PageSourceSearch

https://erne.dev/_next/static/chunks/a594e130d48aa352.js

js erne.dev collected 2026-10-05 06:32:23 UTC 429,443 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29228,e=>{"use strict";e.s(["ThemeProvider",()=>u,"useTheme",()=>l]);var t=e.i(55118),n=(e,t,n,r,i,s,o,a)=>{let l=document.documentElement,u=["light","dark"];function c(t){var n;(Array.isArray(e)?e:[e]).forEach(e=>{let n="class"===e,r=n&&s?i.map(e=>s[e]||e):i;n?(l.classList.remove(...r),l.classList.add(s&&s[t]?s[t]:t)):l.setAttribute(e,t)}),n=t,a&&u.includes(n)&&(l.style.colorScheme=n)}if(r)c(r);else try{let e=localStorage.getItem(t)||n,r=o&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(r)}catch(e){}},r=["light","dark"],i="(prefers-color-scheme: dark)",s="undefined"==typeof window,o=t.createContext(void 0),a={setTheme:e=>{},themes:[]},l=()=>{var e;return null!=(e=t.useContext(o))?e:a},u=e=>t.useContext(o)?t.createElement(t.Fragment,null,e.children):t.createElement(d,{...e}),c=["light","dark"],d=e=>{let{forcedTheme:n,disableTransitionOnChange:s=!1,enableSystem:a=!0,enableColorScheme:l=!0,storageKey:u="theme",themes:d=c,defaultTheme:v=a?"system":"light",attribute:m="data-theme",value:_,children:y,nonce:b,scriptProps:x}=e,[E,w]=t.useState(()=>h(u,v)),[S,R]=t.useState(()=>"system"===E?g():E),k=_?Object.values(_):d,C=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&a&&(t=g());let n=_?_[t]:t,i=s?p(b):null,o=document.documentElement,u=e=>{"class"===e?(o.classList.remove(...k),n&&o.classList.add(n)):e.startsWith("data-")&&(n?o.setAttribute(e,n):o.removeAttribute(e))};if(Array.isArray(m)?m.forEach(u):u(m),l){let e=r.includes(v)?v:null,n=r.includes(t)?t:e;o.style.colorScheme=n}null==i||i()},[b]),T=t.useCallback(e=>{let t="function"==typeof e?e(E):e;w(t);try{localStorage.setItem(u,t)}catch(e){}},[E]),O=t.useCallback(e=>{R(g(e)),"system"===E&&a&&!n&&C("system")},[E,n]);t.useEffect(()=>{let e=window.matchMedia(i);return e.addListener(O),O(e),()=>e.removeListener(O)},[O]),t.useEffect(()=>{let e=e=>{e.key===u&&(e.newValue?w(e.newValue):T(v))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[T]),t.useEffect(()=>{C(null!=n?n:E)},[n,E]);let I=t.useMemo(()=>({theme:E,setTheme:T,forcedTheme:n,resolvedTheme:"system"===E?S:E,themes:a?[...d,"system"]:d,systemTheme:a?S:void 0}),[E,T,n,S,a,d]);return t.createElement(o.Provider,{value:I},t.createElement(f,{forcedTheme:n,storageKey:u,attribute:m,enableSystem:a,enableColorScheme:l,defaultTheme:v,value:_,themes:d,nonce:b,scriptProps:x}),y)},f=t.memo(e=>{let{forcedTheme:r,storageKey:i,attribute:s,enableSystem:o,enableColorScheme:a,defaultTheme:l,value:u,themes:c,nonce:d,scriptProps:f}=e,h=JSON.stringify([s,i,l,r,c,u,o,a]).slice(1,-1);return t.createElement("script",{...f,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?d:"",dangerouslySetInnerHTML:{__html:"(".concat(n.toString(),")(").concat(h,")")}})}),h=(e,t)=>{let n;if(!s){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},p=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},g=e=>(e||(e=window.matchMedia(i)),e.matches?"dark":"light")},9101,e=>{"use strict";e.s(["ThemeProvider",()=>r]);var t=e.i(46882),n=e.i(29228);function r(e){let{children:r}=e;return(0,t.jsx)(n.ThemeProvider,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:r})}},87497,(e,t,n)=>{"use strict";var r=e.r(55118),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,o=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=s({inst:{value:n,getSnapshot:t}}),i=r[0].inst,c=r[1];return a(function(){i.value=n,i.getSnapshot=t,u(i)&&c({inst:i})},[e,n,t]),o(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),l(n),n};n.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},48380,(e,t,n)=>{"use strict";
1t.exports=e.r(87497)},93015,(e,t,n)=>{"use strict";var r=e.r(55118),i=e.r(48380),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=i.useSyncExternalStore,a=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;n.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var h=o(e,(d=u(function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&f.hasValue){var t=f.value;if(i(t,e))return a=t}return a=e}if(t=a,s(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(o=e,t):(o=e,a=n)}var o,a,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,n,r,i]))[0],d[1]);return l(function(){f.hasValue=!0,f.value=h},[h]),c(h),h}},56104,(e,t,n)=>{"use strict";t.exports=e.r(93015)},75419,54501,37729,22923,99248,76154,67871,31891,7680,32621,73391,59832,17538,37462,90531,45305,79118,19383,64270,50445,52868,98455,81470,19371,63910,25542,8017,36953,24153,78021,96865,78239,4e3,37072,2970,25986,12320,1232,45886,24981,57336,32137,96857,4889,e=>{"use strict";let t;e.s(["BookOpen",()=>r],75419);var n=e.i(49793);let r=(0,n.default)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);e.s(["Package",()=>i],54501);let i=(0,n.default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["CommonPopupDataAttributes",()=>o,"popupStateMapping",()=>g,"pressableTriggerOpenStateMapping",()=>p,"triggerOpenStateMapping",()=>h],37729);var s=e.i(64253);let o=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=s.TransitionStatusDataAttributes.startingStyle]="startingStyle",e[e.endingStyle=s.TransitionStatusDataAttributes.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e}({}),a=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({}),l={[a.popupOpen]:""},u={[a.popupOpen]:"",[a.pressed]:""},c={[o.open]:""},d={[o.closed]:""},f={[o.anchorHidden]:""},h={open:e=>e?l:null},p={open:e=>e?u:null},g={open:e=>e?c:d,anchorHidden:e=>e?f:null};e.s(["isAndroid",()=>w,"isIOS",()=>x,"isJSDOM",()=>R,"isMac",()=>S,"isSafari",()=>E,"isWebKit",()=>b],22923);let v="undefined"!=typeof navigator,m=function(){var e,t;if(!v)return{platform:"",maxTouchPoints:-1};let n=navigator.userAgentData;return(null==n?void 0:n.platform)?{platform:n.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:null!=(e=navigator.platform)?e:"",maxTouchPoints:null!=(t=navigator.maxTouchPoints)?t:-1}}(),_=function(){var e;if(!v)return"";let t=navigator.userAgentData;return(null==t?void 0:t.platform)?t.platform:null!=(e=navigator.platform)?e:""}(),y=function(){if(!v)return"";let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return"".concat(t,"/").concat(n)}).join(" "):navigator.userAgent}(),b="undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter:none"),x="MacIntel"===m.platform&&m.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(m.platform);v&&/firefox/i.test(y);let E=v&&/apple/i.test(navigator.vendor);v&&/Edg/i.test(y);let w=v&&/android/i.test(_)||/android/i.test(y),S=v&&_.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,R=y.includes("jsdom/");e.s(["FloatingFocusManager",()=>tJ],81470);var k=e.i(55118),C=e.i(15385);function T(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function O(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return()=>{for(let e=0;e<t.length;e+=1){let n=t[e];n&&n()}}}e.s(["addEventListener",()=>T],99248),e.s(["mergeCleanups",()=>O],76154);var I=e.i(42351);e.s(["useValueAsRef",()=>M],67871);var P=e.i(64999),A=e.i(88516);function M(e){let t=(0,A.useRefWithInit)(N,e).current;return t.next=e,(0,P.useIsoLayoutEffect)(t.effect),t}function N(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var F=e.i(55838),L=e.i(37387),D=e.i(64135),j=e.i(34832);e.s(["ownerWindow",()=>
1$.getWindow],31891);var $=C;e.s(["FocusGuard",()=>V],7680),e.i(19940);let W={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},H={...W,position:"fixed",top:0,left:0};({...W,position:"absolute"});var B=e.i(46882);let V=k.forwardRef(function(e,t){let[n,r]=k.useState();return(0,P.useIsoLayoutEffect)(()=>{E&&r("button")},[]),(0,B.jsx)("span",{...e,ref:t,style:H,"aria-hidden":!n||void 0,tabIndex:0,role:n,"data-base-ui-focus-guard":""})});var U=e.i(28458);e.s(["getFloatingFocusElement",()=>eo,"isEventTargetWithin",()=>ee,"isInteractiveElement",()=>er,"isRootElement",()=>et,"isTargetInsideEnabledTrigger",()=>Q,"isTypeableCombobox",()=>ei,"isTypeableElement",()=>en,"matchesFocusVisible",()=>es],73391),e.s(["ACTIVE_KEY",()=>q,"ARROW_DOWN",()=>Z,"ARROW_LEFT",()=>X,"ARROW_RIGHT",()=>K,"ARROW_UP",()=>J,"FOCUSABLE_ATTRIBUTE",()=>z,"SELECTED_KEY",()=>G,"TYPEABLE_SELECTOR",()=>Y],32621);let z="data-base-ui-focusable",q="active",G="selected",Y="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",X="ArrowLeft",K="ArrowRight",J="ArrowUp",Z="ArrowDown";function Q(e,t){if(!(0,C.isElement)(e))return!1;if(t.hasElement(e))return!e.hasAttribute("data-trigger-disabled");for(let[,n]of t.entries())if((0,U.contains)(n,e))return!n.hasAttribute("data-trigger-disabled");return!1}function ee(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function et(e){return e.matches("html,body")}function en(e){return(0,C.isHTMLElement)(e)&&e.matches(Y)}function er(e){return(null==e?void 0:e.closest('button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),'.concat(Y)))!=null}function ei(e){return!!e&&"combobox"===e.getAttribute("role")&&en(e)}function es(e){if(!e||R)return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}function eo(e){return e?e.hasAttribute(z)?e:e.querySelector("[".concat(z,"]"))||e:null}function ea(e){e.preventDefault(),e.stopPropagation()}function el(e){return"nativeEvent"in e}function eu(e){return""===e.pointerType&&!!e.isTrusted||(w&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function ec(e){return!R&&(!w&&0===e.width&&0===e.height||w&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function ed(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function ef(e){let t=e.type;return"click"===t||"mousedown"===t||"keydown"===t||"keyup"===t}e.s(["isClickLikeEvent",()=>ef,"isMouseLikePointerType",()=>ed,"isReactEvent",()=>el,"isVirtualClick",()=>eu,"isVirtualPointerEvent",()=>ec,"stopEvent",()=>ea],59832),e.s(["disableFocusInside",()=>tr,"enableFocusInside",()=>ti,"focusable",()=>e3,"getNextTabbable",()=>e6,"getPreviousTabbable",()=>e9,"getTabbableAfterElement",()=>te,"getTabbableBeforeElement",()=>tt,"isOutsideEvent",()=>tn,"isTabbable",()=>e5,"tabbable",()=>e4],90531),e.s(["createGridCellMap",()=>eq,"findNonDisabledListIndex",()=>eU,"getGridCellIndexOfCorner",()=>eG,"getGridCellIndices",()=>eY,"getGridNavigatedIndex",()=>ez,"getMaxListIndex",()=>eV,"getMinListIndex",()=>eB,"isElementVisible",()=>eK,"isIndexOutOfListBounds",()=>eH,"isListIndexDisabled",()=>eX],37462),e.s(["clamp",()=>ex,"createCoords",()=>ey,"evaluate",()=>eE,"floor",()=>e_,"getAlignment",()=>eS,"getAlignmentAxis",()=>eT,"getAlignmentSides",()=>eO,"getAxisLength",()=>ek,"getExpandedPlacements",()=>eI,"getOppositeAlignmentPlacement",()=>eP,"getOppositeAxis",()=>eR,"getOppositeAxisPlacements",()=>eL,"getOppositePlacement",()=>eD,"getPaddingObject",()=>ej,"getSide",()=>ew,"getSideAxis",()=>eC,"max",()=>ev,"min",()=>eg,"placements",()=>ep,"rectToClientRect",()=>e$,"round",()=>em,"sides",()=>eh],17538);let eh=["top","right","bottom","left"],ep=eh.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]),eg=Math.min,ev=Math.max,em=Math.round,e_=Math.floor,ey=e=>({x:e,y:e}
1),eb={left:"right",right:"left",bottom:"top",top:"bottom"};function ex(e,t,n){return ev(e,eg(t,n))}function eE(e,t){return"function"==typeof e?e(t):e}function ew(e){return e.split("-")[0]}function eS(e){return e.split("-")[1]}function eR(e){return"x"===e?"y":"x"}function ek(e){return"y"===e?"height":"width"}function eC(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function eT(e){return eR(eC(e))}function eO(e,t,n){void 0===n&&(n=!1);let r=eS(e),i=eT(e),s=ek(i),o="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=eD(o)),[o,eD(o)]}function eI(e){let t=eD(e);return[eP(e),t,eP(t)]}function eP(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let eA=["left","right"],eM=["right","left"],eN=["top","bottom"],eF=["bottom","top"];function eL(e,t,n,r){let i=eS(e),s=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?eM:eA;return t?eA:eM;case"left":case"right":return t?eN:eF;default:return[]}}(ew(e),"start"===n,r);return i&&(s=s.map(e=>e+"-"+i),t&&(s=s.concat(s.map(eP)))),s}function eD(e){let t=ew(e);return eb[t]+e.slice(t.length)}function ej(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function e$(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function eW(e,t,n){return Math.floor(e/t)!==n}function eH(e,t){return t<0||t>=e.length}function eB(e,t){return eU(e.current,{disabledIndices:t})}function eV(e,t){return eU(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function eU(e){let{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=t;do s+=n?-i:i;while(s>=0&&s<=e.length-1&&eX(e,s,r))return s}function ez(e,t){let n,{event:r,orientation:i,loopFocus:s,onLoop:o,rtl:a,cols:l,disabledIndices:u,minIndex:c,maxIndex:d,prevIndex:f,stopEvent:h=!1}=t,p=f;if(r.key===J?n="up":r.key===Z&&(n="down"),n){var g;let t=[],i=[],a=!1,v=0;{let n=null,r=-1;e.forEach((e,s)=>{if(null==e)return;v+=1;let o=e.closest('[role="row"]');o&&(a=!0),(o!==n||-1===r)&&(n=o,t[r+=1]=[]),t[r].push(s),i[s]=r})}let m=!1,_=0;if(a)for(let e of t){let t=e.length;t>_&&(_=t),t!==l&&(m=!0)}let y=m&&v<e.length,b=_||l;h&&ea(r);let x=null!=(g=(n=>{if(!m||-1===f)return;let a=i[f];if(null==a)return;let l=t[a].indexOf(f),c="up"===n?-1:1;for(let n=a+c,p=0;p<t.length;p+=1,n+=c){if(n<0||n>=t.length){if(!s||y)return;if(n=n<0?t.length-1:0,o){var d,h;let e=Math.min(l,t[n].length-1);n=null!=(h=i[o(r,f,null!=(d=t[n][e])?d:t[n][0])])?h:n}}let a=t[n];for(let t=Math.min(l,a.length-1);t>=0;t-=1){let n=a[t];if(!eX(e,n,u))return n}}})(n))?g:(t=>{if(!y||-1===f)return;let n=f%b,r="up"===t?-b:b,i=d-d%b,o=e_(d/b)+1;for(let t=f-n+r,a=0;a<o;a+=1,t+=r){if(t<0||t>d){if(!s)return;t=t<0?i:0}let r=Math.min(t+b-1,d);for(let i=Math.min(t+n,r);i>=t;i-=1)if(!eX(e,i,u))return i}})(n);if(void 0!==x)p=x;else if(-1===f)p="up"===n?d:c;else if(p=eU(e,{startingIndex:f,amount:b,decrement:"up"===n,disabledIndices:u}),s){if("up"===n&&(f-b<c||p<0)){let e=f%b,t=d%b,n=d-(t-e);p=t===e?d:t>e?n:n-b,o&&(p=o(r,f,p))}"down"===n&&f+b>d&&(p=eU(e,{startingIndex:f%b-b,amount:b,disabledIndices:u}),o&&(p=o(r,f,p)))}eH(e,p)&&(p=f)}if("both"===i){let t=e_(f/l);r.key===(a?X:K)&&(h&&ea(r),f%l!=l-1?(p=eU(e,{startingIndex:f,disabledIndices:u}),s&&eW(p,l,t)&&(p=eU(e,{startingIndex:f-f%l-1,disabledIndices:u}),o&&(p=o(r,f,p)))):s&&(p=eU(e,{startingIndex:f-f%l-1,disabledIndices:u}),o&&(p=o(r,f,p))),eW(p,l,t)&&(p=f)),r.key===(a?K:X)&&(h&&ea(r),f%l!=0?(p=eU(e,{startingIndex:f,decrement:!0,disabledIndices:u}),s&&eW(p,l,t)&&(p=eU(e,{startingIndex:f+(l-f%l),decrement:!0,disabledIndices:u}),o&&(p=o(r,f,p)))):s&&(p=eU(e,{startingIndex:f+(l-f%l),decrement:!0,disabledIndices:u}),o&&(p=o(r,f,p))),eW(p,l,t)&&(p=f));let n=e_(d/l)===t;eH(e,p)&&(s&&n?(p=r.key===(a?K:X)?d:eU(e,{startingIndex:f-f%l-1,disabledIndices:u}),o&&(p=o(r,f,p))):p=f)}return p}function eq(e,t,n){let r=[],i=0;return e.forEach((e,s)=>{let{width:o,height:a}=e,l=!1;for(n&&(i=0);!l;){let e=[];for(let n=0;n<o;n+=1)for(let r=0;r<a;r+=1)e.push(i+n+r*t);i%t+o<=t&&e.every(e=>
1null==r[e])?(e.forEach(e=>{r[e]=s}),l=!0):i+=1}}),[...r]}function eG(e,t,n,r,i){if(-1===e)return -1;let s=n.indexOf(e),o=t[e];switch(i){case"tl":return s;case"tr":if(!o)return s;return s+o.width-1;case"bl":if(!o)return s;return s+(o.height-1)*r;case"br":return n.lastIndexOf(e);default:return -1}}function eY(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function eX(e,t,n){var r;if("function"==typeof n?n(t):null!=(r=null==n?void 0:n.includes(t))&&r)return!0;let i=e[t];return!!i&&(!eK(i)||!n&&(i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled")))}function eK(e){return"function"==typeof e.checkVisibility?e.checkVisibility():"none"!==(0,C.getComputedStyle)(e).display}function eJ(e){for(let t of Array.from(e.children))if("summary"===(0,C.getNodeName)(t))return t;return null}function eZ(e){let t=e?(0,C.getNodeName)(e):"";return null!=e&&e.matches('a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]')&&("summary"!==t||null!=e.parentElement&&"details"===(0,C.getNodeName)(e.parentElement)&&eJ(e.parentElement)===e)&&("details"!==t||null==eJ(e))&&("input"!==t||"hidden"!==e.type)}function eQ(e){if(!eZ(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=function(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return(0,C.isShadowRoot)(n)?n.host:null}(t)){let n="slot"===(0,C.getNodeName)(t);if(t.hasAttribute("inert")||t!==e&&"details"===(0,C.getNodeName)(t)&&!t.open&&!function(e,t){let n=eJ(t);return!!n&&(e===n||(0,U.contains)(n,e))}(e,t)||t.hasAttribute("hidden")||!n&&!eK(t))return!1}return!0}function e0(e){let t=e.tabIndex;if(t<0){let t=(0,C.getNodeName)(e);if("details"===t||"audio"===t||"video"===t||(0,C.isHTMLElement)(e)&&e.isContentEditable)return 0}return t}function e1(e){return"input"!==(0,C.getNodeName)(e)?null:"radio"===e.type&&""!==e.name?e:null}function e2(e){if((0,C.isHTMLElement)(e)&&"slot"===(0,C.getNodeName)(e)){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return(0,C.isHTMLElement)(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function e5(e){return eQ(e)&&e0(e)>=0}function e3(e){let t=[];return!function e(t,n){e2(t).forEach(t=>{eZ(t)&&n.push(t),e(t,n)})}(e,t),t.filter(eQ)}function e4(e){let t=e3(e);return t.filter(e=>e0(e)>=0&&function(e,t){let n=e1(e);if(!n)return!0;let r=t.find(e=>{let t=e1(e);return(null==t?void 0:t.name)===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=e1(e);return(null==t?void 0:t.name)===n.name&&t.form===n.form})===n}(e,t))}function e8(e,t){let n=e4(e),r=n.length;if(0===r)return;let i=(0,U.activeElement)((0,j.ownerDocument)(e)),s=n.indexOf(i);return n[-1===s?1===t?0:r-1:s+t]}function e6(e){return e8((0,j.ownerDocument)(e).body,1)||e}function e9(e){return e8((0,j.ownerDocument)(e).body,-1)||e}function e7(e,t){if(!e)return null;let n=e4((0,j.ownerDocument)(e).body),r=n.length;if(0===r)return null;let i=n.indexOf(e);return -1===i?null:n[(i+t+r)%r]}function te(e){return e7(e,1)}function tt(e){return e7(e,-1)}function tn(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!(0,U.contains)(n,r)}function tr(e){e4(e).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function ti(e){let t=[];!function e(t,n,r){e2(t).forEach(t=>{(0,C.isHTMLElement)(t)&&t.matches(n)&&r.push(t),e(t,n,r)})}(e,"[data-tabindex]",t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}function ts(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return e.filter(e=>e.parentId===t).flatMap(t=>{var r;return[...!n||(null==(r=t.context)?void 0:r.open)?[t]:[],...ts(e,t.id,n)]})}function to(e,t){var n;let r=[],i=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;i;){let t=e.find(e=>e.id===i);i=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}e.s(["getNodeAncestors",()=>to,"getNodeChildren",()=>ts],45305);var ta=e.i(42415),tl=e.i(85870);function tu(e){return"data-base-ui-".concat(e)}e.s(["createAttribute",()=>tu],79118),e.s(["enqueueFocus",()=>tf],19383);var tc=e.i(66532);let td=0;function tf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(td);let s=()=>null==e?void 0:e.focus({preventScroll:n});if(i)return s(),tc.NOOP;let o=requestAnimationFrame(s);return td=o,()=>{td===o&&(cancelAnimationFrame(o),td=0)}}let th={inert:new WeakMap,"aria-hidden":new WeakMap},tp="data-base-ui-inert",tg={inert:new WeakSet,"aria-hidden":new WeakSet},tv=new WeakMap,tm=0,t_=(e,t)=>
1t.map(t=>{if(e.contains(t))return t;let n=function e(t){return t?(0,C.isShadowRoot)(t)?t.host:e(t.parentNode):null}(t);return e.contains(n)?n:null}).filter(e=>null!=e),ty=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},tb=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{"script"!==(0,C.getNodeName)(e)&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function tx(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:s=[]}=t,o=(0,j.ownerDocument)(e[0]).body;return function(e,t,n,r,i){let{mark:s=!0,markerIgnoreElements:o=[]}=i,a=r?"inert":n?"aria-hidden":null,l=null,u=null,c=t_(t,e),d=new Set(s?t_(t,o):[]),f=s?tb(t,ty(c),new Set(c)).filter(e=>!d.has(e)):[],h=[],p=[];if(a){let e=th[a],n=tg[a];u=n,l=e;let r=t_(t,Array.from(t.querySelectorAll("[aria-live]"))),i=c.concat(r);tb(t,ty(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=null!==r&&"false"!==r,s=(e.get(t)||0)+1;e.set(t,s),h.push(t),1===s&&i&&n.add(t),i||t.setAttribute(a,"inert"===a?"":"true")})}return s&&f.forEach(e=>{let t=(tv.get(e)||0)+1;tv.set(e,t),p.push(e),1===t&&e.setAttribute(tp,"")}),tm+=1,()=>{l&&h.forEach(e=>{let t=(l.get(e)||0)-1;l.set(e,t),t||((null==u?void 0:u.has(e))||!a||e.removeAttribute(a),null==u||u.delete(e))}),s&&p.forEach(e=>{let t=(tv.get(e)||0)-1;tv.set(e,t),t||e.removeAttribute(tp)}),(tm-=1)||(th.inert=new WeakMap,th["aria-hidden"]=new WeakMap,tg.inert=new WeakSet,tg["aria-hidden"]=new WeakSet,tv=new WeakMap)}}(e,o,n,r,{mark:i,markerIgnoreElements:s})}e.s(["FloatingPortal",()=>tF,"usePortalContext",()=>tM],50445);var tE=e.i(21890),tw=e.i(38593),tS=e.i(94146);e.s(["CLICK_TRIGGER_IDENTIFIER",()=>tT,"DISABLED_TRANSITIONS_STYLE",()=>tC,"DROPDOWN_COLLISION_AVOIDANCE",()=>tO,"PATIENT_CLICK_THRESHOLD",()=>tk,"POPUP_COLLISION_AVOIDANCE",()=>tI,"TYPEAHEAD_RESET_MS",()=>tR,"ownerVisuallyHidden",()=>tP],64270);let tR=500,tk=500,tC={style:{transition:"none"}},tT="data-base-ui-click-trigger",tO={fallbackAxisSide:"none"},tI={fallbackAxisSide:"end"},tP={clipPath:"inset(50%)",position:"fixed",top:0,left:0},tA=k.createContext(null),tM=()=>k.useContext(tA),tN=tu("portal"),tF=k.forwardRef(function(e,t){let{children:n,container:r,className:i,render:s,renderGuards:o,style:a,...l}=e,{portalNode:u,portalSubtree:c}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{ref:t,container:n,componentProps:r=tc.EMPTY_OBJECT,elementProps:i}=e,s=(0,tw.useId)(),o=tM(),a=null==o?void 0:o.portalNode,[l,u]=k.useState(null),[c,d]=k.useState(null),f=(0,F.useStableCallback)(e=>{null!==e&&d(e)}),h=k.useRef(null);(0,P.useIsoLayoutEffect)(()=>{var e,t;if(null===n){h.current&&(h.current=null,d(null),u(null));return}if(null==s)return;let r=null!=(t=null!=(e=n&&((0,C.isNode)(n)?n:n.current))?e:a)?t:document.body;if(null==r){h.current&&(h.current=null,d(null),u(null));return}h.current!==r&&(h.current=r,d(null),u(r))},[n,a,s]);let p=(0,tS.useRenderElement)("div",r,{ref:[t,f],props:[{id:s,[tN]:""},i]});return{portalNode:c,portalSubtree:l&&p?tE.createPortal(p,l):null}}({container:r,ref:t,componentProps:e,elementProps:l}),d=k.useRef(null),f=k.useRef(null),h=k.useRef(null),p=k.useRef(null),[g,v]=k.useState(null),m=k.useRef(!1),_=null==g?void 0:g.modal,y=null==g?void 0:g.open,b="boolean"==typeof o?o:!!g&&!g.modal&&g.open&&!!u;k.useEffect(()=>{if(u&&!_)return O(T(u,"focusin",e,!0),T(u,"focusout",e,!0));function e(e){u&&e.relatedTarget&&tn(e)&&("focusin"===e.type?m.current&&(ti(u),m.current=!1):(tr(u),m.current=!0))}},[u,_]),k.useEffect(()=>{u&&!1===y&&(ti(u),m.current=!1)},[y,u]);let x=k.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:h,afterInsideRef:p,portalNode:u,setFocusManagerState:v}),[u]);return(0,B.jsxs)(k.Fragment,{children:[c,(0,B.jsxs)(tA.Provider,{value:x,children:[b&&u&&(0,B.jsx)(V,{"data-type":"outside",ref:d,onFocus:e=>{if(tn(e,u)){var t;null==(t=h.current)||t.focus()}else{let e=e9(g?g.domReference:null);null==e||e.focus()}}}),b&&u&&(0,B.jsx)("span",{"aria-owns":u.id,style:tP}),u&&tE.createPortal(n,u),b&&u&&(0,B.jsx)(V,{"data-type":"outside",ref:f,onFocus:e=>{if(tn(e,u)){var t;
1null==(t=p.current)||t.focus()}else{let t=e6(g?g.domReference:null);null==t||t.focus(),(null==g?void 0:g.closeOnFocusOut)&&(null==g||g.onOpenChange(!1,(0,ta.createChangeEventDetails)(tl.REASONS.focusOut,e.nativeEvent)))}}})]})]})});e.s(["FloatingNode",()=>tU,"FloatingTree",()=>tz,"useFloatingNodeId",()=>tV,"useFloatingParentNodeId",()=>tH,"useFloatingTree",()=>tB],98455),e.s(["FloatingTreeStore",()=>tj],52868);var tL=e.i(12503);function tD(){let e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}class tj{addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);-1!==t&&this.nodesRef.current.splice(t,1)}constructor(){(0,tL._)(this,"nodesRef",{current:[]}),(0,tL._)(this,"events",tD())}}let t$=k.createContext(null),tW=k.createContext(null),tH=()=>{var e;return(null==(e=k.useContext(t$))?void 0:e.id)||null},tB=e=>{let t=k.useContext(tW);return null!=e?e:t};function tV(e){let t=(0,tw.useId)(),n=tB(e),r=tH();return(0,P.useIsoLayoutEffect)(()=>{if(!t)return;let e={id:t,parentId:r};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}},[n,t,r]),t}function tU(e){let{children:t,id:n}=e,r=tH();return(0,B.jsx)(t$.Provider,{value:k.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function tz(e){let{children:t,externalTree:n}=e,r=(0,A.useRefWithInit)(()=>null!=n?n:new tj).current;return(0,B.jsx)(tW.Provider,{value:r,children:t})}var tq=e.i(64812);let tG=[];function tY(){tG=tG.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function tX(){var e;return tY(),null==(e=tG[tG.length-1])?void 0:e.deref()}function tK(e,t){var n;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!t.current.includes("floating")&&!(null==(n=e.getAttribute("role"))?void 0:n.includes("dialog")))return;let r=e3(e).filter(e=>{let t=e.getAttribute("data-tabindex")||"";return e5(e)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||0===r.length?"0"!==i&&e.setAttribute("tabindex","0"):("-1"!==i||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}
1function tJ(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:s=!0,restoreFocus:o=!1,modal:a=!0,closeOnFocusOut:l=!0,openInteractionType:u="",nextFocusableElement:c,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:h,getInsideElements:p}=e,g="rootStore"in t?t.rootStore:t,v=g.useState("open"),m=g.useState("domReferenceElement"),_=g.useState("floatingElement"),{events:y,dataRef:x}=g.context,E=(0,F.useStableCallback)(()=>{var e;return null==(e=x.current.floatingContext)?void 0:e.nodeId}),w=!1===i,S=ei(m)&&w,R=k.useRef(["content"]),A=M(i),N=M(s),W=M(u),H=tB(h),z=tM(),q=k.useRef(!1),G=k.useRef(!1),Y=k.useRef(!1),X=k.useRef(null),K=k.useRef(""),J=k.useRef(""),Z=k.useRef(null),Q=k.useRef(null),ee=(0,I.useMergedRefs)(Z,f,null==z?void 0:z.beforeInsideRef),et=(0,I.useMergedRefs)(Q,null==z?void 0:z.afterInsideRef),er=(0,L.useTimeout)(),es=(0,L.useTimeout)(),el=(0,D.useAnimationFrame)(),ed=null!=z,ef=eo(_),eh=(0,F.useStableCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ef;return e?e4(e):[]}),ep=(0,F.useStableCallback)(()=>{var e;return null!=(e=null==p?void 0:p().filter(e=>null!=e))?e:[]});k.useEffect(()=>{if(!r&&a)return T((0,j.ownerDocument)(ef),"keydown",function(e){"Tab"===e.key&&(0,U.contains)(ef,(0,U.activeElement)((0,j.ownerDocument)(ef)))&&0===eh().length&&!S&&ea(e)})},[r,m,ef,a,R,S,eh]),k.useEffect(()=>{if(r||!v)return;let e=(0,j.ownerDocument)(ef);function t(){Y.current=!1}return O(T(e,"pointerdown",function(e){let t=(0,U.getTarget)(e),n=ep();Y.current=!((0,U.contains)(_,t)||(0,U.contains)(m,t)||(0,U.contains)(null==z?void 0:z.portalNode,t)||n.some(e=>e===t||(0,U.contains)(e,t))),J.current=e.pointerType||"keyboard",(null==t?void 0:t.closest("[".concat(tT,"]")))&&(G.current=!0)},!0),T(e,"pointerup",t,!0),T(e,"pointercancel",t,!0),T(e,"keydown",function(){J.current="keyboard"},!0))},[r,_,m,ef,v,z,ep]),k.useEffect(()=>{if(r||!l)return;let e=(0,j.ownerDocument)(ef);function t(t){let n=t.relatedTarget,r=t.currentTarget,i=(0,U.getTarget)(t);queueMicrotask(()=>{let s=E(),l=g.context.triggerElements,u=ep(),f=(null==n?void 0:n.hasAttribute(tu("focus-guard")))&&[Z.current,Q.current,null==z?void 0:z.beforeInsideRef.current,null==z?void 0:z.afterInsideRef.current,null==z?void 0:z.beforeOutsideRef.current,null==z?void 0:z.afterOutsideRef.current,(0,tq.resolveRef)(d),(0,tq.resolveRef)(c)].includes(n),h=!((0,U.contains)(m,n)||(0,U.contains)(_,n)||(0,U.contains)(n,_)||(0,U.contains)(null==z?void 0:z.portalNode,n)||u.some(e=>e===n||(0,U.contains)(e,n))||null!=n&&l.hasElement(n)||l.hasMatchingElement(e=>(0,U.contains)(e,n))||f||H&&(ts(H.nodesRef.current,s).find(e=>{var t,r;return(0,U.contains)(null==(t=e.context)?void 0:t.elements.floating,n)||(0,U.contains)(null==(r=e.context)?void 0:r.elements.domReference,n)})||to(H.nodesRef.current,s).find(e=>{var t,r,i;return[null==(t=e.context)?void 0:t.elements.floating,eo(null==(r=e.context)?void 0:r.elements.floating)].includes(n)||(null==(i=e.context)?void 0:i.elements.domReference)===n})));if(r===m&&ef&&tK(ef,R),o&&r!==m&&!(i&&i.isConnected&&("function"==typeof i.checkVisibility?i.checkVisibility():eK(i)))&&(0,U.activeElement)(e)===e.body){if((0,C.isHTMLElement)(ef)&&(ef.focus(),"popup"===o))return void el.request(()=>{ef.focus()});let e=eh(),t=X.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||ef;(0,C.isHTMLElement)(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(S||!a)&&n&&h&&!G.current&&(S||n!==tX())&&(q.current=!0,g.setOpen(!1,(0,ta.createChangeEventDetails)(tl.REASONS.focusOut,t)))})}let n=(0,C.isHTMLElement)(m)?m:null;if(_||n)return O(n&&T(n,"focusout",t),n&&T(n,"pointerdown",function(){G.current=!0,es.start(0,()=>{G.current=!1})}),_&&T(_,"focusin",function(e){let t=(0,U.getTarget)(e);e5(t)&&(X.current=t)}),_&&T(_,"focusout",t),_&&z&&T(_,"focusout",function(){Y.current||(x.current.insideReactTree=!0,er.start(0,()=>{x.current.insideReactTree=!1}))},!0))},[r,m,_,ef,a,H,z,g,l,o,eh,S,E,R,x,er,es,el,c,d,ep]),k.useEffect(()=>{var e,t,n;if(r||!_||!v)return;let i=Array.from((null==z||null==(e=z.portalNode)?void 0:e.querySelectorAll("[".concat(tu("portal"),"]")))||[]),s=null==(n=(H?to(H.nodesRef.current,E()):[]).find(e=>{var t;return ei((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=n.context)?void 0:t.elements.domReference,o=tx([_,...i,Z.current,Q.current,null==z?void 0:z.beforeOutsideRef.current,null==z?void 0:z.afterOutsideRef.current,...ep(),s,(0,tq.resolveRef)(d),(0,tq.resolveRef)(c),S?m:null].filter(e=>null!=e),{ariaHidden:a||S,mark:!1}),l=tx([_,...i].filter(e=>null!=e));return()=>{l(),o()}},[v,r,m,_,a,R,z,S,H,E,c,d,ep]),(0,P.useIsoLayoutEffect)(()=>
1{if(!v||r||!(0,C.isHTMLElement)(ef))return;let e=(0,j.ownerDocument)(ef),t=(0,U.activeElement)(e);queueMicrotask(()=>{let e,n=A.current,r="function"==typeof n?n(W.current||""):n;if(void 0===r||!1===r||(0,U.contains)(ef,t))return;let i=null,s=()=>(null==i&&(i=eh(ef)),i[0]||ef);tf(e=(e=!0===r||null===r?s():(0,tq.resolveRef)(r))||s(),{preventScroll:e===ef})})},[r,v,ef,w,eh,A,W]),(0,P.useIsoLayoutEffect)(()=>{var e;if(r||!ef)return;let t=(0,j.ownerDocument)(ef);function n(e){if(e.open||(K.current=function(e,t){let n=(0,$.getWindow)((0,U.getTarget)(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(0===e.detail?"keyboard":"mouse"):""}(e.nativeEvent,J.current)),e.reason===tl.REASONS.triggerHover&&"mouseleave"===e.nativeEvent.type&&(q.current=!0),e.reason===tl.REASONS.outsidePress)if(e.nested)q.current=!1;else if(eu(e.nativeEvent)||ec(e.nativeEvent))q.current=!1;else{let e=!1;(0,j.ownerDocument)(ef).createElement("div").focus({get preventScroll(){return e=!0,!1}}),e?q.current=!1:q.current=!0}}return e=(0,U.activeElement)(t),tY(),e&&"body"!==(0,C.getNodeName)(e)&&(tG.push(new WeakRef(e)),tG.length>20&&(tG=tG.slice(-20))),y.on("openchange",n),()=>{y.off("openchange",n);let e=(0,U.activeElement)(t),r=ep(),i=(0,U.contains)(_,e)||r.some(t=>t===e||(0,U.contains)(t,e))||H&&ts(H.nodesRef.current,E(),!1).some(t=>{var n;return(0,U.contains)(null==(n=t.context)?void 0:n.elements.floating,e)}),s=N.current,o=function(){let e=N.current,t="function"==typeof e?e(K.current):e;if(void 0===t||!1===t)return null;if(null===t&&(t=!0),"boolean"==typeof t){let e=m||tX();return e&&e.isConnected?e:null}let n=m||tX();return(0,tq.resolveRef)(t)||n||null}();queueMicrotask(()=>{let n=o?e5(o)?o:e4(o)[0]||o:null;s&&!q.current&&(0,C.isHTMLElement)(n)&&("boolean"!=typeof s||n===e||e===t.body||i)&&n.focus({preventScroll:!0}),q.current=!1})}},[r,_,ef,N,x,y,H,m,E,ep]),(0,P.useIsoLayoutEffect)(()=>{if(!b||v||!_)return;let e=(0,U.activeElement)((0,j.ownerDocument)(_));(0,C.isHTMLElement)(e)&&en(e)&&(0,U.contains)(_,e)&&e.blur()},[v,_]),(0,P.useIsoLayoutEffect)(()=>{if(!r&&z)return z.setFocusManagerState({modal:a,closeOnFocusOut:l,open:v,onOpenChange:g.setOpen,domReference:m}),()=>{z.setFocusManagerState(null)}},[r,z,a,v,g,l,m]),(0,P.useIsoLayoutEffect)(()=>{if(!r&&ef)return tK(ef,R),()=>{queueMicrotask(tY)}},[r,ef,R]);let eg=!r&&(!a||!S)&&(ed||a);return(0,B.jsxs)(k.Fragment,{children:[eg&&(0,B.jsx)(V,{"data-type":"inside",ref:ee,onFocus:e=>{if(a){let e=eh();tf(e[e.length-1])}else if(null==z?void 0:z.portalNode)if(q.current=!1,tn(e,z.portalNode)){let e=e6(m);null==e||e.focus()}else{var t;null==(t=(0,tq.resolveRef)(null!=d?d:z.beforeOutsideRef))||t.focus()}}}),n,eg&&(0,B.jsx)(V,{"data-type":"inside",ref:et,onFocus:e=>{if(a)tf(eh()[0]);else if(null==z?void 0:z.portalNode)if(l&&(q.current=!0),tn(e,z.portalNode)){let e=e9(m);null==e||e.focus()}else{var t;null==(t=(0,tq.resolveRef)(null!=c?c:z.afterOutsideRef))||t.focus()}}})]})}e.s(["COMPOSITE_KEYS",()=>t2],19371);let tZ="ArrowUp",tQ="ArrowDown",t0="ArrowLeft",t1="ArrowRight";[...new Set([...new Set([t0,t1]),...new Set([tZ,tQ])])];let t2=new Set([tZ,tQ,t0,t1,"Home","End"]);e.s(["inertValue",()=>t3],63910);var t5=e.i(64025);function t3(e){return(0,t5.isReactVersionAtLeast)(19)?e:e?"true":void 0}e.s(["FloatingRootStore",()=>nu],24153),e.s(["createSelector",()=>t8],25542);var t4=e.i(58931);let t8=function(e,t,n,r,i,s){let o;for(var a=arguments.length,l=Array(a>6?a-6:0),u=6;u<a;u++)l[u-6]=arguments[u];if(l.length>0)throw Error((0,t4.default)(1));if(e&&t&&n&&r&&i&&s)o=(o,a,l,u)=>{let c=e(o,a,l,u),d=t(o,a,l,u),f=n(o,a,l,u);return s(c,d,f,r(o,a,l,u),i(o,a,l,u),a,l,u)};else if(e&&t&&n&&r&&i)o=(s,o,a,l)=>{let u=e(s,o,a,l),c=t(s,o,a,l);return i(u,c,n(s,o,a,l),r(s,o,a,l),o,a,l)};else if(e&&t&&n&&r)o=(i,s,o,a)=>{let l=e(i,s,o,a);return r(l,t(i,s,o,a),n(i,s,o,a),s,o,a)};else if(e&&t&&n)o=(r,i,s,o)=>n(e(r,i,s,o),t(r,i,s,o),i,s,o);else if(e&&t)o=(n,r,i,s)=>t(e(n,r,i,s),r,i,s);else if(e)o=e;else throw Error("Missing arguments");return o};e.s(["ReactStore",()=>na],36953);var t6=e.i(48380),t9=e.i(56104);e.s(["fastComponent",()=>nn,"fastComponentRef",()=>nr,"getInstance",()=>ne,"register",()=>nt],8017);let t7=[];function ne(){return t}function nt(e){t7.push(e)}function nn(e){let n=(n,r)=>{let i,s=(0,A.useRefWithInit)(ni).current;try{for(let e of(t=s,t7))e.before(s);for(let t of(i=e(n,r),t7))t.after(s);s.didInitialize=!0}finally{t=void 0}return i};return n.displayName=e.displayName||e.name,n}function nr(e){return k.forwardRef(nn(e))}function ni(){return{didInitialize:!1}}let ns=(0,t5.isReactVersionAtLeast)(19)?function(e,n,r,i,s){let o,a=t;if(!a){let t=k.useCallback(()=>n(e.getSnapshot(),r,i,s),[e,n,r,i,s]);
1return(0,t6.useSyncExternalStore)(e.subscribe,t,t)}let l=a.syncIndex;return a.syncIndex+=1,a.didInitialize?(o=a.syncHooks[l]).store===e&&o.selector===n&&Object.is(o.a1,r)&&Object.is(o.a2,i)&&Object.is(o.a3,s)||(o.store!==e&&(a.didChangeStore=!0),o.store=e,o.selector=n,o.a1=r,o.a2=i,o.a3=s,o.didChange=!0):(o={store:e,selector:n,a1:r,a2:i,a3:s,value:n(e.getSnapshot(),r,i,s),didChange:!1},a.syncHooks.push(o)),o.value}:function(e,t,n,r,i){return(0,t9.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))};nt({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,t6.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});class no{setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t]))return void this.setState({...this.state,...e})}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return ns(this,e,t,n,r)}constructor(e){(0,tL._)(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),(0,tL._)(this,"getSnapshot",()=>this.state),this.state=e,this.listeners=new Set,this.updateTick=0}}class na extends no{useSyncedValue(e,t){k.useDebugValue(e),(0,P.useIsoLayoutEffect)(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;(0,P.useIsoLayoutEffect)(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);(0,P.useIsoLayoutEffect)(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){k.useDebugValue(e);let n=void 0!==t;(0,P.useIsoLayoutEffect)(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){return(0,this.selectors[e])(this.state,t,n,r)}useState(e,t,n,r){return k.useDebugValue(e),ns(this,this.selectors[e],t,n,r)}useContextCallback(e,t){k.useDebugValue(e);let n=(0,F.useStableCallback)(null!=t?t:tc.NOOP);this.context[e]=n}useStateSetter(e){let t=k.useRef(void 0);return void 0===t.current&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n,r=(n="function"==typeof e?e:this.selectors[e])(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}constructor(e,t={},n){super(e),this.context=t,this.selectors=n}}let nl={open:t8(e=>e.open),transitionStatus:t8(e=>e.transitionStatus),domReferenceElement:t8(e=>e.domReferenceElement),referenceElement:t8(e=>{var t;return null!=(t=e.positionReference)?t:e.referenceElement}),floatingElement:t8(e=>e.floatingElement),floatingId:t8(e=>e.floatingId)};class nu extends na{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...s}=e;super({...s,positionReference:s.referenceElement,domReferenceElement:s.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:tD(),nested:n,triggerElements:i},nl),(0,tL._)(this,"syncOpenEvent",(e,t)=>{(!e||!this.state.open||null!=t&&ef(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)}),(0,tL._)(this,"dispatchOpenChange",(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",n)}),(0,tL._)(this,"setOpen",(e,t)=>{var n,r,i,s;if(this.syncOnly){null==(i=(s=this.context).onOpenChange)||i.call(s,e,t);return}this.dispatchOpenChange(e,t),null==(n=(r=this.context).onOpenChange)||n.call(r,e,t)}),this.syncOnly=t}}e.s(["PopupTriggerMap",()=>nc],78021);
1class nc{add(e,t){let n=this.idMap.get(e);n!==t&&(void 0!==n&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}constructor(){this.elementsSet=new Set,this.idMap=new Map}}e.s(["InternalBackdrop",()=>nd],96865);let nd=k.forwardRef(function(e,t){let n,{cutout:r,...i}=e;if(r){let e=r.getBoundingClientRect();n="polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,".concat(e.left,"px ").concat(e.top,"px,").concat(e.left,"px ").concat(e.bottom,"px,").concat(e.right,"px ").concat(e.bottom,"px,").concat(e.right,"px ").concat(e.top,"px,").concat(e.left,"px ").concat(e.top,"px)")}return(0,B.jsx)("div",{ref:t,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:n}})});e.s(["useScrollLock",()=>nv],78239);var $=C;let nf={},nh={},np="",ng=new class{acquire(e){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(0===this.lockCount||null!==this.restore)return;let t=(0,j.ownerDocument)(e).documentElement,n=(0,$.getWindow)(t).getComputedStyle(t).overflowY;if("hidden"===n||"clip"===n){this.restore=tc.NOOP;return}let r=x||!function(e){if("undefined"==typeof document)return!1;let t=(0,j.ownerDocument)(e);return(0,$.getWindow)(t).innerWidth-t.documentElement.clientWidth>0}(e);this.restore=r?function(e){let t=(0,j.ownerDocument)(e),n=t.documentElement,r=t.body,i=(0,C.isOverflowElement)(n)?n:r,s={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,s)}}(e):function(e){var t,n;let r=(0,j.ownerDocument)(e),i=r.documentElement,s=r.body,o=(0,$.getWindow)(i),a=0,l=0,u=!1,c=D.AnimationFrame.create();if(b&&(null!=(n=null==(t=o.visualViewport)?void 0:t.scale)?n:1)!==1)return()=>{};function d(){let t=o.getComputedStyle(i),n=o.getComputedStyle(s),r=(t.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=i.scrollTop,l=i.scrollLeft,nf={scrollbarGutter:i.style.scrollbarGutter,overflowY:i.style.overflowY,overflowX:i.style.overflowX},np=i.style.scrollBehavior,nh={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};let c=i.scrollHeight>i.clientHeight,d=i.scrollWidth>i.clientWidth,f="scroll"===t.overflowY||"scroll"===n.overflowY,h="scroll"===t.overflowX||"scroll"===n.overflowX,p=Math.max(0,o.innerWidth-s.clientWidth),g=Math.max(0,o.innerHeight-s.clientHeight),v=parseFloat(n.marginTop)+parseFloat(n.marginBottom),m=parseFloat(n.marginLeft)+parseFloat(n.marginRight),_=(0,C.isOverflowElement)(i)?i:s;if(u=function(e){if(!("undefined"!=typeof CSS&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||"undefined"==typeof document)return!1;let t=(0,j.ownerDocument)(e),n=t.documentElement,r=t.body,i=(0,C.isOverflowElement)(n)?n:r,s=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter="stable",i.style.overflowY="scroll";let a=i.offsetWidth;i.style.overflowY="hidden";let l=i.offsetWidth;return i.style.overflowY=s,n.style.scrollbarGutter=o,a===l}(e)){i.style.scrollbarGutter=r,_.style.overflowY="hidden",_.style.overflowX="hidden";return}Object.assign(i.style,{scrollbarGutter:r,overflowY:"hidden",overflowX:"hidden"}),(c||f)&&(i.style.overflowY="scroll"),(d||h)&&(i.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:v||g?"calc(100dvh - ".concat(v+g,"px)"):"100dvh",width:m||p?"calc(100vw - ".concat(m+p,"px)"):"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=a,s.scrollLeft=l,i.setAttribute("data-base-ui-scroll-locked",""),i.style.scrollBehavior="unset"}function f(){Object.assign(i.style,nf),Object.assign(s.style,nh),u||(i.scrollTop=a,i.scrollLeft=l,i.removeAttribute("data-base-ui-scroll-locked"),i.style.scrollBehavior=np)}d();let h=T(o,"resize",function(){f(),c.request(d)});return()=>{c.cancel(),f(),"function"==typeof o.removeEventListener&&h()}}(e)}constructor(){(0,tL._)(this,"lockCount",0),(0,tL._)(this,"restore",null),(0,tL._)(this,"timeoutLock",L.Timeout.create()),(0,tL._)(this,"timeoutUnlock",L.Timeout.create()),(0,tL._)(this,"release",()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)}),(0,tL._)(this,"unlock",()=>{if(0===this.lockCount&&this.restore){var e;null==(e=this.restore)||e.call(this),this.restore=null}})}};function nv(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;(0,P.useIsoLayoutEffect)(()=>
1{if(e)return ng.acquire(t)},[e,t])}function nm(e){let t=k.useRef(!0);t.current&&(t.current=!1,e())}e.s(["useOnFirstRender",()=>nm],4e3),e.s(["useDismiss",()=>nb],37072);let n_={intentional:"onClick",sloppy:"onPointerDown"};function ny(){return!1}function nb(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i="rootStore"in e?e.rootStore:e,s=i.useState("open"),o=i.useState("floatingElement"),{dataRef:a}=i.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:c=!0,outsidePressEvent:d="sloppy",referencePress:f=ny,referencePressEvent:h="sloppy",bubbles:p,externalTree:g}=r,v=tB(g),m=(0,F.useStableCallback)("function"==typeof c?c:()=>!1),_="function"==typeof c?m:c,y=!1!==_,b=(0,F.useStableCallback)(()=>d),x=k.useRef(!1),E=k.useRef(!1),w=k.useRef(!1),{escapeKey:S,outsidePress:R}={escapeKey:"boolean"==typeof p?p:null!=(t=null==p?void 0:p.escapeKey)&&t,outsidePress:"boolean"==typeof p?p:null==(n=null==p?void 0:p.outsidePress)||n},I=k.useRef(null),P=(0,L.useTimeout)(),A=(0,L.useTimeout)(),M=(0,F.useStableCallback)(()=>{A.clear(),a.current.insideReactTree=!1}),N=k.useRef(!1),D=k.useRef(""),$=(0,F.useStableCallback)(f),W=(0,F.useStableCallback)(e=>{var t;if(!s||!l||!u||"Escape"!==e.key||N.current)return;let n=null==(t=a.current.floatingContext)?void 0:t.nodeId,r=v?ts(v.nodesRef.current,n):[];if(!S&&r.length>0){let e=!0;if(r.forEach(t=>{var n;(null==(n=t.context)?void 0:n.open)&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let o=el(e)?e.nativeEvent:e,c=(0,ta.createChangeEventDetails)(tl.REASONS.escapeKey,o);i.setOpen(!1,c),S||c.isPropagationAllowed||e.stopPropagation()}),H=(0,F.useStableCallback)(()=>{a.current.insideReactTree=!0,A.start(0,M)});k.useEffect(()=>{if(!s||!l)return;a.current.__escapeKeyBubbles=S,a.current.__outsidePressBubbles=R;let e=new L.Timeout,t=new L.Timeout;function n(){w.current=!0,t.start(0,()=>{w.current=!1})}function r(){x.current=!1,E.current=!1}function c(){let e=D.current,t=b(),n="function"==typeof t?t():t;return"string"==typeof n?n:n["pen"!==e&&e?e:"mouse"]}function d(e){var t;let n=null==(t=a.current.floatingContext)?void 0:t.nodeId,r=v&&ts(v.nodesRef.current,n).some(t=>{var n;return ee(e,null==(n=t.context)?void 0:n.elements.floating)});return ee(e,i.select("floatingElement"))||ee(e,i.select("domReferenceElement"))||r}function f(e){var n;if(function(e){let t=c();return"intentional"===t&&"click"!==e.type||"sloppy"===t&&"click"===e.type}(e)||a.current.insideReactTree)return void M();let r=(0,U.getTarget)(e),s="[".concat(tu("inert"),"]"),o=(0,C.isElement)(r)?r.getRootNode():null,l=Array.from(((0,C.isShadowRoot)(o)?o:(0,j.ownerDocument)(i.select("floatingElement"))).querySelectorAll(s)),u=i.context.triggerElements;if(r&&(u.hasElement(r)||u.hasMatchingElement(e=>(0,U.contains)(e,r))))return;let f=(0,C.isElement)(r)?r:null;for(;f&&!(0,C.isLastTraversableNode)(f);){let e=(0,C.getParentNode)(f);if((0,C.isLastTraversableNode)(e)||!(0,C.isElement)(e))break;f=e}if(l.length&&(0,C.isElement)(r)&&!et(r)&&!(0,U.contains)(r,i.select("floatingElement"))&&l.every(e=>!(0,U.contains)(f,e)))return;if((0,C.isHTMLElement)(r)&&!("touches"in e)){let t=(0,C.isLastTraversableNode)(r),n=(0,C.getComputedStyle)(r),i=/auto|scroll/,s=t||i.test(n.overflowX),o=t||i.test(n.overflowY),a=s&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,l=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,u="rtl"===n.direction,c=l&&(u?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=a&&e.offsetY>r.clientHeight;if(c||d)return}if(d(e))return;if("intentional"===c()&&w.current){t.clear(),w.current=!1;return}if("function"==typeof _&&!_(e))return;let h=null==(n=a.current.floatingContext)?void 0:n.nodeId,p=v?ts(v.nodesRef.current,h):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;(null==(n=t.context)?void 0:n.open)&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}i.setOpen(!1,(0,ta.createChangeEventDetails)(tl.REASONS.outsidePress,e)),M()}function h(e){if("sloppy"!==c()||!i.select("open")||!l||ee(e,i.select("floatingElement"))||ee(e,i.select("domReferenceElement")))return;let t=e.touches[0];t&&(I.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function p(e,t){let n=(0,U.getTarget)(e);if(!n)return;let r=T(n,e.type,()=>{t(e),r()})}function g(e){P.clear(),"pointerdown"===e.type&&(D.current=e.pointerType),("mousedown"!==e.type||!I.current||I.current.dismissOnMouseDown)&&p(e,e=>{if("pointerdown"===e.type)"sloppy"!==c()||"touch"===e.pointerType||!i.select("open")||!l||ee(e,i.select("floatingElement"))||ee(e,i.select("domReferenceElement"))||f(e);else f(e)})}function m(e){if(!x.current)return;let i=E.current;
1if(r(),"intentional"===c()){if("pointercancel"===e.type){i&&n();return}if(!d(e)){if(i)return void n();("function"!=typeof _||_(e))&&(t.clear(),w.current=!0,M())}}}function k(e){if("sloppy"!==c()||!I.current||ee(e,i.select("floatingElement"))||ee(e,i.select("domReferenceElement")))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-I.current.startX),r=Math.abs(t.clientY-I.current.startY),s=Math.sqrt(n*n+r*r);s>5&&(I.current.dismissOnTouchEnd=!0),s>10&&(f(e),P.clear(),I.current=null)}function A(e){"sloppy"!==c()||!I.current||ee(e,i.select("floatingElement"))||ee(e,i.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&f(e),P.clear(),I.current=null)}let F=(0,j.ownerDocument)(o),$=O(u&&O(T(F,"keydown",W),T(F,"compositionstart",function(){e.clear(),N.current=!0}),T(F,"compositionend",function(){e.start(5*!!(0,C.isWebKit)(),()=>{N.current=!1})})),y&&O(T(F,"click",g,!0),T(F,"pointerdown",g,!0),T(F,"pointerup",m,!0),T(F,"pointercancel",m,!0),T(F,"mousedown",g,!0),T(F,"mouseup",m,!0),T(F,"touchstart",function(e){D.current="touch",p(e,h)},!0),T(F,"touchmove",function(e){p(e,k)},!0),T(F,"touchend",function(e){p(e,A)},!0)));return()=>{$(),e.clear(),t.clear(),r(),w.current=!1}},[a,o,u,y,_,s,l,S,R,W,M,b,v,i,P]),k.useEffect(M,[_,M]);let B=k.useMemo(()=>({onKeyDown:W,[n_[h]]:e=>{$()&&i.setOpen(!1,(0,ta.createChangeEventDetails)(tl.REASONS.triggerPress,e.nativeEvent))},..."intentional"!==h&&{onClick(e){$()&&i.setOpen(!1,(0,ta.createChangeEventDetails)(tl.REASONS.triggerPress,e.nativeEvent))}}}),[W,i,h,$]),V=(0,F.useStableCallback)(e=>{if(!s||!l||0!==e.button)return;let t=(0,U.getTarget)(e.nativeEvent);(0,U.contains)(i.select("floatingElement"),t)&&(x.current||(x.current=!0,E.current=!1))}),z=(0,F.useStableCallback)(e=>{s&&l&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(E.current=!0)}),q=k.useMemo(()=>({onKeyDown:W,onPointerDown:z,onMouseDown:z,onClickCapture:H,onMouseDownCapture(e){H(),V(e)},onPointerDownCapture(e){H(),V(e)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[W,H,V,z]);return k.useMemo(()=>l?{reference:B,floating:q,trigger:B}:{},[l,B,q])}function nx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),i=e.map(e=>null==e?void 0:e.trigger),s=k.useCallback(t=>nE(t,e,"reference"),t),o=k.useCallback(t=>nE(t,e,"floating"),n),a=k.useCallback(t=>nE(t,e,"item"),r),l=k.useCallback(t=>nE(t,e,"trigger"),i);return k.useMemo(()=>({getReferenceProps:s,getFloatingProps:o,getItemProps:a,getTriggerProps:l}),[s,o,a,l])}function nE(e,t,n){let r=new Map,i="item"===n,s={};for(let t in"floating"===n&&(s.tabIndex=-1,s[z]=""),e)i&&e&&(t===q||t===G)||(s[t]=e[t]);for(let a=0;a<t.length;a+=1){var o;let l,u=null==(o=t[a])?void 0:o[n];(l="function"==typeof u?e?u(e):null:u)&&nw(s,l,i,r)}return nw(s,e,i,r),s}function nw(e,t,n,r){for(let s in t){let o=t[s];if(!n||s!==q&&s!==G)if(s.startsWith("on")){if(r.has(s)||r.set(s,[]),"function"==typeof o){var i;null==(i=r.get(s))||i.push(o),e[s]=function(){for(var e,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return null==(e=r.get(s))?void 0:e.map(e=>e(...n)).find(e=>void 0!==e)}}}else e[s]=o}}e.s(["useInteractions",()=>nx],2970),e.s(["useRole",()=>nR],25986);let nS=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function nR(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="rootStore"in e?e.rootStore:e,i=r.useState("open"),s=r.useState("floatingId"),o=r.useState("domReferenceElement"),a=r.useState("floatingElement"),{role:l="dialog"}=n,u=(0,tw.useId)(),c=(null==o?void 0:o.id)||u,d=k.useMemo(()=>{var e;return(null==(e=eo(a))?void 0:e.id)||s},[a,s]),f=null!=(t=nS.get(l))?t:l,h=null!=tH(),p=k.useMemo(()=>"tooltip"===f||"label"===l?tc.EMPTY_OBJECT:{"aria-haspopup":"alertdialog"===f?"dialog":f,"aria-expanded":"false",..."listbox"===f&&{role:"combobox"},..."menu"===f&&h&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}},[f,h,l]),g=k.useMemo(()=>"tooltip"===f||"label"===l?{["aria-".concat("label"===l?"labelledby":"describedby")]:i?d:void 0}:{...p,"aria-expanded":i?"true":"false","aria-controls":i?d:void 0,..."menu"===f&&{id:c}},[f,d,i,c,l,p]),v=k.useMemo(()=>
1{let e={id:d,...f&&{role:f}};return"tooltip"===f||"label"===l?e:{...e,..."menu"===f&&{"aria-labelledby":c}}},[f,d,c,l]),m=k.useCallback(e=>{let{active:t,selected:n}=e,r={role:"option",...t&&{id:"".concat(d,"-fui-option")}};switch(l){case"select":case"combobox":return{...r,"aria-selected":n}}return{}},[d,l]);return k.useMemo(()=>({reference:g,floating:v,item:m,trigger:p}),[g,v,p,m])}function nk(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,i=(0,tw.useId)(),s=null!=tH(),o=t.useState("open"),a=t.useState("activeTriggerElement"),l=t.useState(n?"popupElement":"positionerElement"),u=t.context.triggerElements,c=(0,A.useRefWithInit)(()=>new nu({open:o,transitionStatus:void 0,referenceElement:a,floatingElement:l,triggerElements:u,onOpenChange:r,floatingId:i,syncOnly:!0,nested:s})).current;return(0,P.useIsoLayoutEffect)(()=>{let e={open:o,floatingId:i,referenceElement:a,floatingElement:l};(0,C.isElement)(a)&&(e.domReferenceElement=a),c.state.positionReference===c.state.referenceElement&&(e.positionReference=a),c.update(e)},[o,i,a,l,c]),c.context.onOpenChange=r,c.context.nested=s,c}function nC(e){let[t,n]=k.useState(null),r=(0,F.useStableCallback)((t,r)=>{e||n(r||(x?"touch":""))}),i=k.useRef(e),s=(0,F.useStableCallback)(t=>{t&&!e&&n(null)});(0,P.useIsoLayoutEffect)(()=>{i.current!==e&&s(i.current)},[e,s]),(0,P.useIsoLayoutEffect)(()=>{i.current=e},[e]);let{onClick:o,onPointerDown:a}=function(e){let t=k.useRef(""),n=k.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:k.useCallback(n=>{if(0===n.detail)return void e(n,"keyboard");"pointerType"in n?e(n,n.pointerType):e(n,t.current),t.current=""},[e]),onPointerDown:n}}(r);return k.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:a}}),[t,o,a])}function nT(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new nu({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new nc,floatingId:"",syncOnly:!1,nested:!1,onOpenChange:void 0}),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:tc.EMPTY_OBJECT,inactiveTriggerProps:tc.EMPTY_OBJECT,popupProps:tc.EMPTY_OBJECT}}e.s(["useSyncedFloatingRootContext",()=>nk],12320),e.s(["useOpenInteractionType",()=>nC],1232),e.s(["createInitialPopupStoreState",()=>nT,"popupStoreSelectors",()=>nI],45886);let nO=t8(e=>{var t;return null!=(t=e.triggerIdProp)?t:e.activeTriggerId}),nI={open:t8(e=>{var t;return null!=(t=e.openProp)?t:e.open}),mounted:t8(e=>e.mounted),transitionStatus:t8(e=>e.transitionStatus),floatingRootContext:t8(e=>e.floatingRootContext),preventUnmountingOnClose:t8(e=>e.preventUnmountingOnClose),payload:t8(e=>e.payload),activeTriggerId:nO,activeTriggerElement:t8(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:t8((e,t)=>void 0!==t&&nO(e)===t),isOpenedByTrigger:t8((e,t)=>void 0!==t&&nO(e)===t&&e.open),isMountedByTrigger:t8((e,t)=>void 0!==t&&nO(e)===t&&e.mounted),triggerProps:t8((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:t8(e=>e.popupProps),popupElement:t8(e=>e.popupElement),positionerElement:t8(e=>e.positionerElement)};e.s(["useImplicitActiveTrigger",()=>nF,"useOpenStateTransitions",()=>nL,"useTriggerDataForwarding",()=>nN,"useTriggerRegistration",()=>nM],24981);var nP=e.i(38624),nA=e.i(4814);function nM(e,t){let n=k.useRef(null),r=k.useRef(null);return k.useCallback(i=>{if(void 0!==e){if(null!==n.current){let e=n.current,i=r.current,s=t.context.triggerElements.getById(e);i&&s===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}null!==i&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function nN(e,t,n,r){let i=n.useState("isMountedByTrigger",e),s=nM(e,n),o=(0,F.useStableCallback)(t=>{if(s(t),!t||!n.select("open"))return;let i=n.select("activeTriggerId");if(i===e)return void n.update({activeTriggerElement:t,...r});null==i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return(0,P.useIsoLayoutEffect)(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function nF(e){let t=e.useState("open");(0,P.useIsoLayoutEffect)(()=>
1{if(t&&!e.select("activeTriggerId")&&1===e.context.triggerElements.size){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function nL(e,t,n){let{mounted:r,setMounted:i,transitionStatus:s}=(0,nP.useTransitionStatus)(e);t.useSyncedValues({mounted:r,transitionStatus:s});let o=(0,F.useStableCallback)(()=>{var e,r;i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),null==n||n(),null==(e=(r=t.context).onOpenChangeComplete)||e.call(r,!1)}),a=t.useState("preventUnmountingOnClose");return(0,nA.useOpenChangeComplete)({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:s}}function nD(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:s="click",toggle:o=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:u=0,reason:c=tl.REASONS.triggerPress}=t,d=k.useRef(void 0),f=(0,D.useAnimationFrame)(),h=(0,L.useTimeout)(),p=k.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,i=e.nativeEvent,p=n.select("open");if(0!==e.button||"click"===s||ed(t,!0)&&a)return;let g=r.current.openEvent,v=null==g?void 0:g.type,m=n.select("domReferenceElement")!==e.currentTarget,_=p&&m||!(p&&o&&(!g||!l||"click"===v||"mousedown"===v)),y=(0,U.getTarget)(i);if(en(y)){let e=(0,ta.createChangeEventDetails)(c,i,y);_&&"touch"===t&&u>0?h.start(u,()=>{n.setOpen(!0,e)}):n.setOpen(_,e);return}let b=e.currentTarget;f.request(()=>{let e=(0,ta.createChangeEventDetails)(c,i,b);_&&"touch"===t&&u>0?h.start(u,()=>{n.setOpen(!0,e)}):n.setOpen(_,e)})},onClick(e){if("mousedown-only"===s)return;let t=d.current;if("mousedown"===s&&t){d.current=void 0;return}if(ed(t,!0)&&a)return;let i=n.select("open"),f=r.current.openEvent,p=n.select("domReferenceElement")!==e.currentTarget,g=i&&p||!(i&&o&&(!f||!l||ef(f))),v=(0,ta.createChangeEventDetails)(c,e.nativeEvent,e.currentTarget);g&&"touch"===t&&u>0?h.start(u,()=>{n.setOpen(!0,v)}):n.setOpen(g,v)},onKeyDown(){d.current=void 0}}),[r,s,a,n,l,o,f,h,u,c]);return k.useMemo(()=>i?{reference:p}:tc.EMPTY_OBJECT,[i,p])}e.s(["useClick",()=>nD],57336),e.s(["Dialog",()=>re],32137),e.s(["Backdrop",()=>nH,"Close",()=>nV,"Description",()=>nz,"Handle",()=>n9,"Popup",()=>nJ,"Portal",()=>nZ,"Root",()=>n2,"Title",()=>n8,"Trigger",()=>n6,"Viewport",()=>n4,"createHandle",()=>n7],80889),e.s([],31700),e.i(31700);let nj=k.createContext(void 0);function n$(e){let t=k.useContext(nj);if(!1===e&&void 0===t)throw Error((0,t4.default)(27));return t}let nW={...g,...s.transitionStatusMapping},nH=k.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:s=!1,...o}=e,{store:a}=n$(),l=a.useState("open"),u=a.useState("nested"),c=a.useState("mounted"),d=a.useState("transitionStatus");return(0,tS.useRenderElement)("div",e,{state:{open:l,transitionStatus:d},ref:[a.context.backdropRef,t],stateAttributesMapping:nW,props:[{role:"presentation",hidden:!c,style:{userSelect:"none",WebkitUserSelect:"none"}},o],enabled:s||!u})});
1var nB=e.i(66502);let nV=k.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:s=!0,style:o,...a}=e,{store:l}=n$(),u=l.useState("open"),{getButtonProps:c,buttonRef:d}=(0,nB.useButton)({disabled:i,native:s});return(0,tS.useRenderElement)("button",e,{state:{disabled:i},ref:[t,d],props:[{onClick:function(e){u&&l.setOpen(!1,(0,ta.createChangeEventDetails)(tl.REASONS.closePress,e.nativeEvent))}},a,c]})});var nU=e.i(14148);let nz=k.forwardRef(function(e,t){let{render:n,className:r,style:i,id:s,...o}=e,{store:a}=n$(),l=(0,nU.useBaseUiId)(s);return a.useSyncedValueWithCleanup("descriptionElementId",l),(0,tS.useRenderElement)("p",e,{ref:t,props:[{id:l},o]})}),nq=function(e){return e.nestedDialogs="--nested-dialogs",e}({}),nG=function(e){return e[e.open=o.open]="open",e[e.closed=o.closed]="closed",e[e.startingStyle=o.startingStyle]="startingStyle",e[e.endingStyle=o.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e}({}),nY=k.createContext(void 0);function nX(){let e=k.useContext(nY);if(void 0===e)throw Error((0,t4.default)(26));return e}let nK={...g,...s.transitionStatusMapping,nestedDialogOpen:e=>e?{[nG.nestedDialogOpen]:""}:null},nJ=k.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:s,style:o,...a}=e,{store:l}=n$(),u=l.useState("descriptionElementId"),c=l.useState("disablePointerDismissal"),d=l.useState("floatingRootContext"),f=l.useState("popupProps"),h=l.useState("modal"),p=l.useState("mounted"),g=l.useState("nested"),v=l.useState("nestedOpenDialogCount"),m=l.useState("open"),_=l.useState("openMethod"),y=l.useState("titleElementId"),b=l.useState("transitionStatus"),x=l.useState("role");nX(),(0,nA.useOpenChangeComplete)({open:m,ref:l.context.popupRef,onComplete(){if(m){var e,t;null==(e=(t=l.context).onOpenChangeComplete)||e.call(t,!0)}}});let E=void 0===i?function(e){return"touch"!==e||l.context.popupRef.current}:i,w=(0,tS.useRenderElement)("div",e,{state:{open:m,nested:g,transitionStatus:b,nestedDialogOpen:v>0},props:[f,{"aria-labelledby":null!=y?y:void 0,"aria-describedby":null!=u?u:void 0,role:x,tabIndex:-1,hidden:!p,onKeyDown(e){t2.has(e.key)&&e.stopPropagation()},style:{[nq.nestedDialogs]:v}},a],ref:[t,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:nK});return(0,B.jsx)(tJ,{context:d,openInteractionType:_,disabled:!p,closeOnFocusOut:!c,initialFocus:E,returnFocus:r,modal:!1!==h,restoreFocus:"popup",children:w})}),nZ=k.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=n$(),s=i.useState("mounted"),o=i.useState("modal"),a=i.useState("open");return s||n?(0,B.jsx)(nY.Provider,{value:n,children:(0,B.jsxs)(tF,{ref:t,...r,children:[s&&!0===o&&(0,B.jsx)(nd,{ref:i.context.internalBackdropRef,inert:t3(!a)}),e.children]})}):null}),nQ={...nI,modal:t8(e=>e.modal),nested:t8(e=>e.nested),nestedOpenDialogCount:t8(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:t8(e=>e.nestedOpenDrawerCount),disablePointerDismissal:t8(e=>e.disablePointerDismissal),openMethod:t8(e=>e.openMethod),descriptionElementId:t8(e=>e.descriptionElementId),titleElementId:t8(e=>e.titleElementId),viewportElement:t8(e=>e.viewportElement),role:t8(e=>e.role)};class n0 extends na{static useStore(e,t){let n=(0,A.useRefWithInit)(()=>new n0(t)).current;return null!=e?e:n}constructor(e){super(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...nT(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}(e),{popupRef:k.createRef(),backdropRef:k.createRef(),internalBackdropRef:k.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new nc,onOpenChange:void 0,onOpenChangeComplete:void 0},nQ),(0,tL._)(this,"setOpen",(e,t)=>{var n,r,i,s,o,a;if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||null==this.state.activeTriggerId||(t.trigger=null!=(s=this.state.activeTriggerElement)?s:void 0),null==(n=(r=this.context).onOpenChange)||n.call(r,e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let l={open:e},u=null!=(o=null==(i=t.trigger)?void 0:i.id)?o:null;(u||e)&&(l.activeTriggerId=u,l.activeTriggerElement=null!=(a=t.trigger)?a:null),this.update(l)})}}let n1=k.createContext(!1);function n2(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:s,disablePointerDismissal:o=!1,modal:
1a=!0,actionsRef:l,handle:u,triggerId:c,defaultTriggerId:d=null}=e,f=n$(!0),h=k.useContext(n1),p=!!f,g=n0.useStore(null==u?void 0:u.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:c,modal:a,disablePointerDismissal:o,nested:p});nm(()=>{void 0===n&&!1===g.state.open&&!0===r&&g.update({open:!0,activeTriggerId:d})}),g.useControlledProp("openProp",n),g.useControlledProp("triggerIdProp",c),g.useSyncedValues({disablePointerDismissal:o,nested:p,modal:a}),g.useContextCallback("onOpenChange",i),g.useContextCallback("onOpenChangeComplete",s);let v=g.useState("payload");!function(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,s=t.useState("open"),o=t.useState("disablePointerDismissal"),a=t.useState("modal"),l=t.useState("popupElement"),{openMethod:u,triggerProps:c}=nC(s);nF(t);let{forceUnmount:d}=nL(s,t),f=(0,F.useStableCallback)(e=>{let n=(0,ta.createChangeEventDetails)(e);return n.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},n}),h=k.useCallback(()=>{t.setOpen(!1,f(tl.REASONS.imperativeAction))},[t,f]);k.useImperativeHandle(r,()=>({unmount:d,close:h}),[d,h]);let p=nk({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[g,v]=k.useState(0),[m,_]=k.useState(0),y=0===g,b=nR(p),x=nb(p,{outsidePressEvent:()=>t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:"trap-focus"===a?"sloppy":"intentional",touch:"sloppy"},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||"button"in e&&0!==e.button||"touches"in e&&1!==e.touches.length)return!1;let n=(0,U.getTarget)(e);return!!y&&!o&&(!a||!t.context.internalBackdropRef.current&&!t.context.backdropRef.current||t.context.internalBackdropRef.current===n||t.context.backdropRef.current===n||(0,U.contains)(n,l)&&!(null==n?void 0:n.hasAttribute("data-base-ui-portal")))},escapeKey:y});nv(s&&!0===a,l);let{getReferenceProps:E,getFloatingProps:w,getTriggerProps:S}=nx([b,x]);t.useContextCallback("onNestedDialogOpen",(e,t)=>{v(e),_(t)}),t.useContextCallback("onNestedDialogClose",()=>{v(0),_(0)}),k.useEffect(()=>((null==n?void 0:n.onNestedDialogOpen)&&s&&n.onNestedDialogOpen(g+1,m+ +!!i),(null==n?void 0:n.onNestedDialogClose)&&!s&&n.onNestedDialogClose(),()=>{(null==n?void 0:n.onNestedDialogClose)&&s&&n.onNestedDialogClose()}),[i,s,g,m,n]);let R=k.useMemo(()=>E(c),[E,c]),C=k.useMemo(()=>S(c),[S,c]),T=k.useMemo(()=>w(),[w]);t.useSyncedValues({openMethod:u,activeTriggerProps:R,inactiveTriggerProps:C,popupProps:T,floatingRootContext:p,nestedOpenDialogCount:g,nestedOpenDrawerCount:m})}({store:g,actionsRef:l,parentContext:null==f?void 0:f.store.context,isDrawer:h,onOpenChange:i,triggerIdProp:c});let m=k.useMemo(()=>({store:g}),[g]);return(0,B.jsx)(n1.Provider,{value:!1,children:(0,B.jsx)(nj.Provider,{value:m,children:"function"==typeof t?t({payload:v}):t})})}let n5=function(e){return e[e.open=o.open]="open",e[e.closed=o.closed]="closed",e[e.startingStyle=o.startingStyle]="startingStyle",e[e.endingStyle=o.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e}({}),n3={...g,...s.transitionStatusMapping,nested:e=>e?{[n5.nested]:""}:null,nestedDialogOpen:e=>e?{[n5.nestedDialogOpen]:""}:null},n4=k.forwardRef(function(e,t){let{className:n,render:r,children:i,style:s,...o}=e,a=nX(),{store:l}=n$(),u=l.useState("open"),c=l.useState("nested"),d=l.useState("transitionStatus"),f=l.useState("nestedOpenDialogCount"),h=l.useState("mounted");return(0,tS.useRenderElement)("div",e,{enabled:a||h,state:{open:u,nested:c,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,l.useStateSetter("viewportElement")],stateAttributesMapping:n3,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none"},children:i},o]})}),n8=k.forwardRef(function(e,t){let{render:n,className:r,style:i,id:s,...o}=e,{store:a}=n$(),l=(0,nU.useBaseUiId)(s);return a.useSyncedValueWithCleanup("titleElementId",l),(0,tS.useRenderElement)("h2",e,{ref:t,props:[{id:l},o]})}),n6=k.forwardRef(function(e,t){var n;let{render:r,className:i,disabled:s=!1,nativeButton:o=!0,id:a,payload:l,handle:u,style:c,...d}=e,f=n$(!0),p=null!=(n=null==u?void 0:u.store)?n:null==f?void 0:f.store;if(!p)throw Error((0,t4.default)(79));let g=(0,nU.useBaseUiId)(a),v=p.useState("floatingRootContext"),m=p.useState("isOpenedByTrigger",g),_=k.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=nN(g,_,p,{payload:l}),{getButtonProps:x,buttonRef:E}=(0,nB.useButton)({disabled:s,native:o}),w=nx([nD(v,{enabled:null!=v})]),S=p.useState("triggerProps",b);return(0,tS.useRenderElement)("button",e,{state:{disabled:s,open:m},ref:[E,t,y,_],props:[w.getReferenceProps(),S,{[tT]:"",id:g},d,x],stateAttributesMapping:h})});
1class n9{open(e){let t=e?this.store.context.triggerElements.getById(e):void 0;this.store.setOpen(!0,(0,ta.createChangeEventDetails)(tl.REASONS.imperativeAction,void 0,t))}openWithPayload(e){this.store.set("payload",e),this.store.setOpen(!0,(0,ta.createChangeEventDetails)(tl.REASONS.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,(0,ta.createChangeEventDetails)(tl.REASONS.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}constructor(e){this.store=null!=e?e:new n0}}function n7(){return new n9}var re=e.i(80889);e.s(["XIcon",()=>rt.default],96857);var rt=e.i(29318);e.s(["openSearch",()=>rr,"useSearchOpener",()=>ri],4889);let rn="erne:open-search";function rr(){window.dispatchEvent(new Event(rn))}function ri(e){(0,k.useEffect)(()=>{function t(){e()}return window.addEventListener(rn,t),()=>window.removeEventListener(rn,t)},[e])}},59010,e=>{"use strict";e.s(["Navbar",()=>nQ],59010);var t=e.i(46882),n=e.i(54249),r=e.i(55118),i=e.i(49793);let s=(0,i.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var o=e.i(75419);let a=(0,i.default)("briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]),l=(0,i.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),u=(0,i.default)("compass",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]);var c=e.i(76248);let d=(0,i.default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);var f=e.i(24241),h=e.i(54501),p=e.i(26138),g=e.i(99060),v=e.i(91759);e.s(["Arrow",()=>S,"Backdrop",()=>I,"CheckboxItem",()=>X,"CheckboxItemIndicator",()=>Z,"Group",()=>ee,"GroupLabel",()=>et,"Handle",()=>n_,"Item",()=>en,"LinkItem",()=>er,"Popup",()=>eA,"Portal",()=>eF,"Positioner",()=>tw,"RadioGroup",()=>tR,"RadioItem",()=>tC,"RadioItemIndicator",()=>tT,"Root",()=>tQ,"Separator",()=>nv.Separator,"SubmenuRoot",()=>t0,"SubmenuTrigger",()=>nm,"Trigger",()=>ns,"Viewport",()=>ng,"createHandle",()=>ny],45395),e.s([],75142),e.i(75142),e.i(19940);var m=e.i(58931);let _=r.createContext(void 0);function y(e){let t=r.useContext(_);if(void 0===t&&!e)throw Error((0,m.default)(33));return t}let b=r.createContext(void 0);function x(e){let t=r.useContext(b);if(void 0===t&&!e)throw Error((0,m.default)(36));return t}var E=e.i(94146),w=e.i(37729);let S=r.forwardRef(function(e,t){let{className:n,render:r,style:i,...s}=e,{store:o}=x(),{arrowRef:a,side:l,align:u,arrowUncentered:c,arrowStyles:d}=y(),f=o.useState("open");return(0,E.useRenderElement)("div",e,{ref:[a,t],stateAttributesMapping:w.popupStateMapping,state:{open:f,side:l,align:u,uncentered:c},props:{style:d,"aria-hidden":!0,...s}})});var R=e.i(64253);let k=r.createContext(void 0);function C(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=r.useContext(k);if(void 0===t&&!e)throw Error((0,m.default)(25));return t}var T=e.i(85870);let O={...w.popupStateMapping,...R.transitionStatusMapping},I=r.forwardRef(function(e,t){let{className:n,render:r,style:i,...s}=e,{store:o}=x(),a=o.useState("open"),l=o.useState("mounted"),u=o.useState("transitionStatus"),c=o.useState("lastOpenChangeReason"),d=C();return(0,E.useRenderElement)("div",e,{ref:(null==d?void 0:d.backdropRef)?[t,d.backdropRef]:t,state:{open:a,transitionStatus:u},stateAttributesMapping:O,props:[{role:"presentation",hidden:!l,style:{pointerEvents:c===T.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s]})});var P=e.i(55838),A=e.i(35506);let M=r.createContext(void 0);var N=e.i(42351),F=e.i(66502),L=e.i(27621),D=e.i(22923);function j(e){let{closeOnClick:t,highlighted:n,id:i,nodeId:s,store:o,typingRef:a,itemRef:l,itemMetadata:u}=e,{events:c}
1=o.useState("floatingTreeRoot"),d=C(!0),f=void 0!==d;return r.useMemo(()=>({id:i,role:"menuitem",tabIndex:n?0:-1,onKeyDown(e){" "===e.key&&(null==a?void 0:a.current)&&e.preventDefault()},onMouseMove(e){s&&c.emit("itemhover",{nodeId:s,target:e.currentTarget})},onClick(e){t&&c.emit("close",{domEvent:e,reason:T.REASONS.itemPress})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&1>=Math.abs(e.clientX-t.x)&&1>=Math.abs(e.clientY-t.y)||f&&!D.isMac&&2===e.button)return}l.current&&o.context.allowMouseUpTriggerRef.current&&(!f||2===e.button)&&(!u||"regular-item"===u.type)&&l.current.click()}}),[t,n,i,c,s,o,a,l,d,f,u])}let $={type:"regular-item"};function W(e){let{closeOnClick:t,disabled:n=!1,highlighted:i,id:s,store:o,typingRef:a=o.context.typingRef,nativeButton:l,itemMetadata:u,nodeId:c}=e,d=r.useRef(null),{getButtonProps:f,buttonRef:h}=(0,F.useButton)({disabled:n,focusableWhenDisabled:!0,native:l,composite:!0}),p=j({closeOnClick:t,highlighted:i,id:s,nodeId:c,store:o,typingRef:a,itemRef:d,itemMetadata:u}),g=r.useCallback(e=>(0,L.mergeProps)(p,{onMouseEnter(){"submenu-trigger"===u.type&&u.setActive()}},e,f),[p,f,u]),v=(0,N.useMergedRefs)(d,h);return r.useMemo(()=>({getItemProps:g,itemRef:v}),[g,v])}var H=e.i(64999);let B=r.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}}),V=function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e}({});function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{label:t,metadata:n,textRef:i,indexGuessBehavior:s,index:o}=e,{register:a,unregister:l,subscribeMapChange:u,elementsRef:c,labelsRef:d,nextIndexRef:f}=r.useContext(B),h=r.useRef(-1),[p,g]=r.useState(null!=o?o:s===V.GuessFromOrder?()=>{if(-1===h.current){let e=f.current;f.current+=1,h.current=e}return h.current}:-1),v=r.useRef(null),m=r.useCallback(e=>{if(v.current=e,-1!==p&&null!==e&&(c.current[p]=e,d)){var n,r;let s=void 0!==t;d.current[p]=s?t:null!=(r=null==i||null==(n=i.current)?void 0:n.textContent)?r:e.textContent}},[p,c,d,t,i]);return(0,H.useIsoLayoutEffect)(()=>{if(null!=o)return;let e=v.current;if(e)return a(e,n),()=>{l(e)}},[o,a,l,n]),(0,H.useIsoLayoutEffect)(()=>{if(null==o)return u(e=>{var t;let n=v.current?null==(t=e.get(v.current))?void 0:t.index:null;null!=n&&g(n)})},[o,u,g]),r.useMemo(()=>({ref:m,index:p}),[p,m])}var z=e.i(14148);let q=function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e}({}),G={checked:e=>e?{[q.checked]:""}:{[q.unchecked]:""},...R.transitionStatusMapping};var Y=e.i(42415);let X=r.forwardRef(function(e,n){let{render:i,className:s,id:o,label:a,nativeButton:l=!1,disabled:u=!1,closeOnClick:c=!1,checked:d,defaultChecked:f,onCheckedChange:h,style:p,...g}=e,v=U({label:a}),m=y(!0),_=(0,z.useBaseUiId)(o),{store:b}=x(),w=b.useState("isActive",v.index),S=b.useState("itemProps"),[R,k]=(0,A.useControlled)({controlled:d,default:null!=f&&f,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:C,itemRef:O}=W({closeOnClick:c,disabled:u,highlighted:w,id:_,store:b,nativeButton:l,nodeId:null==m?void 0:m.context.nodeId,itemMetadata:$}),I=r.useMemo(()=>({disabled:u,highlighted:w,checked:R}),[u,w,R]),N=(0,P.useStableCallback)(e=>{let t={...(0,Y.createChangeEventDetails)(T.REASONS.itemPress,e.nativeEvent),preventUnmountOnClose:()=>{}};null==h||h(!R,t),t.isCanceled||k(e=>!e)}),F=(0,E.useRenderElement)("div",e,{state:I,stateAttributesMapping:G,props:[S,{role:"menuitemcheckbox","aria-checked":R,onClick:N},g,C],ref:[O,n,v.ref]});return(0,t.jsx)(M.Provider,{value:I,children:F})});var K=e.i(38624),J=e.i(4814);let Z=r.forwardRef(function(e,t){let{render:n,className:i,style:s,keepMounted:o=!1,...a}=e,l=function(){let e=r.useContext(M);if(void 0===e)throw Error((0,m.default)(30));return e}(),u=r.useRef(null),{transitionStatus:c,setMounted:d}=(0,K.useTransitionStatus)(l.checked);(0,J.useOpenChangeComplete)({open:l.checked,ref:u,onComplete(){l.checked||d(!1)}});let f={checked:l.checked,disabled:l.disabled,highlighted:l.highlighted,transitionStatus:c};return(0,E.useRenderElement)("span",e,{state:f,ref:[t,u],stateAttributesMapping:G,props:{"aria-hidden":!0,...a},enabled:o||l.checked})}),Q=r.createContext(void 0),ee=r.forwardRef(function(e,n){let{render:i,className:s,style:o,...a}=e,[l,u]=r.useState(void 0),c=r.useMemo(()=>({setLabelId:u}),[u]),d=(0,E.useRenderElement)("div",e,{ref:n,props:{role:"group","aria-labelledby":l,...a}});return(0,t.jsx)(Q.Provider,{value:c,children:d})}),et=r.forwardRef(function(e,t){let{className:n,render:i,id:s,style:o,...a}=e,l=(0,z.useBaseUiId)(s),{setLabelId:u}=function(){let e=r.useContext(Q);if(void 0===e)throw Error((0,m.default)(31));return e}();return(0,H.useIsoLayoutEffect)(()=>(u(l),()=>{u(void 0)}),[u,l]),(0,E.useRenderElement)("div",e,{ref:t,props:{id:l,role:"presentation",...a}})}),en=r.forwardRef(function(e,t){let{render:n,className:r,id:i,label:s,nativeButton:o=!1,disabled:a=!1,closeOnClick:l=!0,style:u,...c}=e,d=U({label:s}),f=y(!0),h=(0,z.useBaseUiId)(i),{store:p}
1=x(),g=p.useState("isActive",d.index),v=p.useState("itemProps"),{getItemProps:m,itemRef:_}=W({closeOnClick:l,disabled:a,highlighted:g,id:h,store:p,nativeButton:o,nodeId:null==f?void 0:f.context.nodeId,itemMetadata:$});return(0,E.useRenderElement)("div",e,{state:{disabled:a,highlighted:g},props:[v,c,m],ref:[_,t,d.ref]})}),er=r.forwardRef(function(e,t){let{render:n,className:i,id:s,label:o,closeOnClick:a=!1,style:l,...u}=e,c=r.useRef(null),d=U({label:o}),f=y(!0),h=null==f?void 0:f.context.nodeId,p=(0,z.useBaseUiId)(s),{store:g}=x(),v=g.useState("isActive",d.index),m=g.useState("itemProps"),_=g.context.typingRef,{getButtonProps:b,buttonRef:w}=(0,F.useButton)({native:!1,composite:!0}),S=j({closeOnClick:a,highlighted:v,id:p,nodeId:h,store:g,typingRef:_,itemRef:c}),R=r.useMemo(()=>({highlighted:v}),[v]);return(0,E.useRenderElement)("a",e,{state:R,props:[m,u,function(e){return(0,L.mergeProps)(S,e,b)}],ref:[c,w,t,d.ref]})});var ei=e.i(81470),es=e.i(15385),eo=e.i(99248),ea=e.i(76154),el=e.i(37387),eu=e.i(34832),ec=e.i(28458),ed=e.i(73391),ef=e.i(45305),eh=e.i(98455),ep=e.i(12503),eg=e.i(58087),ev=e.i(88516);class em{static create(){return new em}constructor(){(0,ep._)(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()}),(0,ep._)(this,"disposeEffect",()=>this.dispose),this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new el.Timeout,this.restTimeout=new el.Timeout,this.handleCloseOptions=void 0}}let e_=new WeakMap;function ey(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&e_.get(t)===e){var n,r,i;null==(n=e.pointerEventsScopeElement)||n.style.removeProperty("pointer-events"),null==(r=e.pointerEventsReferenceElement)||r.style.removeProperty("pointer-events"),null==(i=e.pointerEventsFloatingElement)||i.style.removeProperty("pointer-events"),e_.delete(t)}e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function eb(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,s=e_.get(n);s&&s!==e&&ey(s),ey(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,e_.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function ex(e){let t=(0,ev.useRefWithInit)(em.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),(0,eg.useOnMount)(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}var eE=e.i(59832);function ew(e,t,n){let r=null==n||(0,eE.isMouseLikePointerType)(n)?"function"==typeof e?e():e:0;return"number"==typeof r?r:null==r?void 0:r[t]}function eS(e){return"function"==typeof e?e():e}function eR(e,t){return t||"click"===e||"mousedown"===e}let ek=r.createContext(void 0);var eC=e.i(19371),eT=e.i(64270),eO=e.i(66532);function eI(e){return"starting"===e?eT.DISABLED_TRANSITIONS_STYLE:eO.EMPTY_OBJECT}let eP={...w.popupStateMapping,...R.transitionStatusMapping},eA=r.forwardRef(function(e,n){let{render:i,className:s,style:o,finalFocus:a,...l}=e,{store:u}=x(),{side:c,align:d}=y(),f=null!=function(e){let t=r.useContext(ek);if(void 0===t&&!e)throw Error((0,m.default)(69));return t}(!0),h=u.useState("open"),p=u.useState("transitionStatus"),g=u.useState("popupProps"),v=u.useState("mounted"),_=u.useState("instantType"),b=u.useState("activeTriggerElement"),w=u.useState("parent"),S=u.useState("lastOpenChangeReason"),R=u.useState("rootId"),k=u.useState("floatingRootContext"),C=u.useState("floatingTreeRoot"),O=u.useState("closeDelay"),I=u.useState("activeTriggerElement"),A="context-menu"===w.type;(0,J.useOpenChangeComplete)({open:h,ref:u.context.popupRef,onComplete(){if(h){var e,t;null==(e=(t=u.context).onOpenChangeComplete)||e.call(t,!0)}}}),r.useEffect(()=>{function e(e){u.setOpen(!1,(0,Y.createChangeEventDetails)(e.reason,e.domEvent))}return C.events.on("close",e),()=>{C.events.off("close",e)}},[C.events,u]);let M=u.useState("hoverEnabled"),N=u.useState("disabled");!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="rootStore"in e?e.rootStore:e,i=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("domReferenceElement"),{dataRef:a}=n.context,{enabled:l=!0,closeDelay:u=0,nodeId:c}
1=t,d=ex(n),f=(0,eh.useFloatingTree)(),h=(0,eh.useFloatingParentNodeId)(),p=(0,P.useStableCallback)(()=>{var e;return eR(null==(e=a.current.openEvent)?void 0:e.type,d.interactedInside)}),g=(0,P.useStableCallback)(()=>{var e;let t=null==(e=a.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),v=(0,P.useStableCallback)(e=>(0,ed.isTargetInsideEnabledTrigger)(e,n.context.triggerElements)),m=r.useCallback(e=>{let t=ew(u,"close",d.pointerType),r=()=>{n.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.triggerHover,e)),null==f||f.events.emit("floating.closed",e)};t?d.openChangeTimeout.start(t,r):(d.openChangeTimeout.clear(),r())},[u,n,d,f]),_=(0,P.useStableCallback)(()=>{ey(d)}),y=(0,P.useStableCallback)(e=>{let t=(0,ec.getTarget)(e);if(!(0,ed.isInteractiveElement)(t)){d.interactedInside=!1;return}d.interactedInside=(null==t?void 0:t.closest("[aria-haspopup]"))!=null});(0,H.useIsoLayoutEffect)(()=>{i||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,_())},[i,d,_]),r.useEffect(()=>_,[_]),(0,H.useIsoLayoutEffect)(()=>{var e,t,n,r,a,u,c,p,v;if(l&&i&&(null==(e=d.handleCloseOptions)?void 0:e.blockPointerEvents)&&g()&&(0,es.isElement)(o)&&s){let e=(0,eu.ownerDocument)(s),i=null==f||null==(n=f.nodesRef.current.find(e=>e.id===h))||null==(t=n.context)?void 0:t.elements.floating;i&&(i.style.pointerEvents="");let l=null!=(v=null!=(p=null!=(c=null!=(u=null==(a=d.handleCloseOptions)||null==(r=a.getScope)?void 0:r.call(a))?u:d.pointerEventsScopeElement)?c:i)?p:o.closest("[data-rootownerid]"))?v:e.body;return eb(d,{scopeElement:l,referenceElement:o,floatingElement:s}),()=>{_()}}},[l,i,o,s,d,g,f,h,_]);let b=(0,el.useTimeout)();r.useEffect(()=>{if(l)return(0,ea.mergeCleanups)(s&&(0,eo.addEventListener)(s,"mouseenter",function(){d.openChangeTimeout.clear(),b.clear(),null==f||f.events.off("floating.closed",e),_()}),s&&(0,eo.addEventListener)(s,"mouseleave",function(t){var n,r;if(f&&h&&(0,ef.getNodeChildren)(f.nodesRef.current,h).length>0)return void f.events.on("floating.closed",e);if(v(t.relatedTarget))return;let i=null!=(r=null==(n=a.current.floatingContext)?void 0:n.nodeId)?r:c,s=t.relatedTarget;if(!(f&&i&&(0,es.isElement)(s)&&(0,ef.getNodeChildren)(f.nodesRef.current,i,!1).some(e=>{var t;return(0,ec.contains)(null==(t=e.context)?void 0:t.elements.floating,s)}))){if(d.handler)return void d.handler(t);_(),p()||m(t)}}),s&&(0,eo.addEventListener)(s,"pointerdown",y,!0),()=>{null==f||f.events.off("floating.closed",e)});function e(t){f&&h&&!((0,ef.getNodeChildren)(f.nodesRef.current,h).length>0)&&b.start(0,()=>{f.events.off("floating.closed",e),n.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.triggerHover,t)),f.events.emit("floating.closed",t)})}},[l,s,n,a,c,p,v,m,_,y,d,f,h,b])}(k,{enabled:M&&!N&&!A&&"menubar"!==w.type,closeDelay:O});let F={transitionStatus:p,side:c,align:d,open:h,nested:"menu"===w.type,instant:_},L=r.useCallback(e=>{u.set("popupElement",e)},[u]),D=(0,E.useRenderElement)("div",e,{state:F,ref:[n,u.context.popupRef,L],stateAttributesMapping:eP,props:[g,{onKeyDown(e){f&&eC.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},eI(p),l,{"data-rootownerid":R}]}),j=void 0===w.type||A;return(b||"menubar"===w.type&&S!==T.REASONS.outsidePress)&&(j=!0),(0,t.jsx)(ei.FloatingFocusManager,{context:k,modal:A,disabled:!v,returnFocus:void 0===a?j:a,initialFocus:"menu"!==w.type,restoreFocus:!0,externalTree:"menubar"!==w.type?C:void 0,previousFocusableElement:I,nextFocusableElement:void 0===w.type?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:void 0===w.type?u.context.beforeContentFocusGuardRef:void 0,children:D})});var eM=e.i(50445);let eN=r.createContext(void 0),eF=r.forwardRef(function(e,n){let{keepMounted:r=!1,...i}=e,{store:s}=x();return s.useState("mounted")||r?(0,t.jsx)(eN.Provider,{value:r,children:(0,t.jsx)(eM.FloatingPortal,{ref:n,...i})}):null});var eL=e.i(63910),eD=e.i(17538),ej=e.i(31891),e$=e.i(67871);function eW(e,t,n){let r,{reference:i,floating:s}=e,o=(0,eD.getSideAxis)(t),a=(0,eD.getAlignmentAxis)(t),l=(0,eD.getAxisLength)(a),u=(0,eD.getSide)(t),c="y"===o,d=i.x+i.width/2-s.width/2,f=i.y+i.height/2-s.height/2,h=i[l]/2-s[l]/2;switch(u){case"top":r={x:d,y:i.y-s.height};break;case"bottom":r={x:d,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:f};break;case"left":r={x:i.x-s.width,y:f};break;default:r={x:i.x,y:i.y}}switch((0,eD.getAlignment)(t)){case"start":r[a]-=h*(n&&c?-1:1);break;case"end":r[a]+=h*(n&&c?-1:1)}return r}async function eH(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}
1=(0,eD.evaluate)(t,e),p=(0,eD.getPaddingObject)(h),g=a[f?"floating"===d?"reference":"floating":d],v=(0,eD.rectToClientRect)(await s.getClippingRect({element:null==(n=await (null==s.isElement?void 0:s.isElement(g)))||n?g:g.contextElement||await (null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),m="floating"===d?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,_=await (null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),y=await (null==s.isElement?void 0:s.isElement(_))&&await (null==s.getScale?void 0:s.getScale(_))||{x:1,y:1},b=(0,eD.rectToClientRect)(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:_,strategy:l}):m);return{top:(v.top-b.top+p.top)/y.y,bottom:(b.bottom-v.bottom+p.bottom)/y.y,left:(v.left-b.left+p.left)/y.x,right:(b.right-v.right+p.right)/y.x}}let eB=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:eH},l=await (null==o.isRTL?void 0:o.isRTL(t)),u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=eW(u,r,l),f=r,h=0,p={};for(let n=0;n<s.length;n++){let g=s[n];if(!g)continue;let{name:v,fn:m}=g,{x:_,y:y,data:b,reset:x}=await m({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:u,platform:a,elements:{reference:e,floating:t}});c=null!=_?_:c,d=null!=y?y:d,p[v]={...p[v],...b},x&&h<50&&(h++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(u=!0===x.rects?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:c,y:d}=eW(u,f,l)),n=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:p}};function eV(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eU(e){return eD.sides.some(t=>e[t]>=0)}let ez=new Set(["left","top"]);async function eq(e,t){let{placement:n,platform:r,elements:i}=e,s=await (null==r.isRTL?void 0:r.isRTL(i.floating)),o=(0,eD.getSide)(n),a=(0,eD.getAlignment)(n),l="y"===(0,eD.getSideAxis)(n),u=ez.has(o)?-1:1,c=s&&l?-1:1,d=(0,eD.evaluate)(t,e),{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}function eG(e){let t=(0,es.getComputedStyle)(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=(0,es.isHTMLElement)(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=(0,eD.round)(n)!==s||(0,eD.round)(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function eY(e){return(0,es.isElement)(e)?e:e.contextElement}function eX(e){let t=eY(e);if(!(0,es.isHTMLElement)(t))return(0,eD.createCoords)(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:s}=eG(t),o=(s?(0,eD.round)(n.width):n.width)/r,a=(s?(0,eD.round)(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}let eK=(0,eD.createCoords)(0);function eJ(e){let t=(0,es.getWindow)(e);return(0,es.isWebKit)()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eK}function eZ(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let s=e.getBoundingClientRect(),o=eY(e),a=(0,eD.createCoords)(1);t&&(r?(0,es.isElement)(r)&&(a=eX(r)):a=eX(e));let l=(void 0===(i=n)&&(i=!1),r&&(!i||r===(0,es.getWindow)(o))&&i)?eJ(o):(0,eD.createCoords)(0),u=(s.left+l.x)/a.x,c=(s.top+l.y)/a.y,d=s.width/a.x,f=s.height/a.y;if(o){let e=(0,es.getWindow)(o),t=r&&(0,es.isElement)(r)?(0,es.getWindow)(r):r,n=e,i=(0,es.getFrameElement)(n);for(;i&&r&&t!==n;){let e=eX(i),t=i.getBoundingClientRect(),r=(0,es.getComputedStyle)(i),s=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=s,c+=o,n=(0,es.getWindow)(i),i=(0,es.getFrameElement)(n)}}return(0,eD.rectToClientRect)({width:d,height:f,x:u,y:c})}function eQ(e,t){let n=(0,es.getNodeScroll)(e).scrollLeft;return t?t.left+n:eZ((0,es.getDocumentElement)(e)).left+n}function e0(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-eQ(e,n),y:n.top+t.scrollTop}}function e1(e,t,n){let r;if("viewport"===t)r=function(e,t){let n=(0,es.getWindow)(e),r=(0,es.getDocumentElement)(e),i=n.visualVie
1wport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;let e=(0,es.isWebKit)();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}let u=eQ(r);if(u<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(s-=o)}else u<=25&&(s+=u);return{width:s,height:o,x:a,y:l}}(e,n);else if("document"===t)r=function(e){let t=(0,es.getDocumentElement)(e),n=(0,es.getNodeScroll)(e),r=e.ownerDocument.body,i=(0,eD.max)(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=(0,eD.max)(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+eQ(e),a=-n.scrollTop;return"rtl"===(0,es.getComputedStyle)(r).direction&&(o+=(0,eD.max)(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}((0,es.getDocumentElement)(e));else if((0,es.isElement)(t))r=function(e,t){let n=eZ(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=(0,es.isHTMLElement)(e)?eX(e):(0,eD.createCoords)(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y;return{width:o,height:a,x:i*s.x,y:r*s.y}}(t,n);else{let n=eJ(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return(0,eD.rectToClientRect)(r)}function e2(e){return"static"===(0,es.getComputedStyle)(e).position}function e5(e,t){if(!(0,es.isHTMLElement)(e)||"fixed"===(0,es.getComputedStyle)(e).position)return null;if(t)return t(e);let n=e.offsetParent;return(0,es.getDocumentElement)(e)===n&&(n=n.ownerDocument.body),n}function e3(e,t){let n=(0,es.getWindow)(e);if((0,es.isTopLayer)(e))return n;if(!(0,es.isHTMLElement)(e)){let t=(0,es.getParentNode)(e);for(;t&&!(0,es.isLastTraversableNode)(t);){if((0,es.isElement)(t)&&!e2(t))return t;t=(0,es.getParentNode)(t)}return n}let r=e5(e,t);for(;r&&(0,es.isTableElement)(r)&&e2(r);)r=e5(r,t);return r&&(0,es.isLastTraversableNode)(r)&&e2(r)&&!(0,es.isContainingBlock)(r)?n:r||(0,es.getContainingBlock)(e)||n}let e4=async function(e){let t=this.getOffsetParent||e3,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=(0,es.isHTMLElement)(t),i=(0,es.getDocumentElement)(t),s="fixed"===n,o=eZ(e,!0,s,t),a={scrollLeft:0,scrollTop:0},l=(0,eD.createCoords)(0);if(r||!r&&!s)if(("body"!==(0,es.getNodeName)(t)||(0,es.isOverflowElement)(i))&&(a=(0,es.getNodeScroll)(t)),r){let e=eZ(t,!0,s,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=eQ(i));s&&!r&&i&&(l.x=eQ(i));let u=!i||r||s?(0,eD.createCoords)(0):e0(i,a);return{x:o.left+a.scrollLeft-l.x-u.x,y:o.top+a.scrollTop-l.y-u.y,width:o.width,height:o.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},e8={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,s="fixed"===i,o=(0,es.getDocumentElement)(r),a=!!t&&(0,es.isTopLayer)(t.floating);if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=(0,eD.createCoords)(1),c=(0,eD.createCoords)(0),d=(0,es.isHTMLElement)(r);if((d||!d&&!s)&&(("body"!==(0,es.getNodeName)(r)||(0,es.isOverflowElement)(o))&&(l=(0,es.getNodeScroll)(r)),d)){let e=eZ(r);u=eX(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}let f=!o||d||s?(0,eD.createCoords)(0):e0(o,l);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}},getDocumentElement:es.getDocumentElement,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,s=[..."clippingAncestors"===n?(0,es.isTopLayer)(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=(0,es.getOverflowAncestors)(e,[],!1).filter(e=>(0,es.isElement)(e)&&"body"!==(0,es.getNodeName)(e)),i=null,s="fixed"===(0,es.getComputedStyle)(e).position,o=s?(0,es.getParentNode)(e):e;for(;(0,es.isElement)(o)&&!(0,es.isLastTraversableNode)(o);){let t=(0,es.getComputedStyle)(o),n=(0,es.isContainingBlock)(o);n||"fixed"!==t.position||(i=null),(s?n||i:!(!n&&"static"===t.position&&i&&("absolute"===i.position||"fixed"===i.position)||(0,es.isOverflowElement)(o)&&!n&&function e(t,n){let r=(0,es.getParentNode)(t);return!(r===n||!(0,es.isElement)(r)||(0,es.isLastTraversableNode)(r))&&("fixed"===(0,es.getComputedStyle)(r).position||e(r,n))}(e,o)))?i=t:r=r.filter(e=>e!==o),o=(0,es.getParentNode)(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=e1(t,s[0],i),a=o.top,l=o.right,u=o.bottom,c=o.left;for(let e=1;e<s.length;e++){let n=e1(t,s[e],i);a=(0,eD.max)(n.top,a),l=(0,eD.min)(n.right,l),u=(0,eD.min)(n.bottom,u),c=(0,eD.max)(n.left,c)}return{width:l-c,height:u-a,x:c,y:a}},getOffsetParent:e3,getElementRects:e4,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=eG(e);return{width:t,height:n}},getScale:eX,isElement:es.isElement,isRTL:function(e){return"rtl"===(0,es.getComputedStyle)(e).direction}};function e6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function e9(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,c=eY(e),d=s||o?[...c?(0,es.getOverflowAncestors)(c):[],...t?(0,es.getOverflowAncestors)(t):[]]:[];
1d.forEach(e=>{s&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});let f=c&&l?function(e,t){let n,r=null,i=(0,es.getDocumentElement)(e);function s(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function o(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),s();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(a||t(),!f||!h)return;let p=(0,eD.floor)(d),g=(0,eD.floor)(i.clientWidth-(c+f)),v={rootMargin:-p+"px "+-g+"px "+-(0,eD.floor)(i.clientHeight-(d+h))+"px "+-(0,eD.floor)(c)+"px",threshold:(0,eD.max)(0,(0,eD.min)(1,l))||1},m=!0;function _(t){let r=t[0].intersectionRatio;if(r!==l){if(!m)return o();r?o(!1,r):n=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==r||e6(u,e.getBoundingClientRect())||o(),m=!1}try{r=new IntersectionObserver(_,{...v,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(_,v)}r.observe(e)}(!0),s}(c,n):null,h=-1,p=null;a&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),c&&!u&&p.observe(c),t&&p.observe(t));let g=u?eZ(e):null;return u&&function t(){let r=eZ(e);g&&!e6(g,r)&&n(),g=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{s&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=p)||e.disconnect(),p=null,u&&cancelAnimationFrame(i)}}var e7=e.i(21890),te="undefined"!=typeof document?r.useLayoutEffect:function(){};function tt(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!tt(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!tt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function tn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tr(e,t){let n=tn(e);return Math.round(t*n)/n}function ti(e){let t=r.useRef(e);return te(()=>{t.current=e}),t}var ts=e.i(38593),to=e.i(24153),ta=e.i(78021);let tl=r.createContext(void 0);function tu(){var e;let t=r.useContext(tl);return null!=(e=null==t?void 0:t.direction)?e:"ltr"}let tc={name:"hide",async fn(e){var t;let{width:n,height:r,x:i,y:s}=e.rects.reference;return{data:{referenceHidden:(null==(t=(await ((e,t)=>{var n;let r=(void 0===(n=e)&&(n={}),{name:"hide",options:n,async fn(e){let{rects:t,platform:r}=e,{strategy:i="referenceHidden",...s}=(0,eD.evaluate)(n,e);switch(i){case"referenceHidden":{let n=eV(await r.detectOverflow(e,{...s,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:n,referenceHidden:eU(n)}}}case"escaped":{let n=eV(await r.detectOverflow(e,{...s,altBoundary:!0}),t.floating);return{data:{escapedOffsets:n,escaped:eU(n)}}}default:return{}}}});return{name:r.name,fn:r.fn,options:[e,t]}})().fn(e)).data)?void 0:t.referenceHidden)||0===n&&0===r&&0===i&&0===s}}}},td={sideX:"left",sideY:"top"},tf={name:"adaptiveOrigin",async fn(e){var t,n;let{x:r,y:i,rects:{floating:s},elements:{floating:o},platform:a,strategy:l,placement:u}=e,c=(0,ej.ownerWindow)(o),d=c.getComputedStyle(o);if("0s"===d.transitionDuration||""===d.transitionDuration)return{x:r,y:i,data:td};let f=await (null==(t=a.getOffsetParent)?void 0:t.call(a,o)),h={width:0,height:0};if("fixed"===l&&(null==c?void 0:c.visualViewport))h={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){let e=(0,eu.ownerDocument)(o);h={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await (null==(n=a.isElement)?void 0:n.call(a,f))&&(h=await a.getDimensions(f));let p=(0,eD.getSide)(u),g=r,v=i;return"left"===p&&(g=h.width-(r+s.width)),"top"===p&&(v=h.height-(i+s.height)),{x:g,y:v,data:{sideX:"left"===p?"right":td.sideX,sideY:"top"===p?"bottom":td.sideY}}}};function th(e,t,n){let r="inline-start"===e||"inline-end"===e;return({top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"})[t]}function tp(e,t,n){let{rects:r,placement:i}=e;return{side:th(t,(0,eD.getSide)(i),n),align:(0,eD.getAlignment)(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function tg(e){return null!=e&&"current"in e}function tv(e){let{children:n,elementsRef:i,labelsRef:s,onMapChange:o}=e,a=(0,P.useStableCallback)(o),l=r.useRef(0),u=(0,ev.useRefWithInit)(t_).current,c=(0,ev.useRefWithInit)(tm).current,[d,f]=r.useState(0),h=r.useRef(d),p=(0,P.useStableCallback)((e,t)=>{c.set(e,null!=t?t:null),h.current+=1,f(h.current)}),g=(0,P.useStableCallback)(e=>
1{c.delete(e),h.current+=1,f(h.current)}),v=r.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(ty).forEach((t,n)=>{var r;let i=null!=(r=c.get(t))?r:{};e.set(t,{...i,index:n})}),e},[c,d]);(0,H.useIsoLayoutEffect)(()=>{if("function"!=typeof MutationObserver||0===v.size)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),0===t.size&&(h.current+=1,f(h.current))});return v.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[v]),(0,H.useIsoLayoutEffect)(()=>{h.current===d&&(i.current.length!==v.size&&(i.current.length=v.size),s&&s.current.length!==v.size&&(s.current.length=v.size),l.current=v.size),a(v)},[a,v,i,s,d]),(0,H.useIsoLayoutEffect)(()=>()=>{i.current=[]},[i]),(0,H.useIsoLayoutEffect)(()=>()=>{s&&(s.current=[])},[s]);let m=(0,P.useStableCallback)(e=>(u.add(e),()=>{u.delete(e)}));(0,H.useIsoLayoutEffect)(()=>{u.forEach(e=>e(v))},[u,v]);let _=r.useMemo(()=>({register:p,unregister:g,subscribeMapChange:m,elementsRef:i,labelsRef:s,nextIndexRef:l}),[p,g,m,i,s,l]);return(0,t.jsx)(B.Provider,{value:_,children:n})}function tm(){return new Map}function t_(){return new Set}function ty(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var tb=e.i(96865),tx=e.i(66132),tE=e.i(78239);let tw=r.forwardRef(function(e,n){var i,s,o,a;let{anchor:l,positionMethod:u="absolute",className:c,render:d,side:f,align:h,sideOffset:p=0,alignOffset:g=0,collisionBoundary:v="clipping-ancestors",collisionPadding:y=5,arrowPadding:b=5,sticky:S=!1,disableAnchorTracking:R=!1,collisionAvoidance:k=eT.DROPDOWN_COLLISION_AVOIDANCE,style:O,...I}=e,{store:A}=x(),M=function(){let e=r.useContext(eN);if(void 0===e)throw Error((0,m.default)(32));return e}(),N=C(!0),F=A.useState("parent"),L=A.useState("floatingRootContext"),D=A.useState("floatingTreeRoot"),j=A.useState("mounted"),$=A.useState("open"),W=A.useState("modal"),B=A.useState("openMethod"),V=A.useState("activeTriggerElement"),U=A.useState("transitionStatus"),z=A.useState("positionerElement"),q=A.useState("instantType"),G=A.useState("hasViewport"),X=A.useState("lastOpenChangeReason"),K=A.useState("floatingNodeId"),J=A.useState("floatingParentNodeId"),Z=L.useState("domReferenceElement"),Q=r.useRef(null),ee=(0,tx.useAnimationsFinished)(z,!1,!1),et=l,en=p,er=g,ei=h,eo=k;"context-menu"===F.type&&(et=null!=l?l:null==(i=F.context)?void 0:i.anchor,ei=null!=ei?ei:"start",f||"center"===ei||(er=null!=(s=e.alignOffset)?s:2,en=null!=(o=e.sideOffset)?o:-5));let ea=f,ec=ei;"menu"===F.type?(ea=null!=ea?ea:"inline-end",ec=null!=ec?ec:"start",eo=null!=(a=e.collisionAvoidance)?a:eT.POPUP_COLLISION_AVOIDANCE):"menubar"===F.type&&(ea=null!=ea?ea:"bottom",ec=null!=ec?ec:"start");let ed="context-menu"===F.type,ef=function(e){var t,n;let i,s,{anchor:o,positionMethod:a="absolute",side:l="bottom",sideOffset:u=0,align:c="center",alignOffset:d=0,collisionBoundary:f,collisionPadding:h=5,sticky:p=!1,arrowPadding:g=5,disableAnchorTracking:v=!1,keepMounted:m=!1,floatingRootContext:_,mounted:y,collisionAvoidance:b,shiftCrossAxis:x=!1,nodeId:E,adaptiveOrigin:w,lazyFlip:S=!1,externalTree:R}=e,[k,C]=r.useState(null);y||null===k||C(null);let T=b.side||"flip",O=b.align||"flip",I=b.fallbackAxisSide||"end",A="function"==typeof o?o:void 0,M=(0,P.useStableCallback)(A),N=A?M:o,F=(0,e$.useValueAsRef)(o),L=(0,e$.useValueAsRef)(y),D="rtl"===tu(),j=k||({top:"top",right:"right",bottom:"bottom",left:"left","inline-end":D?"left":"right","inline-start":D?"right":"left"})[l],$="center"===c?j:"".concat(j,"-").concat(c),W=h,B=+("bottom"===l),V=+("top"===l),U=+("right"===l),z=+("left"===l);"number"==typeof W?W={top:W+B,right:W+z,bottom:W+V,left:W+U}:W&&(W={top:(W.top||0)+B,right:(W.right||0)+z,bottom:(W.bottom||0)+V,left:(W.left||0)+U});let q={boundary:"clipping-ancestors"===f?"clippingAncestors":f,padding:W},G=r.useRef(null),Y=(0,e$.useValueAsRef)(u),X=(0,e$.useValueAsRef)(d),K=[((e,t)=>{var n;let r=(void 0===(n=e)&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:s,placement:o,middlewareData:a}=e,l=await eq(e,n);return o===(null==(t=a.offset)?void 0:t.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}});return{name:r.name,fn:r.fn,options:[e,t]}})(e=>{let t=tp(e,l,D),n="function"==typeof Y.current?Y.current(t):Y.current,r="function"==typeof X.current?X.current(t):X.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},["function"!=typeof u?u:0,"function"!=typeof d?d:0,D,l])],J="none"===O&&"shift"!==T,Z=!J&&(p||x||"shift"===T),Q="none"===T?null:((e,t)=>{var n;let r=(void 0===(n=e)&&(n={}),{name:"flip",options:n,async fn(e){var t,r,i,s,o;let{placement:a,middlewareData:l,rects:u,initialPlacement:c,platform:d,elements:f}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:_=!0,...y}=(0,eD.evaluate)(n,e);if(null!=(t=l.arrow)&&t.alignmentOffset)return{};let b=(0,eD.getSide)(a),x=(0,eD.getSideAxis)(c),E=(0,eD.getSide)(c)===c,w=await (null==d.isRTL?void 0:d.isRTL(f.floating)),S=g||(E||!_?[(0,eD.getOppositePlacement)(c)]:(0,eD.getExpandedPlacements)(c)),R="none"!==m;!g&&R&&S.push(...(0,eD.getOppositeAxisPlacements)(c,_,m,w));let k=[c,...S],C=await d.detectOverflow(e,y),T=[],O=(null==(r=l.flip)?void 0:r.overflows)||[];if(h&&T.push(C[b]),p){let e=(0,eD.getAlignmentSides)(a,u,w);T.push(C[e[0]],C[e[1]])}if(O=[...O,{placement:a,overflows:T}],!T.every(e=>e<=0)){let e=((null==(i=l.flip)?void 0:i.index)||0)+1,t=k[e];if(t&&("alignment"!==p||x===(0,eD.getSideAxis)(t)||O.every(e=>(0,eD.getSideAxis)(e.placement)!==x||e.overflows[0]>0)))return{data:{index:e,overflows:O},reset:{placement:t}};let n=null==(s=O.filter(e=>e.overflows[0]<=0).sort((e,t)=>
1e.overflows[1]-t.overflows[1])[0])?void 0:s.placement;if(!n)switch(v){case"bestFit":{let e=null==(o=O.filter(e=>{if(R){let t=(0,eD.getSideAxis)(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(n=e);break}case"initialPlacement":n=c}if(a!==n)return{reset:{placement:n}}}return{}}});return{name:r.name,fn:r.fn,options:[e,t]}})({...q,padding:{top:W.top+1,right:W.right+1,bottom:W.bottom+1,left:W.left+1},mainAxis:!x&&"flip"===T,crossAxis:"flip"===O&&"alignment",fallbackAxisSideDirection:I}),ee=J?null:((e,t)=>{var n;let r=(void 0===(n=e)&&(n={}),{name:"shift",options:n,async fn(e){let{x:t,y:r,placement:i,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=(0,eD.evaluate)(n,e),c={x:t,y:r},d=await s.detectOverflow(e,u),f=(0,eD.getSideAxis)((0,eD.getSide)(i)),h=(0,eD.getOppositeAxis)(f),p=c[h],g=c[f];if(o){let e="y"===h?"top":"left",t="y"===h?"bottom":"right",n=p+d[e],r=p-d[t];p=(0,eD.clamp)(n,p,r)}if(a){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",n=g+d[e],r=g-d[t];g=(0,eD.clamp)(n,g,r)}let v=l.fn({...e,[h]:p,[f]:g});return{...v,data:{x:v.x-t,y:v.y-r,enabled:{[h]:o,[f]:a}}}}});return{name:r.name,fn:r.fn,options:[e,t]}})(e=>{var t,n,r;let i=(0,eu.ownerDocument)(e.elements.floating).documentElement;return{...q,rootBoundary:x?{x:0,y:0,width:i.clientWidth,height:i.clientHeight}:void 0,mainAxis:"none"!==O,crossAxis:Z,limiter:p||x?void 0:{fn:(void 0===(r=t=e=>{if(!G.current)return{};let{width:t,height:n}=G.current.getBoundingClientRect(),r=(0,eD.getSideAxis)((0,eD.getSide)(e.placement)),i="y"===r?W.left+W.right:W.top+W.bottom;return{offset:("y"===r?t:n)/2+i/2}})&&(r={}),{options:r,fn(e){let{x:t,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=(0,eD.evaluate)(r,e),c={x:t,y:n},d=(0,eD.getSideAxis)(i),f=(0,eD.getOppositeAxis)(d),h=c[f],p=c[d],g=(0,eD.evaluate)(a,e),v="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){let e="y"===f?"height":"width",t=s.reference[f]-s.floating[e]+v.mainAxis,n=s.reference[f]+s.reference[e]-v.mainAxis;h<t?h=t:h>n&&(h=n)}if(u){var m,_;let e="y"===f?"width":"height",t=ez.has((0,eD.getSide)(i)),n=s.reference[d]-s.floating[e]+(t&&(null==(m=o.offset)?void 0:m[d])||0)+(t?0:v.crossAxis),r=s.reference[d]+s.reference[e]+(t?0:(null==(_=o.offset)?void 0:_[d])||0)-(t?v.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[f]:h,[d]:p}}}).fn,options:[t,n]}}},[q,p,x,W,O]);"shift"===T||"shift"===O||"center"===c?K.push(ee,Q):K.push(Q,ee),K.push(((e,t)=>{var n;let r=(void 0===(n=e)&&(n={}),{name:"size",options:n,async fn(e){var t,r;let i,s,{placement:o,rects:a,platform:l,elements:u}=e,{apply:c=()=>{},...d}=(0,eD.evaluate)(n,e),f=await l.detectOverflow(e,d),h=(0,eD.getSide)(o),p=(0,eD.getAlignment)(o),g="y"===(0,eD.getSideAxis)(o),{width:v,height:m}=a.floating;"top"===h||"bottom"===h?(i=h,s=p===(await (null==l.isRTL?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(s=h,i="end"===p?"top":"bottom");let _=m-f.top-f.bottom,y=v-f.left-f.right,b=(0,eD.min)(m-f[i],_),x=(0,eD.min)(v-f[s],y),E=!e.middlewareData.shift,w=b,S=x;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(S=y),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(w=_),E&&!p){let e=(0,eD.max)(f.left,0),t=(0,eD.max)(f.right,0),n=(0,eD.max)(f.top,0),r=(0,eD.max)(f.bottom,0);g?S=v-2*(0!==e||0!==t?e+t:(0,eD.max)(f.left,f.right)):w=m-2*(0!==n||0!==r?n+r:(0,eD.max)(f.top,f.bottom))}await c({...e,availableWidth:S,availableHeight:w});let R=await l.getDimensions(u.floating);return v!==R.width||m!==R.height?{reset:{rects:!0}}:{}}});return{name:r.name,fn:r.fn,options:[e,t]}})({...q,apply(e){let{elements:{floating:t},availableWidth:n,availableHeight:r,rects:i}=e;if(!L.current)return;let s=t.style;s.setProperty("--available-width","".concat(n,"px")),s.setProperty("--available-height","".concat(r,"px"));let o=(0,ej.ownerWindow)(t).devicePixelRatio||1,{x:a,y:l,width:u,height:c}=i.reference,d=(Math.round((a+u)*o)-Math.round(a*o))/o,f=(Math.round((l+c)*o)-Math.round(l*o))/o;s.setProperty("--anchor-width","".concat(d,"px")),s.setProperty("--anchor-height","".concat(f,"px"))}}),(i=()=>({element:G.current||(0,eu.ownerDocument)(G.current).createElement("div"),padding:g,offsetParent:"floating"}),s=[g],{name:"arrow",options:i,async fn(e){var t,n;let{x:r,y:s,placement:o,rects:a,platform:l,elements:u,middlewareData:c}=e,{element:d,padding:f=0,offsetParent:h="real"}=(0,eD.evaluate)(i,e)||{};if(null==d)return{};
1let p=(0,eD.getPaddingObject)(f),g={x:r,y:s},v=(0,eD.getAlignmentAxis)(o),m=(0,eD.getAxisLength)(v),_=await l.getDimensions(d),y="y"===v,b=y?"clientHeight":"clientWidth",x=a.reference[m]+a.reference[v]-g[v]-a.floating[m],E=g[v]-a.reference[v],w="real"===h?await (null==(t=l.getOffsetParent)?void 0:t.call(l,d)):u.floating,S=u.floating[b]||a.floating[m];S&&await (null==(n=l.isElement)?void 0:n.call(l,w))||(S=u.floating[b]||a.floating[m]);let R=S/2-_[m]/2-1,k=Math.min(p[y?"top":"left"],R),C=Math.min(p[y?"bottom":"right"],R),T=S-_[m]-C,O=S/2-_[m]/2+(x/2-E/2),I=(0,eD.clamp)(k,O,T),P=!c.arrow&&null!=(0,eD.getAlignment)(o)&&O!==I&&a.reference[m]/2-(O<k?k:C)-_[m]/2<0,A=P?O<k?O-k:O-T:0;return{[v]:g[v]+A,data:{[v]:I,centerOffset:O-I-A,...P&&{alignmentOffset:A}},reset:P}},options:[i,s]}),{name:"transformOrigin",fn(e){var t,n,r;let{elements:i,middlewareData:s,placement:o,rects:a,y:c}=e,d=(0,eD.getSide)(o),f=(0,eD.getSideAxis)(d),h=G.current,p=(null==(t=s.arrow)?void 0:t.x)||0,g=(null==(n=s.arrow)?void 0:n.y)||0,v=(null==h?void 0:h.clientWidth)||0,m=(null==h?void 0:h.clientHeight)||0,_=p+v/2,y=g+m/2,b=Math.abs((null==(r=s.shift)?void 0:r.y)||0),x=a.reference.height/2,E="function"==typeof u?u(tp(e,l,D)):u,w=b>E,S={top:"".concat(_,"px calc(100% + ").concat(E,"px)"),bottom:"".concat(_,"px ").concat(-E,"px"),left:"calc(100% + ".concat(E,"px) ").concat(y,"px"),right:"".concat(-E,"px ").concat(y,"px")}[d],R="".concat(_,"px ").concat(a.reference.y+x-c,"px");return i.floating.style.setProperty("--transform-origin",Z&&"y"===f&&w?R:S),{}}},tc,w),(0,H.useIsoLayoutEffect)(()=>{!y&&_&&_.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[y,_]);let et=r.useMemo(()=>({elementResize:!v&&"undefined"!=typeof ResizeObserver,layoutShift:!v&&"undefined"!=typeof IntersectionObserver}),[v]),{refs:en,elements:er,x:ei,y:eo,middlewareData:ea,update:el,placement:ec,context:ed,isPositioned:ef,floatingStyles:ep}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{nodeId:t,externalTree:n}=e,i=function(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=(0,ts.useId)(),s=null!=(0,eh.useFloatingParentNodeId)(),o=(0,ev.useRefWithInit)(()=>{var e,o;return new to.FloatingRootStore({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:null!=(e=r.reference)?e:null,floatingElement:null!=(o=r.floating)?o:null,triggerElements:new ta.PopupTriggerMap,floatingId:i,syncOnly:!1,nested:s})}).current;return(0,H.useIsoLayoutEffect)(()=>{let e={open:t,floatingId:i};void 0!==r.reference&&(e.referenceElement=r.reference,e.domReferenceElement=(0,es.isElement)(r.reference)?r.reference:null),void 0!==r.floating&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=s,o}(e),s=e.rootContext||i,o={reference:s.useState("referenceElement"),floating:s.useState("floatingElement"),domReference:s.useState("domReferenceElement")},[a,l]=r.useState(null),u=r.useRef(null),c=(0,eh.useFloatingTree)(n);(0,H.useIsoLayoutEffect)(()=>{o.domReference&&(u.current=o.domReference)},[o.domReference]);let d=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:s,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:u,open:c}=e,[d,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=r.useState(i);tt(h,i)||p(i);let[g,v]=r.useState(null),[m,_]=r.useState(null),y=r.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),b=r.useCallback(e=>{e!==S.current&&(S.current=e,_(e))},[]),x=o||g,E=a||m,w=r.useRef(null),S=r.useRef(null),R=r.useRef(d),k=null!=u,C=ti(u),T=ti(s),O=ti(c),I=r.useCallback(()=>{if(!w.current||!S.current)return;let e={placement:t,strategy:n,middleware:h};T.current&&(e.platform=T.current),((e,t,n)=>{let r=new Map,i={platform:e8,...n},s={...i.platform,_c:r};return eB(e,t,{...i,platform:s})})(w.current,S.current,e).then(e=>{let t={...e,isPositioned:!1!==O.current};P.current&&!tt(R.current,t)&&(R.current=t,e7.flushSync(()=>{f(t)}))})},[h,t,n,T,O]);te(()=>{!1===c&&R.current.isPositioned&&(R.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[c]);let P=r.useRef(!1);te(()=>(P.current=!0,()=>{P.current=!1}),[]),te(()=>{if(x&&(w.current=x),E&&(S.current=E),x&&E){if(C.current)return C.current(x,E,I);I()}},[x,E,I,C,k]);let A=r.useMemo(()=>({reference:w,floating:S,setReference:y,setFloating:b}),[y,b]),M=r.useMemo(()=>({reference:x,floating:E}),[x,E]),N=r.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=tr(M.floating,d.x),r=tr(M.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...tn(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,M.floating,d.x,d.y]);return r.useMemo(()=>
1({...d,update:I,refs:A,elements:M,floatingStyles:N}),[d,I,A,M,N])}({...e,elements:{...o,...a&&{reference:a}}}),f=r.useCallback(e=>{let t=(0,es.isElement)(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;l(t),d.refs.setReference(t)},[d.refs]),[h,p]=r.useState(void 0),[g,v]=r.useState(null);s.useSyncedValue("referenceElement",null!=h?h:null);let m=(0,es.isElement)(h)?h:null;s.useSyncedValue("domReferenceElement",void 0===h?o.domReference:m),s.useSyncedValue("floatingElement",g);let _=r.useCallback(e=>{((0,es.isElement)(e)||null===e)&&(u.current=e,p(e)),((0,es.isElement)(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!(0,es.isElement)(e))&&d.refs.setReference(e)},[d.refs,p]),y=r.useCallback(e=>{v(e),d.refs.setFloating(e)},[d.refs]),b=r.useMemo(()=>({...d.refs,setReference:_,setFloating:y,setPositionReference:f,domReference:u}),[d.refs,_,y,f]),x=r.useMemo(()=>({...d.elements,domReference:o.domReference}),[d.elements,o.domReference]),E=s.useState("open"),w=s.useState("floatingId"),S=r.useMemo(()=>({...d,dataRef:s.context.dataRef,open:E,onOpenChange:s.setOpen,events:s.context.events,floatingId:w,refs:b,elements:x,nodeId:t,rootStore:s}),[d,b,x,t,s,E,w]);return(0,H.useIsoLayoutEffect)(()=>{s.context.dataRef.current.floatingContext=S;let e=null==c?void 0:c.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),r.useMemo(()=>({...d,context:S,refs:b,elements:x,rootStore:s}),[d,b,x,S,s])}({rootContext:_,open:m?y:void 0,placement:$,middleware:K,strategy:a,whileElementsMounted:m?void 0:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return e9(...t,et)},nodeId:E,externalTree:R}),{sideX:eg,sideY:em}=ea.adaptiveOrigin||td,e_=ef?a:"fixed",ey=r.useMemo(()=>{let e=w?{position:e_,[eg]:ei,[em]:eo}:{position:e_,...ep};return ef||(e.opacity=0),e},[w,e_,eg,ei,em,eo,ep,ef]),eb=r.useRef(null);(0,H.useIsoLayoutEffect)(()=>{if(!y)return;let e=F.current,t="function"==typeof e?e():e,n=(tg(t)?t.current:t)||null;n!==eb.current&&(en.setPositionReference(n),eb.current=n)},[y,en,N,F]),r.useEffect(()=>{if(!y)return;let e=F.current;"function"!=typeof e&&tg(e)&&e.current!==eb.current&&(en.setPositionReference(e.current),eb.current=e.current)},[y,en,N,F]),r.useEffect(()=>{if(m&&y&&er.domReference&&er.floating)return e9(er.domReference,er.floating,el,et)},[m,y,er,el,et]);let ex=(0,eD.getSide)(ec),eE=th(l,ex,D),ew=(0,eD.getAlignment)(ec)||"center",eS=!!(null==(t=ea.hide)?void 0:t.referenceHidden);(0,H.useIsoLayoutEffect)(()=>{S&&y&&ef&&C(ex)},[S,y,ef,ex]);let eR=r.useMemo(()=>{var e,t;return{position:"absolute",top:null==(e=ea.arrow)?void 0:e.y,left:null==(t=ea.arrow)?void 0:t.x}},[ea.arrow]),ek=(null==(n=ea.arrow)?void 0:n.centerOffset)!==0;return r.useMemo(()=>({positionerStyles:ey,arrowStyles:eR,arrowRef:G,arrowUncentered:ek,side:eE,align:ew,physicalSide:ex,anchorHidden:eS,refs:en,context:ed,isPositioned:ef,update:el}),[ey,eR,G,ek,eE,ew,ex,eS,en,ed,ef,el])}({anchor:et,floatingRootContext:L,positionMethod:N?"fixed":u,mounted:j,side:ea,sideOffset:en,align:ec,alignOffset:er,arrowPadding:ed?0:b,collisionBoundary:v,collisionPadding:y,sticky:S,nodeId:K,keepMounted:M,disableAnchorTracking:R,collisionAvoidance:eo,shiftCrossAxis:ed&&!("side"in eo&&"flip"===eo.side),externalTree:D,adaptiveOrigin:G?tf:void 0});r.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===K&&A.set("hoverEnabled",!1),e.nodeId!==K&&e.parentNodeId===A.select("floatingParentNodeId")&&A.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.siblingOpen)))}return D.events.on("menuopenchange",e),()=>{D.events.off("menuopenchange",e)}},[A,D.events,K]),r.useEffect(()=>{if(null!=A.select("floatingParentNodeId"))return D.events.on("menuopenchange",e),()=>{D.events.off("menuopenchange",e)};function e(e){var t;if(e.open||e.nodeId!==A.select("floatingParentNodeId"))return;let n=null!=(t=e.reason)?t:T.REASONS.siblingOpen;A.setOpen(!1,(0,Y.createChangeEventDetails)(n))}},[D.events,A]);let ep=(0,el.useTimeout)();r.useEffect(()=>{$||ep.clear()},[$,ep]),r.useEffect(()=>{function e(e){if($&&e.nodeId===A.select("floatingParentNodeId"))if(e.target&&V&&V!==e.target){let e=A.select("closeDelay");e>0?ep.isStarted()||ep.start(e,()=>{A.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.siblingOpen))}):A.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.siblingOpen))}else ep.clear()}return D.events.on("itemhover",e),()=>{D.events.off("itemhover",e)}},[D.events,$,V,A,ep]),r.useEffect(()=>{let e={open:$,nodeId:K,parentNodeId:J,reason:A.select("lastOpenChangeReason")};D.events.emit("menuopenchange",e)},[D.events,$,A,K,J]),(0,H.useIsoLayoutEffect)(()=>{let e=Q.current;if(Z&&(Q.current=Z),e&&Z&&Z!==e){A.set("instantType",void 0);let e=new AbortController;return ee(()=>{A.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[Z,ee,A]);let eg={open:$,side:ef.side,align:ef.align,anchorHidden:ef.anchorHidden,nested:"menu"===F.type,instant:q},em="menubar"===F.type&&F.context.modal,e_=W&&X!==T.REASONS.triggerHover;!function(e,t,n,i){let[s,o]=r.useState(!1);(0,H.useIsoLayoutEffect)(()=>
1{if(!e||!t||null==n)return void o(!1);let r=(0,eu.ownerDocument)(n).documentElement.clientWidth,i=n.offsetWidth;o(r>0&&i>0&&i>=r-20)},[e,t,n]),(0,tE.useScrollLock)(e&&(!t||s),i)}($&&(em||e_),"touch"===B,z,V);let ey=function(e,t,n){let{styles:r,transitionStatus:i,props:s,refs:o,hidden:a,inert:l=!1}=n,u={...r};return l&&(u.pointerEvents="none"),(0,E.useRenderElement)("div",e,{state:t,ref:o,props:[{role:"presentation",hidden:a,style:u},eI(i),s],stateAttributesMapping:w.popupStateMapping})}(e,eg,{styles:ef.positionerStyles,transitionStatus:U,props:I,refs:[n,A.useStateSetter("positionerElement")],hidden:!j,inert:!$}),eb=j&&"menu"!==F.type&&("menubar"!==F.type&&W&&X!==T.REASONS.triggerHover||"menubar"===F.type&&F.context.modal),ex=null;return"menubar"===F.type?ex=F.context.contentElement:void 0===F.type&&(ex=V),(0,t.jsxs)(_.Provider,{value:ef,children:[eb&&(0,t.jsx)(tb.InternalBackdrop,{ref:"context-menu"===F.type||"nested-context-menu"===F.type?F.context.internalBackdropRef:null,inert:(0,eL.inertValue)(!$),cutout:ex}),(0,t.jsx)(eh.FloatingNode,{id:K,children:(0,t.jsx)(tv,{elementsRef:A.context.itemDomElements,labelsRef:A.context.itemLabels,children:ey})})]})}),tS=r.createContext(void 0),tR=r.memo(r.forwardRef(function(e,n){let{render:i,className:s,value:o,defaultValue:a,onValueChange:l,disabled:u=!1,style:c,...d}=e,[f,h]=(0,A.useControlled)({controlled:o,default:a,name:"MenuRadioGroup"}),p=(0,P.useStableCallback)(l),g=(0,P.useStableCallback)((e,t)=>{null==p||p(e,t),t.isCanceled||h(e)}),v=(0,E.useRenderElement)("div",e,{state:{disabled:u},ref:n,props:{role:"group","aria-disabled":u||void 0,...d}}),m=r.useMemo(()=>({value:f,setValue:g,disabled:u}),[f,g,u]);return(0,t.jsx)(tS.Provider,{value:m,children:v})})),tk=r.createContext(void 0),tC=r.forwardRef(function(e,n){let{render:i,className:s,id:o,label:a,nativeButton:l=!1,disabled:u=!1,closeOnClick:c=!1,value:d,style:f,...h}=e,p=U({label:a}),g=y(!0),v=(0,z.useBaseUiId)(o),{store:_}=x(),b=_.useState("isActive",p.index),w=_.useState("itemProps"),{value:S,setValue:R,disabled:k}=function(){let e=r.useContext(tS);if(void 0===e)throw Error((0,m.default)(34));return e}(),C=k||u,O=S===d,{getItemProps:I,itemRef:A}=W({closeOnClick:c,disabled:C,highlighted:b,id:v,store:_,nativeButton:l,nodeId:null==g?void 0:g.context.nodeId,itemMetadata:$}),M=r.useMemo(()=>({disabled:C,highlighted:b,checked:O}),[C,b,O]),N=(0,P.useStableCallback)(e=>{R(d,{...(0,Y.createChangeEventDetails)(T.REASONS.itemPress,e.nativeEvent),preventUnmountOnClose:()=>{}})}),F=(0,E.useRenderElement)("div",e,{state:M,stateAttributesMapping:G,props:[w,{role:"menuitemradio","aria-checked":O,onClick:N},h,I],ref:[A,n,p.ref]});return(0,t.jsx)(tk.Provider,{value:M,children:F})}),tT=r.forwardRef(function(e,t){let{render:n,className:i,style:s,keepMounted:o=!1,...a}=e,l=function(){let e=r.useContext(tk);if(void 0===e)throw Error((0,m.default)(35));return e}(),u=r.useRef(null),{transitionStatus:c,setMounted:d}=(0,K.useTransitionStatus)(l.checked);(0,J.useOpenChangeComplete)({open:l.checked,ref:u,onComplete(){l.checked||d(!1)}});let f={checked:l.checked,disabled:l.disabled,highlighted:l.highlighted,transitionStatus:c};return(0,E.useRenderElement)("span",e,{state:f,stateAttributesMapping:G,ref:[t,u],props:{"aria-hidden":!0,...a},enabled:o||l.checked})});var tO=e.i(4e3),tI=e.i(8017),tP=e.i(37072),tA=e.i(2970),tM=e.i(37462),tN=e.i(19383),tF=e.i(32621);function tL(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function tD(e,t){return tL(t,e===tF.ARROW_UP||e===tF.ARROW_DOWN,e===tF.ARROW_LEFT||e===tF.ARROW_RIGHT)}function tj(e,t,n){return tL(t,e===tF.ARROW_DOWN,n?e===tF.ARROW_LEFT:e===tF.ARROW_RIGHT)||"Enter"===e||" "===e||""===e}var t$=e.i(25986),tW=e.i(12320);let tH=r.createContext(null);function tB(e){let t=r.useContext(tH);if(null===t&&!e)throw Error((0,m.default)(5));return t}var tV=e.i(1232),tU=e.i(25542),tz=e.i(36953),tq=e.i(52868),tG=e.i(45886);let tY={...tG.popupStoreSelectors,disabled:(0,tU.createSelector)(e=>"menubar"===e.parent.type&&e.parent.context.disabled||e.disabled),modal:(0,tU.createSelector)(e=>{var t;return(void 0===e.parent.type||"context-menu"===e.parent.type)&&(null==(t=e.modal)||t)}),openMethod:(0,tU.createSelector)(e=>e.openMethod),allowMouseEnter:(0,tU.createSelector)(e=>e.allowMouseEnter),stickIfOpen:(0,tU.createSelector)(e=>e.stickIfOpen),parent:(0,tU.createSelector)(e=>e.parent),rootId:(0,tU.createSelector)(e=>"menu"===e.parent.type?e.parent.store.select("rootId"):void 0!==e.parent.type?e.parent.context.rootId:e.rootId),activeIndex:(0,tU.createSelector)(e=>e.activeIndex),isActive:(0,tU.createSelector)((e,t)=>e.activeIndex===t),hoverEnabled:(0,tU.createSelector)(e=>e.hoverEnabled),instantType:(0,tU.createSelector)(e=>e.instantType),lastOpenChangeReason:(0,tU.createSelector)(e=>e.openChangeReason),floatingTreeRoot:(0,tU.createSelector)(e=>"menu"===e.parent.type?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:(0,tU.createSelector)(e=>e.floatingNodeId),floatingParentNodeId:(0,tU.createSelector)(e=>e.floatingParentNodeId),itemProps:(0,tU.createSelector)(e=>e.itemProps),closeDelay:(0,tU.createSelector)(e=>e.closeDelay),hasViewport:(0,tU.createSelector)(e=>e.hasViewport),keyboardEventRelay:(0,tU.createSelector)(e=>e.keyboardEventRelay?e.keyboardEventRelay:"menu"===e.parent.type?e.parent.store.select("keyboardEventRelay"):void 0)};class tX extends tz.ReactStore{setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){let n=(0,ev.useRefWithInit)(()=>new tX(t)).current;return null!=e?e:n}constructor(e){super({...{...(0,tG.createInitialPopupStoreState)(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new tq.FloatingTreeStore,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:eO.EMPTY_OBJECT,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1},...e},{positionerRef:r.createRef(),popupRef:r.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1}
1,triggerFocusTargetRef:r.createRef(),beforeContentFocusGuardRef:r.createRef(),onOpenChangeComplete:void 0,triggerElements:new ta.PopupTriggerMap},tY),(0,ep._)(this,"unsubscribeParentListener",null),this.unsubscribeParentListener=this.observe("parent",e=>{var t;if(null==(t=this.unsubscribeParentListener)||t.call(this),"menu"===e.type){let t=e.store.select("rootId"),n=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select("rootId"),s=e.store.select("floatingTreeRoot"),o=e.store.select("keyboardEventRelay");(t!==i||n!==s||r!==o)&&(t=i,n=s,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}void 0!==e.type&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}}var tK=e.i(24981);let tJ=r.createContext(void 0);function tZ(){return r.useContext(tJ)}let tQ=(0,tI.fastComponent)(function(e){let n,{children:i,open:s,onOpenChange:o,onOpenChangeComplete:a,defaultOpen:l=!1,disabled:u=!1,modal:c,loopFocus:d=!0,orientation:f="vertical",actionsRef:h,closeParentOnEsc:p=!1,handle:g,triggerId:v,defaultTriggerId:m=null,highlightItemOnHover:_=!0}=e,y=C(!0),E=x(!0),w=tB(!0),S=tZ(),R=r.useMemo(()=>S&&E?{type:"menu",store:E.store}:w?{type:"menubar",context:w}:y&&!E?{type:"context-menu",context:y}:{type:void 0},[y,E,w,S]),k=tX.useStore(null==g?void 0:g.store,{open:l,openProp:s,activeTriggerId:m,triggerIdProp:v,parent:R});(0,tO.useOnFirstRender)(()=>{void 0===s&&!1===k.state.open&&!0===l&&k.update({open:!0,activeTriggerId:m})}),k.useControlledProp("openProp",s),k.useControlledProp("triggerIdProp",v),k.useContextCallback("onOpenChangeComplete",a);let O=k.useState("floatingTreeRoot"),I=(0,eh.useFloatingNodeId)(O),A=(0,eh.useFloatingParentNodeId)();(0,H.useIsoLayoutEffect)(()=>{y&&!E?k.update({parent:{type:"context-menu",context:y},floatingNodeId:I,floatingParentNodeId:A}):E&&k.update({floatingNodeId:I,floatingParentNodeId:A})},[y,E,I,A,k]);let M=k.useState("open"),N=k.useState("activeTriggerElement"),F=k.useState("positionerElement"),D=k.useState("hoverEnabled"),j=k.useState("disabled"),$=k.useState("lastOpenChangeReason"),W=k.useState("parent"),B=k.useState("activeIndex"),V=k.useState("payload"),U=k.useState("floatingParentNodeId"),z=r.useRef(null),q=null!=U,{openMethod:G,triggerProps:X}=(0,tV.useOpenInteractionType)(M);k.useSyncedValues({disabled:u,modal:void 0===W.type?c:void 0,openMethod:G,rootId:(0,ts.useId)()}),(0,tK.useImplicitActiveTrigger)(k);let{forceUnmount:K}=(0,tK.useOpenStateTransitions)(M,k,()=>{k.update({allowMouseEnter:!1,stickIfOpen:!0})}),J=r.useRef("context-menu"!==W.type),Z=(0,el.useTimeout)();r.useEffect(()=>{if(M||(z.current=null),"context-menu"===W.type){if(!M){Z.clear(),J.current=!1;return}Z.start(500,()=>{J.current=!0})}},[Z,M,W.type]),(0,H.useIsoLayoutEffect)(()=>{M||D||k.set("hoverEnabled",!0)},[M,D,k]);let Q=r.useRef(!0),ee=(0,el.useTimeout)(),et=(0,P.useStableCallback)((e,t)=>{var n,r,i,s;let a=t.reason;if(M===e&&t.trigger===N&&$===a||(t.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||(t.trigger=null!=N?N:void 0),null==o||o(e,t),t.isCanceled))return;k.state.floatingRootContext.dispatchOpenChange(e,t);let l=t.event;if(!1===e&&(null==l?void 0:l.type)==="click"&&"touch"===l.pointerType&&!Q.current)return;if(!e&&null!==B){let e=k.context.itemDomElements.current[B];queueMicrotask(()=>{null==e||e.setAttribute("tabindex","-1")})}e&&a===T.REASONS.triggerFocus?(Q.current=!1,ee.start(300,()=>{Q.current=!0})):(Q.current=!0,ee.clear());let u=(a===T.REASONS.triggerPress||a===T.REASONS.itemPress)&&0===l.detail&&(null==l?void 0:l.isTrusted),c=!e&&(a===T.REASONS.escapeKey||null==a),d={open:e,openChangeReason:a};z.current=null!=(r=t.event)?r:null;let f=null!=(i=null==(n=t.trigger)?void 0:n.id)?i:null;(f||e)&&(d.activeTriggerId=f,d.activeTriggerElement=null!=(s=t.trigger)?s:null),k.update(d),"menubar"===W.type&&(a===T.REASONS.triggerFocus||a===T.REASONS.focusOut||a===T.REASONS.triggerHover||a===T.REASONS.listNavigation||a===T.REASONS.siblingOpen)?k.set("instantType","group"):u||c?k.set("instantType",u?"click":"dismiss"):k.set("instantType",void 0)}),en=r.useCallback(e=>{let t=(0,Y.createChangeEventDetails)(e);return t.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},t},[k]),er=r.useCallback(()=>{k.setOpen(!1,en(T.REASONS.imperativeAction))},[k,en]);r.useImperativeHandle(h,()=>({unmount:K,close:er}),[K,er]),"context-menu"===W.type&&(n=W.context),r.useImperativeHandle(null==n?void 0:n.positionerRef,()=>F,[F]),r.useImperativeHandle(null==n?void 0:n.actionsRef,()=>({setOpen:et}),[et]);let ei=(0,tW.useSyncedFloatingRootContext)({popupStore:k,onOpenChange:et}),eo=ei.context.events;r.useEffect(()=>{let e=e=>{let{open:t,eventDetails:n}=e;return et(t,n)};return eo.on("setOpen",e),()=>{null==eo||eo.off("setOpen",e)}},[eo,et]);let ea=(0,tP.useDismiss)(ei,{enabled:!j,bubbles:{escapeKey:p&&"menu"===W.type},outsidePress(){var e;return"context-menu"!==W.type||(null==(e=z.current)?void 0:e.type)==="contextmenu"||J.current},externalTree:q?O:void 0}),ef=(0,t$.useRole)(ei,{role:"menu"}
1),ep=tu(),eg=r.useCallback(e=>{k.select("activeIndex")!==e&&k.set("activeIndex",e)},[k]),ev=function(e,t){let n="rootStore"in e?e.rootStore:e,i=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("domReferenceElement"),a=n.context.dataRef,{listRef:l,activeIndex:u,onNavigate:c=()=>{},enabled:d=!0,selectedIndex:f=null,allowEscape:h=!1,loopFocus:p=!1,nested:g=!1,rtl:v=!1,virtual:m=!1,focusItemOnOpen:_="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:E="vertical",parentOrientation:w,cols:S=1,id:R,resetOnPointerLeave:k=!0,externalTree:C}=t,O=(0,ed.getFloatingFocusElement)(s),I=(0,e$.useValueAsRef)(O),A=(0,eh.useFloatingParentNodeId)(),M=(0,eh.useFloatingTree)(C);(0,H.useIsoLayoutEffect)(()=>{a.current.orientation=E},[a,E]);let N=(0,ed.isTypeableCombobox)(o),F=r.useRef(_),L=r.useRef(null!=f?f:-1),D=r.useRef(null),j=r.useRef(!0),$=(0,P.useStableCallback)(e=>{c(-1===L.current?null:L.current,e)}),W=r.useRef($),B=r.useRef(!!s),V=r.useRef(i),U=r.useRef(!1),z=r.useRef(!1),q=r.useRef(null),G=(0,e$.useValueAsRef)(x),X=(0,e$.useValueAsRef)(i),K=(0,e$.useValueAsRef)(f),J=(0,e$.useValueAsRef)(k),Z=(0,P.useStableCallback)(()=>{function e(e){m?null==M||M.events.emit("virtualfocus",e):q.current=(0,tN.enqueueFocus)(e,{sync:U.current,preventScroll:!0})}let t=l.current[L.current],n=z.current;t&&e(t),(U.current?e=>e():requestAnimationFrame)(()=>{let r=l.current[L.current]||t;if(r&&(t||e(r),et&&(n||!j.current))){var i;null==(i=r.scrollIntoView)||i.call(r,{block:"nearest",inline:"nearest"})}})});(0,H.useIsoLayoutEffect)(()=>{d&&(i&&s?(L.current=null!=f?f:-1,F.current&&null!=f&&(z.current=!0,$())):B.current&&(L.current=-1,W.current()))},[d,i,s,f,$]),(0,H.useIsoLayoutEffect)(()=>{if(d){if(!i){U.current=!1;return}if(s)if(null==u){if(U.current=!1,null!=K.current)return;if(B.current&&(L.current=-1,Z()),(!V.current||!B.current)&&F.current&&(null!=D.current||!0===F.current&&null==D.current)){let e=0,t=()=>{null==l.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(L.current=null==D.current||tj(D.current,E,v)||g?(0,tM.getMinListIndex)(l):(0,tM.getMaxListIndex)(l),D.current=null,$())};t()}}else(0,tM.isIndexOutOfListBounds)(l.current,u)||(L.current=u,Z(),z.current=!1)}},[d,i,s,u,K,g,l,E,v,$,Z,G]),(0,H.useIsoLayoutEffect)(()=>{var e,t;if(!d||s||!M||m||!B.current)return;let n=M.nodesRef.current,r=null==(t=n.find(e=>e.id===A))||null==(e=t.context)?void 0:e.elements.floating,i=(0,ec.activeElement)((0,eu.ownerDocument)(s)),o=n.some(e=>e.context&&(0,ec.contains)(e.context.elements.floating,i));r&&!o&&j.current&&r.focus({preventScroll:!0})},[d,s,M,A,m]),(0,H.useIsoLayoutEffect)(()=>{W.current=$,V.current=i,B.current=!!s}),(0,H.useIsoLayoutEffect)(()=>{i||(D.current=null,F.current=_)},[i,_]);let Q=null!=u,ee=(0,P.useStableCallback)(e=>{if(!X.current)return;let t=l.current.indexOf(e.currentTarget);-1!==t&&(L.current!==t||u!==t)&&(L.current=t,$(e))}),et=r.useMemo(()=>({onFocus(e){U.current=!0,ee(e)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},onMouseMove(e){U.current=!0,z.current=!1,y&&ee(e)},onPointerLeave(e){var t;if(!X.current||!j.current||"touch"===e.pointerType)return;U.current=!0;let n=e.relatedTarget;if(!(function(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}(e)||!y||l.current.includes(n))&&J.current&&(null==(t=q.current)||t.call(q),q.current=null,L.current=-1,$(e),!m)){let e=I.current,t=(0,ec.activeElement)((0,eu.ownerDocument)(e));e&&(0,ec.contains)(e,t)&&e.focus({preventScroll:!0})}}}),[ee,X,I,y,l,$,J,m]),en=r.useCallback(()=>{var e,t,n;return null!=w?w:null==M||null==(n=M.nodesRef.current.find(e=>e.id===A))||null==(t=n.context)||null==(e=t.dataRef)?void 0:e.current.orientation},[A,M,w]),er=(0,P.useStableCallback)(e=>{if(j.current=!1,U.current=!0,229===e.which||!X.current&&e.currentTarget===I.current)return;if(g&&function(e,t,n,r){let i=n?e===tF.ARROW_RIGHT:e===tF.ARROW_LEFT,s=e===tF.ARROW_UP;return"both"===t||"horizontal"===t&&r&&r>1?"Escape"===e:tL(t,i,s)}(e.key,E,v,S)){tD(e.key,en())||(0,eE.stopEvent)(e),n.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.listNavigation,e.nativeEvent)),(0,es.isHTMLElement)(o)&&(m?null==M||M.events.emit("virtualfocus",o):o.focus());return}let t=L.current,r=(0,tM.getMinListIndex)(l,x),s=(0,tM.getMaxListIndex)(l,x);if(N||("Home"===e.key&&((0,eE.stopEvent)(e),L.current=r,$(e)),"End"===e.key&&((0,eE.stopEvent)(e),L.current=s,$(e))),S>1){let t=Array.from({length:l.current.length},()=>({width:1,height:1})),n=(0,tM.createGridCellMap)(t,S,!1),i=n.findIndex(e=>null!=e&&!(0,tM.isListIndexDisabled)(l.current,e,x)),o=n.reduce((e,t,n
1)=>null==t||(0,tM.isListIndexDisabled)(l.current,t,x)?e:n,-1),a=n[(0,tM.getGridNavigatedIndex)(n.map(e=>null!=e?l.current[e]:null),{event:e,orientation:E,loopFocus:p,rtl:v,cols:S,disabledIndices:(0,tM.getGridCellIndices)([...("function"!=typeof x?x:null)||l.current.map((e,t)=>(0,tM.isListIndexDisabled)(l.current,t,x)?t:void 0),void 0],n),minIndex:i,maxIndex:o,prevIndex:(0,tM.getGridCellIndexOfCorner)(L.current>s?r:L.current,t,n,S,e.key===tF.ARROW_DOWN?"bl":e.key===(v?tF.ARROW_LEFT:tF.ARROW_RIGHT)?"tr":"tl"),stopEvent:!0})];if(null!=a&&(L.current=a,$(e)),"both"===E)return}if(tD(e.key,E)){if((0,eE.stopEvent)(e),i&&!m&&(0,ec.activeElement)(e.currentTarget.ownerDocument)===e.currentTarget){L.current=tj(e.key,E,v)?r:s,$(e);return}tj(e.key,E,v)?p?t>=s?h&&t!==l.current.length?L.current=-1:(U.current=!1,L.current=r):L.current=(0,tM.findNonDisabledListIndex)(l.current,{startingIndex:t,disabledIndices:x}):L.current=Math.min(s,(0,tM.findNonDisabledListIndex)(l.current,{startingIndex:t,disabledIndices:x})):p?t<=r?h&&-1!==t?L.current=l.current.length:(U.current=!1,L.current=s):L.current=(0,tM.findNonDisabledListIndex)(l.current,{startingIndex:t,decrement:!0,disabledIndices:x}):L.current=Math.max(r,(0,tM.findNonDisabledListIndex)(l.current,{startingIndex:t,decrement:!0,disabledIndices:x})),(0,tM.isIndexOutOfListBounds)(l.current,L.current)&&(L.current=-1),$(e)}}),ei=r.useMemo(()=>m&&i&&Q&&{"aria-activedescendant":"".concat(R,"-").concat(u)},[m,i,Q,R,u]),eo=r.useMemo(()=>({"aria-orientation":"both"===E?void 0:E,...!N?ei:{},onKeyDown(e){if("Tab"===e.key&&e.shiftKey&&i&&!m){let t=(0,ec.getTarget)(e.nativeEvent);if(t&&!(0,ec.contains)(I.current,t))return;(0,eE.stopEvent)(e),n.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.focusOut,e.nativeEvent)),(0,es.isHTMLElement)(o)&&o.focus();return}er(e)},onPointerMove(){j.current=!0}}),[ei,er,I,E,N,n,i,m,o]),ea=r.useMemo(()=>{function e(e){"auto"===_&&(0,eE.isVirtualClick)(e.nativeEvent)&&(F.current=!m)}function t(e){F.current=_,"auto"===_&&(0,eE.isVirtualPointerEvent)(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(e){var t,r;let i=n.select("open");j.current=!1;let s=e.key.startsWith("Arrow"),o=(t=e.key,r=en(),tL(r,v?t===tF.ARROW_LEFT:t===tF.ARROW_RIGHT,t===tF.ARROW_DOWN)),a=tD(e.key,E),u=(g?o:a)||"Enter"===e.key||""===e.key.trim();if(m&&i)return er(e);if(i||b||!s){if(u){let t=tD(e.key,en());D.current=g&&t?null:e.key}if(g){o&&((0,eE.stopEvent)(e),i?(L.current=(0,tM.getMinListIndex)(l,G.current),$(e)):n.setOpen(!0,(0,Y.createChangeEventDetails)(T.REASONS.listNavigation,e.nativeEvent,e.currentTarget)));return}a&&(null!=K.current&&(L.current=K.current),(0,eE.stopEvent)(e),!i&&b?n.setOpen(!0,(0,Y.createChangeEventDetails)(T.REASONS.listNavigation,e.nativeEvent,e.currentTarget)):er(e),i&&$(e))}},onFocus(e){n.select("open")&&!m&&(L.current=-1,$(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[er,G,_,l,g,$,n,b,E,en,v,K,m]),el=r.useMemo(()=>({...ei,...ea}),[ei,ea]);return r.useMemo(()=>d?{reference:el,floating:eo,item:et,trigger:ea}:{},[d,el,eo,ea,et])}(ei,{enabled:!j,listRef:k.context.itemDomElements,activeIndex:B,nested:void 0!==W.type,loopFocus:d,orientation:f,parentOrientation:"menubar"===W.type?W.context.orientation:void 0,rtl:"rtl"===ep,disabledIndices:eO.EMPTY_ARRAY,onNavigate:eg,openOnArrowKeyDown:"context-menu"!==W.type,externalTree:q?O:void 0,focusItemOnHover:_}),em=r.useCallback(e=>{k.context.typingRef.current=e},[k]),e_=function(e,t){var n;let i="rootStore"in e?e.rootStore:e,s=i.context.dataRef,o=i.useState("open"),{listRef:a,elementsRef:l,activeIndex:u,onMatch:c,onTypingChange:d,enabled:f=!0,resetMs:h=750,selectedIndex:p=null}=t,g=(0,el.useTimeout)(),v=r.useRef(""),m=r.useRef(null!=(n=null!=p?p:u)?n:-1),_=r.useRef(null);(0,H.useIsoLayoutEffect)(()=>{(o||null===p)&&(g.clear(),_.current=null,""!==v.current&&(v.current=""))},[o,p,g]),(0,H.useIsoLayoutEffect)(()=>{if(o&&""===v.current){var e;m.current=null!=(e=null!=p?p:u)?e:-1}},[o,p,u]);let y=(0,P.useStableCallback)(e=>{e?s.current.typing||(s.current.typing=e,null==d||d(e)):s.current.typing&&(s.current.typing=e,null==d||d(e))}),b=(0,P.useStableCallback)(e=>{var t,n;function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0===e.length)return -1;let r=(n%e.length+e.length)%e.length,i=t.toLocaleLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length,s=e[n];if((null==s?void 0:s.toLocaleLowerCase().startsWith(i))&&function(e){let t=null==l?void 0:l.current[e];return!t||(0,tM.isElementVisible)(t)}(n))return n}return -1}let i=a.current;if(v.current.length>0&&" "===e.key&&((0,eE.stopEvent)(e),y(!0)),v.current.length>0&&" "!==v.current[0]&&-1===r(i,v.current)&&" "!==e.key&&y(!1),null==i||1!==e.ke
1y.length||e.ctrlKey||e.metaKey||e.altKey)return;o&&" "!==e.key&&((0,eE.stopEvent)(e),y(!0));let s=""===v.current;s&&(m.current=null!=(t=null!=p?p:u)?t:-1),i.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&v.current===e.key&&(v.current="",m.current=_.current),v.current+=e.key,g.start(h,()=>{v.current="",m.current=_.current,y(!1)});let d=s?null!=(n=null!=p?p:u)?n:-1:m.current,f=r(i,v.current,(null!=d?d:0)+1);-1!==f?(null==c||c(f),_.current=f):" "!==e.key&&(v.current="",y(!1))}),x=(0,P.useStableCallback)(e=>{let t=e.relatedTarget,n=i.select("domReferenceElement"),r=i.select("floatingElement"),s=(0,ec.contains)(n,t),o=(0,ec.contains)(r,t);s||o||(g.clear(),v.current="",m.current=_.current,y(!1))}),E=r.useMemo(()=>({onKeyDown:b,onBlur:x}),[b,x]),w=r.useMemo(()=>({onKeyDown:b,onBlur:x}),[b,x]);return r.useMemo(()=>f?{reference:E,floating:w}:{},[f,E,w])}(ei,{listRef:k.context.itemLabels,elementsRef:k.context.itemDomElements,activeIndex:B,resetMs:eT.TYPEAHEAD_RESET_MS,onMatch:e=>{M&&e!==B&&k.set("activeIndex",e)},onTypingChange:em}),{getReferenceProps:ey,getFloatingProps:eb,getItemProps:ex,getTriggerProps:ew}=(0,tA.useInteractions)([ea,ef,ev,e_]),eS=r.useMemo(()=>{let e=(0,L.mergeProps)(ey(),{onMouseMove(){k.set("allowMouseEnter",!0)}},X);return delete e.role,e},[ey,k,X]),eR=r.useMemo(()=>{let e=ew();if(!e)return e;let t=(0,L.mergeProps)(e,X);return delete t.role,delete t["aria-controls"],t},[ew,X]),ek=r.useMemo(()=>eb({onMouseMove(){k.set("allowMouseEnter",!0),"menu"===W.type&&k.set("hoverEnabled",!1)},onClick(){k.select("hoverEnabled")&&k.set("hoverEnabled",!1)},onKeyDown(e){let t=k.select("keyboardEventRelay");t&&!e.isPropagationStopped()&&t(e)}}),[eb,W.type,k]),eC=r.useMemo(()=>ex(),[ex]);k.useSyncedValues({floatingRootContext:ei,activeTriggerProps:eS,inactiveTriggerProps:eR,popupProps:ek,itemProps:eC});let eI=r.useMemo(()=>({store:k,parent:R}),[k,R]),eP=(0,t.jsx)(b.Provider,{value:eI,children:"function"==typeof i?i({payload:V}
1):i});return void 0===W.type||"context-menu"===W.type?(0,t.jsx)(eh.FloatingTree,{externalTree:O,children:eP}):eP});function t0(e){let n=x().store,i=r.useMemo(()=>({parentMenu:n}),[n]);return(0,t.jsx)(tJ.Provider,{value:i,children:(0,t.jsx)(tQ,{...e})})}let t1=.1*.1;function t2(e,t,n,r,i,s){return r>=t!=s>=t&&e<=(i-n)*(t-r)/(s-r)+n}function t5(e,t,n,r,i,s,o,a,l,u){let c=!1;return t2(e,t,n,r,i,s)&&(c=!c),t2(e,t,i,s,o,a)&&(c=!c),t2(e,t,o,a,l,u)&&(c=!c),t2(e,t,l,u,n,r)&&(c=!c),c}function t3(e,t,n,r,i,s){let o=Math.min(n,i),a=Math.max(n,i),l=Math.min(r,s),u=Math.max(r,s);return e>=o&&e<=a&&t>=l&&t<=u}function t4(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{blockPointerEvents:t=!1}=e,n=new el.Timeout,r=e=>{let{x:t,y:r,placement:i,elements:s,onClose:o,nodeId:a,tree:l}=e,u=null==i?void 0:i.split("-")[0],c=!1,d=null,f=null,h="undefined"!=typeof performance?performance.now():0;return function(e){n.clear();let i=s.domReference,p=s.floating;if(!i||!p||null==u||null==t||null==r)return;let{clientX:g,clientY:v}=e,m=(0,ec.getTarget)(e),_="mouseleave"===e.type,y=(0,ec.contains)(p,m),b=(0,ec.contains)(i,m);if(y&&(c=!0,!_))return;if(b&&(c=!1,!_)){c=!0;return}if(_&&(0,es.isElement)(e.relatedTarget)&&(0,ec.contains)(p,e.relatedTarget))return;function x(){return!!(l&&(0,ef.getNodeChildren)(l.nodesRef.current,a).length>0)}function E(){x()||(n.clear(),o())}if(x())return;let w=i.getBoundingClientRect(),S=p.getBoundingClientRect(),R=t>S.right-S.width/2,k=r>S.bottom-S.height/2,C=S.width>w.width,T=S.height>w.height,O=(C?w:S).left,I=(C?w:S).right,P=(T?w:S).top,A=(T?w:S).bottom;if("top"===u&&r>=w.bottom-1||"bottom"===u&&r<=w.top+1||"left"===u&&t>=w.right-1||"right"===u&&t<=w.left+1)return void E();let M=!1;switch(u){case"top":M=t3(g,v,O,w.top+1,I,S.bottom-1);break;case"bottom":M=t3(g,v,O,S.top+1,I,w.bottom-1);break;case"left":M=t3(g,v,S.right-1,A,w.left+1,P);break;
1case"right":M=t3(g,v,w.right-1,A,S.left+1,P)}if(M)return;if(c&&(!(g>=w.x)||!(g<=w.x+w.width)||!(v>=w.y)||!(v<=w.y+w.height))||!_&&function(e,t){let n=performance.now(),r=n-h;if(null===d||null===f||0===r)return d=e,f=t,h=n,!1;let i=e-d,s=t-f;return d=e,f=t,h=n,i*i+s*s<r*r*t1}(g,v))return void E();let N=!1;switch(u){case"top":{let e=C?.25:2,n=r+.5+1,i=R||C?S.bottom-.5:S.top,s=R?C?S.bottom-.5:S.top:S.bottom-.5;N=t5(g,v,C||R?t+e:t-e,n,C?t-e:R?t+e:t-e,n,S.left,i,S.right,s);break}case"bottom":{let e=C?.25:2,n=r-.5,i=R||C?S.top+.5:S.bottom,s=R?C?S.top+.5:S.bottom:S.top+.5;N=t5(g,v,C||R?t+e:t-e,n,C?t-e:R?t+e:t-e,n,S.left,i,S.right,s);break}case"left":{let e=T?.25:2,n=t+.5+1,i=k||T?S.right-.5:S.left,s=k?T?S.right-.5:S.left:S.right-.5;N=t5(g,v,i,S.top,s,S.bottom,n,T||k?r+e:r-e,n,T?r-e:k?r+e:r-e);break}case"right":{let e=T?.25:2,n=t-.5,i=k||T?S.left+.5:S.right,s=k?T?S.left+.5:S.right:S.left+.5;N=t5(g,v,n,T||k?r+e:r-e,n,T?r-e:k?r+e:r-e,i,S.top,s,S.bottom)}}N?c||n.start(40,E):E()}};return r.__options={...e,blockPointerEvents:t},r}var t8=e.i(57336),t6=e.i(79118);let t9=D.isMac&&D.isSafari,t7={current:null};function ne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="rootStore"in e?e.rootStore:e,{dataRef:i,events:s}=n.context,{enabled:o=!0,delay:a=0,handleClose:l=null,mouseOnly:u=!1,restMs:c=0,move:d=!0,triggerElementRef:f=t7,externalTree:h,isActiveTrigger:p=!0,getHandleCloseContext:g,isClosing:v}=t,m=(0,eh.useFloatingTree)(h),_=ex(n),y=r.useRef(!1),b=(0,e$.useValueAsRef)(l),x=(0,e$.useValueAsRef)(a),E=(0,e$.useValueAsRef)(c),w=(0,e$.useValueAsRef)(o),S=(0,e$.useValueAsRef)(v);if(p){var R;_.handleCloseOptions=null==(R=b.current)?void 0:R.__options}let k=(0,P.useStableCallback)(()=>{var e;return eR(null==(e=i.current.openEvent)?void 0:e.type,_.interactedInside)}),C=(0,P.useStableCallback)(e=>(0,ed.isTargetInsideEnabledTrigger)(e,n.context.triggerElements)),O=(0,P.useStableCallback)((e,t,r)=>{let i=n.context.triggerElements;return i.hasElement(t)?!e||!(0,ec.contains)(e,t):!!(0,es.isElement)(r)&&i.hasMatchingElement(e=>(0,ec.contains)(e,r))&&(!e||!(0,ec.contains)(e,r))}),I=(0,P.useStableCallback)(function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=ew(x.current,"close",_.pointerType);r?_.openChangeTimeout.start(r,()=>{n.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.triggerHover,e)),null==m||m.events.emit("floating.closed",e)}):t&&(_.openChangeTimeout.clear(),n.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.triggerHover,e)),null==m||m.events.emit("floating.closed",e))}),A=(0,P.useStableCallback)(()=>{_.handler&&((0,eu.ownerDocument)(n.select("domReferenceElement")).removeEventListener("mousemove",_.handler),_.handler=void 0)}),M=(0,P.useStableCallback)(()=>{ey(_)});return r.useEffect(()=>A,[A]),r.useEffect(()=>{if(o)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){e.open?y.current=!1:(y.current=e.reason===T.REASONS.triggerHover,A(),_.openChangeTimeout.clear(),_.restTimeout.clear(),_.blockMouseMove=!0,_.restTimeoutPending=!1)}},[o,s,_,A]),r.useEffect(()=>{var e;if(!o)return;let t=null!=(e=f.current)?e:p?n.select("domReferenceElement"):null;if((0,es.isElement)(t))return d?(0,ea.mergeCleanups)((0,eo.addEventListener)(t,"mousemove",r,{once:!0}),(0,eo.addEventListener)(t,"mouseenter",r),(0,eo.addEventListener)(t,"mouseleave",s)):(0,ea.mergeCleanups)((0,eo.addEventListener)(t,"mouseenter",r),(0,eo.addEventListener)(t,"mouseleave",s));function r(e){var t,r,i;if(_.openChangeTimeout.clear(),_.blockMouseMove=!1,u&&!(0,eE.isMouseLikePointerType)(_.pointerType))return;let s=eS(E.current),o=ew(x.current,"open",_.pointerType),a=(0,ec.getTarget)(e),l=null!=(r=e.currentTarget)?r:null,c=n.select("domReferenceElement"),d=l;if((0,es.isElement)(a)&&!n.context.triggerElements.hasElement(a)){for(let e of n.context.triggerElements.elements())if((0,ec.contains)(e,a)){d=e;break}}(0,es.isElement)(l)&&(0,es.isElement)(c)&&!n.context.triggerElements.hasElement(l)&&(0,ec.contains)(l,c)&&(d=c);let f=null!=d&&O(c,d,a),h=n.select("open"),p=null!=(i=null==(t=S.current)?void 0:t.call(S))?i:"ending"===n.select("transitionStatus"),g=!h&&p&&y.current,v=!f&&(0,es.isElement)(d)&&(0,es.isElement)(c)&&(0,ec.contains)(c,d)&&g,m=s>0&&!o,b=!h||f;if(f&&(h||g)||v)return void n.setOpen(!0,(0,Y.createChangeEventDetails)(T.REASONS.triggerHover,e,d));!m&&(o?_.openChangeTimeout.start(o,()=>{b&&n.setOpen(!0,(0,Y.createChangeEventDetails)(T.REASONS.triggerHover,e,d))}):b&&n.setOpen(!0,(0,Y.createChangeEventDetails)(T.REASONS.triggerHover,e,d)))}function s(e){var t;if(k())return void M();A();let r=n.select("domReferenceElement"),s=(0,eu.ownerDocument)(r);_.restTimeout.clear(),_.restTimeoutPending=!1;let o=null!=(t=i.current.floatingContext)?t:null==g?void 0:g();if(!C(e.relatedTarget)){if(b.current&&o){n.select("open")||_.openChangeTimeout.clear();let t=f.current;_.handler=b.current({...o,tree:m,x:e.clientX,y:e.clientY,onClose(){M(),A(),w.current&&!k()&&t===n.select("domReferenceElement")&&I(e,!0)}}),s.addEventListener("mousemove",_.handler),_.handler(e);return}"touch"===_.pointerType&&(0,ec.contains)(n.select("floatingElement"),e.relatedTarget)||I(e)}}},[A,M,i,x,I,n,o,b,_,p,O,k,C,u,d,E,f,m,w,g,S]),r.useMemo(()=>
1{if(o)return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){var t,r,i,s;let{nativeEvent:o}=e,a=e.currentTarget,l=n.select("domReferenceElement"),c=n.select("open"),d=O(l,a,e.target);if(u&&!(0,eE.isMouseLikePointerType)(_.pointerType))return;if(c&&d&&(null==(t=_.handleCloseOptions)?void 0:t.blockPointerEvents)){let e=n.select("floatingElement");if(e){let t=null!=(s=null==(i=_.handleCloseOptions)||null==(r=i.getScope)?void 0:r.call(i))?s:a.ownerDocument.body;eb(_,{scopeElement:t,referenceElement:a,floatingElement:e})}}let f=eS(E.current);function h(){if(_.restTimeoutPending=!1,k())return;let e=n.select("open");_.blockMouseMove||e&&!d||n.setOpen(!0,(0,Y.createChangeEventDetails)(T.REASONS.triggerHover,o,a))}(!c||d)&&0!==f&&(!d&&_.restTimeoutPending&&e.movementX**2+e.movementY**2<2||(_.restTimeout.clear(),"touch"===_.pointerType?e7.flushSync(()=>{h()}):d&&c?h():(_.restTimeoutPending=!0,_.restTimeout.start(f,h))))}};function e(e){_.pointerType=e.pointerType}},[o,_,k,O,u,n,E])}var nt=e.i(40979);function nn(e){let{render:t,className:n,style:i,state:s=eO.EMPTY_OBJECT,props:o=eO.EMPTY_ARRAY,refs:a=eO.EMPTY_ARRAY,metadata:l,stateAttributesMapping:u,tag:c="div",...d}=e,{compositeProps:f,compositeRef:h}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:i}=(0,nt.useCompositeRootContext)(),{ref:s,index:o}=U(e),a=n===o,l=r.useRef(null),u=(0,N.useMergedRefs)(s,l);return{compositeProps:r.useMemo(()=>({tabIndex:a?0:-1,onFocus(){i(o)},onMouseMove(){let e=l.current;if(!t||!e)return;let n=e.hasAttribute("disabled")||"true"===e.ariaDisabled;a||n||e.focus()}}),[a,i,o,t]),compositeRef:u,index:o}}({metadata:l});return(0,E.useRenderElement)(c,e,{state:s,ref:[...a,h],props:[f,...o,d],stateAttributesMapping:u})}var nr=e.i(90531),ni=e.i(7680);let ns=(0,tI.fastComponentRef)(function(e,n){var i;let{render:s,className:o,disabled:a=!1,nativeButton:l=!0,id:u,openOnHover:c,delay:d=100,closeDelay:f=0,handle:h,payload:p,style:g,...v}=e,_=x(!0),y=null!=(i=null==h?void 0:h.store)?i:null==_?void 0:_.store;if(!y)throw Error((0,m.default)(85));let b=(0,z.useBaseUiId)(u),S=y.useState("isTriggerActive",b),R=y.useState("floatingRootContext"),k=y.useState("isOpenedByTrigger",b),O=r.useRef(null),I=function(){let e=C(!0),t=x(!0),n=tB(!0);return r.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}(),A=(0,nt.useCompositeRootContext)(!0),M=(0,eh.useFloatingTree)(),N=r.useMemo(()=>null!=M?M:new tq.FloatingTreeStore,[M]),L=(0,eh.useFloatingNodeId)(N),D=(0,eh.useFloatingParentNodeId)(),{registerTrigger:j,isMountedByThisTrigger:$}=(0,tK.useTriggerDataForwarding)(b,O,y,{payload:p,closeDelay:f,parent:I,floatingTreeRoot:N,floatingNodeId:L,floatingParentNodeId:D,keyboardEventRelay:null==A?void 0:A.relayKeyboardEvent}),W="menubar"===I.type,B=y.useState("disabled"),V=a||B||W&&I.context.disabled,{getButtonProps:U,buttonRef:q}=(0,F.useButton)({disabled:V,native:l});r.useEffect(()=>{k||void 0!==I.type||(y.context.allowMouseUpTriggerRef.current=!1)},[y,k,I.type]);let G=r.useRef(null),X=(0,el.useTimeout)(),K=(0,P.useStableCallback)(e=>{if(!G.current)return;X.clear(),y.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if((0,ec.contains)(G.current,t)||(0,ec.contains)(y.select("positionerElement"),t)||t===G.current||null!=t&&function e(t){if((0,es.isHTMLElement)(t)&&t.hasAttribute("data-rootownerid")){var n;return null!=(n=t.getAttribute("data-rootownerid"))?n:void 0}if(!(0,es.isLastTraversableNode)(t))return e((0,es.getParentNode)(t))}(t)===y.select("rootId"))return;let n=function(e){let t=e.getBoundingClientRect(),n=(0,ej.ownerWindow)(e),r=n.getComputedStyle(e,"::before"),i=n.getComputedStyle(e,"::after");if("none"===r.content&&"none"===i.content)return t;let s=parseFloat(r.width)||0,o=parseFloat(r.height)||0,a=parseFloat(i.width)||0,l=parseFloat(i.height)||0,u=Math.max(t.width,s,a),c=Math.max(t.height,o,l),d=u-t.width,f=c-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}(G.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>
1=n.top-2&&e.clientY<=n.bottom+2||N.events.emit("close",{domEvent:e,reason:T.REASONS.cancelOpen})});r.useEffect(()=>{k&&y.select("lastOpenChangeReason")===T.REASONS.triggerHover&&(0,eu.ownerDocument)(G.current).addEventListener("mouseup",K,{once:!0})},[k,K,y]);let J=W&&I.context.hasSubmenuOpen,Z=ne(R,{enabled:(null!=c?c:J)&&!V&&"context-menu"!==I.type&&(!W||J&&!$),handleClose:t4({blockPointerEvents:!W}),mouseOnly:!0,move:!1,restMs:void 0===I.type?d:void 0,delay:{close:f},triggerElementRef:O,externalTree:N,isActiveTrigger:S,isClosing:()=>"ending"===y.select("transitionStatus")}),Q=function(e,t){let n=(0,el.useTimeout)(),[i,s]=r.useState(!1);return(0,H.useIsoLayoutEffect)(()=>{e&&"trigger-hover"===t?(s(!0),n.start(eT.PATIENT_CLICK_THRESHOLD,()=>{s(!1)})):e||(n.clear(),s(!1))},[e,t,n]),i}(k,y.select("lastOpenChangeReason")),ee=(0,t8.useClick)(R,{enabled:!V&&"context-menu"!==I.type,event:k&&W?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:void 0===I.type&&Q}),et=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="rootStore"in e?e.rootStore:e,{events:i,dataRef:s}=n.context,{enabled:o=!0,delay:a}=t,l=r.useRef(!1),u=r.useRef(null),c=(0,el.useTimeout)(),d=r.useRef(!0);r.useEffect(()=>{let e=n.select("domReferenceElement");if(!o)return;let t=(0,es.getWindow)(e);return(0,ea.mergeCleanups)((0,eo.addEventListener)(t,"blur",function(){let e=n.select("domReferenceElement");!n.select("open")&&(0,es.isHTMLElement)(e)&&e===(0,ec.activeElement)((0,eu.ownerDocument)(e))&&(l.current=!0)}),t9&&(0,eo.addEventListener)(t,"keydown",function(){d.current=!0},!0),t9&&(0,eo.addEventListener)(t,"pointerdown",function(){d.current=!1},!0))},[n,o]),r.useEffect(()=>{if(o)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){if(e.reason===T.REASONS.triggerPress||e.reason===T.REASONS.escapeKey){let e=n.select("domReferenceElement");(0,es.isElement)(e)&&(u.current=e,l.current=!0)}}},[i,o,n]);let f=r.useMemo(()=>({onMouseLeave(){l.current=!1,u.current=null},onFocus(e){let t=e.currentTarget;if(l.current){if(u.current===t)return;l.current=!1,u.current=null}let r=(0,ec.getTarget)(e.nativeEvent);if((0,es.isElement)(r)){if(t9&&!e.relatedTarget){if(!d.current&&!(0,ed.isTypeableElement)(r))return}else if(!(0,ed.matchesFocusVisible)(r))return}let i=(0,ed.isTargetInsideEnabledTrigger)(e.relatedTarget,n.context.triggerElements),{nativeEvent:s,currentTarget:o}=e,f="function"==typeof a?a():a;if(n.select("open")&&i||0===f||void 0===f)return void n.setOpen(!0,(0,Y.createChangeEventDetails)(T.REASONS.triggerFocus,s,o));c.start(f,()=>{l.current||n.setOpen(!0,(0,Y.createChangeEventDetails)(T.REASONS.triggerFocus,s,o))})},onBlur(e){l.current=!1,u.current=null;let t=e.relatedTarget,r=e.nativeEvent,i=(0,es.isElement)(t)&&t.hasAttribute((0,t6.createAttribute)("focus-guard"))&&"outside"===t.getAttribute("data-type");c.start(0,()=>{var e;let o=n.select("domReferenceElement"),a=(0,ec.activeElement)((0,eu.ownerDocument)(o));if(!t&&a===o||(0,ec.contains)(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,a)||(0,ec.contains)(o,a)||i)return;let l=null!=t?t:a;(0,ed.isTargetInsideEnabledTrigger)(l,n.context.triggerElements)||n.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.triggerFocus,r))})}}),[s,n,c,a]);return r.useMemo(()=>o?{reference:f,trigger:f}:{},[o,f])}(R,{enabled:!V&&J}),en=function(e){let{enabled:t=!0,mouseDownAction:n,open:i}=e,s=r.useRef(!1);return r.useMemo(()=>t?{onMouseDown:e=>{("open"===n&&!i||"close"===n&&i)&&(s.current=!0,(0,eu.ownerDocument)(e.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:e=>{s.current&&(s.current=!1,e.preventBaseUIHandler())}}:eO.EMPTY_OBJECT,[t,n,i])}({open:k,enabled:W,mouseDownAction:"open"}),er=(0,tA.useInteractions)([ee,et]),ei={disabled:V,open:k},ef=y.useState("triggerProps",$),ep=[G,n,q,j,O],eg=[er.getReferenceProps(),null!=Z?Z:eO.EMPTY_OBJECT,ef,{"aria-haspopup":"menu",id:b,onMouseDown:e=>{y.select("open")||(X.start(200,()=>{y.context.allowMouseUpTriggerRef.current=!0}),(0,eu.ownerDocument)(e.currentTarget).addEventListener("mouseup",K,{once:!0}))}},W?{role:"menuitem"}:{},en,v,U],{preFocusGuardRef:ev,handlePreFocusGuardFocus:em,handleFocusTargetFocus:e_}=function(e,t){let n=r.useRef(null),i=(0,P.useStableCallback)(t=>{e7.flushSync(()=>{e.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.focusOut,t.nativeEvent,t.currentTarget))});
1let r=(0,nr.getTabbableBeforeElement)(n.current);null==r||r.focus()});return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:(0,P.useStableCallback)(n=>{let r=e.select("positionerElement");if(r&&(0,nr.isOutsideEvent)(n,r)){var i;null==(i=e.context.beforeContentFocusGuardRef.current)||i.focus()}else{e7.flushSync(()=>{e.setOpen(!1,(0,Y.createChangeEventDetails)(T.REASONS.focusOut,n.nativeEvent,n.currentTarget))});let i=(0,nr.getTabbableAfterElement)(e.context.triggerFocusTargetRef.current||t.current);for(;null!==i&&(0,ec.contains)(r,i);){let e=i;if((i=(0,nr.getNextTabbable)(i))===e)break}null==i||i.focus()}})}}(y,O),ey=(0,E.useRenderElement)("button",e,{enabled:!W,stateAttributesMapping:w.pressableTriggerOpenStateMapping,state:ei,ref:ep,props:eg});return W?(0,t.jsx)(nn,{tag:"button",render:s,className:o,style:g,state:ei,refs:ep,props:eg,stateAttributesMapping:w.pressableTriggerOpenStateMapping}):k?(0,t.jsxs)(r.Fragment,{children:[(0,t.jsx)(ni.FocusGuard,{ref:ev,onFocus:em},"".concat(b,"-pre-focus-guard")),(0,t.jsx)(r.Fragment,{children:ey},b),(0,t.jsx)(ni.FocusGuard,{ref:y.context.triggerFocusTargetRef,onFocus:e_},"".concat(b,"-post-focus-guard"))]}):(0,t.jsx)(r.Fragment,{children:ey},b)});var no=e.i(64135);function na(e){let t=(0,es.getComputedStyle)(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=(0,es.isHTMLElement)(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return((0,eD.round)(n)!==s||(0,eD.round)(r)!==o)&&(n=s,r=o),{width:n,height:r}}let nl=()=>!0;function nu(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function nc(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(nu(e,r,i));return n.length?()=>{n.forEach(e=>e())}:eO.NOOP}function nd(e,t){let n="auto"===t?"auto":"".concat(t.width,"px"),r="auto"===t?"auto":"".concat(t.height,"px");e.style.setProperty("--popup-width",n),e.style.setProperty("--popup-height",r)}function nf(e,t){let n="max-content"===t?"max-content":"".concat(t.width,"px"),r="max-content"===t?"max-content":"".concat(t.height,"px");e.style.setProperty("--positioner-width",n),e.style.setProperty("--positioner-height",r)}let nh=function(e){return e.popupWidth="--popup-width",e.popupHeight="--popup-height",e}({}),np={activationDirection:e=>e?{"data-activation-direction":e}:null},ng=r.forwardRef(function(e,n){let{render:i,className:s,style:o,children:a,...l}=e,{store:u}=x(),{side:c}=y(),d=u.useState("instantType"),{children:f,state:h}=function(e){let n,{store:i,side:s,cssVars:o,children:a}=e,l=tu(),u=i.useState("activeTriggerElement"),c=i.useState("activeTriggerId"),d=i.useState("open"),f=i.useState("payload"),h=i.useState("mounted"),p=i.useState("popupElement"),g=i.useState("positionerElement"),v=function(e){let[t,n]=r.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}(d?u:null),m=function(e,t){let[n,i]=r.useState(0),s=r.useRef(e),o=r.useRef(t),a=r.useRef(!1);return(0,H.useIsoLayoutEffect)(()=>{let n=s.current,r=t!==o.current;e!==n?(i(e=>e+1),a.current=!r):a.current&&r&&(i(e=>e+1),a.current=!1),s.current=e,o.current=t},[e,t]),"".concat(null!=e?e:"current","-").concat(n)}(c,f),_=r.useRef(null),[y,b]=r.useState(null),[x,E]=r.useState(null),w=r.useRef(null),S=r.useRef(null),R=(0,tx.useAnimationsFinished)(w,!0,!1),k=(0,no.useAnimationFrame)(),[C,T]=r.useState(null),[O,I]=r.useState(!1);(0,H.useIsoLayoutEffect)(()=>(i.set("hasViewport",!0),()=>{i.set("hasViewport",!1)}),[i]);let A=(0,P.useStableCallback)(()=>{var e,t,n;null==(e=w.current)||e.style.setProperty("animation","none"),null==(t=w.current)||t.style.setProperty("transition","none"),null==(n=S.current)||n.style.setProperty("display","none")}),M=(0,P.useStableCallback)(e=>{var t,n,r;null==(t=w.current)||t.style.removeProperty("animation"),null==(n=w.current)||n.style.removeProperty("transition"),null==(r=S.current)||r.style.removeProperty("display"),e&&T(e)}),N=r.useRef(null);(0,H.useIsoLayoutEffect)(()=>{u&&v&&u!==v&&N.current!==u&&_.current&&(b(_.current),I(!0),E(function(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2}
1,s={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:s.x-i.x,vertical:s.y-i.y}}(v,u)),k.request(()=>{e7.flushSync(()=>{I(!1)}),R(()=>{b(null),T(null),_.current=null})}),N.current=u)},[u,v,y,R,k]),(0,H.useIsoLayoutEffect)(()=>{let e=w.current;if(!e)return;let t=(0,eu.ownerDocument)(e).createElement("div");for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));_.current=t});let F=null!=y;return n=F?(0,t.jsxs)(r.Fragment,{children:[(0,t.jsx)("div",{"data-previous":!0,inert:(0,eL.inertValue)(!0),ref:S,style:{...C?{[o.popupWidth]:"".concat(C.width,"px"),[o.popupHeight]:"".concat(C.height,"px")}:null,position:"absolute"},"data-ending-style":O?void 0:""},"previous"),(0,t.jsx)("div",{"data-current":!0,ref:w,"data-starting-style":O?"":void 0,children:a},m)]}):(0,t.jsx)("div",{"data-current":!0,ref:w,children:a},m),(0,H.useIsoLayoutEffect)(()=>{let e=S.current;e&&y&&e.replaceChildren(...Array.from(y.childNodes))},[y]),!function(e){let{popupElement:t,positionerElement:n,content:i,mounted:s,enabled:o=nl,onMeasureLayout:a,onMeasureLayoutComplete:l,side:u,direction:c}=e,d=(0,tx.useAnimationsFinished)(t,!0,!1),f=(0,no.useAnimationFrame)(),h=r.useRef(null),p=r.useRef(null),g=r.useRef(!0),v=r.useRef(eO.NOOP),m=(0,P.useStableCallback)(a),_=(0,P.useStableCallback)(l),y=r.useMemo(()=>{let e="top"===u,t="left"===u;return"rtl"===c?(e=e||"inline-end"===u,t=t||"inline-end"===u):(e=e||"inline-start"===u,t=t||"inline-start"===u),e?{position:"absolute",["top"===u?"bottom":"top"]:"0",[t?"right":"left"]:"0"}:eO.EMPTY_OBJECT},[u,c]);(0,H.useIsoLayoutEffect)(()=>{var e;if(!s||!o()||"function"!=typeof ResizeObserver){v.current=eO.NOOP,g.current=!0,h.current=null,p.current=null;return}if(!t||!n)return;v.current=nc(t,y);let r=new ResizeObserver(e=>{let t=e[0];t&&(p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)})});r.observe(t),nd(t,"auto");let i=nu(t,"position","static"),a=nu(t,"transform","none"),l=nu(t,"scale","1"),u=nc(n,{"--available-width":"max-content","--available-height":"max-content"});function c(){i(),a(),u(),l()}if(null==m||m(),g.current||null===h.current){nf(n,"max-content");let e=na(t);return h.current=e,nf(n,e),c(),null==_||_(null,e),g.current=!1,()=>{r.disconnect(),v.current(),v.current=eO.NOOP}}nd(t,"auto"),nf(n,"max-content");let b=null!=(e=h.current)?e:p.current,x=na(t);if(h.current=x,!b)return nf(n,x),c(),null==_||_(null,x),()=>{r.disconnect(),f.cancel(),v.current(),v.current=eO.NOOP};nd(t,b),c(),null==_||_(b,x),nf(n,x);let E=new AbortController;return f.request(()=>{nd(t,x),d(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},E.signal)}),()=>{r.disconnect(),E.abort(),f.cancel(),v.current(),v.current=eO.NOOP}},[i,t,n,d,f,o,s,m,_,y])}({popupElement:p,positionerElement:g,mounted:h,content:f,onMeasureLayout:A,onMeasureLayoutComplete:M,side:s,direction:l}),{children:n,state:{activationDirection:function(e){if(e){var t,n,r,i;return"".concat((t=e.horizontal,n=5,t>5?"right":t<-n?"left":"")," ").concat((r=e.vertical,i=5,r>5?"down":r<-i?"up":""))}}(x),transitioning:F}}}({store:u,side:c,cssVars:nh,children:a}),p={activationDirection:h.activationDirection,transitioning:h.transitioning,instant:d};return(0,E.useRenderElement)("div",e,{state:p,ref:n,props:[l,{children:f}],stateAttributesMapping:np})});var nv=e.i(44811);let nm=r.forwardRef(function(e,t){let{render:n,className:i,label:s,id:o,nativeButton:a=!1,openOnHover:l=!0,delay:u=100,closeDelay:c=0,disabled:d=!1,style:f,...h}=e,p=U(),g=y(),{store:v}=x(),_=(0,z.useBaseUiId)(o),b=v.useState("open"),S=v.useState("floatingRootContext"),R=v.useState("floatingTreeRoot"),k=(0,tK.useTriggerRegistration)(_,v),C=r.useCallback(e=>{let t=k(e);return null!==e&&v.select("open")&&null==v.select("activeTriggerId")&&v.update({activeTriggerId:_,activeTriggerElement:e,closeDelay:c}),t},[k,c,v,_]),T=r.useRef(null),O=r.useCallback(e=>{T.current=e,v.set("activeTriggerElement",e)},[v]),I=tZ();if(!(null==I?void 0:I.parentMenu))throw Error((0,m.default)(37));v.useSyncedValue("closeDelay",c);let P=I.parentMenu,A=P.useState("itemProps"),M=P.useState("isActive",p.index),N=r.useMemo(()=>({type:"submenu-trigger",setActive(){P.set("activeIndex",p.index)}}),[P,p.index]),F=v.useState("disabled"),L=d||F,{getItemProps:D,itemRef:j}=W({closeOnClick:!1,disabled:L,highlighted:M,id:_,store:v,typingRef:P.context.typingRef,nativeButton:a,itemMetadata:N,nodeId:null==g?void 0:g.context.nodeId}),$=v.useState("hoverEnabled"),H=P.useState("allowMouseEnter"),B=ne(S,{enabled:$&&l&&!L,handleClose:t4({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:u,delay:H?{open:u,close:c}:0,triggerElementRef:T,externalTree:R,isClosing:()=>"ending"===v.select("transitionStatus")}
1),V=(0,t8.useClick)(S,{enabled:!L,event:"mousedown",toggle:!l,ignoreMouse:l,stickIfOpen:!1}),q=(0,tA.useInteractions)([V]),G=v.useState("triggerProps",!0);return delete G.id,(0,E.useRenderElement)("div",e,{state:{disabled:L,highlighted:M,open:b},stateAttributesMapping:w.triggerOpenStateMapping,props:[q.getReferenceProps(),B,G,A,{tabIndex:b||M?0:-1,onBlur(){M&&P.set("activeIndex",null)}},h,D],ref:[t,p.ref,j,C,O]})});class n_{open(e){let t=e?this.store.context.triggerElements.getById(e):void 0;if(e&&!t)throw Error((0,m.default)(83,e));this.store.setOpen(!0,(0,Y.createChangeEventDetails)("imperative-action",void 0,t))}close(){this.store.setOpen(!1,(0,Y.createChangeEventDetails)("imperative-action",void 0,void 0))}get isOpen(){return this.store.state.open}constructor(){this.store=new tX}}function ny(){return new n_}var nb=e.i(45395),nb=nb,nx=e.i(96561);function nE(e){let{...n}=e;return(0,t.jsx)(nb.Root,{"data-slot":"dropdown-menu",...n})}function nw(e){let{...n}=e;return(0,t.jsx)(nb.Trigger,{"data-slot":"dropdown-menu-trigger",...n})}function nS(e){let{align:n="start",alignOffset:r=0,side:i="bottom",sideOffset:s=4,className:o,...a}=e;return(0,t.jsx)(nb.Portal,{children:(0,t.jsx)(nb.Positioner,{className:"isolate z-50 outline-none",align:n,alignOffset:r,side:i,sideOffset:s,children:(0,t.jsx)(nb.Popup,{"data-slot":"dropdown-menu-content",className:(0,nx.cn)("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",o),...a})})})}function nR(e){let{className:n,inset:r,variant:i="default",...s}=e;return(0,t.jsx)(nb.Item,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":i,className:(0,nx.cn)("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",n),...s})}function nk(e){let{className:n,...r}=e;return(0,t.jsx)(nb.Separator,{"data-slot":"dropdown-menu-separator",className:(0,nx.cn)("-mx-1 my-1 h-px bg-border",n),...r})}(0,i.default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),e.i(63849);var nC=e.i(32137),nT=e.i(96857);function nO(e){let{...n}=e;return(0,t.jsx)(nC.Dialog.Root,{"data-slot":"sheet",...n})}function nI(e){let{...n}=e;return(0,t.jsx)(nC.Dialog.Trigger,{"data-slot":"sheet-trigger",...n})}function nP(e){let{...n}=e;return(0,t.jsx)(nC.Dialog.Portal,{"data-slot":"sheet-portal",...n})}function nA(e){let{className:n,...r}=e;return(0,t.jsx)(nC.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,nx.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",n),...r})}function nM(e){let{className:n,children:r,side:i="right",showCloseButton:s=!0,...o}=e;return(0,t.jsxs)(nP,{children:[(0,t.jsx)(nA,{}),(0,t.jsxs)(nC.Dialog.Popup,{"data-slot":"sheet-content","data-side":i,className:(0,nx.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",n),...o,children:[r,s&&(0,t.jsxs)(nC.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(v.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,t.jsx)(nT.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function nN(e){let{className:n,...r}=e;return(0,t.jsx)(nC.Dialog.Title,{"data-slot":"sheet-title",className:(0,nx.cn)("font-heading text-base font-medium text-foreground",n),...r})}var nF=e.i(29228);let nL=(0,i.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),nD=(0,i.default)("moon",[["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"}]]),nj=(0,i.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);function n$(){let{setTheme:e,theme:n}=(0,nF.useTheme)(),[i,s]=(0,r.useState)(!1);return((0,r.useEffect)(()=>s(!0),[]),i)?(0,t.jsxs)(nE,{children:[(0,t.jsxs)(nw,{className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground outline-none",children:["dark"===n?(0,t.jsx)(nD,{className:"h-4 w-4"}):"light"===n?(0,t.jsx)(nL,{className:"h-4 w-4"}):(0,t.jsx)(nj,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Toggle theme"})]}),(0,t.jsxs)(nS,{align:"end",children:[(0,t.jsxs)(nR,{onSelect:()=>e("light"),children:[(0,t.jsx)(nL,{className:"mr-2 h-4 w-4"}),"Light"]}),(0,t.jsxs)(nR,{onSelect:()=>e("dark"),children:[(0,t.jsx)(nD,{className:"mr-2 h-4 w-4"}),"Dark"]}
1),(0,t.jsxs)(nR,{onSelect:()=>e("system"),children:[(0,t.jsx)(nj,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",disabled:!0,className:"animate-pulse"})}var nW=e.i(97648),nH=e.i(21690);function nB(){let{user:e,loading:r}=(0,nH.useUser)();return r?(0,t.jsx)(v.Button,{variant:"ghost",size:"sm",disabled:!0,className:"w-20 animate-pulse"}):e?(0,t.jsx)(v.Button,{variant:"ghost",size:"sm",onClick:async()=>{let e=(0,nW.createClient)();await e.auth.signOut(),window.location.href="/"},children:"Sign out"}):(0,t.jsx)(n.default,{href:"/auth/login",className:(0,v.buttonVariants)({variant:"default",size:"sm"}),children:"Sign in"})}let nV=(0,i.default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),nU=(0,i.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);var nz=e.i(88449);let nq=(0,i.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);function nG(){var e,r,i,o;let{user:a,loading:l}=(0,nH.useUser)();if(l||!a)return null;let u=null!=(o=null!=(i=null==(e=a.user_metadata)?void 0:e.full_name)?i:a.email)?o:"User",c=null==(r=a.user_metadata)?void 0:r.avatar_url,d=u.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase();return(0,t.jsxs)(nE,{children:[(0,t.jsxs)(nw,{className:"flex items-center gap-2 rounded-lg px-1.5 py-1 text-sm font-medium outline-none hover:bg-muted aria-expanded:bg-muted",children:[c?(0,t.jsx)("img",{src:c,alt:"",className:"h-7 w-7 rounded-full object-cover"}):(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-primary text-[11px] font-semibold text-primary-foreground",children:d}),(0,t.jsx)("span",{className:"hidden max-w-[120px] truncate sm:inline",children:u})]}),(0,t.jsxs)(nS,{align:"end",sideOffset:8,className:"w-56 p-1.5",children:[(0,t.jsxs)("div",{className:"px-2 py-1.5",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium",children:u}),a.email&&a.email!==u&&(0,t.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:a.email})]}),(0,t.jsx)(nk,{}),(0,t.jsxs)(nR,{render:(0,t.jsx)(n.default,{href:"/me",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm"}),children:[(0,t.jsx)(nV,{className:"h-4 w-4 text-muted-foreground"}),"Dashboard"]}),(0,t.jsxs)(nR,{render:(0,t.jsx)(n.default,{href:"/monitor",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm"}),children:[(0,t.jsx)(s,{className:"h-4 w-4 text-muted-foreground"}),"Monitor"]}),(0,t.jsxs)(nR,{render:(0,t.jsx)(n.default,{href:"/me",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm"}),children:[(0,t.jsx)(nq,{className:"h-4 w-4 text-muted-foreground"}),"Profile"]}),(0,t.jsxs)(nR,{render:(0,t.jsx)(n.default,{href:"/me/settings",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm"}),children:[(0,t.jsx)(nz.Settings,{className:"h-4 w-4 text-muted-foreground"}),"Settings"]}),(0,t.jsx)(nk,{}),(0,t.jsxs)(nR,{onClick:async()=>{let e=(0,nW.createClient)();await e.auth.signOut(),window.location.href="/"},className:"flex items-center gap-2 text-destructive focus:text-destructive",children:[(0,t.jsx)(nU,{className:"h-4 w-4"}),"Sign out"]})]})]})}var nY=e.i(4889);let nX=[{href:"/fix",label:"Fix"},{href:"/requests",label:"Requests"},{href:"/contribute",label:"Contribute"}],nK=[{href:"/blog",label:"Blog",description:"Daily RN/Expo digest",icon:o.BookOpen},{href:"/repos",label:"Repos",description:"Trending libraries",icon:d},{href:"/packages",label:"Packages",description:"Compatibility matrix",icon:h.Package},{href:"/jobs",label:"Jobs",description:"React Native roles",icon:a},{href:"/status",label:"Status",description:"Ecosystem health",icon:s},{href:"/newsletter",label:"Newsletter",description:"Weekly email",icon:c.FileText}],nJ=[{href:"/community",label:"Community"},{href:"/products",label:"Products"}],nZ=[{title:"Solve",links:[{href:"/fix",label:"Fix"},{href:"/requests",label:"Requests"},{href:"/contribute",label:"Contribute"}]},{title:"Discover",links:nK.map(e=>{let{href:t,label:n}=e;return{href:t,label:n}})},{title:"More",links:[{href:"/community",label:"Community"},{href:"/products",label:"Products"},{href:"/about",label:"About"}]}];function nQ(){let[e,i]=(0,r.useState)(!1),{user:s}=(0,nH.useUser)();return(0,t.jsx)("header",{className:"sticky top-0 z-50 w-full border-b border-border/50 bg-background/80 backdrop-blur-lg",children:(0,t.jsxs)("div",{className:"mx-auto flex h-14 max-w-7xl items-center px-4 sm:px-6 lg:px-8",children:[(0,t.jsx)(n.default,{href:"/",className:"mr-6 flex items-center gap-2 font-bold text-lg tracking-tight",children:"ERNE"}),(0,t.jsxs)("nav",{className:"hidden md:flex md:items-center md:gap-1",children:[nX.map(e=>(0,t.jsx)(n0,{...e},e.href)),(0,t.jsxs)(nE,{children:[(0,t.jsxs)(nw,{render:(0,t.jsx)("button",{type:"button",className:"inline-flex items-center gap-1 rounded-md px-3 py-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground aria-expanded:text-foreground"}),children:[(0,t.jsx)(u,{className:"h-3.5 w-3.5"}),"Discover",(0,t.jsx)(l,{className:"h-3 w-3 opacity-60"})]}),(0,t.jsx)(nS,{align:"start",sideOffset:8,className:"w-64 p-1.5",children:nK.map(e=>{let r=e.icon;return(0,t.jsxs)(nR,{render:(0,t.jsx)(n.default,{href:e.href,className:"flex items-start gap-3 rounded-md px-2 py-2"}),children:[(0,t.jsx)(r,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium leading-tight",children:e.label}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:e.description})]})]},e.href)})})]}),nJ.map(e=>(0,t.jsx)(n0,{...e},e.href))]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1.5 sm:gap-2",children:[(0,t.jsxs)(v.Button,{variant:"outline",size:"sm",className:"hidden sm:inline-flex gap-2 text-muted-foreground",onClick:nY.openSearch,"aria-label":"Open search",children:[(0,t.jsx)(p.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-xs",children:"Search"}),(0,t.jsx)("kbd",{className:"pointer-events-none ml-1 hidden rounded border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground sm:inline-block",children:"⌘K"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"sm:hidden",onClick:nY.openSearch,"aria-label":"Open search",children:(0,t.jsx)(p.Search,{className:"h-4 w-4"})}),(0,t.jsx)(n$,{}),s?(0,t.jsx)(nG,{}):(0,t.jsx)(nB,{}),(0,t.jsxs)(nO,{open:e,onOpenChange:i,children:[(0,t.jsxs)(nI,{className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-muted md:hidden",children:[e?(0,t.jsx)(g.X,{className:"h-5 w-5"}):(0,t.jsx)(f.Menu,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"sr-only",children:"Toggle menu"})]}),(0,t.jsxs)(nM,{side:"right",className:"w-72 overflow-y-auto",children:[(0,t.jsx)(nN,{className:"sr-only",children:"Navigation menu"}),(0,t.jsxs)("nav",{className:"mt-6 flex flex-col gap-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{i(!1),(0,nY.openSearch)()},className:"flex items-center gap-2 rounded-md border border-border bg-muted/40 px-3 py-2 text-left text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:[(0,t.jsx)(p.Search,{className:"h-4 w-4"}),"Search",(0,t.jsx)("kbd",{className:"ml-auto rounded border border-border bg-background px-1.5 py-0.5 text-[10px]",children:"⌘K"})]}),nZ.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("div",{className:"px-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:e.title}),e.links.map(e=>(0,t.jsx)(n.default,{href:e.href,onClick:()=>i(!1),className:"rounded-md px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-muted",children:e.label},e.href))]},e.title))]})]})]})]})]})})}function n0(e){let{href:r,label:i}=e;return(0,t.jsx)(n.default,{href:r,className:"rounded-md px-3 py-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground",children:i})}},62464,e=>{"use strict";e.s(["CommandPalette",()=>nt],62464);var t,n,r,i,s=e.i(46882),o=e.i(55118),a=e.i(97583),l=/[\\\/_+.#"@\[\(\{&]/,u=/[\\\/_+.#"@\[\(\{&]/g,c=/[\s-]/,d=/[\s-]/g;function f(e){return e.toLowerCase().replace(d," ")}function h(e,t){let{checkForDefaultPrevented:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function p(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function g(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{let n=!1,r=t.map(t=>{let r=p(t,e);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let e=0;e<r.length;e++){let n=r[e];"function"==typeof n?n():p(t[e],null)}}}}function v(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return o.useCallback(g(...t),t)}"undefined"!=typeof window&&window.document&&window.document.createElement;var m=(null==(n=globalThis)?void 0:n.document)?o.useLayoutEffect:()=>{},_=o[" useId ".trim().toString()]||(()=>void 0),y=0;function b(e){let[t,n]=o.useState(_());return m(()=>{e||n(e=>null!=e?e:String(y++))},[e]),e||(t?"radix-".concat(t):"")}o[" useEffectEvent ".trim().toString()],o[" useInsertionEffect ".trim().toString()];var x=o[" useInsertionEffect ".trim().toString()]||m;Symbol("RADIX:SYNC_STATE");var E=e.i(21890);function w(e){let t=function(e){let t=o.forwardRef((e,t)=>
1{let{children:n,...r}=e;if(o.isValidElement(n)){var i,s,a;let e,l,u=(l=(e=null==(s=Object.getOwnPropertyDescriptor((i=n).props,"ref"))?void 0:s.get)&&"isReactWarning"in e&&e.isReactWarning)?i.ref:(l=(e=null==(a=Object.getOwnPropertyDescriptor(i,"ref"))?void 0:a.get)&&"isReactWarning"in e&&e.isReactWarning)?i.props.ref:i.props.ref||i.ref,c=function(e,t){let n={...t};for(let r in t){let i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=s(...t);return i(...t),r}:i&&(n[r]=i):"style"===r?n[r]={...i,...s}:"className"===r&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==o.Fragment&&(c.ref=t?g(t,u):u),o.cloneElement(n,c)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),n=o.forwardRef((e,n)=>{let{children:r,...i}=e,a=o.Children.toArray(r),l=a.find(R);if(l){let e=l.props.children,r=a.map(t=>t!==l?t:o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null);return(0,s.jsx)(t,{...i,ref:n,children:o.isValidElement(e)?o.cloneElement(e,void 0,r):null})}return(0,s.jsx)(t,{...i,ref:n,children:r})});return n.displayName="".concat(e,".Slot"),n}var S=Symbol("radix.slottable");function R(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===S}var k=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=w("Primitive.".concat(t)),r=o.forwardRef((e,r)=>{let{asChild:i,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(i?n:t,{...o,ref:r})});return r.displayName="Primitive.".concat(t),{...e,[t]:r}},{});function C(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>function(){for(var e,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return null==(e=t.current)?void 0:e.call(t,...r)},[])}var T="dismissableLayer.update",O=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),I=o.forwardRef((e,t)=>{var n,i;let{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...p}=e,g=o.useContext(O),[m,_]=o.useState(null),y=null!=(i=null==m?void 0:m.ownerDocument)?i:null==(n=globalThis)?void 0:n.document,[,b]=o.useState({}),x=v(t,e=>_(e)),E=Array.from(g.layers),[w]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),S=E.indexOf(w),R=m?E.indexOf(m):-1,I=g.layersWithOutsidePointerEventsDisabled.size>0,M=R>=S,N=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,r=C(e),i=o.useRef(!1),s=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!i.current){let t=function(){A("dismissableLayer.pointerDownOutside",r,i,{discrete:!0})},i={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",s.current),s.current=t,n.addEventListener("click",s.current,{once:!0})):t()}else n.removeEventListener("click",s.current);i.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",s.current)}},[n,r]),{onPointerDownCapture:()=>i.current=!0}}(e=>{let t=e.target,n=[...g.branches].some(e=>e.contains(t));M&&!n&&(null==u||u(e),null==d||d(e),e.defaultPrevented||null==f||f())},y),F=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,r=C(e),i=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!i.current&&A("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}(e=>{let t=e.target;![...g.branches].some(e=>e.contains(t))&&(null==c||c(e),null==d||d(e),e.defaultPrevented||null==f||f())},y);return!function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,r=C(e);o.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{R===g.layers.size-1&&(null==l||l(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))},y),o.useEffect(()=>{if(m)return a&&(0===g.layersWithOutsidePointerEventsDisabled.size&&(r=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(m)),g.layers.add(m),P(),()=>{a&&1===g.layersWithOutsidePointerEventsDisabled.size&&(y.body.style.pointerEvents=r)}},[m,y,a,g]),o.useEffect(()=>()=>{m&&(g.layers.delete(m),g.layersWithOutsidePointerEventsDisabled.delete(m),P())},[m,g]),o.useEffect(()=>{let e=()=>b({});return document.addEventListener(T,e),()=>document.removeEventListener(T,e)}
1,[]),(0,s.jsx)(k.div,{...p,ref:x,style:{pointerEvents:I?M?"auto":"none":void 0,...e.style},onFocusCapture:h(e.onFocusCapture,F.onFocusCapture),onBlurCapture:h(e.onBlurCapture,F.onBlurCapture),onPointerDownCapture:h(e.onPointerDownCapture,N.onPointerDownCapture)})});function P(){let e=new CustomEvent(T);document.dispatchEvent(e)}function A(e,t,n,r){let{discrete:i}=r,s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&s.addEventListener(e,t,{once:!0}),i)s&&E.flushSync(()=>s.dispatchEvent(o));else s.dispatchEvent(o)}I.displayName="DismissableLayer",o.forwardRef((e,t)=>{let n=o.useContext(O),r=o.useRef(null),i=v(t,r);return o.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,s.jsx)(k.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var M=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=w("Primitive.".concat(t)),r=o.forwardRef((e,r)=>{let{asChild:i,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(i?n:t,{...o,ref:r})});return r.displayName="Primitive.".concat(t),{...e,[t]:r}},{}),N="focusScope.autoFocusOnMount",F="focusScope.autoFocusOnUnmount",L={bubbles:!1,cancelable:!0},D=o.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...l}=e,[u,c]=o.useState(null),d=C(i),f=C(a),h=o.useRef(null),p=v(t,e=>c(e)),g=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(g.paused||!u)return;let t=e.target;u.contains(t)?h.current=t:W(h.current,{select:!0})},t=function(e){if(g.paused||!u)return;let t=e.relatedTarget;null!==t&&(u.contains(t)||W(h.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&W(u)});return u&&n.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[r,u,g.paused]),o.useEffect(()=>{if(u){H.add(g);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(N,L);u.addEventListener(N,d),u.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=document.activeElement;for(let r of e)if(W(r,{select:t}),document.activeElement!==n)return}(j(u).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&W(u))}return()=>{u.removeEventListener(N,d),setTimeout(()=>{let t=new CustomEvent(F,L);u.addEventListener(F,f),u.dispatchEvent(t),t.defaultPrevented||W(null!=e?e:document.body,{select:!0}),u.removeEventListener(F,f),H.remove(g)},0)}}},[u,d,f,g]);let m=o.useCallback(e=>{if(!n&&!r||g.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,s]=function(e){let t=j(e);return[$(t,e),$(t.reverse(),e)]}(t);r&&s?e.shiftKey||i!==s?e.shiftKey&&i===r&&(e.preventDefault(),n&&W(s,{select:!0})):(e.preventDefault(),n&&W(r,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,s.jsx)(M.div,{tabIndex:-1,...l,ref:p,onKeyDown:m})});function j(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $(e,t){for(let n of e)if(!function(e,t){let{upTo:n}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===n||e!==n);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(n,{upTo:t}))return n}function W(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var n;let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(n=e)instanceof HTMLInputElement&&"select"in n&&t&&e.select()}}D.displayName="FocusScope";var H=function(){let e=[];return{add(t){let n=e[0];t!==n&&(null==n||n.pause()),(e=B(e,t)).unshift(t)},remove(t){var n;null==(n=(e=B(e,t))[0])||n.resume()}}}();function B(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}var V=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>
1{let n=w("Primitive.".concat(t)),r=o.forwardRef((e,r)=>{let{asChild:i,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(i?n:t,{...o,ref:r})});return r.displayName="Primitive.".concat(t),{...e,[t]:r}},{}),U=o.forwardRef((e,t)=>{var n,r;let{container:i,...a}=e,[l,u]=o.useState(!1);m(()=>u(!0),[]);let c=i||l&&(null==(r=globalThis)||null==(n=r.document)?void 0:n.body);return c?E.default.createPortal((0,s.jsx)(V.div,{...a,ref:t}),c):null});U.displayName="Portal";var z=e=>{let{present:t,children:n}=e,r=function(e){var t,n;let[r,i]=o.useState(),s=o.useRef(null),a=o.useRef(e),l=o.useRef("none"),[u,c]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},o.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return o.useEffect(()=>{let e=q(s.current);l.current="mounted"===u?e:"none"},[u]),m(()=>{let t=s.current,n=a.current;if(n!==e){let r=l.current,i=q(t);e?c("MOUNT"):"none"===i||(null==t?void 0:t.display)==="none"?c("UNMOUNT"):n&&r!==i?c("ANIMATION_OUT"):c("UNMOUNT"),a.current=e}},[e,c]),m(()=>{if(r){var e;let t,n=null!=(e=r.ownerDocument.defaultView)?e:window,i=e=>{let i=q(s.current).includes(CSS.escape(e.animationName));if(e.target===r&&i&&(c("ANIMATION_END"),!a.current)){let e=r.style.animationFillMode;r.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=e)})}},o=e=>{e.target===r&&(l.current=q(s.current))};return r.addEventListener("animationstart",o),r.addEventListener("animationcancel",i),r.addEventListener("animationend",i),()=>{n.clearTimeout(t),r.removeEventListener("animationstart",o),r.removeEventListener("animationcancel",i),r.removeEventListener("animationend",i)}}c("ANIMATION_END")},[r,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:o.useCallback(e=>{s.current=e?getComputedStyle(e):null,i(e)},[])}}(t),i="function"==typeof n?n({present:r.isPresent}):o.Children.only(n),s=v(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?e.ref:(i=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof n||r.isPresent?o.cloneElement(i,{ref:s}):null};function q(e){return(null==e?void 0:e.animationName)||"none"}z.displayName="Presence";var G=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=w("Primitive.".concat(t)),r=o.forwardRef((e,r)=>{let{asChild:i,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(i?n:t,{...o,ref:r})});return r.displayName="Primitive.".concat(t),{...e,[t]:r}},{}),Y=0;function X(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var K=e.i(26184),J="right-scroll-bar-position",Z="width-before-scroll-bar";function Q(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ee="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,et=new WeakMap;function en(e){return e}var er=function(e){void 0===e&&(e={});var t,n,r,i=(void 0===t&&(t=en),n=[],r=!1,{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:null},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var s=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(s)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}});return i.options=(0,K.__assign)({async:!0,ssr:!1},e),i}(),ei=function(){},es=o.forwardRef(function(e,t){var n,r,i,s,a=o.useRef(null),l=o.useState({onScrollCapture:ei,onWheelCapture:ei,onTouchMoveCapture:ei}),u=l[0],c=l[1],d=e.forwardProps,f=e.children,h=e.className,p=e.removeScrollBar,g=e.enabled,v=e.shards,m=e.sideCar,_=e.noRelative,y=e.noIsolation,b=e.inert,x=e.allowPinchZoom,E=e.as,w=e.gapMode,S=(0,K.__rest)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=(n=[a,t],r=function(e){return n.forEac
1h(function(t){return Q(t,e)})},(i=(0,o.useState)(function(){return{value:null,callback:r,facade:{get current(){return i.value},set current(value){var e=i.value;e!==value&&(i.value=value,i.callback(value,e))}}}})[0]).callback=r,s=i.facade,ee(function(){var e=et.get(s);if(e){var t=new Set(e),r=new Set(n),i=s.current;t.forEach(function(e){r.has(e)||Q(e,null)}),r.forEach(function(e){t.has(e)||Q(e,i)})}et.set(s,n)},[n]),s),k=(0,K.__assign)((0,K.__assign)({},S),u);return o.createElement(o.Fragment,null,g&&o.createElement(m,{sideCar:er,removeScrollBar:p,shards:v,noRelative:_,noIsolation:y,inert:b,setCallbacks:c,allowPinchZoom:!!x,lockRef:a,gapMode:w}),d?o.cloneElement(o.Children.only(f),(0,K.__assign)((0,K.__assign)({},k),{ref:R})):o.createElement(void 0===E?"div":E,(0,K.__assign)({},k,{className:h,ref:R}),f))});es.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},es.classNames={fullWidth:Z,zeroRight:J};var eo=function(e){var t=e.sideCar,n=(0,K.__rest)(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return o.createElement(r,(0,K.__assign)({},n))};eo.isSideCarExport=!0;var ea=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=i||("undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var r,s;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),s=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(s)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},el=function(){var e=ea();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},eu=function(){var e=el();return function(t){return e(t.styles,t.dynamic),null}},ec={left:0,top:0,right:0,gap:0},ed=function(e){return parseInt(e||"",10)||0},ef=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[ed(n),ed(r),ed(i)]},eh=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return ec;var t=ef(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ep=eu(),eg="data-scroll-locked",ev=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n  .".concat("with-scroll-bars-hidden"," {\n   overflow: hidden ").concat(r,";\n   padding-right: ").concat(a,"px ").concat(r,";\n  }\n  body[").concat(eg,"] {\n    overflow: hidden ").concat(r,";\n    overscroll-behavior: contain;\n    ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n    padding-left: ".concat(i,"px;\n    padding-top: ").concat(s,"px;\n    padding-right: ").concat(o,"px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ").concat(a,"px ").concat(r,";\n    "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n  }\n  \n  .").concat(J," {\n    right: ").concat(a,"px ").concat(r,";\n  }\n  \n  .").concat(Z," {\n    margin-right: ").concat(a,"px ").concat(r,";\n  }\n  \n  .").concat(J," .").concat(J," {\n    right: 0 ").concat(r,";\n  }\n  \n  .").concat(Z," .").concat(Z," {\n    margin-right: 0 ").concat(r,";\n  }\n  \n  body[").concat(eg,"] {\n    ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n  }\n")},em=function(){var e=parseInt(document.body.getAttribute(eg)||"0",10);return isFinite(e)?e:0},e_=function(){o.useEffect(function(){return document.body.setAttribute(eg,(em()+1).toString()),function(){var e=em()-1;e<=0?document.body.removeAttribute(eg):document.body.setAttribute(eg,e.toString())}},[])},ey=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=void 0===r?"margin":r;e_();var s=o.useMemo(function(){return eh(i)},[i]);return o.createElement(ep,{styles:ev(s,!t,i,n?"":"!important")})},eb=!1;if("undefined"!=typeof window)try{var ex=Object.defineProperty({},"passive",{get:function(){return eb=!0,!0}});window.addEventListener("test",ex,ex),window.removeEventListener("test",ex,ex)}catch(e){eb=!1}var eE=!!eb&&{passive:!1},ew=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},eS=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),eR(e,r)){var i=ek(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body)return!1},eR=function(e,t){return"v"===e?ew(t,"overflowY"):ew(t,"overflowX")},ek=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eC=function(e,t,n,r,i){var s,o=(s=window.getComputedStyle(t).direction,"h"===e&&"rtl"===s?-1:1),a=o*r,l=n.target,u=t.contains(l),c=!1,d=a>0,f=0,h=0;
1do{if(!l)break;var p=ek(e,l),g=p[0],v=p[1]-p[2]-o*g;(g||v)&&eR(e,l)&&(f+=v,h+=g);var m=l.parentNode;l=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!u&&l!==document.body||u&&(t.contains(l)||t===l))return d&&(i&&1>Math.abs(f)||!i&&a>f)?c=!0:!d&&(i&&1>Math.abs(h)||!i&&-a>h)&&(c=!0),c},eT=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eO=function(e){return[e.deltaX,e.deltaY]},eI=function(e){return e&&"current"in e?e.current:e},eP=0,eA=[];let eM=(t=function(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(eP++)[0],s=o.useState(eu)[0],a=o.useRef(e);o.useEffect(function(){a.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=(0,K.__spreadArray)([e.lockRef.current],(e.shards||[]).map(eI),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=o.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var i,s=eT(e),o=n.current,l="deltaX"in e?e.deltaX:o[0]-s[0],u="deltaY"in e?e.deltaY:o[1]-s[1],c=e.target,d=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=window.getSelection(),h=f&&f.anchorNode;if(h&&(h===c||h.contains(c)))return!1;var p=eS(d,c);if(!p)return!0;if(p?i=d:(i="v"===d?"h":"v",p=eS(d,c)),!p)return!1;if(!r.current&&"changedTouches"in e&&(l||u)&&(r.current=i),!i)return!0;var g=r.current||i;return eC(g,t,e,"h"===g?l:u,!0)},[]),u=o.useCallback(function(e){if(eA.length&&eA[eA.length-1]===s){var n="deltaY"in e?eO(e):eT(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var i=(a.current.shards||[]).map(eI).filter(Boolean).filter(function(t){return t.contains(e.target)});(i.length>0?l(e,i[0]):!a.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=o.useCallback(function(e,n,r,i){var s={name:e,delta:n,target:r,should:i,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),d=o.useCallback(function(e){n.current=eT(e),r.current=void 0},[]),f=o.useCallback(function(t){c(t.type,eO(t),t.target,l(t,e.lockRef.current))},[]),h=o.useCallback(function(t){c(t.type,eT(t),t.target,l(t,e.lockRef.current))},[]);o.useEffect(function(){return eA.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,eE),document.addEventListener("touchmove",u,eE),document.addEventListener("touchstart",d,eE),function(){eA=eA.filter(function(e){return e!==s}),document.removeEventListener("wheel",u,eE),document.removeEventListener("touchmove",u,eE),document.removeEventListener("touchstart",d,eE)}},[]);var p=e.removeScrollBar,g=e.inert;return o.createElement(o.Fragment,null,g?o.createElement(s,{styles:"\n  .block-interactivity-".concat(i," {pointer-events: none;}\n  .allow-interactivity-").concat(i," {pointer-events: all;}\n")}):null,p?o.createElement(ey,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},er.useMedium(t),eo);var eN=o.forwardRef(function(e,t){return o.createElement(es,(0,K.__assign)({},e,{ref:t,sideCar:eM}))});eN.classNames=es.classNames;var eF=new WeakMap,eL=new WeakMap,eD={},ej=0,e$=function(e){return e&&(e.host||e$(e.parentNode))},eW=function(e,t,n,r){var i=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=e$(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});eD[n]||(eD[n]=new WeakMap);var s=eD[n],o=[],a=new Set,l=new Set(i),u=function(e){!e||a.has(e)||(a.add(e),u(e.parentNode))};
1i.forEach(u);var c=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(a.has(e))c(e);else try{var t=e.getAttribute(r),i=null!==t&&"false"!==t,l=(eF.get(e)||0)+1,u=(s.get(e)||0)+1;eF.set(e,l),s.set(e,u),o.push(e),1===l&&i&&eL.set(e,!0),1===u&&e.setAttribute(n,"true"),i||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),a.clear(),ej++,function(){o.forEach(function(e){var t=eF.get(e)-1,i=s.get(e)-1;eF.set(e,t),s.set(e,i),t||(eL.has(e)||e.removeAttribute(r),eL.delete(e)),i||e.removeAttribute(n)}),--ej||(eF=new WeakMap,eF=new WeakMap,eL=new WeakMap,eD={})}},eH=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||("undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),eW(r,i,n,"aria-hidden")):function(){return null}},eB="Dialog",[eV,eU]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=(null==n?void 0:n[e])||t;return o.useMemo(()=>({["__scope".concat(e)]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let i=o.createContext(r),a=n.length;n=[...n,r];let l=t=>{var n;let{scope:r,children:l,...u}=t,c=(null==r||null==(n=r[e])?void 0:n[a])||i,d=o.useMemo(()=>u,Object.values(u));return(0,s.jsx)(c.Provider,{value:d,children:l})};return l.displayName=t+"Provider",[l,function(n,s){var l;let u=(null==s||null==(l=s[e])?void 0:l[a])||i,c=o.useContext(u);if(c)return c;if(void 0!==r)return r;throw Error("`".concat(n,"` must be used within `").concat(t,"`"))}]},function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=t[0];if(1===t.length)return r;let i=()=>{let e=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){let n=e.reduce((e,n)=>{let{useScope:r,scopeName:i}=n,s=r(t)["__scope".concat(i)];return{...e,...s}},{});return o.useMemo(()=>({["__scope".concat(r.scopeName)]:n}),[n])}};return i.scopeName=r.scopeName,i}(r,...t)]}(eB),[ez,eq]=eV(eB),eG=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:l=!0}=e,u=o.useRef(null),c=o.useRef(null),[d,f]=function(e){let{prop:t,defaultProp:n,onChange:r=()=>{},caller:i}=e,[s,a,l]=function(e){let{defaultProp:t,onChange:n}=e,[r,i]=o.useState(t),s=o.useRef(r),a=o.useRef(n);return x(()=>{a.current=n},[n]),o.useEffect(()=>{if(s.current!==r){var e;null==(e=a.current)||e.call(a,r),s.current=r}},[r,s]),[r,i,a]}({defaultProp:n,onChange:r}),u=void 0!==t,c=u?t:s;{let e=o.useRef(void 0!==t);o.useEffect(()=>{let t=e.current;if(t!==u){let e=u?"controlled":"uncontrolled";console.warn("".concat(i," is changing from ").concat(t?"controlled":"uncontrolled"," to ").concat(e,". Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component."))}e.current=u},[u,i])}return[c,o.useCallback(e=>{if(u){let r="function"==typeof e?e(t):e;if(r!==t){var n;null==(n=l.current)||n.call(l,r)}}else a(e)},[u,t,a,l])]}({prop:r,defaultProp:null!=i&&i,onChange:a,caller:eB});return(0,s.jsx)(ez,{scope:t,triggerRef:u,contentRef:c,contentId:b(),titleId:b(),descriptionId:b(),open:d,onOpenChange:f,onOpenToggle:o.useCallback(()=>f(e=>!e),[f]),modal:l,children:n})};eG.displayName=eB;var eY="DialogTrigger";o.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=eq(eY,n),o=v(t,i.triggerRef);return(0,s.jsx)(G.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":tt(i.open),...r,ref:o,onClick:h(e.onClick,i.onOpenToggle)})}).displayName=eY;var eX="DialogPortal",[eK,eJ]=eV(eX,{forceMount:void 0}),eZ=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=eq(eX,t);return(0,s.jsx)(eK,{scope:t,forceMount:n,children:o.Children.map(r,e=>(0,s.jsx)(z,{present:n||a.open,children:(0,s.jsx)(U,{asChild:!0,container:i,children:e})}))})};eZ.displayName=eX;var eQ="DialogOverlay",e0=o.forwardRef((e,t)=>{let n=eJ(eQ,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=eq(eQ,e.__scopeDialog);return o.modal?(0,s.jsx)(z,{present:r||o.open,children:(0,s.jsx)(e2,{...i,ref:t})}):null});e0.displayName=eQ;var e1=w("DialogOverlay.RemoveScroll"),e2=o.forwardRef((e,t)=>
1{let{__scopeDialog:n,...r}=e,i=eq(eQ,n);return(0,s.jsx)(eN,{as:e1,allowPinchZoom:!0,shards:[i.contentRef],children:(0,s.jsx)(G.div,{"data-state":tt(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),e5="DialogContent",e3=o.forwardRef((e,t)=>{let n=eJ(e5,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=eq(e5,e.__scopeDialog);return(0,s.jsx)(z,{present:r||o.open,children:o.modal?(0,s.jsx)(e4,{...i,ref:t}):(0,s.jsx)(e8,{...i,ref:t})})});e3.displayName=e5;var e4=o.forwardRef((e,t)=>{let n=eq(e5,e.__scopeDialog),r=o.useRef(null),i=v(t,n.contentRef,r);return o.useEffect(()=>{let e=r.current;if(e)return eH(e)},[]),(0,s.jsx)(e6,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:h(e.onFocusOutside,e=>e.preventDefault())})}),e8=o.forwardRef((e,t)=>{let n=eq(e5,e.__scopeDialog),r=o.useRef(!1),i=o.useRef(!1);return(0,s.jsx)(e6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var s,o;null==(s=e.onCloseAutoFocus)||s.call(e,t),t.defaultPrevented||(r.current||null==(o=n.triggerRef.current)||o.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{var s,o;null==(s=e.onInteractOutside)||s.call(e,t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let a=t.target;(null==(o=n.triggerRef.current)?void 0:o.contains(a))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),e6=o.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...l}=e,u=eq(e5,n),c=o.useRef(null),d=v(t,c);return o.useEffect(()=>{var e,t;let n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!=(e=n[0])?e:X()),document.body.insertAdjacentElement("beforeend",null!=(t=n[1])?t:X()),Y++,()=>{1===Y&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Y--}},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(D,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,s.jsx)(I,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":tt(u.open),...l,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ts,{titleId:u.titleId}),(0,s.jsx)(to,{contentRef:c,descriptionId:u.descriptionId})]})]})}),e9="DialogTitle";o.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=eq(e9,n);return(0,s.jsx)(G.h2,{id:i.titleId,...r,ref:t})}).displayName=e9;var e7="DialogDescription";o.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=eq(e7,n);return(0,s.jsx)(G.p,{id:i.descriptionId,...r,ref:t})}).displayName=e7;var te="DialogClose";function tt(e){return e?"open":"closed"}o.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=eq(te,n);return(0,s.jsx)(G.button,{type:"button",...r,ref:t,onClick:h(e.onClick,()=>i.onOpenChange(!1))})}).displayName=te;var tn="DialogTitleWarning",[tr,ti]=function(e,t){let n=o.createContext(t),r=e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,s.jsx)(n.Provider,{value:i,children:t})};return r.displayName=e+"Provider",[r,function(r){let i=o.useContext(n);if(i)return i;if(void 0!==t)return t;throw Error("`".concat(r,"` must be used within `").concat(e,"`"))}]}(tn,{contentName:e5,titleName:e9,docsSlug:"dialog"}),ts=e=>{let{titleId:t}=e,n=ti(tn),r="`".concat(n.contentName,"` requires a `").concat(n.titleName,"` for the component to be accessible for screen reader users.\n\nIf you want to hide the `").concat(n.titleName,"`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/").concat(n.docsSlug);return o.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},to=e=>{let{contentRef:t,descriptionId:n}=e,r=ti("DialogDescriptionWarning"),i="Warning: Missing `Description` or `aria-describedby={undefined}` for {".concat(r.contentName,"}.");return o.useEffect(()=>{var e;let r=null==(e=t.current)?void 0:e.getAttribute("aria-describedby");n&&r&&(document.getElementById(n)||console.warn(i))},[i,t,n]),null},ta=Symbol.for("react.lazy"),tl=o[" use ".trim().toString()];function tu(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===ta&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var tc=Symbol("radix.slottable");function td(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tc}var tf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>
1{let n=function(e){let t=function(e){let t=o.forwardRef((e,t)=>{let{children:n,...r}=e;if(tu(n)&&"function"==typeof tl&&(n=tl(n._payload)),o.isValidElement(n)){var i,s,a;let e,l,u=(l=(e=null==(s=Object.getOwnPropertyDescriptor((i=n).props,"ref"))?void 0:s.get)&&"isReactWarning"in e&&e.isReactWarning)?i.ref:(l=(e=null==(a=Object.getOwnPropertyDescriptor(i,"ref"))?void 0:a.get)&&"isReactWarning"in e&&e.isReactWarning)?i.props.ref:i.props.ref||i.ref,c=function(e,t){let n={...t};for(let r in t){let i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=s(...t);return i(...t),r}:i&&(n[r]=i):"style"===r?n[r]={...i,...s}:"className"===r&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==o.Fragment&&(c.ref=t?g(t,u):u),o.cloneElement(n,c)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),n=o.forwardRef((e,n)=>{let{children:r,...i}=e;tu(r)&&"function"==typeof tl&&(r=tl(r._payload));let a=o.Children.toArray(r),l=a.find(td);if(l){let e=l.props.children,r=a.map(t=>t!==l?t:o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null);return(0,s.jsx)(t,{...i,ref:n,children:o.isValidElement(e)?o.cloneElement(e,void 0,r):null})}return(0,s.jsx)(t,{...i,ref:n,children:r})});return n.displayName="".concat(e,".Slot"),n}("Primitive.".concat(t)),r=o.forwardRef((e,r)=>{let{asChild:i,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(i?n:t,{...o,ref:r})});return r.displayName="Primitive.".concat(t),{...e,[t]:r}},{}),th='[cmdk-group=""]',tp='[cmdk-group-items=""]',tg='[cmdk-item=""]',tv="".concat(tg,':not([aria-disabled="true"])'),tm="cmdk-item-select",t_="data-value",ty=(e,t,n)=>(function(e,t,n){return function e(t,n,r,i,s,o,a){if(o===n.length)return s===t.length?1:.99;var f="".concat(s,",").concat(o);if(void 0!==a[f])return a[f];for(var h,p,g,v,m=i.charAt(o),_=r.indexOf(m,s),y=0;_>=0;)(h=e(t,n,r,i,_+1,o+1,a))>y&&(_===s?h*=1:l.test(t.charAt(_-1))?(h*=.8,(g=t.slice(s,_-1).match(u))&&s>0&&(h*=Math.pow(.999,g.length))):c.test(t.charAt(_-1))?(h*=.9,(v=t.slice(s,_-1).match(d))&&s>0&&(h*=Math.pow(.999,v.length))):(h*=.17,s>0&&(h*=Math.pow(.999,_-s))),t.charAt(_)!==n.charAt(o)&&(h*=.9999)),(h<.1&&r.charAt(_-1)===i.charAt(o+1)||i.charAt(o+1)===i.charAt(o)&&r.charAt(_-1)!==i.charAt(o))&&.1*(p=e(t,n,r,i,_+1,o+2,a))>h&&(h=.1*p),h>y&&(y=h),_=r.indexOf(m,_+1);return a[f]=y,y}(e=n&&n.length>0?"".concat(e+" "+n.join(" ")):e,t,f(e),f(t),0,0,{})})(e,t,n),tb=o.createContext(void 0),tx=()=>o.useContext(tb),tE=o.createContext(void 0),tw=()=>o.useContext(tE),tS=o.createContext(void 0),tR=o.forwardRef((e,t)=>{let n=tF(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=tF(()=>new Set),i=tF(()=>new Map),s=tF(()=>new Map),a=tF(()=>new Set),l=tM(e),{label:u,children:c,value:d,onValueChange:f,filter:h,shouldFilter:p,loop:g,disablePointerSelection:v=!1,vimBindings:m=!0,..._}=e,y=b(),x=b(),E=b(),w=o.useRef(null),S=tj();tN(()=>{if(void 0!==d){let e=d.trim();n.current.value=e,R.emit()}},[d]),tN(()=>{S(6,P)},[]);let R=o.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,s,o,a;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)I(),T(),S(1,O);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(E);e?e.focus():null==(i=document.getElementById(y))||i.focus()}if(S(7,()=>{var e;n.current.selectedItemId=null==(e=A())?void 0:e.id,R.emit()}),r||S(5,P),(null==(s=l.current)?void 0:s.value)!==void 0){null==(a=(o=l.current).onValueChange)||a.call(o,null!=t?t:"");return}}R.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),k=o.useMemo(()=>({value:(e,t,r)=>{var i;t!==(null==(i=s.current.get(e))?void 0:i.value)&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,C(t,r)),S(2,()=>{T(),R.emit()}))},item:(e,t)=>
1(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{I(),T(),n.current.value||O(),R.emit()}),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{I(),(null==t?void 0:t.getAttribute("id"))===e&&O(),R.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{s.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:E,labelId:x,listInnerRef:w}),[]);function C(e,t){var r,i;let s=null!=(i=null==(r=l.current)?void 0:r.filter)?i:ty;return e?s(e,n.current.search,t):0}function T(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),s=0;r.forEach(t=>{s=Math.max(e.get(t),s)}),t.push([n,s])});let r=w.current;M().sort((t,n)=>{var r,i;let s=t.getAttribute("id"),o=n.getAttribute("id");return(null!=(r=e.get(o))?r:0)-(null!=(i=e.get(s))?i:0)}).forEach(e=>{let t=e.closest(tp);t?t.appendChild(e.parentElement===t?e:e.closest("".concat(tp," > *"))):r.appendChild(e.parentElement===r?e:e.closest("".concat(tp," > *")))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=w.current)?void 0:t.querySelector("".concat(th,"[").concat(t_,'="').concat(encodeURIComponent(e[0]),'"]'));null==n||n.parentElement.appendChild(n)})}function O(){let e=M().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(t_);R.setState("value",t||void 0)}function I(){var e,t,o,a;if(!n.current.search||!1===l.current.shouldFilter){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let u=0;for(let i of r.current){let r=C(null!=(t=null==(e=s.current.get(i))?void 0:e.value)?t:"",null!=(a=null==(o=s.current.get(i))?void 0:o.keywords)?a:[]);n.current.filtered.items.set(i,r),r>0&&u++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=u}function P(){var e,t,n;let r=A();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(th))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function A(){var e;return null==(e=w.current)?void 0:e.querySelector("".concat(tg,'[aria-selected="true"]'))}function M(){var e;return Array.from((null==(e=w.current)?void 0:e.querySelectorAll(tv))||[])}function N(e){let t=M()[e];t&&R.setState("value",t.getAttribute(t_))}function F(e){var t;let n=A(),r=M(),i=r.findIndex(e=>e===n),s=r[i+e];null!=(t=l.current)&&t.loop&&(s=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),s&&R.setState("value",s.getAttribute(t_))}function L(e){let t=A(),n=null==t?void 0:t.closest(th),r;for(;n&&!r;)r=null==(n=e>0?function(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}(n,th):function(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}(n,th))?void 0:n.querySelector(tv);r?R.setState("value",r.getAttribute(t_)):F(e)}let D=()=>N(M().length-1),j=e=>{e.preventDefault(),e.metaKey?D():e.altKey?L(1):F(1)},$=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?L(-1):F(-1)};return o.createElement(tf.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=_.onKeyDown)||t.call(_,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||n))switch(e.key){case"n":case"j":m&&e.ctrlKey&&j(e);break;case"ArrowDown":j(e);break;case"p":case"k":m&&e.ctrlKey&&$(e);break;case"ArrowUp":$(e);break;case"Home":e.preventDefault(),N(0);break;case"End":e.preventDefault(),D();break;case"Enter":{e.preventDefault();let t=A();if(t){let e=new Event(tm);t.dispatchEvent(e)}}}}},o.createElement("label",{"cmdk-label":"",htmlFor:k.inputId,id:k.labelId,style:tW},u),t$(e,e=>o.createElement(tE.Provider,{value:R},o.createElement(tb.Provider,{value:k},e))))}),tk=o.forwardRef((e,t)=>{var n,r;let i=b(),s=o.useRef(null),a=o.useContext(tS),l=tx(),u=tM(e),c=null!=(r=null==(n=u.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;tN(()=>
1{if(!c)return l.item(i,null==a?void 0:a.id)},[c]);let d=tD(i,s,[e.value,e.children,s],e.keywords),f=tw(),h=tL(e=>e.value&&e.value===d.current),p=tL(e=>!!c||!1===l.filter()||!e.search||e.filtered.items.get(i)>0);function v(){var e,t;m(),null==(t=(e=u.current).onSelect)||t.call(e,d.current)}function m(){f.setState("value",d.current,!0)}if(o.useEffect(()=>{let t=s.current;if(!(!t||e.disabled))return t.addEventListener(tm,v),()=>t.removeEventListener(tm,v)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:_,value:y,onSelect:x,forceMount:E,keywords:w,...S}=e;return o.createElement(tf.div,{ref:g(s,t),...S,id:i,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!h,"data-disabled":!!_,"data-selected":!!h,onPointerMove:_||l.getDisablePointerSelection()?void 0:m,onClick:_?void 0:v},e.children)}),tC=o.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...s}=e,a=b(),l=o.useRef(null),u=o.useRef(null),c=b(),d=tx(),f=tL(e=>!!i||!1===d.filter()||!e.search||e.filtered.groups.has(a));tN(()=>d.group(a),[]),tD(a,l,[e.value,e.heading,u]);let h=o.useMemo(()=>({id:a,forceMount:i}),[i]);return o.createElement(tf.div,{ref:g(l,t),...s,"cmdk-group":"",role:"presentation",hidden:!f||void 0},n&&o.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),t$(e,e=>o.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},o.createElement(tS.Provider,{value:h},e))))}),tT=o.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=o.useRef(null),s=tL(e=>!e.search);return n||s?o.createElement(tf.div,{ref:g(i,t),...r,"cmdk-separator":"",role:"separator"}):null}),tO=o.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=null!=e.value,s=tw(),a=tL(e=>e.search),l=tL(e=>e.selectedItemId),u=tx();return o.useEffect(()=>{null!=e.value&&s.setState("search",e.value)},[e.value]),o.createElement(tf.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:i?e.value:a,onChange:e=>{i||s.setState("search",e.target.value),null==n||n(e.target.value)}})}),tI=o.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,s=o.useRef(null),a=o.useRef(null),l=tL(e=>e.selectedItemId),u=tx();return o.useEffect(()=>{if(a.current&&s.current){let e=a.current,t=s.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty("--cmdk-list-height",n.toFixed(1)+"px")})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),o.createElement(tf.div,{ref:g(s,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},t$(e,e=>o.createElement("div",{ref:g(a,u.listInnerRef),"cmdk-list-sizer":""},e)))}),tP=o.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:s,container:a,...l}=e;return o.createElement(eG,{open:n,onOpenChange:r},o.createElement(eZ,{container:a},o.createElement(e0,{"cmdk-overlay":"",className:i}),o.createElement(e3,{"aria-label":e.label,"cmdk-dialog":"",className:s},o.createElement(tR,{ref:t,...l}))))}),tA=Object.assign(tR,{List:tI,Item:tk,Input:tO,Group:tC,Separator:tT,Dialog:tP,Empty:o.forwardRef((e,t)=>tL(e=>0===e.filtered.count)?o.createElement(tf.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:o.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...s}=e;return o.createElement(tf.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},t$(e,e=>o.createElement("div",{"aria-hidden":!0},e)))})});function tM(e){let t=o.useRef(e);return tN(()=>{t.current=e}),t}var tN="undefined"==typeof window?o.useEffect:o.useLayoutEffect;function tF(e){let t=o.useRef();return void 0===t.current&&(t.current=e()),t}function tL(e){let t=tw(),n=()=>e(t.snapshot());return o.useSyncExternalStore(t.subscribe,n,n)}function tD(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=o.useRef(),s=tx();return tN(()=>{var o;let a=(()=>{var e;
1for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():i.current}})(),l=r.map(e=>e.trim());s.value(e,a,l),null==(o=t.current)||o.setAttribute(t_,a),i.current=a}),i}var tj=()=>{let[e,t]=o.useState(),n=tF(()=>new Map);return tN(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function t$(e,t){let n,{asChild:r,children:i}=e;return r&&o.isValidElement(i)?o.cloneElement("function"==typeof(n=i.type)?n(i.props):"render"in n?n.render(i.props):i,{ref:i.ref},t(i.props.children)):t(i)}var tW={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},tH=e.i(49793);let tB=(0,tH.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var tV=e.i(75419);let tU=(0,tH.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var tz=e.i(76248);let tq=(0,tH.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-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"}]]),tG=(0,tH.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var tY=e.i(69670);let tX=(0,tH.default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);var tK=e.i(54501),tJ=e.i(26138),tZ=e.i(53601),tQ=e.i(32137),t0=e.i(96561),t1=e.i(91759),t2=e.i(96857);function t5(e){let{...t}=e;return(0,s.jsx)(tQ.Dialog.Root,{"data-slot":"dialog",...t})}function t3(e){let{...t}=e;return(0,s.jsx)(tQ.Dialog.Portal,{"data-slot":"dialog-portal",...t})}function t4(e){let{className:t,...n}=e;return(0,s.jsx)(tQ.Dialog.Backdrop,{"data-slot":"dialog-overlay",className:(0,t0.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",t),...n})}function t8(e){let{className:t,children:n,showCloseButton:r=!0,...i}=e;return(0,s.jsxs)(t3,{children:[(0,s.jsx)(t4,{}),(0,s.jsxs)(tQ.Dialog.Popup,{"data-slot":"dialog-content",className:(0,t0.cn)("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...i,children:[n,r&&(0,s.jsxs)(tQ.Dialog.Close,{"data-slot":"dialog-close",render:(0,s.jsx)(t1.Button,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[(0,s.jsx)(t2.XIcon,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}var t6=e.i(4889);let t9=[{title:"Home",href:"/",group:"Pages",icon:tq},{title:"Blog",href:"/blog",group:"Pages",description:"Daily RN/Expo digest",icon:tV.BookOpen},{title:"Community",href:"/community",group:"Pages",description:"Forum + Ask",icon:tX},{title:"Status",href:"/status",group:"Pages",description:"Ecosystem health",icon:tZ.Sparkles},{title:"About",href:"/about",group:"Pages",icon:tG},{title:"Newsletter",href:"/newsletter",group:"Pages",icon:tz.FileText},{title:"ERNE",href:"/product",group:"Products",description:"AI harness for RN",icon:tK.Package},{title:"All products",href:"/products",group:"Products",icon:tK.Package},{title:"context-mem",href:"/products/context-mem",group:"Products",icon:tK.Package},{title:"expo-pretext",href:"/products/expo-pretext",group:"Products",icon:tK.Package}],t7="erne:search-recents";function ne(){try{let e=localStorage.getItem(t7);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.slice(0,5):[]}catch(e){return[]}}function nt(){let[e,t]=(0,o.useState)(!1),[n,r]=(0,o.useState)(""),[i,l]=(0,o.useState)([]),[u,c]=(0,o.useState)(!1),[d,f]=(0,o.useState)([]),h=(0,a.useRouter)(),p=(0,o.useRef)(null);(0,o.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),t(e=>!e))}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}
1,[]),(0,t6.useSearchOpener)((0,o.useCallback)(()=>t(!0),[])),(0,o.useEffect)(()=>{if(e)f(ne()),r(""),l([]);else{var t;null==(t=p.current)||t.abort()}},[e]),(0,o.useEffect)(()=>{var t;if(!e)return;let r=n.trim();if(r.length<2){l([]),c(!1);return}let i=new AbortController;null==(t=p.current)||t.abort(),p.current=i;let s=window.setTimeout(async()=>{c(!0);try{let t=await fetch("/api/search?q=".concat(encodeURIComponent(r)),{signal:i.signal});if(!t.ok)throw Error("search failed");let n=await t.json();if(!i.signal.aborted){var e;l(null!=(e=n.articles)?e:[])}}catch(e){"AbortError"!==e.name&&l([])}finally{i.signal.aborted||c(!1)}},180);return()=>{window.clearTimeout(s),i.abort()}},[n,e]);let g=(0,o.useCallback)((e,n)=>{var r={title:n,href:e};try{let e=ne().filter(e=>e.href!==r.href);e.unshift(r),localStorage.setItem(t7,JSON.stringify(e.slice(0,5)))}catch(e){}t(!1),h.push(e)},[h]),v=n.trim().toLowerCase(),m=0===v.length?t9:t9.filter(e=>{var t;return e.title.toLowerCase().includes(v)||(null==(t=e.description)?void 0:t.toLowerCase().includes(v))||e.href.toLowerCase().includes(v)}),_=m.filter(e=>"Pages"===e.group),y=m.filter(e=>"Products"===e.group),b=0===v.length&&d.length>0,x=_.length+y.length+i.length>0;return(0,s.jsx)(t5,{open:e,onOpenChange:t,children:(0,s.jsx)(t8,{showCloseButton:!1,className:"overflow-hidden gap-0 p-0 sm:max-w-xl",children:(0,s.jsxs)(tA,{label:"Search",shouldFilter:!1,className:"flex flex-col [&_[cmdk-group-heading]]:mb-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-muted-foreground",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/60 px-3",children:[(0,s.jsx)(tJ.Search,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,s.jsx)(tA.Input,{autoFocus:!0,value:n,onValueChange:r,placeholder:"Search pages, products, articles…",className:"flex h-12 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"}),u&&(0,s.jsx)(tY.Loader2,{className:"h-4 w-4 shrink-0 animate-spin text-muted-foreground"})]}),(0,s.jsxs)(tA.List,{className:"max-h-[360px] overflow-y-auto overscroll-contain p-2",children:[!x&&!b&&!u&&(0,s.jsx)(tA.Empty,{className:"py-10 text-center text-sm text-muted-foreground",children:v.length<2&&v.length>0?"Keep typing…":"No results found."}),b&&(0,s.jsx)(tA.Group,{heading:"Recent",children:d.map(e=>(0,s.jsx)(nn,{icon:tU,title:e.title,href:e.href,onSelect:()=>g(e.href,e.title)},"recent-".concat(e.href)))}),_.length>0&&(0,s.jsx)(tA.Group,{heading:"Pages",children:_.map(e=>(0,s.jsx)(nn,{icon:e.icon,title:e.title,description:e.description,href:e.href,onSelect:()=>g(e.href,e.title)},e.href))}),y.length>0&&(0,s.jsx)(tA.Group,{heading:"Products",children:y.map(e=>(0,s.jsx)(nn,{icon:e.icon,title:e.title,description:e.description,href:e.href,onSelect:()=>g(e.href,e.title)},e.href))}),i.length>0&&(0,s.jsx)(tA.Group,{heading:"Articles",children:i.map(e=>{var t;return(0,s.jsx)(nn,{icon:tz.FileText,title:e.title,description:null!=(t=e.excerpt)?t:void 0,href:"/blog/".concat(e.slug),onSelect:()=>g("/blog/".concat(e.slug),e.title)},e.id)})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-border/60 bg-muted/30 px-3 py-2 text-[10px] text-muted-foreground",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(nr,{keys:["↵"],label:"open"}),(0,s.jsx)(nr,{keys:["↑","↓"],label:"navigate"}),(0,s.jsx)(nr,{keys:["esc"],label:"close"})]}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Powered by ERNE"})]})]})})})}function nn(e){let{icon:t,title:n,description:r,href:i,onSelect:o}=e;return(0,s.jsxs)(tA.Item,{value:"".concat(n,"-").concat(i),onSelect:o,className:"group/item flex cursor-pointer items-center gap-3 rounded-md px-2 py-2 text-sm aria-selected:bg-accent",children:[(0,s.jsx)(t,{className:"h-4 w-4 shrink-0 text-muted-foreground group-aria-selected/item:text-foreground"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"truncate font-medium",children:n}),r&&(0,s.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:r})]}),(0,s.jsx)(tB,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-aria-selected/item:opacity-100"})]})}function nr(e){let{keys:t,label:n}=e;return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",children:[t.map(e=>(0,s.jsx)("kbd",{className:"inline-flex h-4 min-w-4 items-center justify-center rounded border border-border bg-background px-1 font-sans text-[10px] font-medium",children:e},e)),(0,s.jsx)("span",{children:n})]})}},16710,e=>{"use strict";e.s(["AnalyticsProvider",()=>sZ],16710);var t=e.i(19940),n=e.i(46882),r=e.i(55118),i=e.i(97583);function s(){return"undefined"!=typeof window}function o(){return"production"}function a(){return"development"===((s()?window.vam:o())||"production")}function l(e){return new RegExp("/".concat(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"(?=[/?#]|$)"))}function u(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/".concat(e)}function c(e){return(0,r.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),(0,r.useEffect)(()=>{var n,r;!function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debug:!0},n=arguments.length>1?arguments[1]:void 0;if(!s())return;let{beforeSend:r,src:i,dataset:l}=function(e,t){var n,r;let i=e;if(t)try{i={...null==(n=JSON.parse(t))?void 0:n.analytics,...e}}catch(e){}!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto";if("auto"===e){window.vam=o();return}window.vam=e}(i.mode);
1let s={sdkn:"@vercel/analytics"+(i.framework?"/".concat(i.framework):""),sdkv:"2.0.1"};return i.disableAutoTrack&&(s.disableAutoTrack="1"),i.viewEndpoint&&(s.viewEndpoint=u(i.viewEndpoint)),i.eventEndpoint&&(s.eventEndpoint=u(i.eventEndpoint)),i.sessionEndpoint&&(s.sessionEndpoint=u(i.sessionEndpoint)),a()&&!1===i.debug&&(s.debug="false"),i.dsn&&(s.dsn=i.dsn),i.endpoint?s.endpoint=i.endpoint:i.basePath&&(s.endpoint=u("".concat(i.basePath,"/insights"))),{beforeSend:i.beforeSend,src:(r=i).scriptSrc?u(r.scriptSrc):a()?"https://va.vercel-scripts.com/v1/script.debug.js":r.basePath?u("".concat(r.basePath,"/insights/script.js")):"/_vercel/insights/script.js",dataset:s}}(t,n);if(window.va||(window.va=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];window.vaq||(window.vaq=[]),window.vaq.push(t)}),r&&(null==(e=window.va)||e.call(window,"beforeSend",r)),document.head.querySelector('script[src*="'.concat(i,'"]')))return;let c=document.createElement("script");for(let[e,t]of(c.src=i,Object.entries(l)))c.dataset[e]=t;c.defer=!0,c.onerror=()=>{let e=a()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log("[Vercel Web Analytics] Failed to load script from ".concat(i,". ").concat(e))},document.head.appendChild(c)}({framework:e.framework||"react",basePath:null!=(n=e.basePath)?n:function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...void 0!==e.route&&{disableAutoTrack:!0},...e},null!=(r=e.configString)?r:function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}())},[]),(0,r.useEffect)(()=>{e.route&&e.path&&function(e){var t;let{route:n,path:r}=e;null==(t=window.va)||t.call(window,"pageview",{route:n,path:r})}({route:e.route,path:e.path})},[e.route,e.path]),null}function d(e){let{route:n,path:s}=(()=>{let e=(0,i.useParams)(),t=(0,i.useSearchParams)(),n=(0,i.usePathname)();return e?{route:function(e,t){if(!e||!t)return e;let n=e;try{let e=Object.entries(t);for(let[t,r]of e)if(!Array.isArray(r)){let e=l(r);e.test(n)&&(n=n.replace(e,"/[".concat(t,"]")))}for(let[t,r]of e)if(Array.isArray(r)){let e=l(r.join("/"));e.test(n)&&(n=n.replace(e,"/[...".concat(t,"]")))}return n}catch(t){return e}}(n,Object.keys(e).length?e:Object.fromEntries(t.entries())),path:n}:{route:null,path:n}})();return r.default.createElement(c,{path:s,route:n,...e,basePath:function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}
1(),configString:function(){if(void 0!==t.default&&void 0!==t.default.env)return'{"analytics":{"scriptSrc":"b5ae1e376a991a10/script.js","viewEndpoint":"b5ae1e376a991a10/view","eventEndpoint":"b5ae1e376a991a10/event","sessionEndpoint":"b5ae1e376a991a10/session"},"speedInsights":{"scriptSrc":"95f6983f84f40fae/script.js","endpoint":"95f6983f84f40fae/vitals"}}'}(),framework:"next"})}function f(e){return r.default.createElement(r.Suspense,{fallback:null},r.default.createElement(d,{...e}))}var h="undefined"!=typeof window?window:void 0,p="undefined"!=typeof globalThis?globalThis:h;"undefined"==typeof self&&(p.self=p),"undefined"==typeof File&&(p.File=function(){});var g=null==p?void 0:p.navigator,v=null==p?void 0:p.document,m=null==p?void 0:p.location,_=null==p?void 0:p.fetch,y=null!=p&&p.XMLHttpRequest&&"withCredentials"in new p.XMLHttpRequest?p.XMLHttpRequest:void 0,b=null==p?void 0:p.AbortController,x=null==p?void 0:p.CompressionStream,E=null==g?void 0:g.userAgent,w=null!=h?h:{},S="1.369.0",R={DEBUG:!1,LIB_VERSION:S,LIB_NAME:"web",JS_SDK_VERSION:S};function k(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function C(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(e){k(s,r,i,o,a,"next",e)}function a(e){k(s,r,i,o,a,"throw",e)}o(void 0)})}}function T(){return(T=Object.assign.bind()).apply(null,arguments)}function O(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function I(){return(I=C(function*(e,t,n){void 0===t&&(t=!0);try{var r=new Blob([e],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return yield new Response(r).blob()}catch(e){if(null!=n&&n.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var P=["$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"],A=["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"],M=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var n=e.toLowerCase();return A.concat(t).some(e=>{var t=e.toLowerCase();return -1!==n.indexOf(t)})};function N(e,t){return -1!==e.indexOf(t)}var F=function(e){return e.trim()},L=function(e){return e.replace(/^\$/,"")},D=Object.prototype,j=D.hasOwnProperty,$=D.toString,W=Array.isArray||function(e){return"[object Array]"===$.call(e)},H=e=>"function"==typeof e,B=e=>e===Object(e)&&!W(e),V=e=>{if(B(e)){for(var t in e)if(j.call(e,t))return!1;return!0}return!1},U=e=>void 0===e,z=e=>"[object String]"==$.call(e),q=e=>z(e)&&0===e.trim().length,G=e=>null===e,Y=e=>U(e)||G(e),X=e=>"[object Number]"==$.call(e)&&e==e,K=e=>X(e)&&e>0,J=e=>"[object Boolean]"===$.call(e),Z=e=>N(P,e);function Q(e){return null===e||"object"!=typeof e}function ee(e,t){return({}).toString.call(e)==="[object "+t+"]"}function et(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var en=[!0,"true",1,"1","yes"],er=e=>N(en,e),ei=[!1,"false",0,"0","no"];function es(e,t,n,r,i){return t>n&&(r.warn("min cannot be greater than max."),t=n),X(e)?e>n?(r.warn(" cannot be  greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),es(i||n,t,n,r))}class eo{Ht(e,t){var n=Math.floor((t-e.lastAccess)/this.Vt);n>0&&(e.tokens=Math.min(e.tokens+n*this.$t,this.jt),e.lastAccess=e.lastAccess+n*this.Vt)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.Pt[r];return i?this.Ht(i,n):this.Pt[r]=i={tokens:this.jt,lastAccess:n},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(t=this.Dt)||t.call(this,e)),0===i.tokens)}stop(){this.Pt={}}constructor(e){this.Pt={},this.Dt=e.Dt,this.jt=es(e.bucketSize,0,100,e.qt),this.$t=es(e.refillRate,0,this.jt,e.qt),this.Vt=es(e.refillInterval,0,864e5,e.qt)}}var ea,el,eu,ec="Mobile",ed="Android",ef="Tablet",eh=ed+" "+ef,ep="iPad",eg="Apple",ev=eg+" Watch",em="Safari",e_="BlackBerry",ey="Samsung",eb=ey+"Browser",ex=ey+" Internet",eE="Chrome",ew=eE+" OS",eS=eE+" iOS",eR="Internet Explorer",ek=eR+" "+ec,eC="Opera",eT=eC+" Mini",eO="Edge",eI="Microsoft "+eO,eP="Firefox",eA=eP+" iOS",eM="Nintendo",eN="PlayStation",eF="Xbox",eL=ed+" "+ec,eD=ec+" "+em,ej="Windows",e$=ej+" Phone",eW="Nokia",eH="Ouya",eB="Generic",eV=eB+" "+ec.toLowerCase(),eU=eB+" "+ef.toLowerCase(),ez="Konqueror",eq="(\\d+(\\.\\d+)?)",eG=RegExp("Version/"+eq),eY=RegExp(eF,"i"),eX=RegExp(eN+" \\w+","i"),eK=RegExp(eM+" \\w+","i"),eJ=RegExp(e_+"|PlayBook|BB10","i"),eZ={"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"},eQ=function(e,t){var n;return t=t||"",N(e," OPR/")&&N(e,"Mini")?eT:N(e," OPR/")?eC:eJ.test(e)?e_:N(e,"IE"+ec)||N(e,"WPDesktop")?ek:N(e,eb)?ex:N(e,eO)||N(e,"Edg/")?eI:N(e,"FBIOS")?"Facebook "+ec:N(e,"UCWEB")||N(e,"UCBrowser")?"UC Browser":N(e,"CriOS")?eS:N(e,"CrMo")||N(e,eE)?eE:N(e,ed)&&N(e,em)?eL:N(e,"FxiOS")?eA:N(e.toLowerCase(),ez.toLowerCase())?ez:(n=t)&&N(n,eg)||N(e,em)&&!N(e,eE)&&!N(e,ed)?N(e,ec)?eD:em:N(e,eP)?eP:N(e,"MSIE")||N(e,"Trident/")?eR:N(e,"Gecko")?eP:""},e0={[ek]:[RegExp("rv:"+eq)],[eI]:[RegExp(eO+"?\\/"+eq)],[eE]:[RegExp("("+eE+"|CrMo)\\/"+eq)],[eS]:[RegExp("CriOS\\/"+eq)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+eq)],[em]:[eG],[eD]:[eG],[eC]:[RegExp("(Opera|OPR)\\/"+eq)],[eP]:[RegExp(eP+"\\/"+eq)],[eA]:[RegExp("FxiOS\\/"+eq)],[ez]:[RegExp("Konqueror[:/]?"+eq,"i")],[e_]:[RegExp(e_+" "+eq),eG],[eL]:[RegExp("android\\s"+eq,"i")],[ex]:[RegExp(eb+"\\/"+eq)],[eR]:[RegExp("(rv:|MSIE )"+eq)],Mozilla:[RegExp("rv:"+eq)]},e1=function(e,t){var n=e0[eQ(e,t)];if(U(n))return null;for(var r=0;n.length>r;r++){var i=e.match(n[r]);if(i)return parseFloat(i[i.length-2])}return null},e2=[[RegExp(eF+"; "+eF+" (.*?)[);]","i"),e=>[eF,e&&e[1]||""]],[RegExp(eM,"i"),[eM,""]],[RegExp(eN,"i"),[eN,""]],[eJ,[e_,""]],[RegExp(ej,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[e$,""];if(new RegExp(ec).test(t)&&!/IEMobile\b/.test(t))return[ej+" "+ec,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=eZ[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[ej,r]}return[ej,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=U(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ed+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ed+")","i"),e=>e&&e[2]?[ed,[e[2],e[3],e[4]||"0"].join(".")]:[ed,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ew,""]],[/Linux|debian/i,["Linux",""]]],e5=function(e){return eK.test(e)?eM:eX.test(e)?eN:eY.test(e)?eF:RegExp(eH,"i").test(e)?eH:RegExp("("+e$+"|WPDesktop)","i").test(e)?e$:/iPad/.test(e)?ep:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ev:eJ.test(e)?e_:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eW,"i").test(e)?eW:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(ec).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ed:eh:RegExp("(pda|"+ec+")","i").test(e)?eV:RegExp(ef,"i").test(e)&&!RegExp(ef+" pc","i").test(e)?eU:""},e3=e=>e instanceof Error;class e4{buildFromUnknown(e,t){void 0===t&&(t={});var n=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),s=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(s,n),$exception_level:"error"}}modifyFrames(e){var t=this;return C(function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&W(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var n,r;return null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),T({},e,{cause:n,stack:r})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return C(function*(){var n=e;for(var r of t.modifiers)n=yield r(n);return n})()}convertToExceptionList(e,t){var n,r,i,s={type:e.type,value:e.value,mechanism:{type:null!=(n=t.type)?n:"generic",handled:null==(r=t.handled)||r,synthetic:null!=(i=e.synthetic)&&i}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var o=[s];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,T({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return eu&&n.length===el||(el=n.length,eu=n.reduce((n,r)=>{ea||(ea={});var i=ea[r];if(i)n[i[0]]=i[1];else for(var s=e(r),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=t[r];if(l&&u){n[l]=u,ea[r]=[l,u];break}}return n},{})),eu}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,n){void 0===n&&(n=0);var r=(n,r)=>{if(4>=r){var i=this.buildCoercingContext(e,t,r);return this.applyCoercers(n,i)}};return T({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}constructor(e,t,n){void 0===n&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}}function e8(e,t,n,r,i){var s={platform:e,filename:t,function:"<anonymous>"===n?"?":n,in_app:!0};return U(r)||(s.lineno=r),U(i)||(s.colno=i),s}var e6=(e,t)=>{var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},e9=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,e7=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,te=/\((\S*)(?::(\d+))(?::(\d+))\)/,tt=(e,t)=>{var n=e9.exec(e);if(n){var[,r,i,s]=n;return e8(t,r,"?",+i,+s)}var o=e7.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=te.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=e6(o[1]||"?",o[2]);return e8(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},tn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ti=(e,t)=>{var n=tn.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=tr.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],s=n[1]||"?";return[s,i]=e6(s,i),e8(t,i,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},ts=/\(error: (.*)\)/;class to{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=z(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return ee(e,"DOMException")}isDOMError(e){return ee(e,"DOMError")}}class ta{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var n=e.message;return String(n.error&&"string"==typeof n.error.message?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}}class tl{match(e){return ee(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var n;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}}constructor(){}}var tu=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tc{match(e){return"string"==typeof e}coerce(e,t){var n,[r,i]=this.getInfos(e);return{type:null!=r?r:"Error",value:null!=i?i:e,stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}}getInfos(e){var t="Error",n=e,r=e.match(tu);return r&&(t=r[1],n=r[2]),[t,n]}}var td=["fatal","error","warning","log","info","debug"];function tf(e,t){void 0===t&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");
1if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+"...":i}return""}class th{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var n,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null==(n=t.syntheticException)?void 0:n.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return et(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var n=this.getObjectClassName(e);return(n&&"Object"!==n?"'"+n+"'":"Object")+" captured as exception with keys: "+tf(e)}isSeverityLevel(e){return z(e)&&!q(e)&&td.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var n=e[t];if(e3(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tp{match(e){return et(e)}coerce(e,t){var n,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+tf(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}}}class tg{match(e){return Q(e)}coerce(e,t){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}}}class tv{match(e){return ee(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!et(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var n,r=this.getUnhandledRejectionReason(e);return Q(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var tm=function(e,t){var{debugEnabled:n}=void 0===t?{}:t,r={C(t){if(h&&(R.DEBUG||w.POSTHOG_DEBUG||n)&&!U(h.console)&&h.console){for(var r=("__rrweb_original__"in h.console[t])?h.console[t].__rrweb_original__:h.console[t],i=arguments.length,s=Array(i>1?i-1:0),o=1;i>o;o++)s[o-1]=arguments[o];r(e,...s)}},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.C("log",...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.C("warn",...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.C("error",...t)},critical(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];console.error(e,...n)},uninitializedWarning(e){r.error("You must initialize PostHog before calling "+e)},createLogger:(t,n)=>tm(e+" "+t,n)};return r},t_=tm("[PostHog.js]"),ty=t_.createLogger,tb=ty("[ExternalScriptsLoader]"),tx=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return tb.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=null==v?void 0:v.querySelectorAll("script");if(r){for(var i,s=0;r.length>s;s++)if(i=function(){if(r[s].src===t){var e=r[s];return e.__posthog_loading_callback_fired?{v:n()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,n(void 0,t)}),e.onerror=e=>n(e),{v:void 0})}}())return i.v}var o=()=>{if(!v)return n("document not found");var r=v.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,n(void 0,e)},r.onerror=e=>n(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return n("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)v.head.appendChild(r);else{var i,s=v.querySelectorAll("body > script");s.length>0?null==(i=s[0].parentNode)||i.insertBefore(r,s[0]):v.body.appendChild(r)}};null!=v&&v.body?o():null==v||v.addEventListener("DOMContentLoaded",o)};w.__PosthogExtensions__=w.__PosthogExtensions__||{},w.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if("remote-config"!==t)if(e._resolvedSdkVersion){var r=e.requestRouter.endpointFor("assets","/static/"+e._resolvedSdkVersion+"/"+t+".js");tx(e,r,n)}else{var i="/static/"+t+".js?v="+e.version;"toolbar"===t&&(i=i+"&t="+3e5*Math.floor(Date.now()/3e5));
1var s=e.requestRouter.endpointFor("assets",i);tx(e,s,n)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");tx(e,o,n)}},w.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);tx(e,r,n)};var tE="$people_distinct_id",tw="$device_id",tS="__alias",tR="__timers",tk="$autocapture_disabled_server_side",tC="$heatmaps_enabled_server_side",tT="$exception_capture_enabled_server_side",tO="$error_tracking_suppression_rules",tI="$error_tracking_capture_extension_exceptions",tP="$web_vitals_enabled_server_side",tA="$dead_clicks_enabled_server_side",tM="$product_tours_enabled_server_side",tN="$web_vitals_allowed_metrics",tF="$session_recording_remote_config",tL="$sesid",tD="$session_is_sampled",tj="$enabled_feature_flags",t$="$early_access_features",tW="$feature_flag_details",tH="$stored_person_properties",tB="$stored_group_properties",tV="$surveys",tU="$flag_call_reported",tz="$flag_call_reported_session_id",tq="$feature_flag_errors",tG="$feature_flag_evaluated_at",tY="$user_state",tX="$client_session_props",tK="$capture_rate_limit",tJ="$initial_campaign_params",tZ="$initial_referrer_info",tQ="$initial_person_info",t0="$epp",t1="__POSTHOG_TOOLBAR__",t2="$posthog_cookieless",t5=[tE,tS,"__cmpns",tR,"$session_recording_enabled_server_side",tC,tL,tj,tO,tY,t$,tW,tB,tH,tV,tU,tz,tq,tG,tX,tK,tJ,tZ,t0,tQ],t3="PostHog loadExternalDependency extension not found.",t4="on_reject",t8="always",t6="anonymous",t9="identified",t7="identified_only",ne="visibilitychange",nt="beforeunload",nn="$pageview",nr="$pageleave",ni="$identify",ns="$groupidentify";function no(e,t){W(e)&&e.forEach(t)}function na(e,t){if(!Y(e))if(W(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,n)=>t(e,n));else for(var n in e)j.call(e,n)&&t(e[n],n)}var nl=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var s in i)void 0!==i[s]&&(e[s]=i[s]);return e};function nu(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var nc=function(e){try{return e()}catch(e){return}},nd=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){t_.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),t_.critical(e)}}},nf=function(e){var t={};return na(e,function(e,n){(z(e)&&e.length>0||X(e))&&(t[n]=e)}),t},nh=["herokuapp.com","vercel.app","netlify.app"];function np(e,t,n,r){var{capture:i=!1,passive:s=!0}=null!=r?r:{};null==e||e.addEventListener(t,n,{capture:i,passive:s})}function ng(e){return"ph_toolbar_internal"===e.name}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return X(e)&&isFinite(e)&&Math.floor(e)===e});class nv{static fromFieldsV7(e,t,n,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||0>e||0>t||0>n||0>r||e>0xffffffffffff||t>4095||n>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/0x10000000000,i[1]=e/0x100000000,i[2]=e/0x1000000,i[3]=e/65536,i[4]=e/256,i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=r>>>24,i[13]=r>>>16,i[14]=r>>>8,i[15]=r,new nv(i)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new nv(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}}class nm{generate(){var e=this.generateOrAbort();if(U(e)){this.I=0;var t=this.generateOrAbort();if(U(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.A();else{if(this.I>=e+1e4)return;this.S++,this.S>0x3ffffffffff&&(this.I++,this.A())}return nv.fromFieldsV7(this.I,Math.trunc(this.S/0x40000000),0x3fffffff&this.S,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}constructor(){this.I=0,this.S=0,this.k=new nb}}var n_,ny=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};h&&!U(h.crypto)&&crypto.getRandomValues&&(ny=e=>crypto.getRandomValues(e));
1class nb{nextUint32(){return this.T.length>this.N||(ny(this.T),this.N=0),this.T[this.N++]}constructor(){this.T=new Uint32Array(8),this.N=1/0}}var nx=()=>nE().toString(),nE=()=>(n_||(n_=new nm)).generate(),nw="",nS=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,nR={Ut:()=>!!v,Yt(e){t_.error("cookieStore error: "+e)},Gt(e){if(v){try{for(var t=e+"=",n=v.cookie.split(";").filter(e=>e.length),r=0;n.length>r;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},Wt(e){var t;try{t=JSON.parse(nR.Gt(e))||{}}catch(e){}return t},Xt(e,t,n,r,i){if(v)try{var s="",o="",a=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=v),nw)return nw;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+nx();!nw&&r--;){var s=n.slice(r).join("."),o=i+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(i)&&(t.cookie=o+";max-age=0",nw=s)}return nw}(e);if(!n){var r,i=(r=e.match(nS))?r[0]:"";i!==n&&t_.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}(v.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),s="; expires="+l.toUTCString()}i&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&t_.warn("cookieStore warning: large cookie, len="+u.length),v.cookie=u,u}catch(e){return}},Jt(e,t){if(null!=v&&v.cookie)try{nR.Xt(e,"",-1,t)}catch(e){return}}},nk=null,nC={Ut(){if(!G(nk))return nk;var e=!0;if(U(h))e=!1;else try{var t="__mplssupport__";nC.Xt(t,"xyz"),'"xyz"'!==nC.Gt(t)&&(e=!1),nC.Jt(t)}catch(t){e=!1}return e||t_.error("localStorage unsupported; falling back to cookie store"),nk=e,e},Yt(e){t_.error("localStorage error: "+e)},Gt(e){try{return null==h?void 0:h.localStorage.getItem(e)}catch(e){nC.Yt(e)}return null},Wt(e){try{return JSON.parse(nC.Gt(e))||{}}catch(e){}return null},Xt(e,t){try{null==h||h.localStorage.setItem(e,JSON.stringify(t))}catch(e){nC.Yt(e)}},Jt(e){try{null==h||h.localStorage.removeItem(e)}catch(e){nC.Yt(e)}}},nT=[tw,"distinct_id",tL,tD,t0,tQ,tY],nO={},nI={Ut:()=>!0,Yt(e){t_.error("memoryStorage error: "+e)},Gt:e=>nO[e]||null,Wt:e=>nO[e]||null,Xt(e,t){nO[e]=t},Jt(e){delete nO[e]}},nP=null,nA={Ut(){if(!G(nP))return nP;if(nP=!0,U(h))nP=!1;else try{var e="__support__";nA.Xt(e,"xyz"),'"xyz"'!==nA.Gt(e)&&(nP=!1),nA.Jt(e)}catch(e){nP=!1}return nP},Yt(e){t_.error("sessionStorage error: ",e)},Gt(e){try{return null==h?void 0:h.sessionStorage.getItem(e)}catch(e){nA.Yt(e)}return null},Wt(e){try{return JSON.parse(nA.Gt(e))||null}catch(e){}return null},Xt(e,t){try{null==h||h.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){nA.Yt(e)}},Jt(e){try{null==h||h.sessionStorage.removeItem(e)}catch(e){nA.Yt(e)}}};class nM{get Rt(){return this._instance.config}get consent(){return this.Kt()?0:this.Qt}isOptedOut(){return this.Rt.cookieless_mode===t8||0===this.consent||-1===this.consent&&(this.Rt.opt_out_capturing_by_default||this.Rt.cookieless_mode===t4)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}optInOut(e){this.ti.Xt(this.ei,+!!e,this.Rt.cookie_expiration,this.Rt.cross_subdomain_cookie,this.Rt.secure_cookie)}reset(){this.ti.Jt(this.ei,this.Rt.cross_subdomain_cookie)}get ei(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:"__ph_opt_in_out_"+e)}get Qt(){var e=this.ti.Gt(this.ei);return er(e)?1:N(ei,e)?0:-1}get ti(){var e=this.Rt.opt_out_capturing_persistence_type,t="localStorage"===e?nC:nR;if(!this.ii||this.ii!==t){this.ii=t;var n="localStorage"===e?nR:nC;n.Gt(this.ei)&&(this.ii.Gt(this.ei)||this.optInOut(er(n.Gt(this.ei))),n.Jt(this.ei,this.Rt.cross_subdomain_cookie))}return this.ii}Kt(){return!!this.Rt.respect_dnt&&[null==g?void 0:g.doNotTrack,null==g?void 0:g.msDoNotTrack,w.doNotTrack].some(e=>er(e))}constructor(e){this._instance=e}}var nN=ty("[Dead Clicks]"),nF=()=>!0,nL=e=>{var t,n=!(null==(t=e.instance.persistence)||!t.get_property(tA)),r=e.instance.config.capture_dead_clicks;return J(r)?r:!!B(r)||n};
1class nD{get lazyLoadedDeadClicksAutocapture(){return this.ri}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[tA]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ni(()=>{this.si()}):this.stop()}ni(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?nN.error("failed to load script",t):e()})}si(){var e;if(v){if(!this.ri&&null!=(e=w.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=B(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.ri=w.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.ri.start(v),nN.info("starting...")}}else nN.error("`document` not found. Cannot start.")}stop(){this.ri&&(this.ri.stop(),this.ri=void 0,nN.info("stopping..."))}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}}var nj=ty("[SegmentIntegration]"),n$="posthog-js";function nW(e,t){var{organization:n,projectId:r,prefix:i,severityAllowList:s=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{if("*"!==s&&!s.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var a=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=a,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var l,u,c,d,f,h,p=(null==(l=t.exception)?void 0:l.values)||[],g=p.map(e=>T({},e,{stacktrace:e.stacktrace?T({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>T({},e,{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$exception_type:null==(c=p[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(f=p[0])?void 0:f.type,$sentry_tags:t.tags};return n&&r&&(v.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+t.event_id),o&&(null==(h=e.exceptions)||h.sendExceptionEvent(v)),t}}class nH{constructor(e,t,n,r,i,s){this.name=n$,this.setupOnce=function(o){o(nW(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:null==s||s}))}}}class nB{li(){var e;this.ui=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.oi)}destroy(){var e;null==(e=this.ui)||e.call(this),this.ui=void 0}doPageView(e,t){var n,r=this.hi(e,t);return this.ai={pathname:null!=(n=null==h?void 0:h.location.pathname)?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.hi(e,null==(t=this.ai)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ai)?void 0:e.pageViewId}}hi(e,t){var n=this.ai;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:c}=i;if(!(U(s)||U(o)||U(a)||U(l)||U(u)||U(c))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var d=s>1?es(o/s,0,1,t_):1,f=s>1?es(a/s,0,1,t_):1,h=l>1?es(u/l,0,1,t_):1,p=l>1?es(c/l,0,1,t_):1;r=nl(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:p})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}constructor(e){this.oi=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength)&&(t_.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:n}),this.ai=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.li()}}var nV=e=>{var t=null==v?void 0:v.createElement("a");return U(t)?null:(t.href=e,t)},nU=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;r.length>i;i++){var s=r[i].split("=");if(s[0]===t){n=s;break}}if(!W(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch(e){t_.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},nz=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var d=l[c].split("=");W(d)&&(t.includes(d[0])?u.push(d[0]+"="+n):u.push(l[c]))}var f=a;return null!=o&&(f+="?"+u.join("&")),null!=i&&(f+="#"+i),f},nq=function(e,t){var n=e.match(RegExp(t+"=([^&]*)"));
1return n?n[1]:null},nG="https?://(.*)",nY=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],nX=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...nY],nK="<masked>",nJ=["li_fat_id"];function nZ(e,t,n){if(!v)return{};var r,i=t?[...nY,...n||[]]:[],s=nQ(nz(v.URL,i,nK),e);return nl((r={},na(nJ,function(e){var t=nR.Gt(e);r[e]=t||null}),r),s)}function nQ(e,t){var n=nX.concat(t||[]),r={};return na(n,function(t){var n=nU(e,t);r[t]=n||null}),r}function n0(e){var t=e?0===e.search(nG+"google.([^/?]*)")?"google":0===e.search(nG+"bing.com")?"bing":0===e.search(nG+"yahoo.com")?"yahoo":0===e.search(nG+"duckduckgo.com")?"duckduckgo":null:null,n={};if(!G(t)){n.$search_engine=t;var r=v?nU(v.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(n.ph_keyword=r)}return n}function n1(){return navigator.language||navigator.userLanguage}var n2="$direct";function n5(){return(null==v?void 0:v.referrer)||n2}function n3(e,t){var n=e?[...nY,...t||[]]:[],r=null==m?void 0:m.href.substring(0,1e3);return{r:n5().substring(0,1e3),u:r?nz(r,n,nK):void 0}}function n4(e){var t,{r:n,u:r}=e,i={$referrer:n,$referring_domain:null==n?void 0:n==n2?n2:null==(t=nV(n))?void 0:t.host};if(r){i.$current_url=r;var s=nV(r);i.$host=null==s?void 0:s.host,i.$pathname=null==s?void 0:s.pathname,nl(i,nQ(r))}return n&&nl(i,n0(n)),i}function n8(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var n6=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class n9{isDisabled(){return!!this.fi}vi(e){-1===n6.indexOf(e.persistence.toLowerCase())&&(t_.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,n,r=(void 0===(t=e.cookie_persisted_properties||[])&&(t=[]),n=[...nT,...t],T({},nC,{Wt(e){try{var t={};try{t=nR.Wt(e)||{}}catch(e){}var n=nl(t,JSON.parse(nC.Gt(e)||"{}"));return nC.Xt(e,n),n}catch(e){}return null},Xt(e,t,r,i,s,o){try{nC.Xt(e,t,void 0,void 0,o);var a={};n.forEach(e=>{t[e]&&(a[e]=t[e])}),Object.keys(a).length&&nR.Xt(e,a,r,i,s,o)}catch(e){nC.Yt(e)}},Jt(e,t){try{null==h||h.localStorage.removeItem(e),nR.Jt(e,t)}catch(e){nC.Yt(e)}}})),i=e.persistence.toLowerCase();return"localstorage"===i&&nC.Ut()?nC:"localstorage+cookie"===i&&r.Ut()?r:"sessionstorage"===i&&nA.Ut()?nA:"memory"===i?nI:"cookie"===i?nR:r.Ut()?r:nR}pi(e){var t=null!=e?e:this.Rt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[tG];return!n||"number"!=typeof n||Date.now()-n>t}properties(){var e={};return na(this.props,(t,n)=>{if(n===tj&&B(t)){if(!this.pi())for(var r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]]}else -1===t5.indexOf(n)&&(e[n]=t)}),e}load(){if(!this.fi){var e=this.ti.Wt(this.di);e&&(this.props=nl({},e))}}save(){this.fi||this.ti.Xt(this.di,this.props,this.gi,this.mi,this.yi,this.Rt.debug)}remove(){this.ti.Jt(this.di,!1),this.ti.Jt(this.di,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(B(e)){U(t)&&(t="None"),this.gi=U(n)?this.bi:n;var r=!1;if(na(e,(e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(B(e)){this.gi=U(t)?this.bi:t;var n=!1;if(na(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.ci){var e=nZ(this.Rt.custom_campaign_params,this.Rt.mask_personal_data_properties,this.Rt.custom_personal_data_properties);V(nf(e))||this.register(e),this.ci=!0}}update_search_keyword(){var e;this.register((e=null==v?void 0:v.referrer)?n0(e):{})}update_referrer_info(){var e;this.register_once({$referrer:n5(),$referring_domain:null!=v&&v.referrer&&(null==(e=nV(v.referrer))?void 0:e.host)||n2},void 0)}set_initial_person_info(){this.props[tJ]||this.props[tZ]||this.register_once({[tQ]:n3(this.Rt.mask_personal_data_properties,this.Rt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};na([tZ,tJ],t=>{var n=this.props[t];n&&na(n,function(t,n){e["$initial_"+L(n)]=t})});var t,n,r=this.props[tQ];return r&&nl(e,(t=n4(r),n={},na(t,function(e,t){n["$initial_"+L(t)]=e}),n)),e}
1safe_merge(e){return na(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t,n){if(this.bi=this.gi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var n=[...e].sort(),r=[...t].sort();return n.every((e,t)=>e===r[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var r=this.vi(e),i=this.props;this.clear(),this.ti=r,this.props=i,this.save()}}set_disabled(e){this.fi=e,this.fi?this.remove():this.save()}set_cross_subdomain(e){e!==this.mi&&(this.mi=e,this.remove(),this.save())}set_secure(e){e!==this.yi&&(this.yi=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[tR]||{};n[e]=t,this.props[tR]=n,this.save()}remove_event_timer(e){var t=(this.props[tR]||{})[e];return U(t)||(delete this.props[tR][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}constructor(e,t){this.Rt=e,this.props={},this.ci=!1,this.di=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.ti=this.vi(e),this.load(),e.debug&&t_.info("Persistence loaded",e.persistence,T({},this.props)),this.update_config(e,e,t),this.save()}}var n7={Activation:"events",Cancellation:"cancelEvents"},re={Popover:"popover",API:"api",Widget:"widget"},rt={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},rn={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},rr={Popover:"popover",Inline:"inline"},ri={SHOWN:"product tour shown"},rs={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},ro=ty("[RateLimiter]");class ra{get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,n,r,{captureEventsBurstLimit:i,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!=(t=null==(n=this.instance.persistence)?void 0:n.get_property(tK))?t:{tokens:i,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>i&&(a.tokens=i);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(tK,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{ro.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void ro.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}}var rl=ty("[RemoteConfig]");class ru{get remoteConfig(){var e;return null==(e=w._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}wi(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Ii(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return rl.info("Using preloaded remote config",this.remoteConfig),this.Ci(this.remoteConfig),void this.Si();if(this._instance.ki())return void rl.warn("Remote config is disabled. Falling back to local config.");this.wi(e=>{if(!e)return rl.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ii(e=>{this.Ci(e),this.Si()});this.Ci(e),this.Si()})}catch(e){rl.error("Error loading remote config",e)}}stop(){this.xi&&(clearInterval(this.xi),this.xi=void 0)}refresh(){this._instance.ki()||"hidden"===(null==v?void 0:v.visibilityState)||this._instance.reloadFeatureFlags()}Si(){var e;if(!this.xi){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.xi=setInterval(()=>{this.refresh()},t))}}Ci(e){var t;e||rl.error("Failed to fetch remote config from PostHog."),this._instance.Ci(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}constructor(e){this._instance=e}}var rc={GZipJS:"gzip-js",Base64:"base64"},rd=Uint8Array,rf=Uint16Array,rh=Uint32Array,rp=new rd([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]),rg=new rd([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]),rv=new rd([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rm=function(e,t){for(var n=new rf(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new rh(n[30]);for(r=1;30>r;++r)for(var s=n[r];n[r+1]>s;++s)i[s]=s-n[r]<<5|r;return[n,i]},r_=rm(rp,2),ry=r_[1];
vendor: 4,313 bytes, line 1
1r_[0][28]=258,ry[258]=28;for(var rb=rm(rg,0)[1],rx=new rf(32768),rE=0;32768>rE;++rE){var rw=(43690&rE)>>>1|(21845&rE)<<1;rx[rE]=((65280&(rw=(61680&(rw=(52428&rw)>>>2|(13107&rw)<<2))>>>4|(3855&rw)<<4))>>>8|(255&rw)<<8)>>>1}var rS=function(e,t,n){for(var r=e.length,i=0,s=new rf(t);r>i;++i)++s[e[i]-1];var o,a=new rf(t);for(i=0;t>i;++i)a[i]=a[i-1]+s[i-1]<<1;if(n){o=new rf(1<<t);var l=15-t;for(i=0;r>i;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],d=a[e[i]-1]++<<c,f=d|(1<<c)-1;f>=d;++d)o[rx[d]>>>l]=u}else for(o=new rf(r),i=0;r>i;++i)o[i]=rx[a[e[i]-1]++]>>>15-e[i];return o},rR=new rd(288);for(rE=0;144>rE;++rE)rR[rE]=8;for(rE=144;256>rE;++rE)rR[rE]=9;for(rE=256;280>rE;++rE)rR[rE]=7;for(rE=280;288>rE;++rE)rR[rE]=8;var rk=new rd(32);for(rE=0;32>rE;++rE)rk[rE]=5;var rC=rS(rR,9,0),rT=rS(rk,5,0),rO=function(e){return(e/8|0)+(7&e&&1)},rI=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof rf?rf:e instanceof rh?rh:rd)(n-t);return r.set(e.subarray(t,n)),r},rP=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},rA=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},rM=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new rd(0),0];if(1==i){var o=new rd(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[d].f>n[u].f?u++:d++],l=n[u!=c&&n[d].f>n[u].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=s[0].s;for(r=1;i>r;++r)s[r].s>f&&(f=s[r].s);var h=new rf(f+1),p=rN(n[c-1],h,0);if(p>t){r=0;var g=0,v=p-t,m=1<<v;for(s.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});i>r;++r){var _=s[r].s;if(t>=h[_])break;g+=m-(1<<p-h[_]),h[_]=t}for(g>>>=v;g>0;){var y=s[r].s;t>h[y]?g-=1<<t-h[y]++-1:++r}for(;r>=0&&g;--r){var b=s[r].s;h[b]==t&&(--h[b],++g)}p=t}return[new rd(h),p]},rN=function(e,t,n){return -1==e.s?Math.max(rN(e.l,t,n+1),rN(e.r,t,n+1)):t[e.s]=n},rF=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new rf(++t),r=0,i=e[0],s=1,o=function(e){n[r++]=e},a=1;t>=a;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},rL=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},rD=function(e,t,n){var r=n.length,i=rO(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;r>s;++s)e[i+s+4]=n[s];return 8*(i+4+r)},rj=function(e,t,n,r,i,s,o,a,l,u,c){rP(t,c++,n),++i[256];for(var d=rM(i,15),f=d[0],h=d[1],p=rM(s,15),g=p[0],v=p[1],m=rF(f),_=m[0],y=m[1],b=rF(g),x=b[0],E=b[1],w=new rf(19),S=0;_.length>S;++S)w[31&_[S]]++;for(S=0;x.length>S;++S)w[31&x[S]]++;for(var R=rM(w,7),k=R[0],C=R[1],T=19;T>4&&!k[rv[T-1]];--T);var O,I,P,A,M=u+5<<3,N=rL(i,rR)+rL(s,rk)+o,F=rL(i,f)+rL(s,g)+o+14+3*T+rL(w,k)+(2*w[16]+3*w[17]+7*w[18]);if(N>=M&&F>=M)return rD(t,c,e.subarray(l,l+u));if(rP(t,c,1+(N>F)),c+=2,N>F){O=rS(f,h,0),I=f,P=rS(g,v,0),A=g;var L=rS(k,C,0);for(rP(t,c,y-257),rP(t,c+5,E-1),rP(t,c+10,T-4),c+=14,S=0;T>S;++S)rP(t,c+3*S,k[rv[S]]);c+=3*T;for(var D=[_,x],j=0;2>j;++j){var $=D[j];for(S=0;$.length>S;++S)rP(t,c,L[W=31&$[S]]),c+=k[W],W>15&&(rP(t,c,$[S]>>>5&127),c+=$[S]>>>12)}}else O=rC,I=rR,P=rT,A=rk;for(S=0;a>S;++S)if(r[S]>255){rA(t,c,O[257+(W=r[S]>>>18&31)]),c+=I[W+257],W>7&&(rP(t,c,r[S]>>>23&31),c+=rp[W]);var W,H=31&r[S];rA(t,c,P[H]),c+=A[H],H>3&&(rA(t,c,r[S]>>>5&8191),c+=rg[H])}else rA(t,c,O[r[S]]),c+=I[r[S]];return rA(t,c,O[256]),c+I[256]},r$=new rh([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rW=function(){for(var e=new rh(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&0xedb88320)^n>>>1;e[t]=n}return e}(),rH=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},rB=!!y||!!_,rV="text/plain",rU=!1,rz=function(e,t,n){void 0===n&&(n=!0);var r,i,s,o,a,[l,u]=e.split("?"),c=T({},t),d=null!=(a=null==u?void 0:u.split("&").map(e=>{var t,[r,i]=e.split("="),s=n&&null!=(t=c[r])?t:i;return delete c[r],r+"="+s}))?a:[],f=(void 0===r&&(r="&"),o=[],na(c,function(e,t){U(e)||U(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),s=encodeURIComponent(t),o[o.length]=s+"="+i)}),o.join(r));return f&&d.push(f),l+"?"+d.join("&")},rq=(e,t)=>
1JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),rG=e=>{if(e.zt)return e.zt;var{data:t,compression:n}=e;if(t){if(n===rc.GZipJS){var r=function(e,t){void 0===t&&(t={});var n=(i=0xffffffff,{p(e){for(var t=i,n=0;e.length>n;++n)t=rW[255&t^e[n]]^t>>>8;i=t},d:()=>0xffffffff^i}),r=e.length;n.p(e);var i,s,o,a,l=(a=10+((s=t).filename&&s.filename.length+1||0),function(e,t,n,r,i,s){var o=e.length,a=new rd(r+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(r,a.length-8),u=0;if(!t||8>o)for(var c=0;o>=c;c+=65535){var d=c+65535;o>d?u=rD(l,u,e.subarray(c,d)):(l[c]=!0,u=rD(l,u,e.subarray(c,o)))}else{for(var f=r$[t-1],h=f>>>13,p=8191&f,g=(1<<n)-1,v=new rf(32768),m=new rf(g+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&g},x=new rh(25e3),E=new rf(288),w=new rf(32),S=0,R=0,k=(c=0,0),C=0,T=0;o>c;++c){var O=b(c),I=32767&c,P=m[O];if(v[I]=P,m[O]=I,c>=C){var A=o-c;if((S>7e3||k>24576)&&A>423){u=rj(e,l,0,x,E,w,R,k,T,c-T,u),k=S=R=0,T=c;for(var M=0;286>M;++M)E[M]=0;for(M=0;30>M;++M)w[M]=0}var N=2,F=0,L=p,D=I-P&32767;if(A>2&&O==b(c-D))for(var j=Math.min(h,A)-1,$=Math.min(32767,c),W=Math.min(258,A);$>=D&&--L&&I!=P;){if(e[c+N]==e[c+N-D]){for(var H=0;W>H&&e[c+H]==e[c+H-D];++H);if(H>N){if(N=H,F=D,H>j)break;var B=Math.min(D,H-2),V=0;for(M=0;B>M;++M){var U=c-D+M+32768&32767,z=U-v[U]+32768&32767;z>V&&(V=z,P=U)}}}D+=(I=P)-(P=v[I])+32768&32767}if(F){x[k++]=0x10000000|ry[N]<<18|rb[F];var q=31&ry[N],G=31&rb[F];R+=rp[q]+rg[G],++E[257+q],++w[G],C=c+N,++S}else x[k++]=e[c],++E[e[c]]}}u=rj(e,l,!0,x,E,w,R,k,T,c-T,u)}return rI(a,0,r+rO(u)+i)}(e,null==(o=t).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,a,8)),u=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&rH(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),rH(l,u-8,n.d()),rH(l,u-4,r),l}(function(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new rd(e.length+(e.length>>>1)),i=0,s=function(e){r[i++]=e},o=0;n>o;++o){if(i+5>r.length){var a=new rd(i+8+(n-o<<1));a.set(r),r=a}var l=e.charCodeAt(o);128>l?s(l):(2048>l?s(192|l>>>6):(l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63)):s(224|l>>>12),s(128|l>>>6&63)),s(128|63&l))}return rI(r,0,i)}(rq(t)),{mtime:0});return{contentType:rV,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===rc.Base64){var i=(e=>"data="+encodeURIComponent("string"==typeof e?e:rq(e)))(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):e}(rq(t)));return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=rq(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},rY=function(){var e=C(function*(e){var t=rq(e.data),n=yield function(e,t,n){return I.apply(this,arguments)}(t,R.DEBUG,{rethrow:!0});if(!n)return e;var r=yield n.arrayBuffer();return T({}
1,e,{zt:{contentType:rV,body:r,estimatedSize:r.byteLength}})});return function(t){return e.apply(this,arguments)}}(),rX=(e,t)=>rz(e,{_:(new Date).getTime().toString(),ver:R.JS_SDK_VERSION,compression:t}),rK=[];_&&rK.push({transport:"fetch",method(e){var t,n,{contentType:r,body:i,estimatedSize:s}=null!=(t=rG(e))?t:{},o=new Headers;na(e.headers,function(e,t){o.append(t,e)}),r&&o.append("Content-Type",r);var a=e.url,l=null;if(b){var u=new b;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),e.timeout)}}_(a,T({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&52428.8>(s||0),body:i,signal:null==(n=l)?void 0:n.signal},e.fetchOptions)).then(t=>t.text().then(n=>{var r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){t_.error(e)}null==e.callback||e.callback(r)})).catch(t=>{t_.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),y&&rK.push({transport:"XHR",method(e){var t,n=new y;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:i}=null!=(t=rG(e))?t:{};na(e.headers,function(e,t){n.setRequestHeader(t,e)}),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(4===n.readyState){var t={statusCode:n.status,text:n.responseText};if(200===n.status)try{t.json=JSON.parse(n.responseText)}catch(e){}null==e.callback||e.callback(t)}},n.send(i)}}),null!=g&&g.sendBeacon&&rK.push({transport:"sendBeacon",method(e){var t=rz(e.url,{beacon:"1"});try{var n,{contentType:r,body:i}=null!=(n=rG(e))?n:{};if(!i)return;var s=i instanceof Blob?i:new Blob([i],{type:r});g.sendBeacon(t,s)}catch(e){}}});class rJ{enqueue(e){this.Ai.push(e),this.Ni||this.Mi()}unload(){this.Fi();var e=Object.values(this.Ai.length>0?this.Oi():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Ri(T({},e,{transport:"sendBeacon"}))})}enable(){this.Ti=!1,this.Mi()}Mi(){var e=this;this.Ti||(this.Ni=setTimeout(()=>{if(this.Fi(),this.Ai.length>0){var t=this.Oi();for(var n in t)!function(){var r=t[n],i=(new Date).getTime();r.data&&W(r.data)&&na(r.data,e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp}),e.Ri(r)}()}},this.Ei))}Fi(){clearTimeout(this.Ni),this.Ni=void 0}Oi(){var e={};return na(this.Ai,t=>{var n,r=(t?t.batchKey:null)||t.url;U(e[r])&&(e[r]=T({},t,{data:[]})),null==(n=e[r].data)||n.push(t.data)}),this.Ai=[],e}constructor(e,t){this.Ti=!0,this.Ai=[],this.Ei=es((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,t_.createLogger("flush interval"),3e3),this.Ri=e}}var rZ=["retriesPerformedSoFar"];class rQ{get length(){return this.Ai.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=O(e,rZ);K(t)&&(n.url=rz(n.url,{retry_count:t})),this._instance._send_request(T({},n,{callback:e=>{200===e.statusCode||e.statusCode>=400&&500>e.statusCode||(null!=t?t:0)>=10?null==n.callback||n.callback(e):this.Zi(T({retriesPerformedSoFar:t},n))}}))}Zi(e){var t,n,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var i=Math.ceil((n=Math.min(18e5,t=3e3*Math.pow(2,r)))+(Math.random()-.5)*(n-t/2)),s=Date.now()+i;this.Ai.push({retryAt:s,requestOptions:e});var o="Enqueued failed request for retry in "+i;navigator.onLine||(o+=" (Browser is offline)"),t_.warn(o),this.Pi||(this.Pi=!0,this.$i())}$i(){if(this.Vi&&clearTimeout(this.Vi),0===this.Ai.length)return this.Pi=!1,void(this.Vi=void 0);this.Vi=setTimeout(()=>{this.Di&&this.Ai.length>0&&this.ji(),this.$i()},this.Li)}ji(){var e=Date.now(),t=[],n=this.Ai.filter(n=>e>n.retryAt||(t.push(n),!1));if(this.Ai=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Vi&&(clearTimeout(this.Vi),this.Vi=void 0),this.Pi=!1,U(h)||(this.Bi&&(h.removeEventListener("online",this.Bi),this.Bi=void 0),this.qi&&(h.removeEventListener("offline",this.qi),this.qi=void 0)),this.Ai))try{this._instance._send_request(T({},e,{transport:"sendBeacon"}))}catch(e){t_.error(e)}this.Ai=[]}constructor(e){this.Pi=!1,this.Li=3e3,this.Ai=[],this._instance=e,this.Ai=[],this.Di=!0,!U(h)&&"onLine"in h.navigator&&(this.Di=h.navigator.onLine,this.Bi=()=>{this.Di=!0,this.ji()},this.qi=()=>{this.Di=!1},np(h,"online",this.Bi),np(h,"offline",this.qi))}}class r0{get Ui(){return this._instance.config.scroll_root_selector}getContext(){return this.zi}resetContext(){var e=this.zi;return setTimeout(this.Hi,0),e}startMeasuringScrollPosition(){np(h,"scroll",this.Hi,{capture:!0}),np(h,"scrollend",this.Hi,{capture:!0}),np(h,"resize",this.Hi)}scrollElement(){if(!this.Ui)return null==h?void 0:h.document.documentElement;for(var e of W(this.Ui)?this.Ui:[this.Ui]){var t=null==h?void 0:h.document.querySelector(e);
1if(t)return t}}scrollY(){if(this.Ui){var e=this.scrollElement();return e&&e.scrollTop||0}return h&&(h.scrollY||h.pageYOffset||h.document.documentElement.scrollTop)||0}scrollX(){if(this.Ui){var e=this.scrollElement();return e&&e.scrollLeft||0}return h&&(h.scrollX||h.pageXOffset||h.document.documentElement.scrollLeft)||0}constructor(e){this.Hi=()=>{this.zi||(this.zi={});var e,t,n,r,i=this.scrollElement(),s=this.scrollY(),o=i?Math.max(0,i.scrollHeight-i.clientHeight):0,a=s+((null==i?void 0:i.clientHeight)||0),l=(null==i?void 0:i.scrollHeight)||0;this.zi.lastScrollY=Math.ceil(s),this.zi.maxScrollY=Math.max(s,null!=(e=this.zi.maxScrollY)?e:0),this.zi.maxScrollHeight=Math.max(o,null!=(t=this.zi.maxScrollHeight)?t:0),this.zi.lastContentY=a,this.zi.maxContentY=Math.max(a,null!=(n=this.zi.maxContentY)?n:0),this.zi.maxContentHeight=Math.max(l,null!=(r=this.zi.maxContentHeight)?r:0)},this._instance=e}}var r1=e=>n3(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class r2{Gi(){return this.Xi.props[tX]}getSetOnceProps(){var e,t=null==(e=this.Gi())?void 0:e.props;return t?"r"in t?n4(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return na(nf(this.getSetOnceProps()),(t,n)=>{"$current_url"===n&&(n="url"),e["$session_entry_"+L(n)]=t}),e}constructor(e,t,n,r){this.Yi=e=>{var t=this.Gi();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.Wi(this._instance)};this.Xi.register({[tX]:n})}},this._instance=e,this.Ji=t,this.Xi=n,this.Wi=r||r1,this.Ji.onSessionId(this.Yi)}}class r5{on(e,t){return this.Ki[e]||(this.Ki[e]=[]),this.Ki[e].push(t),()=>{this.Ki[e]=this.Ki[e].filter(e=>e!==t)}}emit(e,t){for(var n of this.Ki[e]||[])n(t);for(var r of this.Ki["*"]||[])r(e,t)}constructor(){this.Ki={}}}var r3=ty("[SessionId]");class r4{on(e,t){return this.Qi.on(e,t)}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return U(this.tr)&&(this.tr=[]),this.tr.push(e),this.nr&&e(this.nr,this.rr),()=>{this.tr=this.tr.filter(t=>t!==e)}}cr(){return"memory"!==this.Rt.persistence&&!this.Xi.fi&&nA.Ut()}pr(e){e!==this.rr&&(this.rr=e,this.cr()&&nA.Xt(this.ur,e))}gr(){return this.rr?this.rr:this.cr()?nA.Wt(this.ur):null}dr(e,t,n){e===this.nr&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.nr=e,this.Xi.register({[tL]:[t,e,n]}))}mr(){var e=this.Xi.props[tL];return W(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.dr(null,null,null)}destroy(){clearTimeout(this.yr),this.yr=void 0,this.er&&h&&(h.removeEventListener(nt,this.er,{capture:!1}),this.er=void 0),this.tr=[]}vr(){this.er=()=>{this.cr()&&nA.Jt(this.hr)},np(h,nt,this.er,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Rt.cookieless_mode===t8)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var n=t||(new Date).getTime(),[r,i,s]=this.mr(),o=this.gr(),a=K(s)&&Math.abs(n-s)>864e5,l=!1,u=!i,c=!u&&!e&&this.ir(n,r);u||c||a?(i=this.sr(),o=this.ar(),r3.info("new session ID generated",{sessionId:i,windowId:o,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}}),s=n,l=!0):o||(o=this.ar(),l=!0);var d=K(r)&&e&&!a?r:n,f=K(s)?s:(new Date).getTime();return this.pr(o),this.dr(i,d,f),e||this.lr(),l&&this.tr.forEach(e=>e(i,o,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0)),{sessionId:i,windowId:o,sessionStartTimestamp:f,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:r}}lr(){clearTimeout(this.yr),this.yr=setTimeout(()=>{var[e]=this.mr();if(this.ir((new Date).getTime(),e)){var t=this.nr;this.resetSessionId(),this.Qi.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}constructor(e,t,n){if(this.tr=[],this.er=void 0,this.Qi=new r5,this.ir=(e,t)=>!(!K(e)||!K(t))&&Math.abs(e-t)>
1this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===t8)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rt=e.config,this.Xi=e.persistence,this.rr=void 0,this.nr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.sr=t||nx,this.ar=n||nx;var r,i=this.Rt.persistence_name||this.Rt.token;if(this._sessionTimeoutMs=1e3*es(this.Rt.session_idle_timeout_seconds||1800,60,36e3,r3.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lr(),this.ur="ph_"+i+"_window_id",this.hr="ph_"+i+"_primary_window_exists",this.cr()){var s=nA.Wt(this.ur),o=nA.Wt(this.hr);s&&!o?this.rr=s:nA.Jt(this.ur),nA.Xt(this.hr,!0)}if(null!=(r=this.Rt.bootstrap)&&r.sessionID)try{var a=(e=>{var t=this.Rt.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.dr(this.Rt.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){r3.error("Invalid sessionID in bootstrap",e)}this.vr()}}var r8=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&M(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>M(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},r6=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function r9(e,t,n){return rq({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var r7={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>r6(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!r6(t,e))),icontains:(e,t)=>t.map(ie).some(t=>e.map(ie).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(ie).every(t=>e.map(ie).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var n=parseFloat(t);return!isNaN(n)&&e.some(e=>n>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var n=parseFloat(t);return!isNaN(n)&&e.some(e=>n<parseFloat(e))})},ie=e=>e.toLowerCase();function it(e,t){return!e||Object.entries(e).every(e=>{var[n,r]=e,i=null==t?void 0:t[n];if(U(i)||G(i))return!1;var s=[String(i)],o=r7[r.operator];return!!o&&o(r.values,s)})}var ir="custom",ii="i.posthog.com";class is{get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"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,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+ii,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.br[this.apiHost]||(this.br[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":ir),this.br[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===ir)return this.apiHost+t;var n=ii+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}constructor(e){this.br={},this.instance=e}}var io=ty("[Surveys]"),ia="seenSurvey_",il=e=>((e,t)=>{var n=""+ia+t.id;return t.current_iteration&&t.current_iteration>0&&(n=""+ia+t.id+"_"+t.current_iteration),n})(0,e),iu=[re.Popover,re.Widget,re.API],ic={ignoreConditions:!1,ignoreDelay:!1,displayType:rr.Popover},id=ty("[PostHog ExternalIntegrations]"),ih={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ip{ni(e,t){var n;null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,e,e=>{if(e)return id.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,n=function(e){var n,r,s;!i||null!=(n=w.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e]||t.ni(ih[e],()=>{var n;null==(n=w.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.start(t._instance)}),!i&&null!=(r=w.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]&&(null==(s=w.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[e])||s.stop())};for(var[r,i]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))n(r)}constructor(e){this._instance=e}}var ig,iv={},im=0,i_=()=>{}
1,iy='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ib="Surveys module not available",ix="sanitize_properties is deprecated. Use before_send instead",iE="Invalid value for property_denylist config: ",iw=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,iS="posthog",iR=!rB&&-1===(null==E?void 0:E.indexOf("MSIE"))&&-1===(null==E?void 0:E.indexOf("Mozilla")),ik=e=>{var t;return T({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!z(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of nh)if(n===r)return!1;return!0}(null==v?void 0:v.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:i_,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,debug:m&&z(null==m?void 0:m.search)&&-1!==m.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==h||null==(t=h.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){t_.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:t7,before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:i_,__preview_eager_load_replay:!1},(e=>({rageclick:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},iC=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],iT=e=>{var t={};for(var[n,r]of iC)U(e[n])||(t[r]=e[n]);var i=nl({},t,e);return W(e.property_blacklist)&&(U(e.property_denylist)?i.property_denylist=e.property_blacklist:W(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:t_.error(iE+e.property_denylist)),i};class iO{get wr(){return this.__forceAllowLocalhost}set wr(e){t_.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}constructor(){this.__forceAllowLocalhost=!1}}class iI{_r(e,t){if(e){var n=this.Ir.indexOf(e);-1!==n&&this.Ir.splice(n,1)}return this.Ir.push(t),null==t.initialize||t.initialize(),t}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}init(e,t,n){if(n&&n!==iS){var r,i=null!=(r=iv[n])?r:new iI;return i._init(e,t,n),iv[n]=i,iv[iS][n]=i,i}return this._init(e,t,n)}_init(e,t,n){if(void 0===t&&(t={}),U(e)||q(e))return t_.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Rr(t.debug),this.Nr=t,this.Mr=[],t.person_profiles?this.Ar=t.person_profiles:t.process_person&&(this.Ar=t.process_person),this.set_config(nl({},ik(t.defaults),iT(t),{name:n,token:e})),this.config.on_xhr_error&&t_.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:rc.GZipJS;var r,i,s,o,a=this.Fr();this.persistence=new n9(this.config,a),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new n9(T({},this.config,{persistence:"sessionStorage"}),a);var l=T({},this.persistence.props),u=T({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Or=new rJ(e=>this.Pr(e),this.config.request_queue_config),this.Lr=new rQ(this),this.__request_queue=[];var c=this.config.cookieless_mode===t8||this.config.cookieless_mode===t4&&this.consent.isExplicitlyOptedOut();c||(this.sessionManager=new r4(this),this.sessionPropsManager=new r2(this,this.sessionManager,this.persistence));var d=null==(r=w._POSTHOG_REMOTE_CONFIG)||null==(r=r[this.config.token])?void 0:r.config,f=null==d||null==(i=d.sdkVersion)?void 0:i.resolved;if(f&&(iw.test(f)?this._resolvedSdkVersion=f:t_.warn("Ignoring invalid preloaded sdkVersion.resolved from remote config: "+f)),this.config.__preview_deferred_init_extensions?(t_.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Dr(c)},0)):(t_.info("Initializing extensions synchronously"),this.Dr(c)),R.DEBUG=R.DEBUG||this.config.debug,R.DEBUG&&t_.info("Starting in debug mode",{this:this,config:t,thisC:T({},this.config),p:l,s:u}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=T({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
1)),void 0!==(null==(o=t.bootstrap)?void 0:o.distinctID)){var p=t.bootstrap.distinctID,g=this.get_distinct_id(),v=this.persistence.get_property(tY);if(t.bootstrap.isIdentifiedID&&null!=g&&g!==p&&v===t6)this.identify(p);else if(t.bootstrap.isIdentifiedID&&null!=g&&g!==p&&v===t9)t_.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 m=this.config.get_device_id(nx()),_=t.bootstrap.isIdentifiedID?m:p;this.persistence.set_property(tY,t.bootstrap.isIdentifiedID?t9:t6),this.register({distinct_id:p,$device_id:_})}}if(c)this.register_once({distinct_id:t2,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(nx());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(tY,t6)}return np(h,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||nx();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(tY,t9)),t()},i=n.user();"then"in i&&H(i.then)?i.then(r):r(i)}(e,()=>{var r;n.register((Promise&&Promise.resolve||nj.warn("This browser does not have Promise support, and can not use the segment integration"),r=(t,n)=>{if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(nj.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(nj.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>r(e,e.event.event),page:e=>r(e,nn),identify:e=>r(e,ni),screen:e=>r(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Br()):this.Br(),H(this.config._onCapture)&&this.config._onCapture!==i_&&(t_.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&t_.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}Dr(e){var t,n,r,i,s,o,a,l=performance.now(),u=T({},iI.__defaultExtensionClasses,this.config.__extensionClasses),c=[];u.featureFlags&&this.Ir.push(this.featureFlags=null!=(t=this.featureFlags)?t:new u.featureFlags(this)),u.exceptions&&this.Ir.push(this.exceptions=null!=(n=this.exceptions)?n:new u.exceptions(this)),u.historyAutocapture&&this.Ir.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Ir.push(new u.tracingHeaders(this)),u.siteApps&&this.Ir.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.Ir.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.Ir.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.Ir.push(this.surveys=null!=(r=this.surveys)?r:new u.surveys(this)),u.logs&&this.Ir.push(this.logs=null!=(i=this.logs)?i:new u.logs(this)),u.conversations&&this.Ir.push(this.conversations=null!=(s=this.conversations)?s:new u.conversations(this)),u.productTours&&this.Ir.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Ir.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Ir.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Ir.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Ir.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,nL)),u.toolbar&&this.Ir.push(this.toolbar=null!=(o=this.toolbar)?o:new u.toolbar(this)),u.experiments&&this.Ir.push(this.experiments=null!=(a=this.experiments)?a:new u.experiments(this)),this.Ir.forEach(e
1=>{e.initialize&&c.push(()=>{null==e.initialize||e.initialize()})}),c.push(()=>{if(this.jr){var e=this.jr;this.jr=void 0,this.Ci(e)}}),this.qr(c,l)}qr(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.qr(e,t)},0);var n=e.shift();if(n)try{n()}catch(e){t_.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&t_.info("PostHog extensions initialized ("+r+"ms)")}Ci(e){var t;if(!v||!v.body)return t_.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ci(e)},500);this.config.__preview_deferred_init_extensions&&(this.jr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=N(e.supportedCompression,rc.GZipJS)?rc.GZipJS:N(e.supportedCompression,rc.Base64)?rc.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Ar?this.Ar:t7}),this.Ir.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}Br(){try{this.config.loaded(this)}catch(e){t_.critical("`loaded` function failed",e)}if(this.Zr(),this.config.internal_or_test_user_hostname&&null!=m&&m.hostname){var e=m.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode===t8)&&this.$r()},1),this.Vr=new ru(this),this.Vr.load()}Zr(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Or)||e.enable())}_dom_loaded(){this.is_capturing()&&no(this.__request_queue,e=>this.Pr(e)),this.__request_queue=[],this.Zr()}_handle_unload(){var e,t,n,r;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this.Hr()&&this.capture(nr),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(n=this.Or)||n.unload(),null==(r=this.Lr)||r.unload()):this.Hr()&&this.capture(nr,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(iR?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=rz(e.url,{ip:+!!this.config.ip}),e.headers=T({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,n,r,i=T({},e);i.timeout=i.timeout||6e4,i.url=rX(i.url,i.compression);var s=null!=(t=i.transport)?t:"fetch",o=rK.filter(e=>!i.disableTransport||!e.transport||!i.disableTransport.includes(e.transport)),a=null!=(n=null==(r=function(e,t){for(var n=0;e.length>n;n++)if(e[n].transport===s)return e[n]}(o))?void 0:r.method)?n:o[0].method;if(!a)throw Error("No available transport method");"sendBeacon"!==s&&i.data&&i.compression===rc.GZipJS&&x&&!rU?rY(i).then(e=>{a(e)}).catch(t=>{if(!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))return rU=!0,void a(T({},i,{compression:void 0,url:rX(e.url,void 0)}));a(i)}):a(i)})(T({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(n=(r=this.config).on_request_error)||n.call(r,t),null==e.callback||e.callback(t)}}))))}Pr(e){this.Lr?this.Lr.retriableRequest(e):this._send_request(e)}_execute_array(e){im++;try{var t,n=[],r=[],i=[];no(e,e=>{e&&(W(t=e[0])?i.push(e):H(e)?e.call(this):W(e)&&"alias"===t?n.push(e):W(e)&&-1!==t.indexOf("capture")&&H(this[t])?i.push(e):r.push(e))});var s=function(e,t){no(e,function(e){if(W(e[0])){var n=t;na(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))})};s(n,this),s(r,this),s(i,this)}finally{im--}}push(e){if(im>0&&W(e)&&z(e[0])){var t=iI.prototype[e[0]];H(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,n){var r,i,s,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Or){if(this.is_capturing())if(!U(e)&&z(e)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!z(null==t?void 0:t.$current_url)&&(t_.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=n&&n.zr||t_.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 c=new Date,d=(null==n?void 0:n.timestamp)||c,f=nx(),h={uuid:f,event:e,properties:this.calculateEventProperties(e,t||{},d,f)};e===nn&&this.config.__preview_capture_bot_pageviews&&l&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),u&&(h.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),(null==n?void 0:n.$set)&&(h.$set=null==n?void 0:n.$set);var p,g=this.Ur(null==n?void 0:n.$set_once,e!==ns,e===ni);if(g&&(h.$set_once=g),null!=n&&n._noTruncate||(i=this.config.properties_string_max_length,s=h,o=e=>z(e)?e.slice(0,i):e,a=new Set,h=function e(t,n){var r;return t!==Object(t)?o?o(t):t:a.has(t)?void 0:(a.add(t),W(t)?(r=[],no(t,t=>{r.push(e(t))})):(r={},na(t,(t,n)=>{a.has(t)||(r[n]=e(t,n))})),r)}(s)),h.timestamp=d,U(null==n?void 0:n.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=c),e===rt.DISMISSED||e===rt.SENT){var v,m,_,y=null==t?void 0:t[rn.SURVEY_ID],b=null==t?void 0:t[rn.SURVEY_ITERATION];p={id:y,current_iteration:b},localStorage.getItem(il(p))||localStorage.setItem(il(p),"true"),h.$set=T({},h.$set,{[(v={id:y,current_iteration:b},_="$survey_"+(m=e===rt.SENT?"responded":"dismissed")+"/"+v.id,v.current_iteration&&v.current_iteration>0&&(_="$survey_"+m+"/"+v.id+"/"+v.current_iteration),_)]:!0})}else e===rt.SHOWN&&(h.$set=T({},h.$set,{[rn.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===ri.SHOWN){var x=null==t?void 0:t[rs.TOUR_TYPE];x&&(h.$set=T({},h.$set,{[rs.TOUR_LAST_SEEN_DATE+"/"+x]:(new Date).toISOString()}))}var E=T({},h.properties.$set,h.$set);if(V(E)||this.setPersonPropertiesForFlags(E),!Y(this.config.before_send)){var w=this.Yr(h);if(!w)return;h=w}this.Sr.emit("eventCaptured",h);var S={method:"POST",url:null!=(r=null==n?void 0:n._url)?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this.Pr(S):this.Or.enqueue(S),h}t_.critical("This capture call is ignored due to client rate limiting.")}}else t_.error("No event name provided to posthog.capture")}else t_.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,n,r,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var s,o=i?void 0:this.persistence.remove_event_timer(e),a=T({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode==t8||this.config.cookieless_mode==t4&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=T({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!z(a.distinct_id)&&!X(a.distinct_id)||q(a.distinct_id))&&t_.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=function(e,t){if(!E)return{};var n,r,i,s,o,a,l,u,c,d,f,p=e?[...nY,...t||[]]:[],[g,v]=function(e){for(var t=0;e2.length>t;t++){var[n,r]=e2[t],i=n.exec(e),s=i&&(H(r)?r(i,e):r);if(s)return s}return["",""]}(E);return nl(nf({$os:g,$os_version:v,$browser:eQ(E,navigator.vendor),$device:e5(E),$device_type:(a={userAgentDataPlatform:null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,maxTouchPoints:null==(r=navigator)?void 0:r.maxTouchPoints,screenWidth:null==h||null==(i=h.screen)?void 0:i.width,screenHeight:null==h||null==(s=h.screen)?void 0:s.height,devicePixelRatio:null==h?void 0:h.devicePixelRatio},(f=e5(E))===ep||f===eh||"Kobo"===f||"Kindle Fire"===f||f===eU?ef:f===eM||f===eF||f===eN||f===eH?"Console":f===ev?"Wearable":f?ec:"Android"===(null==a?void 0:a.userAgentDataPlatform)&&(null!=(l=null==a?void 0:a.maxTouchPoints)?l:0)>0?600>Math.min(null!=(u=null==a?void 0:a.screenWidth)?u:0,null!=(c=null==a?void 0:a.screenHeight)?c:0)/(null!=(d=null==a?void 0:a.devicePixelRatio)?d:1)?ec:ef:"Desktop"),$timezone:n8(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:nz(null==m?void 0:m.href,p,nK),$host:null==m?void 0:m.host,$pathname:null==m?void 0:m.pathname,$raw_user_agent:E.length>1e3?E.substring(0,997)+"...":E,$browser_version:e1(E,navigator.vendor),$browser_language:n1(),$browser_language_prefix:"string"==typeof(o=n1())?o.split("-")[0]:void 0,$screen_height:null==h?void 0:h.screen.height,$screen_width:null==h?void 0:h.screen.width,$viewport_height:null==h?void 0:h.innerHeight,$viewport_width:null==h?void 0:h.innerWidth,$lib:R.LIB_NAME,$lib_version:R.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime());a.$session_id=d,a.$window_id=f}this.sessionPropsManager&&nl(a,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&nl(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(s=this.Lr)?void 0:s.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===ir&&(a.$lib_custom_api_host=this.config.api_host),u=e!==nn||i?e!==nr||i?this.pageViewM
1anager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),a=nl(a,u),e===nn&&v&&(a.title=v.title),!U(o)){var p=n.getTime()-o;a.$duration=parseFloat((p/1e3).toFixed(3))}E&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=nl({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),W(this.config.property_denylist)?na(this.config.property_denylist,function(e){delete a[e]}):t_.error(iE+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(t_.error(ix),a=g(a,e));var _=this.Gr();return a.$process_person_profile=_,_&&!i&&this.Wr("_calculate_event_properties"),a}Ur(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=!1),!this.persistence||!this.Gr()||this.Cr&&!n)return e;var r,i=nl({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(t_.error(ix),i=s(i,"$set_once")),t&&(this.Cr=!0),V(i)?void 0:i}register(e,t){var n;null==(n=this.persistence)||n.register(e,t)}register_once(e,t,n){var r;null==(r=this.persistence)||r.register_once(e,t,n)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Xr(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){var n;return null==(n=this.featureFlags)?void 0:n.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,n){var r;null==(r=this.featureFlags)||r.updateFlags(e,t,n)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){var r;return void 0===t&&(t=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.Sr.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:ib}),()=>{})}onSessionId(e){var t,n;return null!=(t=null==(n=this.sessionManager)?void 0:n.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:ib})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:ib})}renderSurvey(e,t){var n;null==(n=this.surveys)||n.renderSurvey(e,t)}displaySurvey(e,t){var n;void 0===t&&(t=ic),null==(n=this.surveys)||n.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,n;return null!=(t=null==(n=this.surveys)?void 0:n.canRenderSurvey(e))?t:{visible:!1,disabledReason:ib}}canRenderSurveyAsync(e,t){var n,r;return void 0===t&&(t=!1),null!=(n=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(e,t))?n:Promise.resolve({visible:!1,disabledReason:ib})}Jr(e){return!e||q(e)?(t_.critical("Unique user id has not been set in posthog.identify"),!1):e===t2?(t_.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())||(t_.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,n){if(!this.__loaded||!this.persistence)return t_.uninitializedWarning("posthog.identify");if(X(e)&&(e=e.toString(),t_.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Jr(e)&&this.Wr("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tw)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(tS)&&(this.unregister(tS),this.register({distinct_id:e}));var i,s=(this.persistence.get_property(tY)||t6)===t6;e!==r&&s?(this.persistence.set_property(tY,t9),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture(ni,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Er=r9(e,t,n),null==(i=this.featureFlags)||i.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(tU))}}setPersonProperties(e,t){if((e||t)&&this.Wr("posthog.setPersonProperties")){var n=r9(this.get_distinct_id(),e,t);this.Er!==n?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Er=n):t_.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,n){if(e&&t){var r=this.getGroups(),i=r[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:T({},r,{[e]:t})}),i||n){var s={$group_type:e,$group_key:t};n&&(s.$group_set=n),this.capture(ns,s)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else t_.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var n;void 0===t&&(t=!0),null==(n=this.featureFlags)||n.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var n;void 0===t&&(t=!0),this.Wr("posthog.setGroupPropertiesForFlags")&&(null==(n=this.featureFlags)||n.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(t_.info("reset"),!this.__loaded)return t_.uninitializedWarning("posthog.reset");var t,n,r,i,s,o,a,l,u=this.get_property(tw);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(n=this.sessionPersistence)||n.clear(),null==(r=this.surveys)||r.reset(),null==(i=this.Vr)||i.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(tY,t6),null==(l=this.sessionManager)||l.resetSessionId(),this.Er=null,this.config.cookieless_mode===t8)this.register_once({distinct_id:t2,$device_id:null},"");else{var c=this.config.get_device_id(nx());this.register_once({distinct_id:c,$device_id:e?c:u},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(n=this.conversations)||n.Kr()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.Qr()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&n){var i,s=null!=(i=e.timestampLookBack)?i:10;if(!n)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-n)/1e3)-s,0)}return r}alias(e,t){return e===this.get_property(tE)?(t_.critical("Attempting to create alias for existing People user - aborting."),-2):this.Wr("posthog.alias")?(U(t)&&(t=this.get_distinct_id()),e!==t?(this.Xr(tS,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(t_.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=T({},this.config);if(B(e)){nl(this.config,iT(e));var n,r,i,s,o,a,l,u,c,d=this.Fr();null==(n=this.persistence)||n.update_config(this.config,t,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new n9(T({},this.config,{persistence:"sessionStorage"}),d);var f=this.Rr(this.config.debug);J(f)&&(this.config.debug=f),J(this.config.debug)&&(this.config.debug?(R.DEBUG=!0,nC.Ut()&&nC.Xt("ph_debug",!0),t_.info("set_config",{config:e,oldConfig:t,newConfig:T({},this.config)})):(R.DEBUG=!1,nC.Ut()&&nC.Jt("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(o=this.heatmaps)||o.startIfEnabled(),null==(a=this.exceptionObserver)||a.startIfEnabledOrStop(),null==(l=this.deadClicksAutocapture)||l.startIfEnabledOrStop(),null==(u=this.surveys)||u.loadIfEnabled(),this.tn(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){R.LIB_NAME=e,R.LIB_VERSION=t}startSessionRecording(e){var t,n,r,i,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(n=this.sessionRecording)||n.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(i=this.sessionRecording)||i.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var n=Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(T({},r,t))}}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!=(e=null==(t=this.logs)?void 0:t.logger)?e:iI.en}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,n;return null!=(t=null==(n=this.toolbar)?void 0:n.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:iS;return t!==iS&&(t=iS+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(tY))===t9||(null==(t=this.sessionPersistence)?void 0:t.get_property(tY))===t9}Gr(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===t7&&!this._isIdentified()&&V(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tS])&&(null==(t=this.persistence)||null==(t=t.props)||!t[t0]))}Hr(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Gr()||this.Wr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Wr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Wr(e){return"never"===this.config.person_profiles?(t_.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Xr(t0,!0),!0)}Fr(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==t4)}tn(){var e,t,n,r,i=this.Fr();return(null==(e=this.persistence)?void 0:e.fi)!==i&&(null==(n=this.persistence)||n.set_disabled(i)),(null==(t=this.sessionPersistence)?void 0:t.fi)!==i&&(null==(r=this.sessionPersistence)||r.set_disabled(i)),i}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==t8){if(this.config.cookieless_mode===t4&&this.consent.isExplicitlyOptedOut()){this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(s=this.pageViewM
1anager)||s.destroy(),this.sessionManager=new r4(this),this.pageViewManager=new nB(this),this.persistence&&(this.sessionPropsManager=new r2(this,this.sessionManager,this.persistence));var n,r,i,s,o,a,l,u=null!=(o=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)?o:null==(l=iI.__defaultExtensionClasses)?void 0:l.sessionRecording;u&&(this.sessionRecording=this._r(this.sessionRecording,new u(this)))}this.consent.optInOut(!0),this.tn(),this.Zr(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==t4&&(null==(n=this.surveys)||n.loadIfEnabled()),(U(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(r=null==e?void 0:e.captureEventName)?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.$r()}else t_.warn(iy)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode!==t8?(this.config.cookieless_mode===t4&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.tn(),this.config.cookieless_mode===t4&&(this.register({distinct_id:t2,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(n=this.sessionRecording)||n.stopRecording(),this.sessionRecording=void 0,this.$r())):t_.warn(iy)}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 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===t8||(this.config.cookieless_mode===t4?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.tn()}_is_bot(){return g?r8(g,this.config.custom_blocked_useragents):void 0}$r(){v&&("visible"===v.visibilityState?this.kr||(this.kr=!0,this.capture(nn,{title:v.title},{send_instantly:!0}),this.Tr&&(v.removeEventListener(ne,this.Tr),this.Tr=null)):this.Tr||(this.Tr=this.$r.bind(this),np(v,ne,this.Tr)))}debug(e){!1===e?(null==h||h.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==h||h.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}ki(){var e,t,n,r,i=this.Nr||{};return"advanced_disable_flags"in i?!!i.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(t_.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):(t="advanced_disable_decide",n=(e="advanced_disable_flags")in i&&!Y(i[e]),r=t in i&&!Y(i[t]),n?i[e]:!!r&&(t_&&t_.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),i[t]))}Yr(e){if(Y(this.config.before_send))return e;var t=W(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(Y(n=r(n))){var i="Event '"+e.event+"' was rejected in beforeSend function";return Z(e.event)?t_.warn(i+". This can cause unexpected behavior."):t_.info(i),null}n.properties&&!V(n.properties)||t_.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var e;return null==(e=this.pageViewManager.ai)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}Rr(e){var t=J(e)&&!e,n=nC.Ut()&&"true"===nC.Gt("ph_debug");return!t&&(!!n||e)}constructor(){this.webPerformance=new iO,this.Cr=!1,this.version=R.LIB_VERSION,this.Sr=new r5,this.Ir=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ik(),this.SentryIntegration=nH,this.sentryIntegration=e=>(function(e,t){var n=nW(e,t);return{name:n$,processEvent:e=>n(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.kr=!1,this.Tr=null,this.Ar=null,this.Er=null,this.scrollManager=new r0(this),this.pageViewM
1anager=new nB(this),this.rateLimiter=new ra(this),this.requestRouter=new is(this),this.consent=new nM(this),this.externalIntegrations=new ip(this);var e,t=null!=(e=iI.__defaultExtensionClasses)?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,n)=>{var r=z(e)?{[e]:t}:e;this.setPersonProperties(r),null==n||n({})},set_once:(e,t,n)=>{var r=z(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==n||n({})}},this.on("eventCaptured",e=>t_.info('send "'+(null==e?void 0:e.event)+'"',e))}}function iP(e){return e instanceof Element&&(e.id===t1||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function iA(e){return!!e&&1===e.nodeType}function iM(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function iN(e){return!!e&&3===e.nodeType}function iF(e){return!!e&&11===e.nodeType}function iL(e){return e?F(e).split(/\s+/):[]}function iD(e){var t=null==h?void 0:h.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function ij(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return iL(t)}function i$(e){return Y(e)?null:F(e).split(/(\s+)/).filter(e=>i5(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function iW(e){var t="";return iX(e)&&!iK(e)&&e.childNodes&&e.childNodes.length&&na(e.childNodes,function(e){var n;iN(e)&&e.textContent&&(t+=null!=(n=i$(e.textContent))?n:"")}),F(t)}function iH(e){var t;return U(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}iI.__defaultExtensionClasses={},iI.en={trace:ig=()=>{},debug:ig,info:ig,warn:ig,error:ig,fatal:ig},function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=nd(e.prototype[t[n]])}(iI,["identify"]);var iB=["a","button","form","input","select","textarea","label"];function iV(e,t){if(U(t))return!0;var n,r=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function iU(e){var t=e.parentNode;return!(!t||!iA(t))&&t}var iz=["next","previous","prev",">","<"],iq=[".ph-no-rageclick",".ph-no-capture"],iG=e=>!e||iM(e,"html")||!iA(e),iY=(e,t)=>{if(!h||iG(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!iM(i,"body");)if(iF(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=iU(i);if(!s)break;if(t||iB.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var o=h.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(n=!0)}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function iX(e){for(var t=e;t.parentNode&&!iM(t,"body");t=t.parentNode){var n=ij(t);if(N(n,"ph-sensitive")||N(n,"ph-no-capture"))return!1}if(N(ij(e),"ph-include"))return!0;var r=e.type||"";if(z(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!z(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function iK(e){return!!(iM(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||iM(e,"select")||iM(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var iJ="(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})",iZ=RegExp("^(?:"+iJ+")$"),iQ=new RegExp(iJ),i0="\\d{3}-?\\d{2}-?\\d{4}",i1=RegExp("^("+i0+")$"),i2=RegExp("("+i0+")");function i5(e,t){return void 0===t&&(t=!0),!(Y(e)||z(e)&&(e=F(e),(t?iZ:iQ).test((e||"").replace(/[- ]/g,""))||(t?i1:i2).test(e)))&&!0}function i3(e){var t=iW(e);return i5(t=(t+" "+function e(t){var n="";return t&&t.childNodes&&t.childNodes.length&&na(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=iW(t);n=(n+" "+i).trim(),t.childNodes&&t.childNodes.length&&(n=(n+" "+e(t)).trim())}catch(e){t_.error("[AutoCapture]",e)}}),n}(e)).trim())?t:""}function i4(e){return e.replace(/"|\\"/g,'\\"')}class i8{isRageClick(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}constructor(e){this.disabled=!1===e;var t=B(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}}var i6="$copy_autocapture",i9=ty("[AutoCapture]");function i7(e,t){return t.length>e?t.slice(0,e)+"...":t}var se=ty("[ExceptionAutocapture]");function st(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return H(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}var sn=ty("[TracingHeaders]"),sr=ty("[Web Vitals]"),si="disabled",ss="lazy_loading",so="awaiting_config",sa="missing_config";ty("[SessionRecording]"),ty("[SessionRecording]");var sl="[SessionRecording]",su=ty(sl),sc=ty("[Heatmaps]");function sd(e){return B(e)&&"clientX"in e&&"clientY"in e&&X(e.clientX)&&X(e.clientY)}var sf=ty("[Product Tours]"),sh="ph_product_tours",sp=["$set_once","$set"],sg=ty("[SiteApps]"),sv="Error while initializing PostHog app with config id ";function sm(e,t,n){if(Y(e))return!1;switch(n){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class s_{init(){var e,t;U(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,n;if(!U(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
vendor: 5,146 bytes, line 1
1=>{var t,n;null==(t=this.cn)||t.add(e),null==(n=e.steps)||n.forEach(e=>{var t;null==(t=this.hn)||t.add((null==e?void 0:e.event)||"")})}),null!=(n=this._instance)&&n.autocapture)){var r,i=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&i.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(i)}}on(e,t){var n;null!=t&&0!=e.length&&(this.hn.has(e)||this.hn.has(null==t?void 0:t.event))&&this.cn&&(null==(n=this.cn)?void 0:n.size)>0&&this.cn.forEach(e=>{this.dn(t,e)&&this.rn.emit("actionCaptured",e.name)})}vn(e){this.onAction("actionCaptured",t=>e(t))}dn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var n of t.steps)if(this.nn(e,n))return!0;return!1}onAction(e,t){return this.rn.on(e,t)}an(e,t){if(null!=t&&t.url){var n,r=null==e||null==(n=e.properties)?void 0:n.$current_url;if(!r||"string"!=typeof r||!sm(r,t.url,t.url_matching||"contains"))return!1}return!0}ln(e,t){return!!this.fn(e,t)&&!!this.pn(e,t)&&!!this.gn(e,t)}fn(e,t){if(null==t||!t.href)return!0;var n=this.mn(e);if(n.length>0)return n.some(e=>sm(e.href,t.href,t.href_matching||"exact"));var r,i,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&sm((i=s.match(/(?::|")href="(.*?)"/))?i[1]:"",t.href,t.href_matching||"exact")}pn(e,t){if(null==t||!t.text)return!0;var n=this.mn(e);if(n.length>0)return n.some(e=>sm(e.text,t.text,t.text_matching||"exact")||sm(e.$el_text,t.text,t.text_matching||"exact"));var r,i,s,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!Y(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(a),s=t.text,o=t.text_matching||"exact",i.some(e=>sm(e,s,o)))}gn(e,t){if(null==t||!t.selector)return!0;var n,r,i=null==e||null==(n=e.properties)?void 0:n.$element_selectors;if(null!=i&&i.includes(t.selector))return!0;var s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){}return!1}mn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}un(e,t){return null==t||!t.properties||0===t.properties.length||it(t.properties.reduce((e,t)=>{var n=W(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:n,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}constructor(e){this.rn=new r5,this.nn=(e,t)=>this.sn(e,t)&&this.an(e,t)&&this.ln(e,t)&&this.un(e,t),this.sn=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.hn=new Set,this.cn=new Set}}class sy{_n(e,t){return!!e&&it(e.propertyFilters,null==t?void 0:t.properties)}In(e,t){var n=new Map;return e.forEach(e=>{var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(t=>{if(null!=t&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}})}),n}Cn(e,t,n){var r=(n===n7.Activation?this.yn:this.bn).get(e),i=[];return this.Sn(e=>{i=e.filter(e=>null==r?void 0:r.includes(e.id))}),i.filter(r=>{var i,s=null==(i=r.conditions)||null==(i=i[n])||null==(i=i.values)?void 0:i.find(t=>t.name===e);return this._n(s,t)})}register(e){var t;U(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.kn(e),this.xn(e))}xn(e){var t=e.filter(e=>{var t,n;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)?void 0:n.length)>0});0!==t.length&&(null==this.Tn&&(this.Tn=new s_(this._instance),this.Tn.init(),this.Tn.vn(e=>{this.onAction(e)})),t.forEach(e=>{var t,n,r,i,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(n=e.conditions)&&null!=(n=n.actions)&&n.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(i=this.Tn)||i.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach(t=>{if(t&&t.name){var n=this.wn.get(t.name);n&&n.push(e.id),this.wn.set(t.name,n||[e.id])}}))}))}kn(e){var t,n=e.filter(e=>{var t,n;return(null==(t=e.conditions)?void 0:t.events)&&(null==(n=e.conditions)||null==(n=n.events)||null==(n=n.values)?void 0:n.length)>0}),r=e.filter(e=>{var t,n;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(n=e.conditions)||null==(n=n.cancelEvents)||null==(n=n.values)?void 0:n.length)>0});0===n.length&&0===r.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.yn=this.In(e,n7.Activation),this.bn=this.In(e,n7.Cancellation))}onEvent(e,t){var n,r=this.re(),i=this.An(),s=this.En(),o=(null==(n=this._instance)||null==(n=n.persistence)?void 0:n.props[i])||[];if(s===e&&t&&o.length>0){r.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var a,l,u=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(u){var c=o.indexOf(u);0>c||(o.splice(c,1),this.Rn(o))}}else{if(this.bn.has(e)){var d=this.Cn(e,t,n7.Cancellation);d.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map(e=>e.id)}
1),d.forEach(e=>{var t=o.indexOf(e.id);0>t||o.splice(t,1),this.Nn(e.id)}),this.Rn(o))}if(this.yn.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.yn.get(e)});var f=this.Cn(e,t,n7.Activation);this.Rn(o.concat(f.map(e=>e.id)||[]))}}}onAction(e){var t,n=this.An(),r=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[n])||[];this.wn.has(e)&&this.Rn(r.concat(this.wn.get(e)||[]))}Rn(e){var t,n=this.re(),r=this.An(),i=[...new Set(e)].filter(e=>!this.Mn(e));n.info("updating activated items",{activatedItems:i}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[r]:i})}getActivatedIds(){var e,t=this.An();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.yn}Fn(){return this.Tn}constructor(e){this._instance=e,this.yn=new Map,this.bn=new Map,this.wn=new Map}}class sb extends sy{An(){return"$surveys_activated"}En(){return rt.SHOWN}Sn(e){var t;null==(t=this._instance)||t.getSurveys(e)}Nn(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}re(){return io}Mn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}constructor(e){super(e)}}var sx="SDK is not enabled or survey functionality is not yet loaded",sE="Disabled. Not loading surveys.",sw=null!=h&&h.location?nq(h.location.hash,"__posthog")||nq(location.hash,"state"):null,sS="_postHogToolbarParams",sR=ty("[Toolbar]"),sk=ty("[FeatureFlags]"),sC=ty("[FeatureFlags]",{debugEnabled:!0}),sT="\" failed. Feature flags didn't load in time.",sO="$active_feature_flags",sI="$override_feature_flags",sP="$feature_flag_payloads",sA="$override_feature_flag_payloads",sM="$feature_flag_request_id",sN=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},sF=e=>{var t={};for(var[n,r]of nu(e||{}))r&&(t[n]=r);return t},sL=ty("[Error tracking]"),sD="Refusing to render web experiment since the viewer is a likely bot",sj={icontains:(e,t)=>!!h&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!h&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!h&&r6(t.href,e),not_regex:(e,t)=>!!h&&!r6(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class s${get Rt(){return this._instance.config}initialize(){}onFeatureFlags(e){if(this._is_bot())s$.On(sD);else if(!this.Rt.disable_web_experiments){if(Y(this.Pn))return this.Pn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();s$.On("applying feature flags",e),e.forEach(e=>{var t;if(this.Pn&&null!=(t=this.Pn)&&t.has(e)){var n,r=this._instance.getFeatureFlag(e),i=null==(n=this.Pn)?void 0:n.get(e);r&&null!=i&&i.variants[r]&&this.Ln(i.name,r,i.variants[r].transforms)}})}}previewWebExperiment(){var e=s$.getWindowLocation();if(null!=e&&e.search){var t=nU(null==e?void 0:e.search,"__experiment_id"),n=nU(null==e?void 0:e.search,"__experiment_variant");t&&n&&(s$.On("previewing web experiments "+t+" && "+n),this.getWebExperiments(e=>{this.Bn(parseInt(t),n,e)},!1,!0))}}loadIfEnabled(){this.Rt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.Rt.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Rt.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Bn(e,t,n){var r=n.filter(t=>t.id===e);r&&r.length>0&&(s$.On("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Ln(r[0].name,t,r[0].variants[t].transforms))}static Dn(e){return!Y(e.conditions)&&s$.jn(e)&&s$.qn(e)}static jn(e){if(Y(e.conditions)||Y(null==(t=e.conditions)?void 0:t.url))return!0;var t,n,r,i,s=s$.getWindowLocation();return!!s&&(null==(n=e.conditions)||!n.url||sj[null!=(r=null==(i=e.conditions)?void 0:i.urlMatchType)?r:"icontains"](e.conditions.url,s))}
1static getWindowLocation(){return null==h?void 0:h.location}static qn(e){if(Y(e.conditions)||Y(null==(n=e.conditions)?void 0:n.utm))return!0;var t=nZ();if(t.utm_source){var n,r,i,s,o,a,l,u,c,d=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(i=e.conditions)||null==(i=i.utm)?void 0:i.utm_campaign)==t.utm_campaign,f=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,h=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,p=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==t.utm_term;return d&&h&&p&&f}return!1}static On(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];t_.info("[WebExperiments] "+e,n)}Ln(e,t,n){this._is_bot()?s$.On(sD):"control"!==t?n.forEach(n=>{if(n.selector){s$.On("applying transform of variant "+t+" for experiment "+e+" ",n);var r,i=null==(r=document)?void 0:r.querySelectorAll(n.selector);null==i||i.forEach(e=>{n.html&&(e.innerHTML=n.html),n.css&&e.setAttribute("style",n.css)})}}):s$.On("Control variants leave the page unmodified.")}_is_bot(){return g&&this._instance?r8(g,this.Rt.custom_blocked_useragents):void 0}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{s$.On("retrieved web experiments from the server"),t.Pn=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Pn&&(s$.On("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(n=t.Pn)||n.set(e.feature_flag_key,e));var n,r=t._instance.getFeatureFlag(e.feature_flag_key);z(r)&&e.variants[r]&&t.Ln(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var i in e.variants){var s=e.variants[i];s$.Dn(s)&&t.Ln(e.name,i,s.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}}var sW=ty("[Conversations]"),sH="Conversations not available yet.",sB={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}},sV=sB.info;function sU(e){var t=[];for(var n in e){var r=e[n];G(r)||U(r)||t.push({key:n,value:function e(t){if(J(t))return{boolValue:t};if(X(t))return Number.isInteger(t)?{intValue:t}:{doubleValue:t};if("string"==typeof t)return{stringValue:t};if(W(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(r)})}return t}var sz={featureFlags:class{get Rt(){return this._instance.config}get Xi(){return this._instance.persistence}Wn(e){return this._instance.get_property(e)}Xn(){var e,t;return null!=(e=null==(t=this.Xi)?void 0:t.pi(this.Rt.feature_flag_cache_ttl_ms))&&e}Jn(){return!!this.Xn()&&(this.Gn||this.Vn||(this.Gn=!0,sk.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Kn(){var e,t=null!=(e=this.Rt.evaluation_contexts)?e:this.Rt.evaluation_environments;return!this.Rt.evaluation_environments||this.Rt.evaluation_contexts||this.Yn||(sk.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Yn=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||sk.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Qn(){return this.Kn().length>0}initialize(){var e,t,{config:n}=this._instance,r=null!=(e=null==(t=n.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(r).length){var i,s,o=null!=(i=null==(s=n.bootstrap)?void 0:s.featureFlagPayloads)?i:{},a=Object.keys(r).filter(e=>!!r[e]).reduce((e,t)=>(e[t]=r[t]||!1,e),{}),l=Object.keys(o).filter(e=>a[e]).reduce((e,t)=>(o[t]&&(e[t]=o[t]),e),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,n){var r=null!=n&&n.merge?this.getFlagVariants():{},i=null!=n&&n.merge?this.getFlagPayloads():{},s=T({},r,e),o=T({},i,t),a={};for(var[l,u]of Object.entries(s)){var c="string"==typeof u;
1a[l]={key:l,enabled:!!c||!!u,variant:c?u:void 0,reason:void 0,metadata:U(null==o?void 0:o[l])?void 0:{id:0,version:void 0,description:void 0,payload:o[l]}}}this.receivedFeatureFlags({flags:a})}get hasLoadedFlags(){return this.$n}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Wn(tW),t=this.Wn(sI),n=this.Wn(sA);if(!n&&!t)return e||{};var r=nl({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var s,o,a=r[i],l=null==t?void 0:t[i],u=U(l)?null!=(s=null==a?void 0:a.enabled)&&s:!!l,c=U(l)?a.variant:"string"==typeof l?l:void 0,d=null==n?void 0:n[i],f=T({},a,{enabled:u,variant:u?null!=c?c:null==a?void 0:a.variant:void 0});u!==(null==a?void 0:a.enabled)&&(f.original_enabled=null==a?void 0:a.enabled),c!==(null==a?void 0:a.variant)&&(f.original_variant=null==a?void 0:a.variant),d&&(f.metadata=T({},null==a?void 0:a.metadata,{payload:d,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),r[i]=f}return this.Zn||(sk.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Zn=!0),r}getFlagVariants(){var e=this.Wn(tj),t=this.Wn(sI);if(!t)return e||{};for(var n=nl({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Zn||(sk.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Zn=!0),n}getFlagPayloads(){var e=this.Wn(sP),t=this.Wn(sA);if(!t)return e||{};for(var n=nl({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Zn||(sk.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Zn=!0),n}reloadFeatureFlags(){this.Hn||this.Rt.advanced_disable_feature_flags||this.ts||(this._instance.Sr.emit("featureFlagsReloading",!0),this.ts=setTimeout(()=>{this.es()},5))}rs(){clearTimeout(this.ts),this.ts=void 0}ensureFlagsLoaded(){this.$n||this.Vn||this.ts||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Hn=e}es(e){var t;if(this.rs(),!this._instance.ki())if(this.Vn)this.zn=!0;else{var n=this.Rt.token,r=this.Wn(tw),i={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:T({},(null==(t=this.Xi)?void 0:t.get_initial_props())||{},this.Wn(tH)||{}),group_properties:this.Wn(tB),timezone:n8()};G(r)||U(r)||(i.$device_id=r),(null!=e&&e.disableFlags||this.Rt.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.Qn()&&(i.evaluation_contexts=this.Kn());var s=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Rt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Vn=!0,this._instance._send_request({method:"POST",url:s,data:i,compression:this.Rt.disable_compression?void 0:rc.Base64,timeout:this.Rt.feature_flag_request_timeout_ms,callback:e=>{var t,n,r,s=!0;if(200===e.statusCode&&(this.zn||(this.$anon_distinct_id=void 0),s=!1),this.Vn=!1,!i.disable_flags||this.zn){this.Un=!s;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var a,l=!(null==(n=e.json)||null==(n=n.quotaLimited)||!n.includes("feature_flags"));(l&&o.push("quota_limited"),null==(r=this.Xi)||r.register({[tq]:o}),l)?sk.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."):(i.disable_flags||this.receivedFeatureFlags(null!=(a=e.json)?a:{},s,{partialResponse:!!this.Rt.advanced_only_evaluate_survey_feature_flags}
1),this.zn&&(this.zn=!1,this.es()))}}})}}getFeatureFlag(e,t){var n;if(void 0===t&&(t={}),!t.fresh||this.Un)if(this.$n||this.getFlags()&&this.getFlags().length>0){if(!this.Jn()){var r=this.getFeatureFlagResult(e,t);return null!=(n=null==r?void 0:r.variant)?n:null==r?void 0:r.enabled}}else sk.warn('getFeatureFlag for key "'+e+sT)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.Un)if(this.$n||this.getFlags()&&this.getFlags().length>0){if(!this.Jn()){var n=this.getFlagVariants(),r=e in n,i=n[e],s=this.getFlagPayloads()[e],o=String(i),a=this.Wn(sM)||void 0,l=this.Wn(tG)||void 0,u=this.Wn(tU)||{};if(this.Rt.advanced_feature_flags_dedup_per_session){var c,d=this._instance.get_session_id(),f=this.Wn(tz);d&&d!==f&&(u={},null==(c=this.Xi)||c.register({[tU]:u,[tz]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){W(u[e])?u[e].push(o):u[e]=[o],null==(v=this.Xi)||v.register({[tU]:u});var h=this.getFeatureFlagDetails(e),p=[...null!=(m=this.Wn(tq))?m:[]];U(i)&&p.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(_=this.Rt.bootstrap)||null==(_=_.featureFlags)?void 0:_[e])||null,$feature_flag_bootstrapped_payload:(null==(y=this.Rt.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])||null,$used_bootstrap_value:!this.Un};U(null==h||null==(b=h.metadata)?void 0:b.version)||(g.$feature_flag_version=h.metadata.version);var v,m,_,y,b,x,E,w,S,R,k,C=null!=(x=null==h||null==(E=h.reason)?void 0:E.description)?x:null==h||null==(w=h.reason)?void 0:w.code;C&&(g.$feature_flag_reason=C),null!=h&&null!=(S=h.metadata)&&S.id&&(g.$feature_flag_id=h.metadata.id),U(null==h?void 0:h.original_variant)&&U(null==h?void 0:h.original_enabled)||(g.$feature_flag_original_response=U(h.original_variant)?h.original_enabled:h.original_variant),null!=h&&null!=(R=h.metadata)&&R.original_payload&&(g.$feature_flag_original_payload=null==h||null==(k=h.metadata)?void 0:k.original_payload),p.length&&(g.$feature_flag_error=p.join(",")),this._instance.capture("$feature_flag_called",g)}if(r){var T=s;if(!U(s))try{T=JSON.parse(s)}catch(e){}return{key:e,enabled:!!i,variant:"string"==typeof i?i:void 0,payload:T}}}}else sk.warn('getFeatureFlagResult for key "'+e+sT)}getRemoteConfigPayload(e,t){var n=this.Rt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.Qn()&&(r.evaluation_contexts=this.Kn()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Rt.disable_compression?void 0:rc.Base64,timeout:this.Rt.feature_flag_request_timeout_ms,callback(n){var r,i=null==(r=n.json)?void 0:r.featureFlagPayloads;t((null==i?void 0:i[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.Un){if(this.$n||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return U(n)?void 0:!!n}sk.warn('isFeatureEnabled for key "'+e+sT)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,n){if(this.Xi){this.$n=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(e,t,n,r,i,s){void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={});var o,a=((o=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(o).map(e=>{var t;return[e,null!=(t=o[e].variant)?t:o[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(o).filter(e=>o[e].enabled).filter(e=>{var t;return null==(t=o[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=o[e].metadata)?void 0:t.payload]}))):sk.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=a.flags,u=a.featureFlags,c=a.featureFlagPayloads;if(u){var d=e.requestId,f=e.evaluatedAt;if(W(u)){sk.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(u)for(var p=0;u.length>p;p++)h[u[p]]=!0;t&&t.register({[sO]:u,[tj]:h})}else{var g=u,v=c,m=l;if(null!=s&&s.partialResponse)g=T({},n,g),v=T({},r,v),m=T({},i,m);else if(e.errorsWhileComputingFlags)if(l){var _=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));g=T({},n,Object.fromEntries(Object.entries(g).filter(e=>{var[t]=e;return _.has(t)}))),v=T({},r,Object.fromEntries(Object.entries(v||{}).filter(e=>{var[t]=e;return _.has(t)}))),m=T({},i,Object.fromEntries(Object.entries(m||{}).filter(e=>{var[t]=e;return _.has(t)})))}else g=T({},n,g),v=T({},r,v),m=T({},i,m);t&&t.register(T({[sO]:Object.keys(sF(g)),[tj]:g||{},[sP]:v||{},[tW]:m||{}},d?{[sM]:d}:{},f?{[tG]:f}:{}))}}}(e,this.Xi,r,i,s,n),t||(this.Gn=!1),this.ns(t)}}override(e,t){void 0===t&&(t=!1),sk.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.Xi)return sk.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.Xi.unregister(sI),this.Xi.unregister(sA),this.ns(),sC.info("All overrides cleared");if(W(e)){var t,n=sN(e);return this.Xi.register({[sI]:n}),this.ns(),sC.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.Zn=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this.Xi.unregister(sI),sC.info("Flag overrides cleared");else if(e.flags){if(W(e.flags)){var r=sN(e.flags);this.Xi.register({[sI]:r})}else this.Xi.register({[sI]:e.flags});sC.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.Xi.unregister(sA),sC.info("Payload overrides cleared")):e.payloads&&(this.Xi.register({[sA]:e.payloads}),sC.info("Payload overrides set",{payloads:e.payloads}))),void this.ns()}if(e&&"object"==typeof e)return this.Xi.register({[sI]:e}),this.ns(),sC.info("Flag overrides set",{flags:e});sk.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.$n){var{flags:t,flagVariants:n}=this.ss();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.Wn(t$)||[]).find(t=>t.flagKey===e),s={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:s};i&&(o.$early_access_feature_name=i.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(s,!1);var a=T({},this.getFlagVariants(),{[e]:t});
1null==(r=this.Xi)||r.register({[sO]:Object.keys(sF(a)),[tj]:a}),this.ns()}getEarlyAccessFeatures(e,t,n){void 0===t&&(t=!1);var r=this.Wn(t$),i=n?"&"+n.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Rt.token+i),method:"GET",callback:t=>{var n,r;if(t.json){var i=t.json.earlyAccessFeatures;return null==(n=this.Xi)||n.unregister(t$),null==(r=this.Xi)||r.register({[t$]:i}),e(i)}}})}ss(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,n)=>(e[n]=t[n],e),{})}}ns(e){var{flags:t,flagVariants:n}=this.ss();this.featureFlagEventHandlers.forEach(r=>r(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var n=this.Wn(tH)||{},r=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),i=null==e?void 0:e.$set_once,s={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(s[o]=i[o]));this._instance.register({[tH]:T({},n,s,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(tH)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var n=this.Wn(tB)||{};0!==Object.keys(n).length&&Object.keys(n).forEach(t=>{n[t]=T({},n[t],e[t]),delete e[t]}),this._instance.register({[tB]:T({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Wn(tB)||{};this._instance.register({[tB]:T({},t,{[e]:{}})})}else this._instance.unregister(tB)}reset(){this.$n=!1,this.Vn=!1,this.Hn=!1,this.zn=!1,this.Un=!1,this.$anon_distinct_id=void 0,this.rs(),this.Zn=!1}constructor(e){this.Zn=!1,this.$n=!1,this.Vn=!1,this.Hn=!1,this.zn=!1,this.Un=!1,this.Yn=!1,this.Gn=!1,this._instance=e,this.featureFlagEventHandlers=[]}}},sq=T({productTours:class{get Xi(){return this._instance.persistence}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.Xi&&this.Xi.register({[tM]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.co||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(tM)||this.ni(()=>this.vo())}ni(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.generateProductTours?e():null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"product-tours",t=>{t?sf.error("Could not load product tours script",t):e()})}vo(){var e;!this.co&&null!=(e=w.__PosthogExtensions__)&&e.generateProductTours&&(this.co=w.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!W(this.do)||t){var n=this.Xi;if(n){var r=n.props[sh];if(W(r)&&!t)return this.do=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{var r=t.statusCode;if(200!==r||!t.json){var i="Product Tours API could not be loaded, status: "+r;return sf.error(i),void e([],{isLoaded:!1,error:i})}var s=W(t.json.product_tours)?t.json.product_tours:[];this.do=s,n&&n.register({[sh]:s}),e(s,{isLoaded:!0})}})}else e(this.do,{isLoaded:!0})}getActiveProductTours(e){Y(this.co)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.co.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.co)||t.showTourById(e)}previewTour(e){this.co?this.co.previewTour(e):this.ni(()=>{var t;this.vo(),null==(t=this.co)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.co)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.co)||e.nextStep()}previousStep(){var e;null==(e=this.co)||e.previousStep()}clearCache(){var e;this.do=null,null==(e=this.Xi)||e.unregister(sh)}resetTour(e){var t;null==(t=this.co)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.co)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.co)||t.cancelPendingTour(e)}constructor(e){this.co=null,this.do=null,this._instance=e}}},sz),sG=T({surveys:class{get Rt(){return this._instance.config}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Rt.disable_surveys){var t=e.surveys;if(Y(t))return io.warn("Flags not loaded yet. Not loading surveys.");var n=W(t);this.Io=n?t.length>0:t,io.info("flags response received, isSurveysEnabled: "+this.Io),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(null!=n&&n.startsWith(ia)||null!=n&&n.startsWith("inProgressSurvey_"))&&e.push(n)}
1e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.Co)io.info("Already initializing surveys, skipping...");else if(this.Rt.disable_surveys)io.info(sE);else if(this.Rt.cookieless_mode&&this._instance.consent.isOptedOut())io.info("Not loading surveys in cookieless mode without consent.");else{var e=null==w?void 0:w.__PosthogExtensions__;if(e){if(!U(this.Io)||this.Rt.advanced_enable_surveys){var t=this.Io||this.Rt.advanced_enable_surveys;this.Co=!0;try{var n=e.generateSurveys;if(n)return void this.xo(n,t);var r=e.loadExternalDependency;if(!r)return void this.To(t3);r(this._instance,"surveys",n=>{n||!e.generateSurveys?this.To("Could not load surveys script",n):this.xo(e.generateSurveys,t)})}catch(e){throw this.To("Error initializing surveys",e),e}finally{this.Co=!1}}}else io.error("PostHog Extensions not found.")}}xo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new sb(this._instance),io.info("Surveys loaded successfully"),this.Ao({isLoaded:!0})}To(e,t){io.error(e,t),this.Ao({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.So.push(e),this._surveyManager&&this.Ao({isLoaded:!0}),()=>{this.So=this.So.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Rt.disable_surveys)return io.info(sE),e([]);var n,r=this._instance.get_property(tV);if(r&&!t)return e(r,{isLoaded:!0});"undefined"!=typeof Promise&&this.ko?this.ko.then(t=>{var{surveys:n,context:r}=t;return e(n,r)}):("undefined"!=typeof Promise&&(this.ko=new Promise(e=>{n=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Rt.token),method:"GET",timeout:this.Rt.surveys_request_timeout_ms,callback:t=>{this.ko=null;var r=t.statusCode;if(200!==r||!t.json){var i="Surveys API could not be loaded, status: "+r;io.error(i);var s={isLoaded:!1,error:i};return e([],s),void(null==n||n({surveys:[],context:s}))}var o,a,l=t.json.surveys||[],u=l.filter(e=>{var t,n;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||!n.length))});u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(o=this._instance.persistence)||o.register({[tV]:l});var c={isLoaded:!0};e(l,c),null==n||n({surveys:l,context:c})}}))}Ao(e){for(var t of this.So)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){io.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Y(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);io.warn("init was not called")}Eo(e){var t=null;return this.getSurveys(n=>{var r;t=null!=(r=n.find(t=>t.id===e))?r:null}),t}Ro(e){if(Y(this._surveyManager))return{eligible:!1,reason:sx};var t="string"==typeof e?this.Eo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Y(this._surveyManager))return io.warn("init was not called"),{visible:!1,disabledReason:sx};var t=this.Ro(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Y(this._surveyManager)?(io.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:sx})):new Promise(n=>{this.getSurveys(t=>{var r,i=null!=(r=t.find(t=>t.id===e))?r:null;if(i){var s=this.Ro(i);n({visible:s.eligible,disabledReason:s.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,n){var r;if(Y(this._surveyManager))io.warn("init was not called");else{var i="string"==typeof e?this.Eo(e):e;if(null!=i&&i.id)if(iu.includes(i.type)){var s=null==v?void 0:v.querySelector(t);if(s)return null!=(r=i.appearance)&&r.surveyPopupDelaySeconds?(io.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;io.info("Rendering survey "+i.id+" with delay of "+(null==(e=i.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(i,s,n),io.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,s,n);io.warn("Survey element not found")}else io.warn("Surveys of type "+i.type+" cannot be rendered in the app");else io.warn("Survey not found")}}displaySurvey(e,t){var n;if(Y(this._surveyManager))io.warn("init was not called");else{var r=this.Eo(e);if(r){var i=r;if(null!=(n=r.appearance)&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=T({},r,{appearance:T({},r.appearance,{surveyPopupDelaySeconds:0})}
1)),t.displayType!==rr.Popover&&t.initialResponses&&io.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var s=this.canRenderSurvey(r);if(!s.visible)return void io.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==rr.Inline?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}else io.warn("Survey not found")}}cancelPendingSurvey(e){Y(this._surveyManager)?io.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}constructor(e){this.Io=void 0,this._surveyManager=null,this.Co=!1,this.So=[],this.ko=null,this._instance=e,this._surveyEventReceiver=null}}},sz),sY=T({experiments:s$},sz),sX=T({},sz,{sessionRecording:class{get Rt(){return this._instance.config}get Xi(){return this._instance.persistence}get started(){var e;return!(null==(e=this.os)||!e.isStarted)}get status(){var e,t;return this.ls===so||this.ls===sa?this.ls:null!=(e=null==(t=this.os)?void 0:t.status)?e:this.ls}initialize(){this.startIfEnabledOrStop()}get hs(){var e,t=!(null==(e=this._instance.get_property(tF))||!e.enabled),n=!this.Rt.disable_session_recording,r=this.Rt.disable_session_recording||this._instance.consent.isOptedOut();return h&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.hs||null==(t=this.os)||!t.isStarted){var n=!U(Object.assign)&&!U(Array.from);this.hs&&n?(this.cs(e),su.info("starting")):(this.ls=si,this.stopRecording())}}cs(e){var t,n,r;this.hs&&(this.ls!==so&&this.ls!==sa&&(this.ls=ss),null!=w&&null!=(t=w.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(n=w.__PosthogExtensions__)&&n.initSessionRecording?this.ds(e):null==(r=w.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.vs,t=>{if(t)return su.error("could not load recorder",t);this.ds(e)}))}stopRecording(){var e,t;null==(e=this.us)||e.call(this),this.us=void 0,null==(t=this.os)||t.stop()}fs(){var e,t;null==(e=this.us)||e.call(this),this.us=void 0,null==(t=this.os)||t.discard()}ps(){var e;null==(e=this.Xi)||e.unregister(tD)}gs(e,t){if(Y(e))return null;var n=X(e)?e:parseFloat(e);return"number"!=typeof n||!Number.isFinite(n)||0>n||n>1?(su.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):n}ys(e){if(this.Xi){var t,n,r=this.Xi,i=()=>{var t,n=!1===e.sessionRecording?void 0:e.sessionRecording,i=this.gs(null==(t=this.Rt.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),s=this.gs(null==n?void 0:n.sampleRate,"remote config sampleRate"),o=null!=i?i:s;Y(o)&&this.ps();var a=null==n?void 0:n.minimumDurationMilliseconds;r.register({[tF]:T({cache_timestamp:Date.now(),enabled:!!n},n,{networkPayloadCapture:T({capturePerformance:e.capturePerformance},null==n?void 0:n.networkPayloadCapture),canvasRecording:{enabled:null==n?void 0:n.recordCanvas,fps:null==n?void 0:n.canvasFps,quality:null==n?void 0:n.canvasQuality},sampleRate:o,minimumDurationMilliseconds:U(a)?null:a,endpoint:null==n?void 0:n.endpoint,triggerMatchType:null==n?void 0:n.triggerMatchType,masking:null==n?void 0:n.masking,urlTriggers:null==n?void 0:n.urlTriggers,version:null==n?void 0:n.version,triggerGroups:null==n?void 0:n.triggerGroups})})};i(),null==(t=this.us)||t.call(this),this.us=null==(n=this._instance.sessionManager)?void 0:n.onSessionId(i)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.ys(e),void this.fs()):(this.ys(e),void this.startIfEnabledOrStop()):(this.ls===so&&(this.ls=sa,su.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;void 0===t&&(t="log"),null!=(n=this.os)&&n.log?this.os.log(e,t):su.warn("log called before recorder was ready")}get vs(){var e,t,n=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(tF);return(null==n||null==(t=n.scriptConfig)?void 0:t.script)||"lazy-recorder"}bs(){var e,t=this._instance.get_property(tF);if(!t)return!1;var n=null!=(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)?e:Date.now();return 36e5>=Date.now()-n}ds(e){var t,n;if(null==(t=w.__PosthogExtensions__)||!t.initSessionRecording)return su.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0});if(this.os||(this.os=null==(n=w.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance),this.os._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.bs()){if(this.ls===sa||this.ls===so)return;return this.ls=so,su.info("persisted remote config is stale, requesting fresh config before starting"),void new ru(this._instance).load()}this.ls=ss,this.os.start(e)}onRRwebEmit(e){var t;null==(t=this.os)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.os||null==(t=this.Xi)||t.register({$replay_override_linked_flag:!0}),null==(e=this.os)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.os||null==(t=this.Xi)||t.register({$replay_override_sampling:!0}),null==(e=this.os)||e.overrideSampling()}overrideTrigger(e){var t,n;this.os||null==(n=this.Xi)||n.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}
1),null==(t=this.os)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.os)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!(null==(n=this.os)||!n.tryAddCustomEvent(e,t))}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ls=si,this.us=void 0,this._instance=e,!this._instance.sessionManager)throw su.error("started without valid sessionManager"),Error(sl+" started without valid sessionManager. This is a bug.");if(this.Rt.cookieless_mode===t8)throw Error(sl+' cannot be used with cookieless_mode="always"')}}},{autocapture:class{initialize(){this.startIfEnabled()}get Rt(){var e,t,n=B(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null==(e=n.url_allowlist)?void 0:e.map(e=>new RegExp(e)),n.url_ignorelist=null==(t=n.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),n}Ss(){if(this.isBrowserSupported()){if(h&&v){var e=e=>{e=e||(null==h?void 0:h.event);try{this.ks(e)}catch(e){i9.error("Failed to capture event",e)}};if(np(v,"submit",e,{capture:!0}),np(v,"change",e,{capture:!0}),np(v,"click",e,{capture:!0}),this.Rt.capture_copied_text){var t=e=>{this.ks(e=e||(null==h?void 0:h.event),i6)};np(v,"copy",t,{capture:!0}),np(v,"cut",t,{capture:!0})}}}else i9.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ws&&(this.Ss(),this.ws=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Is=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tk]:!!e.autocapture_opt_out}),this._s=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Cs=e}getElementSelectors(e){var t,n=[];return null==(t=this.Cs)||t.forEach(t=>{var r=null==v?void 0:v.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&n.push(t)})}),n}get isEnabled(){var e,t,n=null==(e=this.instance.persistence)?void 0:e.props[tk];if(G(this._s)&&!J(n)&&!this.instance.ki())return!1;var r=null!=(t=this._s)?t:!!n;return!!this.instance.config.autocapture&&!r}ks(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var n,r=iH(e);iN(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&function(e,t){if(!h||iG(e)||(J(t)?(n=!!t&&iq,r=void 0):(n=null!=(i=null==t?void 0:t.css_selector_ignorelist)?i:iq,r=null==t?void 0:t.content_ignorelist),!1===n))return!1;var n,r,i,{targetElementList:s}=iY(e,!1);return!function(e,t){var n;if(!1===e||U(e))return!1;if(!0===e)n=iz;else{if(!W(e))return!1;if(e.length>10)return t_.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;n=e.map(e=>e.toLowerCase())}return t.some(e=>{var{safeText:t,ariaLabel:r}=e;return n.some(e=>t.includes(e)||r.includes(e))})}(r,s.map(e=>{var t;return{safeText:iW(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!iV(s,n)}(r,this.instance.config.rageclick)&&this.ks(e,"$rageclick");var i=t===i6;if(r&&function(e,t,n,r,i){if(void 0===n&&(n=void 0),!h||iG(e)||null!=(s=n)&&s.url_allowlist&&!iD(n.url_allowlist)||null!=(o=n)&&o.url_ignorelist&&iD(n.url_ignorelist))return!1;if(null!=(a=n)&&a.dom_event_allowlist){var s,o,a,l,u=n.dom_event_allowlist;if(u&&!u.some(e=>t.type===e))return!1}var{parentIsUsefulElement:c,targetElementList:d}=iY(e,r);if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(U(n))return!0;var r,i=function(e){if(n.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var s of e)if(r=i(s))return r.v;return!1}(d,n)||!iV(d,null==(l=n)?void 0:l.css_selector_allowlist))return!1;var f=h.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return c?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(iB.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.Rt,i,i?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=function(e,t){for(var n,r,{e:i,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsC
1hainAsString:l}=t,u=[e],c=e;c.parentNode&&!iM(c,"body");)iF(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,f=[],p={},g=!1,v=!1;if(na(u,e=>{var t=iX(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&i5(g)&&g),N(ij(e),"ph-no-capture")&&(v=!0),f.push(function(e,t,n,r){var i=e.tagName.toLowerCase(),s={tag_name:i};iB.indexOf(i)>-1&&!n&&(s.$el_text="a"===i.toLowerCase()||"button"===i.toLowerCase()?i7(1024,i3(e)):i7(1024,iW(e)));var o=ij(e);o.length>0&&(s.classes=o.filter(function(e){return""!==e})),na(e.attributes,function(n){var i;if((!iK(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==r||!r.includes(n.name))&&!t&&i5(n.value)&&(!z(i=n.name)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7))){var o=n.value;"class"===n.name&&(o=iL(o).join(" ")),s["attr__"+n.name]=i7(1024,o)}});for(var a=1,l=1,u=e;u=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!iA(t))return t}(u);)a++,u.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}(e,s,o,a)),nl(p,function(e){if(!iX(e))return{};var t={};return na(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&i5(r)&&(t[n]=r)}}),t}(e))}),v)return{props:{},explicitNoCapture:v};if(o||(f[0].$el_text="a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?i3(e):iW(e)),g){f[0].attr__href=g;var m,_,y=null==(m=nV(g))?void 0:m.host,b=null==h||null==(_=h.location)?void 0:_.host;y&&b&&y!==b&&(d=g)}return{props:nl({$event_type:i.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:f.map(e=>{var t,n,r,i={text:null==(n=e.$el_text)?void 0:n.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:(t=e.attr__class)?W(t)?t:iL(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return nu(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,n]=e;return i.attributes[t]=n}),i}).map(e=>{var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var i of(e.attr_class.sort(),e.attr_class))r+="."+i.replace(/"/g,"");var s=T({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(n=e.nth_of_type)?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return nu(s).sort((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)}).forEach(e=>{var[t,n]=e;return o[i4(t.toString())]=i4(n.toString())}),(r+=":")+nu(o).map(e=>{var[t,n]=e;return t+'="'+n+'"'}).join("")}).join(";")},null!=(n=f[0])&&n.$el_text?{$el_text:null==(r=f[0])?void 0:r.$el_text}:{},d&&"click"===i.type?{$external_click_url:d}:{},p)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rt.element_attribute_ignorelist,elementsChainAsString:this.Is});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(s.$element_selectors=a),t===i6){var l,u=i$(null==h||null==(l=h.getSelection())?void 0:l.toString()),c=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=c}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return H(null==v?void 0:v.querySelectorAll)}constructor(e){this.ws=!1,this._s=null,this.Is=!1,this.instance=e,this.rageclicks=new i8(e.config.rageclick),this.Cs=null}},historyAutocapture:class{initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(t_.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ts&&this.Ts(),this.Ts=void 0,t_.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(h&&h.history){var n=this;null!=(e=h.history.pushState)&&e.__posthog_wrapped__||st(h.history,"pushState",e=>function(t,r,i){e.call(this,t,r,i),n.As("pushState")}),null!=(t=h.history.replaceState)&&t.__posthog_wrapped__||st(h.history,"replaceState",e=>function(t,r,i){e.call(this,t,r,i),n.As("replaceState")}),this.Es()}}As(e){try{var t,n=null==h||null==(t=h.location)?void 0:t.pathname;if(!n)return;n!==this.xs&&this.isEnabled&&this._instance.capture(nn,{navigation_type:e}),this.xs=n}catch(t){t_.error("Error capturing "+e+" pageview",t)}}Es(){if(!this.Ts){var e=()=>{this.As("popstate")};np(h,"popstate",e),this.Ts=()=>{h&&h.removeEventListener("popstate",e)}}}constructor(e){var t;this._instance=e,this.xs=(null==h||null==(t=h.location)?void 0:t.pathname)||""}},heatmaps:class{get Rt(){return this.instance.config}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return B(this.Rt.capture_heatmaps)&&this.Rt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Rt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Y(this.Rt.capture_heatmaps)?Y(this.Rt.enable_heatmaps)?this.Rs:this.Rt.enable_heatmaps:!1!==this.Rt.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.ws||(sc.info("starting..."),this.Ms(),this.Tt());else{var e;clearInterval(null!=(e=this.Ns)?e:void 0),this.Fs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tC]:t}),this.Rs=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Os(e){this.wt(e.originalEvent,"deadclick")}Tt(){this.Ns&&clearInterval(this.Ns),this.Ns="visible"===(null==v?void 0:v.visibilityState)?setInterval(this.ji.bind(this),this.flushIntervalMilliseconds):null}Ms(){h&&v&&(this.Ps=this.ji.bind(this),np(h,nt,this.Ps),this.Ls=e=>this.wt(e||(null==h?void 0:h.event)),np(v,"click",this.Ls,{capture:!0}),this.Ds=e=>this.Bs(e||(null==h?void 0:h.event)),np(v,"mousemove",this.Ds,{capture:!0}),this.js=new nD(this.instance,nF,this.Os.bind(this)),this.js.startIfEnabledOrStop(),this.qs=this.Tt.bind(this),np(v,ne,this.qs),this.ws=!0)}Fs(){var e;h&&v&&(this.Ps&&h.removeEventListener(nt,this.Ps),this.Ls&&v.removeEventListener("click",this.Ls,{capture:!0}),this.Ds&&v.removeEventListener("mousemove",this.Ds,{capture:!0}),this.qs&&v.removeEventListener(ne,this.qs),clearTimeout(this.Zs),null==(e=this.js)||e.stop(),this.ws=!1)}$s(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),s=function(e,t,n){for(var r=e;r&&iA(r)&&!iM(r,"body")&&r!==n;){if(N(t,null==h?void 0:h.getComputedStyle(r).position))return!0;r=iU(r)}return!1}(iH(e),["fixed","sticky"],i);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}wt(e,t){var n;if(void 0===t&&(t="click"),!iP(e.target)&&sd(e)){var r=this.$s(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Vs(T({},r,{type:"rageclick"})),this.Vs(r)}
1}Bs(e){!iP(e.target)&&sd(e)&&(clearTimeout(this.Zs),this.Zs=setTimeout(()=>{this.Vs(this.$s(e,"mousemove"))},500))}Vs(e){if(h){var t=h.location.href,n=this.Rt.custom_personal_data_properties,r=nz(t,this.Rt.mask_personal_data_properties?[...nY,...n||[]]:[],nK);this.T=this.T||{},this.T[r]||(this.T[r]=[]),this.T[r].push(e)}}ji(){this.T&&!V(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}constructor(e){var t;this.Rs=!1,this.ws=!1,this.Ns=null,this.instance=e,this.Rs=!(null==(t=this.instance.persistence)||!t.props[tC]),this.rageclicks=new i8(e.config.rageclick)}},deadClicksAutocapture:nD,webVitalsAutocapture:class{get Ws(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,n=B(this.Ws)?null==(e=this.Ws)?void 0:e.web_vitals_allowed_metrics:void 0;return Y(n)?(null==(t=this._instance.persistence)?void 0:t.props[tN])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(B(this.Ws)?this.Ws.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=B(this.Ws)?this.Ws.web_vitals_attribution:void 0;return null!=e&&e}get Ys(){var e=B(this.Ws)&&X(this.Ws.__web_vitals_max_value)?this.Ws.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==m?void 0:m.protocol;if("http:"!==e&&"https:"!==e)return sr.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=B(this.Ws)?this.Ws.web_vitals:J(this.Ws)?this.Ws:void 0;return J(t)?t:this.Rs}startIfEnabled(){this.isEnabled&&!this.ws&&(sr.info("enabled, starting..."),this.ni(this.Gs))}onRemoteConfig(e){if("capturePerformance"in e){var t=B(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=B(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tP]:t}),this._instance.persistence.register({[tN]:n})),this.Rs=t,this.startIfEnabled()}}ni(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?sr.error("failed to load script",t):e()})}Us(){var e=h?h.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return nz(e,this._instance.config.mask_personal_data_properties?[...nY,...t||[]]:[],nK)}sr.error("Could not determine current URL")}constructor(e){var t;this.Rs=!1,this.ws=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Hs=()=>{clearTimeout(this.zs),0!==this.T.metrics.length&&(this._instance.capture("$web_vitals",this.T.metrics.reduce((e,t)=>T({},e,{["$web_vitals_"+t.name+"_event"]:T({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.nt=e=>{var t,n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(U(n))sr.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.Us();U(r)||(Y(null==e?void 0:e.name)||Y(null==e?void 0:e.value)?sr.error("Invalid metric received",e):!this.Ys||this.Ys>e.value?(this.T.url!==r&&(this.Hs(),this.zs=setTimeout(this.Hs,this.flushToCaptureTimeoutMs)),U(this.T.url)&&(this.T.url=r),this.T.firstMetricTimestamp=U(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.T.metrics.push(T({},e,{$current_url:r,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.Hs()):sr.error("Ignoring metric with value >= "+this.Ys,e))}},this.Gs=()=>{if(!this.ws){var e,t,n,r,i=w.__PosthogExtensions__;U(i)||U(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.nt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.nt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this.nt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.nt.bind(this)),this.ws=!0):sr.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Rs=!(null==(t=this._instance.persistence)||!t.props[tP]),this.startIfEnabled()}}},{exceptionObserver:class{ro(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return B(e)?t=T({},t,e):(U(e)?this.eo:e)&&(t=T({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Rt.capture_console_errors||this.Rt.capture_unhandled_errors||this.Rt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(se.info("enabled"),this.Qs(),this.ni(this.Gs)):this.Qs()}ni(e){var t,n;
1null!=(t=w.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return se.error("failed to load script",t);e()})}Qs(){var e,t,n;null==(e=this.Xs)||e.call(this),this.Xs=void 0,null==(t=this.Js)||t.call(this),this.Js=void 0,null==(n=this.Ks)||n.call(this),this.Ks=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.eo=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[tT]:this.eo}),this.Rt=this.ro(),this.startIfEnabledOrStop())}onConfigChange(){this.Rt=this.ro()}captureException(e){var t,n,r,i=null!=(t=null==e||null==(n=e.$exception_list)||null==(n=n[0])?void 0:n.type)?t:"Exception";this.io.consumeRateLimit(i)?se.info("Skipping exception capture because of client rate limiting.",{exception:i}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(e)}constructor(e){var t,n,r;this.Gs=()=>{var e;if(h&&this.isEnabled&&null!=(e=w.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=w.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=w.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=w.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Xs&&this.Rt.capture_unhandled_errors&&(this.Xs=t(this.captureException.bind(this))),!this.Js&&this.Rt.capture_unhandled_rejections&&(this.Js=n(this.captureException.bind(this))),!this.Ks&&this.Rt.capture_console_errors&&(this.Ks=r(this.captureException.bind(this)))}catch(e){se.error("failed to start",e),this.Qs()}}},this._instance=e,this.eo=!(null==(t=this._instance.persistence)||!t.props[tT]),this.io=new eo({refillRate:null!=(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?n:1,bucketSize:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?r:10,refillInterval:1e4,qt:se}),this.Rt=this.ro(),this.startIfEnabledOrStop()}},exceptions:class{onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var i=null!=(t=null==(n=e.errorTracking)?void 0:n.suppressionRules)?t:[],s=null==(r=e.errorTracking)?void 0:r.captureExtensionExceptions;this.no=i,this._instance.persistence&&this._instance.persistence.register({[tO]:this.no,[tI]:s})}}get oo(){var e,t=!!this._instance.get_property(tI),n=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=n?n:t)&&e}buildProperties(e,t){return this.so.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ao(t)){if(this.lo(t))return void sL.info("Skipping exception capture because a suppression rule matched");if(!this.oo&&this.uo(t))return void sL.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ho(t))return void sL.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",zr:!0})}lo(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var{type:n,value:r}=t;return z(n)&&n.length>0&&e.$exception_types.push(n),z(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.no.some(e=>{var n=e.values.map(e=>{var n,r=r7[e.operator],i=W(e.value)?e.value:[e.value],s=null!=(n=t[e.key])?n:[];return i.length>0&&r(i,s)});return"OR"===e.type?n.some(Boolean):n.every(Boolean)})}uo(e){return e.flatMap(e=>{var t,n;return null!=(t=null==(n=e.stacktrace)?void 0:n.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ho(e){if(e.length>0){var t,n,r,i,s=null!=(t=null==(n=e[0].stacktrace)?void 0:n.frames)?t:[],o=s[s.length-1];return null!=(r=null==o||null==(i=o.filename)?void 0:i.includes("posthog.com/static"))&&r}return!1}ao(e){return!Y(e)&&W(e)}constructor(e){var t,n;this.no=[],this.so=new e4([new to,new tv,new tl,new ta,new tp,new th,new tc,new tg],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var i=[],s=t.split("\n"),o=r;s.length>o;o++){var a=s[o];if(1024>=a.length){var l=ts.test(a)?a.replace(ts,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of n){var c=u(l,e);if(c){i.push(c);break}}if(i.length>=50)break}}}if(!i.length)return[];var d=Array.from(i);return d.reverse(),d.slice(0,50).map(e=>T({},e,{filename:e.filename||(d[d.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",tt,ti)),this._instance=e,this.no=null!=(t=null==(n=this._instance.persistence)?void 0:n.get_property(tO))?t:[]}}},sq,{siteApps:class{get isEnabled(){return!!this._instance.config.opt_in_site_apps}po(e,t){if(t){var n=this.globalsForEvent(t);this.fo.push(n),this.fo.length>1e3&&(this.fo=this.fo.slice(10))}}get siteAppLoaders(){var e;return null==(e=w._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.po.bind(this));this.mo=()=>{e(),this.fo=[],this.mo=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,n,r,i,s,o,a,l={},u=this._instance.get_property("$groups")||[];for(var[c,d]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[c]={id:u[c],type:c,properties:d};var{$set_once:f,$set:h}=e;return{event:T({},O(e,sp),{properties:T({},e.properties,h?{$set:T({},null!=(t=null==(n=e.properties)?void 0:n.$set)?t:{},h)}:{},f?{$set_once:T({},null!=(r=null==(i=e.properties)?void 0:i.$set_once)?r:{},f)}:{}),elements_chain:null!=(s=null==(o=e.properties)?void 0:o.$elements_chain)?s:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.fo.length&&(sg.info("Processing "+this.fo.length+" events for site app with id "+e.id),this.fo.forEach(e
1=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(n=this.mo)||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,sg.info("Site app with id "+e.id+" "+(i?"loaded":"errored")),r&&n()};try{var{processEvent:s}=e.init({posthog:this._instance,callback(e){i(e)}});s&&(t.processEvent=s),r=!0}catch(t){sg.error(sv+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){sg.error("Error while processing buffered events PostHog app with config id "+e.id,n),t.errored=!0}}yo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}bo(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{null==n.processEvent||n.processEvent(t)}catch(t){sg.error("Error while processing event "+e.event+" for site app "+n.id,t)}}}onRemoteConfig(e){var t,n,r,i=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.yo(),void this._instance.on("eventCaptured",e=>this.bo(e))):void sg.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(n=this.mo)||n.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled){var s=function(e){var t;w["__$$ph_site_app_"+e]=i._instance,null==(t=w.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(i._instance,a,t=>{if(t)return sg.error(sv+e,t)})};for(var{id:o,url:a}of e.siteApps)s(o)}else sg.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}constructor(e){this._instance=e,this.fo=[],this.apps={}}}},sG,{tracingHeaders:class{initialize(){this.startIfEnabledOrStop()}ni(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return sn.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.ni(this.Gs):(null==(e=this.wo)||e.call(this),null==(t=this._o)||t.call(this),this.wo=void 0,this._o=void 0)}constructor(e){this.wo=void 0,this._o=void 0,this.Gs=()=>{var e,t;U(this.wo)&&(null==(e=w.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),U(this._o)&&(null==(t=w.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}}},{toolbar:class{No(e){w.ph_toolbar_state=e}Mo(){var e;return null!=(e=w.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),ng(this.instance.config)||!h||!v)return!1;e=null!=e?e:h.location,n=null!=n?n:h.history;try{if(!t){try{h.localStorage.setItem("test","test"),h.localStorage.removeItem("test")}catch(e){return!1}t=null==h?void 0:h.localStorage}var r,i=sw||nq(e.hash,"__posthog")||nq(e.hash,"state"),s=i?nc(()=>JSON.parse(atob(decodeURIComponent(i))))||nc(()=>JSON.parse(decodeURIComponent(i))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(sS)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}}Fo(e){var t=w.ph_load_toolbar||w.ph_load_editor;!Y(t)&&H(t)?t(e,this.instance):sR.warn("No toolbar load function found")}loadToolbar(e){var t,n=!(null==v||!v.getElementById(t1));if(!h||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=T({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(h.localStorage.setItem(sS,JSON.stringify(T({},i,{source:void 0}))),2===this.Mo())?this.Fo(i):0===this.Mo()&&(this.No(1),null==(t=w.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return sR.error("[Toolbar] Failed to load",e),void this.No(0);this.No(2),this.Fo(i)}),np(h,"turbolinks:load",()=>{this.No(0),this.loadToolbar(i)})),!0}Oo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),this.maybeLoadToolbar(e,t,n)}constructor(e){this.instance=e}}},sY,{conversations:class{initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Y(t)||(J(t)?this.Po=t:(this.Po=t.enabled,this.Do=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Po=void 0,this.Do=null}loadIfEnabled(){if(!(this._conversationsManager||this.Lo||this._instance.config.disable_conversations||ng(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==w?void 0:w.__PosthogExtensions__;if(e&&!U(this.Po)&&this.Po)if(this.Do&&this.Do.token){this.Lo=!0;try{var t=e.initConversations;if(t)return this.Bo(t),void(this.Lo=!1);var n=e.loadExternalDependency;if(!n)return void this.jo(t3);n(this._instance,"conversations",t=>{t||!e.initConversations?this.jo("Could not load conversations script",t):this.Bo(e.initConversations),this.Lo=!1})}catch(e){this.jo("Error initializing conversations",e),this.Lo=!1}}else sW.error("Conversations enabled but missing token in remote config.")}}Bo(e){if(this.Do)try{this._conversationsManager=e(this.Do,this._instance),sW.info("Conversations loaded successfully")}catch(e){this.jo("Error completing conversations initialization",e)}else sW.error("Cannot complete initialization: remote config is null")}jo(e,t){sW.error(e,t),this._conversationsManager=null,this.Lo=!1}show(){this._conversationsManager?this._conversationsManager.show():sW.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Po&&!G(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,n){var r=this;return C(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(sW.warn(sH),null)})()}getMessages(e,t){var n=this;return C(function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(sW.warn(sH),null)})()}markAsRead(e){var t=this;return C(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(sW.warn(sH),null)})()}getTickets(e){var t=this;return C(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(sW.warn(sH),null)})()}requestRestoreLink(e){var t=this;return C(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(sW.warn(sH),null)})()}restoreFromToken(e){var t=this;return C(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(sW.warn(sH),null)})()}restoreFromUrlToken(){var e=this;return C(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(sW.warn(sH),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}Kr(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Qr(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}constructor(e){this.Po=void 0,this._conversationsManager=null,this.Lo=!1,this.Do=null,this._instance=e}}},{logs:class{initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,n=null==(t=e.logs)?void 0:t.captureConsoleLogs;!Y(n)&&n&&(this.qo=!0,this.loadIfEnabled())}reset(){this.$o=[],this.Ni&&(clearTimeout(this.Ni),this.Ni=void 0),this.Vo=0,this.Ho=0,this.zo=!1}loadIfEnabled(){if(this.qo&&!this.Zo){var e=null==w?void 0:w.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var n;t||null==(n=e.logs)||!n.initializeLogs?this.qt.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.Zo=!0)}):this.qt.error(t3)}else this.qt.error("PostHog Extensions not found.")}}captureLog(e){var t,n,r,i,s,o;if(this._instance.is_capturing())if(e&&e.body){var a=null!=(t=null==(n=this._instance.config.logs)?void 0:n.flushIntervalMs)?t:3e3,l=null!=(r=null==(i=this._instance.config.logs)?void 0:i.maxLogsPerInterval)?r:1e3,u=Date.now();if(a>u-this.Ho||(this.Ho=u,this.Vo=0,this.zo=!1),l>this.Vo){this.Vo++;var c=function(e,t){var{text:n,number:r}=sB[e.level||"info"]||sV,i=String(Date.now())+"000000",s={};t.distinctId&&(s.posthogDistinctId=t.distinctId),t.sessionId&&(s.sessionId=t.sessionId),t.currentUrl&&(s["url.full"]=t.currentUrl),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(s.feature_flags=t.activeFeatureFlags);var o=T({},s,e.attributes||{}),a={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:r,severityText:n,body:{stringValue:e.body},attributes:sU(o)};return e.trace_id&&(a.traceId=e.trace_id),e.span_id&&(a.spanId=e.span_id),U(e.trace_flags)||(a.flags=e.trace_flags),a}(e,this.Uo());this.$o.push({record:c}),(null!=(s=null==(o=this._instance.config.logs)?void 0:o.maxBufferSize)?s:100)>this.$o.length?this.Yo():this.flushLogs()}else this.zo||(this.qt.warn("captureLog dropping logs: exceeded "+l+" logs per "+a+"ms"),this.zo=!0)}else this.qt.warn("captureLog requires a body")}get logger(){return this.Go||(this.Go={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>
1this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Go}flushLogs(e){if(this.Ni&&(clearTimeout(this.Ni),this.Ni=void 0),0!==this.$o.length){var t,n=this.$o;this.$o=[];var r=this._instance.config.logs,i=T({"service.name":(null==r?void 0:r.serviceName)||"unknown_service"},(null==r?void 0:r.environment)&&{"deployment.environment":r.environment},(null==r?void 0:r.serviceVersion)&&{"service.version":r.serviceVersion},null==r?void 0:r.resourceAttributes),s=(t=n.map(e=>e.record),{resourceLogs:[{resource:{attributes:sU(i)},scopeLogs:[{scope:{name:R.LIB_NAME},logRecords:t}]}]}),o=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Pr({method:"POST",url:o,data:s,compression:"best-available",batchKey:"logs",transport:e})}}Yo(){var e,t;this.Ni||(this.Ni=setTimeout(()=>{this.Ni=void 0,this.flushLogs()},null!=(e=null==(t=this._instance.config.logs)?void 0:t.flushIntervalMs)?e:3e3))}Uo(){var e,t={lib:R.LIB_NAME};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(null!=w&&null!=(e=w.location)&&e.href&&(t.currentUrl=w.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}constructor(e){var t;this.qo=!1,this.Zo=!1,this.qt=ty("[logs]"),this.$o=[],this.Vo=0,this.Ho=0,this.zo=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.qo=!0)}}});iI.__defaultExtensionClasses=T({},sX);var sK,sJ=(sK=iv[iS]=new iI,function(){function e(){e.done||(e.done=!0,iR=!1,na(iv,function(e){e._dom_loaded()}))}null!=v&&v.addEventListener?"complete"===v.readyState?e():np(v,"DOMContentLoaded",e,{capture:!1}):h&&t_.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),sK);function sZ(){return(0,r.useEffect)(()=>{sJ.init("phc_qt9BsVXrFuwtgyCd2RRHEHTgEFHbq5Fc4h5pCyNHQCEx\n",{api_host:"https://us.i.posthog.com",loaded:e=>{}})},[]),(0,n.jsx)(f,{})}}]);

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