@gup-fe/js-sdk 2.4.3 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -1
- package/dist/js-sdk.bundle.js +21512 -40391
- package/dist/js-sdk.bundle.umd.js +48 -291
- package/dist/js-sdk.js +7266 -7615
- package/dist/js-sdk.umd.js +24 -33
- package/package.json +3 -3
package/dist/js-sdk.umd.js
CHANGED
|
@@ -1,66 +1,57 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`._Viewport_ai81v_1{position:fixed;width:100%;max-width:300px;margin:0 auto;top:1rem;right:0;left:0;bottom:auto;z-index:999}._Toast_ai81v_14{--gap: .75rem;--peek: .75rem;--scale: max(0, 1 - (var(--toast-index) * .1)) ;--shrink: calc(1 - var(--scale));--height: var(--toast-frontmost-height, var(--toast-height));--offset-y: calc( var(--toast-offset-y) + (var(--toast-index) * var(--gap)) + var(--toast-swipe-movement-y) );position:absolute;box-sizing:border-box;background:var(--color-gray-50);color:var(--color-gray-900);border:1px solid var(--color-gray-200);padding:1rem;width:100%;box-shadow:0 2px 10px #0000001a;background-clip:padding-box;border-radius:.5rem;transform-origin:top center;top:0;left:0;right:0;margin:0 auto;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:transform .5s cubic-bezier(.22,1,.36,1),opacity .5s,height .15s;cursor:default;z-index:calc(1000 - var(--toast-index));height:var(--height);transform:translate(var(--toast-swipe-movement-x)) translateY(calc(var(--toast-swipe-movement-y) + (var(--toast-index) * var(--peek)) + (var(--shrink) * var(--height)))) scale(var(--scale))}._Toast_ai81v_14[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--offset-y));height:var(--toast-height)}._Toast_ai81v_14[data-starting-style],._Toast_ai81v_14[data-ending-style]{transform:translateY(-150%)}._Toast_ai81v_14[data-limited],._Toast_ai81v_14[data-ending-style]{opacity:0}._Toast_ai81v_14[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 150%))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 150%)) translateY(var(--offset-y))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 150%)) translateY(var(--offset-y))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 150%))}._Toast_ai81v_14:after{content:"";position:absolute;width:100%;bottom:100%;left:0;height:calc(var(--gap) + 1px)}._Content_ai81v_99{overflow:hidden;transition:opacity .25s}._Content_ai81v_99[data-behind]{opacity:0}._Content_ai81v_99[data-expanded]{opacity:1}._Title_ai81v_112{font-weight:500;font-size:.975rem;line-height:1.25rem;margin:0}._Description_ai81v_119{font-size:.925rem;line-height:1.25rem;margin:0}._Close_ai81v_125{position:absolute;top:.5rem;right:.5rem;padding:0;border:none;background:transparent;width:1.25rem;height:1.25rem;display:flex;align-items:center;justify-content:center;border-radius:.25rem}._Close_ai81v_125:hover{background-color:var(--color-gray-100)}._Icon_ai81v_144{width:1rem;height:1rem}._trigger_1e3h3_1{display:flex;height:100%;width:4rem;align-items:center;justify-content:center;gap:.25rem;border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));outline:2px solid transparent;outline-offset:2px}._popup_1e3h3_5{width:20rem;overflow-y:auto;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);max-height:var(--available-height);transform-origin:var(--transform-origin);transition:transform .2s ease,opacity .2s ease}._popup_1e3h3_5[data-starting-style],._popup_1e3h3_5[data-ending-style]{opacity:0;transform:scale(.95)}._popup_1e3h3_5[data-side=none][data-starting-style]{transform:scale(1);opacity:1}._item_1e3h3_24{display:grid;min-width:var(--anchor-width);cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;grid-template-columns:.75rem 1fr;align-items:center;gap:.5rem;border-bottom-width:1px;padding:.75rem 1rem;font-size:.875rem;line-height:1.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}._item_1e3h3_24:last-child{border-bottom-width:0px}._item_1e3h3_24:first-of-type{border-top-left-radius:1rem;border-top-right-radius:1rem}._item_1e3h3_24:last-of-type{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}._item_1e3h3_24[data-highlighted]{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(120 155 245 / var(--tw-text-opacity, 1))}._indicator_1e3h3_40{grid-column-start:1}._itemText_1e3h3_44{grid-column-start:2;display:flex;justify-content:space-between}._itemCode_1e3h3_48{font-weight:500}._itemLabel_1e3h3_52{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._uidGet_os9yc_1{width:80vw;max-width:400px;background-size:cover;background-position:center}._mailCodeGet_os9yc_5{width:100%;background-size:cover;background-position:center}.game-5174 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626145347721513.png);aspect-ratio:553 / 428}.game-5174 ._mailCodeGet_os9yc_5{aspect-ratio:680/1096}.game-5174 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626151631191610.png)}@media(min-width:1024px){.game-5174 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5174 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626144535531913.png)}}.game-5273 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626142807783110.png);aspect-ratio:553 / 428}.game-5273 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1096;background-image:url(https://h5.sdk.mobileztgame.com/dist/role-tip-mobile.png)}@media(min-width:1024px){.game-5273 ._mailCodeGet_os9yc_5{aspect-ratio:1220/654}}@media(min-width:1024px){.game-5273 ._mailCodeGet_os9yc_5{background-image:url(https://h5.sdk.mobileztgame.com/dist/role-tip-pc.png)}}.game-5242 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624152217734019.png);aspect-ratio:596 / 266}.game-5242 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1094;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624132201121910.png)}@media(min-width:1024px){.game-5242 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5242 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624143628881023.png)}}.game-5234 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811141956691626.png);aspect-ratio:740 / 290}.game-5234 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1094;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811142113377920.png)}@media(min-width:1024px){.game-5234 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5234 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811142146601319.png)}}.game-5199 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319163303381734.png);aspect-ratio:541 / 431;border-radius:10px}.game-5199 ._mailCodeGet_os9yc_5{aspect-ratio:353 / 561;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319160000001714.png)}@media(min-width:1024px){.game-5199 ._mailCodeGet_os9yc_5{aspect-ratio:677/323}}@media(min-width:1024px){.game-5199 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319153435571035.png)}}.game-5199 input{color:#dfd9c6}.game-5199 input::-moz-placeholder{color:#70625e}.game-5199 input::placeholder{color:#70625e}.game-5199 button{color:#dfd9c6}.game-5199 ._uidGetPopup_os9yc_79{background-color:#5d5655;padding:10px}.game-5199 ._uidGetArrow_os9yc_83{color:#5d5655}.game-5199 ._inputControl_os9yc_86{height:40px}.game-5199 ._form_os9yc_89>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}._quickLogin_1ibz1_1{width:100%}._quickAccounts_1ibz1_5{position:relative}._selectedAccount_1ibz1_9{display:flex;align-items:center;justify-content:space-between;border:1px solid #ddd;border-radius:9999px;height:44px;padding:0 20px;background:#fff;cursor:pointer}._accountInfo_1ibz1_21{display:flex;flex-direction:column}._accountName_1ibz1_26{font-size:15px;color:#333}._arrow_1ibz1_31{size:16px;color:#999;transition:transform .2s}._arrowRotate_1ibz1_37{transform:rotate(180deg)}._accountList_1ibz1_41{position:absolute;top:50px;left:0;right:0;z-index:10}._listScroll_1ibz1_49{max-height:200px;border:1px solid #ddd;border-radius:12px;overflow-y:auto;background:#fff;box-shadow:0 4px 12px #0000001a}._accountItem_1ibz1_58{display:flex;align-items:center;justify-content:space-between;padding:0 20px;height:44px;gap:12px;border-bottom:1px solid #f5f5f5;cursor:pointer}._accountItem_1ibz1_58:last-child{border-bottom:none}._accountItem_1ibz1_58:hover{background-color:#f9f9f9}._accountItem_1ibz1_58._active_1ibz1_77{background-color:#f0f4ff}._accountItem_1ibz1_58._active_1ibz1_77 ._itemName_1ibz1_81{color:#497efe;font-weight:500}._itemInfo_1ibz1_86{display:flex;flex-direction:column;flex:1}._itemName_1ibz1_81{font-size:14px;color:#333}._deleteBtn_1ibz1_97{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:background-color .2s}._deleteBtn_1ibz1_97:hover{background-color:#fee2e2}.game-5199 ._modal_1pbx2_2{background:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319165656615516.png) no-repeat center center;background-size:100% 100%;padding:60px 35px 30px}.game-5199 ._close_1pbx2_8{top:10px;right:0;background:url(https://ipay.ztgame.com/png/button_close.hzBHa9.png) no-repeat center center;background-size:100% 100%;width:57px;height:60px}.game-5199 ._close_1pbx2_8 svg{opacity:0}.game-5199 ._close_1pbx2_8:hover{background-color:transparent}._autoLoginHint_h58ls_1{position:fixed;top:16px;left:50%;transform:translate(-50%);width:80%;max-width:400px;height:48px;background-color:#000c;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 20px;z-index:9999;font-size:14px;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-radius:24px;box-shadow:0 8px 20px #0000004d}._left_h58ls_22{display:flex;align-items:center;gap:8px}._loading_h58ls_28{width:18px;height:18px;border:2px solid rgba(255,255,255,.2);border-top-color:#fff;border-radius:50%;animation:_spin_h58ls_1 .8s cubic-bezier(.5,.1,.4,.9) infinite}._switchBtn_h58ls_37{color:#a5a7ff;cursor:pointer;padding:6px 12px;background:#787bf426;border:none;font-size:13px;font-weight:600;border-radius:12px;transition:all .2s ease}._switchBtn_h58ls_37:hover{background:#787bf44d;color:#fff}@keyframes _spin_h58ls_1{to{transform:rotate(360deg)}}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input::-webkit-input-placeholder{color:#a9a9a9}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.inset-0{inset:0}.bottom-0{bottom:0}.left-0{left:0}.left-1\\/2{left:50%}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-1\\/2{top:50%}.top-4{top:1rem}.z-\\[1\\]{z-index:1}.z-\\[990\\]{z-index:990}.z-\\[991\\]{z-index:991}.z-\\[992\\]{z-index:992}.z-\\[999\\]{z-index:999}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.mx-auto{margin-left:auto;margin-right:auto}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.-mt-1\\.5{margin-top:-.375rem}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.aspect-\\[240\\/85\\]{aspect-ratio:240/85}.size-3{width:.75rem;height:.75rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-4{height:1rem}.h-4\\/6{height:66.666667%}.h-7{height:1.75rem}.h-9{height:2.25rem}.h-\\[70vh\\]{height:70vh}.h-full{height:100%}.max-h-\\[var\\(--available-height\\)\\]{max-height:var(--available-height)}.w-0{width:0px}.w-12{width:3rem}.w-16{width:4rem}.w-32{width:8rem}.w-80{width:20rem}.w-96{width:24rem}.w-\\[300px\\]{width:300px}.w-\\[400px\\]{width:400px}.w-\\[90vw\\]{width:90vw}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[var\\(--anchor-width\\)\\]{min-width:var(--anchor-width)}.max-w-64{max-width:16rem}.max-w-\\[80vw\\]{max-width:80vw}.max-w-\\[calc\\(100vw-3rem\\)\\]{max-width:calc(100vw - 3rem)}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.origin-\\[var\\(--transform-origin\\)\\]{transform-origin:var(--transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-\\[0\\.75rem_1fr\\]{grid-template-columns:.75rem 1fr}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-\\[var\\(--jssdk-input-border-color\\)\\]{border-color:var(--jssdk-input-border-color)}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.bg-\\[canvas\\]{background-color:canvas}.bg-\\[var\\(--jssdk-icon-color\\)\\]{background-color:var(--jssdk-icon-color)}.bg-\\[var\\(--jssdk-input-bg-color\\)\\]{background-color:var(--jssdk-input-bg-color)}.bg-black\\/20{background-color:#0003}.bg-black\\/70{background-color:#000000b3}.bg-black\\/80{background-color:#000c}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-inherit{background-color:inherit}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\\[\\#497efe\\]{--tw-gradient-from: #497efe var(--tw-gradient-from-position);--tw-gradient-to: rgb(73 126 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-\\[\\#947afa\\]{--tw-gradient-to: #947afa var(--tw-gradient-to-position)}.fill-\\[canvas\\]{fill:canvas}.fill-current{fill:currentColor}.fill-gray-200{fill:#e5e7eb}.fill-gray-400{fill:#9ca3af}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-\\[11px\\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-\\[\\#f59e9e\\]{--tw-text-opacity: 1;color:rgb(245 158 158 / var(--tw-text-opacity, 1))}.text-\\[var\\(--jssdk-primary-color\\)\\]{color:var(--jssdk-primary-color)}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/80{color:#fffc}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-\\[transform\\,scale\\,opacity\\]{transition-property:transform,scale,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.\\[transform\\:translateY\\(var\\(--drawer-swipe-movement-y\\)\\)\\]{transform:translateY(var(--drawer-swipe-movement-y))}.placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:left-0:before{content:var(--tw-content);left:0}.before\\:top-\\[-100\\%\\]:before{content:var(--tw-content);top:-100%}.before\\:h-full:before{content:var(--tw-content);height:100%}.before\\:w-full:before{content:var(--tw-content);width:100%}.before\\:content-\\[\\'\\'\\]:before{--tw-content: "";content:var(--tw-content)}.last\\:border-b-0:last-child{border-bottom-width:0px}.focus-within\\:border-\\[\\#787bf4\\]:focus-within{--tw-border-opacity: 1;border-color:rgb(120 123 244 / var(--tw-border-opacity, 1))}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\\:text-\\[var\\(--jssdk-primary-color\\)\\]:hover{color:var(--jssdk-primary-color)}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-2:focus{outline-width:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.active\\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:brightness-90:active{--tw-brightness: brightness(.9);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.enabled\\:text-\\[var\\(--jssdk-primary-color\\)\\]:enabled{color:var(--jssdk-primary-color)}.enabled\\:hover\\:bg-\\[var\\(--jssdk-primary-color\\)\\]:hover:enabled{background-color:var(--jssdk-primary-color)}.enabled\\:hover\\:text-\\[var\\(--jssdk-primary-foregroud-color\\)\\]:hover:enabled{color:var(--jssdk-primary-foregroud-color)}.enabled\\:hover\\:text-white:hover:enabled{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:grayscale:disabled{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.data-\\[direction\\=down\\]\\:bottom-0[data-direction=down]{bottom:0}.data-\\[side\\=bottom\\]\\:top-\\[-8px\\][data-side=bottom]{top:-8px}.data-\\[side\\=left\\]\\:right-\\[-13px\\][data-side=left]{right:-13px}.data-\\[side\\=right\\]\\:left-\\[-13px\\][data-side=right]{left:-13px}.data-\\[side\\=top\\]\\:bottom-\\[-8px\\][data-side=top]{bottom:-8px}.data-\\[ending-style\\]\\:translate-y-full[data-ending-style],.data-\\[starting-style\\]\\:translate-y-full[data-starting-style]{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:rotate-90[data-side=left]{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=right\\]\\:-rotate-90[data-side=right]{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:rotate-180[data-side=top]{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[ending-style\\]\\:scale-90[data-ending-style]{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:scale-100[data-starting-style][data-side=none]{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[starting-style\\]\\:scale-90[data-starting-style]{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[checked\\]\\:border-\\[var\\(--jssdk-primary-color\\)\\][data-checked]{border-color:var(--jssdk-primary-color)}.data-\\[unchecked\\]\\:border-\\[var\\(--jssdk-input-border-color\\)\\][data-unchecked]{border-color:var(--jssdk-input-border-color)}.data-\\[unchecked\\]\\:border-gray-300[data-unchecked]{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.data-\\[highlighted\\]\\:bg-gray-50[data-highlighted]{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.data-\\[highlighted\\]\\:text-\\[\\#789bf5\\][data-highlighted]{--tw-text-opacity: 1;color:rgb(120 155 245 / var(--tw-text-opacity, 1))}.data-\\[ending-style\\]\\:opacity-0[data-ending-style]{opacity:0}.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:opacity-100[data-starting-style][data-side=none]{opacity:1}.data-\\[starting-style\\]\\:opacity-0[data-starting-style]{opacity:0}.data-\\[ending-style\\]\\:transition-none[data-ending-style],.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:transition-none[data-starting-style][data-side=none]{transition-property:none}.data-\\[direction\\=down\\]\\:before\\:bottom-\\[-100\\%\\][data-direction=down]:before{content:var(--tw-content);bottom:-100%}.group[data-focused] .group-data-\\[focused\\]\\:border-\\[var\\(--jssdk-primary-color\\)\\]{border-color:var(--jssdk-primary-color)}.group[data-focused] .group-data-\\[focused\\]\\:shadow-\\[0_0_6px_color-mix\\(in_srgb\\,var\\(--jssdk-primary-color\\)\\,transparent_80\\%\\)\\]{--tw-shadow: 0 0 6px color-mix(in srgb,var(--jssdk-primary-color),transparent 80%);--tw-shadow-colored: 0 0 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\\:fill-gray-300:is(.dark *){fill:#d1d5db}.dark\\:fill-none:is(.dark *){fill:none}.dark\\:opacity-70:is(.dark *){opacity:.7}.dark\\:shadow-none:is(.dark *){--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\\:-outline-offset-1:is(.dark *){outline-offset:-1px}.dark\\:outline-gray-300:is(.dark *){outline-color:#d1d5db}@media(min-width:768px){.md\\:size-5{width:1.25rem;height:1.25rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media(min-width:1024px){.lg\\:size-6{width:1.5rem;height:1.5rem}.lg\\:w-4\\/5{width:80%}.lg\\:w-\\[60vw\\]{width:60vw}.lg\\:max-w-5xl{max-width:64rem}.lg\\:text-2xl{font-size:1.5rem;line-height:2rem}}`)),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
(function(yt,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react-dom/client","react","react-dom"],w):(yt=typeof globalThis<"u"?globalThis:yt||self,w(yt.SDK={},yt.jsxRuntime,yt.ReactDOM,yt.React,yt.ReactDOM))})(this,(function(yt,w,em,oe,tm){"use strict";function Uc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=Uc(oe),Kt=Uc(tm);var Kr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ro=typeof window>"u"||"Deno"in globalThis;function Jt(){}function nm(e,t){return typeof e=="function"?e(t):e}function rm(e){return typeof e=="number"&&e>=0&&e!==1/0}function om(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gi(e,t){return typeof e=="function"?e(t):e}function sm(e,t){return typeof e=="function"?e(t):e}function Bc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==yi(i,t.options))return!1}else if(!Jr(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Wc(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(tr(t.options.mutationKey)!==tr(s))return!1}else if(!Jr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function yi(e,t){return(t?.queryKeyHashFn||tr)(e)}function tr(e){return JSON.stringify(e,(t,n)=>bi(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Jr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Jr(e[n],t[n])):!1}function vi(e,t){if(e===t)return e;const n=Zc(e)&&Zc(t);if(n||bi(e)&&bi(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{},c=new Set(r);let u=0;for(let l=0;l<i;l++){const d=n?l:s[l];(!n&&c.has(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,u++):(a[d]=vi(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&u++)}return o===i&&u===o?e:a}return t}function im(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Zc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bi(e){if(!Gc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Gc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Gc(e){return Object.prototype.toString.call(e)==="[object Object]"}function am(e){return new Promise(t=>{setTimeout(t,e)})}function cm(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return vi(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return vi(e,t)}return t}function um(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lm(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var No=Symbol();function Yc(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===No&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===No?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function dm(e,t){return typeof e=="function"?e(...t):!!e}var fm=class extends Kr{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ro&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Xc=new fm,pm=class extends Kr{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ro&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Mo=new pm;function hm(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function mm(e){return Math.min(1e3*2**e,3e4)}function qc(e){return(e??"online")==="online"?Mo.isOnline():!0}var Kc=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function wi(e){return e instanceof Kc}function Jc(e){let t=!1,n=0,r=!1,o;const s=hm(),i=g=>{r||(p(new Kc(g)),e.abort?.())},a=()=>{t=!0},c=()=>{t=!1},u=()=>Xc.isFocused()&&(e.networkMode==="always"||Mo.isOnline())&&e.canRun(),l=()=>qc(e.networkMode)&&e.canRun(),d=g=>{r||(r=!0,e.onSuccess?.(g),o?.(),s.resolve(g))},p=g=>{r||(r=!0,e.onError?.(g),o?.(),s.reject(g))},h=()=>new Promise(g=>{o=v=>{(r||u())&&g(v)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),m=()=>{if(r)return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(d).catch(y=>{if(r)return;const C=e.retry??(Ro?0:3),S=e.retryDelay??mm,E=typeof S=="function"?S(n,y):S,b=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,y);if(t||!b){p(y);return}n++,e.onFail?.(n,y),am(E).then(()=>u()?void 0:h()).then(()=>{t?p(y):m()})})};return{promise:s,cancel:i,continue:()=>(o?.(),s),cancelRetry:a,continueRetry:c,canStart:l,start:()=>(l()?m():h().then(m),s)}}var gm=e=>setTimeout(e,0);function ym(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=gm;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ot=ym(),Qc=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rm(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ro?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},vm=class extends Qc{#e;#t;#n;#r;#o;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=wm(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#o?.promise}setOptions(e){this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=cm(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#o?.promise;return this.#o?.cancel(e),t?t.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>sm(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===No||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>gi(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!om(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#o&&(this.#a?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(u=>u.options.queryFn);c&&this.setOptions(c.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const c=Yc(this.options,t),l=(()=>{const d={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#a=!1,this.options.persister?this.options.persister(c,l,this):c(l)},i=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:o};return r(c),c})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta});const a=c=>{wi(c)&&c.silent||this.#s({type:"error",error:c}),wi(c)||(this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this)),this.scheduleGc()};return this.#o=Jc({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:c=>{if(c===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(u){a(u);return}this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,u)=>{this.#s({type:"failed",failureCount:c,error:u})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#o.start()}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...bm(n.data,this.options),fetchMeta:e.meta??null};case"success":return this.#t=void 0,{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return wi(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ot.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function bm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wm(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Sm=class extends Kr{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??yi(r,t);let s=this.get(o);return s||(s=new vm({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ot.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Bc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Bc(e,n)):t}notify(e){Ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ot.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ot.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Em=class extends Qc{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||eu(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})};this.#n=Jc({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(o,s)=>{this.#r({type:"failed",failureCount:o,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const n=this.state.status==="pending",r=!this.#n.canStart();try{if(n)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#t.config.onMutate?.(e,this);const s=await this.options.onMutate?.(e);s!==this.state.context&&this.#r({type:"pending",context:s,variables:e,isPaused:r})}const o=await this.#n.start();return await this.#t.config.onSuccess?.(o,e,this.state.context,this),await this.options.onSuccess?.(o,e,this.state.context),await this.#t.config.onSettled?.(o,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(o,null,e,this.state.context),this.#r({type:"success",data:o}),o}catch(o){try{throw await this.#t.config.onError?.(o,e,this.state.context,this),await this.options.onError?.(o,e,this.state.context),await this.#t.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,o,e,this.state.context),o}finally{this.#r({type:"error",error:o})}}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ot.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function eu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xm=class extends Kr{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new Em({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Ao(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ao(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ao(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Ao(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ot.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Wc(t,n))}findAll(e={}){return this.getAll().filter(t=>Wc(e,t))}notify(e){Ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ot.batch(()=>Promise.all(e.map(t=>t.continue().catch(Jt))))}};function Ao(e){return e.options.scope?.id}function tu(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let l=!1;const d=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?l=!0:t.signal.addEventListener("abort",()=>{l=!0}),t.signal)})},p=Yc(t.options,t.fetchOptions),h=async(m,g,v)=>{if(l)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const C=(()=>{const x={client:t.client,queryKey:t.queryKey,pageParam:g,direction:v?"backward":"forward",meta:t.options.meta};return d(x),x})(),S=await p(C),{maxPages:E}=t.options,b=v?lm:um;return{pages:b(m.pages,S,E),pageParams:b(m.pageParams,g,E)}};if(o&&s.length){const m=o==="backward",g=m?Cm:nu,v={pages:s,pageParams:i},y=g(r,v);a=await h(v,y,m)}else{const m=e??s.length;do{const g=c===0?i[0]??r.initialPageParam:nu(r,a);if(c>0&&g==null)break;a=await h(a,g),c++}while(c<m)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function nu(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Cm(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Tm=class{#e;#t;#n;#r;#o;#i;#a;#s;constructor(e={}){this.#e=e.queryCache||new Sm,this.#t=e.mutationCache||new xm,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Xc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Mo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(gi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,i=nm(t,s);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ot.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ot.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ot.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ot.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Jt).catch(Jt)}invalidateQueries(e,t={}){return Ot.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ot.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Jt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(gi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=tu(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=tu(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Mo.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(tr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Jr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(tr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Jr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=yi(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===No&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Om=class extends Kr{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),im(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&tr(n.mutationKey)!==tr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#o(){const t=this.#n?.state??eu();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){Ot.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context;t?.type==="success"?(this.#r.onSuccess?.(t.data,n,r),this.#r.onSettled?.(t.data,null,n,r)):t?.type==="error"&&(this.#r.onError?.(t.error,n,r),this.#r.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#t)})})}},ru=f.createContext(void 0),Pm=e=>{const t=f.useContext(ru);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_m=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(ru.Provider,{value:e,children:t}));function sn(e,t){const n=Pm(),[r]=f.useState(()=>new Om(n,e));f.useEffect(()=>{r.setOptions(e)},[r,e]);const o=f.useSyncExternalStore(f.useCallback(i=>r.subscribe(Ot.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=f.useCallback((i,a)=>{r.mutate(i,a).catch(Jt)},[r]);if(o.error&&dm(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var Si=function(){return Si=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Si.apply(this,arguments)};function pn(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(l){try{u(r.next(l))}catch(d){i(d)}}function c(l){try{u(r.throw(l))}catch(d){i(d)}}function u(l){l.done?s(l.value):o(l.value).then(a,c)}u((r=r.apply(e,t||[])).next())})}function hn(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(u){return function(l){return c([u,l])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(l){u=[6,l],o=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Im(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function ou(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var su="4.6.2";function Do(e,t){return new Promise(function(n){return setTimeout(n,e,t)})}function km(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function Rm(e,t){t===void 0&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise(function(r){return n.call(window,function(){return r()},{timeout:t})}):Do(Math.min(e,t))}function iu(e){return!!e&&typeof e.then=="function"}function au(e,t){try{var n=e();iu(n)?n.then(function(r){return t(!0,r)},function(r){return t(!1,r)}):t(!0,n)}catch(r){t(!1,r)}}function cu(e,t,n){return n===void 0&&(n=16),pn(this,void 0,void 0,function(){var r,o,s,i;return hn(this,function(a){switch(a.label){case 0:r=Array(e.length),o=Date.now(),s=0,a.label=1;case 1:return s<e.length?(r[s]=t(e[s],s),i=Date.now(),i>=o+n?(o=i,[4,km()]):[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return++s,[3,1];case 4:return[2,r]}})})}function Qr(e){return e.then(void 0,function(){}),e}function Nm(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}function Mm(e,t){return!Nm(e,t)}function Ei(e){return parseInt(e)}function an(e){return parseFloat(e)}function In(e,t){return typeof e=="number"&&isNaN(e)?t:e}function Nt(e){return e.reduce(function(t,n){return t+(n?1:0)},0)}function uu(e,t){if(t===void 0&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function Am(e){for(var t,n,r="Unexpected syntax '".concat(e,"'"),o=/^\s*([a-z-]*)(.*)$/i.exec(e),s=o[1]||void 0,i={},a=/([.:#][\w-]+|\[.+?\])/gi,c=function(p,h){i[p]=i[p]||[],i[p].push(h)};;){var u=a.exec(o[2]);if(!u)break;var l=u[0];switch(l[0]){case".":c("class",l.slice(1));break;case"#":c("id",l.slice(1));break;case"[":{var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(l);if(d)c(d[1],(n=(t=d[4])!==null&&t!==void 0?t:d[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[s,i]}function Dm(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>127)return new TextEncoder().encode(e);t[n]=r}return t}function jn(e,t){var n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,s=e[1]&65535,i=t[0]>>>16,a=t[0]&65535,c=t[1]>>>16,u=t[1]&65535,l=0,d=0,p=0,h=0;h+=s+u,p+=h>>>16,h&=65535,p+=o+c,d+=p>>>16,p&=65535,d+=r+a,l+=d>>>16,d&=65535,l+=n+i,l&=65535,e[0]=l<<16|d,e[1]=p<<16|h}function Qt(e,t){var n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,s=e[1]&65535,i=t[0]>>>16,a=t[0]&65535,c=t[1]>>>16,u=t[1]&65535,l=0,d=0,p=0,h=0;h+=s*u,p+=h>>>16,h&=65535,p+=o*u,d+=p>>>16,p&=65535,p+=s*c,d+=p>>>16,p&=65535,d+=r*u,l+=d>>>16,d&=65535,d+=o*c,l+=d>>>16,d&=65535,d+=s*a,l+=d>>>16,d&=65535,l+=n*u+r*c+o*a+s*i,l&=65535,e[0]=l<<16|d,e[1]=p<<16|h}function Tr(e,t){var n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function Wt(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function dt(e,t){e[0]^=t[0],e[1]^=t[1]}var Lm=[4283543511,3981806797],Fm=[3301882366,444984403];function lu(e){var t=[0,e[0]>>>1];dt(e,t),Qt(e,Lm),t[1]=e[0]>>>1,dt(e,t),Qt(e,Fm),t[1]=e[0]>>>1,dt(e,t)}var Lo=[2277735313,289559509],Fo=[1291169091,658871167],du=[0,5],Vm=[0,1390208809],zm=[0,944331445];function $m(e,t){var n=Dm(e);t=t||0;var r=[0,n.length],o=r[1]%16,s=r[1]-o,i=[0,t],a=[0,t],c=[0,0],u=[0,0],l;for(l=0;l<s;l=l+16)c[0]=n[l+4]|n[l+5]<<8|n[l+6]<<16|n[l+7]<<24,c[1]=n[l]|n[l+1]<<8|n[l+2]<<16|n[l+3]<<24,u[0]=n[l+12]|n[l+13]<<8|n[l+14]<<16|n[l+15]<<24,u[1]=n[l+8]|n[l+9]<<8|n[l+10]<<16|n[l+11]<<24,Qt(c,Lo),Tr(c,31),Qt(c,Fo),dt(i,c),Tr(i,27),jn(i,a),Qt(i,du),jn(i,Vm),Qt(u,Fo),Tr(u,33),Qt(u,Lo),dt(a,u),Tr(a,31),jn(a,i),Qt(a,du),jn(a,zm);c[0]=0,c[1]=0,u[0]=0,u[1]=0;var d=[0,0];switch(o){case 15:d[1]=n[l+14],Wt(d,48),dt(u,d);case 14:d[1]=n[l+13],Wt(d,40),dt(u,d);case 13:d[1]=n[l+12],Wt(d,32),dt(u,d);case 12:d[1]=n[l+11],Wt(d,24),dt(u,d);case 11:d[1]=n[l+10],Wt(d,16),dt(u,d);case 10:d[1]=n[l+9],Wt(d,8),dt(u,d);case 9:d[1]=n[l+8],dt(u,d),Qt(u,Fo),Tr(u,33),Qt(u,Lo),dt(a,u);case 8:d[1]=n[l+7],Wt(d,56),dt(c,d);case 7:d[1]=n[l+6],Wt(d,48),dt(c,d);case 6:d[1]=n[l+5],Wt(d,40),dt(c,d);case 5:d[1]=n[l+4],Wt(d,32),dt(c,d);case 4:d[1]=n[l+3],Wt(d,24),dt(c,d);case 3:d[1]=n[l+2],Wt(d,16),dt(c,d);case 2:d[1]=n[l+1],Wt(d,8),dt(c,d);case 1:d[1]=n[l],dt(c,d),Qt(c,Lo),Tr(c,31),Qt(c,Fo),dt(i,c)}return dt(i,r),dt(a,r),jn(i,a),jn(a,i),lu(i),lu(a),jn(i,a),jn(a,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}function jm(e){var t;return Si({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
|
|
3
|
-
`)},e)}function Hm(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Um(e){return typeof e!="function"}function Bm(e,t){var n=Qr(new Promise(function(r){var o=Date.now();au(e.bind(null,t),function(){for(var s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];var a=Date.now()-o;if(!s[0])return r(function(){return{error:s[1],duration:a}});var c=s[1];if(Um(c))return r(function(){return{value:c,duration:a}});r(function(){return new Promise(function(u){var l=Date.now();au(c,function(){for(var d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];var h=a+Date.now()-l;if(!d[0])return u({error:d[1],duration:h});u({value:d[1],duration:h})})})})})}));return function(){return n.then(function(o){return o()})}}function Wm(e,t,n,r){var o=Object.keys(e).filter(function(i){return Mm(n,i)}),s=Qr(cu(o,function(i){return Bm(e[i],t)},r));return function(){return pn(this,void 0,void 0,function(){var a,c,u,l,d;return hn(this,function(p){switch(p.label){case 0:return[4,s];case 1:return a=p.sent(),[4,cu(a,function(h){return Qr(h())},r)];case 2:return c=p.sent(),[4,Promise.all(c)];case 3:for(u=p.sent(),l={},d=0;d<o.length;++d)l[o[d]]=u[d];return[2,l]}})})}}function fu(){var e=window,t=navigator;return Nt(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Zm(){var e=window,t=navigator;return Nt(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!fu()}function eo(){var e=window,t=navigator;return Nt(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function cn(){var e=window,t=navigator;return Nt(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function xi(){var e=window,t=e.HTMLElement,n=e.Document;return Nt(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function to(){var e=window;return Hm(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function pu(){var e,t,n=window;return Nt(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Gm(){var e=window;return Nt([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Ym(){var e=window,t=e.URLPattern;return Nt(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Xm(){var e=window;return Nt(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function no(){var e=window,t=navigator,n=e.CSS,r=e.HTMLButtonElement;return Nt([!("getStorageUpdates"in t),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function qm(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return Nt(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function Km(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Jm(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Ci(){var e=eo(),t=pu(),n=window,r=navigator,o="connection";return e?Nt([!("SharedWorker"in n),r[o]&&"ontypechange"in r[o],!("sinkId"in new Audio)])>=2:t?Nt(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function Qm(){var e=navigator,t=window,n=Audio.prototype,r=t.visualViewport;return Nt(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function eg(){return rg()?-4:tg()}function tg(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(ng())return-1;var n=4500,r=5e3,o=new t(1,r,44100),s=o.createOscillator();s.type="triangle",s.frequency.value=1e4;var i=o.createDynamicsCompressor();i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.25,s.connect(i),i.connect(o.destination),s.start(0);var a=og(o),c=a[0],u=a[1],l=Qr(c.then(function(d){return sg(d.getChannelData(0).subarray(n))},function(d){if(d.name==="timeout"||d.name==="suspended")return-3;throw d}));return function(){return u(),l}}function ng(){return cn()&&!xi()&&!Xm()}function rg(){return cn()&&no()&&to()||eo()&&Qm()&&Ym()}function og(e){var t=3,n=500,r=500,o=5e3,s=function(){},i=new Promise(function(a,c){var u=!1,l=0,d=0;e.oncomplete=function(m){return a(m.renderedBuffer)};var p=function(){setTimeout(function(){return c(hu("timeout"))},Math.min(r,d+o-Date.now()))},h=function(){try{var m=e.startRendering();switch(iu(m)&&Qr(m),e.state){case"running":d=Date.now(),u&&p();break;case"suspended":document.hidden||l++,u&&l>=t?c(hu("suspended")):setTimeout(h,n);break}}catch(g){c(g)}};h(),s=function(){u||(u=!0,d>0&&p())}});return[i,s]}function sg(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function hu(e){var t=new Error(e);return t.name=e,t}function mu(e,t,n){var r,o,s;return n===void 0&&(n=50),pn(this,void 0,void 0,function(){var i,a;return hn(this,function(c){switch(c.label){case 0:i=document,c.label=1;case 1:return i.body?[3,3]:[4,Do(n)];case 2:return c.sent(),[3,1];case 3:a=i.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise(function(u,l){var d=!1,p=function(){d=!0,u()},h=function(v){d=!0,l(v)};a.onload=p,a.onerror=h;var m=a.style;m.setProperty("display","block","important"),m.position="absolute",m.top="0",m.left="0",m.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",i.body.appendChild(a);var g=function(){var v,y;d||(((y=(v=a.contentWindow)===null||v===void 0?void 0:v.document)===null||y===void 0?void 0:y.readyState)==="complete"?p():setTimeout(g,10))};g()})];case 5:c.sent(),c.label=6;case 6:return!((o=(r=a.contentWindow)===null||r===void 0?void 0:r.document)===null||o===void 0)&&o.body?[3,8]:[4,Do(n)];case 7:return c.sent(),[3,6];case 8:return[4,e(a,a.contentWindow)];case 9:return[2,c.sent()];case 10:return(s=a.parentNode)===null||s===void 0||s.removeChild(a),[7];case 11:return[2]}})})}function ig(e){for(var t=Am(e),n=t[0],r=t[1],o=document.createElement(n??"div"),s=0,i=Object.keys(r);s<i.length;s++){var a=i[s],c=r[a].join(" ");a==="style"?ag(o.style,c):o.setAttribute(a,c)}return o}function ag(e,t){for(var n=0,r=t.split(";");n<r.length;n++){var o=r[n],s=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(o);if(s){var i=s[1],a=s[2],c=s[4];e.setProperty(i,a,c||"")}}}function cg(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}var ug="mmMwWLliI0O&1",lg="48px",Or=["monospace","sans-serif","serif"],gu=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function dg(){var e=this;return mu(function(t,n){var r=n.document;return pn(e,void 0,void 0,function(){var o,s,i,a,c,u,l,d,p,h,m,g;return hn(this,function(v){for(o=r.body,o.style.fontSize=lg,s=r.createElement("div"),s.style.setProperty("visibility","hidden","important"),i={},a={},c=function(y){var C=r.createElement("span"),S=C.style;return S.position="absolute",S.top="0",S.left="0",S.fontFamily=y,C.textContent=ug,s.appendChild(C),C},u=function(y,C){return c("'".concat(y,"',").concat(C))},l=function(){return Or.map(c)},d=function(){for(var y={},C=function(x){y[x]=Or.map(function(T){return u(x,T)})},S=0,E=gu;S<E.length;S++){var b=E[S];C(b)}return y},p=function(y){return Or.some(function(C,S){return y[S].offsetWidth!==i[C]||y[S].offsetHeight!==a[C]})},h=l(),m=d(),o.appendChild(s),g=0;g<Or.length;g++)i[Or[g]]=h[g].offsetWidth,a[Or[g]]=h[g].offsetHeight;return[2,gu.filter(function(y){return p(m[y])})]})})})}function fg(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var r=e[n];if(r){for(var o=[],s=0;s<r.length;++s){var i=r[s];o.push({type:i.type,suffixes:i.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:o})}}return t}}function pg(){return hg(Sg())}function hg(e){var t,n=!1,r,o,s=mg(),i=s[0],a=s[1];return gg(i,a)?(n=yg(a),e?r=o="skipped":(t=vg(i,a),r=t[0],o=t[1])):r=o="unsupported",{winding:n,geometry:r,text:o}}function mg(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function gg(e,t){return!!(t&&e.toDataURL)}function yg(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function vg(e,t){bg(e,t);var n=Ti(e),r=Ti(e);if(n!==r)return["unstable","unstable"];wg(e,t);var o=Ti(e);return[o,n]}function bg(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat("😃");t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function wg(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var o=r[n],s=o[0],i=o[1],a=o[2];t.fillStyle=s,t.beginPath(),t.arc(i,a,40,0,Math.PI*2,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Ti(e){return e.toDataURL()}function Sg(){return cn()&&no()&&to()}function Eg(){var e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=Ei(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}var r="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:r}}function xg(){return navigator.oscpu}function Cg(){var e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))eo()&&Gm()||t.push(e.languages);else if(typeof e.languages=="string"){var r=e.languages;r&&t.push(r.split(","))}return t}function Tg(){return window.screen.colorDepth}function Og(){return In(an(navigator.deviceMemory),void 0)}function Pg(){if(!(cn()&&no()&&to()))return _g()}function _g(){var e=screen,t=function(r){return In(Ei(r),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n}var Ig=2500,kg=10,Vo,Oi;function Rg(){if(Oi===void 0){var e=function(){var t=Pi();_i(t)?Oi=setTimeout(e,Ig):(Vo=t,Oi=void 0)};e()}}function Ng(){var e=this;return Rg(),function(){return pn(e,void 0,void 0,function(){var t;return hn(this,function(n){switch(n.label){case 0:return t=Pi(),_i(t)?Vo?[2,ou([],Vo,!0)]:Km()?[4,Jm()]:[3,2]:[3,2];case 1:n.sent(),t=Pi(),n.label=2;case 2:return _i(t)||(Vo=t),[2,t]}})})}}function Mg(){var e=this;if(cn()&&no()&&to())return function(){return Promise.resolve(void 0)};var t=Ng();return function(){return pn(e,void 0,void 0,function(){var n,r;return hn(this,function(o){switch(o.label){case 0:return[4,t()];case 1:return n=o.sent(),r=function(s){return s===null?null:uu(s,kg)},[2,[r(n[0]),r(n[1]),r(n[2]),r(n[3])]]}})})}}function Pi(){var e=screen;return[In(an(e.availTop),null),In(an(e.width)-an(e.availWidth)-In(an(e.availLeft),0),null),In(an(e.height)-an(e.availHeight)-In(an(e.availTop),0),null),In(an(e.availLeft),null)]}function _i(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Ag(){return In(Ei(navigator.hardwareConcurrency),void 0)}function Dg(){var e,t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){var n=new t().resolvedOptions().timeZone;if(n)return n}var r=-Lg();return"UTC".concat(r>=0?"+":"").concat(r)}function Lg(){var e=new Date().getFullYear();return Math.max(an(new Date(e,0,1).getTimezoneOffset()),an(new Date(e,6,1).getTimezoneOffset()))}function Fg(){try{return!!window.sessionStorage}catch{return!0}}function Vg(){try{return!!window.localStorage}catch{return!0}}function zg(){if(!(fu()||Zm()))try{return!!window.indexedDB}catch{return!0}}function $g(){return!!window.openDatabase}function jg(){return navigator.cpuClass}function Hg(){var e=navigator.platform;return e==="MacIntel"&&cn()&&!xi()?qm()?"iPad":"iPhone":e}function Ug(){return navigator.vendor||""}function Bg(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var r=n[t],o=window[r];o&&typeof o=="object"&&e.push(r)}return e.sort()}function Wg(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function Zg(){var e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Gg(e){var t=e===void 0?{}:e,n=t.debug;return pn(this,void 0,void 0,function(){var r,o,s,i,a,c;return hn(this,function(u){switch(u.label){case 0:return Yg()?(r=Zg(),o=Object.keys(r),s=(c=[]).concat.apply(c,o.map(function(l){return r[l]})),[4,Xg(s)]):[2,void 0];case 1:return i=u.sent(),n&&qg(r,i),a=o.filter(function(l){var d=r[l],p=Nt(d.map(function(h){return i[h]}));return p>d.length*.6}),a.sort(),[2,a]}})})}function Yg(){return cn()||Ci()}function Xg(e){var t;return pn(this,void 0,void 0,function(){var n,r,o,s,c,i,a,c;return hn(this,function(u){switch(u.label){case 0:for(n=document,r=n.createElement("div"),o=new Array(e.length),s={},yu(r),c=0;c<e.length;++c)i=ig(e[c]),i.tagName==="DIALOG"&&i.show(),a=n.createElement("div"),yu(a),a.appendChild(i),r.appendChild(a),o[c]=i;u.label=1;case 1:return n.body?[3,3]:[4,Do(50)];case 2:return u.sent(),[3,1];case 3:n.body.appendChild(r);try{for(c=0;c<e.length;++c)o[c].offsetParent||(s[e[c]]=!0)}finally{(t=r.parentNode)===null||t===void 0||t.removeChild(r)}return[2,s]}})})}function yu(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function qg(e,t){for(var n="DOM blockers debug:\n```",r=0,o=Object.keys(e);r<o.length;r++){var s=o[r];n+=`
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`._Viewport_ai81v_1{position:fixed;width:100%;max-width:300px;margin:0 auto;top:1rem;right:0;left:0;bottom:auto;z-index:999}._Toast_ai81v_14{--gap: .75rem;--peek: .75rem;--scale: max(0, 1 - (var(--toast-index) * .1)) ;--shrink: calc(1 - var(--scale));--height: var(--toast-frontmost-height, var(--toast-height));--offset-y: calc( var(--toast-offset-y) + (var(--toast-index) * var(--gap)) + var(--toast-swipe-movement-y) );position:absolute;box-sizing:border-box;background:var(--color-gray-50);color:var(--color-gray-900);border:1px solid var(--color-gray-200);padding:1rem;width:100%;box-shadow:0 2px 10px #0000001a;background-clip:padding-box;border-radius:.5rem;transform-origin:top center;top:0;left:0;right:0;margin:0 auto;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:transform .5s cubic-bezier(.22,1,.36,1),opacity .5s,height .15s;cursor:default;z-index:calc(1000 - var(--toast-index));height:var(--height);transform:translate(var(--toast-swipe-movement-x)) translateY(calc(var(--toast-swipe-movement-y) + (var(--toast-index) * var(--peek)) + (var(--shrink) * var(--height)))) scale(var(--scale))}._Toast_ai81v_14[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--offset-y));height:var(--toast-height)}._Toast_ai81v_14[data-starting-style],._Toast_ai81v_14[data-ending-style]{transform:translateY(-150%)}._Toast_ai81v_14[data-limited],._Toast_ai81v_14[data-ending-style]{opacity:0}._Toast_ai81v_14[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 150%))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 150%)) translateY(var(--offset-y))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 150%)) translateY(var(--offset-y))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 150%))}._Toast_ai81v_14:after{content:"";position:absolute;width:100%;bottom:100%;left:0;height:calc(var(--gap) + 1px)}._Content_ai81v_99{overflow:hidden;transition:opacity .25s}._Content_ai81v_99[data-behind]{opacity:0}._Content_ai81v_99[data-expanded]{opacity:1}._Title_ai81v_112{font-weight:500;font-size:.975rem;line-height:1.25rem;margin:0}._Description_ai81v_119{font-size:.925rem;line-height:1.25rem;margin:0}._Close_ai81v_125{position:absolute;top:.5rem;right:.5rem;padding:0;border:none;background:transparent;width:1.25rem;height:1.25rem;display:flex;align-items:center;justify-content:center;border-radius:.25rem}._Close_ai81v_125:hover{background-color:var(--color-gray-100)}._Icon_ai81v_144{width:1rem;height:1rem}._trigger_1e3h3_1{display:flex;height:100%;width:4rem;align-items:center;justify-content:center;gap:.25rem;border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));outline:2px solid transparent;outline-offset:2px}._popup_1e3h3_5{width:20rem;overflow-y:auto;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);max-height:var(--available-height);transform-origin:var(--transform-origin);transition:transform .2s ease,opacity .2s ease}._popup_1e3h3_5[data-starting-style],._popup_1e3h3_5[data-ending-style]{opacity:0;transform:scale(.95)}._popup_1e3h3_5[data-side=none][data-starting-style]{transform:scale(1);opacity:1}._item_1e3h3_24{display:grid;min-width:var(--anchor-width);cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;grid-template-columns:.75rem 1fr;align-items:center;gap:.5rem;border-bottom-width:1px;padding:.75rem 1rem;font-size:.875rem;line-height:1.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}._item_1e3h3_24:last-child{border-bottom-width:0px}._item_1e3h3_24:first-of-type{border-top-left-radius:1rem;border-top-right-radius:1rem}._item_1e3h3_24:last-of-type{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}._item_1e3h3_24[data-highlighted]{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(120 155 245 / var(--tw-text-opacity, 1))}._indicator_1e3h3_40{grid-column-start:1}._itemText_1e3h3_44{grid-column-start:2;display:flex;justify-content:space-between}._itemCode_1e3h3_48{font-weight:500}._itemLabel_1e3h3_52{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._uidGet_os9yc_1{width:80vw;max-width:400px;background-size:cover;background-position:center}._mailCodeGet_os9yc_5{width:100%;background-size:cover;background-position:center}.game-5174 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626145347721513.png);aspect-ratio:553 / 428}.game-5174 ._mailCodeGet_os9yc_5{aspect-ratio:680/1096}.game-5174 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626151631191610.png)}@media(min-width:1024px){.game-5174 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5174 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626144535531913.png)}}.game-5273 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626142807783110.png);aspect-ratio:553 / 428}.game-5273 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1096;background-image:url(https://h5.sdk.mobileztgame.com/dist/role-tip-mobile.png)}@media(min-width:1024px){.game-5273 ._mailCodeGet_os9yc_5{aspect-ratio:1220/654}}@media(min-width:1024px){.game-5273 ._mailCodeGet_os9yc_5{background-image:url(https://h5.sdk.mobileztgame.com/dist/role-tip-pc.png)}}.game-5242 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624152217734019.png);aspect-ratio:596 / 266}.game-5242 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1094;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624132201121910.png)}@media(min-width:1024px){.game-5242 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5242 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624143628881023.png)}}.game-5234 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811141956691626.png);aspect-ratio:740 / 290}.game-5234 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1094;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811142113377920.png)}@media(min-width:1024px){.game-5234 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5234 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811142146601319.png)}}.game-5199 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319163303381734.png);aspect-ratio:541 / 431;border-radius:10px}.game-5199 ._mailCodeGet_os9yc_5{aspect-ratio:353 / 561;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319160000001714.png)}@media(min-width:1024px){.game-5199 ._mailCodeGet_os9yc_5{aspect-ratio:677/323}}@media(min-width:1024px){.game-5199 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319153435571035.png)}}.game-5199 input{color:#dfd9c6}.game-5199 input::-moz-placeholder{color:#70625e}.game-5199 input::placeholder{color:#70625e}.game-5199 button{color:#dfd9c6}.game-5199 ._uidGetPopup_os9yc_79{background-color:#5d5655;padding:10px}.game-5199 ._uidGetArrow_os9yc_83{color:#5d5655}.game-5199 ._inputControl_os9yc_86{height:40px}.game-5199 ._form_os9yc_89>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}._quickLogin_1ibz1_1{width:100%}._quickAccounts_1ibz1_5{position:relative}._selectedAccount_1ibz1_9{display:flex;align-items:center;justify-content:space-between;border:1px solid #ddd;border-radius:9999px;height:44px;padding:0 20px;background:#fff;cursor:pointer}._accountInfo_1ibz1_21{display:flex;flex-direction:column}._accountName_1ibz1_26{font-size:15px;color:#333}._arrow_1ibz1_31{size:16px;color:#999;transition:transform .2s}._arrowRotate_1ibz1_37{transform:rotate(180deg)}._accountList_1ibz1_41{position:absolute;top:50px;left:0;right:0;z-index:10}._listScroll_1ibz1_49{max-height:200px;border:1px solid #ddd;border-radius:12px;overflow-y:auto;background:#fff;box-shadow:0 4px 12px #0000001a}._accountItem_1ibz1_58{display:flex;align-items:center;justify-content:space-between;padding:0 20px;height:44px;gap:12px;border-bottom:1px solid #f5f5f5;cursor:pointer}._accountItem_1ibz1_58:last-child{border-bottom:none}._accountItem_1ibz1_58:hover{background-color:#f9f9f9}._accountItem_1ibz1_58._active_1ibz1_77{background-color:#f0f4ff}._accountItem_1ibz1_58._active_1ibz1_77 ._itemName_1ibz1_81{color:#497efe;font-weight:500}._itemInfo_1ibz1_86{display:flex;flex-direction:column;flex:1}._itemName_1ibz1_81{font-size:14px;color:#333}._deleteBtn_1ibz1_97{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:background-color .2s}._deleteBtn_1ibz1_97:hover{background-color:#fee2e2}.game-5199 ._modal_1pbx2_2{background:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319165656615516.png) no-repeat center center;background-size:100% 100%;padding:60px 35px 30px}.game-5199 ._close_1pbx2_8{top:10px;right:0;background:url(https://ipay.ztgame.com/png/button_close.hzBHa9.png) no-repeat center center;background-size:100% 100%;width:57px;height:60px}.game-5199 ._close_1pbx2_8 svg{opacity:0}.game-5199 ._close_1pbx2_8:hover{background-color:transparent}._autoLoginHint_h58ls_1{position:fixed;top:16px;left:50%;transform:translate(-50%);width:80%;max-width:400px;height:48px;background-color:#000c;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 20px;z-index:9999;font-size:14px;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-radius:24px;box-shadow:0 8px 20px #0000004d}._left_h58ls_22{display:flex;align-items:center;gap:8px}._loading_h58ls_28{width:18px;height:18px;border:2px solid rgba(255,255,255,.2);border-top-color:#fff;border-radius:50%;animation:_spin_h58ls_1 .8s cubic-bezier(.5,.1,.4,.9) infinite}._switchBtn_h58ls_37{color:#a5a7ff;cursor:pointer;padding:6px 12px;background:#787bf426;border:none;font-size:13px;font-weight:600;border-radius:12px;transition:all .2s ease}._switchBtn_h58ls_37:hover{background:#787bf44d;color:#fff}@keyframes _spin_h58ls_1{to{transform:rotate(360deg)}}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input::-webkit-input-placeholder{color:#a9a9a9}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.inset-0{inset:0}.bottom-0{bottom:0}.left-0{left:0}.left-1\\/2{left:50%}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-1\\/2{top:50%}.top-4{top:1rem}.z-\\[1\\]{z-index:1}.z-\\[990\\]{z-index:990}.z-\\[991\\]{z-index:991}.z-\\[992\\]{z-index:992}.z-\\[999\\]{z-index:999}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.mx-auto{margin-left:auto;margin-right:auto}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.-mt-1\\.5{margin-top:-.375rem}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.aspect-\\[240\\/85\\]{aspect-ratio:240/85}.size-3{width:.75rem;height:.75rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-4{height:1rem}.h-4\\/6{height:66.666667%}.h-7{height:1.75rem}.h-9{height:2.25rem}.h-\\[70vh\\]{height:70vh}.h-full{height:100%}.max-h-\\[var\\(--available-height\\)\\]{max-height:var(--available-height)}.w-0{width:0px}.w-12{width:3rem}.w-16{width:4rem}.w-32{width:8rem}.w-80{width:20rem}.w-96{width:24rem}.w-\\[300px\\]{width:300px}.w-\\[320px\\]{width:320px}.w-\\[400px\\]{width:400px}.w-\\[90vw\\]{width:90vw}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[var\\(--anchor-width\\)\\]{min-width:var(--anchor-width)}.max-w-64{max-width:16rem}.max-w-\\[80vw\\]{max-width:80vw}.max-w-\\[calc\\(100vw-3rem\\)\\]{max-width:calc(100vw - 3rem)}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.origin-\\[var\\(--transform-origin\\)\\]{transform-origin:var(--transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-\\[0\\.75rem_1fr\\]{grid-template-columns:.75rem 1fr}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-\\[var\\(--jssdk-input-border-color\\)\\]{border-color:var(--jssdk-input-border-color)}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.\\!bg-\\[var\\(--jssdk-backdrop-bg-color\\,rgba\\(0\\,0\\,0\\,0\\.7\\)\\)\\]{background-color:var(--jssdk-backdrop-bg-color,rgba(0,0,0,.7))!important}.bg-\\[canvas\\]{background-color:canvas}.bg-\\[var\\(--jssdk-icon-color\\)\\]{background-color:var(--jssdk-icon-color)}.bg-\\[var\\(--jssdk-input-bg-color\\)\\]{background-color:var(--jssdk-input-bg-color)}.bg-black\\/20{background-color:#0003}.bg-black\\/70{background-color:#000000b3}.bg-black\\/80{background-color:#000c}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-inherit{background-color:inherit}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\\[\\#497efe\\]{--tw-gradient-from: #497efe var(--tw-gradient-from-position);--tw-gradient-to: rgb(73 126 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-\\[\\#947afa\\]{--tw-gradient-to: #947afa var(--tw-gradient-to-position)}.fill-\\[canvas\\]{fill:canvas}.fill-current{fill:currentColor}.fill-gray-200{fill:#e5e7eb}.fill-gray-400{fill:#9ca3af}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-\\[11px\\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-\\[\\#f59e9e\\]{--tw-text-opacity: 1;color:rgb(245 158 158 / var(--tw-text-opacity, 1))}.text-\\[var\\(--jssdk-primary-color\\)\\]{color:var(--jssdk-primary-color)}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/80{color:#fffc}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-\\[transform\\,scale\\,opacity\\]{transition-property:transform,scale,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.\\[transform\\:translateY\\(var\\(--drawer-swipe-movement-y\\)\\)\\]{transform:translateY(var(--drawer-swipe-movement-y))}.placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:left-0:before{content:var(--tw-content);left:0}.before\\:top-\\[-100\\%\\]:before{content:var(--tw-content);top:-100%}.before\\:h-full:before{content:var(--tw-content);height:100%}.before\\:w-full:before{content:var(--tw-content);width:100%}.before\\:content-\\[\\'\\'\\]:before{--tw-content: "";content:var(--tw-content)}.last\\:border-b-0:last-child{border-bottom-width:0px}.focus-within\\:border-\\[\\#787bf4\\]:focus-within{--tw-border-opacity: 1;border-color:rgb(120 123 244 / var(--tw-border-opacity, 1))}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\\:text-\\[var\\(--jssdk-primary-color\\)\\]:hover{color:var(--jssdk-primary-color)}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-2:focus{outline-width:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.active\\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:brightness-90:active{--tw-brightness: brightness(.9);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.enabled\\:text-\\[var\\(--jssdk-primary-color\\)\\]:enabled{color:var(--jssdk-primary-color)}.enabled\\:hover\\:bg-\\[var\\(--jssdk-primary-color\\)\\]:hover:enabled{background-color:var(--jssdk-primary-color)}.enabled\\:hover\\:text-\\[var\\(--jssdk-primary-foregroud-color\\)\\]:hover:enabled{color:var(--jssdk-primary-foregroud-color)}.enabled\\:hover\\:text-white:hover:enabled{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:grayscale:disabled{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.data-\\[direction\\=down\\]\\:bottom-0[data-direction=down]{bottom:0}.data-\\[side\\=bottom\\]\\:top-\\[-8px\\][data-side=bottom]{top:-8px}.data-\\[side\\=left\\]\\:right-\\[-13px\\][data-side=left]{right:-13px}.data-\\[side\\=right\\]\\:left-\\[-13px\\][data-side=right]{left:-13px}.data-\\[side\\=top\\]\\:bottom-\\[-8px\\][data-side=top]{bottom:-8px}.data-\\[ending-style\\]\\:translate-y-full[data-ending-style],.data-\\[starting-style\\]\\:translate-y-full[data-starting-style]{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:rotate-90[data-side=left]{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=right\\]\\:-rotate-90[data-side=right]{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:rotate-180[data-side=top]{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[ending-style\\]\\:scale-90[data-ending-style]{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:scale-100[data-starting-style][data-side=none]{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[starting-style\\]\\:scale-90[data-starting-style]{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[checked\\]\\:border-\\[var\\(--jssdk-primary-color\\)\\][data-checked]{border-color:var(--jssdk-primary-color)}.data-\\[unchecked\\]\\:border-\\[var\\(--jssdk-input-border-color\\)\\][data-unchecked]{border-color:var(--jssdk-input-border-color)}.data-\\[unchecked\\]\\:border-gray-300[data-unchecked]{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.data-\\[highlighted\\]\\:bg-gray-50[data-highlighted]{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.data-\\[highlighted\\]\\:text-\\[\\#789bf5\\][data-highlighted]{--tw-text-opacity: 1;color:rgb(120 155 245 / var(--tw-text-opacity, 1))}.data-\\[ending-style\\]\\:opacity-0[data-ending-style]{opacity:0}.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:opacity-100[data-starting-style][data-side=none]{opacity:1}.data-\\[starting-style\\]\\:opacity-0[data-starting-style]{opacity:0}.data-\\[ending-style\\]\\:transition-none[data-ending-style],.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:transition-none[data-starting-style][data-side=none]{transition-property:none}.data-\\[direction\\=down\\]\\:before\\:bottom-\\[-100\\%\\][data-direction=down]:before{content:var(--tw-content);bottom:-100%}.group[data-focused] .group-data-\\[focused\\]\\:border-\\[var\\(--jssdk-primary-color\\)\\]{border-color:var(--jssdk-primary-color)}.group[data-focused] .group-data-\\[focused\\]\\:shadow-\\[0_0_6px_color-mix\\(in_srgb\\,var\\(--jssdk-primary-color\\)\\,transparent_80\\%\\)\\]{--tw-shadow: 0 0 6px color-mix(in srgb,var(--jssdk-primary-color),transparent 80%);--tw-shadow-colored: 0 0 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\\:fill-gray-300:is(.dark *){fill:#d1d5db}.dark\\:fill-none:is(.dark *){fill:none}.dark\\:opacity-70:is(.dark *){opacity:.7}.dark\\:shadow-none:is(.dark *){--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\\:-outline-offset-1:is(.dark *){outline-offset:-1px}.dark\\:outline-gray-300:is(.dark *){outline-color:#d1d5db}@media(min-width:768px){.md\\:size-5{width:1.25rem;height:1.25rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media(min-width:1024px){.lg\\:size-6{width:1.5rem;height:1.5rem}.lg\\:w-4\\/5{width:80%}.lg\\:w-\\[60vw\\]{width:60vw}.lg\\:max-w-5xl{max-width:64rem}.lg\\:text-2xl{font-size:1.5rem;line-height:2rem}}`)),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(yt,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react-dom/client","react","react-dom"],w):(yt=typeof globalThis<"u"?globalThis:yt||self,w(yt.SDK={},yt.jsxRuntime,yt.ReactDOM,yt.React,yt.ReactDOM))})(this,(function(yt,w,ah,re,ch){"use strict";function uc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const p=uc(re),Kt=uc(ch);var qr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ro=typeof window>"u"||"Deno"in globalThis;function Jt(){}function lh(e,t){return typeof e=="function"?e(t):e}function uh(e){return typeof e=="number"&&e>=0&&e!==1/0}function fh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ni(e,t){return typeof e=="function"?e(t):e}function dh(e,t){return typeof e=="function"?e(t):e}function fc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==ri(i,t.options))return!1}else if(!Kr(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function dc(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(tr(t.options.mutationKey)!==tr(s))return!1}else if(!Kr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ri(e,t){return(t?.queryKeyHashFn||tr)(e)}function tr(e){return JSON.stringify(e,(t,n)=>oi(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Kr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Kr(e[n],t[n])):!1}function pc(e,t){if(e===t)return e;const n=hc(e)&&hc(t);if(n||oi(e)&&oi(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{},c=new Set(r);let l=0;for(let u=0;u<i;u++){const f=n?u:s[u];(!n&&c.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,l++):(a[f]=pc(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function ph(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function hc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function oi(e){if(!mc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!mc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function mc(e){return Object.prototype.toString.call(e)==="[object Object]"}function hh(e){return new Promise(t=>{setTimeout(t,e)})}function mh(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?pc(e,t):t}function gh(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function yh(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var si=Symbol();function gc(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===si?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function vh(e,t){return typeof e=="function"?e(...t):!!e}var bh=class extends qr{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ro&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},yc=new bh,wh=class extends qr{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ro&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Mo=new wh;function Sh(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function xh(e){return Math.min(1e3*2**e,3e4)}function vc(e){return(e??"online")==="online"?Mo.isOnline():!0}var bc=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ii(e){return e instanceof bc}function wc(e){let t=!1,n=0,r=!1,o;const s=Sh(),i=y=>{r||(d(new bc(y)),e.abort?.())},a=()=>{t=!0},c=()=>{t=!1},l=()=>yc.isFocused()&&(e.networkMode==="always"||Mo.isOnline())&&e.canRun(),u=()=>vc(e.networkMode)&&e.canRun(),f=y=>{r||(r=!0,e.onSuccess?.(y),o?.(),s.resolve(y))},d=y=>{r||(r=!0,e.onError?.(y),o?.(),s.reject(y))},h=()=>new Promise(y=>{o=v=>{(r||l())&&y(v)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),m=()=>{if(r)return;let y;const v=n===0?e.initialPromise:void 0;try{y=v??e.fn()}catch(g){y=Promise.reject(g)}Promise.resolve(y).then(f).catch(g=>{if(r)return;const E=e.retry??(Ro?0:3),C=e.retryDelay??xh,S=typeof C=="function"?C(n,g):C,b=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,g);if(t||!b){d(g);return}n++,e.onFail?.(n,g),hh(S).then(()=>l()?void 0:h()).then(()=>{t?d(g):m()})})};return{promise:s,cancel:i,continue:()=>(o?.(),s),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?m():h().then(m),s)}}var Eh=e=>setTimeout(e,0);function Ch(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=Eh;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Tt=Ch(),Sc=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uh(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ro?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Ph=class extends Sc{#e;#t;#n;#r;#o;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=kh(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#o?.promise}setOptions(e){this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=mh(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#o?.promise;return this.#o?.cancel(e),t?t.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>dh(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===si||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ni(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!fh(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#o&&(this.#a?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(l=>l.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const c=gc(this.options,t),u=(()=>{const f={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(f),f})();return this.#a=!1,this.options.persister?this.options.persister(c,u,this):c(u)},i=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:o};return r(c),c})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta});const a=c=>{ii(c)&&c.silent||this.#s({type:"error",error:c}),ii(c)||(this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this)),this.scheduleGc()};return this.#o=wc({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:c=>{if(c===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(l){a(l);return}this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,l)=>{this.#s({type:"failed",failureCount:c,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#o.start()}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Th(n.data,this.options),fetchMeta:e.meta??null};case"success":return this.#t=void 0,{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return ii(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Tt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Th(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function kh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ih=class extends qr{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??ri(r,t);let s=this.get(o);return s||(s=new Ph({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Tt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>fc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>fc(e,n)):t}notify(e){Tt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Tt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Tt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Oh=class extends Sc{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||xc(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})};this.#n=wc({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(o,s)=>{this.#r({type:"failed",failureCount:o,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const n=this.state.status==="pending",r=!this.#n.canStart();try{if(n)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#t.config.onMutate?.(e,this);const s=await this.options.onMutate?.(e);s!==this.state.context&&this.#r({type:"pending",context:s,variables:e,isPaused:r})}const o=await this.#n.start();return await this.#t.config.onSuccess?.(o,e,this.state.context,this),await this.options.onSuccess?.(o,e,this.state.context),await this.#t.config.onSettled?.(o,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(o,null,e,this.state.context),this.#r({type:"success",data:o}),o}catch(o){try{throw await this.#t.config.onError?.(o,e,this.state.context,this),await this.options.onError?.(o,e,this.state.context),await this.#t.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,o,e,this.state.context),o}finally{this.#r({type:"error",error:o})}}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tt.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function xc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _h=class extends qr{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new Oh({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Ao(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ao(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ao(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Ao(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Tt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>dc(t,n))}findAll(e={}){return this.getAll().filter(t=>dc(e,t))}notify(e){Tt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Tt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Jt))))}};function Ao(e){return e.options.scope?.id}function Ec(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let u=!1;const f=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},d=gc(t.options,t.fetchOptions),h=async(m,y,v)=>{if(u)return Promise.reject();if(y==null&&m.pages.length)return Promise.resolve(m);const E=(()=>{const x={client:t.client,queryKey:t.queryKey,pageParam:y,direction:v?"backward":"forward",meta:t.options.meta};return f(x),x})(),C=await d(E),{maxPages:S}=t.options,b=v?yh:gh;return{pages:b(m.pages,C,S),pageParams:b(m.pageParams,y,S)}};if(o&&s.length){const m=o==="backward",y=m?Rh:Cc,v={pages:s,pageParams:i},g=y(r,v);a=await h(v,g,m)}else{const m=e??s.length;do{const y=c===0?i[0]??r.initialPageParam:Cc(r,a);if(c>0&&y==null)break;a=await h(a,y),c++}while(c<m)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Cc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Rh(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Mh=class{#e;#t;#n;#r;#o;#i;#a;#s;constructor(e={}){this.#e=e.queryCache||new Ih,this.#t=e.mutationCache||new _h,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=yc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Mo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ni(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,i=lh(t,s);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Tt.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Tt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Tt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Tt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Jt).catch(Jt)}invalidateQueries(e,t={}){return Tt.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Tt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Jt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(ni(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=Ec(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=Ec(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Mo.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(tr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Kr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(tr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Kr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ri(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===si&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ah=class extends qr{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),ph(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&tr(n.mutationKey)!==tr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#o(){const t=this.#n?.state??xc();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){Tt.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context;t?.type==="success"?(this.#r.onSuccess?.(t.data,n,r),this.#r.onSettled?.(t.data,null,n,r)):t?.type==="error"&&(this.#r.onError?.(t.error,n,r),this.#r.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#t)})})}},Pc=p.createContext(void 0),Dh=e=>{const t=p.useContext(Pc);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Nh=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(Pc.Provider,{value:e,children:t}));function sn(e,t){const n=Dh(),[r]=p.useState(()=>new Ah(n,e));p.useEffect(()=>{r.setOptions(e)},[r,e]);const o=p.useSyncExternalStore(p.useCallback(i=>r.subscribe(Tt.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=p.useCallback((i,a)=>{r.mutate(i,a).catch(Jt)},[r]);if(o.error&&vh(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var ai=function(){return ai=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ai.apply(this,arguments)};function pn(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{l(r.next(u))}catch(f){i(f)}}function c(u){try{l(r.throw(u))}catch(f){i(f)}}function l(u){u.done?s(u.value):o(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})}function hn(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(n=0)),n;)try{if(r=1,o&&(s=l[0]&2?o.return:l[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,l[1])).done)return s;switch(o=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,o=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1],s=l;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(l);break}s[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],o=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Fh(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function Tc(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var kc="4.6.2";function Do(e,t){return new Promise(function(n){return setTimeout(n,e,t)})}function Lh(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function zh(e,t){t===void 0&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise(function(r){return n.call(window,function(){return r()},{timeout:t})}):Do(Math.min(e,t))}function Ic(e){return!!e&&typeof e.then=="function"}function Oc(e,t){try{var n=e();Ic(n)?n.then(function(r){return t(!0,r)},function(r){return t(!1,r)}):t(!0,n)}catch(r){t(!1,r)}}function _c(e,t,n){return n===void 0&&(n=16),pn(this,void 0,void 0,function(){var r,o,s,i;return hn(this,function(a){switch(a.label){case 0:r=Array(e.length),o=Date.now(),s=0,a.label=1;case 1:return s<e.length?(r[s]=t(e[s],s),i=Date.now(),i>=o+n?(o=i,[4,Lh()]):[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return++s,[3,1];case 4:return[2,r]}})})}function Jr(e){return e.then(void 0,function(){}),e}function $h(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}function Vh(e,t){return!$h(e,t)}function ci(e){return parseInt(e)}function an(e){return parseFloat(e)}function In(e,t){return typeof e=="number"&&isNaN(e)?t:e}function Rt(e){return e.reduce(function(t,n){return t+(n?1:0)},0)}function Rc(e,t){if(t===void 0&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function jh(e){for(var t,n,r="Unexpected syntax '".concat(e,"'"),o=/^\s*([a-z-]*)(.*)$/i.exec(e),s=o[1]||void 0,i={},a=/([.:#][\w-]+|\[.+?\])/gi,c=function(d,h){i[d]=i[d]||[],i[d].push(h)};;){var l=a.exec(o[2]);if(!l)break;var u=l[0];switch(u[0]){case".":c("class",u.slice(1));break;case"#":c("id",u.slice(1));break;case"[":{var f=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(f)c(f[1],(n=(t=f[4])!==null&&t!==void 0?t:f[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[s,i]}function Hh(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>127)return new TextEncoder().encode(e);t[n]=r}return t}function jn(e,t){var n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,s=e[1]&65535,i=t[0]>>>16,a=t[0]&65535,c=t[1]>>>16,l=t[1]&65535,u=0,f=0,d=0,h=0;h+=s+l,d+=h>>>16,h&=65535,d+=o+c,f+=d>>>16,d&=65535,f+=r+a,u+=f>>>16,f&=65535,u+=n+i,u&=65535,e[0]=u<<16|f,e[1]=d<<16|h}function Qt(e,t){var n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,s=e[1]&65535,i=t[0]>>>16,a=t[0]&65535,c=t[1]>>>16,l=t[1]&65535,u=0,f=0,d=0,h=0;h+=s*l,d+=h>>>16,h&=65535,d+=o*l,f+=d>>>16,d&=65535,d+=s*c,f+=d>>>16,d&=65535,f+=r*l,u+=f>>>16,f&=65535,f+=o*c,u+=f>>>16,f&=65535,f+=s*a,u+=f>>>16,f&=65535,u+=n*l+r*c+o*a+s*i,u&=65535,e[0]=u<<16|f,e[1]=d<<16|h}function Cr(e,t){var n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function Ut(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function ft(e,t){e[0]^=t[0],e[1]^=t[1]}var Zh=[4283543511,3981806797],Wh=[3301882366,444984403];function Mc(e){var t=[0,e[0]>>>1];ft(e,t),Qt(e,Zh),t[1]=e[0]>>>1,ft(e,t),Qt(e,Wh),t[1]=e[0]>>>1,ft(e,t)}var No=[2277735313,289559509],Fo=[1291169091,658871167],Ac=[0,5],Uh=[0,1390208809],Bh=[0,944331445];function Gh(e,t){var n=Hh(e);t=t||0;var r=[0,n.length],o=r[1]%16,s=r[1]-o,i=[0,t],a=[0,t],c=[0,0],l=[0,0],u;for(u=0;u<s;u=u+16)c[0]=n[u+4]|n[u+5]<<8|n[u+6]<<16|n[u+7]<<24,c[1]=n[u]|n[u+1]<<8|n[u+2]<<16|n[u+3]<<24,l[0]=n[u+12]|n[u+13]<<8|n[u+14]<<16|n[u+15]<<24,l[1]=n[u+8]|n[u+9]<<8|n[u+10]<<16|n[u+11]<<24,Qt(c,No),Cr(c,31),Qt(c,Fo),ft(i,c),Cr(i,27),jn(i,a),Qt(i,Ac),jn(i,Uh),Qt(l,Fo),Cr(l,33),Qt(l,No),ft(a,l),Cr(a,31),jn(a,i),Qt(a,Ac),jn(a,Bh);c[0]=0,c[1]=0,l[0]=0,l[1]=0;var f=[0,0];switch(o){case 15:f[1]=n[u+14],Ut(f,48),ft(l,f);case 14:f[1]=n[u+13],Ut(f,40),ft(l,f);case 13:f[1]=n[u+12],Ut(f,32),ft(l,f);case 12:f[1]=n[u+11],Ut(f,24),ft(l,f);case 11:f[1]=n[u+10],Ut(f,16),ft(l,f);case 10:f[1]=n[u+9],Ut(f,8),ft(l,f);case 9:f[1]=n[u+8],ft(l,f),Qt(l,Fo),Cr(l,33),Qt(l,No),ft(a,l);case 8:f[1]=n[u+7],Ut(f,56),ft(c,f);case 7:f[1]=n[u+6],Ut(f,48),ft(c,f);case 6:f[1]=n[u+5],Ut(f,40),ft(c,f);case 5:f[1]=n[u+4],Ut(f,32),ft(c,f);case 4:f[1]=n[u+3],Ut(f,24),ft(c,f);case 3:f[1]=n[u+2],Ut(f,16),ft(c,f);case 2:f[1]=n[u+1],Ut(f,8),ft(c,f);case 1:f[1]=n[u],ft(c,f),Qt(c,No),Cr(c,31),Qt(c,Fo),ft(i,c)}return ft(i,r),ft(a,r),jn(i,a),jn(a,i),Mc(i),Mc(a),jn(i,a),jn(a,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}function Yh(e){var t;return ai({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
|
|
3
|
+
`)},e)}function Xh(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function qh(e){return typeof e!="function"}function Kh(e,t){var n=Jr(new Promise(function(r){var o=Date.now();Oc(e.bind(null,t),function(){for(var s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];var a=Date.now()-o;if(!s[0])return r(function(){return{error:s[1],duration:a}});var c=s[1];if(qh(c))return r(function(){return{value:c,duration:a}});r(function(){return new Promise(function(l){var u=Date.now();Oc(c,function(){for(var f=[],d=0;d<arguments.length;d++)f[d]=arguments[d];var h=a+Date.now()-u;if(!f[0])return l({error:f[1],duration:h});l({value:f[1],duration:h})})})})})}));return function(){return n.then(function(o){return o()})}}function Jh(e,t,n,r){var o=Object.keys(e).filter(function(i){return Vh(n,i)}),s=Jr(_c(o,function(i){return Kh(e[i],t)},r));return function(){return pn(this,void 0,void 0,function(){var a,c,l,u,f;return hn(this,function(d){switch(d.label){case 0:return[4,s];case 1:return a=d.sent(),[4,_c(a,function(h){return Jr(h())},r)];case 2:return c=d.sent(),[4,Promise.all(c)];case 3:for(l=d.sent(),u={},f=0;f<o.length;++f)u[o[f]]=l[f];return[2,u]}})})}}function Dc(){var e=window,t=navigator;return Rt(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Qh(){var e=window,t=navigator;return Rt(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Dc()}function Qr(){var e=window,t=navigator;return Rt(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function cn(){var e=window,t=navigator;return Rt(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function li(){var e=window,t=e.HTMLElement,n=e.Document;return Rt(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function eo(){var e=window;return Xh(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Nc(){var e,t,n=window;return Rt(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function em(){var e=window;return Rt([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function tm(){var e=window,t=e.URLPattern;return Rt(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function nm(){var e=window;return Rt(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function to(){var e=window,t=navigator,n=e.CSS,r=e.HTMLButtonElement;return Rt([!("getStorageUpdates"in t),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function rm(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return Rt(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function om(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function sm(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function ui(){var e=Qr(),t=Nc(),n=window,r=navigator,o="connection";return e?Rt([!("SharedWorker"in n),r[o]&&"ontypechange"in r[o],!("sinkId"in new Audio)])>=2:t?Rt(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function im(){var e=navigator,t=window,n=Audio.prototype,r=t.visualViewport;return Rt(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function am(){return um()?-4:cm()}function cm(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(lm())return-1;var n=4500,r=5e3,o=new t(1,r,44100),s=o.createOscillator();s.type="triangle",s.frequency.value=1e4;var i=o.createDynamicsCompressor();i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.25,s.connect(i),i.connect(o.destination),s.start(0);var a=fm(o),c=a[0],l=a[1],u=Jr(c.then(function(f){return dm(f.getChannelData(0).subarray(n))},function(f){if(f.name==="timeout"||f.name==="suspended")return-3;throw f}));return function(){return l(),u}}function lm(){return cn()&&!li()&&!nm()}function um(){return cn()&&to()&&eo()||Qr()&&im()&&tm()}function fm(e){var t=3,n=500,r=500,o=5e3,s=function(){},i=new Promise(function(a,c){var l=!1,u=0,f=0;e.oncomplete=function(m){return a(m.renderedBuffer)};var d=function(){setTimeout(function(){return c(Fc("timeout"))},Math.min(r,f+o-Date.now()))},h=function(){try{var m=e.startRendering();switch(Ic(m)&&Jr(m),e.state){case"running":f=Date.now(),l&&d();break;case"suspended":document.hidden||u++,l&&u>=t?c(Fc("suspended")):setTimeout(h,n);break}}catch(y){c(y)}};h(),s=function(){l||(l=!0,f>0&&d())}});return[i,s]}function dm(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function Fc(e){var t=new Error(e);return t.name=e,t}function Lc(e,t,n){var r,o,s;return n===void 0&&(n=50),pn(this,void 0,void 0,function(){var i,a;return hn(this,function(c){switch(c.label){case 0:i=document,c.label=1;case 1:return i.body?[3,3]:[4,Do(n)];case 2:return c.sent(),[3,1];case 3:a=i.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise(function(l,u){var f=!1,d=function(){f=!0,l()},h=function(v){f=!0,u(v)};a.onload=d,a.onerror=h;var m=a.style;m.setProperty("display","block","important"),m.position="absolute",m.top="0",m.left="0",m.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",i.body.appendChild(a);var y=function(){var v,g;f||(((g=(v=a.contentWindow)===null||v===void 0?void 0:v.document)===null||g===void 0?void 0:g.readyState)==="complete"?d():setTimeout(y,10))};y()})];case 5:c.sent(),c.label=6;case 6:return!((o=(r=a.contentWindow)===null||r===void 0?void 0:r.document)===null||o===void 0)&&o.body?[3,8]:[4,Do(n)];case 7:return c.sent(),[3,6];case 8:return[4,e(a,a.contentWindow)];case 9:return[2,c.sent()];case 10:return(s=a.parentNode)===null||s===void 0||s.removeChild(a),[7];case 11:return[2]}})})}function pm(e){for(var t=jh(e),n=t[0],r=t[1],o=document.createElement(n??"div"),s=0,i=Object.keys(r);s<i.length;s++){var a=i[s],c=r[a].join(" ");a==="style"?hm(o.style,c):o.setAttribute(a,c)}return o}function hm(e,t){for(var n=0,r=t.split(";");n<r.length;n++){var o=r[n],s=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(o);if(s){var i=s[1],a=s[2],c=s[4];e.setProperty(i,a,c||"")}}}function mm(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}var gm="mmMwWLliI0O&1",ym="48px",Pr=["monospace","sans-serif","serif"],zc=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function vm(){var e=this;return Lc(function(t,n){var r=n.document;return pn(e,void 0,void 0,function(){var o,s,i,a,c,l,u,f,d,h,m,y;return hn(this,function(v){for(o=r.body,o.style.fontSize=ym,s=r.createElement("div"),s.style.setProperty("visibility","hidden","important"),i={},a={},c=function(g){var E=r.createElement("span"),C=E.style;return C.position="absolute",C.top="0",C.left="0",C.fontFamily=g,E.textContent=gm,s.appendChild(E),E},l=function(g,E){return c("'".concat(g,"',").concat(E))},u=function(){return Pr.map(c)},f=function(){for(var g={},E=function(x){g[x]=Pr.map(function(T){return l(x,T)})},C=0,S=zc;C<S.length;C++){var b=S[C];E(b)}return g},d=function(g){return Pr.some(function(E,C){return g[C].offsetWidth!==i[E]||g[C].offsetHeight!==a[E]})},h=u(),m=f(),o.appendChild(s),y=0;y<Pr.length;y++)i[Pr[y]]=h[y].offsetWidth,a[Pr[y]]=h[y].offsetHeight;return[2,zc.filter(function(g){return d(m[g])})]})})})}function bm(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var r=e[n];if(r){for(var o=[],s=0;s<r.length;++s){var i=r[s];o.push({type:i.type,suffixes:i.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:o})}}return t}}function wm(){return Sm(Im())}function Sm(e){var t,n=!1,r,o,s=xm(),i=s[0],a=s[1];return Em(i,a)?(n=Cm(a),e?r=o="skipped":(t=Pm(i,a),r=t[0],o=t[1])):r=o="unsupported",{winding:n,geometry:r,text:o}}function xm(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function Em(e,t){return!!(t&&e.toDataURL)}function Cm(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function Pm(e,t){Tm(e,t);var n=fi(e),r=fi(e);if(n!==r)return["unstable","unstable"];km(e,t);var o=fi(e);return[o,n]}function Tm(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat("😃");t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function km(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var o=r[n],s=o[0],i=o[1],a=o[2];t.fillStyle=s,t.beginPath(),t.arc(i,a,40,0,Math.PI*2,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function fi(e){return e.toDataURL()}function Im(){return cn()&&to()&&eo()}function Om(){var e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=ci(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}var r="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:r}}function _m(){return navigator.oscpu}function Rm(){var e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))Qr()&&em()||t.push(e.languages);else if(typeof e.languages=="string"){var r=e.languages;r&&t.push(r.split(","))}return t}function Mm(){return window.screen.colorDepth}function Am(){return In(an(navigator.deviceMemory),void 0)}function Dm(){if(!(cn()&&to()&&eo()))return Nm()}function Nm(){var e=screen,t=function(r){return In(ci(r),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n}var Fm=2500,Lm=10,Lo,di;function zm(){if(di===void 0){var e=function(){var t=pi();hi(t)?di=setTimeout(e,Fm):(Lo=t,di=void 0)};e()}}function $m(){var e=this;return zm(),function(){return pn(e,void 0,void 0,function(){var t;return hn(this,function(n){switch(n.label){case 0:return t=pi(),hi(t)?Lo?[2,Tc([],Lo,!0)]:om()?[4,sm()]:[3,2]:[3,2];case 1:n.sent(),t=pi(),n.label=2;case 2:return hi(t)||(Lo=t),[2,t]}})})}}function Vm(){var e=this;if(cn()&&to()&&eo())return function(){return Promise.resolve(void 0)};var t=$m();return function(){return pn(e,void 0,void 0,function(){var n,r;return hn(this,function(o){switch(o.label){case 0:return[4,t()];case 1:return n=o.sent(),r=function(s){return s===null?null:Rc(s,Lm)},[2,[r(n[0]),r(n[1]),r(n[2]),r(n[3])]]}})})}}function pi(){var e=screen;return[In(an(e.availTop),null),In(an(e.width)-an(e.availWidth)-In(an(e.availLeft),0),null),In(an(e.height)-an(e.availHeight)-In(an(e.availTop),0),null),In(an(e.availLeft),null)]}function hi(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function jm(){return In(ci(navigator.hardwareConcurrency),void 0)}function Hm(){var e,t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){var n=new t().resolvedOptions().timeZone;if(n)return n}var r=-Zm();return"UTC".concat(r>=0?"+":"").concat(r)}function Zm(){var e=new Date().getFullYear();return Math.max(an(new Date(e,0,1).getTimezoneOffset()),an(new Date(e,6,1).getTimezoneOffset()))}function Wm(){try{return!!window.sessionStorage}catch{return!0}}function Um(){try{return!!window.localStorage}catch{return!0}}function Bm(){if(!(Dc()||Qh()))try{return!!window.indexedDB}catch{return!0}}function Gm(){return!!window.openDatabase}function Ym(){return navigator.cpuClass}function Xm(){var e=navigator.platform;return e==="MacIntel"&&cn()&&!li()?rm()?"iPad":"iPhone":e}function qm(){return navigator.vendor||""}function Km(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var r=n[t],o=window[r];o&&typeof o=="object"&&e.push(r)}return e.sort()}function Jm(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function Qm(){var e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function eg(e){var t=e===void 0?{}:e,n=t.debug;return pn(this,void 0,void 0,function(){var r,o,s,i,a,c;return hn(this,function(l){switch(l.label){case 0:return tg()?(r=Qm(),o=Object.keys(r),s=(c=[]).concat.apply(c,o.map(function(u){return r[u]})),[4,ng(s)]):[2,void 0];case 1:return i=l.sent(),n&&rg(r,i),a=o.filter(function(u){var f=r[u],d=Rt(f.map(function(h){return i[h]}));return d>f.length*.6}),a.sort(),[2,a]}})})}function tg(){return cn()||ui()}function ng(e){var t;return pn(this,void 0,void 0,function(){var n,r,o,s,c,i,a,c;return hn(this,function(l){switch(l.label){case 0:for(n=document,r=n.createElement("div"),o=new Array(e.length),s={},$c(r),c=0;c<e.length;++c)i=pm(e[c]),i.tagName==="DIALOG"&&i.show(),a=n.createElement("div"),$c(a),a.appendChild(i),r.appendChild(a),o[c]=i;l.label=1;case 1:return n.body?[3,3]:[4,Do(50)];case 2:return l.sent(),[3,1];case 3:n.body.appendChild(r);try{for(c=0;c<e.length;++c)o[c].offsetParent||(s[e[c]]=!0)}finally{(t=r.parentNode)===null||t===void 0||t.removeChild(r)}return[2,s]}})})}function $c(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function rg(e,t){for(var n="DOM blockers debug:\n```",r=0,o=Object.keys(e);r<o.length;r++){var s=o[r];n+=`
|
|
4
4
|
`.concat(s,":");for(var i=0,a=e[s];i<a.length;i++){var c=a[i];n+=`
|
|
5
|
-
`.concat(t[c]?"🚫":"➡️"," ").concat(c)}}console.log("".concat(n,"\n```"))}function
|
|
5
|
+
`.concat(t[c]?"🚫":"➡️"," ").concat(c)}}console.log("".concat(n,"\n```"))}function og(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var n=t[e];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}}function sg(){if(Vc("inverted"))return!0;if(Vc("none"))return!1}function Vc(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function ig(){if(jc("active"))return!0;if(jc("none"))return!1}function jc(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var ag=100;function cg(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=ag;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function lg(){if(Tr("no-preference"))return 0;if(Tr("high")||Tr("more"))return 1;if(Tr("low")||Tr("less"))return-1;if(Tr("forced"))return 10}function Tr(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function ug(){if(Hc("reduce"))return!0;if(Hc("no-preference"))return!1}function Hc(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function fg(){if(Zc("reduce"))return!0;if(Zc("no-preference"))return!1}function Zc(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function dg(){if(Wc("high"))return!0;if(Wc("standard"))return!1}function Wc(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var et=Math,Mt=function(){return 0};function pg(){var e=et.acos||Mt,t=et.acosh||Mt,n=et.asin||Mt,r=et.asinh||Mt,o=et.atanh||Mt,s=et.atan||Mt,i=et.sin||Mt,a=et.sinh||Mt,c=et.cos||Mt,l=et.cosh||Mt,u=et.tan||Mt,f=et.tanh||Mt,d=et.exp||Mt,h=et.expm1||Mt,m=et.log1p||Mt,y=function(I){return et.pow(et.PI,I)},v=function(I){return et.log(I+et.sqrt(I*I-1))},g=function(I){return et.log(I+et.sqrt(I*I+1))},E=function(I){return et.log((1+I)/(1-I))/2},C=function(I){return et.exp(I)-1/et.exp(I)/2},S=function(I){return(et.exp(I)+1/et.exp(I))/2},b=function(I){return et.exp(I)-1},x=function(I){return(et.exp(2*I)-1)/(et.exp(2*I)+1)},T=function(I){return et.log(1+I)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:v(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:g(1),atanh:o(.5),atanhPf:E(.5),atan:s(.5),sin:i(-1e300),sinh:a(1),sinhPf:C(1),cos:c(10.000000000123),cosh:l(1),coshPf:S(1),tan:u(-1e300),tanh:f(1),tanhPf:x(1),exp:d(1),expm1:h(1),expm1Pf:b(1),log1p:m(10),log1pPf:T(10),powPI:y(-100)}}var hg="mmMwWLliI0fiflO&1",mi={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function mg(){return gg(function(e,t){for(var n={},r={},o=0,s=Object.keys(mi);o<s.length;o++){var i=s[o],a=mi[i],c=a[0],l=c===void 0?{}:c,u=a[1],f=u===void 0?hg:u,d=e.createElement("span");d.textContent=f,d.style.whiteSpace="nowrap";for(var h=0,m=Object.keys(l);h<m.length;h++){var y=m[h],v=l[y];v!==void 0&&(d.style[y]=v)}n[i]=d,t.append(e.createElement("br"),d)}for(var g=0,E=Object.keys(mi);g<E.length;g++){var i=E[g];r[i]=n[i].getBoundingClientRect().width}return r})}function gg(e,t){return t===void 0&&(t=4e3),Lc(function(n,r){var o=r.document,s=o.body,i=s.style;i.width="".concat(t,"px"),i.webkitTextSizeAdjust=i.textSizeAdjust="none",Qr()?s.style.zoom="".concat(1/r.devicePixelRatio):cn()&&(s.style.zoom="reset");var a=o.createElement("div");return a.textContent=Tc([],Array(t/20<<0),!0).map(function(){return"word"}).join(" "),s.appendChild(a),e(o,s)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function yg(){return navigator.pdfViewerEnabled}function vg(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function bg(){var e=window.ApplePaySession;if(typeof e?.canMakePayments!="function")return-1;if(wg())return-3;try{return e.canMakePayments()?1:0}catch(t){return Sg(t)}}var wg=mm;function Sg(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function xg(){var e,t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}var Uc=-1,Bc=-2,Eg=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Cg=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Pg=["FRAGMENT_SHADER","VERTEX_SHADER"],Tg=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Gc="WEBGL_debug_renderer_info",kg="WEBGL_polygon_mode";function Ig(e){var t,n,r,o,s,i,a=e.cache,c=Yc(a);if(!c)return Uc;if(!Kc(c))return Bc;var l=qc()?null:c.getExtension(Gc);return{version:((t=c.getParameter(c.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=c.getParameter(c.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:l?(r=c.getParameter(l.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((o=c.getParameter(c.RENDERER))===null||o===void 0?void 0:o.toString())||"",rendererUnmasked:l?(s=c.getParameter(l.UNMASKED_RENDERER_WEBGL))===null||s===void 0?void 0:s.toString():"",shadingLanguageVersion:((i=c.getParameter(c.SHADING_LANGUAGE_VERSION))===null||i===void 0?void 0:i.toString())||""}}function Og(e){var t=e.cache,n=Yc(t);if(!n)return Uc;if(!Kc(n))return Bc;var r=n.getSupportedExtensions(),o=n.getContextAttributes(),s=[],i=[],a=[],c=[],l=[];if(o)for(var u=0,f=Object.keys(o);u<f.length;u++){var d=f[u];i.push("".concat(d,"=").concat(o[d]))}for(var h=Xc(n),m=0,y=h;m<y.length;m++){var v=y[m],g=n[v];a.push("".concat(v,"=").concat(g).concat(Eg.has(g)?"=".concat(n.getParameter(g)):""))}if(r)for(var E=0,C=r;E<C.length;E++){var S=C[E];if(!(S===Gc&&qc()||S===kg&&Mg())){var b=n.getExtension(S);if(!b){s.push(S);continue}for(var x=0,T=Xc(b);x<T.length;x++){var v=T[x],g=b[v];c.push("".concat(v,"=").concat(g).concat(Cg.has(g)?"=".concat(n.getParameter(g)):""))}}}for(var I=0,z=Pg;I<z.length;I++)for(var A=z[I],F=0,V=Tg;F<V.length;F++){var $=V[F],M=_g(n,A,$);l.push("".concat(A,".").concat($,"=").concat(M.join(",")))}return c.sort(),a.sort(),{contextAttributes:i,parameters:a,shaderPrecisions:l,extensions:r,extensionParameters:c,unsupportedExtensions:s}}function Yc(e){if(e.webgl)return e.webgl.context;var t=document.createElement("canvas"),n;t.addEventListener("webglCreateContextError",function(){return n=void 0});for(var r=0,o=["webgl","experimental-webgl"];r<o.length;r++){var s=o[r];try{n=t.getContext(s)}catch{}if(n)break}return e.webgl={context:n},n}function _g(e,t,n){var r=e.getShaderPrecisionFormat(e[t],e[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function Xc(e){var t=Object.keys(e.__proto__);return t.filter(Rg)}function Rg(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function qc(){return Nc()}function Mg(){return Qr()||cn()}function Kc(e){return typeof e.getParameter=="function"}function Ag(){var e=ui()||cn();if(!e)return-2;if(!window.AudioContext)return-1;var t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function Dg(){if(!window.Intl)return-1;var e=window.Intl.DateTimeFormat;if(!e)return-2;var t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}var Ng={fonts:vm,domBlockers:eg,fontPreferences:mg,audio:am,screenFrame:Vm,canvas:wm,osCpu:_m,languages:Rm,colorDepth:Mm,deviceMemory:Am,screenResolution:Dm,hardwareConcurrency:jm,timezone:Hm,sessionStorage:Wm,localStorage:Um,indexedDB:Bm,openDatabase:Gm,cpuClass:Ym,platform:Xm,plugins:bm,touchSupport:Om,vendor:qm,vendorFlavors:Km,cookiesEnabled:Jm,colorGamut:og,invertedColors:sg,forcedColors:ig,monochrome:cg,contrast:lg,reducedMotion:ug,reducedTransparency:fg,hdr:dg,math:pg,pdfViewerEnabled:yg,architecture:vg,applePay:bg,privateClickMeasurement:xg,audioBaseLatency:Ag,dateTimeLocale:Dg,webGlBasics:Ig,webGlExtensions:Og};function Fg(e){return Jh(Ng,e,[])}var Lg="$ if upgrade to Pro: https://fpjs.dev/pro";function zg(e){var t=$g(e),n=Vg(t);return{score:t,comment:Lg.replace(/\$/g,"".concat(n))}}function $g(e){if(ui())return .4;if(cn())return li()&&!(to()&&eo())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Vg(e){return Rc(.99+.01*e,1e-4)}function jg(e){for(var t="",n=0,r=Object.keys(e).sort();n<r.length;n++){var o=r[n],s=e[o],i="error"in s?"error":JSON.stringify(s.value);t+="".concat(t?"|":"").concat(o.replace(/([:|\\])/g,"\\$1"),":").concat(i)}return t}function Jc(e){return JSON.stringify(e,function(t,n){return n instanceof Error?Yh(n):n},2)}function Qc(e){return Gh(jg(e))}function Hg(e){var t,n=zg(e);return{get visitorId(){return t===void 0&&(t=Qc(this.components)),t},set visitorId(r){t=r},confidence:n,components:e,version:kc}}function Zg(e){return e===void 0&&(e=50),zh(e,e*2)}function Wg(e,t){var n=Date.now();return{get:function(r){return pn(this,void 0,void 0,function(){var o,s,i;return hn(this,function(a){switch(a.label){case 0:return o=Date.now(),[4,e()];case 1:return s=a.sent(),i=Hg(s),(t||r?.debug)&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(i.version,`
|
|
6
6
|
userAgent: `).concat(navigator.userAgent,`
|
|
7
7
|
timeBetweenLoadAndGet: `).concat(o-n,`
|
|
8
8
|
visitorId: `).concat(i.visitorId,`
|
|
9
|
-
components: `).concat(ku(s),"\n```")),[2,i]}})})}}}function Vy(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(su,"/npm-monitoring"),!0),e.send()}catch(t){console.error(t)}}function zy(e){var t;return e===void 0&&(e={}),pn(this,void 0,void 0,function(){var n,r,o;return hn(this,function(s){switch(s.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&Vy(),n=e.delayFallback,r=e.debug,[4,Ly(n)];case 1:return s.sent(),o=Iy({cache:{},debug:r}),[2,Fy(o,r)]}})})}var $y={load:zy,hashComponents:Ru,componentsToDebugString:ku};function Nu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Nu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Mu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Nu(e))&&(r&&(r+=" "),r+=t);return r}const ki="-",jy=e=>{const t=Uy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(ki);return a[0]===""&&a.length!==1&&a.shift(),Au(a,t)||Hy(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},Au=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Au(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(ki);return t.validators.find(({validator:i})=>i(s))?.classGroupId},Du=/^\[(.+)\]$/,Hy=e=>{if(Du.test(e)){const t=Du.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Uy=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Wy(Object.entries(e.classGroups),n).forEach(([s,i])=>{Ri(i,r,s,t)}),r},Ri=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Lu(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(By(o)){Ri(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Ri(i,Lu(t,s),n,r)})})},Lu=(e,t)=>{let n=e;return t.split(ki).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},By=e=>e.isThemeGetter,Wy=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,Zy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Fu="!",Gy=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const c=[];let u=0,l=0,d;for(let v=0;v<a.length;v++){let y=a[v];if(u===0){if(y===o&&(r||a.slice(v,v+s)===t)){c.push(a.slice(l,v)),l=v+s;continue}if(y==="/"){d=v;continue}}y==="["?u++:y==="]"&&u--}const p=c.length===0?a:a.substring(l),h=p.startsWith(Fu),m=h?p.substring(1):p,g=d&&d>l?d-l:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},Yy=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Xy=e=>({cache:Zy(e.cacheSize),parseClassName:Gy(e),...jy(e)}),qy=/\s+/,Ky=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(qy);let a="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{modifiers:l,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let m=!!h,g=r(m?p.substring(0,h):p);if(!g){if(!m){a=u+(a.length>0?" "+a:a);continue}if(g=r(p),!g){a=u+(a.length>0?" "+a:a);continue}m=!1}const v=Yy(l).join(":"),y=d?v+Fu:v,C=y+g;if(s.includes(C))continue;s.push(C);const S=o(g,m);for(let E=0;E<S.length;++E){const b=S[E];s.push(y+b)}a=u+(a.length>0?" "+a:a)}return a};function Jy(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Vu(t))&&(r&&(r+=" "),r+=n);return r}const Vu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Vu(e[r]))&&(n&&(n+=" "),n+=t);return n};function Qy(e,...t){let n,r,o,s=i;function i(c){const u=t.reduce((l,d)=>d(l),e());return n=Xy(u),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const u=r(c);if(u)return u;const l=Ky(c,n);return o(c,l),l}return function(){return s(Jy.apply(null,arguments))}}const ut=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},zu=/^\[(?:([a-z-]+):)?(.+)\]$/i,ev=/^\d+\/\d+$/,tv=new Set(["px","full","screen"]),nv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ov=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,sv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kn=e=>_r(e)||tv.has(e)||ev.test(e),Hn=e=>Ir(e,"length",hv),_r=e=>!!e&&!Number.isNaN(Number(e)),Ni=e=>Ir(e,"number",_r),ro=e=>!!e&&Number.isInteger(Number(e)),av=e=>e.endsWith("%")&&_r(e.slice(0,-1)),ze=e=>zu.test(e),Un=e=>nv.test(e),cv=new Set(["length","size","percentage"]),uv=e=>Ir(e,cv,$u),lv=e=>Ir(e,"position",$u),dv=new Set(["image","url"]),fv=e=>Ir(e,dv,gv),pv=e=>Ir(e,"",mv),oo=()=>!0,Ir=(e,t,n)=>{const r=zu.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},hv=e=>rv.test(e)&&!ov.test(e),$u=()=>!1,mv=e=>sv.test(e),gv=e=>iv.test(e),Mi=Qy(()=>{const e=ut("colors"),t=ut("spacing"),n=ut("blur"),r=ut("brightness"),o=ut("borderColor"),s=ut("borderRadius"),i=ut("borderSpacing"),a=ut("borderWidth"),c=ut("contrast"),u=ut("grayscale"),l=ut("hueRotate"),d=ut("invert"),p=ut("gap"),h=ut("gradientColorStops"),m=ut("gradientColorStopPositions"),g=ut("inset"),v=ut("margin"),y=ut("opacity"),C=ut("padding"),S=ut("saturate"),E=ut("scale"),b=ut("sepia"),x=ut("skew"),T=ut("space"),P=ut("translate"),$=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",ze,t],L=()=>[ze,t],D=()=>["",kn,Hn],R=()=>["auto",_r,ze],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",ze],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[_r,ze];return{cacheSize:500,separator:":",theme:{colors:[oo],spacing:[kn,Hn],blur:["none","",Un,ze],brightness:B(),borderColor:[e],borderRadius:["none","","full",Un,ze],borderSpacing:L(),borderWidth:D(),contrast:B(),grayscale:A(),hueRotate:B(),invert:A(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[av,Hn],inset:V(),margin:V(),opacity:B(),padding:L(),saturate:B(),scale:B(),sepia:A(),skew:B(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",ze]}],container:["container"],columns:[{columns:[Un]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...O(),ze]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ro,ze]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ze]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",ro,ze]}],"grid-cols":[{"grid-cols":[oo]}],"col-start-end":[{col:["auto",{span:["full",ro,ze]},ze]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[oo]}],"row-start-end":[{row:["auto",{span:[ro,ze]},ze]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ze]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ze,t]}],"min-w":[{"min-w":[ze,t,"min","max","fit"]}],"max-w":[{"max-w":[ze,t,"none","full","min","max","fit","prose",{screen:[Un]},Un]}],h:[{h:[ze,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ze,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Un,Hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ni]}],"font-family":[{font:[oo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ze]}],"line-clamp":[{"line-clamp":["none",_r,Ni]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",kn,ze]}],"list-image":[{"list-image":["none",ze]}],"list-style-type":[{list:["none","disc","decimal",ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",kn,Hn]}],"underline-offset":[{"underline-offset":["auto",kn,ze]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),lv]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uv]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},fv]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:I()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[kn,ze]}],"outline-w":[{outline:[kn,Hn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[kn,Hn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Un,pv]}],"shadow-color":[{shadow:[oo]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Un,ze]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[d]}],saturate:[{saturate:[S]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ze]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",ze]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[ro,ze]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ze]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ze]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[kn,Hn,Ni]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),yv=[];function so(e){f.useEffect(e,yv)}const ju={};function wt(e,t){const n=f.useRef(ju);return n.current===ju&&(n.current=e(t)),n}function vv(e,t){return function(r,...o){const s=new URL(e);return s.searchParams.set("code",r.toString()),o.forEach(i=>s.searchParams.append("args[]",i)),`${t} error #${r}; visit ${s} for the full message.`}}const ft=vv("https://base-ui.com/production-error","Base UI"),zo=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(zo.displayName="ToastContext");function Hu(){const e=f.useContext(zo);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":ft(73));return e}const de=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":ft(1));let a;if(e&&t&&n&&r&&o&&s)a=(c,u,l,d)=>{const p=e(c,u,l,d),h=t(c,u,l,d),m=n(c,u,l,d),g=r(c,u,l,d),v=o(c,u,l,d);return s(p,h,m,g,v,u,l,d)};else if(e&&t&&n&&r&&o)a=(c,u,l,d)=>{const p=e(c,u,l,d),h=t(c,u,l,d),m=n(c,u,l,d),g=r(c,u,l,d);return o(p,h,m,g,u,l,d)};else if(e&&t&&n&&r)a=(c,u,l,d)=>{const p=e(c,u,l,d),h=t(c,u,l,d),m=n(c,u,l,d);return r(p,h,m,u,l,d)};else if(e&&t&&n)a=(c,u,l,d)=>{const p=e(c,u,l,d),h=t(c,u,l,d);return n(p,h,u,l,d)};else if(e&&t)a=(c,u,l,d)=>{const p=e(c,u,l,d);return t(p,u,l,d)};else if(e)a=e;else throw new Error("Missing arguments");return a};var bv=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const o={};e(o)===o&&(r=!0)}catch{}if(r){let o;try{throw new Error}catch(s){({stack:o}=s)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
10
|
-
\`createSelector([state => state.todos], todos => todos)\`
|
|
11
|
-
This could lead to inefficient memoization and unnecessary re-renders.
|
|
12
|
-
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:o})}}},wv=(e,t,n)=>{const{memoize:r,memoizeOptions:o}=t,{inputSelectorResults:s,inputSelectorResultsCopy:i}=e,a=r(()=>({}),...o);if(!(a.apply(null,s)===a.apply(null,i))){let u;try{throw new Error}catch(l){({stack:u}=l)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
13
|
-
This means your output selector will likely run more frequently than intended.
|
|
14
|
-
Avoid returning a new reference inside your input selector, e.g.
|
|
15
|
-
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:s,secondInputs:i,stack:u})}},Sv={inputStabilityCheck:"once",identityFunctionCheck:"once"},$o=Symbol("NOT_FOUND");function Ev(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function xv(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Cv(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Uu=e=>Array.isArray(e)?e:[e];function Tv(e){const t=Array.isArray(e[0])?e[0]:e;return Cv(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Bu(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var Ov=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...Sv,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:bv},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:wv}}};function Pv(e){let t;return{get(n){return t&&e(t.key,n)?t.value:$o},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function _v(e,t){let n=[];function r(a){const c=n.findIndex(u=>t(a,u.key));if(c>-1){const u=n[c];return c>0&&(n.splice(c,1),n.unshift(u)),u.value}return $o}function o(a,c){r(a)===$o&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:r,put:o,getEntries:s,clear:i}}var Iv=(e,t)=>e===t;function kv(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function Rv(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=Iv,maxSize:o=1,resultEqualityCheck:s}=n,i=kv(r);let a=0;const c=o<=1?Pv(i):_v(o,i);function u(){let l=c.get(arguments);if(l===$o){if(l=e.apply(null,arguments),a++,s){const p=c.getEntries().find(h=>s(h.value,l));p&&(l=p.value,a!==0&&a--)}c.put(arguments,l)}return l}return u.clearCache=()=>{c.clear(),u.resetResultsCount()},u.resultsCount=()=>a,u.resetResultsCount=()=>{a=0},u}var Nv=class{constructor(e){this.value=e}deref(){return this.value}},Mv=typeof WeakRef<"u"?WeakRef:Nv,Av=0,Wu=1;function jo(){return{s:Av,v:void 0,o:null,p:null}}function Zu(e,t={}){let n=jo();const{resultEqualityCheck:r}=t;let o,s=0;function i(){let a=n;const{length:c}=arguments;for(let d=0,p=c;d<p;d++){const h=arguments[d];if(typeof h=="function"||typeof h=="object"&&h!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const g=m.get(h);g===void 0?(a=jo(),m.set(h,a)):a=g}else{let m=a.p;m===null&&(a.p=m=new Map);const g=m.get(h);g===void 0?(a=jo(),m.set(h,a)):a=g}}const u=a;let l;if(a.s===Wu)l=a.v;else if(l=e.apply(null,arguments),s++,r){const d=o?.deref?.()??o;d!=null&&r(d,l)&&(l=d,s!==0&&s--),o=typeof l=="object"&&l!==null||typeof l=="function"?new Mv(l):l}return u.s=Wu,u.v=l,l}return i.clearCache=()=>{n=jo(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function Gu(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,a,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),Ev(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const l={...n,...c},{memoize:d,memoizeOptions:p=[],argsMemoize:h=Zu,argsMemoizeOptions:m=[],devModeChecks:g={}}=l,v=Uu(p),y=Uu(m),C=Tv(o),S=d(function(){return s++,u.apply(null,arguments)},...v);let E=!0;const b=h(function(){i++;const T=Bu(C,arguments);if(a=S.apply(null,T),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:P,inputStabilityCheck:$}=Ov(E,g);if(P.shouldRun&&P.run(u,T,a),$.shouldRun){const M=Bu(C,arguments);$.run({inputSelectorResults:T,inputSelectorResultsCopy:M},{memoize:d,memoizeOptions:v},arguments)}E&&(E=!1)}return a},...y);return Object.assign(b,{resultFunc:u,memoizedResultFunc:S,dependencies:C,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:d,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var Dv=Gu(Zu),Lv=Object.assign((e,t=Dv)=>{xv(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>Lv});const Fv=Gu({memoize:Rv,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),Vv=(...e)=>{const t=new WeakMap;let n=1;const r=e[e.length-1],o=e.length-1||1,s=r.length-o;if(s>3)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of arguments":ft(2));return(a,c,u,l)=>{let d=a.__cacheKey__;d||(d={id:n},a.__cacheKey__=d,n+=1);let p=t.get(d);if(!p){let h=e;const m=[void 0,void 0,void 0];switch(s){case 0:break;case 1:{h=[...e.slice(0,-1),()=>m[0],r];break}case 2:{h=[...e.slice(0,-1),()=>m[0],()=>m[1],r];break}case 3:{h=[...e.slice(0,-1),()=>m[0],()=>m[1],()=>m[2],r];break}default:throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of arguments":ft(2))}p=Fv(...h),p.selectorArgs=m,t.set(d,p)}switch(p.selectorArgs[0]=c,p.selectorArgs[1]=u,p.selectorArgs[2]=l,s){case 0:return p(a);case 1:return p(a,c);case 2:return p(a,c,u);case 3:return p(a,c,u,l);default:throw new Error("unreachable")}}};var Ho=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uo={exports:{}},Ai={};var Yu;function $v(){if(Yu)return Ai;Yu=1;var e=oe;function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(d,p){var h=p(),m=r({inst:{value:h,getSnapshot:p}}),g=m[0].inst,v=m[1];return s(function(){g.value=h,g.getSnapshot=p,c(g)&&v({inst:g})},[d,h,p]),o(function(){return c(g)&&v({inst:g}),d(function(){c(g)&&v({inst:g})})},[d]),i(h),h}function c(d){var p=d.getSnapshot;d=d.value;try{var h=p();return!n(d,h)}catch{return!0}}function u(d,p){return p()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Ai.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,Ai}var Di={};var Xu;function jv(){return Xu||(Xu=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}function t(h,m){l||o.startTransition===void 0||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=m();if(!d){var v=m();s(g,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}v=i({inst:{value:g,getSnapshot:m}});var y=v[0].inst,C=v[1];return c(function(){y.value=g,y.getSnapshot=m,n(y)&&C({inst:y})},[h,g,m]),a(function(){return n(y)&&C({inst:y}),h(function(){n(y)&&C({inst:y})})},[h]),u(g),g}function n(h){var m=h.getSnapshot;h=h.value;try{var g=m();return!s(h,g)}catch{return!0}}function r(h,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=oe,s=typeof Object.is=="function"?Object.is:e,i=o.useState,a=o.useEffect,c=o.useLayoutEffect,u=o.useDebugValue,l=!1,d=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Di.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Di}var qu;function Li(){return qu||(qu=1,process.env.NODE_ENV==="production"?Uo.exports=$v():Uo.exports=jv()),Uo.exports}var Hv=Li(),Bo={exports:{}},Fi={};var Ku;function Uv(){if(Ku)return Fi;Ku=1;var e=oe,t=Li();function n(u,l){return u===l&&(u!==0||1/u===1/l)||u!==u&&l!==l}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Fi.useSyncExternalStoreWithSelector=function(u,l,d,p,h){var m=s(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function y(x){if(!C){if(C=!0,S=x,x=p(x),h!==void 0&&g.hasValue){var T=g.value;if(h(T,x))return E=T}return E=x}if(T=E,r(S,x))return T;var P=p(x);return h!==void 0&&h(T,P)?(S=x,T):(S=x,E=P)}var C=!1,S,E,b=d===void 0?null:d;return[function(){return y(l())},b===null?void 0:function(){return y(b())}]},[l,d,p,h]);var v=o(u,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),c(v),v},Fi}var Vi={};var Ju;function Bv(){return Ju||(Ju=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,l){return u===l&&(u!==0||1/u===1/l)||u!==u&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=oe,n=Li(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,a=t.useMemo,c=t.useDebugValue;Vi.useSyncExternalStoreWithSelector=function(u,l,d,p,h){var m=s(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function y(x){if(!C){if(C=!0,S=x,x=p(x),h!==void 0&&g.hasValue){var T=g.value;if(h(T,x))return E=T}return E=x}if(T=E,r(S,x))return T;var P=p(x);return h!==void 0&&h(T,P)?(S=x,T):(S=x,E=P)}var C=!1,S,E,b=d===void 0?null:d;return[function(){return y(l())},b===null?void 0:function(){return y(b())}]},[l,d,p,h]);var v=o(u,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Vi}var Qu;function Wv(){return Qu||(Qu=1,process.env.NODE_ENV==="production"?Bo.exports=Uv():Bo.exports=Bv()),Bo.exports}var Zv=Wv();const Gv=parseInt(f.version,10);function zi(e){return Gv>=e}const Yv=zi(19)?qv:Kv;function We(e,t,n,r,o){return Yv(e,t,n,r,o)}function Xv(e,t,n,r,o){const s=f.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Hv.useSyncExternalStore(e.subscribe,s,s)}function qv(e,t,n,r,o){return Xv(e,t,n,r,o)}function Kv(e,t,n,r,o){return Zv.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class el{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return We(this,t,n,r,o)}}const $i=f[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Jv=$i&&$i!==f.useLayoutEffect?$i:e=>e();function ie(e){const t=wt(Qv).current;return t.next=e,Jv(t.effect),t.trampoline}function Qv(){const e={next:void 0,callback:eb,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function eb(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const he=typeof document<"u"?f.useLayoutEffect:()=>{};function Ct(){}const tl=Object.freeze([]),mt=Object.freeze({});class Wo extends el{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){f.useDebugValue(t),he(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;he(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this;if(process.env.NODE_ENV!=="production"){f.useDebugValue(t,i=>Object.keys(i));const o=f.useRef(Object.keys(t)).current,s=Object.keys(t);(o.length!==s.length||o.some((i,a)=>i!==s[a]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const r=Object.values(t);he(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){f.useDebugValue(t);const r=n!==void 0;if(he(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r]),process.env.NODE_ENV!=="production"){const o=this.controlledValues??=new Map;o.has(t)||o.set(t,r);const s=o.get(t);s!==void 0&&s!==r&&console.error(`A component is changing the ${r?"":"un"}controlled state of ${t.toString()} to be ${r?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return f.useDebugValue(t),We(this,this.selectors[t],n,r,o)}useContextCallback(t,n){f.useDebugValue(t);const r=ie(n??Ct);this.context[t]=r}useStateSetter(t){const n=f.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const a=o;o=i,n(i,a,this)}})}}function Zo(){return typeof window<"u"}function kt(e){return ji(e)?(e.nodeName||"").toLowerCase():"#document"}function tt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mn(e){var t;return(t=(ji(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ji(e){return Zo()?e instanceof Node||e instanceof tt(e).Node:!1}function $e(e){return Zo()?e instanceof Element||e instanceof tt(e).Element:!1}function it(e){return Zo()?e instanceof HTMLElement||e instanceof tt(e).HTMLElement:!1}function kr(e){return!Zo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tt(e).ShadowRoot}function Bn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function tb(e){return/^(table|td|th)$/.test(kt(e))}function Go(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const nb=/transform|translate|scale|rotate|perspective|filter/,rb=/paint|layout|strict|content/,nr=e=>!!e&&e!=="none";let Hi;function Ui(e){const t=$e(e)?At(e):e;return nr(t.transform)||nr(t.translate)||nr(t.scale)||nr(t.rotate)||nr(t.perspective)||!Yo()&&(nr(t.backdropFilter)||nr(t.filter))||nb.test(t.willChange||"")||rb.test(t.contain||"")}function ob(e){let t=Nn(e);for(;it(t)&&!Rn(t);){if(Ui(t))return t;if(Go(t))return null;t=Nn(t)}return null}function Yo(){return Hi==null&&(Hi=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hi}function Rn(e){return/^(html|body|#document)$/.test(kt(e))}function At(e){return tt(e).getComputedStyle(e)}function Xo(e){return $e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nn(e){if(kt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kr(e)&&e.host||mn(e);return kr(t)?t.host:t}function nl(e){const t=Nn(e);return Rn(t)?e.ownerDocument?e.ownerDocument.body:e.body:it(t)&&Bn(t)?t:nl(t)}function io(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=nl(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=tt(o);if(s){const a=Bi(i);return t.concat(i,i.visualViewport||[],Bn(o)?o:[],a&&n?io(a):[])}else return t.concat(o,io(o,[],n))}function Bi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gn(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ie(e){return e?.ownerDocument||document}function Fe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const qo=null;let rl=globalThis.requestAnimationFrame;class sb{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV!=="production"&&rl!==requestAnimationFrame&&(rl=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Ko=new sb;class yn{static create(){return new yn}static request(t){return Ko.request(t)}static cancel(t){return Ko.cancel(t)}currentId=qo;request(t){this.cancel(),this.currentId=Ko.request(()=>{this.currentId=qo,t()})}cancel=()=>{this.currentId!==qo&&(Ko.cancel(this.currentId),this.currentId=qo)};disposeEffect=()=>this.cancel}function ao(){const e=wt(yn.create).current;return so(e.disposeEffect),e}const co=0;class Zt{static create(){return new Zt}currentId=co;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=co,n()},t)}isStarted(){return this.currentId!==co}clear=()=>{this.currentId!==co&&(clearTimeout(this.currentId),this.currentId=co)};disposeEffect=()=>this.clear}function Gt(){const e=wt(Zt.create).current;return so(e.disposeEffect),e}let ol=0;function ib(e){return ol+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ol}`}function Wi(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const Rr=typeof navigator<"u",Zi=cb(),sl=lb(),il=ub(),Gi=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),al=Zi.platform==="MacIntel"&&Zi.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Zi.platform),ab=Rr&&/apple/i.test(navigator.vendor),Jo=Rr&&/android/i.test(sl)||/android/i.test(il);Rr&&sl.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const cl=il.includes("jsdom/");function cb(){if(!Rr)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function ub(){if(!Rr)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function lb(){if(!Rr)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Yi="data-base-ui-focusable",ul="active",ll="selected",dl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Wn="ArrowLeft",Zn="ArrowRight",Xi="ArrowUp",uo="ArrowDown";function Pt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function we(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&kr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function lt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function fl(e,t){if(!$e(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(we(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function un(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function db(e){return e.matches("html,body")}function qi(e){return it(e)&&e.matches(dl)}function fb(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${dl}`)!=null}function Ki(e){return e?e.getAttribute("role")==="combobox"&&qi(e):!1}function Ji(e){if(!e||cl)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function lo(e){return e?e.hasAttribute(Yi)?e:e.querySelector(`[${Yi}]`)||e:null}function vn(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...vn(e,o.id,n)])}function pl(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Yt(e){e.preventDefault(),e.stopPropagation()}function pb(e){return"nativeEvent"in e}function hl(e){return e.pointerType===""&&e.isTrusted?!0:Jo&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ml(e){return cl?!1:!Jo&&e.width===0&&e.height===0||Jo&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function fo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function gl(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const hb=["top","right","bottom","left"],Nr=Math.min,Xt=Math.max,Qo=Math.round,rr=Math.floor,bn=e=>({x:e,y:e}),mb={left:"right",right:"left",bottom:"top",top:"bottom"};function Qi(e,t,n){return Xt(e,Nr(t,n))}function Mn(e,t){return typeof e=="function"?e(t):e}function jt(e){return e.split("-")[0]}function Gn(e){return e.split("-")[1]}function ea(e){return e==="x"?"y":"x"}function ta(e){return e==="y"?"height":"width"}function en(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function na(e){return ea(en(e))}function gb(e,t,n){n===void 0&&(n=!1);const r=Gn(e),o=na(e),s=ta(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=es(i)),[i,es(i)]}function yb(e){const t=es(e);return[ra(e),t,ra(t)]}function ra(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const yl=["left","right"],vl=["right","left"],vb=["top","bottom"],bb=["bottom","top"];function wb(e,t,n){switch(e){case"top":case"bottom":return n?t?vl:yl:t?yl:vl;case"left":case"right":return t?vb:bb;default:return[]}}function Sb(e,t,n,r){const o=Gn(e);let s=wb(jt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ra)))),s}function es(e){const t=jt(e);return mb[t]+e.slice(t.length)}function Eb(e){return{top:0,right:0,bottom:0,left:0,...e}}function bl(e){return typeof e!="number"?Eb(e):{top:e,right:e,bottom:e,left:e}}function po(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ts(e,t,n){return Math.floor(e/t)!==n}function ns(e,t){return t<0||t>=e.length}function oa(e,t){return Dt(e.current,{disabledIndices:t})}function wl(e,t){return Dt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Dt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&Mr(e,s,r));return s}function xb(e,{event:t,orientation:n,loopFocus:r,onLoop:o,rtl:s,cols:i,disabledIndices:a,minIndex:c,maxIndex:u,prevIndex:l,stopEvent:d=!1}){let p=l,h;if(t.key===Xi?h="up":t.key===uo&&(h="down"),h){const m=[],g=[];let v=!1,y=0;{let $=null,M=-1;e.forEach((V,L)=>{if(V==null)return;y+=1;const D=V.closest('[role="row"]');D&&(v=!0),(D!==$||M===-1)&&($=D,M+=1,m[M]=[]),m[M].push(L),g[L]=M})}let C=!1,S=0;if(v)for(const $ of m){const M=$.length;M>S&&(S=M),M!==i&&(C=!0)}const E=C&&y<e.length,b=S||i,x=$=>{if(!C||l===-1)return;const M=g[l];if(M==null)return;const V=m[M].indexOf(l),L=$==="up"?-1:1;for(let D=M+L,R=0;R<m.length;R+=1,D+=L){if(D<0||D>=m.length){if(!r||E)return;if(D=D<0?m.length-1:0,o){const I=Math.min(V,m[D].length-1),_=m[D][I]??m[D][0],N=o(t,l,_);D=g[N]??D}}const O=m[D];for(let I=Math.min(V,O.length-1);I>=0;I-=1){const _=O[I];if(!Mr(e,_,a))return _}}},T=$=>{if(!E||l===-1)return;const M=l%b,V=$==="up"?-b:b,L=u-u%b,D=rr(u/b)+1;for(let R=l-M+V,O=0;O<D;O+=1,R+=V){if(R<0||R>u){if(!r)return;R=R<0?L:0}const I=Math.min(R+b-1,u);for(let _=Math.min(R+M,I);_>=R;_-=1)if(!Mr(e,_,a))return _}};d&&Yt(t);const P=x(h)??T(h);if(P!==void 0)p=P;else if(l===-1)p=h==="up"?u:c;else if(p=Dt(e,{startingIndex:l,amount:b,decrement:h==="up",disabledIndices:a}),r){if(h==="up"&&(l-b<c||p<0)){const $=l%b,M=u%b,V=u-(M-$);M===$?p=u:p=M>$?V:V-b,o&&(p=o(t,l,p))}h==="down"&&l+b>u&&(p=Dt(e,{startingIndex:l%b-b,amount:b,disabledIndices:a}),o&&(p=o(t,l,p)))}ns(e,p)&&(p=l)}if(n==="both"){const m=rr(l/i);t.key===(s?Wn:Zn)&&(d&&Yt(t),l%i!==i-1?(p=Dt(e,{startingIndex:l,disabledIndices:a}),r&&ts(p,i,m)&&(p=Dt(e,{startingIndex:l-l%i-1,disabledIndices:a}),o&&(p=o(t,l,p)))):r&&(p=Dt(e,{startingIndex:l-l%i-1,disabledIndices:a}),o&&(p=o(t,l,p))),ts(p,i,m)&&(p=l)),t.key===(s?Zn:Wn)&&(d&&Yt(t),l%i!==0?(p=Dt(e,{startingIndex:l,decrement:!0,disabledIndices:a}),r&&ts(p,i,m)&&(p=Dt(e,{startingIndex:l+(i-l%i),decrement:!0,disabledIndices:a}),o&&(p=o(t,l,p)))):r&&(p=Dt(e,{startingIndex:l+(i-l%i),decrement:!0,disabledIndices:a}),o&&(p=o(t,l,p))),ts(p,i,m)&&(p=l));const g=rr(u/i)===m;ns(e,p)&&(r&&g?(p=t.key===(s?Zn:Wn)?u:Dt(e,{startingIndex:l-l%i-1,disabledIndices:a}),o&&(p=o(t,l,p))):p=l)}return p}function Cb(e,t,n){const r=[];let o=0;return e.forEach(({width:s,height:i},a)=>{if(s>t&&process.env.NODE_ENV!=="production")throw new Error(`[Floating UI]: Invalid grid - item width at index ${a} is greater than grid columns`);let c=!1;for(;!c;){const u=[];for(let l=0;l<s;l+=1)for(let d=0;d<i;d+=1)u.push(o+l+d*t);o%t+s<=t&&u.every(l=>r[l]==null)?(u.forEach(l=>{r[l]=a}),c=!0):o+=1}}),[...r]}function Tb(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e);default:return-1}}function Ob(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Mr(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?rs(o)?!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!0:!1}function Pb(e){return e.visibility==="hidden"||e.visibility==="collapse"}function rs(e,t=e?At(e):null){return!e||!e.isConnected||!t||Pb(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const _b='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Ib(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return kr(n)?n.host:null}function sa(e){for(const t of Array.from(e.children))if(kt(t)==="summary")return t;return null}function kb(e,t){const n=sa(t);return!!n&&(e===n||we(n,e))}function Sl(e){const t=e?kt(e):"";return e!=null&&e.matches(_b)&&(t!=="summary"||e.parentElement!=null&&kt(e.parentElement)==="details"&&sa(e.parentElement)===e)&&(t!=="details"||sa(e)==null)&&(t!=="input"||e.type!=="hidden")}function El(e){if(!Sl(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Ib(t)){const n=t!==e,r=kt(t)==="slot";if(t.hasAttribute("inert")||n&&kt(t)==="details"&&!t.open&&!kb(e,t)||t.hasAttribute("hidden")||!r&&!Rb(t,n))return!1}return!0}function Rb(e,t){const n=At(e);return t?n.display!=="none":rs(e,n)}function xl(e){const t=e.tabIndex;if(t<0){const n=kt(e);if(n==="details"||n==="audio"||n==="video"||it(e)&&e.isContentEditable)return 0}return t}function ia(e){if(kt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Nb(e,t){const n=ia(e);if(!n)return!0;const r=t.find(o=>{const s=ia(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=ia(o);return s?.name===n.name&&s.form===n.form})===n}function Cl(e){if(it(e)&&kt(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return it(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Tl(e,t){Cl(e).forEach(n=>{Sl(n)&&t.push(n),Tl(n,t)})}function Ol(e,t,n){Cl(e).forEach(r=>{it(r)&&r.matches(t)&&n.push(r),Ol(r,t,n)})}function aa(e){return El(e)&&xl(e)>=0}function Pl(e){const t=[];return Tl(e,t),t.filter(El)}function ho(e){const t=Pl(e);return t.filter(n=>xl(n)>=0&&Nb(n,t))}function _l(e,t){const n=ho(e),r=n.length;if(r===0)return;const o=Pt(Ie(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function ca(e){return _l(Ie(e).body,1)||e}function Il(e){return _l(Ie(e).body,-1)||e}function kl(e,t){if(!e)return null;const n=ho(Ie(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Mb(e){return kl(e,1)}function Ab(e){return kl(e,-1)}function Ar(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!we(n,r)}function Db(e){ho(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rl(e){const t=[];Ol(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const os=Vv(e=>e.toasts,e=>{const t=new Map;let n=0,r=0;return e.forEach((o,s)=>{const i=o.transitionStatus==="ending";t.set(o.id,{value:o,domIndex:s,visibleIndex:i?-1:n,offsetY:r}),r+=o.height||0,i||(n+=1)}),t}),wn={toasts:de(e=>e.toasts),isEmpty:de(e=>e.toasts.length===0),toast:de(os,(e,t)=>e.get(t)?.value),toastIndex:de(os,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:de(os,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:de(os,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:de(e=>e.hovering),focused:de(e=>e.focused),expanded:de(e=>e.hovering||e.focused),expandedOrOutOfFocus:de(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:de(e=>e.prevFocusElement)};class Lb extends Wo{timers=new Map;areTimersPaused=!1;constructor(t){super(t,{},wn)}setFocused(t){this.set("focused",t)}setHovering(t){this.set("hovering",t)}setIsWindowFocused(t){this.set("isWindowFocused",t)}setPrevFocusElement(t){this.set("prevFocusElement",t)}setViewport=t=>{this.set("viewport",t)};disposeEffect=()=>()=>{this.timers.forEach(t=>{t.timeout?.clear()}),this.timers.clear()};removeToast(t,n={}){const r=wn.toastIndex(this.state,t);if(r===-1)return;const o=this.state.toasts[r];n.skipOnRemove||o?.onRemove?.();const s=[...this.state.toasts];s.splice(r,1),this.setToasts(s)}addToast=t=>{const{timeout:n,limit:r}=this.state,o=t.id||ib("toast");if(t.id){const u=wn.toast(this.state,t.id);if(u)if(u.transitionStatus==="ending")this.removeToast(t.id,{skipOnRemove:!0});else{const{id:l,transitionStatus:d,...p}=t;return this.updateToastInternal(t.id,p,{resetTimer:!0,markUpdated:!0}),t.id}}const s={...t,id:o,updateKey:0,transitionStatus:"starting"},i=[s,...this.state.toasts],a=i.filter(u=>u.transitionStatus!=="ending");if(a.length>r){const u=a.length-r,l=a.slice(-u),d=new Set(l.map(p=>p.id));this.setToasts(i.map(p=>{const h=d.has(p.id);return p.limited!==h?{...p,limited:h}:p}))}else this.setToasts(i.map(u=>u.limited?{...u,limited:!1}:u));const c=s.timeout??n;return s.type!=="loading"&&c>0&&this.scheduleTimer(o,c,()=>this.closeToast(o)),wn.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),o};updateToast=(t,n)=>{this.updateToastInternal(t,n,{markUpdated:!0})};updateToastInternal=(t,n,r={})=>{const{timeout:o,toasts:s}=this.state,i=wn.toast(this.state,t)??null;if(!i||i.transitionStatus==="ending")return;const a={...i,...n,...r.markUpdated&&{updateKey:(i.updateKey??0)+1}};this.setToasts(s.map(g=>g.id===t?a:g));const c=a.timeout??o,u=i?.timeout??o,l=Object.hasOwn(n,"timeout"),d=a.transitionStatus!=="ending"&&a.type!=="loading"&&c>0,p=this.timers.has(t),h=u!==c,m=i?.type==="loading";if(!d&&p){this.timers.get(t)?.timeout?.clear(),this.timers.delete(t);return}if(d&&(!p||h||l||m||r.resetTimer)){const g=this.timers.get(t);g&&(g.timeout?.clear(),this.timers.delete(t)),this.scheduleTimer(t,c,()=>this.closeToast(t)),wn.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=t=>{const n=t===void 0,{limit:r,toasts:o}=this.state;let s;if(n)s=o,this.timers.forEach(u=>{u.timeout?.clear()}),this.timers.clear();else{const u=wn.toast(this.state,t);if(!u)return;s=[u];const l=this.timers.get(t);l?.timeout&&(l.timeout.clear(),this.timers.delete(t))}let i=0;const c={toasts:o.map(u=>{if(n||u.id===t)return{...u,transitionStatus:"ending",height:0};if(u.transitionStatus==="ending")return u;const l=i>=r;return i+=1,u.limited!==l?{...u,limited:l}:u})};(n||o.length===1)&&(c.hovering=!1,c.focused=!1),this.update(c),s.forEach(u=>{u.transitionStatus!=="ending"&&u.onClose?.()}),this.handleFocusManagement(t)};promiseToast=(t,n)=>{const r=Wi(n.loading),o=this.addToast({...r,type:"loading"}),s=t.then(i=>{const a=Wi(n.success,i);return this.updateToast(o,{...a,type:"success",timeout:a.timeout}),i}).catch(i=>{const a=Wi(n.error,i);return this.updateToast(o,{...a,type:"error",timeout:a.timeout}),Promise.reject(i)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(s),s};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(t=>{if(t.timeout){t.timeout.clear();const n=Date.now()-t.start,r=t.delay-n;t.remaining=r>0?r:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((t,n)=>{t.remaining=t.remaining>0?t.remaining:t.delay,t.timeout??=Zt.create(),t.timeout.start(t.remaining,()=>{this.timers.delete(n),t.callback()}),t.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=t=>{if(t.pointerType!=="touch")return;const n=lt(t);we(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(t,n,r){const o=Date.now(),s=!wn.expandedOrOutOfFocus(this.state),i=s?Zt.create():void 0;i?.start(n,()=>{this.timers.delete(t),r()}),this.timers.set(t,{timeout:i,start:s?o:0,delay:n,remaining:n,callback:r})}setToasts(t){const n={toasts:t};t.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(t){const n=Pt(Ie(this.state.viewport));if(!this.state.viewport||!we(this.state.viewport,n)||!Ji(n))return;if(t===void 0){this.restoreFocusToPrevElement();return}const r=wn.toasts(this.state),o=wn.toastIndex(this.state,t);let s=null,i=o+1;for(;i<r.length;){if(r[i].transitionStatus!=="ending"){s=r[i];break}i+=1}if(!s)for(i=o-1;i>=0;){if(r[i].transitionStatus!=="ending"){s=r[i];break}i-=1}s?s.ref?.current?.focus():this.restoreFocusToPrevElement()}}const Nl=function(t){const{children:n,timeout:r=5e3,limit:o=3,toastManager:s}=t,i=wt(()=>new Lb({timeout:r,limit:o,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return so(i.disposeEffect),f.useEffect(function(){return s?s[" subscribe"](({action:u,options:l})=>{const d=l.id;u==="promise"&&l.promise?i.promiseToast(l.promise,l):u==="update"&&d?i.updateToast(d,l):u==="close"?i.closeToast(d):i.addToast(l)}):void 0},[i,r,s]),i.useSyncedValues({timeout:r,limit:o}),w.jsx(zo.Provider,{value:i,children:n})};process.env.NODE_ENV!=="production"&&(Nl.displayName="ToastProvider");const Ml={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ss={...Ml,position:"fixed",top:0,left:0},Al={...Ml,position:"absolute"},Sn=f.forwardRef(function(t,n){const[r,o]=f.useState();he(()=>{ab&&o("button")},[]);const s={tabIndex:0,role:r};return w.jsx("span",{...t,ref:n,style:ss,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(Sn.displayName="FocusGuard");function or(e,t,n,r){const o=wt(Dl).current;return Vb(o,e,t,n,r)&&Ll(o,[e,t,n,r]),o.callback}function Fb(e){const t=wt(Dl).current;return zb(t,e)&&Ll(t,e),t.callback}function Dl(){return{callback:null,cleanup:null,refs:[]}}function Vb(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function zb(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function Ll(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(r[o]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=r[o];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}function Fl(e){if(!f.isValidElement(e))return null;const t=e,n=t.props;return(zi(19)?n?.ref:t.ref)??null}function ua(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}let la;process.env.NODE_ENV!=="production"&&(la=new Set);function $b(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");la.has(t)||(la.add(t),console.warn(`Base UI: ${t}`))}}function jb(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const s=t[r](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function Hb(e,t){return typeof e=="function"?e(t):e}function Ub(e,t){return typeof e=="function"?e(t):e}const da={};function En(e,t,n,r,o){if(!n&&!r&&!o&&!e)return is(t);let s=is(e);return t&&(s=mo(s,t)),n&&(s=mo(s,n)),r&&(s=mo(s,r)),o&&(s=mo(s,o)),s}function Bb(e){if(e.length===0)return da;if(e.length===1)return is(e[0]);let t=is(e[0]);for(let n=1;n<e.length;n+=1)t=mo(t,e[n]);return t}function is(e){return fa(e)?{...zl(e,da)}:Wb(e)}function mo(e,t){return fa(t)?zl(t,e):Zb(e,t)}function Wb(e){const t={...e};for(const n in t){const r=t[n];Vl(n,r)&&(t[n]=$l(r))}return t}function Zb(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=ua(e.style,r);break}case"className":{e[n]=jl(e.className,r);break}default:Vl(n,r)?e[n]=Gb(e[n],r):e[n]=r}}return e}function Vl(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function fa(e){return typeof e=="function"}function zl(e,t){return fa(e)?e(t):e??da}function Gb(e,t){return t?e?(...n)=>{const r=n[0];if(Hl(r)){const s=r;as(s);const i=t(...n);return s.baseUIHandlerPrevented||e?.(...n),i}const o=t(...n);return e?.(...n),o}:$l(t):e}function $l(e){return e&&((...t)=>{const n=t[0];return Hl(n)&&as(n),e(...t)})}function as(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function jl(e,t){return t?e?t+" "+e:t:e}function Hl(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function qe(e,t,n={}){const r=t.render,o=Yb(t,n);if(n.enabled===!1)return null;const s=n.state??mt;return Qb(e,r,o,s)}function Yb(e,t={}){const{className:n,style:r,render:o}=e,{state:s=mt,ref:i,props:a,stateAttributesMapping:c,enabled:u=!0}=t,l=u?Hb(n,s):void 0,d=u?Ub(r,s):void 0,p=u?jb(s,c):mt,h=u&&a?Xb(a):void 0,m=u?ua(p,h)??{}:mt;return typeof document<"u"&&(u?Array.isArray(i)?m.ref=Fb([m.ref,Fl(o),...i]):m.ref=or(m.ref,Fl(o),i):or(null,null)),u?(l!==void 0&&(m.className=jl(m.className,l)),d!==void 0&&(m.style=ua(m.style,d)),m):mt}function Xb(e){return Array.isArray(e)?Bb(e):En(void 0,e)}const qb=Symbol.for("react.lazy"),Kb=/^[A-Z][A-Za-z0-9$]*$/,Jb=/[a-z]/;function Qb(e,t,n,r){if(t){if(typeof t=="function")return process.env.NODE_ENV!=="production"&&e0(t),t(n,r);const o=En(n,t.props);o.ref=n.ref;let s=t;if(s?.$$typeof===qb&&(s=f.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!f.isValidElement(s))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
|
|
16
|
-
`));return f.cloneElement(s,o)}if(e&&typeof e=="string")return t0(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":ft(8))}function e0(e){const t=e.name;t.length!==0&&Kb.test(t)&&Jb.test(t)&&$b(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.","If this is an intentional render callback, rename it to start with a lowercase letter.","Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.","https://base-ui.com/r/invalid-render-prop")}function t0(e,t){return e==="button"?oe.createElement("button",{type:"button",...t,key:t.key}):e==="img"?oe.createElement("img",{alt:"",...t,key:t.key}):f.createElement(e,t)}let n0=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const Ul=f.forwardRef(function(t,n){const{render:r,className:o,style:s,children:i,...a}=t,c=Hu(),u=Gt(),l=f.useRef(!1),d=f.useRef(!1),p=f.useRef(!1),h=c.useState("isEmpty"),m=c.useState("toasts"),g=c.useState("focused"),v=c.useState("expanded"),y=c.useState("prevFocusElement"),C=m[0]?.height??0,S=f.useMemo(()=>m.some(_=>_.transitionStatus==="ending"),[m]);f.useEffect(()=>{const _=c.state.viewport;if(!_)return;function N(j){h||j.key==="F6"&<(j)!==_&&(j.preventDefault(),c.setPrevFocusElement(Pt(Ie(_))),_?.focus({preventScroll:!0}),c.pauseTimers(),c.setFocused(!0))}const A=tt(_);return Fe(A,"keydown",N)},[c,h]),f.useEffect(()=>{const _=c.state.viewport;if(!_||h)return;const N=tt(_);function A(B){lt(B)===N&&(c.setIsWindowFocused(!1),c.pauseTimers())}function j(B){if(B.relatedTarget)return;const U=lt(B),W=Pt(Ie(_));(U===N||!we(_,U)||!Ji(W))&&c.resumeTimers(),u.start(0,()=>c.setIsWindowFocused(!0))}return gn(Fe(N,"blur",A,!0),Fe(N,"focus",j,!0))},[c,u,h]),f.useEffect(()=>{const _=c.state.viewport;if(!_||h)return;const N=Ie(_);return Fe(N,"pointerdown",c.handleDocumentPointerDown,!0)},[h,c]);function E(_){const N=c.state.viewport;N&&(l.current=!0,_.relatedTarget===N?m[0]?.ref?.current?.focus():c.restoreFocusToPrevElement())}function b(_){_.key==="Tab"&&_.shiftKey&<(_.nativeEvent)===c.state.viewport&&(_.preventDefault(),c.restoreFocusToPrevElement(),c.resumeTimers())}function x(){const _=c.state.toasts.some(N=>N.transitionStatus==="ending");!c.state.isWindowFocused||_||p.current||!d.current||(c.resumeTimers(),c.setHovering(!1),d.current=!1)}f.useEffect(x,[S,c]);function T(){c.pauseTimers(),c.setHovering(!0),d.current=!1}function P(){S||p.current?d.current=!0:(c.resumeTimers(),c.setHovering(!1))}function $(_){_.pointerType==="touch"&&(p.current=!0)}function M(_){_.pointerType==="touch"&&(p.current=!1,x())}function V(){if(l.current){l.current=!1;return}g||Ji(Pt(Ie(c.state.viewport)))&&(c.setFocused(!0),c.pauseTimers())}function L(_){!g||we(c.state.viewport,_.relatedTarget)||(c.setFocused(!1),c.resumeTimers())}const D={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:T,onMouseMove:T,onMouseLeave:P,onFocus:V,onBlur:L,onKeyDown:b,onClick:V,onPointerDown:$,onPointerUp:M,onPointerCancel:M},R={expanded:v},O=qe("div",t,{ref:[n,c.setViewport],state:R,props:[D,{style:{[n0.frontmostHeight]:C?`${C}px`:void 0}},a,{children:w.jsxs(f.Fragment,{children:[!h&&y&&w.jsx(Sn,{onFocus:E}),i,!h&&y&&w.jsx(Sn,{onFocus:E})]})}]}),I=f.useMemo(()=>m.filter(_=>_.priority==="high"),[m]);return w.jsxs(f.Fragment,{children:[!h&&y&&w.jsx(Sn,{onFocus:E}),O,!g&&I.length>0&&w.jsx("div",{style:ss,children:I.map(_=>w.jsxs("div",{role:"alert","aria-atomic":!0,children:[w.jsx("div",{children:_.title}),w.jsx("div",{children:_.description})]},_.id))})]})});process.env.NODE_ENV!=="production"&&(Ul.displayName="ToastViewport");function cs(e){return zi(19)?e:e?"true":void 0}const pa=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(pa.displayName="ToastRootContext");function r0(){const e=f.useContext(pa);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.":ft(66));return e}let sr=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const o0={[sr.startingStyle]:""},s0={[sr.endingStyle]:""},tn={transitionStatus(e){return e==="starting"?o0:e==="ending"?s0:null}};function An(e){return e==null?e:"current"in e?e.current:e}function Bl(e,t=!1,n=!0){const r=ao();return ie((o,s=null)=>{r.cancel();const i=An(e);if(i==null)return;const a=i,c=()=>{Kt.flushSync(o)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){o();return}function u(){Promise.all(a.getAnimations().map(l=>l.finished)).then(()=>{s?.aborted||c()}).catch(()=>{if(n){s?.aborted||c();return}const l=a.getAnimations();!s?.aborted&&l.length>0&&l.some(d=>d.pending||d.playState!=="finished")&&u()})}if(t){const l=sr.startingStyle;if(!a.hasAttribute(l)){r.request(u);return}const d=new MutationObserver(()=>{a.hasAttribute(l)||(d.disconnect(),u())});d.observe(a,{attributes:!0,attributeFilter:[l]}),s?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}r.request(u)})}function xn(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=ie(o),i=Bl(r,n,!1);f.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}let ir=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const i0=500,a0={style:{transition:"none"}},ha="data-base-ui-click-trigger",c0="data-base-ui-swipe-ignore",u0="data-swipe-ignore",Wl=`[${c0}]`,l0=`[${u0}]`,d0={fallbackAxisSide:"none"},f0={fallbackAxisSide:"end"},p0={clipPath:"inset(50%)",position:"fixed",top:0,left:0},h0={...tn,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},go=40,m0=10,Yn=.5,g0=1,y0=`${Wl},${l0}`;function Zl(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function v0(e){const n=tt(e).getComputedStyle(e).transform;let r=0,o=0,s=1;if(n&&n!=="none"){const i=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(i){const a=i[1].split(", ").map(parseFloat);a.length===6?(r=a[4],o=a[5],s=Math.sqrt(a[0]*a[0]+a[1]*a[1])):a.length===16&&(r=a[12],o=a[13],s=a[0])}}return{x:r,y:o,scale:s}}const Gl=f.forwardRef(function(t,n){const{toast:r,render:o,className:s,swipeDirection:i=["down","right"],style:a,...c}=t,u=r.positionerProps?.anchor!==void 0;let l=[];u||(l=Array.isArray(i)?i:[i]);const d=l.length>0,p=Hu(),[h,m]=f.useState(void 0),[g,v]=f.useState(!1),[y,C]=f.useState(!1),[S,E]=f.useState(!1),[b,x]=f.useState({x:0,y:0}),[T,P]=f.useState({x:0,y:0,scale:1}),[$,M]=f.useState(),[V,L]=f.useState(),[D,R]=f.useState(null),O=f.useRef(null),I=f.useRef({x:0,y:0}),_=f.useRef({x:0,y:0,scale:1}),N=f.useRef(void 0),A=f.useRef(0),j=f.useRef(!1),B=f.useRef({x:0,y:0}),U=f.useRef(!1),W=p.useState("toastIndex",r.id),G=p.useState("toastVisibleIndex",r.id),Z=p.useState("toastOffsetY",r.id),X=p.useState("focused"),K=p.useState("expanded");xn({open:r.transitionStatus!=="ending",ref:O,onComplete(){r.transitionStatus==="ending"&&p.removeToast(r.id)}});const J=ie((k=!1)=>{const H=O.current;if(!H)return;const F=H.style.height;H.style.height="auto";const z=H.offsetHeight;H.style.height=F;function Q(){p.updateToastInternal(r.id,{ref:O,height:z,...r.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}k?Kt.flushSync(Q):Q()});he(J,[J]);function se(k,H){let F=k,z=H;return!l.includes("left")&&!l.includes("right")?F=k>0?k**Yn:-(Math.abs(k)**Yn):(!l.includes("right")&&k>0&&(F=k**Yn),!l.includes("left")&&k<0&&(F=-(Math.abs(k)**Yn))),!l.includes("up")&&!l.includes("down")?z=H>0?H**Yn:-(Math.abs(H)**Yn):(!l.includes("down")&&H>0&&(z=H**Yn),!l.includes("up")&&H<0&&(z=-(Math.abs(H)**Yn))),{x:F,y:z}}function ae(k){if(k.button!==0)return;k.pointerType==="touch"&&p.pauseTimers();const H=lt(k.nativeEvent);if(!(H&&H.closest(`button,a,input,textarea,[role="button"],${y0}`))){if(j.current=!1,N.current=void 0,A.current=0,I.current={x:k.clientX,y:k.clientY},B.current=I.current,O.current){const z=v0(O.current);_.current=z,P(z),x({x:z.x,y:z.y})}p.setHovering(!0),v(!0),C(!1),R(null),U.current=!0,O.current?.setPointerCapture(k.pointerId)}}function pe(k){if(!g)return;k.preventDefault(),U.current&&(I.current={x:k.clientX,y:k.clientY},U.current=!1);const{clientY:H,clientX:F,movementX:z,movementY:Q}=k;(Q<0&&H>B.current.y||Q>0&&H<B.current.y)&&(B.current={x:B.current.x,y:H}),(z<0&&F>B.current.x||z>0&&F<B.current.x)&&(B.current={x:F,y:B.current.y});const ne=F-I.current.x,te=H-I.current.y,ye=H-B.current.y,_e=F-B.current.x;if(!y&&Math.sqrt(ne*ne+te*te)>=g0&&(C(!0),D===null)){const He=l.includes("left")||l.includes("right"),nt=l.includes("up")||l.includes("down");if(He&&nt){const st=Math.abs(ne),Re=Math.abs(te);R(st>Re?"horizontal":"vertical")}}let Ee;if(!N.current)D==="vertical"?te>0?Ee="down":te<0&&(Ee="up"):D==="horizontal"?ne>0?Ee="right":ne<0&&(Ee="left"):Math.abs(ne)>=Math.abs(te)?Ee=ne>0?"right":"left":Ee=te>0?"down":"up",Ee&&l.includes(Ee)&&(N.current=Ee,A.current=Zl(Ee,ne,te),m(Ee));else{const Ge=N.current,He=Zl(Ge,_e,ye);He>go?(j.current=!1,m(Ge)):!(l.includes("left")&&l.includes("right"))&&!(l.includes("up")&&l.includes("down"))&&A.current-He>=m0&&(j.current=!0)}const Ce=se(ne,te);let Pe=_.current.x,Ve=_.current.y;D==="horizontal"?(l.includes("left")||l.includes("right"))&&(Pe+=Ce.x):(D==="vertical"||(l.includes("left")||l.includes("right"))&&(Pe+=Ce.x),(l.includes("up")||l.includes("down"))&&(Ve+=Ce.y)),x({x:Pe,y:Ve})}function Y(k){if(!g)return;if(v(!1),C(!1),R(null),O.current?.releasePointerCapture(k.pointerId),j.current){x({x:T.x,y:T.y}),m(void 0);return}let H=!1;const F=b.x-T.x,z=b.y-T.y;let Q;for(const ne of l){switch(ne){case"right":F>go&&(H=!0,Q="right");break;case"left":F<-go&&(H=!0,Q="left");break;case"down":z>go&&(H=!0,Q="down");break;case"up":z<-go&&(H=!0,Q="up");break}if(H)break}H?(m(Q),E(!0),p.closeToast(r.id)):(x({x:T.x,y:T.y}),m(void 0))}function me(){g&&(v(!1),C(!1),R(null),x({x:T.x,y:T.y}),m(void 0))}function ge(k){if(k.key==="Escape"){if(!O.current||!we(O.current,Pt(Ie(O.current))))return;p.closeToast(r.id)}}f.useEffect(()=>{if(!d)return;const k=O.current;if(!k)return;function H(F){we(k,lt(F))&&F.preventDefault()}return Fe(k,"touchmove",H,{passive:!1})},[d]);function fe(){if(!g&&b.x===T.x&&b.y===T.y&&!S)return{[ir.swipeMovementX]:"0px",[ir.swipeMovementY]:"0px"};const k=b.x-T.x,H=b.y-T.y;return{transition:g?"none":void 0,transform:g?`translateX(${b.x}px) translateY(${b.y}px) scale(${T.scale})`:void 0,[ir.swipeMovementX]:`${k}px`,[ir.swipeMovementY]:`${H}px`}}const le=r.priority==="high",ce={role:le?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":$,"aria-describedby":V,"aria-hidden":le&&!X?!0:void 0,onPointerDown:d?ae:void 0,onPointerMove:d?pe:void 0,onPointerUp:d?Y:void 0,onPointerCancel:d?me:void 0,onKeyDown:ge,inert:cs(r.limited),style:{...fe(),[ir.index]:r.transitionStatus==="ending"?W:G,[ir.offsetY]:`${Z}px`,[ir.height]:r.height?`${r.height}px`:void 0}},ve=f.useMemo(()=>({rootRef:O,toast:r,titleId:$,setTitleId:M,descriptionId:V,setDescriptionId:L,swiping:g,swipeDirection:h,recalculateHeight:J,index:W,visibleIndex:G,expanded:K}),[r,$,V,g,h,J,W,G,K]),ue={transitionStatus:r.transitionStatus,expanded:K,limited:r.limited||!1,type:r.type,swiping:ve.swiping,swipeDirection:ve.swipeDirection},Se=qe("div",t,{ref:[n,ve.rootRef],state:ue,stateAttributesMapping:h0,props:[ce,c]});return w.jsx(pa.Provider,{value:ve,children:Se})});process.env.NODE_ENV!=="production"&&(Gl.displayName="ToastRoot");const Dr={...f};let Yl=0;function b0(e,t="mui"){const[n,r]=f.useState(e),o=e||n;return f.useEffect(()=>{n==null&&(Yl+=1,r(`${t}-${Yl}`))},[n,t]),o}const Xl=Dr.useId;function Xn(e,t){if(Xl!==void 0){const n=Xl();return e??(t?`${t}-${n}`:n)}return b0(e,t)}const ql=f.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,children:a,...c}=t,{toast:u,setDescriptionId:l}=r0(),d=a??u.description,p=!!d,h=Xn(i);he(()=>{if(p)return l(h),()=>{l(void 0)}},[p,h,l]);const m={type:u.type},g=qe("p",t,{ref:n,state:m,props:{...c,id:h,children:d}});return p?g:null});process.env.NODE_ENV!=="production"&&(ql.displayName="ToastDescription");let ma;process.env.NODE_ENV!=="production"&&(ma=new Set);function ar(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ma.has(t)||(ma.add(t),console.error(`Base UI: ${t}`))}}const Kl=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Kl.displayName="CompositeRootContext");function w0(e=!1){const t=f.useContext(Kl);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":ft(16));return t}function S0(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,i=r&&t!==!1,a=r&&t===!1;return{props:f.useMemo(()=>{const u={onKeyDown(l){n&&t&&l.key!=="Tab"&&l.preventDefault()}};return r||(u.tabIndex=o,!s&&n&&(u.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||a)&&(u.disabled=n),u},[r,n,t,i,a,s,o])}}function Lr(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0,composite:s}=e,i=f.useRef(null),a=w0(!0),c=s??a!==void 0,{props:u}=S0({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:o});process.env.NODE_ENV!=="production"&&f.useEffect(()=>{if(!i.current)return;const h=us(i.current);if(o){if(!h){const m=Dr.captureOwnerStack?.()||"";ar(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${m}`)}}else if(h){const m=Dr.captureOwnerStack?.()||"";ar(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${m}`)}},[o]);const l=f.useCallback(()=>{const h=i.current;us(h)&&c&&t&&u.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,u.disabled,c]);he(l,[l]);const d=f.useCallback((h={})=>{const{onClick:m,onMouseDown:g,onKeyUp:v,onKeyDown:y,onPointerDown:C,...S}=h;return En({type:o?"button":void 0,onClick(b){if(t){b.preventDefault();return}m?.(b)},onMouseDown(b){t||g?.(b)},onKeyDown(b){if(t||(as(b),y?.(b),b.baseUIHandlerPrevented))return;const x=b.target===b.currentTarget,T=b.currentTarget,P=us(T),$=!o&&E0(T),M=x&&(o?P:!$),V=b.key==="Enter",L=b.key===" ",D=T.getAttribute("role"),R=D?.startsWith("menuitem")||D==="option"||D==="gridcell";if(x&&c&&L){if(b.defaultPrevented&&R)return;b.preventDefault(),$||o&&P?(T.click(),b.preventBaseUIHandler()):M&&(m?.(b),b.preventBaseUIHandler());return}M&&(!o&&(L||V)&&b.preventDefault(),!o&&V&&m?.(b))},onKeyUp(b){if(!t){if(as(b),v?.(b),b.target===b.currentTarget&&o&&c&&us(b.currentTarget)&&b.key===" "){b.preventDefault();return}b.baseUIHandlerPrevented||b.target===b.currentTarget&&!o&&!c&&b.key===" "&&m?.(b)}},onPointerDown(b){if(t){b.preventDefault();return}C?.(b)}},o?void 0:{role:"button"},u,S)},[t,u,c,o]),p=ie(h=>{i.current=h,l()});return{getButtonProps:d,buttonRef:p}}function us(e){return it(e)&&e.tagName==="BUTTON"}function E0(e){return!!(e?.tagName==="A"&&e?.href)}function x0(e,t){return t!=null&&!fo(t)?0:typeof e=="function"?e():e}function ga(e,t,n){const r=x0(e,n);return typeof r=="number"?r:r?.[t]}function Jl(e){return typeof e=="function"?e():e}function Ql(e,t){return t||e==="click"||e==="mousedown"}const cr="none",Fr="trigger-press",Lt="trigger-hover",ya="outside-press",va="item-press",C0="close-press",ur="focus-out",ed="escape-key",T0="close-watcher",ba="list-navigation",O0="cancel-open",td="imperative-action",ls="swipe",P0="window-resize";function Ae(e,t,n,r){let o=!1,s=!1;const i=mt;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...i}}function _0(e,t,n){const r=mt;return{reason:e,event:t??new Event("base-ui"),...r}}function vt(e){const t=wt(I0,e).current;return t.next=e,he(t.effect),t}function I0(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ds(e){return`data-base-ui-${e}`}let fs=0;function ps(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(fs);const s=()=>e?.focus({preventScroll:n});if(o)return s(),Ct;const i=requestAnimationFrame(s);return fs=i,()=>{fs===i&&(cancelAnimationFrame(i),fs=0)}}const wa={inert:new WeakMap,"aria-hidden":new WeakMap},nd="data-base-ui-inert",Sa={inert:new WeakSet,"aria-hidden":new WeakSet};let yo=new WeakMap,Ea=0;function k0(e){return Sa[e]}function rd(e){return e?kr(e)?e.host:rd(e.parentNode):null}const xa=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=rd(n);return e.contains(r)?r:null}).filter(n=>n!=null),od=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},sd=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{kt(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function R0(e,t,n,r,{mark:o=!0,markerIgnoreElements:s=[]}){const i=r?"inert":n?"aria-hidden":null;let a=null,c=null;const u=xa(t,e),l=o?xa(t,s):[],d=new Set(l),p=o?sd(t,od(u),new Set(u)).filter(g=>!d.has(g)):[],h=[],m=[];if(i){const g=wa[i],v=k0(i);c=v,a=g;const y=xa(t,Array.from(t.querySelectorAll("[aria-live]"))),C=u.concat(y);sd(t,od(C),new Set(C)).forEach(E=>{const b=E.getAttribute(i),x=b!==null&&b!=="false",T=(g.get(E)||0)+1;g.set(E,T),h.push(E),T===1&&x&&v.add(E),x||E.setAttribute(i,i==="inert"?"":"true")})}return o&&p.forEach(g=>{const v=(yo.get(g)||0)+1;yo.set(g,v),m.push(g),v===1&&g.setAttribute(nd,"")}),Ea+=1,()=>{a&&h.forEach(g=>{const y=(a.get(g)||0)-1;a.set(g,y),y||(!c?.has(g)&&i&&g.removeAttribute(i),c?.delete(g))}),o&&m.forEach(g=>{const v=(yo.get(g)||0)-1;yo.set(g,v),v||g.removeAttribute(nd)}),Ea-=1,Ea||(wa.inert=new WeakMap,wa["aria-hidden"]=new WeakMap,Sa.inert=new WeakSet,Sa["aria-hidden"]=new WeakSet,yo=new WeakMap)}}function id(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0,markerIgnoreElements:s=[]}=t,i=Ie(e[0]).body;return R0(e,i,n,r,{mark:o,markerIgnoreElements:s})}const Ca=f.createContext(null);process.env.NODE_ENV!=="production"&&(Ca.displayName="PortalContext");const ad=()=>f.useContext(Ca),N0=ds("portal");function cd(e={}){const{ref:t,container:n,componentProps:r=mt,elementProps:o}=e,s=Xn(),a=ad()?.portalNode,[c,u]=f.useState(null),[l,d]=f.useState(null),p=ie(v=>{v!==null&&d(v)}),h=f.useRef(null);he(()=>{if(n===null){h.current&&(h.current=null,d(null),u(null));return}if(s==null)return;const v=(n&&(ji(n)?n:n.current))??a??document.body;if(v==null){h.current&&(h.current=null,d(null),u(null));return}h.current!==v&&(h.current=v,d(null),u(v))},[n,a,s]);const m=qe("div",r,{ref:[t,p],props:[{id:s,[N0]:""},o]});return{portalNode:l,portalSubtree:c&&m?Kt.createPortal(m,c):null}}const hs=f.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,renderGuards:a,style:c,...u}=t,{portalNode:l,portalSubtree:d}=cd({container:o,ref:n,componentProps:t,elementProps:u}),p=f.useRef(null),h=f.useRef(null),m=f.useRef(null),g=f.useRef(null),[v,y]=f.useState(null),C=f.useRef(!1),S=v?.modal,E=v?.open,b=typeof a=="boolean"?a:!!v&&!v.modal&&v.open&&!!l;f.useEffect(()=>{if(!l||S)return;function T(P){l&&P.relatedTarget&&Ar(P)&&(P.type==="focusin"?C.current&&(Rl(l),C.current=!1):(Db(l),C.current=!0))}return gn(Fe(l,"focusin",T,!0),Fe(l,"focusout",T,!0))},[l,S]),f.useEffect(()=>{!l||E!==!1||(Rl(l),C.current=!1)},[E,l]);const x=f.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:h,beforeInsideRef:m,afterInsideRef:g,portalNode:l,setFocusManagerState:y}),[l]);return w.jsxs(f.Fragment,{children:[d,w.jsxs(Ca.Provider,{value:x,children:[b&&l&&w.jsx(Sn,{"data-type":"outside",ref:p,onFocus:T=>{if(Ar(T,l))m.current?.focus();else{const P=v?v.domReference:null;Il(P)?.focus()}}}),b&&l&&w.jsx("span",{"aria-owns":l.id,style:p0}),l&&Kt.createPortal(r,l),b&&l&&w.jsx(Sn,{"data-type":"outside",ref:h,onFocus:T=>{if(Ar(T,l))g.current?.focus();else{const P=v?v.domReference:null;ca(P)?.focus(),v?.closeOnFocusOut&&v?.onOpenChange(!1,Ae(ur,T.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(hs.displayName="FloatingPortal");function ud(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class M0{nodesRef={current:[]};events=ud();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Ta=f.createContext(null);process.env.NODE_ENV!=="production"&&(Ta.displayName="FloatingNodeContext");const Oa=f.createContext(null);process.env.NODE_ENV!=="production"&&(Oa.displayName="FloatingTreeContext");const qn=()=>f.useContext(Ta)?.id||null,lr=e=>{const t=f.useContext(Oa);return e??t};function A0(e){const t=Xn(),n=lr(e),r=qn();return he(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function D0(e){const{children:t,id:n}=e,r=qn();return w.jsx(Ta.Provider,{value:f.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function L0(e){const{children:t,externalTree:n}=e,r=wt(()=>n??new M0).current;return w.jsx(Oa.Provider,{value:r,children:t})}function F0(e,t){const n=tt(lt(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||(e.detail===0?"keyboard":"mouse"):""}const ld=20;let Kn=[];function Pa(){Kn=Kn.filter(e=>e.deref()?.isConnected)}function V0(e){Pa(),e&&kt(e)!=="body"&&(Kn.push(new WeakRef(e)),Kn.length>ld&&(Kn=Kn.slice(-ld)))}function _a(){return Pa(),Kn[Kn.length-1]?.deref()}function z0(e){return e?aa(e)?e:ho(e)[0]||e:null}function dd(e,t){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const r=Pl(e).filter(s=>{const i=s.getAttribute("data-tabindex")||"";return aa(s)||s.hasAttribute("data-tabindex")&&!i.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ms(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:l,previousFocusableElement:d,beforeContentFocusGuardRef:p,externalTree:h,getInsideElements:m}=e,g="rootStore"in t?t.rootStore:t,v=g.useState("open"),y=g.useState("domReferenceElement"),C=g.useState("floatingElement"),{events:S,dataRef:E}=g.context,b=ie(()=>E.current.floatingContext?.nodeId),x=o===!1,T=Ki(y)&&x,P=f.useRef(["content"]),$=vt(o),M=vt(s),V=vt(u),L=lr(h),D=ad(),R=f.useRef(!1),O=f.useRef(!1),I=f.useRef(!1),_=f.useRef(null),N=f.useRef(""),A=f.useRef(""),j=f.useRef(null),B=f.useRef(null),U=or(j,p,D?.beforeInsideRef),W=or(B,D?.afterInsideRef),G=Gt(),Z=Gt(),X=ao(),K=D!=null,J=lo(C),se=ie((Y=J)=>Y?ho(Y):[]),ae=ie(()=>m?.().filter(Y=>Y!=null)??[]);f.useEffect(()=>{if(r||!a)return;function Y(ge){ge.key==="Tab"&&we(J,Pt(Ie(J)))&&se().length===0&&!T&&Yt(ge)}const me=Ie(J);return Fe(me,"keydown",Y)},[r,y,J,a,P,T,se]),f.useEffect(()=>{if(r||!v)return;const Y=Ie(J);function me(){I.current=!1}function ge(le){const ce=lt(le),ve=ae(),ue=we(C,ce)||we(y,ce)||we(D?.portalNode,ce)||ve.some(Se=>Se===ce||we(Se,ce));I.current=!ue,A.current=le.pointerType||"keyboard",ce?.closest(`[${ha}]`)&&(O.current=!0)}function fe(){A.current="keyboard"}return gn(Fe(Y,"pointerdown",ge,!0),Fe(Y,"pointerup",me,!0),Fe(Y,"pointercancel",me,!0),Fe(Y,"keydown",fe,!0))},[r,C,y,J,v,D,ae]),f.useEffect(()=>{if(r||!c)return;const Y=Ie(J);function me(){O.current=!0,Z.start(0,()=>{O.current=!1})}function ge(ve){const ue=lt(ve);aa(ue)&&(_.current=ue)}function fe(ve){const ue=ve.relatedTarget,Se=ve.currentTarget,k=lt(ve);queueMicrotask(()=>{const H=b(),F=g.context.triggerElements,z=ae(),Q=ue?.hasAttribute(ds("focus-guard"))&&[j.current,B.current,D?.beforeInsideRef.current,D?.afterInsideRef.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,An(d),An(l)].includes(ue),ne=!(we(y,ue)||we(C,ue)||we(ue,C)||we(D?.portalNode,ue)||z.some(te=>te===ue||we(te,ue))||ue!=null&&F.hasElement(ue)||F.hasMatchingElement(te=>we(te,ue))||Q||L&&(vn(L.nodesRef.current,H).find(te=>we(te.context?.elements.floating,ue)||we(te.context?.elements.domReference,ue))||pl(L.nodesRef.current,H).find(te=>[te.context?.elements.floating,lo(te.context?.elements.floating)].includes(ue)||te.context?.elements.domReference===ue)));if(Se===y&&J&&dd(J,P),i&&Se!==y&&!rs(k)&&Pt(Y)===Y.body){if(it(J)&&(J.focus(),i==="popup")){X.request(()=>{J.focus()});return}const te=se(),ye=_.current,_e=(ye&&te.includes(ye)?ye:null)||te[te.length-1]||J;it(_e)&&_e.focus()}if(E.current.insideReactTree){E.current.insideReactTree=!1;return}(T||!a)&&ue&&ne&&!O.current&&(T||ue!==_a())&&(R.current=!0,g.setOpen(!1,Ae(ur,ve)))})}function le(){I.current||(E.current.insideReactTree=!0,G.start(0,()=>{E.current.insideReactTree=!1}))}const ce=it(y)?y:null;if(!(!C&&!ce))return gn(ce&&Fe(ce,"focusout",fe),ce&&Fe(ce,"pointerdown",me),C&&Fe(C,"focusin",ge),C&&Fe(C,"focusout",fe),C&&D&&Fe(C,"focusout",le,!0))},[r,y,C,J,a,L,D,g,c,i,se,T,b,P,E,G,Z,X,l,d,ae]),f.useEffect(()=>{if(r||!C||!v)return;const Y=Array.from(D?.portalNode?.querySelectorAll(`[${ds("portal")}]`)||[]),ge=(L?pl(L.nodesRef.current,b()):[]).find(Se=>Ki(Se.context?.elements.domReference||null))?.context?.elements.domReference,le=[...[C,...Y,j.current,B.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,...ae()],ge,An(d),An(l),T?y:null].filter(Se=>Se!=null),ce=id(le,{ariaHidden:a||T,mark:!1}),ve=[C,...Y].filter(Se=>Se!=null),ue=id(ve);return()=>{ue(),ce()}},[v,r,y,C,a,P,D,T,L,b,l,d,ae]),he(()=>{if(!v||r||!it(J))return;const Y=Ie(J),me=Pt(Y);queueMicrotask(()=>{const ge=$.current,fe=typeof ge=="function"?ge(V.current||""):ge;if(fe===void 0||fe===!1||we(J,me))return;let ce=null;const ve=()=>(ce==null&&(ce=se(J)),ce[0]||J);let ue;fe===!0||fe===null?ue=ve():ue=An(fe),ue=ue||ve(),ps(ue,{preventScroll:ue===J})})},[r,v,J,x,se,$,V]),he(()=>{if(r||!J)return;const Y=Ie(J),me=Pt(Y);V0(me);function ge(le){if(le.open||(N.current=F0(le.nativeEvent,A.current)),le.reason===Lt&&le.nativeEvent.type==="mouseleave"&&(R.current=!0),le.reason===ya)if(le.nested)R.current=!1;else if(hl(le.nativeEvent)||ml(le.nativeEvent))R.current=!1;else{let ce=!1;Ie(J).createElement("div").focus({get preventScroll(){return ce=!0,!1}}),ce?R.current=!1:R.current=!0}}S.on("openchange",ge);function fe(){const le=M.current;let ce=typeof le=="function"?le(N.current):le;if(ce===void 0||ce===!1)return null;if(ce===null&&(ce=!0),typeof ce=="boolean"){const ue=y||_a();return ue&&ue.isConnected?ue:null}const ve=y||_a();return An(ce)||ve||null}return()=>{S.off("openchange",ge);const le=Pt(Y),ce=ae(),ve=we(C,le)||ce.some(k=>k===le||we(k,le))||L&&vn(L.nodesRef.current,b(),!1).some(k=>we(k.context?.elements.floating,le)),ue=M.current,Se=fe();queueMicrotask(()=>{const k=z0(Se),H=typeof ue!="boolean";ue&&!R.current&&it(k)&&(!(!H&&k!==le&&le!==Y.body)||ve)&&k.focus({preventScroll:!0}),R.current=!1})}},[r,C,J,M,E,S,L,y,b,ae]),he(()=>{if(!Gi||v||!C)return;const Y=Pt(Ie(C));!it(Y)||!qi(Y)||we(C,Y)&&Y.blur()},[v,C]),he(()=>{if(!(r||!D))return D.setFocusManagerState({modal:a,closeOnFocusOut:c,open:v,onOpenChange:g.setOpen,domReference:y}),()=>{D.setFocusManagerState(null)}},[r,D,a,v,g,c,y]),he(()=>{if(!(r||!J))return dd(J,P),()=>{queueMicrotask(Pa)}},[r,J,P]);const pe=!r&&(a?!T:!0)&&(K||a);return w.jsxs(f.Fragment,{children:[pe&&w.jsx(Sn,{"data-type":"inside",ref:U,onFocus:Y=>{if(a){const me=se();ps(me[me.length-1])}else D?.portalNode&&(R.current=!1,Ar(Y,D.portalNode)?ca(y)?.focus():An(d??D.beforeOutsideRef)?.focus())}}),n,pe&&w.jsx(Sn,{"data-type":"inside",ref:W,onFocus:Y=>{a?ps(se()[0]):D?.portalNode&&(c&&(R.current=!0),Ar(Y,D.portalNode)?Il(y)?.focus():An(l??D.afterOutsideRef)?.focus())}})]})}function Ia(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:u=0,reason:l=Fr}=t,d=f.useRef(void 0),p=ao(),h=Gt(),m=f.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){const v=d.current,y=g.nativeEvent,C=n.select("open");if(g.button!==0||s==="click"||fo(v,!0)&&a)return;const S=r.current.openEvent,E=S?.type,b=n.select("domReferenceElement")!==g.currentTarget,x=C&&b||!(C&&i&&(!(S&&c)||E==="click"||E==="mousedown")),T=lt(y);if(qi(T)){const $=Ae(l,y,T);x&&v==="touch"&&u>0?h.start(u,()=>{n.setOpen(!0,$)}):n.setOpen(x,$);return}const P=g.currentTarget;p.request(()=>{const $=Ae(l,y,P);x&&v==="touch"&&u>0?h.start(u,()=>{n.setOpen(!0,$)}):n.setOpen(x,$)})},onClick(g){if(s==="mousedown-only")return;const v=d.current;if(s==="mousedown"&&v){d.current=void 0;return}if(fo(v,!0)&&a)return;const y=n.select("open"),C=r.current.openEvent,S=n.select("domReferenceElement")!==g.currentTarget,E=y&&S||!(y&&i&&(!(C&&c)||gl(C))),b=Ae(l,g.nativeEvent,g.currentTarget);E&&v==="touch"&&u>0?h.start(u,()=>{n.setOpen(!0,b)}):n.setOpen(E,b)},onKeyDown(){d.current=void 0}}),[r,s,a,n,c,i,p,h,u,l]);return f.useMemo(()=>o?{reference:m}:mt,[o,m])}const $0={intentional:"onClick",sloppy:"onPointerDown"};function j0(){return!1}function H0(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function ka(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),{dataRef:s}=n.context,{enabled:i=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:u="sloppy",referencePress:l=j0,referencePressEvent:d="sloppy",bubbles:p,externalTree:h}=t,m=lr(h),g=ie(typeof c=="function"?c:()=>!1),v=typeof c=="function"?g:c,y=v!==!1,C=ie(()=>u),S=f.useRef(!1),E=f.useRef(!1),b=f.useRef(!1),{escapeKey:x,outsidePress:T}=H0(p),P=f.useRef(null),$=Gt(),M=Gt(),V=ie(()=>{M.clear(),s.current.insideReactTree=!1}),L=f.useRef(!1),D=f.useRef(""),R=ie(l),O=ie(B=>{if(!r||!i||!a||B.key!=="Escape"||L.current)return;const U=s.current.floatingContext?.nodeId,W=m?vn(m.nodesRef.current,U):[];if(!x&&W.length>0){let X=!0;if(W.forEach(K=>{K.context?.open&&!K.context.dataRef.current.__escapeKeyBubbles&&(X=!1)}),!X)return}const G=pb(B)?B.nativeEvent:B,Z=Ae(ed,G);n.setOpen(!1,Z),!x&&!Z.isPropagationAllowed&&B.stopPropagation()}),I=ie(()=>{s.current.insideReactTree=!0,M.start(0,V)});f.useEffect(()=>{if(!r||!i)return;s.current.__escapeKeyBubbles=x,s.current.__outsidePressBubbles=T;const B=new Zt,U=new Zt;function W(){B.clear(),L.current=!0}function G(){B.start(Yo()?5:0,()=>{L.current=!1})}function Z(){b.current=!0,U.start(0,()=>{b.current=!1})}function X(){S.current=!1,E.current=!1}function K(){const F=D.current,z=F==="pen"||!F?"mouse":F,Q=C(),ne=typeof Q=="function"?Q():Q;return typeof ne=="string"?ne:ne[z]}function J(F){const z=K();return z==="intentional"&&F.type!=="click"||z==="sloppy"&&F.type==="click"}function se(F){const z=s.current.floatingContext?.nodeId,Q=m&&vn(m.nodesRef.current,z).some(ne=>un(F,ne.context?.elements.floating));return un(F,n.select("floatingElement"))||un(F,n.select("domReferenceElement"))||Q}function ae(F){if(J(F)){V();return}if(s.current.insideReactTree){V();return}const z=lt(F),Q=`[${ds("inert")}]`,ne=$e(z)?z.getRootNode():null,te=Array.from((kr(ne)?ne:Ie(n.select("floatingElement"))).querySelectorAll(Q)),ye=n.context.triggerElements;if(z&&(ye.hasElement(z)||ye.hasMatchingElement(Pe=>we(Pe,z))))return;let _e=$e(z)?z:null;for(;_e&&!Rn(_e);){const Pe=Nn(_e);if(Rn(Pe)||!$e(Pe))break;_e=Pe}if(te.length&&$e(z)&&!db(z)&&!we(z,n.select("floatingElement"))&&te.every(Pe=>!we(_e,Pe)))return;if(it(z)&&!("touches"in F)){const Pe=Rn(z),Ve=At(z),Ge=/auto|scroll/,He=Pe||Ge.test(Ve.overflowX),nt=Pe||Ge.test(Ve.overflowY),st=He&&z.clientWidth>0&&z.scrollWidth>z.clientWidth,Re=nt&&z.clientHeight>0&&z.scrollHeight>z.clientHeight,Te=Ve.direction==="rtl",Ue=Re&&(Te?F.offsetX<=z.offsetWidth-z.clientWidth:F.offsetX>z.clientWidth),Be=st&&F.offsetY>z.clientHeight;if(Ue||Be)return}if(se(F))return;if(K()==="intentional"&&b.current){U.clear(),b.current=!1;return}if(typeof v=="function"&&!v(F))return;const Ee=s.current.floatingContext?.nodeId,Ce=m?vn(m.nodesRef.current,Ee):[];if(Ce.length>0){let Pe=!0;if(Ce.forEach(Ve=>{Ve.context?.open&&!Ve.context.dataRef.current.__outsidePressBubbles&&(Pe=!1)}),!Pe)return}n.setOpen(!1,Ae(ya,F)),V()}function pe(F){K()!=="sloppy"||F.pointerType==="touch"||!n.select("open")||!i||un(F,n.select("floatingElement"))||un(F,n.select("domReferenceElement"))||ae(F)}function Y(F){if(K()!=="sloppy"||!n.select("open")||!i||un(F,n.select("floatingElement"))||un(F,n.select("domReferenceElement")))return;const z=F.touches[0];z&&(P.current={startTime:Date.now(),startX:z.clientX,startY:z.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},$.start(1e3,()=>{P.current&&(P.current.dismissOnTouchEnd=!1,P.current.dismissOnMouseDown=!1)}))}function me(F,z){const Q=lt(F);if(!Q)return;const ne=Fe(Q,F.type,()=>{z(F),ne()})}function ge(F){D.current="touch",me(F,Y)}function fe(F){$.clear(),F.type==="pointerdown"&&(D.current=F.pointerType),!(F.type==="mousedown"&&P.current&&!P.current.dismissOnMouseDown)&&me(F,z=>{z.type==="pointerdown"?pe(z):ae(z)})}function le(F){if(!S.current)return;const z=E.current;if(X(),K()==="intentional"){if(F.type==="pointercancel"){z&&Z();return}if(!se(F)){if(z){Z();return}typeof v=="function"&&!v(F)||(U.clear(),b.current=!0,V())}}}function ce(F){if(K()!=="sloppy"||!P.current||un(F,n.select("floatingElement"))||un(F,n.select("domReferenceElement")))return;const z=F.touches[0];if(!z)return;const Q=Math.abs(z.clientX-P.current.startX),ne=Math.abs(z.clientY-P.current.startY),te=Math.sqrt(Q*Q+ne*ne);te>5&&(P.current.dismissOnTouchEnd=!0),te>10&&(ae(F),$.clear(),P.current=null)}function ve(F){me(F,ce)}function ue(F){K()!=="sloppy"||!P.current||un(F,n.select("floatingElement"))||un(F,n.select("domReferenceElement"))||(P.current.dismissOnTouchEnd&&ae(F),$.clear(),P.current=null)}function Se(F){me(F,ue)}const k=Ie(o),H=gn(a&&gn(Fe(k,"keydown",O),Fe(k,"compositionstart",W),Fe(k,"compositionend",G)),y&&gn(Fe(k,"click",fe,!0),Fe(k,"pointerdown",fe,!0),Fe(k,"pointerup",le,!0),Fe(k,"pointercancel",le,!0),Fe(k,"mousedown",fe,!0),Fe(k,"mouseup",le,!0),Fe(k,"touchstart",ge,!0),Fe(k,"touchmove",ve,!0),Fe(k,"touchend",Se,!0)));return()=>{H(),B.clear(),U.clear(),X(),b.current=!1}},[s,o,a,y,v,r,i,x,T,O,V,C,m,n,$]),f.useEffect(V,[v,V]);const _=f.useMemo(()=>({onKeyDown:O,[$0[d]]:B=>{R()&&n.setOpen(!1,Ae(Fr,B.nativeEvent))},...d!=="intentional"&&{onClick(B){R()&&n.setOpen(!1,Ae(Fr,B.nativeEvent))}}}),[O,n,d,R]),N=ie(B=>{if(!r||!i||B.button!==0)return;const U=lt(B.nativeEvent);we(n.select("floatingElement"),U)&&(S.current||(S.current=!0,E.current=!1))}),A=ie(B=>{!r||!i||(B.defaultPrevented||B.nativeEvent.defaultPrevented)&&S.current&&(E.current=!0)}),j=f.useMemo(()=>({onKeyDown:O,onPointerDown:A,onMouseDown:A,onClickCapture:I,onMouseDownCapture(B){I(),N(B)},onPointerDownCapture(B){I(),N(B)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[O,I,N,A]);return f.useMemo(()=>i?{reference:_,floating:j,trigger:_}:{},[i,_,j])}function fd(e,t,n){let{reference:r,floating:o}=e;const s=en(t),i=na(t),a=ta(i),c=jt(t),u=s==="y",l=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:l,y:r.y-o.height};break;case"bottom":h={x:l,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Gn(t)){case"start":h[i]-=p*(n&&u?-1:1);break;case"end":h[i]+=p*(n&&u?-1:1);break}return h}async function U0(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Mn(t,e),m=bl(h),v=a[p?d==="floating"?"reference":"floating":d],y=po(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:l,strategy:c})),C=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},b=po(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:S,strategy:c}):C);return{top:(y.top-b.top+m.top)/E.y,bottom:(b.bottom-y.bottom+m.bottom)/E.y,left:(y.left-b.left+m.left)/E.x,right:(b.right-y.right+m.right)/E.x}}const B0=50,W0=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:U0},c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:l,y:d}=fd(u,r,c),p=r,h=0;const m={};for(let g=0;g<s.length;g++){const v=s[g];if(!v)continue;const{name:y,fn:C}=v,{x:S,y:E,data:b,reset:x}=await C({x:l,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});l=S??l,d=E??d,m[y]={...m[y],...b},x&&h<B0&&(h++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(u=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:l,y:d}=fd(u,p,c)),g=-1)}return{x:l,y:d,placement:p,strategy:o,middlewareData:m}},Z0=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=Mn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=jt(o),C=en(a),S=jt(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=p||(S||!g?[es(a)]:yb(a)),x=m!=="none";!p&&x&&b.push(...Sb(a,g,m,E));const T=[a,...b],P=await c.detectOverflow(t,v),$=[];let M=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&$.push(P[y]),d){const R=gb(o,i,E);$.push(P[R[0]],P[R[1]])}if(M=[...M,{placement:o,overflows:$}],!$.every(R=>R<=0)){var V,L;const R=(((V=s.flip)==null?void 0:V.index)||0)+1,O=T[R];if(O&&(!(d==="alignment"?C!==en(O):!1)||M.every(N=>en(N.placement)===C?N.overflows[0]>0:!0)))return{data:{index:R,overflows:M},reset:{placement:O}};let I=(L=M.filter(_=>_.overflows[0]<=0).sort((_,N)=>_.overflows[1]-N.overflows[1])[0])==null?void 0:L.placement;if(!I)switch(h){case"bestFit":{var D;const _=(D=M.filter(N=>{if(x){const A=en(N.placement);return A===C||A==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(A=>A>0).reduce((A,j)=>A+j,0)]).sort((N,A)=>N[1]-A[1])[0])==null?void 0:D[0];_&&(I=_);break}case"initialPlacement":I=a;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function pd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hd(e){return hb.some(t=>e[t]>=0)}const G0=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Mn(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=pd(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:hd(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=pd(i,n.floating);return{data:{escapedOffsets:a,escaped:hd(a)}}}default:return{}}}}},md=new Set(["left","top"]);async function Y0(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=jt(n),a=Gn(n),c=en(n)==="y",u=md.has(i)?-1:1,l=s&&c?-1:1,d=Mn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*l,y:p*u}:{x:p*u,y:h*l}}const X0=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await Y0(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},q0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:C,y:S}=y;return{x:C,y:S}}},...u}=Mn(e,t),l={x:n,y:r},d=await s.detectOverflow(t,u),p=en(jt(o)),h=ea(p);let m=l[h],g=l[p];if(i){const y=h==="y"?"top":"left",C=h==="y"?"bottom":"right",S=m+d[y],E=m-d[C];m=Qi(S,m,E)}if(a){const y=p==="y"?"top":"left",C=p==="y"?"bottom":"right",S=g+d[y],E=g-d[C];g=Qi(S,g,E)}const v=c.fn({...t,[h]:m,[p]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[p]:a}}}}}},K0=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Mn(e,t),l={x:n,y:r},d=en(o),p=ea(d);let h=l[p],m=l[d];const g=Mn(a,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const S=p==="y"?"height":"width",E=s.reference[p]-s.floating[S]+v.mainAxis,b=s.reference[p]+s.reference[S]-v.mainAxis;h<E?h=E:h>b&&(h=b)}if(u){var y,C;const S=p==="y"?"width":"height",E=md.has(jt(o)),b=s.reference[d]-s.floating[S]+(E&&((y=i.offset)==null?void 0:y[d])||0)+(E?0:v.crossAxis),x=s.reference[d]+s.reference[S]+(E?0:((C=i.offset)==null?void 0:C[d])||0)-(E?v.crossAxis:0);m<b?m=b:m>x&&(m=x)}return{[p]:h,[d]:m}}}},J0=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=Mn(e,t),l=await i.detectOverflow(t,u),d=jt(o),p=Gn(o),h=en(o)==="y",{width:m,height:g}=s.floating;let v,y;d==="top"||d==="bottom"?(v=d,y=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,v=p==="end"?"top":"bottom");const C=g-l.top-l.bottom,S=m-l.left-l.right,E=Nr(g-l[v],C),b=Nr(m-l[y],S),x=!t.middlewareData.shift;let T=E,P=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),x&&!p){const M=Xt(l.left,0),V=Xt(l.right,0),L=Xt(l.top,0),D=Xt(l.bottom,0);h?P=m-2*(M!==0||V!==0?M+V:Xt(l.left,l.right)):T=g-2*(L!==0||D!==0?L+D:Xt(l.top,l.bottom))}await c({...t,availableWidth:P,availableHeight:T});const $=await i.getDimensions(a.floating);return m!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function gd(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=it(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Qo(n)!==s||Qo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ra(e){return $e(e)?e:e.contextElement}function Vr(e){const t=Ra(e);if(!it(t))return bn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=gd(t);let i=(s?Qo(n.width):n.width)/r,a=(s?Qo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Q0=bn(0);function yd(e){const t=tt(e);return!Yo()||!t.visualViewport?Q0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ew(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==tt(e)?!1:t}function dr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ra(e);let i=bn(1);t&&(r?$e(r)&&(i=Vr(r)):i=Vr(e));const a=ew(s,n,r)?yd(s):bn(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,l=o.width/i.x,d=o.height/i.y;if(s){const p=tt(s),h=r&&$e(r)?tt(r):r;let m=p,g=Bi(m);for(;g&&r&&h!==m;){const v=Vr(g),y=g.getBoundingClientRect(),C=At(g),S=y.left+(g.clientLeft+parseFloat(C.paddingLeft))*v.x,E=y.top+(g.clientTop+parseFloat(C.paddingTop))*v.y;c*=v.x,u*=v.y,l*=v.x,d*=v.y,c+=S,u+=E,m=tt(g),g=Bi(m)}}return po({width:l,height:d,x:c,y:u})}function gs(e,t){const n=Xo(e).scrollLeft;return t?t.left+n:dr(mn(e)).left+n}function vd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-gs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function tw(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=mn(r),a=t?Go(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=bn(1);const l=bn(0),d=it(r);if((d||!d&&!s)&&((kt(r)!=="body"||Bn(i))&&(c=Xo(r)),d)){const h=dr(r);u=Vr(r),l.x=h.x+r.clientLeft,l.y=h.y+r.clientTop}const p=i&&!d&&!s?vd(i,c):bn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+l.x+p.x,y:n.y*u.y-c.scrollTop*u.y+l.y+p.y}}function nw(e){return Array.from(e.getClientRects())}function rw(e){const t=mn(e),n=Xo(e),r=e.ownerDocument.body,o=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+gs(e);const a=-n.scrollTop;return At(r).direction==="rtl"&&(i+=Xt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const bd=25;function ow(e,t){const n=tt(e),r=mn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const l=Yo();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=gs(r);if(u<=0){const l=r.ownerDocument,d=l.body,p=getComputedStyle(d),h=l.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-h);m<=bd&&(s-=m)}else u<=bd&&(s+=u);return{width:s,height:i,x:a,y:c}}function sw(e,t){const n=dr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=it(e)?Vr(e):bn(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function wd(e,t,n){let r;if(t==="viewport")r=ow(e,n);else if(t==="document")r=rw(mn(e));else if($e(t))r=sw(t,n);else{const o=yd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return po(r)}function Sd(e,t){const n=Nn(e);return n===t||!$e(n)||Rn(n)?!1:At(n).position==="fixed"||Sd(n,t)}function iw(e,t){const n=t.get(e);if(n)return n;let r=io(e,[],!1).filter(a=>$e(a)&&kt(a)!=="body"),o=null;const s=At(e).position==="fixed";let i=s?Nn(e):e;for(;$e(i)&&!Rn(i);){const a=At(i),c=Ui(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Bn(i)&&!c&&Sd(e,i))?r=r.filter(l=>l!==i):o=a,i=Nn(i)}return t.set(e,r),r}function aw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Go(t)?[]:iw(t,this._c):[].concat(n),r],a=wd(t,i[0],o);let c=a.top,u=a.right,l=a.bottom,d=a.left;for(let p=1;p<i.length;p++){const h=wd(t,i[p],o);c=Xt(h.top,c),u=Nr(h.right,u),l=Nr(h.bottom,l),d=Xt(h.left,d)}return{width:u-d,height:l-c,x:d,y:c}}function cw(e){const{width:t,height:n}=gd(e);return{width:t,height:n}}function uw(e,t,n){const r=it(t),o=mn(t),s=n==="fixed",i=dr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=bn(0);function u(){c.x=gs(o)}if(r||!r&&!s)if((kt(t)!=="body"||Bn(o))&&(a=Xo(t)),r){const h=dr(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&u();s&&!r&&o&&u();const l=o&&!r&&!s?vd(o,a):bn(0),d=i.left+a.scrollLeft-c.x-l.x,p=i.top+a.scrollTop-c.y-l.y;return{x:d,y:p,width:i.width,height:i.height}}function Na(e){return At(e).position==="static"}function Ed(e,t){if(!it(e)||At(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mn(e)===n&&(n=n.ownerDocument.body),n}function xd(e,t){const n=tt(e);if(Go(e))return n;if(!it(e)){let o=Nn(e);for(;o&&!Rn(o);){if($e(o)&&!Na(o))return o;o=Nn(o)}return n}let r=Ed(e,t);for(;r&&tb(r)&&Na(r);)r=Ed(r,t);return r&&Rn(r)&&Na(r)&&!Ui(r)?n:r||ob(e)||n}const lw=async function(e){const t=this.getOffsetParent||xd,n=this.getDimensions,r=await n(e.floating);return{reference:uw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dw(e){return At(e).direction==="rtl"}const Cd={convertOffsetParentRelativeRectToViewportRelativeRect:tw,getDocumentElement:mn,getClippingRect:aw,getOffsetParent:xd,getElementRects:lw,getClientRects:nw,getDimensions:cw,getScale:Vr,isElement:$e,isRTL:dw};function Td(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fw(e,t){let n=null,r;const o=mn(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:l,top:d,width:p,height:h}=u;if(a||t(),!p||!h)return;const m=rr(d),g=rr(o.clientWidth-(l+p)),v=rr(o.clientHeight-(d+h)),y=rr(l),S={rootMargin:-m+"px "+-g+"px "+-v+"px "+-y+"px",threshold:Xt(0,Nr(1,c))||1};let E=!0;function b(x){const T=x[0].intersectionRatio;if(T!==c){if(!E)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Td(u,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(b,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,S)}n.observe(e)}return i(!0),s}function Od(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Ra(e),l=o||s?[...u?io(u):[],...t?io(t):[]]:[];l.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=u&&a?fw(u,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(y=>{let[C]=y;C&&C.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!c&&h.observe(u),t&&h.observe(t));let m,g=c?dr(e):null;c&&v();function v(){const y=dr(e);g&&!Td(g,y)&&n(),g=y,m=requestAnimationFrame(v)}return n(),()=>{var y;l.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),d?.(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const pw=X0,hw=q0,mw=Z0,gw=J0,yw=G0,vw=K0,bw=(e,t,n)=>{const r=new Map,o={platform:Cd,...n},s={...o.platform,_c:r};return W0(e,t,{...o,platform:s})};var ww=typeof document<"u",Sw=function(){},ys=ww?oe.useLayoutEffect:Sw;function vs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!vs(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!vs(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Pd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _d(e,t){const n=Pd(e);return Math.round(t*n)/n}function Ma(e){const t=f.useRef(e);return ys(()=>{t.current=e}),t}function Ew(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[l,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=f.useState(r);vs(p,r)||h(r);const[m,g]=f.useState(null),[v,y]=f.useState(null),C=f.useCallback(N=>{N!==x.current&&(x.current=N,g(N))},[]),S=f.useCallback(N=>{N!==T.current&&(T.current=N,y(N))},[]),E=s||m,b=i||v,x=f.useRef(null),T=f.useRef(null),P=f.useRef(l),$=c!=null,M=Ma(c),V=Ma(o),L=Ma(u),D=f.useCallback(()=>{if(!x.current||!T.current)return;const N={placement:t,strategy:n,middleware:p};V.current&&(N.platform=V.current),bw(x.current,T.current,N).then(A=>{const j={...A,isPositioned:L.current!==!1};R.current&&!vs(P.current,j)&&(P.current=j,Kt.flushSync(()=>{d(j)}))})},[p,t,n,V,L]);ys(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const R=f.useRef(!1);ys(()=>(R.current=!0,()=>{R.current=!1}),[]),ys(()=>{if(E&&(x.current=E),b&&(T.current=b),E&&b){if(M.current)return M.current(E,b,D);D()}},[E,b,D,M,$]);const O=f.useMemo(()=>({reference:x,floating:T,setReference:C,setFloating:S}),[C,S]),I=f.useMemo(()=>({reference:E,floating:b}),[E,b]),_=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!I.floating)return N;const A=_d(I.floating,l.x),j=_d(I.floating,l.y);return a?{...N,transform:"translate("+A+"px, "+j+"px)",...Pd(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:j}},[n,a,I.floating,l.x,l.y]);return f.useMemo(()=>({...l,update:D,refs:O,elements:I,floatingStyles:_}),[l,D,O,I,_])}const xw=(e,t)=>{const n=pw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cw=(e,t)=>{const n=hw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tw=(e,t)=>({fn:vw(e).fn,options:[e,t]}),Ow=(e,t)=>{const n=mw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pw=(e,t)=>{const n=gw(e);return{name:n.name,fn:n.fn,options:[e,t]}},_w=(e,t)=>{const n=yw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Iw={open:de(e=>e.open),transitionStatus:de(e=>e.transitionStatus),domReferenceElement:de(e=>e.domReferenceElement),referenceElement:de(e=>e.positionReference??e.referenceElement),floatingElement:de(e=>e.floatingElement),floatingId:de(e=>e.floatingId)};class Aa extends Wo{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:ud(),nested:r,triggerElements:s},Iw),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&gl(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function vo(e,t=!1,n=!1){const[r,o]=f.useState(e&&t?"idle":void 0),[s,i]=f.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),he(()=>{if(!e&&s&&r!=="ending"&&n){const a=yn.request(()=>{o("ending")});return()=>{yn.cancel(a)}}},[e,s,r,n]),he(()=>{if(!e||t)return;const a=yn.request(()=>{o(void 0)});return()=>{yn.cancel(a)}},[t,e]),he(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=yn.request(()=>{o("idle")});return()=>{yn.cancel(a)}},[t,e,s,r]),{mounted:s,setMounted:i,transitionStatus:r}}function kw(e,t){const n=f.useRef(null),r=f.useRef(null);return f.useCallback(o=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=r.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,r.current=null}o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function Id(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=kw(e,n),i=ie(a=>{if(s(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...r});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...r})});return he(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:o}}function kd(e){const t=e.useState("open");he(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function Rd(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=vo(e);t.useSyncedValues({mounted:r,transitionStatus:s});const i=ie(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return xn({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class bs{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);if(r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elementsSet.size!==this.idMap.size))throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.")}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function Rw(){return new Aa({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new bs,floatingId:"",syncOnly:!1,nested:!1,onOpenChange:void 0})}function Nd(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Rw(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:mt,inactiveTriggerProps:mt,popupProps:mt}}const ws=de(e=>e.triggerIdProp??e.activeTriggerId),Md={open:de(e=>e.openProp??e.open),mounted:de(e=>e.mounted),transitionStatus:de(e=>e.transitionStatus),floatingRootContext:de(e=>e.floatingRootContext),preventUnmountingOnClose:de(e=>e.preventUnmountingOnClose),payload:de(e=>e.payload),activeTriggerId:ws,activeTriggerElement:de(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:de((e,t)=>t!==void 0&&ws(e)===t),isOpenedByTrigger:de((e,t)=>t!==void 0&&ws(e)===t&&e.open),isMountedByTrigger:de((e,t)=>t!==void 0&&ws(e)===t&&e.mounted),triggerProps:de((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:de(e=>e.popupProps),popupElement:de(e=>e.popupElement),positionerElement:de(e=>e.positionerElement)};function Ad(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=Xn(),s=qn()!=null;if(process.env.NODE_ENV!=="production"){const a=r.reference;a&&!$e(a)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`","instead.")}const i=wt(()=>new Aa({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new bs,floatingId:o,syncOnly:!1,nested:s})).current;return he(()=>{const a={open:t,floatingId:o};r.reference!==void 0&&(a.referenceElement=r.reference,a.domReferenceElement=$e(r.reference)?r.reference:null),r.floating!==void 0&&(a.floatingElement=r.floating),i.update(a)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i}function Nw(e={}){const{nodeId:t,externalTree:n}=e,r=Ad(e),o=e.rootContext||r,s={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[i,a]=f.useState(null),c=f.useRef(null),u=lr(n);he(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const l=Ew({...e,elements:{...s,...i&&{reference:i}}}),d=f.useCallback(P=>{const $=$e(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;a($),l.refs.setReference($)},[l.refs]),[p,h]=f.useState(void 0),[m,g]=f.useState(null);o.useSyncedValue("referenceElement",p??null);const v=$e(p)?p:null;o.useSyncedValue("domReferenceElement",p===void 0?s.domReference:v),o.useSyncedValue("floatingElement",m);const y=f.useCallback(P=>{($e(P)||P===null)&&(c.current=P,h(P)),($e(l.refs.reference.current)||l.refs.reference.current===null||P!==null&&!$e(P))&&l.refs.setReference(P)},[l.refs,h]),C=f.useCallback(P=>{g(P),l.refs.setFloating(P)},[l.refs]),S=f.useMemo(()=>({...l.refs,setReference:y,setFloating:C,setPositionReference:d,domReference:c}),[l.refs,y,C,d]),E=f.useMemo(()=>({...l.elements,domReference:s.domReference}),[l.elements,s.domReference]),b=o.useState("open"),x=o.useState("floatingId"),T=f.useMemo(()=>({...l,dataRef:o.context.dataRef,open:b,onOpenChange:o.setOpen,events:o.context.events,floatingId:x,refs:S,elements:E,nodeId:t,rootStore:o}),[l,S,E,t,o,b,x]);return he(()=>{o.context.dataRef.current.floatingContext=T;const P=u?.nodesRef.current.find($=>$.id===t);P&&(P.context=T)}),f.useMemo(()=>({...l,context:T,refs:S,elements:E,rootStore:o}),[l,S,E,T,o])}function Dd(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,o=Xn(),s=qn()!=null,i=t.useState("open"),a=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),u=t.context.triggerElements,l=wt(()=>new Aa({open:i,transitionStatus:void 0,referenceElement:a,floatingElement:c,triggerElements:u,onOpenChange:r,floatingId:o,syncOnly:!0,nested:s})).current;return he(()=>{const d={open:i,floatingId:o,referenceElement:a,floatingElement:c};$e(a)&&(d.domReferenceElement=a),l.state.positionReference===l.state.referenceElement&&(d.positionReference=a),l.update(d)},[i,o,a,c,l]),l.context.onOpenChange=r,l.context.nested=s,l}class Da{constructor(){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 Zt,this.restTimeout=new Zt,this.handleCloseOptions=void 0}static create(){return new Da}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Ss=new WeakMap;function Es(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Ss.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Ss.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Ld(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t,s=Ss.get(n);s&&s!==e&&Es(s),Es(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,Ss.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function Fd(e){const t=wt(Da.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),so(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function Mw(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,nodeId:u}=t,l=Fd(n),d=lr(),p=qn(),h=ie(()=>Ql(i.current.openEvent?.type,l.interactedInside)),m=ie(()=>{const E=i.current.openEvent?.type;return E?.includes("mouse")&&E!=="mousedown"}),g=ie(E=>fl(E,n.context.triggerElements)),v=f.useCallback(E=>{const b=ga(c,"close",l.pointerType),x=()=>{n.setOpen(!1,Ae(Lt,E)),d?.events.emit("floating.closed",E)};b?l.openChangeTimeout.start(b,x):(l.openChangeTimeout.clear(),x())},[c,n,l,d]),y=ie(()=>{Es(l)}),C=ie(E=>{const b=lt(E);if(!fb(b)){l.interactedInside=!1;return}l.interactedInside=b?.closest("[aria-haspopup]")!=null});he(()=>{r||(l.pointerType=void 0,l.restTimeoutPending=!1,l.interactedInside=!1,y())},[r,l,y]),f.useEffect(()=>y,[y]),he(()=>{if(a&&r&&l.handleCloseOptions?.blockPointerEvents&&m()&&$e(s)&&o){const E=s,b=o,x=Ie(o),T=d?.nodesRef.current.find($=>$.id===p)?.context?.elements.floating;T&&(T.style.pointerEvents="");const P=l.handleCloseOptions?.getScope?.()??l.pointerEventsScopeElement??T??E.closest("[data-rootownerid]")??x.body;return Ld(l,{scopeElement:P,referenceElement:E,floatingElement:b}),()=>{y()}}},[a,r,s,o,l,m,d,p,y]);const S=Gt();f.useEffect(()=>{if(!a)return;function E(){l.openChangeTimeout.clear(),S.clear(),d?.events.off("floating.closed",x),y()}function b(P){if(d&&p&&vn(d.nodesRef.current,p).length>0){d.events.on("floating.closed",x);return}if(g(P.relatedTarget))return;const $=i.current.floatingContext?.nodeId??u,M=P.relatedTarget;if(!(d&&$&&$e(M)&&vn(d.nodesRef.current,$,!1).some(L=>we(L.context?.elements.floating,M)))){if(l.handler){l.handler(P);return}y(),h()||v(P)}}function x(P){!d||!p||vn(d.nodesRef.current,p).length>0||S.start(0,()=>{d.events.off("floating.closed",x),n.setOpen(!1,Ae(Lt,P)),d.events.emit("floating.closed",P)})}const T=o;return gn(T&&Fe(T,"mouseenter",E),T&&Fe(T,"mouseleave",b),T&&Fe(T,"pointerdown",C,!0),()=>{d?.events.off("floating.closed",x)})},[a,o,n,i,u,h,g,v,y,C,l,d,p,S])}const Aw={current:null};function Dw(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:o}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:u=0,move:l=!0,triggerElementRef:d=Aw,externalTree:p,isActiveTrigger:h=!0,getHandleCloseContext:m,isClosing:g}=t,v=lr(p),y=Fd(n),C=f.useRef(!1),S=vt(a),E=vt(i),b=vt(u),x=vt(s),T=vt(g);h&&(y.handleCloseOptions=S.current?.__options);const P=ie(()=>Ql(r.current.openEvent?.type,y.interactedInside)),$=ie(R=>fl(R,n.context.triggerElements)),M=ie((R,O,I)=>{const _=n.context.triggerElements;if(_.hasElement(O))return!R||!we(R,O);if(!$e(I))return!1;const N=I;return _.hasMatchingElement(A=>we(A,N))&&(!R||!we(R,N))}),V=ie((R,O=!0)=>{const I=ga(E.current,"close",y.pointerType);I?y.openChangeTimeout.start(I,()=>{n.setOpen(!1,Ae(Lt,R)),v?.events.emit("floating.closed",R)}):O&&(y.openChangeTimeout.clear(),n.setOpen(!1,Ae(Lt,R)),v?.events.emit("floating.closed",R))}),L=ie(()=>{if(!y.handler)return;Ie(n.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),D=ie(()=>{Es(y)});return f.useEffect(()=>L,[L]),f.useEffect(()=>{if(!s)return;function R(O){O.open?C.current=!1:(C.current=O.reason===Lt,L(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return o.on("openchange",R),()=>{o.off("openchange",R)}},[s,o,y,L]),f.useEffect(()=>{if(!s)return;const R=d.current??(h?n.select("domReferenceElement"):null);if(!$e(R))return;function O(_){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,c&&!fo(y.pointerType))return;const N=Jl(b.current),A=ga(E.current,"open",y.pointerType),j=lt(_),B=_.currentTarget??null,U=n.select("domReferenceElement");let W=B;if($e(j)&&!n.context.triggerElements.hasElement(j)){for(const Y of n.context.triggerElements.elements())if(we(Y,j)){W=Y;break}}$e(B)&&$e(U)&&!n.context.triggerElements.hasElement(B)&&we(B,U)&&(W=U);const G=W==null?!1:M(U,W,j),Z=n.select("open"),X=T.current?.()??n.select("transitionStatus")==="ending",K=!Z&&X&&C.current,J=!G&&$e(W)&&$e(U)&&we(U,W)&&K,se=N>0&&!A,ae=G&&(Z||K)||J,pe=!Z||G;if(ae){n.setOpen(!0,Ae(Lt,_,W));return}se||(A?y.openChangeTimeout.start(A,()=>{pe&&n.setOpen(!0,Ae(Lt,_,W))}):pe&&n.setOpen(!0,Ae(Lt,_,W)))}function I(_){if(P()){D();return}L();const N=n.select("domReferenceElement"),A=Ie(N);y.restTimeout.clear(),y.restTimeoutPending=!1;const j=r.current.floatingContext??m?.();if($(_.relatedTarget))return;if(S.current&&j){n.select("open")||y.openChangeTimeout.clear();const W=d.current;y.handler=S.current({...j,tree:v,x:_.clientX,y:_.clientY,onClose(){D(),L(),x.current&&!P()&&W===n.select("domReferenceElement")&&V(_,!0)}}),A.addEventListener("mousemove",y.handler),y.handler(_);return}(y.pointerType!=="touch"||!we(n.select("floatingElement"),_.relatedTarget))&&V(_)}return l?gn(Fe(R,"mousemove",O,{once:!0}),Fe(R,"mouseenter",O),Fe(R,"mouseleave",I)):gn(Fe(R,"mouseenter",O),Fe(R,"mouseleave",I))},[L,D,r,E,V,n,s,S,y,h,M,P,$,c,l,b,d,v,x,m,T]),f.useMemo(()=>{if(!s)return;function R(O){y.pointerType=O.pointerType}return{onPointerDown:R,onPointerEnter:R,onMouseMove(O){const{nativeEvent:I}=O,_=O.currentTarget,N=n.select("domReferenceElement"),A=n.select("open"),j=M(N,_,O.target);if(c&&!fo(y.pointerType))return;if(A&&j&&y.handleCloseOptions?.blockPointerEvents){const W=n.select("floatingElement");if(W){const G=y.handleCloseOptions?.getScope?.()??_.ownerDocument.body;Ld(y,{scopeElement:G,referenceElement:_,floatingElement:W})}}const B=Jl(b.current);if(A&&!j||B===0||!j&&y.restTimeoutPending&&O.movementX**2+O.movementY**2<2)return;y.restTimeout.clear();function U(){if(y.restTimeoutPending=!1,P())return;const W=n.select("open");!y.blockMouseMove&&(!W||j)&&n.setOpen(!0,Ae(Lt,I,_))}y.pointerType==="touch"?Kt.flushSync(()=>{U()}):j&&A?U():(y.restTimeoutPending=!0,y.restTimeout.start(B,U))}}},[s,y,P,M,c,n,b])}function bo(e=[]){const t=e.map(u=>u?.reference),n=e.map(u=>u?.floating),r=e.map(u=>u?.item),o=e.map(u=>u?.trigger),s=f.useCallback(u=>xs(u,e,"reference"),t),i=f.useCallback(u=>xs(u,e,"floating"),n),a=f.useCallback(u=>xs(u,e,"item"),r),c=f.useCallback(u=>xs(u,e,"trigger"),o);return f.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function xs(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Yi]="");for(const i in e)o&&e&&(i===ul||i===ll)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&Vd(s,a,o,r)}return Vd(s,e,o,r),s}function Vd(e,t,n,r){for(const o in t){const s=t[o];n&&(o===ul||o===ll)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...i)=>r.get(o)?.map(a=>a(...i)).find(a=>a!==void 0))):e[o]=s)}}const Lw="Escape";function Cs(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ts(e,t){return Cs(t,e===Xi||e===uo,e===Wn||e===Zn)}function La(e,t,n){return Cs(t,e===uo,n?e===Wn:e===Zn)||e==="Enter"||e===" "||e===""}function Fw(e,t,n){return Cs(t,n?e===Wn:e===Zn,e===uo)}function Vw(e,t,n,r){const o=n?e===Zn:e===Wn,s=e===Xi;return t==="both"||t==="horizontal"&&r&&r>1?e===Lw:Cs(t,o,s)}function zw(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:a,activeIndex:c,onNavigate:u=()=>{},enabled:l=!0,selectedIndex:d=null,allowEscape:p=!1,loopFocus:h=!1,nested:m=!1,rtl:g=!1,virtual:v=!1,focusItemOnOpen:y="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:S=!0,disabledIndices:E=void 0,orientation:b="vertical",parentOrientation:x,cols:T=1,id:P,resetOnPointerLeave:$=!0,externalTree:M}=t;process.env.NODE_ENV!=="production"&&(p&&(h||console.warn("`useListNavigation` looping must be enabled to allow escaping."),v||console.warn("`useListNavigation` must be virtual to allow escaping.")),b==="vertical"&&T>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const V=lo(o),L=vt(V),D=qn(),R=lr(M);he(()=>{i.current.orientation=b},[i,b]);const O=Ki(s),I=f.useRef(y),_=f.useRef(d??-1),N=f.useRef(null),A=f.useRef(!0),j=ie(k=>{u(_.current===-1?null:_.current,k)}),B=f.useRef(j),U=f.useRef(!!o),W=f.useRef(r),G=f.useRef(!1),Z=f.useRef(!1),X=f.useRef(null),K=vt(E),J=vt(r),se=vt(d),ae=vt($),pe=ie(()=>{function k(Q){v?R?.events.emit("virtualfocus",Q):X.current=ps(Q,{sync:G.current,preventScroll:!0})}const H=a.current[_.current],F=Z.current;H&&k(H),(G.current?Q=>Q():requestAnimationFrame)(()=>{const Q=a.current[_.current]||H;if(!Q)return;H||k(Q),ge&&(F||!A.current)&&Q.scrollIntoView?.({block:"nearest",inline:"nearest"})})});he(()=>{l&&(r&&o?(_.current=d??-1,I.current&&d!=null&&(Z.current=!0,j())):U.current&&(_.current=-1,B.current()))},[l,r,o,d,j]),he(()=>{if(l){if(!r){G.current=!1;return}if(o)if(c==null){if(G.current=!1,se.current!=null)return;if(U.current&&(_.current=-1,pe()),(!W.current||!U.current)&&I.current&&(N.current!=null||I.current===!0&&N.current==null)){let k=0;const H=()=>{a.current[0]==null?(k<2&&(k?requestAnimationFrame:queueMicrotask)(H),k+=1):(_.current=N.current==null||La(N.current,b,g)||m?oa(a):wl(a),N.current=null,j())};H()}}else ns(a.current,c)||(_.current=c,pe(),Z.current=!1)}},[l,r,o,c,se,m,a,b,g,j,pe,K]),he(()=>{if(!l||o||!R||v||!U.current)return;const k=R.nodesRef.current,H=k.find(Q=>Q.id===D)?.context?.elements.floating,F=Pt(Ie(o)),z=k.some(Q=>Q.context&&we(Q.context.elements.floating,F));H&&!z&&A.current&&H.focus({preventScroll:!0})},[l,o,R,D,v]),he(()=>{B.current=j,W.current=r,U.current=!!o}),he(()=>{r||(N.current=null,I.current=y)},[r,y]);const Y=c!=null,me=ie(k=>{if(!J.current)return;const H=a.current.indexOf(k.currentTarget);H!==-1&&(_.current!==H||c!==H)&&(_.current=H,j(k))}),ge=f.useMemo(()=>({onFocus(H){G.current=!0,me(H)},onClick:({currentTarget:H})=>H.focus({preventScroll:!0}),onMouseMove(H){G.current=!0,Z.current=!1,C&&me(H)},onPointerLeave(H){if(!J.current||!A.current||H.pointerType==="touch")return;G.current=!0;const F=H.relatedTarget;if(!(!C||a.current.includes(F))&&ae.current&&(X.current?.(),X.current=null,_.current=-1,j(H),!v)){const z=L.current,Q=Pt(Ie(z));z&&we(z,Q)&&z.focus({preventScroll:!0})}}}),[me,J,L,C,a,j,ae,v]),fe=f.useCallback(()=>x??R?.nodesRef.current.find(k=>k.id===D)?.context?.dataRef?.current.orientation,[D,R,x]),le=ie(k=>{if(A.current=!1,G.current=!0,k.which===229||!J.current&&k.currentTarget===L.current)return;if(m&&Vw(k.key,b,g,T)){Ts(k.key,fe())||Yt(k),n.setOpen(!1,Ae(ba,k.nativeEvent)),it(s)&&(v?R?.events.emit("virtualfocus",s):s.focus());return}const H=_.current,F=oa(a,E),z=wl(a,E);if(O||(k.key==="Home"&&(Yt(k),_.current=F,j(k)),k.key==="End"&&(Yt(k),_.current=z,j(k))),T>1){const Q=Array.from({length:a.current.length},()=>({width:1,height:1})),ne=Cb(Q,T),te=ne.findIndex(Ee=>Ee!=null&&!Mr(a.current,Ee,E)),ye=ne.reduce((Ee,Ce,Pe)=>Ce!=null&&!Mr(a.current,Ce,E)?Pe:Ee,-1),_e=ne[xb(ne.map(Ee=>Ee!=null?a.current[Ee]:null),{event:k,orientation:b,loopFocus:h,rtl:g,cols:T,disabledIndices:Ob([...(typeof E!="function"?E:null)||a.current.map((Ee,Ce)=>Mr(a.current,Ce,E)?Ce:void 0),void 0],ne),minIndex:te,maxIndex:ye,prevIndex:Tb(_.current>z?F:_.current,Q,ne,T,k.key===uo?"bl":k.key===(g?Wn:Zn)?"tr":"tl"),stopEvent:!0})];if(_e!=null&&(_.current=_e,j(k)),b==="both")return}if(Ts(k.key,b)){if(Yt(k),r&&!v&&Pt(k.currentTarget.ownerDocument)===k.currentTarget){_.current=La(k.key,b,g)?F:z,j(k);return}La(k.key,b,g)?h?H>=z?p&&H!==a.current.length?_.current=-1:(G.current=!1,_.current=F):_.current=Dt(a.current,{startingIndex:H,disabledIndices:E}):_.current=Math.min(z,Dt(a.current,{startingIndex:H,disabledIndices:E})):h?H<=F?p&&H!==-1?_.current=a.current.length:(G.current=!1,_.current=z):_.current=Dt(a.current,{startingIndex:H,decrement:!0,disabledIndices:E}):_.current=Math.max(F,Dt(a.current,{startingIndex:H,decrement:!0,disabledIndices:E})),ns(a.current,_.current)&&(_.current=-1),j(k)}}),ce=f.useMemo(()=>v&&r&&Y&&{"aria-activedescendant":`${P}-${c}`},[v,r,Y,P,c]),ve=f.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,...O?{}:ce,onKeyDown(k){if(k.key==="Tab"&&k.shiftKey&&r&&!v){const H=lt(k.nativeEvent);if(H&&!we(L.current,H))return;Yt(k),n.setOpen(!1,Ae(ur,k.nativeEvent)),it(s)&&s.focus();return}le(k)},onPointerMove(){A.current=!0}}),[ce,le,L,b,O,n,r,v,s]),ue=f.useMemo(()=>{function k(F){y==="auto"&&hl(F.nativeEvent)&&(I.current=!v)}function H(F){I.current=y,y==="auto"&&ml(F.nativeEvent)&&(I.current=!0)}return{onKeyDown(F){const z=n.select("open");A.current=!1;const Q=F.key.startsWith("Arrow"),ne=Fw(F.key,fe(),g),te=Ts(F.key,b),ye=(m?ne:te)||F.key==="Enter"||F.key.trim()==="";if(v&&z)return le(F);if(!(!z&&!S&&Q)){if(ye){const _e=Ts(F.key,fe());N.current=m&&_e?null:F.key}if(m){ne&&(Yt(F),z?(_.current=oa(a,K.current),j(F)):n.setOpen(!0,Ae(ba,F.nativeEvent,F.currentTarget)));return}te&&(se.current!=null&&(_.current=se.current),Yt(F),!z&&S?n.setOpen(!0,Ae(ba,F.nativeEvent,F.currentTarget)):le(F),z&&j(F))}},onFocus(F){n.select("open")&&!v&&(_.current=-1,j(F))},onPointerDown:H,onPointerEnter:H,onMouseDown:k,onClick:k}},[le,K,y,a,m,j,n,S,b,fe,g,se,v]),Se=f.useMemo(()=>({...ce,...ue}),[ce,ue]);return f.useMemo(()=>l?{reference:Se,floating:ve,item:ge,trigger:ue}:{},[l,Se,ve,ue,ge])}const $w=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function zd(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{role:a="dialog"}=t,c=Xn(),u=s?.id||c,l=f.useMemo(()=>lo(i)?.id||o,[i,o]),d=$w.get(a)??a,h=qn()!=null,m=f.useMemo(()=>d==="tooltip"||a==="label"?mt:{"aria-haspopup":d==="alertdialog"?"dialog":d,"aria-expanded":"false",...d==="listbox"&&{role:"combobox"},...d==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[d,h,a]),g=f.useMemo(()=>d==="tooltip"||a==="label"?{[`aria-${a==="label"?"labelledby":"describedby"}`]:r?l:void 0}:{...m,"aria-expanded":r?"true":"false","aria-controls":r?l:void 0,...d==="menu"&&{id:u}},[d,l,r,u,a,m]),v=f.useMemo(()=>{const C={id:l,...d&&{role:d}};return d==="tooltip"||a==="label"?C:{...C,...d==="menu"&&{"aria-labelledby":u}}},[d,l,u,a]),y=f.useCallback(({active:C,selected:S})=>{const E={role:"option",...C&&{id:`${l}-fui-option`}};switch(a){case"select":case"combobox":return{...E,"aria-selected":S}}return{}},[l,a]);return f.useMemo(()=>({reference:g,floating:v,item:y,trigger:m}),[g,v,m,y])}function jw(e,t){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,o=n.useState("open"),{listRef:s,elementsRef:i,activeIndex:a,onMatch:c,onTypingChange:u,enabled:l=!0,resetMs:d=750,selectedIndex:p=null}=t,h=Gt(),m=f.useRef(""),g=f.useRef(p??a??-1),v=f.useRef(null);he(()=>{!o&&p!==null||(h.clear(),v.current=null,m.current!==""&&(m.current=""))},[o,p,h]),he(()=>{o&&m.current===""&&(g.current=p??a??-1)},[o,p,a]);const y=ie(x=>{x?r.current.typing||(r.current.typing=x,u?.(x)):r.current.typing&&(r.current.typing=x,u?.(x))}),C=ie(x=>{function T(O){const I=i?.current[O];return!I||rs(I)}function P(O,I,_=0){if(O.length===0)return-1;const N=(_%O.length+O.length)%O.length,A=I.toLocaleLowerCase();for(let j=0;j<O.length;j+=1){const B=(N+j)%O.length;if(!(!O[B]?.toLocaleLowerCase().startsWith(A)||!T(B)))return B}return-1}const $=s.current;if(m.current.length>0&&x.key===" "&&(Yt(x),y(!0)),m.current.length>0&&m.current[0]!==" "&&P($,m.current)===-1&&x.key!==" "&&y(!1),$==null||x.key.length!==1||x.ctrlKey||x.metaKey||x.altKey)return;o&&x.key!==" "&&(Yt(x),y(!0));const M=m.current==="";M&&(g.current=p??a??-1),$.every(O=>O?O[0]?.toLocaleLowerCase()!==O[1]?.toLocaleLowerCase():!0)&&m.current===x.key&&(m.current="",g.current=v.current),m.current+=x.key,h.start(d,()=>{m.current="",g.current=v.current,y(!1)});const D=((M?p??a??-1:g.current)??0)+1,R=P($,m.current,D);R!==-1?(c?.(R),v.current=R):x.key!==" "&&(m.current="",y(!1))}),S=ie(x=>{const T=x.relatedTarget,P=n.select("domReferenceElement"),$=n.select("floatingElement"),M=we(P,T),V=we($,T);M||V||(h.clear(),m.current="",g.current=v.current,y(!1))}),E=f.useMemo(()=>({onKeyDown:C,onBlur:S}),[C,S]),b=f.useMemo(()=>({onKeyDown:C,onBlur:S}),[C,S]);return f.useMemo(()=>l?{reference:E,floating:b}:{},[l,E,b])}const $d=.1,Hw=$d*$d,rt=.5;function Os(e,t,n,r,o,s){return r>=t!=s>=t&&e<=(o-n)*(t-r)/(s-r)+n}function Ps(e,t,n,r,o,s,i,a,c,u){let l=!1;return Os(e,t,n,r,o,s)&&(l=!l),Os(e,t,o,s,i,a)&&(l=!l),Os(e,t,i,a,c,u)&&(l=!l),Os(e,t,c,u,n,r)&&(l=!l),l}function Uw(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function _s(e,t,n,r,o,s){const i=Math.min(n,o),a=Math.max(n,o),c=Math.min(r,s),u=Math.max(r,s);return e>=i&&e<=a&&t>=c&&t<=u}function Bw(e={}){const{blockPointerEvents:t=!1}=e,n=new Zt,r=({x:o,y:s,placement:i,elements:a,onClose:c,nodeId:u,tree:l})=>{const d=i?.split("-")[0];let p=!1,h=null,m=null,g=typeof performance<"u"?performance.now():0;function v(C,S){const E=performance.now(),b=E-g;if(h===null||m===null||b===0)return h=C,m=S,g=E,!1;const x=C-h,T=S-m,P=x*x+T*T,$=b*b*Hw;return h=C,m=S,g=E,P<$}function y(){n.clear(),c()}return function(S){n.clear();const E=a.domReference,b=a.floating;if(!E||!b||d==null||o==null||s==null)return;const{clientX:x,clientY:T}=S,P=lt(S),$=S.type==="mouseleave",M=we(b,P),V=we(E,P);if(M&&(p=!0,!$))return;if(V&&(p=!1,!$)){p=!0;return}if($&&$e(S.relatedTarget)&&we(b,S.relatedTarget))return;function L(){return!!(l&&vn(l.nodesRef.current,u).length>0)}function D(){L()||y()}if(L())return;const R=E.getBoundingClientRect(),O=b.getBoundingClientRect(),I=o>O.right-O.width/2,_=s>O.bottom-O.height/2,N=O.width>R.width,A=O.height>R.height,j=(N?R:O).left,B=(N?R:O).right,U=(A?R:O).top,W=(A?R:O).bottom;if(d==="top"&&s>=R.bottom-1||d==="bottom"&&s<=R.top+1||d==="left"&&o>=R.right-1||d==="right"&&o<=R.left+1){D();return}let G=!1;switch(d){case"top":G=_s(x,T,j,R.top+1,B,O.bottom-1);break;case"bottom":G=_s(x,T,j,O.top+1,B,R.bottom-1);break;case"left":G=_s(x,T,O.right-1,W,R.left+1,U);break;case"right":G=_s(x,T,R.right-1,W,O.left+1,U);break}if(G)return;if(p&&!Uw(x,T,R)){D();return}if(!$&&v(x,T)){D();return}let Z=!1;switch(d){case"top":{const X=N?rt/2:rt*4,K=N||I?o+X:o-X,J=N?o-X:I?o+X:o-X,se=s+rt+1,ae=I||N?O.bottom-rt:O.top,pe=I?N?O.bottom-rt:O.top:O.bottom-rt;Z=Ps(x,T,K,se,J,se,O.left,ae,O.right,pe);break}case"bottom":{const X=N?rt/2:rt*4,K=N||I?o+X:o-X,J=N?o-X:I?o+X:o-X,se=s-rt,ae=I||N?O.top+rt:O.bottom,pe=I?N?O.top+rt:O.bottom:O.top+rt;Z=Ps(x,T,K,se,J,se,O.left,ae,O.right,pe);break}case"left":{const X=A?rt/2:rt*4,K=A||_?s+X:s-X,J=A?s-X:_?s+X:s-X,se=o+rt+1,ae=_||A?O.right-rt:O.left,pe=_?A?O.right-rt:O.left:O.right-rt;Z=Ps(x,T,ae,O.top,pe,O.bottom,se,K,se,J);break}case"right":{const X=A?rt/2:rt*4,K=A||_?s+X:s-X,J=A?s-X:_?s+X:s-X,se=o-rt,ae=_||A?O.left+rt:O.right,pe=_?A?O.left+rt:O.right:O.left+rt;Z=Ps(x,T,se,K,se,J,ae,O.top,pe,O.bottom);break}}Z?p||n.start(40,D):D()}};return r.__options={...e,blockPointerEvents:t},r}const jd=f.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,style:a,...c}=t,{portalNode:u,portalSubtree:l}=cd({container:o,ref:n,componentProps:t,elementProps:c});return!l&&!u?null:w.jsxs(f.Fragment,{children:[l,u&&Kt.createPortal(r,u)]})});process.env.NODE_ENV!=="production"&&(jd.displayName="FloatingPortalLite");const Ww=jd,Hd=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Hd.displayName="DirectionContext");function Ud(){return f.useContext(Hd)?.direction??"ltr"}const Zw=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:l=0,offsetParent:d="real"}=Mn(e,t)||{};if(u==null)return{};const p=bl(l),h={x:n,y:r},m=na(o),g=ta(m),v=await i.getDimensions(u),y=m==="y",C=y?"top":"left",S=y?"bottom":"right",E=y?"clientHeight":"clientWidth",b=s.reference[g]+s.reference[m]-h[m]-s.floating[g],x=h[m]-s.reference[m],T=d==="real"?await i.getOffsetParent?.(u):a.floating;let P=a.floating[E]||s.floating[g];(!P||!await i.isElement?.(T))&&(P=a.floating[E]||s.floating[g]);const $=b/2-x/2,M=P/2-v[g]/2-1,V=Math.min(p[C],M),L=Math.min(p[S],M),D=V,R=P-v[g]-L,O=P/2-v[g]/2+$,I=Qi(D,O,R),_=!c.arrow&&Gn(o)!=null&&O!==I&&s.reference[g]/2-(O<D?V:L)-v[g]/2<0,N=_?O<D?O-D:O-R:0;return{[m]:h[m]+N,data:{[m]:I,centerOffset:O-I-N,..._&&{alignmentOffset:N}},reset:_}}}),Gw=(e,t)=>({...Zw(e),options:[e,t]}),Yw={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await _w().fn(e)).data?.referenceHidden||s}}}},Is={sideX:"left",sideY:"top"},Xw={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:s,strategy:i,placement:a}=e,c=tt(o),u=c.getComputedStyle(o);if(!(u.transitionDuration!=="0s"&&u.transitionDuration!==""))return{x:t,y:n,data:Is};const d=await s.getOffsetParent?.(o);let p={width:0,height:0};if(i==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(d===c){const C=Ie(o);p={width:C.documentElement.clientWidth,height:C.documentElement.clientHeight}}else await s.isElement?.(d)&&(p=await s.getDimensions(d));const h=jt(a);let m=t,g=n;h==="left"&&(m=p.width-(t+r.width)),h==="top"&&(g=p.height-(n+r.height));const v=h==="left"?"right":Is.sideX,y=h==="top"?"bottom":Is.sideY;return{x:m,y:g,data:{sideX:v,sideY:y}}}};function Bd(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Wd(e,t,n){const{rects:r,placement:o}=e;return{side:Bd(t,jt(o),n),align:Gn(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Zd(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:u=!1,arrowPadding:l=5,disableAnchorTracking:d=!1,keepMounted:p=!1,floatingRootContext:h,mounted:m,collisionAvoidance:g,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:C,lazyFlip:S=!1,externalTree:E}=e,[b,x]=f.useState(null);!m&&b!==null&&x(null);const T=g.side||"flip",P=g.align||"flip",$=g.fallbackAxisSide||"end",M=typeof t=="function"?t:void 0,V=ie(M),L=M?V:t,D=vt(t),R=vt(m),I=Ud()==="rtl",_=b||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[r],N=s==="center"?_:`${_}-${s}`;let A=c;const j=1,B=r==="bottom"?j:0,U=r==="top"?j:0,W=r==="right"?j:0,G=r==="left"?j:0;typeof A=="number"?A={top:A+B,right:A+G,bottom:A+U,left:A+W}:A&&(A={top:(A.top||0)+B,right:(A.right||0)+G,bottom:(A.bottom||0)+U,left:(A.left||0)+W});const Z={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:A},X=f.useRef(null),K=vt(o),J=vt(i),pe=[xw(Re=>{const Te=Wd(Re,r,I),Ue=typeof K.current=="function"?K.current(Te):K.current,Be=typeof J.current=="function"?J.current(Te):J.current;return{mainAxis:Ue,crossAxis:Be,alignmentAxis:Be}},[typeof o!="function"?o:0,typeof i!="function"?i:0,I,r])],Y=P==="none"&&T!=="shift",me=!Y&&(u||v||T==="shift"),ge=T==="none"?null:Ow({...Z,padding:{top:A.top+j,right:A.right+j,bottom:A.bottom+j,left:A.left+j},mainAxis:!v&&T==="flip",crossAxis:P==="flip"?"alignment":!1,fallbackAxisSideDirection:$}),fe=Y?null:Cw(Re=>{const Te=Ie(Re.elements.floating).documentElement;return{...Z,rootBoundary:v?{x:0,y:0,width:Te.clientWidth,height:Te.clientHeight}:void 0,mainAxis:P!=="none",crossAxis:me,limiter:u||v?void 0:Tw(Ue=>{if(!X.current)return{};const{width:Be,height:ct}=X.current.getBoundingClientRect(),Ye=en(jt(Ue.placement)),Ut=Ye==="y"?Be:ct,$t=Ye==="y"?A.left+A.right:A.top+A.bottom;return{offset:Ut/2+$t/2}})}},[Z,u,v,A,P]);T==="shift"||P==="shift"||s==="center"?pe.push(fe,ge):pe.push(ge,fe),pe.push(Pw({...Z,apply({elements:{floating:Re},availableWidth:Te,availableHeight:Ue,rects:Be}){if(!R.current)return;const ct=Re.style;ct.setProperty("--available-width",`${Te}px`),ct.setProperty("--available-height",`${Ue}px`);const Ye=tt(Re).devicePixelRatio||1,{x:Ut,y:$t,width:Ke,height:q}=Be.reference,re=(Math.round((Ut+Ke)*Ye)-Math.round(Ut*Ye))/Ye,be=(Math.round(($t+q)*Ye)-Math.round($t*Ye))/Ye;ct.setProperty("--anchor-width",`${re}px`),ct.setProperty("--anchor-height",`${be}px`)}}),Gw(()=>({element:X.current||Ie(X.current).createElement("div"),padding:l,offsetParent:"floating"}),[l]),{name:"transformOrigin",fn(Re){const{elements:Te,middlewareData:Ue,placement:Be,rects:ct,y:Ye}=Re,Ut=jt(Be),$t=en(Ut),Ke=X.current,q=Ue.arrow?.x||0,re=Ue.arrow?.y||0,be=Ke?.clientWidth||0,Le=Ke?.clientHeight||0,je=q+be/2,De=re+Le/2,Qe=Math.abs(Ue.shift?.y||0),Oe=ct.reference.height/2,xe=typeof o=="function"?o(Wd(Re,r,I)):o,Ne=Qe>xe,Me={top:`${je}px calc(100% + ${xe}px)`,bottom:`${je}px ${-xe}px`,left:`calc(100% + ${xe}px) ${De}px`,right:`${-xe}px ${De}px`}[Ut],Xe=`${je}px ${ct.reference.y+Oe-Ye}px`;return Te.floating.style.setProperty("--transform-origin",me&&$t==="y"&&Ne?Xe:Me),{}}},Yw,C),he(()=>{!m&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,h]);const le=f.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:ce,elements:ve,x:ue,y:Se,middlewareData:k,update:H,placement:F,context:z,isPositioned:Q,floatingStyles:ne}=Nw({rootContext:h,open:p?m:void 0,placement:N,middleware:pe,strategy:n,whileElementsMounted:p?void 0:(...Re)=>Od(...Re,le),nodeId:y,externalTree:E}),{sideX:te,sideY:ye}=k.adaptiveOrigin||Is,_e=Q?n:"fixed",Ee=f.useMemo(()=>{const Re=C?{position:_e,[te]:ue,[ye]:Se}:{position:_e,...ne};return Q||(Re.opacity=0),Re},[C,_e,te,ue,ye,Se,ne,Q]),Ce=f.useRef(null);he(()=>{if(!m)return;const Re=D.current,Te=typeof Re=="function"?Re():Re,Be=(Gd(Te)?Te.current:Te)||null||null;Be!==Ce.current&&(ce.setPositionReference(Be),Ce.current=Be)},[m,ce,L,D]),f.useEffect(()=>{if(!m)return;const Re=D.current;typeof Re!="function"&&Gd(Re)&&Re.current!==Ce.current&&(ce.setPositionReference(Re.current),Ce.current=Re.current)},[m,ce,L,D]),f.useEffect(()=>{if(p&&m&&ve.domReference&&ve.floating)return Od(ve.domReference,ve.floating,H,le)},[p,m,ve,H,le]);const Pe=jt(F),Ve=Bd(r,Pe,I),Ge=Gn(F)||"center",He=!!k.hide?.referenceHidden;he(()=>{S&&m&&Q&&x(Pe)},[S,m,Q,Pe]);const nt=f.useMemo(()=>({position:"absolute",top:k.arrow?.y,left:k.arrow?.x}),[k.arrow]),st=k.arrow?.centerOffset!==0;return f.useMemo(()=>({positionerStyles:Ee,arrowStyles:nt,arrowRef:X,arrowUncentered:st,side:Ve,align:Ge,physicalSide:Pe,anchorHidden:He,refs:ce,context:z,isPositioned:Q,update:H}),[Ee,nt,X,st,Ve,Ge,Pe,He,ce,z,Q,H])}function Gd(e){return e!=null&&"current"in e}let Ft=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=sr.startingStyle]="startingStyle",e[e.endingStyle=sr.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Fa=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const qw={[Fa.popupOpen]:""},Kw={[Fa.popupOpen]:"",[Fa.pressed]:""},Jw={[Ft.open]:""},Qw={[Ft.closed]:""},eS={[Ft.anchorHidden]:""},Yd={open(e){return e?qw:null}},Xd={open(e){return e?Kw:null}},Cn={open(e){return e?Jw:Qw},anchorHidden(e){return e?eS:null}};function Va(e){return e==="starting"?a0:mt}function qd(e,t,{styles:n,transitionStatus:r,props:o,refs:s,hidden:i,inert:a=!1}){const c={...n};return a&&(c.pointerEvents="none"),qe("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:c},Va(r),o],stateAttributesMapping:Cn})}function Kd(){const e=f.useContext(zo);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":ft(73));const t=e.useState("toasts");return f.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function fr(...e){return Mi(Mu(e))}const Jd={Viewport:"_Viewport_ai81v_1",Toast:"_Toast_ai81v_14"};let zr=null,wo=3e3;function tS({timeout:e}){const t=Kd();return f.useEffect(()=>(zr=t,wo=e,()=>{zr=null}),[t,e]),null}const gt={success:(e,t)=>zr?.add({description:e,timeout:t?.timeout||wo}),error:(e,t)=>zr?.add({description:e,timeout:t?.timeout||wo}),info:(e,t)=>zr?.add({description:e,timeout:t?.timeout||wo}),warning:(e,t)=>zr?.add({description:e,timeout:t?.timeout||wo})};function nS({toastConfigs:e}){const t=e?.timeout??3e3;return w.jsxs(Nl,{timeout:t,children:[w.jsx(tS,{timeout:t}),w.jsx(rS,{configs:e})]})}function rS({configs:e}){const{toasts:t}=Kd();return w.jsx(Ww,{children:w.jsx(Ul,{className:fr(Jd.Viewport,e?.viewportClassName),children:t.map(n=>w.jsx(Gl,{toast:n,className:fr("pointer-events-none flex items-center justify-center px-6 py-3 min-w-[200px] max-w-[80vw]","text-white text-base rounded-md bg-black/80",Jd.Toast,e?.className),style:e?.style,children:w.jsx(ql,{className:"text-xs",children:n.description})},n.id))})})}class oS{baseUrl;credentials;interceptors;timeout;onError;headers;constructor({baseUrl:t,timeout:n=1/0,responseInterceptor:r=c=>c.data,requestInterceptor:o=c=>c,onError:s=()=>{},headers:i,credentials:a="include"}){this.baseUrl=t,this.timeout=n,this.credentials=a,this.interceptors={request:o,response:r},this.headers=new Headers({"Content-Type":"application/json",...i}),this.onError=s}async request(t){const n=new AbortController;t.url=`${this.baseUrl}${t.url}`,t=this.interceptors.request(t);const r=new Headers(this.headers);Object.entries(t.headers||{}).forEach(([a,c])=>{r.set(a,c)});const o=this.headers.get("content-type");let s=null;if(t.data instanceof FormData)s=t.data,r.delete("Content-Type");else if(t.data!==void 0&&t.method!=="GET")if(o==="application/x-www-form-urlencoded"){const a=new URLSearchParams;for(const c in t.data)t.data[c]!==void 0&&a.append(c,t.data[c]);s=a.toString()}else s=JSON.stringify(t.data);else if(t.method==="GET"){const a=new URLSearchParams;for(const u in t.data)t.data[u]!==void 0&&a.append(u,t.data[u]);const c=a.toString();t.url+=c?`?${c}`:""}const i=fetch(t.url,{method:t.method,headers:r,body:s,signal:t.signal||n.signal,credentials:this.credentials});try{const a=t.timeout||this.timeout,{timeoutId:c,timeoutPromise:u}=this._setTimeout(a,n),l=await Promise.race([i,u].filter(Boolean));if(c&&clearTimeout(c),l.ok){const d=await l.json();return this.interceptors.response(d,l).catch(p=>(this.onError({data:p,response:l}),Promise.reject(d)))}else{const d=await l.json();return this.onError({data:d,response:l}),Promise.reject(d)}}catch(a){return a.name!=="AbortError"&&this.onError({}),Promise.reject(a)}}_setTimeout(t,n){let r=null,o=null;return t!==1/0&&(o=new Promise((s,i)=>{r=setTimeout(()=>{i(new Error("请求超时")),n.abort()},t)})),{timeoutPromise:o,timeoutId:r}}get(t,n,r){return this.request({...r,url:t,method:"GET",data:n})}post(t,n,r){return this.request({...r,url:t,method:"POST",data:n})}put(t,n,r){return this.request({...r,url:t,method:"PUT",data:n})}delete(t,n){return this.request({...n,url:t,method:"DELETE"})}patch(t,n,r){return this.request({...r,url:t,method:"PATCH",data:n})}}const _t=new oS({baseUrl:"https://apis.sdk.mobileztgame.com",credentials:"omit",headers:{"Content-Type":"application/x-www-form-urlencoded"},async responseInterceptor(e,t){if(["/passport-api/v2/ztgame/auth/login","/passport-api/v2/sms-captchas","/passport-api/v2/ztgame/auth/mobile-register","/passport-api/v2/ztgame/auth/auth","/passport-api/v2/ztgame/auth/re-auth","/passport-api/v2/ztgame/user-center/forget-password/forget-password-keys","/passport-api/v2/ztgame/user-center/forget-password/","/passport-api/v2/ztgame/user-center/forget-password/sms-captchas","/passport-api/v2/ztgame/user-center/forget-password/forget-password-update","/idcard"].some(r=>t.url.includes(r))){const r=t.headers.get("set-authentication")||t.headers.get("Set-Authentication")||"";return{...e,_auth:r}}if(e?.code!==0)throw new Error(e.error);return e},onError({response:e,data:t}){if(e&&e?.status!==401){const n=`${t?.message||t?.detail||"未知错误"}`;gt.error(n)}}});function Qd(e){_t.headers.set("Authentication",e)}const at={ROLE_ID:"roleid",GIANT:"giant",MOBILE:"mobile"},ks={default:{types:[at.GIANT,at.MOBILE],default:at.GIANT},5327:{types:[at.GIANT,at.MOBILE],default:at.MOBILE},5273:{types:[at.ROLE_ID],default:at.ROLE_ID},5199:{types:[at.ROLE_ID],default:at.ROLE_ID},5012:{types:[at.ROLE_ID],default:at.ROLE_ID},5242:{types:[at.GIANT,at.MOBILE],default:at.MOBILE}};function St(...e){return Mi(Mu(e))}function sS(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(Number.parseInt(n,16))))}function iS(e){return e==="5199"||e==="5012"}function aS(e){const{entity:t,gaplaySign:n}=e;return sS(`${JSON.stringify(t)}$$${n}`)}function Rs(e,t){return t||ks[e]?.types||ks.default?.types||[]}function cS(e,t){return t||ks[e]?.default||ks.default?.default}function ef({loginTypes:e,gameId:t}){return Rs(t,e).includes(at.GIANT)}function tf({loginTypes:e,gameId:t}){return Rs(t,e).includes(at.ROLE_ID)}function nf({loginTypes:e,gameId:t}){return Rs(t,e).includes(at.MOBILE)}function rf({gameId:e}){_t.headers.set("X-GAME-ID",e),_t.headers.set("X-Login-H5","1");const t=localStorage.getItem("UNIQUE_ID");t&&_t.headers.set("X-Client-Info",JSON.stringify({sdk_version:"3.0.0",device_udid:t,appunid:t}))}async function uS({gameId:e}){rf({gameId:e});let t=localStorage.getItem("UNIQUE_ID");t||(t=(await(await $y.load()).get()).visitorId,localStorage.setItem("UNIQUE_ID",t)),_t.headers.set("X-Client-Info",JSON.stringify({sdk_version:"3.0.0",device_udid:t,appunid:t}))}const lS=[{code:"86",name:"中国大陆"},{code:"886",name:"台湾地区"},{code:"852",name:"香港特别行政区"},{code:"853",name:"澳门特别行政区"},{code:"1",name:"美国"},{code:"81",name:"日本"},{code:"376",name:"安道尔"},{code:"971",name:"阿拉伯联合酋长国"},{code:"93",name:"阿富汗"},{code:"1268",name:"安提瓜和巴布达"},{code:"1264",name:"安圭拉"},{code:"355",name:"阿尔巴尼亚"},{code:"374",name:"亚美尼亚"},{code:"244",name:"安哥拉"},{code:"54",name:"阿根廷"},{code:"1684",name:"美属萨摩亚"},{code:"43",name:"奥地利"},{code:"61",name:"澳大利亚"},{code:"297",name:"阿鲁巴"},{code:"994",name:"阿塞拜疆"},{code:"387",name:"波斯尼亚和黑塞哥维那"},{code:"1246",name:"巴巴多斯"},{code:"880",name:"孟加拉国"},{code:"32",name:"比利时"},{code:"226",name:"布基纳法索"},{code:"359",name:"保加利亚"},{code:"973",name:"巴林"},{code:"257",name:"布隆迪"},{code:"229",name:"贝宁"},{code:"1441",name:"百慕大群岛"},{code:"673",name:"文莱"},{code:"591",name:"玻利维亚"},{code:"599",name:"荷兰加勒比"},{code:"55",name:"巴西"},{code:"1242",name:"巴哈马"},{code:"975",name:"不丹"},{code:"267",name:"博茨瓦纳"},{code:"375",name:"白俄罗斯"},{code:"501",name:"伯利兹"},{code:"1",name:"加拿大"},{code:"243",name:"刚果民主共和国"},{code:"236",name:"中非共和国"},{code:"242",name:"刚果共和国"},{code:"41",name:"瑞士"},{code:"225",name:"象牙海岸"},{code:"682",name:"库克群岛"},{code:"56",name:"智利"},{code:"237",name:"喀麦隆"},{code:"57",name:"哥伦比亚"},{code:"506",name:"哥斯达黎加"},{code:"53",name:"古巴"},{code:"238",name:"佛得角共和国"},{code:"599",name:"库拉索"},{code:"357",name:"塞浦路斯"},{code:"420",name:"捷克"},{code:"49",name:"德国"},{code:"253",name:"吉布提"},{code:"45",name:"丹麦"},{code:"1767",name:"多米尼加"},{code:"1809",name:"多米尼加共和国"},{code:"213",name:"阿尔及利亚"},{code:"593",name:"厄瓜多尔"},{code:"372",name:"爱沙尼亚"},{code:"20",name:"埃及"},{code:"291",name:"厄立特里亚"},{code:"34",name:"西班牙"},{code:"251",name:"埃塞俄比亚"},{code:"358",name:"芬兰"},{code:"679",name:"斐济"},{code:"691",name:"密克罗尼西亚"},{code:"298",name:"法罗群岛"},{code:"33",name:"法国"},{code:"241",name:"加蓬"},{code:"44",name:"英国"},{code:"1473",name:"格林纳达"},{code:"995",name:"格鲁吉亚"},{code:"594",name:"法属圭亚那"},{code:"233",name:"加纳"},{code:"350",name:"直布罗陀"},{code:"299",name:"格陵兰岛"},{code:"220",name:"冈比亚"},{code:"224",name:"几内亚"},{code:"590",name:"瓜德罗普岛"},{code:"240",name:"赤道几内亚"},{code:"30",name:"希腊"},{code:"502",name:"瓜地马拉"},{code:"1671",name:"关岛"},{code:"245",name:"几内亚比绍共和国"},{code:"592",name:"圭亚那"},{code:"504",name:"洪都拉斯"},{code:"385",name:"克罗地亚"},{code:"509",name:"海地"},{code:"36",name:"匈牙利"},{code:"62",name:"印度尼西亚"},{code:"353",name:"爱尔兰"},{code:"972",name:"以色列"},{code:"91",name:"印度"},{code:"964",name:"伊拉克"},{code:"98",name:"伊朗"},{code:"354",name:"冰岛"},{code:"39",name:"意大利"},{code:"1876",name:"牙买加"},{code:"962",name:"约旦"},{code:"254",name:"肯尼亚"},{code:"996",name:"吉尔吉斯斯坦"},{code:"855",name:"柬埔寨"},{code:"686",name:"基里巴斯"},{code:"269",name:"科摩罗"},{code:"1869",name:"圣基茨和尼维斯"},{code:"850",name:"朝鲜"},{code:"82",name:"韩国"},{code:"965",name:"科威特"},{code:"1345",name:"开曼群岛"},{code:"7",name:"哈萨克斯坦"},{code:"856",name:"老挝"},{code:"961",name:"黎巴嫩"},{code:"1758",name:"圣露西亚"},{code:"423",name:"列支敦士登"},{code:"94",name:"斯里兰卡"},{code:"231",name:"利比里亚"},{code:"266",name:"莱索托"},{code:"370",name:"立陶宛"},{code:"352",name:"卢森堡"},{code:"371",name:"拉脱维亚"},{code:"218",name:"利比亚"},{code:"212",name:"摩洛哥"},{code:"377",name:"摩纳哥"},{code:"373",name:"摩尔多瓦"},{code:"382",name:"黑山"},{code:"261",name:"马达加斯加"},{code:"692",name:"马绍尔群岛"},{code:"389",name:"北马其顿"},{code:"223",name:"马里"},{code:"95",name:"缅甸"},{code:"976",name:"蒙古"},{code:"222",name:"毛里塔尼亚"},{code:"1664",name:"蒙特塞拉特岛"},{code:"356",name:"马耳他"},{code:"230",name:"毛里求斯"},{code:"960",name:"马尔代夫"},{code:"265",name:"马拉维"},{code:"52",name:"墨西哥"},{code:"60",name:"马来西亚"},{code:"258",name:"莫桑比克"},{code:"264",name:"纳米比亚"},{code:"687",name:"新喀里多尼亚"},{code:"227",name:"尼日尔"},{code:"234",name:"尼日利亚"},{code:"505",name:"尼加拉瓜"},{code:"31",name:"荷兰"},{code:"47",name:"挪威"},{code:"977",name:"尼泊尔"},{code:"674",name:"拿鲁岛"},{code:"64",name:"新西兰"},{code:"968",name:"阿曼"},{code:"507",name:"巴拿马"},{code:"51",name:"秘鲁"},{code:"689",name:"法属波利尼西亚"},{code:"675",name:"巴布亚新几内亚"},{code:"63",name:"菲律宾"},{code:"92",name:"巴基斯坦"},{code:"48",name:"波兰"},{code:"508",name:"圣彼埃尔和密克隆岛"},{code:"1787",name:"波多黎各"},{code:"351",name:"葡萄牙"},{code:"680",name:"帕劳"},{code:"595",name:"巴拉圭"},{code:"974",name:"卡塔尔"},{code:"262",name:"留尼汪"},{code:"40",name:"罗马尼亚"},{code:"381",name:"塞尔维亚"},{code:"7",name:"俄罗斯"},{code:"250",name:"卢旺达"},{code:"966",name:"沙特阿拉伯"},{code:"677",name:"所罗门群岛"},{code:"248",name:"塞舌尔"},{code:"249",name:"苏丹"},{code:"46",name:"瑞典"},{code:"65",name:"新加坡"},{code:"386",name:"斯洛文尼亚"},{code:"421",name:"斯洛伐克"},{code:"232",name:"塞拉利昂"},{code:"378",name:"圣马力诺"},{code:"221",name:"塞内加尔"},{code:"252",name:"索马里"},{code:"597",name:"苏里南"},{code:"239",name:"圣多美和普林西比"},{code:"503",name:"萨尔瓦多"},{code:"963",name:"叙利亚"},{code:"268",name:"埃斯瓦蒂尼"},{code:"1649",name:"特克斯和凯科斯群岛"},{code:"235",name:"乍得"},{code:"228",name:"多哥"},{code:"66",name:"泰国"},{code:"992",name:"塔吉克斯坦"},{code:"670",name:"东帝汶"},{code:"993",name:"土库曼斯坦"},{code:"216",name:"突尼斯"},{code:"676",name:"汤加"},{code:"90",name:"土耳其"},{code:"1868",name:"特立尼达和多巴哥"},{code:"255",name:"坦桑尼亚"},{code:"380",name:"乌克兰"},{code:"256",name:"乌干达"},{code:"598",name:"乌拉圭"},{code:"998",name:"乌兹别克斯坦"},{code:"1784",name:"圣文森特和格林纳丁斯"},{code:"58",name:"委内瑞拉"},{code:"1284",name:"英属处女群岛"},{code:"84",name:"越南"},{code:"678",name:"瓦努阿图"},{code:"685",name:"萨摩亚"},{code:"967",name:"也门"},{code:"269",name:"马约特"},{code:"27",name:"南非"},{code:"260",name:"赞比亚"},{code:"263",name:"津巴布韦"}].map(e=>({label:e.name,value:e.code,id:`${e.code}-${e.name}`}));function dS(e){return lS}function fS(e){return"account"in e}function pS({gameId:e,serverUserInfo:t,extraState:n}){const r={game_id:e,xToken:aS(t),saveTime:t.entity.time,$version:"v2",extraState:n};if(fS(t))r.openid=t.entity.openid,r.gaplaySign=t.gaplaySign,r.account=t.account,r.username=t.account.view_name,r.loginByRoleMail=!1,r.channelId=t.channel||6;else if(t.gaplaySign){const{ZONEID:o,openid:s,CHARID:i,NAME:a,REALZONEID:c,ZONENAME:u}=t.entity;r.openid=s,r.zone={zoneid:c||o,zonename:u,area:o},r.char={...t.entity,CHARID:i,NAME:a,GAMEPOINT:t.entity.GAMEPOINT,VIPLEVEL:t.entity.VIPLEVEL},r.loginByRoleMail=!0,r.gaplaySign=t.gaplaySign}else{const{ZONEID:o,CHARID:s,NAME:i,REALZONEID:a,ZONENAME:c,OPENID:u,CHANNELID:l,GAMEPOINT:d,VIPLEVEL:p}=t.entity;r.openid=u,r.channelId=l,r.char={CHARID:s,NAME:i,GAMEPOINT:d,VIPLEVEL:p},r.loginByRoleMail=!1,r.username=i,r.zone={zoneid:a||o,zonename:c,area:o},r.xToken=void 0}return r}function of(){try{const e=localStorage.getItem("userInfo")||"[]";return JSON.parse(e)}catch{return[]}}function za(e){return of().find(n=>n.game_id===e)}function hS(e){const t=localStorage.getItem("userInfo")||"[]",n=JSON.parse(t),r=n.find(s=>s.game_id===e);r?.openid&&sf(r.openid,e);const o=n.filter(s=>s.game_id!==e);localStorage.setItem("userInfo",JSON.stringify(o))}function mS(e){const t=of(),n=za(e.game_id),r=t.findIndex(o=>o.game_id===e.game_id);n?t[r]=e:t.push(e),localStorage.setItem("userInfo",JSON.stringify(t))}const So="LOGIN_SDK_ACCOUNTS";function $r(e){try{const t=JSON.parse(localStorage.getItem(So)||"[]");return e?t.filter(n=>n.gameId===e):t}catch{return[]}}function Ns(e,t,n){if(!n)return;const r=JSON.parse(localStorage.getItem(So)||"[]");let o=1;const s=r.filter(c=>c.openid===e.accid&&c.gameId===n?(o=(c.loginCnt||1)+1,!1):!0),a=[{openid:e.accid,username:e.account?.view_name||"",uid:e.account?.uid||"",mobile:e.account?.mobile||"",accountType:e.account?.account_type||0,authorization:t,loginAt:Date.now(),loginCnt:o,gameId:n},...s].slice(0,20);localStorage.setItem(So,JSON.stringify(a))}function sf(e,t){if(!t)return;const r=JSON.parse(localStorage.getItem(So)||"[]").filter(o=>!(o.openid===e&&o.gameId===t));localStorage.setItem(So,JSON.stringify(r))}let af={};function cf(e){af=e}function pr(e){const t=e||af.gameId;if(!t)throw new Error("gameId is required. Call init({ gameId }) first or pass it as an argument.");return t}const uf=oe.createContext(void 0),gS={enabled:!0,days:7},lf={"--primary-color":"#787bf4","--icon-color":"#a9aad1","--input-border-color":"#cad0e0","--input-label-color":"var(--jssdk-primary-color)","--input-bg-color":"#fff"};function Dn(){const e=oe.use(uf);if(!e)throw new Error("useConfig 必须在 ConfigProvider 中使用");return e}function df({children:e,value:t}){const n=pr(t.gameId),r=Rs(n,t.loginTypes),o=cS(n,t.defaultLoginType),s=oe.useRef(null);rf({gameId:n});const i=oe.useMemo(()=>!t.defaultLoginType&&$r(n).length>0?"quick":o,[t.defaultLoginType,n,o]),[a,c]=oe.useState(i),[u,l]=oe.useState(!0),[d,p]=oe.useState(!1),[h,m]=oe.useState(!1),[g,v]=oe.useState(""),y=()=>{p(!0)};oe.useEffect(()=>{uS({gameId:n})},[n]);const C={...t,gameId:n,loginTypes:r,defaultLoginType:o,autoLoginConfig:{...gS,...t.autoLoginConfig}};oe.useEffect(()=>{document.body.classList.add(`game-${n}`)},[n]);function S(E){Object.entries(E).forEach(([b,x])=>{const T=`--jssdk-${b.replace(/^--/,"")}`;document.documentElement.style.setProperty(T,x)})}return oe.useEffect(()=>{const E=s.current;if(E){const b={...lf,...t.styleVars};S(b)}return()=>{E&&S(lf)}},[t.styleVars]),w.jsx("div",{ref:s,children:w.jsx(uf,{value:{...C,currentLoginType:a,setCurrentLoginType:c,isShowGiantLogo:u,setIsShowGiantLogo:l,showRealNameModal:d,setShowRealNameModal:p,triggerRealNameAuth:y,isAutoLoggingIn:h,setIsAutoLoggingIn:m,autoLoginAccountName:g,setAutoLoginAccountName:v,onClose:t.onClose},children:e})})}function Eo({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=f.useRef(e!==void 0),[s,i]=f.useState(t),a=o?e:s;if(process.env.NODE_ENV!=="production"){f.useEffect(()=>{o!==(e!==void 0)&&ar([`A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
17
|
-
`))},[r,n,e]);const{current:u}=f.useRef(t);f.useEffect(()=>{!o&&ff(u)!==ff(t)&&ar([`A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
|
|
18
|
-
`))},[t])}const c=f.useCallback(u=>{o||i(u)},[]);return[a,c]}function ff(e){let t=0;const n=new WeakMap;try{return JSON.stringify(e,function(s,i){if(!(s==="_owner"&&this!=null&&typeof this=="object"&&"$$typeof"in this)){if(typeof i=="bigint")return`__bigint__:${i}`;if(i!==null&&typeof i=="object"){const a=n.get(i);if(a!==void 0)return`__object__:${a}`;n.set(i,t),t+=1}return i}})??`__top__:${typeof e}`}catch{return"__unserializable__"}}const $a=f.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!=="production"&&($a.displayName="CompositeListContext");function yS(){return f.useContext($a)}function vS(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=ie(o),i=f.useRef(0),a=wt(wS).current,c=wt(bS).current,[u,l]=f.useState(0),d=f.useRef(u),p=ie((y,C)=>{c.set(y,C??null),d.current+=1,l(d.current)}),h=ie(y=>{c.delete(y),d.current+=1,l(d.current)}),m=f.useMemo(()=>{const y=new Map;return Array.from(c.keys()).filter(S=>S.isConnected).sort(SS).forEach((S,E)=>{const b=c.get(S)??{};y.set(S,{...b,index:E})}),y},[c,u]);he(()=>{if(typeof MutationObserver!="function"||m.size===0)return;const y=new MutationObserver(C=>{const S=new Set,E=b=>S.has(b)?S.delete(b):S.add(b);C.forEach(b=>{b.removedNodes.forEach(E),b.addedNodes.forEach(E)}),S.size===0&&(d.current+=1,l(d.current))});return m.forEach((C,S)=>{S.parentElement&&y.observe(S.parentElement,{childList:!0})}),()=>{y.disconnect()}},[m]),he(()=>{d.current===u&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),i.current=m.size),s(m)},[s,m,n,r,u]),he(()=>()=>{n.current=[]},[n]),he(()=>()=>{r&&(r.current=[])},[r]);const g=ie(y=>(a.add(y),()=>{a.delete(y)}));he(()=>{a.forEach(y=>y(m))},[a,m]);const v=f.useMemo(()=>({register:p,unregister:h,subscribeMapChange:g,elementsRef:n,labelsRef:r,nextIndexRef:i}),[p,h,g,n,r,i]);return w.jsx($a.Provider,{value:v,children:t})}function bS(){return new Map}function wS(){return new Set}function SS(e,t){const 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}function qt(e){return Xn(e,"base-ui")}let pf=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function ES(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:s}=e,{register:i,unregister:a,subscribeMapChange:c,elementsRef:u,labelsRef:l,nextIndexRef:d}=yS(),p=f.useRef(-1),[h,m]=f.useState(s??(o===pf.GuessFromOrder?()=>{if(p.current===-1){const y=d.current;d.current+=1,p.current=y}return p.current}:-1)),g=f.useRef(null),v=f.useCallback(y=>{if(g.current=y,h!==-1&&y!==null&&(u.current[h]=y,l)){const C=t!==void 0;l.current[h]=C?t:r?.current?.textContent??y.textContent}},[h,u,l,t,r]);return he(()=>{if(s!=null)return;const y=g.current;if(y)return i(y,n),()=>{a(y)}},[s,i,a,n]),he(()=>{if(s==null)return c(y=>{const C=g.current?y.get(g.current)?.index:null;C!=null&&m(C)})},[s,c,m]),f.useMemo(()=>({ref:v,index:h}),[h,v])}const hf="ArrowUp",mf="ArrowDown",gf="ArrowLeft",yf="ArrowRight",vf="Home",bf="End",xS=new Set([gf,yf]),CS=new Set([hf,mf]),TS=new Set([...xS,...CS]);[...TS];const Ms=new Set([hf,mf,gf,yf,vf,bf]);function ja(e){const t=f.useRef(!0);t.current&&(t.current=!1,e())}let wf={},Sf={},Ef="";function OS(e){if(typeof document>"u")return!1;const t=Ie(e);return tt(t).innerWidth-t.documentElement.clientWidth>0}function PS(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Ie(e),r=n.documentElement,o=n.body,s=Bn(r)?r:o,i=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,c===u}function _S(e){const t=Ie(e),n=t.documentElement,r=t.body,o=Bn(n)?n:r,s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function IS(e){const t=Ie(e),n=t.documentElement,r=t.body,o=tt(n);let s=0,i=0,a=!1;const c=yn.create();if(Gi&&(o.visualViewport?.scale??1)!==1)return()=>{};function u(){const h=o.getComputedStyle(n),m=o.getComputedStyle(r),y=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,wf={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ef=n.style.scrollBehavior,Sf={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,S=n.scrollWidth>n.clientWidth,E=h.overflowY==="scroll"||m.overflowY==="scroll",b=h.overflowX==="scroll"||m.overflowX==="scroll",x=Math.max(0,o.innerWidth-r.clientWidth),T=Math.max(0,o.innerHeight-r.clientHeight),P=parseFloat(m.marginTop)+parseFloat(m.marginBottom),$=parseFloat(m.marginLeft)+parseFloat(m.marginRight),M=Bn(n)?n:r;if(a=PS(e),a){n.style.scrollbarGutter=y,M.style.overflowY="hidden",M.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(C||E)&&(n.style.overflowY="scroll"),(S||b)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:P||T?`calc(100dvh - ${P+T}px)`:"100dvh",width:$||x?`calc(100vw - ${$+x}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function l(){Object.assign(n.style,wf),Object.assign(r.style,Sf),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Ef)}function d(){l(),c.request(u)}u();const p=Fe(o,"resize",d);return()=>{c.cancel(),l(),typeof o.removeEventListener=="function"&&p()}}class kS{lockCount=0;restore=null;timeoutLock=Zt.create();timeoutUnlock=Zt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Ie(t).documentElement,o=tt(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=Ct;return}const s=al||!OS(t);this.restore=s?_S(t):IS(t)}}const RS=new kS;function xf(e=!0,t=null){he(()=>{if(e)return RS.acquire(t)},[e,t])}function NS(e){const t=f.useRef(""),n=f.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:f.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function As(e,t){const n=f.useRef(e),r=ie(t);he(()=>{n.current!==e&&r(n.current)},[e,r]),he(()=>{n.current=e},[e])}function Ha(e){const[t,n]=f.useState(null),r=ie((i,a)=>{e||n(a||(al?"touch":""))});As(e,i=>{i&&!e&&n(null)});const{onClick:o,onPointerDown:s}=NS(r);return f.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:s}}),[t,o,s])}function MS(e){const{store:t,parentContext:n,actionsRef:r,isDrawer:o}=e,s=t.useState("open"),i=t.useState("disablePointerDismissal"),a=t.useState("modal"),c=t.useState("popupElement"),{openMethod:u,triggerProps:l}=Ha(s);kd(t);const{forceUnmount:d}=Rd(s,t),p=f.useCallback(()=>{t.setOpen(!1,Ae(td))},[t]);f.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);const h=Dd({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[m,g]=f.useState(0),[v,y]=f.useState(0),C=m===0,S=zd(h),E=ka(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(V){if(!t.context.outsidePressEnabledRef.current||"button"in V&&V.button!==0||"touches"in V&&V.touches.length!==1)return!1;const L=lt(V);if(C&&!i){const D=L;return a&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===D||t.context.backdropRef.current===D||we(D,c)&&!D?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});xf(s&&a===!0,c);const{getReferenceProps:b,getFloatingProps:x,getTriggerProps:T}=bo([S,E]);t.useContextCallback("onNestedDialogOpen",(V,L)=>{g(V),y(L)}),t.useContextCallback("onNestedDialogClose",()=>{g(0),y(0)}),f.useEffect(()=>(n?.onNestedDialogOpen&&s&&n.onNestedDialogOpen(m+1,v+(o?1:0)),n?.onNestedDialogClose&&!s&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&s&&n.onNestedDialogClose()}),[o,s,m,v,n]);const P=f.useMemo(()=>b(l),[b,l]),$=f.useMemo(()=>T(l),[T,l]),M=f.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:u,activeTriggerProps:P,inactiveTriggerProps:$,popupProps:M,floatingRootContext:h,nestedOpenDialogCount:m,nestedOpenDrawerCount:v})}const Ua=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ua.displayName="DialogRootContext");function Vt(e){const t=f.useContext(Ua);if(e===!1&&t===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.":ft(27));return t}const AS={...Md,modal:de(e=>e.modal),nested:de(e=>e.nested),nestedOpenDialogCount:de(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:de(e=>e.nestedOpenDrawerCount),disablePointerDismissal:de(e=>e.disablePointerDismissal),openMethod:de(e=>e.openMethod),descriptionElementId:de(e=>e.descriptionElementId),titleElementId:de(e=>e.titleElementId),viewportElement:de(e=>e.viewportElement),role:de(e=>e.role)};class Ba extends Wo{constructor(t){super(DS(t),{popupRef:f.createRef(),backdropRef:f.createRef(),internalBackdropRef:f.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new bs,onOpenChange:void 0,onOpenChangeComplete:void 0},AS)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t},o=n.trigger?.id??null;(o||t)&&(r.activeTriggerId=o,r.activeTriggerElement=n.trigger??null),this.update(r)};static useStore(t,n){const r=wt(()=>new Ba(n)).current;return t??r}}function DS(e={}){return{...Nd(),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}}const Ds=f.createContext(!1);process.env.NODE_ENV!=="production"&&(Ds.displayName="IsDrawerContext");function Wa(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:c,handle:u,triggerId:l,defaultTriggerId:d=null}=e,p=Vt(!0),h=f.useContext(Ds),m=!!p,g=Ba.useStore(u?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:l,modal:a,disablePointerDismissal:i,nested:m});ja(()=>{n===void 0&&g.state.open===!1&&r===!0&&g.update({open:!0,activeTriggerId:d})}),g.useControlledProp("openProp",n),g.useControlledProp("triggerIdProp",l),g.useSyncedValues({disablePointerDismissal:i,nested:m,modal:a}),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",s);const v=g.useState("payload");MS({store:g,actionsRef:c,parentContext:p?.store.context,isDrawer:h});const y=f.useMemo(()=>({store:g}),[g]);return w.jsx(Ds.Provider,{value:!1,children:w.jsx(Ua.Provider,{value:y,children:typeof t=="function"?t({payload:v}):t})})}const LS={...Cn,...tn},Za=f.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,{store:c}=Vt(),u=c.useState("open"),l=c.useState("nested"),d=c.useState("mounted"),p=c.useState("transitionStatus");return qe("div",t,{state:{open:u,transitionStatus:p},ref:[c.context.backdropRef,n],stateAttributesMapping:LS,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:i||!l})});process.env.NODE_ENV!=="production"&&(Za.displayName="DialogBackdrop");const Ga=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,style:a,...c}=t,{store:u}=Vt(),l=u.useState("open");function d(g){l&&u.setOpen(!1,Ae(C0,g.nativeEvent))}const{getButtonProps:p,buttonRef:h}=Lr({disabled:s,native:i});return qe("button",t,{state:{disabled:s},ref:[n,h],props:[{onClick:d},c,p]})});process.env.NODE_ENV!=="production"&&(Ga.displayName="DialogClose");const Ya=f.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,{store:c}=Vt(),u=qt(i);return c.useSyncedValueWithCleanup("descriptionElementId",u),qe("p",t,{ref:n,props:[{id:u},a]})});process.env.NODE_ENV!=="production"&&(Ya.displayName="DialogDescription");let FS=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),VS=(function(e){return e[e.open=Ft.open]="open",e[e.closed=Ft.closed]="closed",e[e.startingStyle=Ft.startingStyle]="startingStyle",e[e.endingStyle=Ft.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Xa=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Xa.displayName="DialogPortalContext");function qa(){const e=f.useContext(Xa);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Portal> is missing.":ft(26));return e}const zS={...Cn,...tn,nestedDialogOpen(e){return e?{[VS.nestedDialogOpen]:""}:null}},Ka=f.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,style:a,...c}=t,{store:u}=Vt(),l=u.useState("descriptionElementId"),d=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),h=u.useState("popupProps"),m=u.useState("modal"),g=u.useState("mounted"),v=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),C=u.useState("open"),S=u.useState("openMethod"),E=u.useState("titleElementId"),b=u.useState("transitionStatus"),x=u.useState("role");qa(),xn({open:C,ref:u.context.popupRef,onComplete(){C&&u.context.onOpenChangeComplete?.(!0)}});function T(L){return L==="touch"?u.context.popupRef.current:!0}const P=s===void 0?T:s,$=y>0,V=qe("div",t,{state:{open:C,nested:v,transitionStatus:b,nestedDialogOpen:$},props:[h,{"aria-labelledby":E??void 0,"aria-describedby":l??void 0,role:x,tabIndex:-1,hidden:!g,onKeyDown(L){Ms.has(L.key)&&L.stopPropagation()},style:{[FS.nestedDialogs]:y}},c],ref:[n,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:zS});return w.jsx(ms,{context:p,openInteractionType:S,disabled:!g,closeOnFocusOut:!d,initialFocus:P,returnFocus:o,modal:m!==!1,restoreFocus:"popup",children:V})});process.env.NODE_ENV!=="production"&&(Ka.displayName="DialogPopup");const Ls=f.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return w.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(Ls.displayName="InternalBackdrop");const Fs=f.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=Vt(),i=s.useState("mounted"),a=s.useState("modal"),c=s.useState("open");return i||r?w.jsx(Xa.Provider,{value:r,children:w.jsxs(hs,{ref:n,...o,children:[i&&a===!0&&w.jsx(Ls,{ref:s.context.internalBackdropRef,inert:cs(!c)}),t.children]})}):null});process.env.NODE_ENV!=="production"&&(Fs.displayName="DialogPortal");const Vs=f.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,{store:c}=Vt(),u=qt(i);return c.useSyncedValueWithCleanup("titleElementId",u),qe("h2",t,{ref:n,props:[{id:u},a]})});process.env.NODE_ENV!=="production"&&(Vs.displayName="DialogTitle");const zs=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,id:a,payload:c,handle:u,style:l,...d}=t,p=Vt(!0),h=u?.store??p?.store;if(!h)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.":ft(79));const m=qt(a),g=h.useState("floatingRootContext"),v=h.useState("isOpenedByTrigger",m),y=f.useRef(null),{registerTrigger:C,isMountedByThisTrigger:S}=Id(m,y,h,{payload:c}),{getButtonProps:E,buttonRef:b}=Lr({disabled:s,native:i}),x=Ia(g,{enabled:g!=null}),T=bo([x]),P={disabled:s,open:v},$=h.useState("triggerProps",S);return qe("button",t,{state:P,ref:[b,n,C,y],props:[T.getReferenceProps(),$,{[ha]:"",id:m},d,E],stateAttributesMapping:Yd})});process.env.NODE_ENV!=="production"&&(zs.displayName="DialogTrigger");let Cf=(function(e){return e[e.open=Ft.open]="open",e[e.closed=Ft.closed]="closed",e[e.startingStyle=Ft.startingStyle]="startingStyle",e[e.endingStyle=Ft.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const $S={...Cn,...tn,nested(e){return e?{[Cf.nested]:""}:null},nestedDialogOpen(e){return e?{[Cf.nestedDialogOpen]:""}:null}},Tf=f.forwardRef(function(t,n){const{className:r,render:o,children:s,style:i,...a}=t,c=qa(),{store:u}=Vt(),l=u.useState("open"),d=u.useState("nested"),p=u.useState("transitionStatus"),h=u.useState("nestedOpenDialogCount"),m=u.useState("mounted"),g=h>0;return qe("div",t,{enabled:c||m,state:{open:l,nested:d,transitionStatus:p,nestedDialogOpen:g},ref:[n,u.useStateSetter("viewportElement")],stateAttributesMapping:$S,props:[{role:"presentation",hidden:!m,style:{pointerEvents:l?void 0:"none"},children:s},a]})});process.env.NODE_ENV!=="production"&&(Tf.displayName="DialogViewport");const jS=(e,t)=>Object.is(e,t);function jr(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function HS(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:jr(t,r,n))}function xo(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:jr(r,t,n))}function US(e,t,n){return e.filter(r=>!jr(t,r,n))}function Ja(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function BS(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function WS(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(BS(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function ZS(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Ja(e)}function Hr(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Ja(e.value):Ja(e)}let Of=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const $s={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Co={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},GS={disabled:!1,...Co},hr={valid(e){return e===null?null:e?{[Of.valid]:""}:{[Of.invalid]:""}}},Qa=f.createContext({invalid:void 0,name:void 0,validityData:{state:$s,errors:[],error:"",value:"",initialValue:null},setValidityData:Ct,disabled:void 0,touched:Co.touched,setTouched:Ct,dirty:Co.dirty,setDirty:Ct,filled:Co.filled,setFilled:Ct,focused:Co.focused,setFocused:Ct,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:GS,markedDirtyRef:{current:!1},registerFieldControl:Ct,validation:{getValidationProps:(e=mt)=>e,getInputValidationProps:(e=mt)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Qa.displayName="FieldRootContext");function mr(e=!0){const t=f.useContext(Qa);if(t.setValidityData===Ct&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":ft(28));return t}function ec(e,t){const{enabled:n=!0,getValue:r,id:o,value:s}=t,{registerFieldControl:i}=mr(),a=f.useRef(null);a.current||(a.current=Symbol()),he(()=>{const c=a.current;if(!(!c||!n))return i(c,{controlRef:e,getValue:r,id:o,value:s}),()=>{i(c,void 0)}},[e,n,r,o,i,s])}const tc=f.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ct,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(tc.displayName="FormContext");function Ur(){return f.useContext(tc)}const nc=f.createContext({controlId:void 0,registerControlId:Ct,labelId:void 0,setLabelId:Ct,messageIds:[],setMessageIds:Ct,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(nc.displayName="LabelableContext");function Ln(){return f.useContext(nc)}function rc(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:s}=Ln(),i=qt(t),a=n?o:void 0,c=wt(()=>Symbol("labelable-control")),u=f.useRef(!1),l=f.useRef(t!=null),d=ie(()=>{!u.current||s===Ct||(u.current=!1,s(c.current,void 0))});return he(()=>{if(s===Ct)return;let p;if(n){const h=r?.current;$e(h)&&h.closest("label")!=null?p=t??null:p=a??i}else if(t!=null)l.current=!0,p=t;else if(l.current)p=i;else{d();return}if(p===void 0){d();return}u.current=!0,s(c.current,p)},[t,r,a,s,n,i,c,d]),f.useEffect(()=>d,[d]),o??i}function YS(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=tt(e),r=n.getComputedStyle(e,"::before"),o=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||o.content!=="none"))return t;const i=parseFloat(r.width)||0,a=parseFloat(r.height)||0,c=parseFloat(o.width)||0,u=parseFloat(o.height)||0,l=Math.max(t.width,i,c),d=Math.max(t.height,a,u),p=l-t.width,h=d-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-h/2,bottom:t.bottom+h/2}}function XS(e,t){return e??t}const qS=20;function Pf(e,t,n,r){const[o,s]=f.useState(!1);he(()=>{if(!e||!t||n==null){s(!1);return}const i=Ie(n).documentElement.clientWidth,a=n.offsetWidth;s(i>0&&a>0&&a>=i-qS)},[e,t,n]),xf(e&&(!t||o),r)}let _f=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function If(e){return f.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[_f.checked]:""}:{[_f.unchecked]:""}},...hr}),[e.indeterminate])}const kf=f.createContext({disabled:!1});process.env.NODE_ENV!=="production"&&(kf.displayName="FieldItemContext");function KS(){return f.useContext(kf)}function JS(e,t,n,r=!0,o){const[s,i]=f.useState(),a=qt(o?`${o}-label`:void 0),c=e??t??s;return he(()=>{const u=e||t||!r?void 0:QS(n.current,a);s!==u&&i(u)}),c}function QS(e,t){const n=eE(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function eE(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const o=e.nextElementSibling;if(o&&o.htmlFor===n)return o}const r=e.labels;return r&&r[0]}const Rf=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Rf.displayName="CheckboxGroupContext");function tE(e=!0){const t=f.useContext(Rf);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.":ft(3));return t}const oc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(oc.displayName="CheckboxRootContext");function nE(){const e=f.useContext(oc);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.":ft(14));return e}const rE="data-parent",sc=f.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,form:c,id:u,indeterminate:l=!1,inputRef:d,name:p,onCheckedChange:h,parent:m=!1,readOnly:g=!1,render:v,required:y=!1,uncheckedValue:C,value:S,nativeButton:E=!1,style:b,...x}=t,{clearErrors:T}=Ur(),{disabled:P,name:$,setDirty:M,setFilled:V,setFocused:L,setTouched:D,state:R,validationMode:O,validityData:I,shouldValidateOnChange:_,validation:N}=mr(),A=KS(),{labelId:j,controlId:B,registerControlId:U,getDescriptionProps:W}=Ln(),G=tE(),Z=G?.parent,X=Z&&G.allValues,K=P||A.disabled||G?.disabled||a,J=$??p,se=S??J,ae=qt(),pe=qt();let Y=B;X?Y=m?pe:`${Z.id}-${se}`:u&&(Y=u);let me={};X&&(m?me=G.parent.getParentProps():se&&(me=G.parent.getChildProps(se)));const ge=ie(h),{checked:fe=r,indeterminate:le=l,onCheckedChange:ce,...ve}=me,ue=G?.value,Se=G?.setValue,k=G?.defaultValue,H=f.useRef(null),F=wt(()=>Symbol("checkbox-control")),z=f.useRef(!1),{getButtonProps:Q,buttonRef:ne}=Lr({disabled:K,native:E}),te=G?.validation??N,[ye,_e]=Eo({controlled:se&&ue&&!m?ue.includes(se):fe,default:se&&k&&!m?k.includes(se):s,name:"Checkbox",state:"checked"});he(()=>{U!==Ct&&(z.current=!0,U(F.current,Y))},[Y,G,U,m,F]),f.useEffect(()=>{const Te=F.current;return()=>{!z.current||U===Ct||(z.current=!1,U(Te,void 0))}},[U,F]),ec(H,{enabled:!G,id:ae,value:ye});const Ee=f.useRef(null),Ce=or(d,Ee,te.inputRef),Pe=JS(i,j,Ee,!E,Y??void 0);he(()=>{Ee.current&&(Ee.current.indeterminate=le,ye&&V(!0))},[ye,le,V]),As(ye,()=>{G&&!m||(T(J),V(ye),M(ye!==I.initialValue),_()?te.commit(ye):te.commit(ye,!0))});const Ve=En({checked:ye,disabled:K,form:c,name:m?void 0:J,id:E?void 0:Y??void 0,required:y,ref:Ce,style:J?Al:ss,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Te){if(Te.nativeEvent.defaultPrevented)return;if(g){Te.preventDefault();return}const Ue=Te.currentTarget.checked,Be=Ae(cr,Te.nativeEvent);if(ce?.(Ue,Be),ge(Ue,Be),!Be.isCanceled&&(_e(Ue),se&&ue&&Se&&!m&&!X)){const ct=Ue?[...ue,se]:ue.filter(Ye=>Ye!==se);Se(ct,Be)}},onFocus(){H.current?.focus()}},S!==void 0?{value:(G?ye&&S:S)||""}:mt,W,G?te.getValidationProps:te.getInputValidationProps),Ge=X?!!fe:ye,He=X&&le||l;f.useEffect(()=>{if(!Z||!se)return;const Te=Z.disabledStatesRef.current;return Te.set(se,K),()=>{Te.delete(se)}},[Z,K,se]);const nt=f.useMemo(()=>({...R,checked:Ge,disabled:K,readOnly:g,required:y,indeterminate:He}),[R,Ge,K,g,y,He]),st=If(nt),Re=qe("span",t,{state:nt,ref:[ne,H,n,G?.registerControlRef],props:[{id:E?Y??void 0:ae,role:"checkbox","aria-checked":le?"mixed":ye,"aria-readonly":g||void 0,"aria-required":y||void 0,"aria-labelledby":Pe,[rE]:m?"":void 0,onFocus(){L(!0)},onBlur(){const Te=Ee.current;Te&&(D(!0),L(!1),O==="onBlur"&&te.commit(G?ue:Te.checked))},onClick(Te){g||K||(Te.preventDefault(),Ee.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:Te.shiftKey,ctrlKey:Te.ctrlKey,altKey:Te.altKey,metaKey:Te.metaKey})))}},W,te.getValidationProps,x,ve,Q],stateAttributesMapping:st});return w.jsxs(oc.Provider,{value:nt,children:[Re,!ye&&!G&&J&&!m&&C!==void 0&&w.jsx("input",{type:"hidden",form:c,name:J,value:C}),w.jsx("input",{...Ve,suppressHydrationWarning:!0})]})});process.env.NODE_ENV!=="production"&&(sc.displayName="CheckboxRoot");const ic=f.forwardRef(function(t,n){const{render:r,className:o,style:s,keepMounted:i=!1,...a}=t,c=nE(),u=c.checked||c.indeterminate,{mounted:l,transitionStatus:d,setMounted:p}=vo(u),h=f.useRef(null),m={...c,transitionStatus:d};xn({open:u,ref:h,onComplete(){u||p(!1)}});const g=If(c),v=f.useMemo(()=>({...g,...tn,...hr}),[g]),y=i||l,C=qe("span",t,{ref:[n,h],state:m,stateAttributesMapping:v,props:a});return y?C:null});process.env.NODE_ENV!=="production"&&(ic.displayName="CheckboxIndicator");function oE(e,t){const n=qt(e);return he(()=>(t(n),()=>{t(void 0)}),[n,t]),n}function sE(e={}){const{id:t,fallbackControlId:n,native:r=!1,setLabelId:o,focusControl:s}=e,{controlId:i,setLabelId:a}=Ln(),c=ie(h=>{a(h),o?.(h)}),u=oE(t,c),l=i??n;function d(h){if(s){s(h,l);return}if(!l)return;const m=Ie(h.currentTarget).getElementById(l);it(m)&&iE(m)}function p(h){lt(h.nativeEvent)?.closest("button,input,select,textarea")||(!h.defaultPrevented&&h.detail>1&&h.preventDefault(),!r&&d(h))}return r?{id:u,htmlFor:l??void 0,onMouseDown:p}:{id:u,onClick:p,onPointerDown(h){h.preventDefault()}}}function iE(e){e.focus({focusVisible:!0})}const Nf=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Nf.displayName="ToolbarRootContext");function Mf(e){return f.useContext(Nf)}function aE(e,t){const n=f.useRef(null),r=ie(s=>{Kt.flushSync(()=>{e.setOpen(!1,Ae(ur,s.nativeEvent,s.currentTarget))}),Ab(n.current)?.focus()}),o=ie(s=>{const i=e.select("positionerElement");if(i&&Ar(s,i))e.context.beforeContentFocusGuardRef.current?.focus();else{Kt.flushSync(()=>{e.setOpen(!1,Ae(ur,s.nativeEvent,s.currentTarget))});let a=Mb(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&we(i,a);){const c=a;if(a=ca(a),a===c)break}a?.focus()}});return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:o}}function cE(e){const[t,n]=f.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}const Af=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Af.displayName="CSPContext");const uE={disableStyleElements:!1};function lE(){return f.useContext(Af)??uE}let Tt=(function(e){return e.nestedDrawers="--nested-drawers",e.height="--drawer-height",e.frontmostHeight="--drawer-frontmost-height",e.swipeMovementX="--drawer-swipe-movement-x",e.swipeMovementY="--drawer-swipe-movement-y",e.snapPointOffset="--drawer-snap-point-offset",e.swipeStrength="--drawer-swipe-strength",e})({}),Fn=(function(e){return e.swipeProgress="--drawer-swipe-progress",e})({});const dE={...Cn,...tn},Df=f.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,{store:c}=Vt(),u=c.useState("open"),l=c.useState("nested"),d=c.useState("mounted"),p=c.useState("transitionStatus");return qe("div",t,{state:{open:u,transitionStatus:p},ref:[c.context.backdropRef,n],stateAttributesMapping:dE,props:[{role:"presentation",hidden:!d,style:{pointerEvents:u?void 0:"none",userSelect:"none",WebkitUserSelect:"none",[Fn.swipeProgress]:"0",[Tt.swipeStrength]:"1"}},a],enabled:i||!l})});process.env.NODE_ENV!=="production"&&(Df.displayName="DrawerBackdrop");const Lf="data-drawer-content",Ff=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t;return Vt(),qe("div",t,{ref:n,props:[{[Lf]:""},i]})});process.env.NODE_ENV!=="production"&&(Ff.displayName="DrawerContent");const Vf=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Vf.displayName="DrawerProviderContext");function zf(e){return f.useContext(Vf)}let ln=(function(e){return e[e.open=Ft.open]="open",e[e.closed=Ft.closed]="closed",e[e.startingStyle=Ft.startingStyle]="startingStyle",e[e.endingStyle=Ft.endingStyle]="endingStyle",e.expanded="data-expanded",e.nestedDrawerOpen="data-nested-drawer-open",e.nestedDrawerSwiping="data-nested-drawer-swiping",e.swipeDismiss="data-swipe-dismiss",e.swipeDirection="data-swipe-direction",e.swiping="data-swiping",e})({});const ac=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(ac.displayName="DrawerRootContext");function js(e){const t=f.useContext(ac);if(e===!1&&t===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.":ft(90));return t}function bt(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function $f(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e=="number")return Number.isFinite(e)?e<=1?bt(e,0,1)*t:e:null;const r=e.trim();if(r.endsWith("px")){const o=Number.parseFloat(r);return Number.isFinite(o)?o:null}if(r.endsWith("rem")){const o=Number.parseFloat(r);return Number.isFinite(o)?o*n:null}return null}function fE(e,t){let n=null,r=1/0;for(const o of t){const s=Math.abs(o.height-e);s<r&&(r=s,n=o)}return n}function jf(){const{store:e}=Vt(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:o}=js(),s=e.useState("viewportElement"),[i,a]=f.useState(0),[c,u]=f.useState(16),l=ie(()=>{const m=Ie(s).documentElement;s&&a(s.offsetHeight),s||a(m.clientHeight);const g=parseFloat(getComputedStyle(m).fontSize);Number.isFinite(g)&&u(g)});he(()=>{if(l(),!s||typeof ResizeObserver!="function")return;const h=new ResizeObserver(l);return h.observe(s),()=>{h.disconnect()}},[l,s]);const d=f.useMemo(()=>{if(!t||t.length===0||i<=0||o<=0)return[];const h=Math.min(o,i);if(!Number.isFinite(h)||h<=0)return[];const m=t.map(y=>{const C=$f(y,i,c);if(C===null||!Number.isFinite(C))return null;const S=bt(C,0,h);return{value:y,height:S,offset:Math.max(0,o-S)}}).filter(y=>!!y);if(m.length<=1)return m;const g=[],v=[];for(let y=m.length-1;y>=0;y-=1){const C=m[y];v.some(E=>Math.abs(E-C.height)<=1)||(v.push(C.height),g.push(C))}return g.reverse(),g},[o,c,t,i]),p=f.useMemo(()=>{if(n===void 0)return d[0];if(n===null)return;const h=d.find(y=>Object.is(y.value,n));if(h)return h;const m=Math.min(o,i),g=$f(n,i,c);if(g===null||!Number.isFinite(g))return;const v=bt(g,0,m);return fE(v,d)??void 0},[n,o,d,c,i]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:o,viewportHeight:i,resolvedSnapPoints:d,activeSnapPointOffset:p?.offset??null}}const cc=f.createContext(null);process.env.NODE_ENV!=="production"&&(cc.displayName="DrawerViewportContext");function pE(e){return f.useContext(cc)}let Hf=!1;function hE(){Hf||(typeof CSS<"u"&&"registerProperty"in CSS&&([Tt.swipeMovementX,Tt.swipeMovementY,Tt.snapPointOffset].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),[{name:Fn.swipeProgress,initialValue:"0"},{name:Tt.swipeStrength,initialValue:"1"}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:"<number>",inherits:!1,initialValue:t})}catch{}})),Hf=!0)}const mE={...Cn,...tn,expanded(e){return e?{[ln.expanded]:""}:null},nestedDrawerOpen(e){return e?{[ln.nestedDrawerOpen]:""}:null},nestedDrawerSwiping(e){return e?{[ln.nestedDrawerSwiping]:""}:null},swipeDirection(e){return e?{[ln.swipeDirection]:e}:null},swiping(e){return e?{[ln.swiping]:""}:null}},Uf=f.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,style:a,...c}=t,{store:u}=Vt(),{swipeDirection:l,frontmostHeight:d,hasNestedDrawer:p,nestedSwiping:h,nestedSwipeProgressStore:m,onPopupHeightChange:g,notifyParentFrontmostHeight:v,notifyParentHasNestedDrawer:y}=js(),C=u.useState("descriptionElementId"),S=u.useState("disablePointerDismissal"),E=u.useState("floatingRootContext"),b=u.useState("popupProps"),x=u.useState("modal"),T=u.useState("mounted"),P=u.useState("nested"),$=u.useState("nestedOpenDrawerCount"),M=u.useState("transitionStatus"),V=u.useState("open"),L=u.useState("openMethod"),D=u.useState("titleElementId"),R=u.useState("role"),O=$>0,I=pE(),_=I?.swiping??!1,N=I?.swipeStrength??null,{snapPoints:A,activeSnapPoint:j,activeSnapPointOffset:B}=jf();qa();const[U,W]=f.useState(0),G=f.useRef(0);process.env.NODE_ENV!=="production"&&f.useEffect(()=>{if(I)return;const ge=Dr.captureOwnerStack?.()||"";ar(`<Drawer.Popup> expected to be rendered within <Drawer.Viewport>. Omitting the viewport disables drawer swipe handling and touch scroll locking. Wrap <Drawer.Popup> in <Drawer.Viewport>.${ge}`)},[I]);const Z=ie(()=>{const ge=u.context.popupRef.current;if(!ge)return;const fe=ge.offsetHeight;if(G.current>0&&d>G.current&&fe>G.current)return;if(G.current>0&&p){const ve=G.current;W(ve),g(ve);return}const ce=fe;ce!==G.current&&(G.current=ce,W(ce),g(ce))});he(()=>{if(!T){G.current=0,W(0),g(0);return}const ge=u.context.popupRef.current;if(!ge||(hE(),Z(),typeof ResizeObserver!="function"))return;const fe=new ResizeObserver(Z);return fe.observe(ge),()=>{fe.disconnect()}},[Z,T,O,g,u.context.popupRef]),he(()=>{const ge=u.context.popupRef,fe=()=>{const ce=ge.current;if(!ce)return;const ve=m.getSnapshot();ve>0?ce.style.setProperty(Fn.swipeProgress,`${ve}`):ce.style.setProperty(Fn.swipeProgress,"0")};fe();const le=m.subscribe(fe);return()=>{le();const ce=ge.current;ce&&ce.style.setProperty(Fn.swipeProgress,"0")}},[m,u.context.popupRef]),f.useEffect(()=>{if(V)return v?.(d),()=>{v?.(0)}},[d,V,v]),f.useEffect(()=>y?(y(V||M==="ending"),()=>{y(!1)}):void 0,[y,V,M]),xn({open:V,ref:u.context.popupRef,onComplete(){V&&u.context.onOpenChangeComplete?.(!0)}});const X=s===void 0?u.context.popupRef:s,K={open:V,nested:P,transitionStatus:M,expanded:j===1,nestedDrawerOpen:O,nestedDrawerSwiping:h,swipeDirection:l,swiping:_};let J;U&&!(!p&&M!=="ending")&&(J=`${U}px`);const ae=A&&A.length>0&&(l==="down"||l==="up");let pe=null;ae&&B!==null&&(pe=l==="up"?-B:B);let Y=I?I.getDragStyles():mt;if(ae&&l==="down"){const ge=B??0,fe=Number.parseFloat(String(Y[Tt.swipeMovementY]??0)),le=Number.isFinite(fe)?ge+fe:ge,ce=le<0;if(_&&ce&&Number.isFinite(fe)){const ve=Math.abs(le),Se=-Math.sqrt(ve)-ge;Y={...Y,transform:void 0,[Tt.swipeMovementY]:`${Se}px`}}else Y={...Y,transform:void 0}}const me=qe("div",t,{state:K,props:[b,{"aria-labelledby":D,"aria-describedby":C,role:R,tabIndex:-1,hidden:!T,onKeyDown(ge){Ms.has(ge.key)&&ge.stopPropagation()},style:{...Y,[Fn.swipeProgress]:"0",[Tt.nestedDrawers]:$,[Tt.height]:J,[Tt.snapPointOffset]:typeof pe=="number"?`${pe}px`:"0px",[Tt.frontmostHeight]:d?`${d}px`:void 0,[Tt.swipeStrength]:typeof N=="number"&&Number.isFinite(N)&&N>0?`${N}`:"1"}},c],ref:[n,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:mE});return w.jsx(ms,{context:E,openInteractionType:L,disabled:!T,closeOnFocusOut:!S,initialFocus:X,returnFocus:o,modal:x!==!1,restoreFocus:"popup",children:me})});process.env.NODE_ENV!=="production"&&(Uf.displayName="DrawerPopup");const gE=Fs;var Bf,Wf;function yE(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:c,handle:u,triggerId:l,defaultTriggerId:d=null,swipeDirection:p="down",snapToSequentialPoints:h=!1,snapPoints:m,snapPoint:g,defaultSnapPoint:v,onSnapPointChange:y}=e,C=ie(y),S=js(!0),E=S?.onNestedSwipeProgressChange,b=S?.onNestedFrontmostHeightChange,x=S?.onNestedSwipingChange,T=S?.onNestedDrawerPresenceChange,[P,$]=f.useState(0),[M,V]=f.useState(0),[L,D]=f.useState(!1),[R,O]=f.useState(!1),[I]=f.useState(vE),_=v!==void 0?v:m?.[0]??null,N=g!==void 0,[A,j]=Eo({controlled:g,default:_,name:"Drawer",state:"snapPoint"}),B=f.useRef(!1),U=ie((Y,me)=>{const ge=me??Ae(cr);C?.(Y,ge),!ge.isCanceled&&j(Y)}),W=f.useMemo(()=>N||!m||m.length===0?A:A===null||!m.some(Y=>Object.is(Y,A))?_:A,[A,N,_,m]),G=ie(Y=>{$(Y),!B.current&&Y>0&&V(Y)}),Z=ie(Y=>{if(Y>0){B.current=!0,V(Y);return}B.current=!1,P>0&&V(P)}),X=ie(Y=>{D(Y)}),K=ie(Y=>{I.set(Y),E?.(Y)}),J=ie(Y=>{O(Y),x?.(Y)}),se=ie((Y,me)=>{o?.(Y,me),!me.isCanceled&&!Y&&m&&m.length>0&&U(_,Ae(me.reason,me.event,me.trigger))}),ae=f.useMemo(()=>({swipeDirection:p,snapToSequentialPoints:h,snapPoints:m,activeSnapPoint:W,setActiveSnapPoint:U,frontmostHeight:M,popupHeight:P,hasNestedDrawer:L,nestedSwiping:R,nestedSwipeProgressStore:I,onNestedDrawerPresenceChange:X,onPopupHeightChange:G,onNestedFrontmostHeightChange:Z,onNestedSwipingChange:J,onNestedSwipeProgressChange:K,notifyParentFrontmostHeight:b,notifyParentSwipingChange:x,notifyParentSwipeProgressChange:E,notifyParentHasNestedDrawer:T}),[W,M,L,R,I,T,E,x,b,X,Z,K,J,G,P,U,m,h,p]),pe=typeof t=="function"?Y=>w.jsxs(f.Fragment,{children:[Bf||(Bf=w.jsx(Zf,{})),t(Y)]}):w.jsxs(f.Fragment,{children:[Wf||(Wf=w.jsx(Zf,{})),t]});return w.jsx(ac.Provider,{value:ae,children:w.jsx(Ds.Provider,{value:!0,children:w.jsx(Wa,{open:n,defaultOpen:r,onOpenChange:se,onOpenChangeComplete:s,disablePointerDismissal:i,modal:a,actionsRef:c,handle:u,triggerId:l,defaultTriggerId:d,children:pe})})})}function vE(){let e=0;const t=new Set;return{getSnapshot:()=>e,set(n){const r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(o=>{o()}))},subscribe(n){return t.add(n),()=>{t.delete(n)}}}}function Zf(){const e=Xn(),t=zf(),n=Vt(!1),r=n.store.useState("open"),o=n.store.useState("nestedOpenDialogCount"),s=n.store.useState("popupElement"),i=o===0;return f.useEffect(()=>{if(!(!t||e==null))return()=>{t.removeDrawer(e)}},[e,t]),f.useEffect(()=>{e!=null&&t?.setDrawerOpen(e,r)},[e,r,t]),f.useEffect(()=>{if(!r||!i||!Jo)return;const c=tt(s).CloseWatcher;if(!c)return;function u(p){n.store.select("open")&&n.store.setOpen(!1,Ae(T0,p))}const l=new c,d=Fe(l,"close",u);return()=>{d(),l.destroy()}},[n.store,i,r,s]),null}function uc(e,t){const n=At(e);if(t==="vertical"){const o=n.overflowY;return(o==="auto"||o==="scroll")&&e.scrollHeight>e.clientHeight}const r=n.overflowX;return(r==="auto"||r==="scroll")&&e.scrollWidth>e.clientWidth}function bE(e,t,n){let r=e;for(;r&&r!==t;){for(const o of n)if(uc(r,o))return!0;r=r.parentElement}return!1}function Br(e,t,n="vertical"){let r=it(e)?e:null;for(;r&&r!==t;){if(uc(r,n))return r;r=r.parentElement}return uc(t,n)?t:null}function Hs(e,t,n){return typeof e?.elementFromPoint=="function"?e.elementFromPoint(t,n):null}const wE=40,SE=10,EE=1,xE=50,Gf=16,CE=80,TE='button,a,input,select,textarea,label,[role="button"]';function lc(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function OE(e){const n=tt(e).getComputedStyle(e).transform;let r=0,o=0,s=1;if(n&&n!=="none"){const i=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(i){const a=i[1].split(", ").map(parseFloat);a.length===6?(r=a[4],o=a[5],s=Math.sqrt(a[0]*a[0]+a[1]*a[1])):a.length===16&&(r=a[12],o=a[13],s=a[0])}}return{x:r,y:o,scale:s}}function Us(e){return Number.isFinite(e)&&e>0?e:null}function PE(e){return e%2===1}function dc(e,t,n){const r=e[n];if(typeof r=="function")try{r.call(e,t)}catch(o){if(o&&typeof o=="object"&&"name"in o&&o.name==="NotFoundError")return;throw o}}function _E(e){const{enabled:t,directions:n,elementRef:r,movementCssVars:o,canStart:s,ignoreSelectorWhenTouch:i=!0,ignoreScrollableAncestors:a=!1,swipeThreshold:c,onDismiss:u,onProgress:l,onCancel:d,onSwipeStart:p,onRelease:h,onSwipingChange:m,trackDrag:g=!0}=e,v=TE,y=n.length===1?n[0]:void 0,C=Math.max(0,typeof c=="number"?c:wE),S=n.includes("left"),E=n.includes("right"),b=n.includes("up"),x=n.includes("down"),T=S||E,P=b||x,$=f.useMemo(()=>{const q=[];return P&&q.push("vertical"),T&&q.push("horizontal"),q},[T,P]),[M,V]=f.useState(void 0),[L,D]=f.useState(!1),[R,O]=f.useState(!1),[I,_]=f.useState(!1),[N,A]=f.useState({x:0,y:0}),[j,B]=f.useState({x:0,y:0,scale:1}),[U,W]=f.useState(null),G=f.useRef({x:0,y:0}),Z=f.useRef({x:0,y:0}),X=f.useRef(null),K=f.useRef({x:0,y:0,scale:1}),J=f.useRef(void 0),se=f.useRef(0),ae=f.useRef(!1),pe=f.useRef({x:0,y:0}),Y=f.useRef(!1),me=f.useRef(!1),ge=f.useRef(null),fe=f.useRef(!1),le=f.useRef(!1),ce=f.useRef({width:0,height:0}),ve=f.useRef(0),ue=f.useRef(C),Se=f.useRef(null),k=f.useRef(null),H=f.useRef({x:0,y:0}),F=f.useRef(null),z=f.useRef(!1),Q=ie(q=>{z.current!==q&&(z.current=q,D(q),m?.(q))});function ne(q){if(!q)return;if(typeof c!="function"){ue.current=C;return}const re=r.current;if(!re)return;const be=c({element:re,direction:q});ue.current=Math.max(0,be)}const te=ie((q,re)=>{const be=Number.isFinite(q)?bt(q,0,1):0,Le=be!==ve.current;let je=!1;if(re){const De=F.current;je=!De||De.deltaX!==re.deltaX||De.deltaY!==re.deltaY||De.direction!==re.direction}!Le&&!je||(ve.current=be,re?F.current=re:Le&&(F.current=null),l?.(be,re))});function ye(q,re){if(re===null)return;const be=k.current;if(be&&re>be.time){const Le=Math.max(re-be.time,Gf);H.current={x:(q.x-be.x)/Le,y:(q.y-be.y)/Le}}k.current={x:q.x,y:q.y,time:re}}const _e=f.useCallback(()=>{V(void 0),Q(!1),O(!1),_(!1),A({x:0,y:0}),B({x:0,y:0,scale:1}),W(null),te(0),ue.current=C,G.current={x:0,y:0},Z.current={x:0,y:0},K.current={x:0,y:0,scale:1},J.current=void 0,se.current=0,ae.current=!1,pe.current={x:0,y:0},Y.current=!1,X.current=null,me.current=!1,ge.current=null,fe.current=!1,le.current=!1,ce.current={width:0,height:0},Se.current=null,k.current=null,H.current={x:0,y:0},F.current=null},[Q,C,te]);f.useEffect(()=>{typeof c!="function"&&(ue.current=C)},[C,c]);function Ee(q){if("touches"in q){const re=q.touches[0];return re?{x:re.clientX,y:re.clientY}:null}return{x:q.clientX,y:q.clientY}}function Ce(q){return"touches"in q?!0:q.pointerType==="touch"}function Pe(q,re){const be=Ie(r.current);return Hs(be,q.x,q.y)??lt(re)}function Ve(q,re){return T&&!P?Br(q,re,"horizontal"):P&&!T?Br(q,re,"vertical"):Br(q,re,"vertical")??Br(q,re,"horizontal")}function Ge(q,re,be){fe.current=!1;const Le=Ce(q),je=Pe(re,q.nativeEvent),Qe=Ie(r.current).body,Oe=Le&&Qe?Ve(je,Qe):null,xe=be?.ignoreScrollableTarget??!1;if(Oe&&!xe||(fe.current=!!(Oe&&xe),(je?je.closest(v):!1)&&(!Le||i)))return!1;const Me=r.current;if(a&&Me&&je&&$.length>0&&!(be?.ignoreScrollableAncestors??!1)&&bE(je,Me,$))return!1;if(ae.current=!1,J.current=void 0,se.current=0,G.current=re,Se.current=Us(q.timeStamp),pe.current=re,X.current=re,Me){ce.current={width:Me.offsetWidth,height:Me.offsetHeight},ne(y);const Xe=OE(Me);K.current=Xe,Z.current={x:Xe.x,y:Xe.y},B(Xe),A({x:Xe.x,y:Xe.y}),ye({x:Xe.x,y:Xe.y},Se.current),"touches"in q||dc(Me,q.pointerId,"setPointerCapture")}return p?.(q.nativeEvent),Q(!0),O(!1),W(null),Y.current=!0,te(0),!0}function He(){nt(),fe.current=!1,X.current=null}function nt(){me.current=!1,ge.current=null}function st(q){if(He(),!z.current)return;Q(!1),O(!1),W(null);const re=g?j:K.current;Z.current={x:re.x,y:re.y},A({x:re.x,y:re.y}),V(void 0),le.current=!1;const be=r.current;be&&dc(be,q.pointerId,"releasePointerCapture"),te(0,{deltaX:0,deltaY:0,direction:void 0}),d?.(q.nativeEvent)}function Re(q,re){const be=Qe=>Qe>=0?Qe**.5:-(Math.abs(Qe)**.5),Le=(Qe,Oe,xe)=>!Oe&&Qe<0||!xe&&Qe>0?be(Qe):Qe,je=T?Le(q,S,E):be(q),De=P?Le(re,b,x):be(re);return{x:je,y:De}}function Te(q,re,be){const Le=Math.abs(re),je=Math.abs(be);if(P&&be!==0&&(!T||je>=Le)){const Oe=Math.max(0,q.scrollHeight-q.clientHeight),xe=q.scrollTop<=0,Ne=q.scrollTop>=Oe,Me=be>0,Xe=be<0;return Me&&xe&&x||Xe&&Ne&&b}if(T&&re!==0&&(!P||Le>je)){const Oe=Math.max(0,q.scrollWidth-q.clientWidth),xe=q.scrollLeft<=0,Ne=q.scrollLeft>=Oe,Me=re>0,Xe=re<0;return Me&&xe&&E||Xe&&Ne&&S}return null}const Ue=ie(q=>{if(!t||q.defaultPrevented||q.nativeEvent.defaultPrevented||!("touches"in q)&&q.button!==0)return;const re=Ee(q);!re||(me.current=!0,ge.current=re,fe.current=!1,le.current=!1,!(s?s(re,{nativeEvent:q.nativeEvent,direction:y}):!0))||Ge(q,re)&&nt()});function Be(q,re,be){if(!t||!z.current)return;const Le=lt(q.nativeEvent);if(Ce(q)&&!fe.current){const on=q.currentTarget;if(Ve(Le,on))return}if("touches"in q||q.preventDefault(),Y.current){G.current=re;const on=Us(q.timeStamp);on!==null&&(Se.current=on),Y.current=!1}const je=re.x,De=re.y,Qe=be.x,Oe=be.y;(Oe<0&&De>pe.current.y||Oe>0&&De<pe.current.y)&&(pe.current={x:pe.current.x,y:De}),(Qe<0&&je>pe.current.x||Qe>0&&je<pe.current.x)&&(pe.current={x:je,y:pe.current.y});const xe=je-G.current.x,Ne=De-G.current.y,Me=De-pe.current.y,Xe=je-pe.current.x;if(!R&&Math.sqrt(xe*xe+Ne*Ne)>=EE&&(O(!0),U===null&&T&&P)){const qr=Math.abs(xe),Hc=Math.abs(Ne);W(qr>Hc?"horizontal":"vertical")}let Je;if(!J.current)U==="vertical"?Ne>0?Je="down":Ne<0&&(Je="up"):U==="horizontal"?xe>0?Je="right":xe<0&&(Je="left"):Math.abs(xe)>=Math.abs(Ne)?Je=xe>0?"right":"left":Je=Ne>0?"down":"up",Je&&(Je==="left"&&S||Je==="right"&&E||Je==="up"&&b||Je==="down"&&x)&&(J.current=Je,se.current=lc(Je,xe,Ne),V(Je),ne(Je));else{const on=J.current,qr=lc(on,Xe,Me);qr>ue.current?(ae.current=!1,V(on)):!(S&&E)&&!(b&&x)&&se.current-qr>=SE&&(ae.current=!0)}const dn=Re(xe,Ne);let rn=K.current.x,Bt=K.current.y;U==="horizontal"?T&&(rn+=dn.x):(U==="vertical"||T&&(rn+=dn.x),P&&(Bt+=dn.y)),Z.current={x:rn,y:Bt},g&&A({x:rn,y:Bt}),ye({x:rn,y:Bt},Us(q.timeStamp));const er=rn-K.current.x,Pn=Bt-K.current.y,Er=J.current,xr=y??J.current;if(!xr){te(0,{deltaX:er,deltaY:Pn,direction:Er});return}const _n=xr==="left"||xr==="right"?ce.current.width:ce.current.height,fn=K.current.scale||1;if(_n<=0||fn<=0){te(0,{deltaX:er,deltaY:Pn,direction:Er});return}const Cr=lc(xr,rn-K.current.x,Bt-K.current.y);if(Cr<=0){te(0,{deltaX:er,deltaY:Pn,direction:Er});return}te(Cr/(_n*fn),{deltaX:er,deltaY:Pn,direction:Er})}const ct=ie(q=>{const re=Ee(q);if(!re)return;if(!("touches"in q)){const je=PE(q.buttons);je&&(le.current=!0);const De=q.buttons===0&&le.current;if(q.buttons!==0&&!je||De){st(q);return}}if(!L&&me.current){if(!Ce(q)&&(q.defaultPrevented||q.nativeEvent.defaultPrevented)){He();return}if(s?s(re,{nativeEvent:q.nativeEvent,direction:y}):!0){const De=ge.current;let Qe=!1;if(Ce(q)){const xe=r.current;if(De&&xe){const Ne=Pe(re,q.nativeEvent),Xe=Ie(xe).body,Je=Xe?Ve(Ne,Xe):null;if(Je&&(we(xe,Je)||we(Je,xe))){const dn=re.x-De.x,rn=re.y-De.y,Bt=Te(Je,dn,rn);if(Bt===!1)return;Bt===!0&&(Qe=!0)}}}Ge(q,re,{ignoreScrollableTarget:Qe,ignoreScrollableAncestors:Qe})&&(De&&Qe?(nt(),G.current=De,pe.current=De,X.current=De,Y.current=!1):(nt(),fe.current=!1))}}const be=X.current,Le=be===null?{x:0,y:0}:{x:re.x-be.x,y:re.y-be.y};X.current=re,Be(q,re,Le)}),Ye=ie(q=>{if(!t)return;const re=Z.current,be=K.current,Le=re.x-be.x,je=re.y-be.y,De={deltaX:Le,deltaY:je,direction:M??J.current};if(!z.current){He(),te(0,De);return}Q(!1),O(!1),W(null),He(),le.current=!1;const Qe=r.current;Qe&&("touches"in q||dc(Qe,q.pointerId,"releasePointerCapture"));const Oe=Le,xe=je,Ne=Se.current,Me=Us(q.timeStamp),Xe=Ne!==null&&Me!==null&&Me>Ne?Me-Ne:0,Je=Xe>0?Math.max(Xe,xE):0,dn=Je>0?Oe/Je:0,rn=Je>0?xe/Je:0;let Bt=H.current.x,er=H.current.y;const Pn=k.current;if(Pn&&Me!==null&&Me>=Pn.time){const Cr=Me-Pn.time;if(Cr<=CE){const on=Math.max(Cr,Gf),qr=re.x-Pn.x,Hc=re.y-Pn.y,Jh=qr/on,Qh=Hc/on;Jh!==0&&(Bt=Jh),Qh!==0&&(er=Qh)}else Bt=0,er=0}const Er=h?.({event:q.nativeEvent,direction:M??J.current,deltaX:Oe,deltaY:xe,velocityX:dn,velocityY:rn,releaseVelocityX:Bt,releaseVelocityY:er}),xr=typeof Er=="boolean";if(ae.current&&!xr){Z.current={x:be.x,y:be.y},A({x:be.x,y:be.y}),V(void 0),te(0,De);return}let _n=!1,fn;if(xr)_n=Er,fn=M??J.current??y;else for(const Cr of n){switch(Cr){case"right":Oe>ue.current&&(_n=!0,fn="right");break;case"left":Oe<-ue.current&&(_n=!0,fn="left");break;case"down":xe>ue.current&&(_n=!0,fn="down");break;case"up":xe<-ue.current&&(_n=!0,fn="up");break}if(_n)break}_n&&fn?(V(fn),_(!0),u?.(q.nativeEvent,{direction:fn})):(Z.current={x:be.x,y:be.y},A({x:be.x,y:be.y}),V(void 0),te(0,De))}),Ut=f.useCallback(()=>{const q=g?N:Z.current,re=g?j:K.current;if(!L&&q.x===re.x&&q.y===re.y&&!I)return{[o.x]:"0px",[o.y]:"0px"};const be=q.x-re.x,Le=q.y-re.y;return{transition:L?"none":void 0,transform:L?`translateX(${q.x}px) translateY(${q.y}px) scale(${re.scale})`:void 0,[o.x]:`${be}px`,[o.y]:`${Le}px`}},[I,N,j,L,o,g]),$t=f.useCallback(()=>t?{onPointerDown:Ue,onPointerMove:ct,onPointerUp:Ye,onPointerCancel:Ye}:{},[t,Ye,ct,Ue]),Ke=f.useCallback(()=>t?{onTouchStart:Ue,onTouchMove:ct,onTouchEnd:Ye,onTouchCancel:Ye}:{},[t,Ye,ct,Ue]);return{swiping:L,swipeDirection:M,dragDismissed:I,getPointerProps:$t,getTouchProps:Ke,getDragStyles:Ut,reset:_e}}const IE=Vs,kE=zs,fc=10,Yf=.5,Xf=.5,RE=300,qf=4,Kf=.2,NE=4,pc=80,Jf=360,hc=.1,Qf=1,ME=`[${Lf}]`,ep=f.forwardRef(function(t,n){const{className:r,render:o,style:s,children:i,...a}=t,{store:c}=Vt(),{swipeDirection:u,notifyParentSwipingChange:l,notifyParentSwipeProgressChange:d,frontmostHeight:p,snapToSequentialPoints:h}=js(),g=zf()?.visualStateStore,v=c.useState("open"),y=c.useState("mounted"),C=c.useState("nested"),S=c.useState("nestedOpenDrawerCount"),E=c.useState("viewportElement"),b=c.useState("popupElement"),x=S>0,T=u==="left"||u==="right"?"horizontal":"vertical",P=T==="vertical",$=P?"horizontal":"vertical",{snapPoints:M,resolvedSnapPoints:V,activeSnapPoint:L,activeSnapPointOffset:D,setActiveSnapPoint:R,popupHeight:O}=jf(),[I,_]=f.useState(null),N=f.useRef(void 0),A=f.useRef(null),j=ao(),B=f.useRef(!1),U=f.useRef(""),W=f.useRef(!1),G=f.useRef(!1),Z=f.useRef(null),X=f.useMemo(()=>{if(!M||M.length<2||u!=="down"&&u!=="up"||V.length<2)return null;const k=V.map(ne=>ne.offset).filter(ne=>Number.isFinite(ne)).sort((ne,te)=>ne-te);if(k.length<2)return null;const H=k[0],F=k[1],z=k[k.length-1];let Q=F-H;if(!Number.isFinite(Q)||Q<=0){const ne=z-H;if(!Number.isFinite(ne)||ne<=0)return null;Q=ne}return{minOffset:H,range:Q}},[V,M,u]),K=f.useMemo(()=>!X||D===null?null:bt((D-X.minOffset)/X.range,0,1),[D,X]),J=f.useMemo(()=>M&&M.length>0&&(u==="down"||u==="up")?u==="down"?["down","up"]:["up","down"]:[u],[M,u]),se=ie(k=>{tp(c.context.popupRef.current,c.context.backdropRef.current,k)}),ae=ie(()=>{se(!1),c.context.popupRef.current?.removeAttribute(sr.endingStyle),_(null)}),pe=ie(()=>{B.current&&(B.current=!1,l?.(!1))}),Y=ie(({resolvedProgress:k,shouldTrackProgress:H,notifyParent:F})=>{const z=v&&!C&&H,Q=z?k:0,ne=v&&H?k:0;F&&d&&(d(ne),ne<=0&&pe()),g?.set({swipeProgress:Q,frontmostHeight:Q>0?p:0});const te=c.context.backdropRef.current;if(te){if(!z||Q<=0){te.style.setProperty(Fn.swipeProgress,"0"),te.style.removeProperty(Tt.height);return}te.style.setProperty(Fn.swipeProgress,`${Q}`),p>0?te.style.setProperty(Tt.height,`${p}px`):te.style.removeProperty(Tt.height)}});function me({direction:k,deltaX:H,deltaY:F,velocityX:z,velocityY:Q,releaseVelocityX:ne,releaseVelocityY:te}){if(!k)return null;const ye=c.context.popupRef.current;if(!ye)return null;const _e=k==="left"||k==="right"?ye.offsetWidth:ye.offsetHeight;if(!Number.isFinite(_e)||_e<=0)return null;const Ee=k==="left"||k==="right"?H:F,Ce=M&&M.length>0?D??0:0;let Pe=0;k==="down"?Pe=Ce:k==="up"&&(Pe=-Ce);const Ve=Pe+Ee,Ge=k==="left"||k==="up"?-Ve:Ve,He=Math.max(0,_e-Ge);if(!Number.isFinite(He)||He<=0)return null;const nt=k==="left"||k==="right"?ne:te,st=k==="left"||k==="right"?z:Q,Re=Math.abs(nt)>0&&Number.isFinite(nt)?nt:st,Te=k==="left"||k==="up"?-Re:Re;if(!Number.isFinite(Te)||Te<=Kf)return null;const Ue=bt(Te,Kf,NE),Be=bt(He/Ue,pc,Jf);if(!Number.isFinite(Be))return null;const ct=(Be-pc)/(Jf-pc),Ye=bt(hc+ct*(Qf-hc),hc,Qf);return!Number.isFinite(Ye)||Ye<=0?null:Ye}function ge(k){if(B.current||!k)return;const H=k.direction??u,F=H==="left"||H==="right"?k.deltaX:k.deltaY;!Number.isFinite(F)||Math.abs(F)<fc||(B.current=!0,l?.(!0))}const fe=_E({enabled:y&&!x,directions:J,elementRef:c.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:Tt.swipeMovementX,y:Tt.swipeMovementY},onSwipeStart(k){if("touches"in k||"pointerType"in k&&k.pointerType==="touch")return;const H=c.context.popupRef.current;if(!H)return;const z=Ie(H).getSelection?.();if(!z||z.isCollapsed)return;const Q=$e(z.anchorNode)?z.anchorNode:z.anchorNode?.parentElement,ne=$e(z.focusNode)?z.focusNode:z.focusNode?.parentElement;!we(H,Q)&&!we(H,ne)||z.removeAllRanges()},onSwipingChange(k){np(c.context.backdropRef.current,k),!k&&!d&&pe()},swipeThreshold({element:k,direction:H}){return rp(k,H)},canStart(k,H){const F=c.context.popupRef.current;if(!F)return!1;const z=F.ownerDocument,Q=Hs(z,k.x,k.y);if(!Q||!we(F,Q))return!1;const ne=H.nativeEvent;return!(("touches"in ne||"pointerType"in ne&&ne.pointerType==="touch")&&sp(z,F)||ne.type==="touchstart"&&mc(Q))},onProgress(k,H){ge(H);const F=H?.direction??fe.swipeDirection,z=F===void 0||F===u,Q=!!(M&&M.length>0),te=Q&&(u==="down"||u==="up")||!Q||u==="left"||u==="right"||z;let ye=k;if(X&&O>0){if(H&&Number.isFinite(H.deltaY)){const _e=D??X.minOffset,Ee=bt(_e+H.deltaY,0,O);ye=bt((Ee-X.minOffset)/X.range,0,1)}else if(K!==null)ye=K;else if(F==="down"||F==="up"){const _e=k*O,Ee=D??X.minOffset,Ce=F==="down"?Ee+_e:Ee-_e;ye=bt((Ce-X.minOffset)/X.range,0,1)}}Y({resolvedProgress:ye,shouldTrackProgress:te,notifyParent:!0})},onRelease({event:k,deltaX:H,deltaY:F,direction:z,velocityX:Q,velocityY:ne,releaseVelocityX:te,releaseVelocityY:ye}){const _e={deltaX:H,deltaY:F,velocityX:Q,velocityY:ne,releaseVelocityX:te,releaseVelocityY:ye};function Ee(Ke){const q=c.context.popupRef.current;q&&(pe(),se(!0),q.style.removeProperty("transition"),q.setAttribute(sr.endingStyle,""),Kt.flushSync(()=>{_(me({direction:Ke,..._e}))}))}if(!M||M.length===0){if(!z){ae();return}const Ke=c.context.popupRef.current;if(!Ke){ae();return}const q=rp(Ke,z),re=z==="left"||z==="right"?H:F;if(!Number.isFinite(re)){ae();return}const be=z==="left"||z==="up"?-re:re;if(be<=0)return ae(),!1;const Le=z==="left"||z==="right"?Q:ne;if((z==="left"||z==="up"?-Le:Le)>=Yf&&be>0)return Ee(z),!0;const De=be>q;return De?Ee(z):ae(),De}if(u!=="down"&&u!=="up"){ae();return}if(!O||V.length===0){ae();return}const Ce=u==="down"?F:-F;if(!Number.isFinite(Ce)){ae();return}const Pe=Math.sign(Ce),Ve=u==="down"?ye:-ye,Ge=u==="down"?ne:-ne;let He=Number.isFinite(Ve)?Ve:Ge;if(Pe!==0&&Math.abs(Ce)>=fc&&Number.isFinite(He)){const Ke=Math.sign(He);Ke!==0&&Ke!==Pe&&(He=Ge)}const nt=D??0,st=bt(nt+Ce,0,O),Re=Number.isFinite(He)&&Math.abs(He)>=Xf?bt(He,-qf,qf)*RE:0,Te=h?st:bt(st+Re,0,O),Ue=Ae(ls,k),Be=()=>(N.current=L,R?.(null,Ue),Ee(u),!0);if(h){const Ke=[...V].sort((Ne,Me)=>Ne.offset-Me.offset);if(Ke.length===0)return ae(),!1;let q=0,re=Math.abs(nt-Ke[0].offset);for(let Ne=1;Ne<Ke.length;Ne+=1){const Me=Math.abs(nt-Ke[Ne].offset);Me<re&&(re=Me,q=Ne)}let be=Ke[0];re=Math.abs(Te-be.offset);for(const Ne of Ke){const Me=Math.abs(Te-Ne.offset);Me<re&&(re=Me,be=Ne)}const Le=Math.sign(He),je=Pe!==0&&Le!==0&&Le===Pe&&Math.abs(He)>=Xf;let De=Te;if(je){const Ne=bt(q+Pe,0,Ke.length-1);if(Ne!==q){const Me=Ke[Ne];(Pe>0?Te<Me.offset:Te>Me.offset)&&(be=Me,De=Me.offset)}else if(Pe>0)return Be()}const Oe=Math.abs(De-O),xe=Math.abs(De-be.offset);return Oe<xe?Be():(R?.(be.value,Ue),ae(),!1)}if(He>=Yf&&Ce>0)return Be();let ct=V[0],Ye=Math.abs(Te-ct.offset);for(const Ke of V){const q=Math.abs(Te-Ke.offset);q<Ye&&(Ye=q,ct=Ke)}return Math.abs(Te-O)<Ye?Be():(R?.(ct.value,Ue),ae(),!1)},onDismiss(k){g?.set({swipeProgress:0,frontmostHeight:0});const H=c.context.backdropRef.current;H&&(H.style.setProperty(Fn.swipeProgress,"0"),H.style.removeProperty(Tt.height));const F=Ae(ls,k);if(c.setOpen(!1,F),F.isCanceled){const z=N.current;z!==void 0&&R?.(z,Ae(ls,k)),N.current=void 0,A.current?.(),ae();return}if(c.select("open")){const z=k;j.request(()=>{if(c.select("open")){const Q=N.current;Q!==void 0&&R?.(Q,Ae(ls,z)),N.current=void 0,ae(),A.current?.()}else N.current=void 0});return}N.current=void 0,se(!0)}}),le=fe.getPointerProps(),ce=fe.getTouchProps(),ve=fe.reset;A.current=ve,f.useEffect(()=>{const k=E??b;if(!k)return;const H=k,F=Ie(H),z=tt(F);function Q(ne){if(G.current)return;const te=Z.current,ye=ne.touches[0];if(!ye||!te)return;const _e=P?ye.clientY-te.lastY:ye.clientX-te.lastX;if(ip(ne,z)){te.allowSwipe=!1,gr(te,ye);return}if(ne.touches.length===2){gr(te,ye);return}if(sp(F,H)||!v||!y||x){gr(te,ye);return}if(FE(te,ye,P)){gr(te,ye);return}const Ce=te.scrollTarget;if(!Ce||Ce===F.documentElement||Ce===F.body){ne.cancelable&&ne.preventDefault(),gr(te,ye);return}if(!VE(Ce,T)){ne.cancelable&&ne.preventDefault(),gr(te,ye);return}const Ve=_e;if(Ve!==0){const Ge=$E(Ce,T,u,Ve);te.allowSwipe?ne.cancelable&&ne.preventDefault():ne.cancelable&&Ge?(te.allowSwipe=!0,ne.preventDefault()):te.allowSwipe=!1}gr(te,ye)}return Fe(F,"touchmove",Q,{passive:!1,capture:!0})},[y,x,v,b,P,T,u,E]),f.useEffect(()=>{if(!X||fe.swiping)return;Y({resolvedProgress:!v||C?0:K??0,shouldTrackProgress:!0,notifyParent:!1})},[Y,p,C,d,v,K,X,fe.swiping,c,g]),f.useEffect(()=>{if(d)return v||d(0),()=>{d(0)}},[d,v]),f.useEffect(()=>{v&&(ve(),ae())},[ae,v,ve]),f.useEffect(()=>()=>{g?.set({swipeProgress:0,frontmostHeight:0}),np(c.context.backdropRef.current,!1),pe()},[pe,c,g]);const ue=f.useMemo(()=>({swiping:fe.swiping,getDragStyles:fe.getDragStyles,swipeStrength:I??null,setSwipeDismissed(k){tp(c.context.popupRef.current,c.context.backdropRef.current,k)}}),[c,fe.getDragStyles,fe.swiping,I]);function Se(){G.current=!1,Z.current=null,U.current="",W.current=!1}return w.jsx(Tf,{ref:n,className:r,render:o,...En(a,{onPointerDown(k){if(U.current=k.pointerType,W.current=k.pointerType==="pen",!v||!y||x)return;const H=Ie(k.currentTarget),F=Hs(H,k.clientX,k.clientY);mc(F)||AE(F)||k.pointerType!=="touch"&&le.onPointerDown?.(k)},onPointerMove(k){k.pointerType!=="touch"&&le.onPointerMove?.(k)},onPointerUp(k){U.current===k.pointerType&&(U.current=""),k.pointerType!=="touch"&&le.onPointerUp?.(k)},onPointerCancel(k){U.current===k.pointerType&&(U.current=""),k.pointerType!=="touch"&&le.onPointerCancel?.(k)},onTouchStart(k){if(U.current==="pen"&&W.current){W.current=!1,G.current=!1,Z.current=null;return}if(!v||!y||x){G.current=!1,Z.current=null;return}const F=k.touches[0];if(!F)return;if(ap(k)){G.current=!1,Z.current=null;return}const z=Ie(k.currentTarget),Q=Hs(z,F.clientX,F.clientY);if(G.current=mc(Q),G.current){Z.current=null;return}const ne=E??b,te=lt(k.nativeEvent),ye=$e(te)?te:null;if(ne&&ye&&!we(ne,ye)){G.current=!0,Z.current=null;return}let _e=null,Ee=!1;ne&&ye&&(_e=Br(ye,ne,T),Ee=Br(ye,ne,$)!=null);let Ce=null;_e&&(Ce=zE(_e,T,u)?null:!1),Z.current={startX:F.clientX,startY:F.clientY,lastX:F.clientX,lastY:F.clientY,scrollTarget:_e,hasCrossAxisScrollableContent:Ee,allowSwipe:Ce,preserveNativeCrossAxisScroll:!1},ce.onTouchStart?.(k)},onTouchMove(k){if(G.current||ap(k))return;const H=Z.current;H?.preserveNativeCrossAxisScroll||H?.allowSwipe===!1||H?.scrollTarget!=null&&!H.allowSwipe||ce.onTouchMove?.(k)},onTouchEnd(k){Se(),ce.onTouchEnd?.(k)},onTouchCancel(k){Se(),ce.onTouchCancel?.(k)},"data-nested-dialog-open":void 0}),children:w.jsx(cc.Provider,{value:ue,children:i})})});process.env.NODE_ENV!=="production"&&(ep.displayName="DrawerViewport");function tp(e,t,n){if(n){e?.setAttribute(ln.swipeDismiss,""),t?.setAttribute(ln.swipeDismiss,"");return}e?.removeAttribute(ln.swipeDismiss),t?.removeAttribute(ln.swipeDismiss)}function np(e,t){if(e){if(t){e.setAttribute(ln.swiping,"");return}e.removeAttribute(ln.swiping)}}function mc(e){return!!e?.closest(Wl)}function AE(e){return!!e?.closest(ME)}function rp(e,t){const n=t==="left"||t==="right"?e.offsetWidth:e.offsetHeight;return Math.max(n*.5,fc)}function op(e,t){return e instanceof t.HTMLInputElement&&e.type==="range"}function DE(e){return $e(e)?e.tagName==="INPUT"||e.tagName==="TEXTAREA":!1}function LE(e,t){const n=$e(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=$e(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||we(t,n)||we(t,r)}function sp(e,t){const n=Pt(e);if(!!(n&&we(t,n))&&DE(n)){const{selectionStart:s,selectionEnd:i}=n;if(s!=null&&i!=null&&s<i)return!0}const o=e.getSelection?.();return!o||o.isCollapsed?!1:LE(o,t)}function ip(e,t){const n=e.composedPath();return n?n.some(r=>op(r,t)):op(lt(e),t)}function ap(e){return ip(e.nativeEvent,tt(e.currentTarget))}function gr(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function FE(e,t,n){if(e.preserveNativeCrossAxisScroll)return!0;if(e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;const r=n?t.clientY-e.startY:t.clientX-e.startX,o=n?t.clientX-e.startX:t.clientY-e.startY,s=Math.abs(r),i=Math.abs(o);return i<6||i<=s+2?!1:(e.preserveNativeCrossAxisScroll=!0,!0)}function VE(e,t){return t==="vertical"?e.scrollHeight>e.clientHeight:e.scrollWidth>e.clientWidth}function cp(e,t){if(t==="vertical"){const r=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:r}}const n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function zE(e,t,n){const{offset:r,max:o}=cp(e,t),s=up(n,t);return s===null?!1:s?r<=0:r>=o}function $E(e,t,n,r){const{offset:o,max:s}=cp(e,t),i=up(n,t);return i===null||!(i?r>0:r<0)?!1:i?o<=0:o>=s}function up(e,t){return t==="vertical"?e==="down"?!0:e==="up"?!1:null:e==="right"?!0:e==="left"?!1:null}const lp=f.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});process.env.NODE_ENV!=="production"&&(lp.displayName="FieldsetRootContext");function jE(e=!1){const t=f.useContext(lp);if(!t&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>.":ft(86));return t}const dp=function(t){const n=qt(),r=t.controlId===void 0?n:t.controlId,[o,s]=f.useState(r),[i,a]=f.useState(t.labelId),[c,u]=f.useState([]),l=wt(()=>new Map),{messageIds:d}=Ln(),p=ie((g,v)=>{const y=l.current;if(v===void 0){y.delete(g);return}y.set(g,v),s(C=>{if(y.size===0)return;let S;for(const E of y.values()){if(C!==void 0&&E===C)return C;S===void 0&&(S=E)}return S})}),h=f.useCallback(g=>En({"aria-describedby":d.concat(c).join(" ")||void 0},g),[d,c]),m=f.useMemo(()=>({controlId:o,registerControlId:p,labelId:i,setLabelId:a,messageIds:c,setMessageIds:u,getDescriptionProps:h}),[o,p,i,a,c,u,h]);return w.jsx(nc.Provider,{value:m,children:t.children})};process.env.NODE_ENV!=="production"&&(dp.displayName="LabelableProvider");function Bs(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Ws=Object.keys($s);function HE(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of Ws)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function UE(e){const{formRef:t,clearErrors:n}=Ur(),{setValidityData:r,validate:o,validityData:s,validationDebounceTime:i,invalid:a,markedDirtyRef:c,state:u,name:l,shouldValidateOnChange:d}=e,{controlId:p,getDescriptionProps:h}=Ln(),m=Gt(),g=f.useRef(null),v=ie(async(S,E=!1)=>{const b=g.current;if(!b)return;if(E){if(u.valid!==!1)return;const D=b.validity;if(!D.valueMissing){const O={value:S,state:{...$s,valid:!0},error:"",errors:[],initialValue:s.initialValue};if(b.setCustomValidity(""),p){const I=t.current.fields.get(p);I&&t.current.fields.set(p,{...I,...Bs(O,!1)})}r(O);return}const R=Ws.reduce((O,I)=>(O[I]=D[I],O),{});if(!R.valid&&!HE(R))return}function x(D){const R=Ws.reduce((I,_)=>(I[_]=D.validity[_],I),{});let O=!1;for(const I of Ws)if(I!=="valid"){if(I==="valueMissing"&&R[I])O=!0;else if(R[I])return R}return O&&!c.current&&(R.valid=!0,R.valueMissing=!1),R}m.clear();let T=null,P=[];const $=x(b);let M;const V=d();if(b.validationMessage&&!V)M=b.validationMessage,P=[b.validationMessage];else{const D=Array.from(t.current.fields.values()).reduce((O,I)=>(I.name&&(O[I.name]=I.getValue()),O),{}),R=o(S,D);typeof R=="object"&&R!==null&&"then"in R?T=await R:T=R,T!==null?($.valid=!1,$.customError=!0,Array.isArray(T)?(P=T,b.setCustomValidity(T.join(`
|
|
19
|
-
`))):T&&(P=[T],b.setCustomValidity(T))):V&&(b.setCustomValidity(""),$.customError=!1,b.validationMessage?(M=b.validationMessage,P=[b.validationMessage]):b.validity.valid&&!$.valid&&($.valid=!0))}const L={value:S,state:$,error:M??(Array.isArray(T)?T[0]:T??""),errors:P,initialValue:s.initialValue};if(p){const D=t.current.fields.get(p);D&&t.current.fields.set(p,{...D,...Bs(L,a)})}r(L)}),y=f.useCallback((S={})=>En(h,u.valid===!1?{"aria-invalid":!0}:mt,S),[h,u.valid]),C=f.useCallback((S={})=>En({onChange(E){if(E.nativeEvent.defaultPrevented)return;if(n(l),!d()){v(E.currentTarget.value,!0);return}const b=E.currentTarget;if(b.value===""){v(b.value);return}m.clear(),i?m.start(i,()=>{v(b.value)}):v(b.value)}},y(S)),[y,n,l,m,v,i,d]);return f.useMemo(()=>({getValidationProps:y,getInputValidationProps:C,inputRef:g,commit:v}),[y,C,v])}function BE(e){const{commit:t,invalid:n,markedDirtyRef:r,name:o,setValidityData:s,validityData:i}=e,{formRef:a}=Ur(),c=f.useRef(null),u=f.useRef(null),l=f.useRef(null),d=ie(()=>{const v=u.current;if(v)return v.getValue?v.getValue():v.value}),p=ie((v=!0)=>{const y=u.current;if(!y)return;let C=y.value;C===void 0&&(C=d()),r.current=!0,v?Kt.flushSync(()=>t(C)):t(C)});function h(){const v=u.current;!v||!v.id||a.current.fields.set(v.id,{getValue:d,name:o,controlRef:v.controlRef??l,validityData:Bs(i,n),validate:p})}function m(v=u.current?.id){v&&a.current.fields.delete(v)}function g(){const v=u.current;if(!v)return;let y=v.value;y===void 0&&(y=d()),i.initialValue===null&&y!==null&&s(C=>({...C,initialValue:y}))}return he(()=>{const v=u.current;!v||!v.id||a.current.fields.set(v.id,{getValue:d,name:o,controlRef:v.controlRef??l,validityData:Bs(i,n),validate:p})},[a,d,n,o,p,i]),he(()=>{const v=a.current.fields;return()=>{const y=u.current?.id;y&&v.delete(y)}},[a]),ie((v,y)=>{if(!y){c.current===v&&(c.current=null,m(),u.current=null);return}const C=u.current?.id;c.current=v,u.current=y,C&&C!==y.id&&m(C),g(),h()})}const fp=f.forwardRef(function(t,n){const{errors:r,validationMode:o,submitAttemptedRef:s}=Ur(),{render:i,className:a,validate:c,validationDebounceTime:u=0,validationMode:l=o,name:d,disabled:p=!1,invalid:h,dirty:m,touched:g,actionsRef:v,style:y,...C}=t,{disabled:S}=jE(),E=ie(c||(()=>null)),b=S||p,[x,T]=f.useState(!1),[P,$]=f.useState(!1),[M,V]=f.useState(!1),[L,D]=f.useState(!1),R=m??P,O=g??x,I=f.useRef(!1),_=ie(pe=>{m===void 0&&(pe&&(I.current=!0),$(pe))}),N=ie(pe=>{g===void 0&&T(pe)}),A=ie(()=>l==="onChange"||l==="onSubmit"&&s.current),j=!!d&&Object.hasOwn(r,d)&&r[d]!==void 0,B=h===!0||j,[U,W]=f.useState({state:$s,error:"",errors:[],value:null,initialValue:null}),G=!B&&U.state.valid,Z=f.useMemo(()=>({disabled:b,touched:O,dirty:R,valid:G,filled:M,focused:L}),[b,O,R,G,M,L]),X=UE({setValidityData:W,validate:E,validityData:U,validationDebounceTime:u,invalid:B,markedDirtyRef:I,state:Z,name:d,shouldValidateOnChange:A}),K=f.useCallback(()=>{I.current=!0,X.commit(U.value)},[X,U]),J=BE({commit:X.commit,invalid:B,markedDirtyRef:I,name:d,setValidityData:W,validityData:U});f.useImperativeHandle(v,()=>({validate:K}),[K]);const se=f.useMemo(()=>({invalid:B,name:d,validityData:U,setValidityData:W,disabled:b,touched:O,setTouched:N,dirty:R,setDirty:_,filled:M,setFilled:V,focused:L,setFocused:D,validate:E,validationMode:l,validationDebounceTime:u,shouldValidateOnChange:A,state:Z,markedDirtyRef:I,registerFieldControl:J,validation:X}),[B,d,U,b,O,N,R,_,M,V,L,D,E,l,u,A,Z,J,X]),ae=qe("div",t,{ref:n,state:Z,props:C,stateAttributesMapping:hr});return w.jsx(Qa.Provider,{value:se,children:ae})});process.env.NODE_ENV!=="production"&&(fp.displayName="FieldRootInner");const Wr=f.forwardRef(function(t,n){return w.jsx(dp,{children:w.jsx(fp,{...t,ref:n})})});process.env.NODE_ENV!=="production"&&(Wr.displayName="FieldRoot");const gc=f.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,nativeLabel:a=!0,...c}=t,u=mr(!1),{labelId:l}=Ln(),d=f.useRef(null),p=sE({id:l??i,native:a});return process.env.NODE_ENV!=="production"&&f.useEffect(()=>{if(!d.current)return;const m=d.current.tagName==="LABEL";if(a){if(!m){const g=Dr.captureOwnerStack?.()||"";ar(`<Field.Label> expected a <label> element because the \`nativeLabel\` prop is true. Rendering a non-<label> disables native label association, so \`htmlFor\` will not work. Use a real <label> in the \`render\` prop, or set \`nativeLabel\` to \`false\`.${g}`)}}else if(m){const g=Dr.captureOwnerStack?.()||"";ar(`<Field.Label> expected a non-<label> element because the \`nativeLabel\` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the \`render\` prop, or set \`nativeLabel\` to \`true\`.${g}`)}},[a]),qe("label",t,{ref:[n,d],state:u.state,props:[p,c],stateAttributesMapping:hr})});process.env.NODE_ENV!=="production"&&(gc.displayName="FieldLabel");const WE={...hr,...tn},Zs=f.forwardRef(function(t,n){const{render:r,id:o,className:s,match:i,style:a,...c}=t,u=qt(o),{validityData:l,state:d,name:p}=mr(!1),{setMessageIds:h}=Ln(),{errors:m}=Ur(),g=p?m[p]:null,v=typeof i=="string";let y=!1;i===!0?y=!0:v?y=!!l.state[i]:y=!!g||l.state.valid===!1;const{mounted:C,transitionStatus:S,setMounted:E}=vo(y);he(()=>{if(!(!y||!u))return h(O=>O.concat(u)),()=>{h(O=>O.filter(I=>I!==u))}},[y,u,h]);const b=f.useRef(null),[x,T]=f.useState(null),[P,$]=f.useState(null),M=l.errors.length>1?w.jsx("ul",{children:l.errors.map(O=>w.jsx("li",{children:O},O))}):l.error,V=v?M:g||M;let L=l.error;g!=null?L=Array.isArray(g)?JSON.stringify(g):g:l.errors.length>1&&(L=JSON.stringify(l.errors)),y&&L!==P&&($(L),T(V)),xn({open:y,ref:b,onComplete(){y||E(!1)}});const D={...d,transitionStatus:S},R=qe("div",t,{ref:[n,b],state:D,props:[{id:u,children:y?V:x},c],stateAttributesMapping:WE,enabled:C});return C?R:null});process.env.NODE_ENV!=="production"&&(Zs.displayName="FieldError");const Gs=f.forwardRef(function(t,n){const{render:r,className:o,id:s,name:i,value:a,disabled:c=!1,onValueChange:u,defaultValue:l,autoFocus:d=!1,style:p,...h}=t,{state:m,name:g,disabled:v,setTouched:y,setDirty:C,validityData:S,setFocused:E,setFilled:b,validationMode:x,validation:T}=mr(),P=v||c,$=g??i,M={...m,disabled:P},{labelId:V}=Ln(),L=rc({id:s});he(()=>{const A=a!=null;T.inputRef.current?.value||A&&a!==""?b(!0):A&&a===""&&b(!1)},[T.inputRef,b,a]);const D=f.useRef(null);he(()=>{d&&D.current===Pt(Ie(D.current))&&E(!0)},[d,E]);const[R]=Eo({controlled:a,default:l,name:"FieldControl",state:"value"}),O=a!==void 0,I=O?R:void 0,_=ie(()=>T.inputRef.current?.value);return ec(T.inputRef,{id:L,value:I,getValue:_}),qe("input",t,{ref:[n,D],state:M,props:[{id:L,disabled:P,name:$,ref:T.inputRef,"aria-labelledby":V,autoFocus:d,...O?{value:I}:{defaultValue:l},onChange(A){const j=A.currentTarget.value;u?.(j,Ae(cr,A.nativeEvent)),C(j!==S.initialValue),b(j!=="")},onFocus(){E(!0)},onBlur(A){y(!0),E(!1),x==="onBlur"&&T.commit(A.currentTarget.value)},onKeyDown(A){A.currentTarget.tagName==="INPUT"&&A.key==="Enter"&&(y(!0),T.commit(A.currentTarget.value))}},T.getInputValidationProps(),h],stateAttributesMapping:hr})});process.env.NODE_ENV!=="production"&&(Gs.displayName="FieldControl");const To=f.forwardRef(function(t,n){const{render:r,className:o,validationMode:s="onSubmit",errors:i,onSubmit:a,onFormSubmit:c,actionsRef:u,style:l,...d}=t,p=f.useRef({fields:new Map}),h=f.useRef(!1),m=f.useRef(!1),g=ie(x=>{x&&(x.focus(),x.tagName==="INPUT"&&x.select())}),[v,y]=f.useState(i);As(i,()=>{y(i)}),f.useEffect(()=>{if(!h.current)return;h.current=!1;const x=Array.from(p.current.fields.values()).filter(T=>T.validityData.state.valid===!1);x.length&&g(x[0].controlRef.current)},[v,g]);const C=f.useCallback(x=>{const T=Array.from(p.current.fields.values());if(x){const P=T.find($=>$.name===x);P&&P.validate(!1)}else T.forEach(P=>{P.validate(!1)})},[]);f.useImperativeHandle(u,()=>({validate:C}),[C]);const S=qe("form",t,{ref:n,props:[{noValidate:!0,onSubmit(x){m.current=!0;let T=Array.from(p.current.fields.values());T.forEach($=>{$.validate()}),T=Array.from(p.current.fields.values());const P=T.filter($=>!$.validityData.state.valid);if(P.length)x.preventDefault(),g(P[0].controlRef.current);else if(h.current=!0,a?.(x),c){x.preventDefault();const $=T.reduce((M,V)=>(V.name&&(M[V.name]=V.getValue()),M),{});c($,_0(cr,x.nativeEvent))}}},d]}),E=ie(x=>{if(x&&v&&mt.hasOwnProperty.call(v,x)){const T={...v};delete T[x],y(T)}}),b=f.useMemo(()=>({formRef:p,validationMode:s,errors:v??mt,clearErrors:E,submitAttemptedRef:m}),[p,s,v,E]);return w.jsx(tc.Provider,{value:b,children:S})});process.env.NODE_ENV!=="production"&&(To.displayName="Form");const yc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(yc.displayName="PopoverRootContext");function Vn(e){const t=f.useContext(yc);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.":ft(47));return t}function ZE(){return{...Nd(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const GE={...Md,disabled:de(e=>e.disabled),instantType:de(e=>e.instantType),openMethod:de(e=>e.openMethod),openChangeReason:de(e=>e.openChangeReason),modal:de(e=>e.modal),focusManagerModal:de(e=>e.focusManagerModal),stickIfOpen:de(e=>e.stickIfOpen),titleElementId:de(e=>e.titleElementId),descriptionElementId:de(e=>e.descriptionElementId),openOnHover:de(e=>e.openOnHover),closeDelay:de(e=>e.closeDelay),hasViewport:de(e=>e.hasViewport)};class vc extends Wo{constructor(t){const n={...ZE(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:f.createRef(),backdropRef:f.createRef(),internalBackdropRef:f.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:f.createRef(),beforeContentFocusGuardRef:f.createRef(),stickIfOpenTimeout:new Zt,triggerElements:new bs},GE)}setOpen=(t,n)=>{const r=n.reason===Lt,o=n.reason===Fr&&n.event.detail===0,s=!t&&(n.reason===ed||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const i=()=>{const a={open:t,openChangeReason:n.reason},c=n.trigger?.id??null;(c||t)&&(a.activeTriggerId=c,a.activeTriggerElement=n.trigger??null),this.update(a)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(i0,()=>{this.set("stickIfOpen",!1)}),Kt.flushSync(i)):i(),o||s?this.set("instantType",o?"click":"dismiss"):n.reason===ur?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const r=wt(()=>new vc(n)).current,o=t??r;return so(r.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function pp({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,modal:i=!1,handle:a,triggerId:c,defaultTriggerId:u=null}=e,l=vc.useStore(a?.store,{modal:i,open:r,openProp:n,activeTriggerId:u,triggerIdProp:c});ja(()=>{n===void 0&&l.state.open===!1&&r===!0&&l.update({open:!0,activeTriggerId:u})}),l.useControlledProp("openProp",n),l.useControlledProp("triggerIdProp",c);const d=l.useState("open"),p=l.useState("payload");l.useContextCallback("onOpenChange",o),l.useContextCallback("onOpenChangeComplete",s);const{openMethod:h,triggerProps:m}=Ha(d);kd(l);const{forceUnmount:g}=Rd(d,l,()=>{l.update({stickIfOpen:!0,openChangeReason:null})});f.useEffect(()=>{d||l.context.stickIfOpenTimeout.clear()},[l,d]);const v=f.useCallback(()=>{l.setOpen(!1,Ae(td))},[l]);f.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:v}),[g,v]);const y=Dd({popupStore:l,onOpenChange:l.setOpen}),C=ka(y,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),S=zd(y),{getReferenceProps:E,getFloatingProps:b,getTriggerProps:x}=bo([C,S]),T=f.useMemo(()=>E(m),[E,m]),P=f.useMemo(()=>x(m),[x,m]),$=f.useMemo(()=>b(),[b]);l.useSyncedValues({modal:i,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:P,popupProps:$,floatingRootContext:y,nested:qn()!=null});const M=f.useMemo(()=>({store:l}),[l]);return w.jsx(yc.Provider,{value:M,children:typeof t=="function"?t({payload:p}):t})}function YE(e){return Vn(!0)?w.jsx(pp,{props:e}):w.jsx(L0,{children:w.jsx(pp,{props:e})})}const XE=300,hp=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,handle:a,payload:c,openOnHover:u=!1,delay:l=XE,closeDelay:d=0,id:p,style:h,...m}=t,g=Vn(!0),v=a?.store??g?.store;if(!v)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.":ft(74));const y=qt(p),C=v.useState("isTriggerActive",y),S=v.useState("floatingRootContext"),E=v.useState("isOpenedByTrigger",y),b=f.useRef(null),{registerTrigger:x,isMountedByThisTrigger:T}=Id(y,b,v,{payload:c,disabled:s,openOnHover:u,closeDelay:d}),P=v.useState("openChangeReason"),$=v.useState("stickIfOpen"),M=v.useState("openMethod"),V=v.useState("focusManagerModal"),L=Dw(S,{enabled:S!=null&&u&&(M!=="touch"||P!==Fr),mouseOnly:!0,move:!1,handleClose:Bw(),restMs:l,delay:{close:d},triggerElementRef:b,isActiveTrigger:C,isClosing:()=>v.select("transitionStatus")==="ending"}),D=Ia(S,{enabled:S!=null,stickIfOpen:$}),R=bo([D]),O=v.useState("triggerProps",T),I={disabled:s,open:E},{getButtonProps:_,buttonRef:N}=Lr({disabled:s,native:i}),A=f.useMemo(()=>({open(G){return G&&P===Fr?Xd.open(G):Yd.open(G)}}),[P]),j=qe("button",t,{state:I,ref:[N,n,x,b],props:[R.getReferenceProps(),L,O,{[ha]:"",id:y},m,_],stateAttributesMapping:A}),{preFocusGuardRef:B,handlePreFocusGuardFocus:U,handleFocusTargetFocus:W}=aE(v,b);return C&&!V?w.jsxs(f.Fragment,{children:[w.jsx(Sn,{ref:B,onFocus:U}),w.jsx(f.Fragment,{children:j},y),w.jsx(Sn,{ref:v.context.triggerFocusTargetRef,onFocus:W})]}):w.jsx(f.Fragment,{children:j},y)});process.env.NODE_ENV!=="production"&&(hp.displayName="PopoverTrigger");const bc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(bc.displayName="PopoverPortalContext");function qE(){const e=f.useContext(bc);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Portal> is missing.":ft(45));return e}const mp=f.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=Vn();return s.useState("mounted")||r?w.jsx(bc.Provider,{value:r,children:w.jsx(hs,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(mp.displayName="PopoverPortal");const wc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(wc.displayName="PopoverPositionerContext");function gp(){const e=f.useContext(wc);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.":ft(46));return e}const yp=f.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:a="bottom",align:c="center",sideOffset:u=0,alignOffset:l=0,collisionBoundary:d="clipping-ancestors",collisionPadding:p=5,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:g=!1,collisionAvoidance:v=f0,style:y,...C}=t,{store:S}=Vn(),E=qE(),b=A0(),x=S.useState("floatingRootContext"),T=S.useState("mounted"),P=S.useState("open"),$=S.useState("openChangeReason"),M=S.useState("activeTriggerElement"),V=S.useState("modal"),L=S.useState("openMethod"),D=S.useState("positionerElement"),R=S.useState("instantType"),O=S.useState("transitionStatus"),I=S.useState("hasViewport"),_=f.useRef(null),N=Bl(D,!1,!1),A=Zd({anchor:s,floatingRootContext:x,positionMethod:i,mounted:T,side:a,sideOffset:u,align:c,alignOffset:l,arrowPadding:h,collisionBoundary:d,collisionPadding:p,sticky:m,disableAnchorTracking:g,keepMounted:E,nodeId:b,collisionAvoidance:v,adaptiveOrigin:I?Xw:void 0}),j=x.useState("domReferenceElement");he(()=>{const G=j,Z=_.current;if(G&&(_.current=G),Z&&G&&G!==Z){S.set("instantType",void 0);const X=new AbortController;return N(()=>{S.set("instantType","trigger-change")},X.signal),()=>{X.abort()}}},[j,N,S]);const B={open:P,side:A.side,align:A.align,anchorHidden:A.anchorHidden,instant:R};Pf(P&&V===!0&&$!==Lt,L==="touch",D,M);const U=f.useCallback(G=>{S.set("positionerElement",G)},[S]),W=qd(t,B,{styles:A.positionerStyles,transitionStatus:O,props:C,refs:[n,U],hidden:!T,inert:!P});return w.jsxs(wc.Provider,{value:A,children:[T&&V===!0&&$!==Lt&&w.jsx(Ls,{ref:S.context.internalBackdropRef,inert:cs(!P),cutout:M}),w.jsx(D0,{id:b,children:W})]})});process.env.NODE_ENV!=="production"&&(yp.displayName="PopoverPositioner");const vp=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(vp.displayName="ClosePartContext");function KE(){const[e,t]=f.useState(0),n=ie(()=>(t(o=>o+1),()=>{t(o=>Math.max(0,o-1))}));return{context:f.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function JE(e){const{value:t,children:n}=e;return w.jsx(vp.Provider,{value:t,children:n})}const QE={...Cn,...tn},bp=f.forwardRef(function(t,n){const{className:r,render:o,initialFocus:s,finalFocus:i,style:a,...c}=t,{store:u}=Vn(),l=gp(),d=Mf()!=null,{context:p,hasClosePart:h}=KE(),m=u.useState("open"),g=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),C=u.useState("popupProps"),S=u.useState("titleElementId"),E=u.useState("descriptionElementId"),b=u.useState("modal"),x=u.useState("mounted"),T=u.useState("openChangeReason"),P=u.useState("activeTriggerElement"),$=u.useState("floatingRootContext");xn({open:m,ref:u.context.popupRef,onComplete(){m&&u.context.onOpenChangeComplete?.(!0)}});const M=u.useState("disabled"),V=u.useState("openOnHover"),L=u.useState("closeDelay");Mw($,{enabled:V&&!M,closeDelay:L});function D(A){return A==="touch"?u.context.popupRef.current:!0}const R=s===void 0?D:s,O={open:m,side:l.side,align:l.align,instant:v,transitionStatus:y},I=b!==!1&&h;u.useSyncedValue("focusManagerModal",I);const _=f.useCallback(A=>{u.set("popupElement",A)},[u]),N=qe("div",t,{state:O,ref:[n,u.context.popupRef,_],props:[C,{"aria-labelledby":S,"aria-describedby":E,onKeyDown(A){d&&Ms.has(A.key)&&A.stopPropagation()}},Va(y),c],stateAttributesMapping:QE});return w.jsx(ms,{context:$,openInteractionType:g,modal:I,disabled:!x||T===Lt,initialFocus:R,returnFocus:i,restoreFocus:"popup",previousFocusableElement:it(P)?P:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:w.jsx(JE,{value:p,children:N})})});process.env.NODE_ENV!=="production"&&(bp.displayName="PopoverPopup");const wp=f.forwardRef(function(t,n){const{className:r,render:o,style:s,...i}=t,{store:a}=Vn(),c=a.useState("open"),{arrowRef:u,side:l,align:d,arrowUncentered:p,arrowStyles:h}=gp();return qe("div",t,{state:{open:c,side:l,align:d,uncentered:p},ref:[n,u],props:[{style:h,"aria-hidden":!0},i],stateAttributesMapping:Cn})});process.env.NODE_ENV!=="production"&&(wp.displayName="PopoverArrow");const e1={...Cn,...tn},Sp=f.forwardRef(function(t,n){const{className:r,render:o,style:s,...i}=t,{store:a}=Vn(),c=a.useState("open"),u=a.useState("mounted"),l=a.useState("transitionStatus"),d=a.useState("openChangeReason");return qe("div",t,{state:{open:c,transitionStatus:l},ref:[a.context.backdropRef,n],props:[{role:"presentation",hidden:!u,style:{pointerEvents:d===Lt?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i],stateAttributesMapping:e1})});process.env.NODE_ENV!=="production"&&(Sp.displayName="PopoverBackdrop");const Ep=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=Vn(),c=qt(i.id);return he(()=>(a.set("titleElementId",c),()=>{a.set("titleElementId",void 0)}),[a,c]),qe("h2",t,{ref:n,props:[{id:c},i]})});process.env.NODE_ENV!=="production"&&(Ep.displayName="PopoverTitle");const xp=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=Vn(),c=qt(i.id);return he(()=>(a.set("descriptionElementId",c),()=>{a.set("descriptionElementId",void 0)}),[a,c]),qe("p",t,{ref:n,props:[{id:c},i]})});process.env.NODE_ENV!=="production"&&(xp.displayName="PopoverDescription");const Ys="base-ui-disable-scrollbar",Sc={className:Ys,getElement(e){return w.jsx("style",{nonce:e,href:Ys,precedence:"base-ui:low",children:`.${Ys}{scrollbar-width:none}.${Ys}::-webkit-scrollbar{display:none}`})}};process.env.NODE_ENV!=="production"&&(Sc.getElement.displayName="styleDisableScrollbar.getElement");const zn=1;function Cp(e,t){return Math.max(0,e-t)}function t1(e,t){if(t<=0)return 0;const n=bt(e,0,t),r=n,o=t-n,s=r<=zn,i=o<=zn;return s&&i?r<=o?0:t:s?0:i?t:n}const Ec=f.createContext(null);process.env.NODE_ENV!=="production"&&(Ec.displayName="SelectRootContext");const xc=f.createContext(null);process.env.NODE_ENV!=="production"&&(xc.displayName="SelectFloatingContext");function Zr(){const e=f.useContext(Ec);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.":ft(60));return e}function Tp(){const e=f.useContext(xc);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.":ft(61));return e}const Ze={id:de(e=>e.id),labelId:de(e=>e.labelId),modal:de(e=>e.modal),multiple:de(e=>e.multiple),items:de(e=>e.items),itemToStringLabel:de(e=>e.itemToStringLabel),itemToStringValue:de(e=>e.itemToStringValue),isItemEqualToValue:de(e=>e.isItemEqualToValue),value:de(e=>e.value),hasSelectedValue:de(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Hr(t,r)!==""}),hasNullItemLabel:de((e,t)=>t?WS(e.items):!1),open:de(e=>e.open),mounted:de(e=>e.mounted),forceMount:de(e=>e.forceMount),transitionStatus:de(e=>e.transitionStatus),openMethod:de(e=>e.openMethod),activeIndex:de(e=>e.activeIndex),selectedIndex:de(e=>e.selectedIndex),isActive:de((e,t)=>e.activeIndex===t),isSelected:de((e,t,n)=>{const r=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(s=>jr(n,s,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:jr(n,o,r)}),isSelectedByFocus:de((e,t)=>e.selectedIndex===t),popupProps:de(e=>e.popupProps),triggerProps:de(e=>e.triggerProps),triggerElement:de(e=>e.triggerElement),positionerElement:de(e=>e.positionerElement),listElement:de(e=>e.listElement),scrollUpArrowVisible:de(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:de(e=>e.scrollDownArrowVisible),hasScrollArrows:de(e=>e.hasScrollArrows)};function n1(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:a,name:c,form:u,autoComplete:l,disabled:d=!1,readOnly:p=!1,required:h=!1,modal:m=!0,actionsRef:g,inputRef:v,onOpenChangeComplete:y,items:C,multiple:S=!1,itemToStringLabel:E,itemToStringValue:b,isItemEqualToValue:x=jS,highlightItemOnHover:T=!0,children:P}=e,{clearErrors:$}=Ur(),{setDirty:M,setTouched:V,setFocused:L,shouldValidateOnChange:D,validityData:R,setFilled:O,name:I,disabled:_,validation:N,validationMode:A}=mr(),j=rc({id:t}),B=_||d,U=I??c,[W,G]=Eo({controlled:n,default:S?r??tl:r,name:"Select",state:"value"}),[Z,X]=Eo({controlled:s,default:i,name:"Select",state:"open"}),K=f.useRef([]),J=f.useRef([]),se=f.useRef(null),ae=f.useRef(null),pe=f.useRef(0),Y=f.useRef(null),me=f.useRef([]),ge=f.useRef(!1),fe=f.useRef(!1),le=f.useRef(null),ce=f.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ve=f.useRef(!1),{mounted:ue,setMounted:Se,transitionStatus:k}=vo(Z),{openMethod:H,triggerProps:F}=Ha(Z),z=wt(()=>new el({id:j,labelId:void 0,modal:m,multiple:S,itemToStringLabel:E,itemToStringValue:b,isItemEqualToValue:x,value:W,open:Z,mounted:ue,transitionStatus:k,items:C,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Q=We(z,Ze.activeIndex),ne=We(z,Ze.selectedIndex),te=We(z,Ze.triggerElement),ye=We(z,Ze.positionerElement),_e=cE(H),Ee=H??_e,Ce=f.useMemo(()=>S&&Array.isArray(W)&&W.length===0?"":Hr(W,b),[S,W,b]),Pe=f.useMemo(()=>S&&Array.isArray(W)?W.map(Oe=>Hr(Oe,b)):Hr(W,b),[S,W,b]),Ve=vt(z.state.triggerElement),Ge=ie(()=>Pe);ec(Ve,{id:j,value:W,getValue:Ge});const He=f.useRef(W);he(()=>{W!==He.current&&z.set("forceMount",!0)},[z,W]),he(()=>{O(S?Array.isArray(W)&&W.length>0:W!=null)},[S,W,O]),he(function(){if(Z)return;const xe=me.current;if(S){const Me=Array.isArray(W)?W:[];if(Me.length===0){z.set("selectedIndex",null);return}const Xe=Me[Me.length-1],Je=xo(xe,Xe,x);z.set("selectedIndex",Je===-1?null:Je);return}const Ne=xo(xe,W,x);z.set("selectedIndex",Ne===-1?null:Ne)},[S,Z,W,me,x,z]),As(W,()=>{$(U),M(W!==R.initialValue),D()?N.commit(W):N.commit(W,!0)});const nt=ie((Oe,xe)=>{if(a?.(Oe,xe),!xe.isCanceled&&(X(Oe),!Oe&&(xe.reason===ur||xe.reason===ya)&&(V(!0),L(!1),A==="onBlur"&&N.commit(W)),!Oe&&z.state.activeIndex!==null)){const Ne=K.current[z.state.activeIndex];queueMicrotask(()=>{Ne?.setAttribute("tabindex","-1")})}}),st=ie(()=>{Se(!1),z.update({activeIndex:null,openMethod:null}),y?.(!1)});xn({enabled:!g,open:Z,ref:se,onComplete(){Z||st()}}),f.useImperativeHandle(g,()=>({unmount:st}),[st]);const Re=ie((Oe,xe)=>{o?.(Oe,xe),!xe.isCanceled&&G(Oe)}),Te=ie(()=>{const Oe=z.state.listElement||se.current;if(!Oe)return;const xe=Cp(Oe.scrollHeight,Oe.clientHeight),Ne=t1(Oe.scrollTop,xe),Me=Ne>0,Xe=Ne<xe;z.state.scrollUpArrowVisible!==Me&&z.set("scrollUpArrowVisible",Me),z.state.scrollDownArrowVisible!==Xe&&z.set("scrollDownArrowVisible",Xe)}),Ue=Ad({open:Z,onOpenChange:nt,elements:{reference:te,floating:ye}}),Be=Ia(Ue,{enabled:!p&&!B,event:"mousedown"}),ct=ka(Ue,{bubbles:!1}),Ye=zw(Ue,{enabled:!p&&!B,listRef:K,activeIndex:Q,selectedIndex:ne,disabledIndices:tl,onNavigate(Oe){Oe===null&&!Z||z.set("activeIndex",Oe)},focusItemOnHover:T}),Ut=jw(Ue,{enabled:!p&&!B&&(Z||!S),listRef:J,activeIndex:Q,selectedIndex:ne,onMatch(Oe){Z?z.set("activeIndex",Oe):Re(me.current[Oe],Ae("none"))},onTypingChange(Oe){ge.current=Oe}}),{getReferenceProps:$t,getFloatingProps:Ke,getItemProps:q}=bo([Be,ct,Ye,Ut]),re=f.useMemo(()=>En($t(),F,j?{id:j}:mt),[$t,F,j]);ja(()=>{z.update({popupProps:Ke(),triggerProps:re})}),he(()=>{z.update({id:j,modal:m,multiple:S,value:W,open:Z,mounted:ue,transitionStatus:k,popupProps:Ke(),triggerProps:re,items:C,itemToStringLabel:E,itemToStringValue:b,isItemEqualToValue:x,openMethod:Ee})},[z,j,m,S,W,Z,ue,k,Ke,re,C,E,b,x,Ee]);const be=f.useMemo(()=>({store:z,name:U,required:h,disabled:B,readOnly:p,multiple:S,highlightItemOnHover:T,setValue:Re,setOpen:nt,listRef:K,popupRef:se,scrollHandlerRef:ae,handleScrollArrowVisibility:Te,scrollArrowsMountedCountRef:pe,getItemProps:q,events:Ue.context.events,valueRef:Y,valuesRef:me,labelsRef:J,typingRef:ge,selectionRef:ce,selectedItemTextRef:le,validation:N,onOpenChangeComplete:y,keyboardActiveRef:fe,alignItemWithTriggerActiveRef:ve,initialValueRef:He}),[z,U,h,B,p,S,T,Re,nt,q,Ue.context.events,N,y,Te]),Le=or(v,N.inputRef),je=S&&Array.isArray(W)&&W.length>0,De=S?void 0:U,Qe=f.useMemo(()=>!S||!Array.isArray(W)||!U?null:W.map(Oe=>{const xe=Hr(Oe,b);return w.jsx("input",{type:"hidden",form:u,name:U,value:xe},xe)}),[S,W,u,U,b]);return w.jsx(Ec.Provider,{value:be,children:w.jsxs(xc.Provider,{value:Ue,children:[P,w.jsx("input",{...N.getInputValidationProps({onFocus(){z.state.triggerElement?.focus({focusVisible:!0})},onChange(Oe){if(Oe.nativeEvent.defaultPrevented)return;const xe=Oe.currentTarget.value,Ne=Ae(cr,Oe.nativeEvent);function Me(){if(S)return;const Xe=me.current.find(Je=>Hr(Je,b).toLowerCase()===xe.toLowerCase()||ZS(Je,E).toLowerCase()===xe.toLowerCase());Xe!=null&&(M(Xe!==R.initialValue),Re(Xe,Ne),D()&&N.commit(Xe))}z.set("forceMount",!0),queueMicrotask(Me)}}),id:j&&De==null?`${j}-hidden-input`:void 0,form:u,name:De,autoComplete:l,value:Ce,disabled:B,required:h&&!je,readOnly:p,ref:Le,style:U?Al:ss,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Qe]})})}const Xs=2,r1=400,Op=200,o1={...Xd,...hr,value:()=>null},Pp=f.forwardRef(function(t,n){const{render:r,className:o,id:s,disabled:i=!1,nativeButton:a=!0,style:c,...u}=t,{setTouched:l,setFocused:d,validationMode:p,state:h,disabled:m}=mr(),{labelId:g}=Ln(),{store:v,setOpen:y,selectionRef:C,validation:S,readOnly:E,required:b,alignItemWithTriggerActiveRef:x,disabled:T,keyboardActiveRef:P}=Zr(),$=m||T||i,M=We(v,Ze.open),V=We(v,Ze.value),L=We(v,Ze.triggerProps),D=We(v,Ze.positionerElement),R=We(v,Ze.listElement),O=We(v,Ze.id),I=We(v,Ze.labelId),_=We(v,Ze.hasSelectedValue),N=!_&&M,A=We(v,Ze.hasNullItemLabel,N),j=s??O,B=XS(g,I);rc({id:j});const U=vt(D),W=f.useRef(null),{getButtonProps:G,buttonRef:Z}=Lr({disabled:$,native:a}),X=ie(fe=>{v.set("triggerElement",fe)}),K=or(n,W,Z,X),J=Gt(),se=Gt(),ae=Gt(),pe=Gt();f.useEffect(()=>{if(M)return!(_||A)?ae.start(r1,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):pe.start(Op,()=>{C.current.allowUnselectedMouseUp=!0,ae.start(Op,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{ae.clear(),pe.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},se.clear()},[M,_,A,C,se,ae,pe]);const Y=f.useMemo(()=>R?.id??lo(D)?.id,[R,D]),me=En(L,{id:j,role:"combobox","aria-expanded":M?"true":"false","aria-haspopup":"listbox","aria-controls":M?Y:void 0,"aria-labelledby":B,"aria-readonly":E||void 0,"aria-required":b||void 0,tabIndex:$?-1:0,ref:K,onFocus(fe){d(!0),M&&x.current&&y(!1,Ae(cr,fe.nativeEvent)),J.start(0,()=>{v.set("forceMount",!0)})},onBlur(fe){we(D,fe.relatedTarget)||(l(!0),d(!1),p==="onBlur"&&S.commit(V))},onPointerMove(){P.current=!1},onKeyDown(){P.current=!0},onMouseDown(fe){if(M)return;const le=Ie(fe.currentTarget);function ce(ve){if(!W.current)return;const ue=ve.target;if(we(W.current,ue)||we(U.current,ue)||ue===W.current)return;const Se=YS(W.current);ve.clientX>=Se.left-Xs&&ve.clientX<=Se.right+Xs&&ve.clientY>=Se.top-Xs&&ve.clientY<=Se.bottom+Xs||y(!1,Ae(O0,ve))}se.start(0,()=>{le.addEventListener("mouseup",ce,{once:!0})})}},S.getValidationProps,u,G);me.role="combobox";const ge={...h,open:M,disabled:$,value:V,readOnly:E,placeholder:!_};return qe("button",t,{ref:[n,W],state:ge,stateAttributesMapping:o1,props:me})});process.env.NODE_ENV!=="production"&&(Pp.displayName="SelectTrigger");const _p=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(_p.displayName="SelectPortalContext");const Ip=f.forwardRef(function(t,n){const{store:r}=Zr(),o=We(r,Ze.mounted),s=We(r,Ze.forceMount);return o||s?w.jsx(_p.Provider,{value:!0,children:w.jsx(hs,{ref:n,...t})}):null});process.env.NODE_ENV!=="production"&&(Ip.displayName="SelectPortal");const Cc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Cc.displayName="SelectPositionerContext");function s1(){const e=f.useContext(Cc);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.":ft(59));return e}function qs(e,t){e&&Object.assign(e.style,t)}const i1={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},a1={position:"fixed"},kp=f.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:a="bottom",align:c="center",sideOffset:u=0,alignOffset:l=0,collisionBoundary:d="clipping-ancestors",collisionPadding:p,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:g,alignItemWithTrigger:v=!0,collisionAvoidance:y=d0,style:C,...S}=t,{store:E,listRef:b,labelsRef:x,alignItemWithTriggerActiveRef:T,selectedItemTextRef:P,valuesRef:$,initialValueRef:M,popupRef:V,setValue:L}=Zr(),D=Tp(),R=We(E,Ze.open),O=We(E,Ze.mounted),I=We(E,Ze.modal),_=We(E,Ze.value),N=We(E,Ze.openMethod),A=We(E,Ze.positionerElement),j=We(E,Ze.triggerElement),B=We(E,Ze.isItemEqualToValue),U=We(E,Ze.transitionStatus),W=f.useRef(null),G=f.useRef(null),[Z,X]=f.useState(v),K=O&&Z&&N!=="touch";!O&&Z!==v&&X(v),he(()=>{O||(Ze.scrollUpArrowVisible(E.state)&&E.set("scrollUpArrowVisible",!1),Ze.scrollDownArrowVisible(E.state)&&E.set("scrollDownArrowVisible",!1))},[E,O]),f.useImperativeHandle(T,()=>K),Pf((K||I)&&R,N==="touch",A,j);const J=Zd({anchor:r,floatingRootContext:D,positionMethod:o,mounted:O,side:a,sideOffset:u,align:c,alignOffset:l,arrowPadding:h,collisionBoundary:d,collisionPadding:p,sticky:m,disableAnchorTracking:g??K,collisionAvoidance:y,keepMounted:!0}),se=K?"none":J.side,ae=K?a1:J.positionerStyles,pe={open:R,side:se,align:J.align,anchorHidden:J.anchorHidden},Y=ie(ce=>{E.set("positionerElement",ce)}),me=qd(t,pe,{styles:ae,transitionStatus:U,props:S,refs:[n,Y],hidden:!O,inert:!R}),ge=f.useRef(0),fe=ie(ce=>{if(ce.size===0&&ge.current===0||$.current.length===0)return;const ve=ge.current;if(ge.current=ce.size,ce.size===ve)return;const ue=Ae(cr);if(ve!==0&&!E.state.multiple&&_!==null&&xo($.current,_,B)===-1){const k=M.current,F=k!=null&&xo($.current,k,B)!==-1?k:null;L(F,ue),F===null&&(E.set("selectedIndex",null),P.current=null)}if(ve!==0&&E.state.multiple&&Array.isArray(_)){const Se=H=>xo($.current,H,B)!==-1,k=_.filter(H=>Se(H));(k.length!==_.length||k.some(H=>!HS(_,H,B)))&&(L(k,ue),k.length===0&&(E.set("selectedIndex",null),P.current=null))}if(R&&K){E.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Se={height:""};qs(A,Se),qs(V.current,Se)}}),le=f.useMemo(()=>({...J,side:se,alignItemWithTriggerActive:K,setControlledAlignItemWithTrigger:X,scrollUpArrowRef:W,scrollDownArrowRef:G}),[J,se,K,X]);return w.jsx(vS,{elementsRef:b,labelsRef:x,onMapChange:fe,children:w.jsxs(Cc.Provider,{value:le,children:[O&&I&&w.jsx(Ls,{inert:cs(!R),cutout:j}),me]})})});process.env.NODE_ENV!=="production"&&(kp.displayName="SelectPositioner");const c1={...Cn,...tn},Rp=f.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:c,popupRef:u,onOpenChangeComplete:l,setOpen:d,valueRef:p,selectedItemTextRef:h,keyboardActiveRef:m,multiple:g,handleScrollArrowVisibility:v,scrollHandlerRef:y,listRef:C,highlightItemOnHover:S}=Zr(),{side:E,align:b,alignItemWithTriggerActive:x,isPositioned:T,setControlledAlignItemWithTrigger:P,scrollDownArrowRef:$,scrollUpArrowRef:M}=s1(),V=Mf()!=null,L=Tp(),D=Ud(),{nonce:R,disableStyleElements:O}=lE(),I=We(c,Ze.id),_=We(c,Ze.open),N=We(c,Ze.mounted),A=We(c,Ze.popupProps),j=We(c,Ze.transitionStatus),B=We(c,Ze.triggerElement),U=We(c,Ze.positionerElement),W=We(c,Ze.listElement),G=f.useRef(!1),Z=f.useRef(!1),X=f.useRef({}),K=ao(),J=ie(Y=>{if(!U||!u.current||!Z.current)return;if(G.current||!x){v();return}const me=U.style.top==="0px",ge=U.style.bottom==="0px";if(!me&&!ge){v();return}const fe=Mp(U),le=Oo(U.getBoundingClientRect().height,"y",fe),ce=Ie(U),ve=getComputedStyle(U),ue=parseFloat(ve.marginTop),Se=parseFloat(ve.marginBottom),k=Np(getComputedStyle(u.current)),H=Math.min(ce.documentElement.clientHeight-ue-Se,k),F=Y.scrollTop,z=Ks(Y);let Q=0,ne=null,te=!1,ye=!1;const _e=Ve=>{U.style.height=`${Ve}px`},Ee=(Ve,Ge)=>{const He=bt(Ve,0,H-le);He>0&&_e(le+He),Y.scrollTop=Ge,H-(le+He)<=zn&&(G.current=!0),v()},Ce=me?z-F:F,Pe=Math.min(le+Ce,H);if(Q=Pe,Ce<=zn){Ee(Ce,me?z:0);return}if(H-Pe>zn)me?ye=!0:ne=0;else if(te=!0,ge&&F<z){const Ve=le+Ce-H;ne=F-(Ce-Ve)}if(Q=Math.ceil(Q),Q!==0&&_e(Q),ye||ne!=null){const Ve=Ks(Y),Ge=ye?Ve:bt(ne,0,Ve);Math.abs(Y.scrollTop-Ge)>zn&&(Y.scrollTop=Ge)}(te||Q>=H-zn)&&(G.current=!0),v()});f.useImperativeHandle(y,()=>J,[J]),xn({open:_,ref:u,onComplete(){_&&l?.(!0)}});const se={open:_,transitionStatus:j,side:E,align:b};he(()=>{!U||!u.current||Object.keys(X.current).length||(X.current={top:U.style.top||"0",left:U.style.left||"0",right:U.style.right,height:U.style.height,bottom:U.style.bottom,minHeight:U.style.minHeight,maxHeight:U.style.maxHeight,marginTop:U.style.marginTop,marginBottom:U.style.marginBottom})},[u,U]),he(()=>{_||x||(Z.current=!1,G.current=!1,qs(U,X.current))},[_,x,U,u]),he(()=>{const Y=u.current;if(!_||!B||!U||!Y||x&&!T||c.state.transitionStatus==="ending")return;if(!x){Z.current=!0,K.request(v),Y.style.removeProperty("--transform-origin");return}const me=u1(Y);Y.style.removeProperty("--transform-origin");try{const ge=h.current,fe=p.current,le=getComputedStyle(U),ce=getComputedStyle(Y),ve=Ie(B),ue=tt(U),Se=Mp(B),k=Js(B.getBoundingClientRect(),Se),H=Js(U.getBoundingClientRect(),Se),F=k.height,z=W||Y,Q=z.scrollHeight,ne=parseFloat(ce.borderBottomWidth),te=parseFloat(le.marginTop)||10,ye=parseFloat(le.marginBottom)||10,_e=parseFloat(le.minHeight)||100,Ee=Np(ce),Ce=5,Pe=5,Ve=20,Ge=ve.documentElement.clientHeight-te-ye,He=ve.documentElement.clientWidth,nt=Ge-k.bottom+F;let st,Re=D==="rtl"?k.right-H.width:k.left,Te=0;if(ge&&fe){const Le=Js(fe.getBoundingClientRect(),Se);st=Js(ge.getBoundingClientRect(),Se),Re=H.left+(D==="rtl"?Le.right-st.right:Le.left-st.left);const je=Le.top-k.top+Le.height/2;Te=st.top-H.top+st.height/2-je}const Ue=nt+Te+ye+ne;let Be=Math.min(Ge,Ue);const ct=Ge-te-ye,Ye=Ue-Be,Ut=He-Pe;U.style.left=`${bt(Re,Ce,Ut-H.width)}px`,U.style.height=`${Be}px`,U.style.maxHeight="auto",U.style.marginTop=`${te}px`,U.style.marginBottom=`${ye}px`,Y.style.height="100%";const $t=Ks(z),Ke=Ye>=$t-zn;Ke&&(Be=Math.min(Ge,H.height)-(Ye-$t));const q=k.top<Ve||k.bottom>Ge-Ve||Math.ceil(Be)+zn<Math.min(Q,_e),re=(ue.visualViewport?.scale??1)!==1&&Gi;if(q||re){Z.current=!0,qs(U,X.current),P(!1);return}const be=Math.max(_e,Be);if(Ke){const Le=Math.max(0,Ge-Ue);U.style.top=H.height>=ct?"0":`${Le}px`,U.style.height=`${Be}px`,z.scrollTop=Ks(z)}else U.style.bottom="0",z.scrollTop=Ye;if(st){const Le=H.top,je=H.height,De=st.top+st.height/2,Qe=je>0?(De-Le)/je*100:50,Oe=bt(Qe,0,100);Y.style.setProperty("--transform-origin",`50% ${Oe}%`)}(be===Ge||Be>=Ee)&&(G.current=!0),v(),S&&c.state.selectedIndex===null&&c.state.activeIndex===null&&C.current[0]!=null&&c.set("activeIndex",0),Z.current=!0}finally{me()}},[c,_,U,B,p,h,u,v,x,P,K,$,M,W,C,S,D,T]),f.useEffect(()=>{if(!x||!U||!_)return;const Y=tt(U);function me(ge){d(!1,Ae(P0,ge))}return Fe(Y,"resize",me)},[d,x,U,_]);const ae={...W?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${I}-list`},onKeyDown(Y){m.current=!0,V&&Ms.has(Y.key)&&Y.stopPropagation()},onMouseMove(){m.current=!1},onScroll(Y){W||J(Y.currentTarget)},...x&&{style:W?{height:"100%"}:i1}},pe=qe("div",t,{ref:[n,u],state:se,stateAttributesMapping:c1,props:[A,ae,Va(j),{className:!W&&x?Sc.className:void 0},a]});return w.jsxs(f.Fragment,{children:[!O&&Sc.getElement(R),w.jsx(ms,{context:L,modal:!1,disabled:!N,returnFocus:i,restoreFocus:!0,children:pe})]})});process.env.NODE_ENV!=="production"&&(Rp.displayName="SelectPopup");function Np(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Ks(e){return Cp(e.scrollHeight,e.clientHeight)}function Mp(e){return Cd.getScale(e)}function Oo(e,t,n){return e/n[t]}function Js(e,t){return po({x:Oo(e.x,"x",t),y:Oo(e.y,"y",t),width:Oo(e.width,"x",t),height:Oo(e.height,"y",t)})}const Ap=[["transform","none"],["scale","1"],["translate","0 0"]];function u1(e){const{style:t}=e,n={};for(const[r,o]of Ap)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of Ap){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}const Tc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Tc.displayName="SelectItemContext");function Oc(){const e=f.useContext(Tc);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.":ft(57));return e}const Dp=f.memo(f.forwardRef(function(t,n){const{render:r,className:o,value:s=null,label:i,disabled:a=!1,nativeButton:c=!1,style:u,...l}=t,d=f.useRef(null),p=ES({label:i,textRef:d,indexGuessBehavior:pf.GuessFromOrder}),{store:h,getItemProps:m,setOpen:g,setValue:v,selectionRef:y,typingRef:C,valuesRef:S,multiple:E,selectedItemTextRef:b}=Zr(),x=We(h,Ze.isActive,p.index),T=We(h,Ze.isSelected,p.index,s),P=We(h,Ze.isSelectedByFocus,p.index),$=We(h,Ze.isItemEqualToValue),M=p.index,V=M!==-1,L=f.useRef(null),D=vt(M);he(()=>{if(!V)return;const Z=S.current;return Z[M]=s,()=>{delete Z[M]}},[V,M,s,S]),he(()=>{if(!V)return;const Z=h.state.value;let X=Z;E&&Array.isArray(Z)&&Z.length>0&&(X=Z[Z.length-1]),X!==void 0&&jr(s,X,$)&&(h.set("selectedIndex",M),d.current&&(b.current=d.current))},[V,M,E,$,h,s,b]);const R={disabled:a,selected:T,highlighted:x},O=m({active:x,selected:T});O.id=void 0;const I=f.useRef(null),_=f.useRef("mouse"),N=f.useRef(!1),{getButtonProps:A,buttonRef:j}=Lr({disabled:a,focusableWhenDisabled:!0,native:c,composite:!0});function B(Z){const X=h.state.value;if(E){const K=Array.isArray(X)?X:[],J=T?US(K,s,$):[...K,s];v(J,Ae(va,Z))}else v(s,Ae(va,Z)),g(!1,Ae(va,Z))}const U={role:"option","aria-selected":T,tabIndex:x?0:-1,onTouchStart(){y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(Z){I.current=Z.key,h.set("activeIndex",M),Z.key===" "&&C.current&&Z.preventDefault()},onClick(Z){N.current=!1,!(Z.type==="keydown"&&I.current===null)&&(a||Z.type==="keydown"&&I.current===" "&&C.current||_.current!=="touch"&&!x||(I.current=null,B(Z.nativeEvent)))},onPointerEnter(Z){_.current=Z.pointerType},onPointerDown(Z){_.current=Z.pointerType,N.current=!0},onMouseUp(){if(a)return;if(N.current){N.current=!1;return}const Z=!y.current.allowSelectedMouseUp&&T,X=!y.current.allowUnselectedMouseUp&&!T;Z||X||_.current!=="touch"&&!x||L.current?.click()}},W=qe("div",t,{ref:[j,n,p.ref,L],state:R,props:[O,U,l,A]}),G=f.useMemo(()=>({selected:T,indexRef:D,textRef:d,selectedByFocus:P,hasRegistered:V}),[T,D,d,P,V]);return w.jsx(Tc.Provider,{value:G,children:W})}));process.env.NODE_ENV!=="production"&&(Dp.displayName="SelectItem");const Lp=f.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=Oc();return r||o?w.jsx(Fp,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(Lp.displayName="SelectItemIndicator");const Fp=f.memo(f.forwardRef((e,t)=>{const{render:n,className:r,style:o,keepMounted:s,...i}=e,{selected:a}=Oc(),c=f.useRef(null),{transitionStatus:u,setMounted:l}=vo(a),p=qe("span",e,{ref:[t,c],state:{selected:a,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:tn});return xn({open:a,ref:c,onComplete(){a||l(!1)}}),p}));process.env.NODE_ENV!=="production"&&(Fp.displayName="Inner");const Vp=f.memo(f.forwardRef(function(t,n){const{indexRef:r,textRef:o,selectedByFocus:s,hasRegistered:i}=Oc(),{selectedItemTextRef:a}=Zr(),{className:c,render:u,style:l,...d}=t,p=f.useCallback(m=>{if(!m||!i)return;const g=a.current===null||!a.current.isConnected;(s||g&&r.current===0)&&(a.current=m)},[a,r,s,i]);return qe("div",t,{ref:[p,n,o],props:d})}));process.env.NODE_ENV!=="production"&&(Vp.displayName="SelectItemText");function Rt({as:e,children:t,className:n,disabled:r,...o}){const s=e||"button",i=s==="button";return w.jsx(s,{className:Mi("align-middle inline-flex items-center justify-center transition-all cursor-pointer hover:brightness-110 active:brightness-90 active:scale-90 disabled:cursor-not-allowed disabled:grayscale",n),...i?{disabled:r}:{"aria-disabled":r},...r&&!i?{onClick:a=>{a.preventDefault(),a.stopPropagation()}}:{},...o,children:t})}const l1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),zp=e=>{const t=d1(e);return t.charAt(0).toUpperCase()+t.slice(1)},$p=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),f1=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var p1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const h1=oe.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>oe.createElement("svg",{ref:c,...p1,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$p("lucide",o),...!s&&!f1(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,l])=>oe.createElement(u,l)),...Array.isArray(s)?s:[s]]));const $n=(e,t)=>{const n=oe.forwardRef(({className:r,...o},s)=>oe.createElement(h1,{ref:s,iconNode:t,className:$p(`lucide-${l1(zp(e))}`,`lucide-${e}`,r),...o}));return n.displayName=zp(e),n};const Pc=$n("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const jp=$n("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Hp=$n("eye-closed",[["path",{d:"m15 18-.722-3.25",key:"1j64jw"}],["path",{d:"M2 8a10.645 10.645 0 0 0 20 0",key:"1e7gxb"}],["path",{d:"m20 15-1.726-2.05",key:"1cnuld"}],["path",{d:"m4 15 1.726-2.05",key:"1dsqqd"}],["path",{d:"m9 18 .722-3.25",key:"ypw2yx"}]]);const Up=$n("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const m1=$n("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);const g1=$n("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const y1=$n("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);const v1=$n("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"}]]);const Bp=$n("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function b1(e){return _t.get("/channel/game/role/mail-captcha",e)}function w1(e){return _t.get("/channel/game/role/auth",e)}function S1(e){return _t.post("/passport-api/v2/ztgame/auth/login",{account:e.account,password:e.password,channel_login:1,channel_id:6})}function E1(e){return _t.post("/passport-api/v2/sms-captchas",{mobile:e.mobile,type:e.type||"register",is_voice:0,nationcode:e.countryCode})}function x1(e){return _t.post("/passport-api/v2/ztgame/auth/mobile-register",{mobile:e.mobile,captcha:e.captcha,channel_login:1,channel_id:6,nationcode:e.countryCode,ad_id:""})}function Wp(){return _t.post("/passport-api/v2/ztgame/auth/auth",{channel_login:1,channel_id:6})}function C1(e){return _t.post(`/passport-api/v2/ztgame/users/${e.uid}/idcard`,{name:e.name,idcard:e.idcard},{headers:{Authentication:e.authorization}})}function T1(e){return _t.post("/passport-api/v2/ztgame/auth/re-auth",{type:"auth",channel_id:6,ad_id:"",channel_login:1},{headers:{Authentication:e}})}function O1(e){return _t.post("/passport-api/v2/ztgame/user-center/forget-password/",e)}function P1(e){return _t.post("/passport-api/v2/ztgame/user-center/forget-password/sms-captchas",e)}function Zp(e){return _t.post("/passport-api/v2/ztgame/user-center/forget-password/forget-password-keys",e)}function _1(e){return _t.post("/passport-api/v2/ztgame/user-center/forget-password/forget-password-update",e)}const I1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAYAAADk3wSdAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFJ0lEQVQ4jW2VW4ydVRXHf2tfvu87Z+5znEtnxnLR0pYJatEHWxhBEZUSCE8YESImRnzwQTEEY6KJGrQJXiFGXzAxaowkSkyoIgjYlEqEIIrSS6KmpTPDdJgz55w5t++29/bhjDQFVrKf9lq/rGSt/3/J+v2XExRQgNsKuJbH9QLFKaE4BWqUu6TCvXhGQsajOD6D4BJfQBCuvvaLLE/uhLTN/8PwVlGCxIJZCJ9XYzwYBEIGdLkztBE8d1rvSJWlbSLw/oJy9UZe8AOAGglfNbt4UE2CSkBikASwfKpE6blOncdndtOauAjy3gWM8516wCGiuFGPyT2Mhw+EQvC9wZ+UEAw4UfXZtBU6cZX7Fm+C4IDwBmgAPHdguEGPy1VqSO0MObhewHc9UgC5gAKXKmpbW3fV8i1/8JovsDyzG5ortxK4DpFzwP1A2yAcUpHciwURCLngOgFVBkIOOPBd/qrWir/MrTV/k6nk2N3v/Rx/uHgJmqvfrqb5l3sioBVofTsi18hrDywGqQ46IQBFwHcCRT1QrrmfDjXaP/TrvNRerrIiM/xq98d4bH6ROK3fV3XlV0QU60azajTOGND6R4YIpAqiAsEDVnB1UM30lonQ/t0/G3t4uXkZqxM1TkztpDmUXP7uzVcO2SA3FVrR0hoEOkrRCAFCGDMScUJX3V6lPCEIrqexsb82quVHnji6xJ9PH8Bbtc9G2f4dW42PznbDzc5qerGlnURURMidEPT2sIw5bFTMYVMp94rxEASfyananu6RI0/t49G/f4gdMxu/jExxm/QF1fMURtEdshRKMSo5GZa1OKJlDVSSc1STx4wedi/paomKPMELSfAv9NKY5569jNGk89nIFLeFIAQFISiMC9jCMZzlHJ+cfPn5uem9G6AQBdXkReKoacxw0TDDHhWX4BQqLjY3z4zTaVapVLODIch5YchAHNa7rJ4k1//pit3LRRT9h9a2RCvJJtai7JgbN1ObqOlzqJlzMJxPjF7cZnSkT78V/1Hk/GJLgKBlKyqLfUcX33m0mJu9lLIU4giSGOJ4gjhG2Zn6uxhvk+kqfRvDWPdKc8UrfPgTz+E2R34cUvMwKhAEvOL0Rcud95+pLZw4eeB94N2VGAtRNHjW7qOajBlG+gcb3QXq3XHaZUzFdvfOmY2r5JNnjw39+2/Iz3Z9vGbCDyTORyr94ul/LEbFr+8YhWoLmvJpbDSQqggYPUsSf0TSjYmw0p6nnlnqmWUji8Frp4bzm1eS7PfHf3sJ5eMLjHQtJ/eUPH39GAzNvI2txUdIZ66mtzVwKQGshaHqz00ImsxruqWmkRleS4W1VOvQqBz2OvnJ2aW1B55cXD1BfQqG50fpRbdTn/oG0UQNayC24MIAGllQqiO+FX13pXnp3Sebk5zuaZZ7hvVU86+e5vlMcIWjwDxJmG3i3/5B9PwkageoKWAanAKXDUzCmrMovWRE5V+aH//vcaS8oe+n97/at3ObheLFAtK+h7wCevo6dA10ddsjuxASEAW6UqLNMSR6BpHv4GkaPIjJH1oYXn+onY1E3UJuXE3VPb0tvZ9Cg66A0oNz4FNQMfg20Gkj5lvI+C9Qc8vI1GCJX3d+D6mzlEHy2PhH3lF1B95T8d9ECYQAFBByCH3wLXBnnsWd2QP9Q6CXt+X2Fs6/7Xy5F4oAOyxfQ/sGRfa919NCAX75GVBLmF1AzGBCF8abDp8ARuDVnoJMvo/JSrz/OpIaKJ7CN25Batul4U1AgP8BRjZPP9WeeTQAAAAASUVORK5CYII=";function k1(e){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 500 500",...e,children:[w.jsx("path",{fill:"url(#a)",d:"M0 250C0 111.929 111.929 0 250 0s250 111.929 250 250-111.929 250-250 250S0 388.071 0 250Z"}),w.jsx("path",{fill:"#fff",d:"M159.432 341h-33.008V158.949h33.008V341Zm220.263-76.172c0 11.087-1.946 21.286-5.84 30.596-3.808 9.31-9.098 17.35-15.869 24.121-6.771 6.686-14.811 11.934-24.121 15.742-9.31 3.809-19.424 5.713-30.342 5.713h-89.121c-2.369 0-4.57-.423-6.601-1.27-2.031-.846-3.809-1.988-5.332-3.427-1.439-1.524-2.582-3.301-3.428-5.332-.846-2.032-1.27-4.232-1.27-6.602V175.58c0-2.285.424-4.443 1.27-6.475.846-2.031 1.989-3.808 3.428-5.332a16.354 16.354 0 0 1 5.332-3.554c2.031-.847 4.232-1.27 6.601-1.27h89.121c10.918 0 21.032 1.905 30.342 5.713 9.31 3.809 17.35 9.098 24.121 15.869 6.771 6.686 12.061 14.727 15.869 24.121 3.894 9.31 5.84 19.466 5.84 30.469v29.707Zm-33.007-29.707c0-6.432-1.058-12.314-3.174-17.646-2.032-5.332-4.952-9.86-8.76-13.584-3.809-3.809-8.379-6.729-13.711-8.76-5.247-2.116-11.087-3.174-17.52-3.174h-72.744v116.035h72.744c6.433 0 12.273-1.015 17.52-3.047 5.332-2.116 9.902-5.035 13.711-8.759 3.808-3.809 6.728-8.337 8.76-13.584 2.116-5.332 3.174-11.257 3.174-17.774v-29.707Z"}),w.jsx("defs",{children:w.jsxs("linearGradient",{id:"a",x1:250,x2:250,y1:0,y2:500,gradientUnits:"userSpaceOnUse",children:[w.jsx("stop",{stopColor:"#497EFE"}),w.jsx("stop",{offset:1,stopColor:"#947AFA"})]})})]})}function Qs(){const{gameId:e,loginTypes:t,currentLoginType:n,setCurrentLoginType:r}=Dn(),o=tf({loginTypes:t,gameId:e}),s=nf({loginTypes:t,gameId:e}),i=ef({loginTypes:t,gameId:e}),a=[];return i&&n!==at.GIANT&&a.push({type:at.GIANT,label:e==="5327"?"账号密码登录":"巨人账号",icon:e==="5327"?null:w.jsx("img",{className:"size-4",src:I1})}),s&&n!==at.MOBILE&&a.push({type:at.MOBILE,label:"手机号登录",icon:w.jsx(m1,{className:"size-4"})}),o&&n!==at.ROLE_ID&&a.push({type:at.ROLE_ID,label:"ID 登录",icon:w.jsx(k1,{className:"size-4"})}),n!=="quick"&&$r(e).length>0&&a.push({type:"quick",label:"快捷登录",icon:w.jsx(v1,{className:"size-4"})}),a.length?w.jsx("div",{className:"text-gray-500 text-xs flex justify-center items-center gap-2 mb-4",children:a.map((c,u)=>w.jsxs(Rt,{className:"h-7 px-3 border rounded-full border-gray-300 gap-1.5 text-xs",onClick:()=>r(c.type),children:[c.icon,w.jsx("span",{children:c.label})]},c.type))}):null}function R1(e){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 90 90",fill:"currentColor",...e,children:w.jsx("path",{d:"M41.415 1.601c6.427-2.244 13.363 2.04 14.18 8.773.611 5.508-2.959 10.609-8.365 11.833-.408.102-.918.203-1.326.305-.918.204-1.735.409-2.653.613-.306.102-.714.204-1.122.306h-.101c-.816.306-1.633.51-2.448.816-.306.102-.715.306-1.021.408l-2.754 1.223c-.408.103-.714.307-1.02.511-1.224.612-2.346 1.326-3.468 2.142l-.307.306c-.612.409-1.122.919-1.632 1.327-.51.408-1.02.816-1.53 1.326-.408.306-.714.713-1.122 1.02-.408.407-.816.918-1.326 1.428-.306.612-.409 1.224-.612 1.836-.204 1.122-.51 2.143-.714 3.265-.204 1.02-.408 2.04-.51 3.06 0 .611-.103 1.122-.103 1.734v1.632c0 1.02 0 1.938.103 2.958.102 1.02.306 2.143.51 3.163.204.816.408 1.733.612 2.55.204.816.408 1.53.612 2.346.102.306.204.51.408.714.51.612 1.122 1.122 1.632 1.734 1.02.918 2.04 1.836 3.162 2.754.816.612 1.734 1.224 2.55 1.836.51.306.919.612 1.429.918.102 0 .204 0 .204.103.204 0 .306.102.51.204.408.204.714.408 1.122.612.918.408 1.734.714 2.652 1.122.714.204 1.326.51 2.04.714 1.122.306 2.143.612 3.265.918.51.204 1.122.204 1.632 0 .306-.102.51-.102.816-.204.816-.204 1.53-.51 2.346-.714 1.53-.408 2.958-1.02 4.386-1.633h.102c.816-.408 1.735-.815 2.55-1.325.307-.204.714-.408 1.02-.612 1.02-.714 2.04-1.428 3.06-2.244.613-.51 1.123-1.02 1.735-1.53l2.142-2.143c.408-.408.714-.816.816-1.428 0-.102.103-.102.103-.204.306-1.02.611-2.142.815-3.162.306-1.326.612-2.755.714-4.183v-.204c.102-1.224.103-2.448.103-3.672-.102-.816-.102-1.53-.204-2.346 0-.102 0-.204-.102-.205-.918.408-1.735.715-2.55 1.225-1.633.918-3.061 1.938-4.489 3.06-.102.101-.204.102-.306.204-1.02.918-1.938 1.734-2.856 2.652-1.02 1.02-2.041 2.04-2.96 3.162-1.937 2.244-4.487 3.469-7.445 3.673-5.713.306-10.61-3.673-11.324-9.283-.816-5.61 2.959-10.813 8.467-11.935a52.639 52.639 0 0 0 7.856-2.142h.101c.816-.408 1.734-.715 2.55-1.122 3.264-1.53 6.121-3.672 8.773-6.12 1.327-1.327 2.652-2.653 3.876-4.082 2.347-2.55 5.305-3.774 8.773-3.57 5.1.306 9.283 4.285 9.895 9.283.204 1.53.102 3.06-.408 4.489-.612 1.938-1.224 3.876-1.734 5.916-.102 1.02-.408 1.939-.51 2.958-.408 2.449-.51 4.795-.306 7.141v.306c.102.816.204 1.53.306 2.347a46.28 46.28 0 0 0 1.224 5.406c.102 0 .102.102.102.204.51 1.632 1.224 3.264 1.224 4.794.306 3.162-.51 5.917-2.55 8.365-1.632 1.938-3.774 3.06-6.223 3.57-1.734.408-3.57.817-5.304 1.326-.102.102-.204.102-.306.102-1.836.612-3.775 1.326-5.509 2.244h-.101c-.918.408-1.735.919-2.551 1.429-.306.204-.714.51-1.02.714a30.738 30.738 0 0 0-2.856 2.244c-.816.714-1.633 1.53-2.347 2.244a.22.22 0 0 1-.204.204c-.918.918-1.734 1.836-2.55 2.754-2.346 2.55-5.202 3.877-8.67 3.775-3.06-.102-5.61-1.428-7.651-3.672-1.428-1.633-2.958-3.163-4.488-4.591v-.102c-.51-.408-1.02-.918-1.53-1.326-.715-.612-1.53-1.122-2.245-1.734l-1.53-.918c-.612-.306-1.122-.612-1.734-.918l-2.754-1.225c-1.326-.612-2.653-1.02-4.081-1.428-1.326-.407-2.652-.714-3.978-1.02a11.146 11.146 0 0 1-3.673-1.224c-3.264-1.734-5.1-4.489-5.61-8.16-.204-1.633 0-3.265.51-4.795.816-2.244 1.428-4.59 1.938-6.936.102-.102.102-.103.102-.204.102-.715.204-1.531.306-2.347.102-.714.205-1.428.205-2.142V43.63l-.087-.956a39.328 39.328 0 0 0-1.24-6.695c-.102-.102-.102-.205-.102-.306-.51-1.734-1.224-3.469-1.53-5.203-1.122-5.712 2.55-11.22 8.263-12.445.714-.204 1.53-.306 2.244-.51 1.224-.306 2.55-.612 3.775-1.02 1.224-.408 2.448-.816 3.672-1.326l1.223-.612c.918-.408 1.837-.918 2.755-1.428 1.122-.714 2.244-1.53 3.366-2.346.408-.306.715-.612 1.122-.918.408-.408.918-.918 1.428-1.326a40.49 40.49 0 0 0 2.96-2.96c1.53-1.835 3.161-3.16 5.405-3.977Z"})})}function N1(e){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",fill:"currentColor",...e,children:w.jsx("path",{d:"M842.667 384H768V277.333a234.667 234.667 0 1 0-469.333 0V384H224a53.393 53.393 0 0 0-53.333 53.333V928A53.393 53.393 0 0 0 224 981.333h618.667A53.393 53.393 0 0 0 896 928V437.333A53.393 53.393 0 0 0 842.667 384zm-288 295.007v110.326a21.333 21.333 0 0 1-42.667 0V679.007a64 64 0 1 1 42.667 0zM725.333 384h-384V277.333c0-105.866 86.134-192 192-192s192 86.134 192 192z"})})}var _c,Gp;function M1(){if(Gp)return _c;Gp=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,c=typeof Ho=="object"&&Ho&&Ho.Object===Object&&Ho,u=typeof self=="object"&&self&&self.Object===Object&&self,l=c||u||Function("return this")(),d=Object.prototype,p=d.toString,h=Math.max,m=Math.min,g=function(){return l.Date.now()};function v(b,x,T){var P,$,M,V,L,D,R=0,O=!1,I=!1,_=!0;if(typeof b!="function")throw new TypeError(e);x=E(x)||0,y(T)&&(O=!!T.leading,I="maxWait"in T,M=I?h(E(T.maxWait)||0,x):M,_="trailing"in T?!!T.trailing:_);function N(K){var J=P,se=$;return P=$=void 0,R=K,V=b.apply(se,J),V}function A(K){return R=K,L=setTimeout(U,x),O?N(K):V}function j(K){var J=K-D,se=K-R,ae=x-J;return I?m(ae,M-se):ae}function B(K){var J=K-D,se=K-R;return D===void 0||J>=x||J<0||I&&se>=M}function U(){var K=g();if(B(K))return W(K);L=setTimeout(U,j(K))}function W(K){return L=void 0,_&&P?N(K):(P=$=void 0,V)}function G(){L!==void 0&&clearTimeout(L),R=0,P=D=$=L=void 0}function Z(){return L===void 0?V:W(g())}function X(){var K=g(),J=B(K);if(P=arguments,$=this,D=K,J){if(L===void 0)return A(D);if(I)return L=setTimeout(U,x),N(D)}return L===void 0&&(L=setTimeout(U,x)),V}return X.cancel=G,X.flush=Z,X}function y(b){var x=typeof b;return!!b&&(x=="object"||x=="function")}function C(b){return!!b&&typeof b=="object"}function S(b){return typeof b=="symbol"||C(b)&&p.call(b)==n}function E(b){if(typeof b=="number")return b;if(S(b))return t;if(y(b)){var x=typeof b.valueOf=="function"?b.valueOf():b;b=y(x)?x+"":x}if(typeof b!="string")return b===0?b:+b;b=b.replace(r,"");var T=s.test(b);return T||i.test(b)?a(b.slice(2),T?2:8):o.test(b)?t:+b}return _c=v,_c}M1();function A1(e=!1){if(typeof e!="boolean")throw new Error("defaultValue must be `true` or `false`");const[t,n]=oe.useState(e),r=oe.useCallback(()=>{n(!0)},[]),o=oe.useCallback(()=>{n(!1)},[]),s=oe.useCallback(()=>{n(i=>!i)},[]);return{value:t,setValue:n,setTrue:r,setFalse:o,toggle:s}}var Yp=typeof window<"u"?oe.useLayoutEffect:oe.useEffect;function D1(e){const[t,n]=oe.useState(e),r=oe.useCallback(()=>{n(i=>i+1)},[]),o=oe.useCallback(()=>{n(i=>i-1)},[]),s=oe.useCallback(()=>{n(e)},[e]);return{count:t,increment:r,decrement:o,reset:s,setCount:n}}function L1(e,t){const n=oe.useRef(e);Yp(()=>{n.current=e},[e]),oe.useEffect(()=>{if(t===null)return;const r=setInterval(()=>{n.current()},t);return()=>{clearInterval(r)}},[t])}function F1({countStart:e,countStop:t=0,intervalMs:n=1e3,isIncrement:r=!1}){const{count:o,increment:s,decrement:i,reset:a}=D1(e),{value:c,setTrue:u,setFalse:l}=A1(!1),d=oe.useCallback(()=>{l(),a()},[l,a]),p=oe.useCallback(()=>{if(o===t){l();return}r?s():i()},[o,t,i,s,r,l]);return L1(p,c?n:null),[o,{startCountdown:u,stopCountdown:l,resetCountdown:d}]}var V1=typeof window>"u";function z1(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const r=a=>V1?t:window.matchMedia(a).matches,[o,s]=oe.useState(()=>n?r(e):t);function i(){s(r(e))}return Yp(()=>{const a=window.matchMedia(e);return i(),a.addListener?a.addListener(i):a.addEventListener("change",i),()=>{a.removeListener?a.removeListener(i):a.removeEventListener("change",i)}},[e]),o}function Xp({trigger:e,title:t,description:n,children:r,open:o,showCloseIcon:s=!0,onOpenChange:i,zIndex:a,classNames:c}){return z1("(min-width: 1024px)")?w.jsxs(Wa,{open:o,onOpenChange:i,disablePointerDismissal:!0,children:[e&&w.jsx(zs,{className:c?.trigger,children:e}),w.jsxs(Fs,{children:[w.jsx(Za,{style:{zIndex:a},className:"fixed inset-0 bg-black/70 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm"}),w.jsxs(Ka,{style:{zIndex:a},className:fr("fixed top-1/2 left-1/2 w-96 max-w-[calc(100vw-3rem)] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-gray-50 p-4 text-gray-900 transition-all duration-150 data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 z-[991]",c?.desktopPopup),children:[t&&w.jsx(Vs,{className:fr("-mt-1.5 mb-1 text-lg font-medium",c?.title),children:t}),n&&w.jsx(Ya,{className:fr("mb-6 text-base text-gray-600",c?.description),children:n}),s&&w.jsx(Ga,{className:"absolute right-4 top-4 text-gray-700 hover:bg-gray-200 rounded p-0.5",children:w.jsx(Bp,{})}),w.jsx("div",{children:r})]})]})]}):w.jsxs(yE,{open:o,onOpenChange:i,children:[e&&w.jsx(kE,{className:c?.trigger,children:e}),w.jsxs(gE,{children:[w.jsx(Df,{style:{zIndex:a},className:fr("fixed inset-0 bg-black/70 transition-opacity duration-300 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm",c?.backdrop)}),w.jsx(ep,{style:{zIndex:a},className:"fixed inset-0 z-[991]",children:w.jsx(Uf,{className:fr("fixed bottom-0 left-0 right-0 rounded-t-xl bg-white p-4 transition-transform duration-300 data-[starting-style]:translate-y-full data-[ending-style]:translate-y-full","[transform:translateY(var(--drawer-swipe-movement-y))]",c?.mobilePopup),children:w.jsxs(Ff,{children:[w.jsx("div",{"aria-hidden":!0,className:"mx-auto w-12 h-1.5 flex-shrink-0 rounded-full bg-gray-300 mb-4"}),w.jsx(IE,{className:"sr-only",children:t}),w.jsx("div",{children:r})]})})})]})]})}function qp({checked:e,onChange:t}){const[n,r]=oe.useState(!1),[o,s]=oe.useState(!1);return w.jsxs("div",{children:[w.jsx(Xp,{title:"用户协议",open:n,onOpenChange:r,zIndex:993,classNames:{desktopPopup:"w-[90vw] lg:w-[60vw]"},children:w.jsx("iframe",{src:"https://www.gatribe.com/license-light.html?channel_id=1&game_id=5327",className:"w-full h-[70vh]"})}),w.jsx(Xp,{title:"隐私政策",open:o,onOpenChange:s,zIndex:993,classNames:{desktopPopup:"w-[90vw] lg:w-[60vw]"},children:w.jsx("iframe",{src:"https://www.gatribe.com/privacy-light.html?channel_id=1&game_id=5327",className:"w-full h-[70vh]"})}),w.jsx(Wr,{name:"rememberLogin",children:w.jsxs(gc,{className:"flex items-center justify-center text-gray-500 text-xs md:text-sm",children:[w.jsx(sc,{checked:e,className:"size-4 md:size-5 flex items-center justify-center rounded-full border-2 data-[checked]:border-[var(--jssdk-primary-color)] data-[unchecked]:border-[var(--jssdk-input-border-color)]",onCheckedChange:i=>t(!!i),children:w.jsx(ic,{children:w.jsx(Pc,{className:"size-3 text-[var(--jssdk-primary-color)]",strokeWidth:4})})}),w.jsx("span",{className:"ml-2 text-xs md:text-sm",children:"我已详细阅读并同意"}),w.jsx(Rt,{className:"text-[var(--jssdk-primary-color)] text-xs md:text-sm",onClick:()=>r(!0),type:"button",children:"《用户协议》"}),w.jsx("span",{className:"text-xs md:text-sm",children:"及"}),w.jsx(Rt,{className:"text-[var(--jssdk-primary-color)] text-xs md:text-sm",onClick:()=>s(!0),type:"button",children:"《隐私政策》"})]})})]})}function Po({trigger:e,title:t,description:n,children:r,open:o,showCloseIcon:s=!0,onOpenChange:i,disablePointerDismissal:a=!1,classNames:c}){return w.jsxs(Wa,{open:o,onOpenChange:i,disablePointerDismissal:a,children:[e&&w.jsx(zs,{className:c?.trigger,children:e}),w.jsxs(Fs,{children:[w.jsx(Za,{className:"fixed inset-0 bg-black/70 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm",forceRender:!0}),w.jsxs(Ka,{className:St("fixed top-1/2 left-1/2 w-96 max-w-[calc(100vw-3rem)] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-gray-50 p-4 text-gray-900 transition-all duration-150 data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 z-[990]",c?.popup),children:[t&&w.jsx(Vs,{className:St("-mt-1.5 mb-1 text-lg font-medium",c?.title),children:t}),n&&w.jsx(Ya,{className:St("mb-6 text-base text-gray-600",c?.description),children:n}),s&&w.jsx(Ga,{className:St("absolute right-4 top-4 text-gray-700 hover:bg-gray-200 rounded p-0.5",c?.close),children:w.jsx(Bp,{})}),w.jsx("div",{children:r})]})]})]})}function Tn({name:e,prefix:t,suffix:n,className:r,inputClassName:o,error:s,...i}){return w.jsxs(Wr,{name:e,className:"group",children:[w.jsxs("div",{className:St("flex items-center border border-[var(--jssdk-input-border-color)] group-data-[focused]:border-[var(--jssdk-primary-color)] group-data-[focused]:shadow-[0_0_6px_color-mix(in_srgb,var(--jssdk-primary-color),transparent_80%)] rounded-full bg-white px-3 gap-2 h-12 transition-all duration-200",s&&"border-red-500",r),children:[t,w.jsx(Gs,{className:St("flex-1 w-0 outline-none rounded-full h-full pl-1",o),...i}),n]}),w.jsx(Zs,{className:"text-red-500 text-xs mt-1 ml-3"})]})}function $1({account:e,forgetPasswordKey:t,onSuccess:n}){const[r,o]=oe.useState(""),[s,i]=oe.useState(!1),{mutate:a,isPending:c}=sn({mutationFn:()=>_1({account:e,forget_password_key:t,password:r}),onSuccess:l=>{l?.code===0||!l?.error?n():gt.warning(l.detail||l.error||"重置失败")}}),u=()=>{if(!r){gt.warning("请输入新密码");return}if(r.length<6||r.length>18){gt.warning("密码长度需要在6-18位之间");return}a()};return w.jsxs("div",{className:"space-y-4",children:[w.jsx("div",{className:"text-sm text-gray-500 mb-4 text-center",children:"请设置新的登录密码"}),w.jsx(Tn,{name:"password",type:s?"text":"password",autoComplete:"off",inputClassName:"placeholder:text-sm",placeholder:"请输入6-18位由数字、字母组成的密码",value:r,autoFocus:!0,onValueChange:l=>o(l),suffix:w.jsx(Rt,{onClick:()=>i(!s),type:"button",children:s?w.jsx(Up,{className:"size-5 text-gray-400"}):w.jsx(Hp,{className:"size-5 text-gray-400"})})}),w.jsx(Rt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:u,disabled:!r||c,children:c?"重置中...":"确定修改"})]})}var j1=function(e){return typeof e=="number"};function H1(e){var t=oe.useRef(e);return t.current=e,t}var ei={exports:{}},U1=ei.exports,Kp;function B1(){return Kp||(Kp=1,(function(e,t){(function(n,r){e.exports=r()})(U1,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",c="hour",u="day",l="week",d="month",p="quarter",h="year",m="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var O=["th","st","nd","rd"],I=R%100;return"["+R+(O[(I-20)%10]||O[I]||O[0])+"]"}},S=function(R,O,I){var _=String(R);return!_||_.length>=O?R:""+Array(O+1-_.length).join(I)+R},E={s:S,z:function(R){var O=-R.utcOffset(),I=Math.abs(O),_=Math.floor(I/60),N=I%60;return(O<=0?"+":"-")+S(_,2,"0")+":"+S(N,2,"0")},m:function R(O,I){if(O.date()<I.date())return-R(I,O);var _=12*(I.year()-O.year())+(I.month()-O.month()),N=O.clone().add(_,d),A=I-N<0,j=O.clone().add(_+(A?-1:1),d);return+(-(_+(I-N)/(A?N-j:j-N))||0)},a:function(R){return R<0?Math.ceil(R)||0:Math.floor(R)},p:function(R){return{M:d,y:h,w:l,d:u,D:m,h:c,m:a,s:i,ms:s,Q:p}[R]||String(R||"").toLowerCase().replace(/s$/,"")},u:function(R){return R===void 0}},b="en",x={};x[b]=C;var T="$isDayjsObject",P=function(R){return R instanceof L||!(!R||!R[T])},$=function R(O,I,_){var N;if(!O)return b;if(typeof O=="string"){var A=O.toLowerCase();x[A]&&(N=A),I&&(x[A]=I,N=A);var j=O.split("-");if(!N&&j.length>1)return R(j[0])}else{var B=O.name;x[B]=O,N=B}return!_&&N&&(b=N),N||!_&&b},M=function(R,O){if(P(R))return R.clone();var I=typeof O=="object"?O:{};return I.date=R,I.args=arguments,new L(I)},V=E;V.l=$,V.i=P,V.w=function(R,O){return M(R,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var L=(function(){function R(I){this.$L=$(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[T]=!0}var O=R.prototype;return O.parse=function(I){this.$d=(function(_){var N=_.date,A=_.utc;if(N===null)return new Date(NaN);if(V.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var j=N.match(v);if(j){var B=j[2]-1||0,U=(j[7]||"0").substring(0,3);return A?new Date(Date.UTC(j[1],B,j[3]||1,j[4]||0,j[5]||0,j[6]||0,U)):new Date(j[1],B,j[3]||1,j[4]||0,j[5]||0,j[6]||0,U)}}return new Date(N)})(I),this.init()},O.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},O.$utils=function(){return V},O.isValid=function(){return this.$d.toString()!==g},O.isSame=function(I,_){var N=M(I);return this.startOf(_)<=N&&N<=this.endOf(_)},O.isAfter=function(I,_){return M(I)<this.startOf(_)},O.isBefore=function(I,_){return this.endOf(_)<M(I)},O.$g=function(I,_,N){return V.u(I)?this[_]:this.set(N,I)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(I,_){var N=this,A=!!V.u(_)||_,j=V.p(I),B=function(se,ae){var pe=V.w(N.$u?Date.UTC(N.$y,ae,se):new Date(N.$y,ae,se),N);return A?pe:pe.endOf(u)},U=function(se,ae){return V.w(N.toDate()[se].apply(N.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(ae)),N)},W=this.$W,G=this.$M,Z=this.$D,X="set"+(this.$u?"UTC":"");switch(j){case h:return A?B(1,0):B(31,11);case d:return A?B(1,G):B(0,G+1);case l:var K=this.$locale().weekStart||0,J=(W<K?W+7:W)-K;return B(A?Z-J:Z+(6-J),G);case u:case m:return U(X+"Hours",0);case c:return U(X+"Minutes",1);case a:return U(X+"Seconds",2);case i:return U(X+"Milliseconds",3);default:return this.clone()}},O.endOf=function(I){return this.startOf(I,!1)},O.$set=function(I,_){var N,A=V.p(I),j="set"+(this.$u?"UTC":""),B=(N={},N[u]=j+"Date",N[m]=j+"Date",N[d]=j+"Month",N[h]=j+"FullYear",N[c]=j+"Hours",N[a]=j+"Minutes",N[i]=j+"Seconds",N[s]=j+"Milliseconds",N)[A],U=A===u?this.$D+(_-this.$W):_;if(A===d||A===h){var W=this.clone().set(m,1);W.$d[B](U),W.init(),this.$d=W.set(m,Math.min(this.$D,W.daysInMonth())).$d}else B&&this.$d[B](U);return this.init(),this},O.set=function(I,_){return this.clone().$set(I,_)},O.get=function(I){return this[V.p(I)]()},O.add=function(I,_){var N,A=this;I=Number(I);var j=V.p(_),B=function(G){var Z=M(A);return V.w(Z.date(Z.date()+Math.round(G*I)),A)};if(j===d)return this.set(d,this.$M+I);if(j===h)return this.set(h,this.$y+I);if(j===u)return B(1);if(j===l)return B(7);var U=(N={},N[a]=r,N[c]=o,N[i]=n,N)[j]||1,W=this.$d.getTime()+I*U;return V.w(W,this)},O.subtract=function(I,_){return this.add(-1*I,_)},O.format=function(I){var _=this,N=this.$locale();if(!this.isValid())return N.invalidDate||g;var A=I||"YYYY-MM-DDTHH:mm:ssZ",j=V.z(this),B=this.$H,U=this.$m,W=this.$M,G=N.weekdays,Z=N.months,X=N.meridiem,K=function(ae,pe,Y,me){return ae&&(ae[pe]||ae(_,A))||Y[pe].slice(0,me)},J=function(ae){return V.s(B%12||12,ae,"0")},se=X||function(ae,pe,Y){var me=ae<12?"AM":"PM";return Y?me.toLowerCase():me};return A.replace(y,(function(ae,pe){return pe||(function(Y){switch(Y){case"YY":return String(_.$y).slice(-2);case"YYYY":return V.s(_.$y,4,"0");case"M":return W+1;case"MM":return V.s(W+1,2,"0");case"MMM":return K(N.monthsShort,W,Z,3);case"MMMM":return K(Z,W);case"D":return _.$D;case"DD":return V.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return K(N.weekdaysMin,_.$W,G,2);case"ddd":return K(N.weekdaysShort,_.$W,G,3);case"dddd":return G[_.$W];case"H":return String(B);case"HH":return V.s(B,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return se(B,U,!0);case"A":return se(B,U,!1);case"m":return String(U);case"mm":return V.s(U,2,"0");case"s":return String(_.$s);case"ss":return V.s(_.$s,2,"0");case"SSS":return V.s(_.$ms,3,"0");case"Z":return j}return null})(ae)||j.replace(":","")}))},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(I,_,N){var A,j=this,B=V.p(_),U=M(I),W=(U.utcOffset()-this.utcOffset())*r,G=this-U,Z=function(){return V.m(j,U)};switch(B){case h:A=Z()/12;break;case d:A=Z();break;case p:A=Z()/3;break;case l:A=(G-W)/6048e5;break;case u:A=(G-W)/864e5;break;case c:A=G/o;break;case a:A=G/r;break;case i:A=G/n;break;default:A=G}return N?A:V.a(A)},O.daysInMonth=function(){return this.endOf(d).$D},O.$locale=function(){return x[this.$L]},O.locale=function(I,_){if(!I)return this.$L;var N=this.clone(),A=$(I,_,!0);return A&&(N.$L=A),N},O.clone=function(){return V.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},R})(),D=L.prototype;return M.prototype=D,[["$ms",s],["$s",i],["$m",a],["$H",c],["$W",u],["$M",d],["$y",h],["$D",m]].forEach((function(R){D[R[1]]=function(O){return this.$g(O,R[0],R[1])}})),M.extend=function(R,O){return R.$i||(R(O,L,M),R.$i=!0),M},M.locale=$,M.isDayjs=P,M.unix=function(R){return M(1e3*R)},M.en=x[b],M.Ls=x,M.p={},M}))})(ei)),ei.exports}var W1=B1();const Z1=zv(W1);var Ic=function(e){if(!e)return 0;var t=Z1(e).valueOf()-Date.now();return t<0?0:t},G1=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},Jp=function(e){e===void 0&&(e={});var t=e||{},n=t.leftTime,r=t.targetDate,o=t.interval,s=o===void 0?1e3:o,i=t.onEnd,a=oe.useMemo(function(){return j1(n)&&n>0?Date.now()+n:void 0},[n]),c="leftTime"in e?a:r,u=Im(oe.useState(function(){return Ic(c)}),2),l=u[0],d=u[1],p=H1(i);oe.useEffect(function(){if(!c){d(0);return}d(Ic(c));var m=setInterval(function(){var g,v=Ic(c);d(v),v===0&&(clearInterval(m),(g=p.current)===null||g===void 0||g.call(p))},s);return function(){return clearInterval(m)}},[c,s]);var h=oe.useMemo(function(){return G1(l)},[l]);return[l,h]};function Y1({account:e,mobile:t,onNext:n}){const[r,o]=oe.useState(""),[s,i]=oe.useState(),[a]=Jp({leftTime:s?s*1e3:void 0,interval:1e3,onEnd(){i(void 0)}}),{mutate:c,isPending:u}=sn({mutationFn:()=>P1({account:e,type:"reset-password",is_voice:0,t:"ctoken"}),onSuccess:h=>{i(h.lock_time),gt.success("验证码已发送,请注意查收")}}),{mutate:l,isPending:d}=sn({mutationFn:()=>Zp({account:e,captcha:r,t:"reset-password"}),onSuccess:h=>{h?.forget_password_key?n(h.forget_password_key):gt.warning("安全验证失败")},onError:h=>{gt.warning(h?.message||h?.detail||"验证失败")}}),p=()=>{if(!r){gt.warning("请输入验证码");return}l()};return w.jsxs("div",{className:"space-y-4",children:[w.jsxs("div",{className:"text-sm text-gray-500 mb-4 text-center",children:["为了您的账号安全,请先进行安全验证",w.jsx("br",{}),"请输入验证码,短信将发送至您的绑定手机"," ",w.jsx("span",{className:"font-semibold text-gray-700",children:t})]}),w.jsx(Tn,{name:"verificationCode",placeholder:"请输入验证码",value:r,type:"number",autoFocus:!0,onValueChange:h=>o(h),suffix:w.jsx("button",{type:"button",className:"enabled:text-[var(--jssdk-primary-color)] text-sm rounded-full h-4/6 px-2 enabled:hover:bg-[var(--jssdk-primary-color)] enabled:hover:text-white inline-flex items-center disabled:cursor-not-allowed disabled:text-gray-500",onClick:()=>c(),disabled:!!s||u,children:u?"发送中...":s?`${Math.round(a/1e3)}s 后重新获取`:"获取验证码"})}),w.jsx(Rt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:p,disabled:d,children:d?"验证中...":"下一步"})]})}function X1({account:e,onNext:t}){const[n,r]=oe.useState(""),{mutate:o,isPending:s}=sn({mutationFn:()=>Zp({account:e,idcard:n,t:"reset-password"}),onSuccess:a=>{a?.forget_password_key?t(a.forget_password_key):gt.warning("安全验证失败")}}),i=()=>{if(!n){gt.warning("请输入身份证号");return}o()};return w.jsxs("div",{className:"space-y-4",children:[w.jsxs("div",{className:"text-sm text-gray-500 mb-4 text-center",children:["为了您的账号安全,请先进行安全验证",w.jsx("br",{}),"该账号未绑定手机,请输入注册时填写的身份证信息"]}),w.jsx(Tn,{name:"idCard",placeholder:"请输入身份证号",value:n,autoFocus:!0,onChange:a=>r(a.currentTarget.value)}),w.jsx(Rt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:i,disabled:s,children:s?"验证中...":"下一步"})]})}function q1({onClose:e,defaultAccount:t=""}){const[n,r]=oe.useState("account"),[o,s]=oe.useState(t),[i,a]=oe.useState(""),[c,u]=oe.useState(2),[l,d]=oe.useState(""),p=oe.useRef(null);oe.useEffect(()=>{if(!window.captchaZtgame){const y=document.createElement("script");y.type="text/javascript",y.src=`//nocaptcha.ztgame.com/static/verify2023/js/captcha.js?t=${new Date().getTime()}`,y.id="captchaZtgameScript",document.body.appendChild(y)}},[]);const{mutate:h,isPending:m}=sn({mutationFn:async y=>O1({account:o,nonce:y.nonce,token:y.token,type:y.type,t:"ctoken"}),onSuccess:y=>{const C=y.type;u(C),a(C===2?y.mobile:""),r("secure"),p.current?.onRefresh?.()},onError:y=>{gt.warning(y?.message||y?.detail||"验证失败"),p.current?.onRefresh?.()}}),g=()=>{if(!o){gt.warning("请输入账号信息");return}window.captchaZtgame?window.captchaZtgame.init({appsceneid:"pt_login",usertype:"1",el:"captcha-forget-pwd",mode:"popup",styles:{width:300,height:150,fontSize:"14px"},popupStyles:{position:"fixed",top:"30%",left:"50%",zIndex:"99999"},onSuccess(y,C){p.current=y,h({nonce:y.nonce,token:C.data.token,type:y.type})},onLoad(y){p.current=y,y.onVerify()},onFail(){}}):gt.warning("安全组件未加载,请稍后再试")},v=y=>{d(y),r("reset")};return w.jsxs("div",{className:"space-y-5",children:[w.jsx("div",{id:"captcha-forget-pwd"}),n==="account"&&w.jsxs("div",{className:"space-y-4",children:[w.jsxs("div",{className:"text-sm text-gray-500 mb-4 text-center",children:["为了您的账号安全,请先进行安全验证",w.jsx("br",{}),"请输入您的账号信息"]}),w.jsx(Tn,{name:"account",placeholder:"请输入账号信息",autoFocus:!0,value:o,onChange:y=>s(y.currentTarget.value)}),w.jsx(Rt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:g,disabled:!o||m,children:m?"验证中...":"下一步"})]}),n==="secure"&&(c===2?w.jsx(Y1,{account:o,mobile:i,onNext:v}):w.jsx(X1,{account:o,onNext:v})),n==="reset"&&w.jsx($1,{account:o,forgetPasswordKey:l,onSuccess:()=>r("success")}),n==="success"&&w.jsxs("div",{className:"space-y-4 py-6",children:[w.jsx("div",{className:"text-center text-lg font-medium text-gray-800",children:"重置密码成功"}),w.jsx(Rt,{className:"mt-6 h-10 w-full bg-gray-100 text-gray-700 rounded-full hover:bg-gray-200",onClick:()=>e?.(),children:"返回登录"})]})]})}function K1(){const{gameId:e,onAccountLoginSuccess:t,onLoginSuccess:n,onLoginError:r,triggerRealNameAuth:o}=Dn(),s=oe.useRef(null),[i,a]=oe.useState(""),[c,u]=oe.useState(""),[l,d]=oe.useState(!1),[p,h]=oe.useState(!0),[m,g]=oe.useState(!1),{mutate:v,isPending:y}=sn({mutationFn:()=>S1({account:i,password:c}),onSuccess:S=>{const E={account:S.account,entity:S.channel_info.entity,token:S.channel_info.token,sign:S.channel_info.sign,accid:S.channel_info.entity.openid,extra_data:S.channel_info.extra_data,gaplaySign:S.channel_info.gaplaySign,realname:S.channel_info.realname};if(Ns(E,S._auth,e),E.realname&&E.realname.reject>=2){o();return}t?.(E),n?.(E)},onError:S=>{r?.(S)}});async function C(S){if(S.preventDefault(),!p){gt.warning("请先阅读并同意用户协议和隐私政策");return}if(!i||!c){gt.warning("请输入账号和密码");return}v()}return w.jsx(w.Fragment,{children:w.jsxs(To,{ref:s,onSubmit:C,className:"space-y-5",children:[w.jsx(Tn,{name:"account",placeholder:e==="5327"?"请输入账号":"请输入巨人通行证账号",autoFocus:!0,onChange:S=>a(S.currentTarget.value),prefix:e==="5327"?w.jsx(y1,{className:"size-5 text-gray-400"}):w.jsx(R1,{className:"size-5 text-gray-400"})}),w.jsx(Tn,{name:"password",type:l?"text":"password",autoComplete:"off",placeholder:"请输入密码",value:c,onValueChange:S=>u(S),prefix:w.jsx(N1,{className:"size-5 text-gray-400"}),suffix:w.jsx(Rt,{onClick:()=>d(!l),type:"button",children:l?w.jsx(Up,{className:"size-5 text-gray-400"}):w.jsx(Hp,{className:"size-5 text-gray-400"})})}),w.jsxs("section",{children:[w.jsx("div",{className:"flex justify-end mb-1",children:w.jsx(Po,{title:"忘记密码",open:m,onOpenChange:g,trigger:w.jsx("button",{type:"button",className:"text-[var(--jssdk-primary-color)] text-sm",children:"忘记密码"}),children:w.jsx(q1,{onClose:()=>g(!1),defaultAccount:i})})}),w.jsx(Rt,{className:"h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",type:"submit",disabled:y,children:"登录"})]}),w.jsx(Qs,{}),w.jsx(qp,{checked:p,onChange:h})]})})}var Qp;function ee(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){const p=l[d];p in a||(a[p]=u[p].bind(a))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const u=n?.Parent?new s:this;r(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Gr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eh extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Qp=globalThis).__zod_globalConfig??(Qp.__zod_globalConfig={});const kc=globalThis.__zod_globalConfig;function yr(e){return kc}function th(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Rc(e,t){return typeof t=="bigint"?t.toString():t}function Nc(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Mc(e){return e==null}function Ac(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const nh=Symbol("evaluating");function ot(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==nh)return r===void 0&&(r=nh,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function vr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Jn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function rh(e){return JSON.stringify(e)}function J1(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const oh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ti(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Q1=Nc(()=>{if(kc.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function _o(e){if(ti(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ti(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function sh(e){return _o(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const ex=new Set(["string","number","symbol"]);function ni(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ke(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function tx(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function nx(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Jn(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return vr(this,"shape",i),i},checks:[]});return Qn(e,s)}function rx(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Jn(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return vr(this,"shape",i),i},checks:[]});return Qn(e,s)}function ox(e,t){if(!_o(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Jn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return vr(this,"shape",s),s}});return Qn(e,o)}function sx(e,t){if(!_o(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Jn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return vr(this,"shape",r),r}});return Qn(e,n)}function ix(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Jn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return vr(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Qn(e,n)}function ax(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Jn(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return vr(this,"shape",c),c},checks:[]});return Qn(t,i)}function cx(e,t,n){const r=Jn(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return vr(this,"shape",s),s}});return Qn(t,r)}function Yr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ux(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ih(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ri(e){return typeof e=="string"?e:e?.message}function br(e,t,n){const r=e.message?e.message:ri(e.inst?._zod.def?.error?.(e))??ri(t?.error?.(e))??ri(n.customError?.(e))??ri(n.localeError?.(e))??"Invalid input",{inst:o,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=i),a}function Dc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Io(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const ah=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Rc,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ch=ee("$ZodError",ah),uh=ee("$ZodError",ah,{Parent:Error});function oi(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function lx(e,t=n=>n.message){const n={_errors:[]},r=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{const a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,u=0;for(;u<a.length;){const l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return r(e),n}const Lc=e=>(t,n,r,o)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Gr;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>br(c,s,yr())));throw oh(a,o?.callee),a}return i.value},Fc=e=>async(t,n,r,o)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>br(c,s,yr())));throw oh(a,o?.callee),a}return i.value},si=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Gr;return s.issues.length?{success:!1,error:new(e??ch)(s.issues.map(i=>br(i,o,yr())))}:{success:!0,data:s.value}},dx=si(uh),ii=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>br(i,o,yr())))}:{success:!0,data:s.value}},fx=ii(uh),px=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Lc(e)(t,n,o)},hx=e=>(t,n,r)=>Lc(e)(t,n,r),mx=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Fc(e)(t,n,o)},gx=e=>async(t,n,r)=>Fc(e)(t,n,r),yx=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return si(e)(t,n,o)},vx=e=>(t,n,r)=>si(e)(t,n,r),bx=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ii(e)(t,n,o)},wx=e=>async(t,n,r)=>ii(e)(t,n,r),Sx=/^[cC][0-9a-z]{6,}$/,Ex=/^[0-9a-z]+$/,xx=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Cx=/^[0-9a-vA-V]{20}$/,Tx=/^[A-Za-z0-9]{27}$/,Ox=/^[a-zA-Z0-9_-]{21}$/,Px=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_x=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,lh=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ix=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Rx(){return new RegExp(kx,"u")}const Nx=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ax=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Dx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dh=/^[A-Za-z0-9_-]*$/,Fx=/^https?$/,Vx=/^\+[1-9]\d{6,14}$/,fh="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",zx=new RegExp(`^${fh}$`);function ph(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $x(e){return new RegExp(`^${ph(e)}$`)}function jx(e){const t=ph({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${fh}T(?:${r})$`)}const Hx=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ux=/^[^A-Z]*$/,Bx=/^[^a-z]*$/,On=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Wx=ee("$ZodCheckMaxLength",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mc(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=Dc(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Zx=ee("$ZodCheckMinLength",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mc(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=Dc(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Gx=ee("$ZodCheckLengthEquals",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mc(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const i=Dc(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ai=ee("$ZodCheckStringFormat",(e,t)=>{var n,r;On.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Yx=ee("$ZodCheckRegex",(e,t)=>{ai.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Xx=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ux),ai.init(e,t)}),qx=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Bx),ai.init(e,t)}),Kx=ee("$ZodCheckIncludes",(e,t)=>{On.init(e,t);const n=ni(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Jx=ee("$ZodCheckStartsWith",(e,t)=>{On.init(e,t);const n=new RegExp(`^${ni(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Qx=ee("$ZodCheckEndsWith",(e,t)=>{On.init(e,t);const n=new RegExp(`.*${ni(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),eC=ee("$ZodCheckOverwrite",(e,t)=>{On.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class tC{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
9
|
+
components: `).concat(Jc(s),"\n```")),[2,i]}})})}}}function Ug(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(kc,"/npm-monitoring"),!0),e.send()}catch(t){console.error(t)}}function Bg(e){var t;return e===void 0&&(e={}),pn(this,void 0,void 0,function(){var n,r,o;return hn(this,function(s){switch(s.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&Ug(),n=e.delayFallback,r=e.debug,[4,Zg(n)];case 1:return s.sent(),o=Fg({cache:{},debug:r}),[2,Wg(o,r)]}})})}var Gg={load:Bg,hashComponents:Qc,componentsToDebugString:Jc};function el(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=el(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function tl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=el(e))&&(r&&(r+=" "),r+=t);return r}const gi="-",Yg=e=>{const t=qg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(gi);return a[0]===""&&a.length!==1&&a.shift(),nl(a,t)||Xg(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},nl=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?nl(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(gi);return t.validators.find(({validator:i})=>i(s))?.classGroupId},rl=/^\[(.+)\]$/,Xg=e=>{if(rl.test(e)){const t=rl.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},qg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Jg(Object.entries(e.classGroups),n).forEach(([s,i])=>{yi(i,r,s,t)}),r},yi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:ol(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Kg(o)){yi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{yi(i,ol(t,s),n,r)})})},ol=(e,t)=>{let n=e;return t.split(gi).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Kg=e=>e.isThemeGetter,Jg=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,Qg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},sl="!",ey=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const c=[];let l=0,u=0,f;for(let v=0;v<a.length;v++){let g=a[v];if(l===0){if(g===o&&(r||a.slice(v,v+s)===t)){c.push(a.slice(u,v)),u=v+s;continue}if(g==="/"){f=v;continue}}g==="["?l++:g==="]"&&l--}const d=c.length===0?a:a.substring(u),h=d.startsWith(sl),m=h?d.substring(1):d,y=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:i}):i},ty=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},ny=e=>({cache:Qg(e.cacheSize),parseClassName:ey(e),...Yg(e)}),ry=/\s+/,oy=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(ry);let a="";for(let c=i.length-1;c>=0;c-=1){const l=i[c],{modifiers:u,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}=n(l);let m=!!h,y=r(m?d.substring(0,h):d);if(!y){if(!m){a=l+(a.length>0?" "+a:a);continue}if(y=r(d),!y){a=l+(a.length>0?" "+a:a);continue}m=!1}const v=ty(u).join(":"),g=f?v+sl:v,E=g+y;if(s.includes(E))continue;s.push(E);const C=o(y,m);for(let S=0;S<C.length;++S){const b=C[S];s.push(g+b)}a=l+(a.length>0?" "+a:a)}return a};function sy(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=il(t))&&(r&&(r+=" "),r+=n);return r}const il=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=il(e[r]))&&(n&&(n+=" "),n+=t);return n};function iy(e,...t){let n,r,o,s=i;function i(c){const l=t.reduce((u,f)=>f(u),e());return n=ny(l),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=oy(c,n);return o(c,u),u}return function(){return s(sy.apply(null,arguments))}}const lt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},al=/^\[(?:([a-z-]+):)?(.+)\]$/i,ay=/^\d+\/\d+$/,cy=new Set(["px","full","screen"]),ly=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uy=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,dy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,py=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,On=e=>kr(e)||cy.has(e)||ay.test(e),Hn=e=>Ir(e,"length",Sy),kr=e=>!!e&&!Number.isNaN(Number(e)),vi=e=>Ir(e,"number",kr),no=e=>!!e&&Number.isInteger(Number(e)),hy=e=>e.endsWith("%")&&kr(e.slice(0,-1)),$e=e=>al.test(e),Zn=e=>ly.test(e),my=new Set(["length","size","percentage"]),gy=e=>Ir(e,my,cl),yy=e=>Ir(e,"position",cl),vy=new Set(["image","url"]),by=e=>Ir(e,vy,Ey),wy=e=>Ir(e,"",xy),ro=()=>!0,Ir=(e,t,n)=>{const r=al.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Sy=e=>uy.test(e)&&!fy.test(e),cl=()=>!1,xy=e=>dy.test(e),Ey=e=>py.test(e),bi=iy(()=>{const e=lt("colors"),t=lt("spacing"),n=lt("blur"),r=lt("brightness"),o=lt("borderColor"),s=lt("borderRadius"),i=lt("borderSpacing"),a=lt("borderWidth"),c=lt("contrast"),l=lt("grayscale"),u=lt("hueRotate"),f=lt("invert"),d=lt("gap"),h=lt("gradientColorStops"),m=lt("gradientColorStopPositions"),y=lt("inset"),v=lt("margin"),g=lt("opacity"),E=lt("padding"),C=lt("saturate"),S=lt("scale"),b=lt("sepia"),x=lt("skew"),T=lt("space"),I=lt("translate"),z=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",$e,t],V=()=>[$e,t],$=()=>["",On,Hn],M=()=>["auto",kr,$e],k=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],P=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",$e],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[kr,$e];return{cacheSize:500,separator:":",theme:{colors:[ro],spacing:[On,Hn],blur:["none","",Zn,$e],brightness:W(),borderColor:[e],borderRadius:["none","","full",Zn,$e],borderSpacing:V(),borderWidth:$(),contrast:W(),grayscale:D(),hueRotate:W(),invert:D(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[hy,Hn],inset:F(),margin:F(),opacity:W(),padding:V(),saturate:W(),scale:W(),sepia:D(),skew:W(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[Zn]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...k(),$e]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",no,$e]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",no,$e]}],"grid-cols":[{"grid-cols":[ro]}],"col-start-end":[{col:["auto",{span:["full",no,$e]},$e]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[ro]}],"row-start-end":[{row:["auto",{span:[no,$e]},$e]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[Zn]},Zn]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zn,Hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vi]}],"font-family":[{font:[ro]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$e]}],"line-clamp":[{"line-clamp":["none",kr,vi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",On,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",On,Hn]}],"underline-offset":[{"underline-offset":["auto",On,$e]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...k(),yy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},by]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:O()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[On,$e]}],"outline-w":[{outline:[On,Hn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[On,Hn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zn,wy]}],"shadow-color":[{shadow:[ro]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...P(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":P()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Zn,$e]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[no,$e]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[On,Hn,vi]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Cy=[];function oo(e){p.useEffect(e,Cy)}const ll={};function wt(e,t){const n=p.useRef(ll);return n.current===ll&&(n.current=e(t)),n}function Py(e,t){return function(r,...o){const s=new URL(e);return s.searchParams.set("code",r.toString()),o.forEach(i=>s.searchParams.append("args[]",i)),`${t} error #${r}; visit ${s} for the full message.`}}const dt=Py("https://base-ui.com/production-error","Base UI"),wi=p.createContext(void 0);function ul(){const e=p.useContext(wi);if(!e)throw new Error(dt(73));return e}const fe=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(dt(1));let a;if(e&&t&&n&&r&&o&&s)a=(c,l,u,f)=>{const d=e(c,l,u,f),h=t(c,l,u,f),m=n(c,l,u,f),y=r(c,l,u,f),v=o(c,l,u,f);return s(d,h,m,y,v,l,u,f)};else if(e&&t&&n&&r&&o)a=(c,l,u,f)=>{const d=e(c,l,u,f),h=t(c,l,u,f),m=n(c,l,u,f),y=r(c,l,u,f);return o(d,h,m,y,l,u,f)};else if(e&&t&&n&&r)a=(c,l,u,f)=>{const d=e(c,l,u,f),h=t(c,l,u,f),m=n(c,l,u,f);return r(d,h,m,l,u,f)};else if(e&&t&&n)a=(c,l,u,f)=>{const d=e(c,l,u,f),h=t(c,l,u,f);return n(d,h,l,u,f)};else if(e&&t)a=(c,l,u,f)=>{const d=e(c,l,u,f);return t(d,l,u,f)};else if(e)a=e;else throw new Error("Missing arguments");return a};var zo=Symbol("NOT_FOUND");function Ty(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ky(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Iy(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var fl=e=>Array.isArray(e)?e:[e];function Oy(e){const t=Array.isArray(e[0])?e[0]:e;return Iy(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function _y(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function Ry(e){let t;return{get(n){return t&&e(t.key,n)?t.value:zo},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function My(e,t){let n=[];function r(a){const c=n.findIndex(l=>t(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return zo}function o(a,c){r(a)===zo&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:r,put:o,getEntries:s,clear:i}}var Ay=(e,t)=>e===t;function Dy(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function Ny(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=Ay,maxSize:o=1,resultEqualityCheck:s}=n,i=Dy(r);let a=0;const c=o<=1?Ry(i):My(o,i);function l(){let u=c.get(arguments);if(u===zo){if(u=e.apply(null,arguments),a++,s){const d=c.getEntries().find(h=>s(h.value,u));d&&(u=d.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var Fy=class{constructor(e){this.value=e}deref(){return this.value}},Ly=typeof WeakRef<"u"?WeakRef:Fy,zy=0,dl=1;function $o(){return{s:zy,v:void 0,o:null,p:null}}function pl(e,t={}){let n=$o();const{resultEqualityCheck:r}=t;let o,s=0;function i(){let a=n;const{length:c}=arguments;for(let f=0,d=c;f<d;f++){const h=arguments[f];if(typeof h=="function"||typeof h=="object"&&h!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const y=m.get(h);y===void 0?(a=$o(),m.set(h,a)):a=y}else{let m=a.p;m===null&&(a.p=m=new Map);const y=m.get(h);y===void 0?(a=$o(),m.set(h,a)):a=y}}const l=a;let u;if(a.s===dl)u=a.v;else if(u=e.apply(null,arguments),s++,r){const f=o?.deref?.()??o;f!=null&&r(f,u)&&(u=f,s!==0&&s--),o=typeof u=="object"&&u!==null||typeof u=="function"?new Ly(u):u}return l.s=dl,l.v=u,u}return i.clearCache=()=>{n=$o(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function hl(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,a,c={},l=o.pop();typeof l=="object"&&(c=l,l=o.pop()),Ty(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:d=[],argsMemoize:h=pl,argsMemoizeOptions:m=[]}=u,y=fl(d),v=fl(m),g=Oy(o),E=f(function(){return s++,l.apply(null,arguments)},...y),C=h(function(){i++;const b=_y(g,arguments);return a=E.apply(null,b),a},...v);return Object.assign(C,{resultFunc:l,memoizedResultFunc:E,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var $y=hl(pl),Vy=Object.assign((e,t=$y)=>{ky(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>Vy});const jy=hl({memoize:Ny,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),Hy=(...e)=>{const t=new WeakMap;let n=1;const r=e[e.length-1],o=e.length-1||1,s=r.length-o;if(s>3)throw new Error(dt(2));return(a,c,l,u)=>{let f=a.__cacheKey__;f||(f={id:n},a.__cacheKey__=f,n+=1);let d=t.get(f);if(!d){let h=e;const m=[void 0,void 0,void 0];switch(s){case 0:break;case 1:{h=[...e.slice(0,-1),()=>m[0],r];break}case 2:{h=[...e.slice(0,-1),()=>m[0],()=>m[1],r];break}case 3:{h=[...e.slice(0,-1),()=>m[0],()=>m[1],()=>m[2],r];break}default:throw new Error(dt(2))}d=jy(...h),d.selectorArgs=m,t.set(f,d)}switch(d.selectorArgs[0]=c,d.selectorArgs[1]=l,d.selectorArgs[2]=u,s){case 0:return d(a);case 1:return d(a,c);case 2:return d(a,c,l);case 3:return d(a,c,l,u);default:throw new Error("unreachable")}}};var Vo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Si={exports:{}},xi={};var ml;function Wy(){if(ml)return xi;ml=1;var e=re;function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(f,d){var h=d(),m=r({inst:{value:h,getSnapshot:d}}),y=m[0].inst,v=m[1];return s(function(){y.value=h,y.getSnapshot=d,c(y)&&v({inst:y})},[f,h,d]),o(function(){return c(y)&&v({inst:y}),f(function(){c(y)&&v({inst:y})})},[f]),i(h),h}function c(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function l(f,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return xi.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,xi}var gl;function yl(){return gl||(gl=1,Si.exports=Wy()),Si.exports}var Uy=yl(),Ei={exports:{}},Ci={};var vl;function By(){if(vl)return Ci;vl=1;var e=re,t=yl();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Ci.useSyncExternalStoreWithSelector=function(l,u,f,d,h){var m=s(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function g(x){if(!E){if(E=!0,C=x,x=d(x),h!==void 0&&y.hasValue){var T=y.value;if(h(T,x))return S=T}return S=x}if(T=S,r(C,x))return T;var I=d(x);return h!==void 0&&h(T,I)?(C=x,T):(C=x,S=I)}var E=!1,C,S,b=f===void 0?null:f;return[function(){return g(u())},b===null?void 0:function(){return g(b())}]},[u,f,d,h]);var v=o(l,m[0],m[1]);return i(function(){y.hasValue=!0,y.value=v},[v]),c(v),v},Ci}var bl;function Gy(){return bl||(bl=1,Ei.exports=By()),Ei.exports}var Yy=Gy();const Xy=parseInt(p.version,10);function Pi(e){return Xy>=e}const qy=Pi(19)?Jy:Qy;function Ue(e,t,n,r,o){return qy(e,t,n,r,o)}function Ky(e,t,n,r,o){const s=p.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Uy.useSyncExternalStore(e.subscribe,s,s)}function Jy(e,t,n,r,o){return Ky(e,t,n,r,o)}function Qy(e,t,n,r,o){return Yy.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class wl{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Ue(this,t,n,r,o)}}const Ti=p[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ev=Ti&&Ti!==p.useLayoutEffect?Ti:e=>e();function ie(e){const t=wt(tv).current;return t.next=e,ev(t.effect),t.trampoline}function tv(){const e={next:void 0,callback:nv,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function nv(){}const he=typeof document<"u"?p.useLayoutEffect:()=>{};function Et(){}const Sl=Object.freeze([]),mt=Object.freeze({});class jo extends wl{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){p.useDebugValue(t),he(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;he(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);he(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){p.useDebugValue(t);const r=n!==void 0;he(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return p.useDebugValue(t),Ue(this,this.selectors[t],n,r,o)}useContextCallback(t,n){p.useDebugValue(t);const r=ie(n??Et);this.context[t]=r}useStateSetter(t){const n=p.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const a=o;o=i,n(i,a,this)}})}}function Ho(){return typeof window<"u"}function _t(e){return ki(e)?(e.nodeName||"").toLowerCase():"#document"}function tt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mn(e){var t;return(t=(ki(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ki(e){return Ho()?e instanceof Node||e instanceof tt(e).Node:!1}function je(e){return Ho()?e instanceof Element||e instanceof tt(e).Element:!1}function it(e){return Ho()?e instanceof HTMLElement||e instanceof tt(e).HTMLElement:!1}function Or(e){return!Ho()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tt(e).ShadowRoot}function Wn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function rv(e){return/^(table|td|th)$/.test(_t(e))}function Zo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ov=/transform|translate|scale|rotate|perspective|filter/,sv=/paint|layout|strict|content/,nr=e=>!!e&&e!=="none";let Ii;function Oi(e){const t=je(e)?At(e):e;return nr(t.transform)||nr(t.translate)||nr(t.scale)||nr(t.rotate)||nr(t.perspective)||!Wo()&&(nr(t.backdropFilter)||nr(t.filter))||ov.test(t.willChange||"")||sv.test(t.contain||"")}function iv(e){let t=Rn(e);for(;it(t)&&!_n(t);){if(Oi(t))return t;if(Zo(t))return null;t=Rn(t)}return null}function Wo(){return Ii==null&&(Ii=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ii}function _n(e){return/^(html|body|#document)$/.test(_t(e))}function At(e){return tt(e).getComputedStyle(e)}function Uo(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rn(e){if(_t(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Or(e)&&e.host||mn(e);return Or(t)?t.host:t}function xl(e){const t=Rn(e);return _n(t)?e.ownerDocument?e.ownerDocument.body:e.body:it(t)&&Wn(t)?t:xl(t)}function so(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=xl(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=tt(o);if(s){const a=_i(i);return t.concat(i,i.visualViewport||[],Wn(o)?o:[],a&&n?so(a):[])}else return t.concat(o,so(o,[],n))}function _i(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gn(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Oe(e){return e?.ownerDocument||document}function Le(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const Bo=null;class av{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Go=new av;class yn{static create(){return new yn}static request(t){return Go.request(t)}static cancel(t){return Go.cancel(t)}currentId=Bo;request(t){this.cancel(),this.currentId=Go.request(()=>{this.currentId=Bo,t()})}cancel=()=>{this.currentId!==Bo&&(Go.cancel(this.currentId),this.currentId=Bo)};disposeEffect=()=>this.cancel}function io(){const e=wt(yn.create).current;return oo(e.disposeEffect),e}const ao=0;class Bt{static create(){return new Bt}currentId=ao;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ao,n()},t)}isStarted(){return this.currentId!==ao}clear=()=>{this.currentId!==ao&&(clearTimeout(this.currentId),this.currentId=ao)};disposeEffect=()=>this.clear}function Gt(){const e=wt(Bt.create).current;return oo(e.disposeEffect),e}let El=0;function cv(e){return El+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${El}`}function Ri(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const _r=typeof navigator<"u",Mi=uv(),Cl=dv(),Pl=fv(),Ai=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Tl=Mi.platform==="MacIntel"&&Mi.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Mi.platform),lv=_r&&/apple/i.test(navigator.vendor),Yo=_r&&/android/i.test(Cl)||/android/i.test(Pl);_r&&Cl.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const kl=Pl.includes("jsdom/");function uv(){if(!_r)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function fv(){if(!_r)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function dv(){if(!_r)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Di="data-base-ui-focusable",Il="active",Ol="selected",_l="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Un="ArrowLeft",Bn="ArrowRight",Ni="ArrowUp",co="ArrowDown";function kt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function we(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Or(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ut(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Rl(e,t){if(!je(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(we(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function ln(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function pv(e){return e.matches("html,body")}function Fi(e){return it(e)&&e.matches(_l)}function hv(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${_l}`)!=null}function Li(e){return e?e.getAttribute("role")==="combobox"&&Fi(e):!1}function zi(e){if(!e||kl)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function lo(e){return e?e.hasAttribute(Di)?e:e.querySelector(`[${Di}]`)||e:null}function vn(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...vn(e,o.id,n)])}function Ml(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Yt(e){e.preventDefault(),e.stopPropagation()}function mv(e){return"nativeEvent"in e}function Al(e){return e.pointerType===""&&e.isTrusted?!0:Yo&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Dl(e){return kl?!1:!Yo&&e.width===0&&e.height===0||Yo&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function uo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Nl(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const gv=["top","right","bottom","left"],Rr=Math.min,Xt=Math.max,Xo=Math.round,rr=Math.floor,bn=e=>({x:e,y:e}),yv={left:"right",right:"left",bottom:"top",top:"bottom"};function $i(e,t,n){return Xt(e,Rr(t,n))}function Mn(e,t){return typeof e=="function"?e(t):e}function jt(e){return e.split("-")[0]}function Gn(e){return e.split("-")[1]}function Vi(e){return e==="x"?"y":"x"}function ji(e){return e==="y"?"height":"width"}function en(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Hi(e){return Vi(en(e))}function vv(e,t,n){n===void 0&&(n=!1);const r=Gn(e),o=Hi(e),s=ji(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=qo(i)),[i,qo(i)]}function bv(e){const t=qo(e);return[Zi(e),t,Zi(t)]}function Zi(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Fl=["left","right"],Ll=["right","left"],wv=["top","bottom"],Sv=["bottom","top"];function xv(e,t,n){switch(e){case"top":case"bottom":return n?t?Ll:Fl:t?Fl:Ll;case"left":case"right":return t?wv:Sv;default:return[]}}function Ev(e,t,n,r){const o=Gn(e);let s=xv(jt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Zi)))),s}function qo(e){const t=jt(e);return yv[t]+e.slice(t.length)}function Cv(e){return{top:0,right:0,bottom:0,left:0,...e}}function zl(e){return typeof e!="number"?Cv(e):{top:e,right:e,bottom:e,left:e}}function fo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ko(e,t,n){return Math.floor(e/t)!==n}function Jo(e,t){return t<0||t>=e.length}function Wi(e,t){return Dt(e.current,{disabledIndices:t})}function $l(e,t){return Dt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Dt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&Mr(e,s,r));return s}function Pv(e,{event:t,orientation:n,loopFocus:r,onLoop:o,rtl:s,cols:i,disabledIndices:a,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:f=!1}){let d=u,h;if(t.key===Ni?h="up":t.key===co&&(h="down"),h){const m=[],y=[];let v=!1,g=0;{let z=null,A=-1;e.forEach((F,V)=>{if(F==null)return;g+=1;const $=F.closest('[role="row"]');$&&(v=!0),($!==z||A===-1)&&(z=$,A+=1,m[A]=[]),m[A].push(V),y[V]=A})}let E=!1,C=0;if(v)for(const z of m){const A=z.length;A>C&&(C=A),A!==i&&(E=!0)}const S=E&&g<e.length,b=C||i,x=z=>{if(!E||u===-1)return;const A=y[u];if(A==null)return;const F=m[A].indexOf(u),V=z==="up"?-1:1;for(let $=A+V,M=0;M<m.length;M+=1,$+=V){if($<0||$>=m.length){if(!r||S)return;if($=$<0?m.length-1:0,o){const O=Math.min(F,m[$].length-1),P=m[$][O]??m[$][0],R=o(t,u,P);$=y[R]??$}}const k=m[$];for(let O=Math.min(F,k.length-1);O>=0;O-=1){const P=k[O];if(!Mr(e,P,a))return P}}},T=z=>{if(!S||u===-1)return;const A=u%b,F=z==="up"?-b:b,V=l-l%b,$=rr(l/b)+1;for(let M=u-A+F,k=0;k<$;k+=1,M+=F){if(M<0||M>l){if(!r)return;M=M<0?V:0}const O=Math.min(M+b-1,l);for(let P=Math.min(M+A,O);P>=M;P-=1)if(!Mr(e,P,a))return P}};f&&Yt(t);const I=x(h)??T(h);if(I!==void 0)d=I;else if(u===-1)d=h==="up"?l:c;else if(d=Dt(e,{startingIndex:u,amount:b,decrement:h==="up",disabledIndices:a}),r){if(h==="up"&&(u-b<c||d<0)){const z=u%b,A=l%b,F=l-(A-z);A===z?d=l:d=A>z?F:F-b,o&&(d=o(t,u,d))}h==="down"&&u+b>l&&(d=Dt(e,{startingIndex:u%b-b,amount:b,disabledIndices:a}),o&&(d=o(t,u,d)))}Jo(e,d)&&(d=u)}if(n==="both"){const m=rr(u/i);t.key===(s?Un:Bn)&&(f&&Yt(t),u%i!==i-1?(d=Dt(e,{startingIndex:u,disabledIndices:a}),r&&Ko(d,i,m)&&(d=Dt(e,{startingIndex:u-u%i-1,disabledIndices:a}),o&&(d=o(t,u,d)))):r&&(d=Dt(e,{startingIndex:u-u%i-1,disabledIndices:a}),o&&(d=o(t,u,d))),Ko(d,i,m)&&(d=u)),t.key===(s?Bn:Un)&&(f&&Yt(t),u%i!==0?(d=Dt(e,{startingIndex:u,decrement:!0,disabledIndices:a}),r&&Ko(d,i,m)&&(d=Dt(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:a}),o&&(d=o(t,u,d)))):r&&(d=Dt(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:a}),o&&(d=o(t,u,d))),Ko(d,i,m)&&(d=u));const y=rr(l/i)===m;Jo(e,d)&&(r&&y?(d=t.key===(s?Bn:Un)?l:Dt(e,{startingIndex:u-u%i-1,disabledIndices:a}),o&&(d=o(t,u,d))):d=u)}return d}function Tv(e,t,n){const r=[];let o=0;return e.forEach(({width:s,height:i},a)=>{let c=!1;for(;!c;){const l=[];for(let u=0;u<s;u+=1)for(let f=0;f<i;f+=1)l.push(o+u+f*t);o%t+s<=t&&l.every(u=>r[u]==null)?(l.forEach(u=>{r[u]=a}),c=!0):o+=1}}),[...r]}function kv(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e);default:return-1}}function Iv(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Mr(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?Qo(o)?!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!0:!1}function Ov(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Qo(e,t=e?At(e):null){return!e||!e.isConnected||!t||Ov(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const _v='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Rv(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Or(n)?n.host:null}function Ui(e){for(const t of Array.from(e.children))if(_t(t)==="summary")return t;return null}function Mv(e,t){const n=Ui(t);return!!n&&(e===n||we(n,e))}function Vl(e){const t=e?_t(e):"";return e!=null&&e.matches(_v)&&(t!=="summary"||e.parentElement!=null&&_t(e.parentElement)==="details"&&Ui(e.parentElement)===e)&&(t!=="details"||Ui(e)==null)&&(t!=="input"||e.type!=="hidden")}function jl(e){if(!Vl(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Rv(t)){const n=t!==e,r=_t(t)==="slot";if(t.hasAttribute("inert")||n&&_t(t)==="details"&&!t.open&&!Mv(e,t)||t.hasAttribute("hidden")||!r&&!Av(t,n))return!1}return!0}function Av(e,t){const n=At(e);return t?n.display!=="none":Qo(e,n)}function Hl(e){const t=e.tabIndex;if(t<0){const n=_t(e);if(n==="details"||n==="audio"||n==="video"||it(e)&&e.isContentEditable)return 0}return t}function Bi(e){if(_t(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Dv(e,t){const n=Bi(e);if(!n)return!0;const r=t.find(o=>{const s=Bi(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=Bi(o);return s?.name===n.name&&s.form===n.form})===n}function Zl(e){if(it(e)&&_t(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return it(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Wl(e,t){Zl(e).forEach(n=>{Vl(n)&&t.push(n),Wl(n,t)})}function Ul(e,t,n){Zl(e).forEach(r=>{it(r)&&r.matches(t)&&n.push(r),Ul(r,t,n)})}function Gi(e){return jl(e)&&Hl(e)>=0}function Bl(e){const t=[];return Wl(e,t),t.filter(jl)}function po(e){const t=Bl(e);return t.filter(n=>Hl(n)>=0&&Dv(n,t))}function Gl(e,t){const n=po(e),r=n.length;if(r===0)return;const o=kt(Oe(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function Yi(e){return Gl(Oe(e).body,1)||e}function Yl(e){return Gl(Oe(e).body,-1)||e}function Xl(e,t){if(!e)return null;const n=po(Oe(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Nv(e){return Xl(e,1)}function Fv(e){return Xl(e,-1)}function Ar(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!we(n,r)}function Lv(e){po(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ql(e){const t=[];Ul(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const es=Hy(e=>e.toasts,e=>{const t=new Map;let n=0,r=0;return e.forEach((o,s)=>{const i=o.transitionStatus==="ending";t.set(o.id,{value:o,domIndex:s,visibleIndex:i?-1:n,offsetY:r}),r+=o.height||0,i||(n+=1)}),t}),wn={toasts:fe(e=>e.toasts),isEmpty:fe(e=>e.toasts.length===0),toast:fe(es,(e,t)=>e.get(t)?.value),toastIndex:fe(es,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:fe(es,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:fe(es,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:fe(e=>e.hovering),focused:fe(e=>e.focused),expanded:fe(e=>e.hovering||e.focused),expandedOrOutOfFocus:fe(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:fe(e=>e.prevFocusElement)};class zv extends jo{timers=new Map;areTimersPaused=!1;constructor(t){super(t,{},wn)}setFocused(t){this.set("focused",t)}setHovering(t){this.set("hovering",t)}setIsWindowFocused(t){this.set("isWindowFocused",t)}setPrevFocusElement(t){this.set("prevFocusElement",t)}setViewport=t=>{this.set("viewport",t)};disposeEffect=()=>()=>{this.timers.forEach(t=>{t.timeout?.clear()}),this.timers.clear()};removeToast(t,n={}){const r=wn.toastIndex(this.state,t);if(r===-1)return;const o=this.state.toasts[r];n.skipOnRemove||o?.onRemove?.();const s=[...this.state.toasts];s.splice(r,1),this.setToasts(s)}addToast=t=>{const{timeout:n,limit:r}=this.state,o=t.id||cv("toast");if(t.id){const l=wn.toast(this.state,t.id);if(l)if(l.transitionStatus==="ending")this.removeToast(t.id,{skipOnRemove:!0});else{const{id:u,transitionStatus:f,...d}=t;return this.updateToastInternal(t.id,d,{resetTimer:!0,markUpdated:!0}),t.id}}const s={...t,id:o,updateKey:0,transitionStatus:"starting"},i=[s,...this.state.toasts],a=i.filter(l=>l.transitionStatus!=="ending");if(a.length>r){const l=a.length-r,u=a.slice(-l),f=new Set(u.map(d=>d.id));this.setToasts(i.map(d=>{const h=f.has(d.id);return d.limited!==h?{...d,limited:h}:d}))}else this.setToasts(i.map(l=>l.limited?{...l,limited:!1}:l));const c=s.timeout??n;return s.type!=="loading"&&c>0&&this.scheduleTimer(o,c,()=>this.closeToast(o)),wn.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),o};updateToast=(t,n)=>{this.updateToastInternal(t,n,{markUpdated:!0})};updateToastInternal=(t,n,r={})=>{const{timeout:o,toasts:s}=this.state,i=wn.toast(this.state,t)??null;if(!i||i.transitionStatus==="ending")return;const a={...i,...n,...r.markUpdated&&{updateKey:(i.updateKey??0)+1}};this.setToasts(s.map(y=>y.id===t?a:y));const c=a.timeout??o,l=i?.timeout??o,u=Object.hasOwn(n,"timeout"),f=a.transitionStatus!=="ending"&&a.type!=="loading"&&c>0,d=this.timers.has(t),h=l!==c,m=i?.type==="loading";if(!f&&d){this.timers.get(t)?.timeout?.clear(),this.timers.delete(t);return}if(f&&(!d||h||u||m||r.resetTimer)){const y=this.timers.get(t);y&&(y.timeout?.clear(),this.timers.delete(t)),this.scheduleTimer(t,c,()=>this.closeToast(t)),wn.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=t=>{const n=t===void 0,{limit:r,toasts:o}=this.state;let s;if(n)s=o,this.timers.forEach(l=>{l.timeout?.clear()}),this.timers.clear();else{const l=wn.toast(this.state,t);if(!l)return;s=[l];const u=this.timers.get(t);u?.timeout&&(u.timeout.clear(),this.timers.delete(t))}let i=0;const c={toasts:o.map(l=>{if(n||l.id===t)return{...l,transitionStatus:"ending",height:0};if(l.transitionStatus==="ending")return l;const u=i>=r;return i+=1,l.limited!==u?{...l,limited:u}:l})};(n||o.length===1)&&(c.hovering=!1,c.focused=!1),this.update(c),s.forEach(l=>{l.transitionStatus!=="ending"&&l.onClose?.()}),this.handleFocusManagement(t)};promiseToast=(t,n)=>{const r=Ri(n.loading),o=this.addToast({...r,type:"loading"}),s=t.then(i=>{const a=Ri(n.success,i);return this.updateToast(o,{...a,type:"success",timeout:a.timeout}),i}).catch(i=>{const a=Ri(n.error,i);return this.updateToast(o,{...a,type:"error",timeout:a.timeout}),Promise.reject(i)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(s),s};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(t=>{if(t.timeout){t.timeout.clear();const n=Date.now()-t.start,r=t.delay-n;t.remaining=r>0?r:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((t,n)=>{t.remaining=t.remaining>0?t.remaining:t.delay,t.timeout??=Bt.create(),t.timeout.start(t.remaining,()=>{this.timers.delete(n),t.callback()}),t.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=t=>{if(t.pointerType!=="touch")return;const n=ut(t);we(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(t,n,r){const o=Date.now(),s=!wn.expandedOrOutOfFocus(this.state),i=s?Bt.create():void 0;i?.start(n,()=>{this.timers.delete(t),r()}),this.timers.set(t,{timeout:i,start:s?o:0,delay:n,remaining:n,callback:r})}setToasts(t){const n={toasts:t};t.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(t){const n=kt(Oe(this.state.viewport));if(!this.state.viewport||!we(this.state.viewport,n)||!zi(n))return;if(t===void 0){this.restoreFocusToPrevElement();return}const r=wn.toasts(this.state),o=wn.toastIndex(this.state,t);let s=null,i=o+1;for(;i<r.length;){if(r[i].transitionStatus!=="ending"){s=r[i];break}i+=1}if(!s)for(i=o-1;i>=0;){if(r[i].transitionStatus!=="ending"){s=r[i];break}i-=1}s?s.ref?.current?.focus():this.restoreFocusToPrevElement()}}const $v=function(t){const{children:n,timeout:r=5e3,limit:o=3,toastManager:s}=t,i=wt(()=>new zv({timeout:r,limit:o,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return oo(i.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:l,options:u})=>{const f=u.id;l==="promise"&&u.promise?i.promiseToast(u.promise,u):l==="update"&&f?i.updateToast(f,u):l==="close"?i.closeToast(f):i.addToast(u)}):void 0},[i,r,s]),i.useSyncedValues({timeout:r,limit:o}),w.jsx(wi.Provider,{value:i,children:n})},Kl={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ts={...Kl,position:"fixed",top:0,left:0},Jl={...Kl,position:"absolute"},An=p.forwardRef(function(t,n){const[r,o]=p.useState();he(()=>{lv&&o("button")},[]);const s={tabIndex:0,role:r};return w.jsx("span",{...t,ref:n,style:ts,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function or(e,t,n,r){const o=wt(Ql).current;return jv(o,e,t,n,r)&&eu(o,[e,t,n,r]),o.callback}function Vv(e){const t=wt(Ql).current;return Hv(t,e)&&eu(t,e),t.callback}function Ql(){return{callback:null,cleanup:null,refs:[]}}function jv(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function Hv(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function eu(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(r[o]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=r[o];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}function tu(e){if(!p.isValidElement(e))return null;const t=e,n=t.props;return(Pi(19)?n?.ref:t.ref)??null}function Xi(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Zv(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const s=t[r](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function Wv(e,t){return typeof e=="function"?e(t):e}function Uv(e,t){return typeof e=="function"?e(t):e}const qi={};function Sn(e,t,n,r,o){if(!n&&!r&&!o&&!e)return ns(t);let s=ns(e);return t&&(s=ho(s,t)),n&&(s=ho(s,n)),r&&(s=ho(s,r)),o&&(s=ho(s,o)),s}function Bv(e){if(e.length===0)return qi;if(e.length===1)return ns(e[0]);let t=ns(e[0]);for(let n=1;n<e.length;n+=1)t=ho(t,e[n]);return t}function ns(e){return Ki(e)?{...ru(e,qi)}:Gv(e)}function ho(e,t){return Ki(t)?ru(t,e):Yv(e,t)}function Gv(e){const t={...e};for(const n in t){const r=t[n];nu(n,r)&&(t[n]=ou(r))}return t}function Yv(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Xi(e.style,r);break}case"className":{e[n]=su(e.className,r);break}default:nu(n,r)?e[n]=Xv(e[n],r):e[n]=r}}return e}function nu(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function Ki(e){return typeof e=="function"}function ru(e,t){return Ki(e)?e(t):e??qi}function Xv(e,t){return t?e?(...n)=>{const r=n[0];if(iu(r)){const s=r;rs(s);const i=t(...n);return s.baseUIHandlerPrevented||e?.(...n),i}const o=t(...n);return e?.(...n),o}:ou(t):e}function ou(e){return e&&((...t)=>{const n=t[0];return iu(n)&&rs(n),e(...t)})}function rs(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function su(e,t){return t?e?t+" "+e:t:e}function iu(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function qe(e,t,n={}){const r=t.render,o=qv(t,n);if(n.enabled===!1)return null;const s=n.state??mt;return Qv(e,r,o,s)}function qv(e,t={}){const{className:n,style:r,render:o}=e,{state:s=mt,ref:i,props:a,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Wv(n,s):void 0,f=l?Uv(r,s):void 0,d=l?Zv(s,c):mt,h=l&&a?Kv(a):void 0,m=l?Xi(d,h)??{}:mt;return typeof document<"u"&&(l?Array.isArray(i)?m.ref=Vv([m.ref,tu(o),...i]):m.ref=or(m.ref,tu(o),i):or(null,null)),l?(u!==void 0&&(m.className=su(m.className,u)),f!==void 0&&(m.style=Xi(m.style,f)),m):mt}function Kv(e){return Array.isArray(e)?Bv(e):Sn(void 0,e)}const Jv=Symbol.for("react.lazy");function Qv(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const o=Sn(n,t.props);o.ref=n.ref;let s=t;return s?.$$typeof===Jv&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,o)}if(e&&typeof e=="string")return e0(e,n);throw new Error(dt(8))}function e0(e,t){return e==="button"?re.createElement("button",{type:"button",...t,key:t.key}):e==="img"?re.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}let t0=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const n0=p.forwardRef(function(t,n){const{render:r,className:o,style:s,children:i,...a}=t,c=ul(),l=Gt(),u=p.useRef(!1),f=p.useRef(!1),d=p.useRef(!1),h=c.useState("isEmpty"),m=c.useState("toasts"),y=c.useState("focused"),v=c.useState("expanded"),g=c.useState("prevFocusElement"),E=m[0]?.height??0,C=p.useMemo(()=>m.some(P=>P.transitionStatus==="ending"),[m]);p.useEffect(()=>{const P=c.state.viewport;if(!P)return;function R(j){h||j.key==="F6"&&ut(j)!==P&&(j.preventDefault(),c.setPrevFocusElement(kt(Oe(P))),P?.focus({preventScroll:!0}),c.pauseTimers(),c.setFocused(!0))}const D=tt(P);return Le(D,"keydown",R)},[c,h]),p.useEffect(()=>{const P=c.state.viewport;if(!P||h)return;const R=tt(P);function D(W){ut(W)===R&&(c.setIsWindowFocused(!1),c.pauseTimers())}function j(W){if(W.relatedTarget)return;const Z=ut(W),U=kt(Oe(P));(Z===R||!we(P,Z)||!zi(U))&&c.resumeTimers(),l.start(0,()=>c.setIsWindowFocused(!0))}return gn(Le(R,"blur",D,!0),Le(R,"focus",j,!0))},[c,l,h]),p.useEffect(()=>{const P=c.state.viewport;if(!P||h)return;const R=Oe(P);return Le(R,"pointerdown",c.handleDocumentPointerDown,!0)},[h,c]);function S(P){const R=c.state.viewport;R&&(u.current=!0,P.relatedTarget===R?m[0]?.ref?.current?.focus():c.restoreFocusToPrevElement())}function b(P){P.key==="Tab"&&P.shiftKey&&ut(P.nativeEvent)===c.state.viewport&&(P.preventDefault(),c.restoreFocusToPrevElement(),c.resumeTimers())}function x(){const P=c.state.toasts.some(R=>R.transitionStatus==="ending");!c.state.isWindowFocused||P||d.current||!f.current||(c.resumeTimers(),c.setHovering(!1),f.current=!1)}p.useEffect(x,[C,c]);function T(){c.pauseTimers(),c.setHovering(!0),f.current=!1}function I(){C||d.current?f.current=!0:(c.resumeTimers(),c.setHovering(!1))}function z(P){P.pointerType==="touch"&&(d.current=!0)}function A(P){P.pointerType==="touch"&&(d.current=!1,x())}function F(){if(u.current){u.current=!1;return}y||zi(kt(Oe(c.state.viewport)))&&(c.setFocused(!0),c.pauseTimers())}function V(P){!y||we(c.state.viewport,P.relatedTarget)||(c.setFocused(!1),c.resumeTimers())}const $={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:T,onMouseMove:T,onMouseLeave:I,onFocus:F,onBlur:V,onKeyDown:b,onClick:F,onPointerDown:z,onPointerUp:A,onPointerCancel:A},M={expanded:v},k=qe("div",t,{ref:[n,c.setViewport],state:M,props:[$,{style:{[t0.frontmostHeight]:E?`${E}px`:void 0}},a,{children:w.jsxs(p.Fragment,{children:[!h&&g&&w.jsx(An,{onFocus:S}),i,!h&&g&&w.jsx(An,{onFocus:S})]})}]}),O=p.useMemo(()=>m.filter(P=>P.priority==="high"),[m]);return w.jsxs(p.Fragment,{children:[!h&&g&&w.jsx(An,{onFocus:S}),k,!y&&O.length>0&&w.jsx("div",{style:ts,children:O.map(P=>w.jsxs("div",{role:"alert","aria-atomic":!0,children:[w.jsx("div",{children:P.title}),w.jsx("div",{children:P.description})]},P.id))})]})});function os(e){return Pi(19)?e:e?"true":void 0}const au=p.createContext(void 0);function r0(){const e=p.useContext(au);if(!e)throw new Error(dt(66));return e}let sr=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const o0={[sr.startingStyle]:""},s0={[sr.endingStyle]:""},tn={transitionStatus(e){return e==="starting"?o0:e==="ending"?s0:null}};function Dn(e){return e==null?e:"current"in e?e.current:e}function cu(e,t=!1,n=!0){const r=io();return ie((o,s=null)=>{r.cancel();const i=Dn(e);if(i==null)return;const a=i,c=()=>{Kt.flushSync(o)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){o();return}function l(){Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{s?.aborted||c()}).catch(()=>{if(n){s?.aborted||c();return}const u=a.getAnimations();!s?.aborted&&u.length>0&&u.some(f=>f.pending||f.playState!=="finished")&&l()})}if(t){const u=sr.startingStyle;if(!a.hasAttribute(u)){r.request(l);return}const f=new MutationObserver(()=>{a.hasAttribute(u)||(f.disconnect(),l())});f.observe(a,{attributes:!0,attributeFilter:[u]}),s?.addEventListener("abort",()=>f.disconnect(),{once:!0});return}r.request(l)})}function xn(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=ie(o),i=cu(r,n,!1);p.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}let ir=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const i0=500,a0={style:{transition:"none"}},Ji="data-base-ui-click-trigger",c0="data-base-ui-swipe-ignore",l0="data-swipe-ignore",lu=`[${c0}]`,u0=`[${l0}]`,f0={fallbackAxisSide:"none"},d0={fallbackAxisSide:"end"},p0={clipPath:"inset(50%)",position:"fixed",top:0,left:0},h0={...tn,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},mo=40,m0=10,Yn=.5,g0=1,y0=`${lu},${u0}`;function uu(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function v0(e){const n=tt(e).getComputedStyle(e).transform;let r=0,o=0,s=1;if(n&&n!=="none"){const i=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(i){const a=i[1].split(", ").map(parseFloat);a.length===6?(r=a[4],o=a[5],s=Math.sqrt(a[0]*a[0]+a[1]*a[1])):a.length===16&&(r=a[12],o=a[13],s=a[0])}}return{x:r,y:o,scale:s}}const b0=p.forwardRef(function(t,n){const{toast:r,render:o,className:s,swipeDirection:i=["down","right"],style:a,...c}=t,l=r.positionerProps?.anchor!==void 0;let u=[];l||(u=Array.isArray(i)?i:[i]);const f=u.length>0,d=ul(),[h,m]=p.useState(void 0),[y,v]=p.useState(!1),[g,E]=p.useState(!1),[C,S]=p.useState(!1),[b,x]=p.useState({x:0,y:0}),[T,I]=p.useState({x:0,y:0,scale:1}),[z,A]=p.useState(),[F,V]=p.useState(),[$,M]=p.useState(null),k=p.useRef(null),O=p.useRef({x:0,y:0}),P=p.useRef({x:0,y:0,scale:1}),R=p.useRef(void 0),D=p.useRef(0),j=p.useRef(!1),W=p.useRef({x:0,y:0}),Z=p.useRef(!1),U=d.useState("toastIndex",r.id),G=d.useState("toastVisibleIndex",r.id),B=d.useState("toastOffsetY",r.id),X=d.useState("focused"),K=d.useState("expanded");xn({open:r.transitionStatus!=="ending",ref:k,onComplete(){r.transitionStatus==="ending"&&d.removeToast(r.id)}});const J=ie((_=!1)=>{const H=k.current;if(!H)return;const N=H.style.height;H.style.height="auto";const L=H.offsetHeight;H.style.height=N;function Q(){d.updateToastInternal(r.id,{ref:k,height:L,...r.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}_?Kt.flushSync(Q):Q()});he(J,[J]);function se(_,H){let N=_,L=H;return!u.includes("left")&&!u.includes("right")?N=_>0?_**Yn:-(Math.abs(_)**Yn):(!u.includes("right")&&_>0&&(N=_**Yn),!u.includes("left")&&_<0&&(N=-(Math.abs(_)**Yn))),!u.includes("up")&&!u.includes("down")?L=H>0?H**Yn:-(Math.abs(H)**Yn):(!u.includes("down")&&H>0&&(L=H**Yn),!u.includes("up")&&H<0&&(L=-(Math.abs(H)**Yn))),{x:N,y:L}}function ae(_){if(_.button!==0)return;_.pointerType==="touch"&&d.pauseTimers();const H=ut(_.nativeEvent);if(!(H&&H.closest(`button,a,input,textarea,[role="button"],${y0}`))){if(j.current=!1,R.current=void 0,D.current=0,O.current={x:_.clientX,y:_.clientY},W.current=O.current,k.current){const L=v0(k.current);P.current=L,I(L),x({x:L.x,y:L.y})}d.setHovering(!0),v(!0),E(!1),M(null),Z.current=!0,k.current?.setPointerCapture(_.pointerId)}}function pe(_){if(!y)return;_.preventDefault(),Z.current&&(O.current={x:_.clientX,y:_.clientY},Z.current=!1);const{clientY:H,clientX:N,movementX:L,movementY:Q}=_;(Q<0&&H>W.current.y||Q>0&&H<W.current.y)&&(W.current={x:W.current.x,y:H}),(L<0&&N>W.current.x||L>0&&N<W.current.x)&&(W.current={x:N,y:W.current.y});const ne=N-O.current.x,te=H-O.current.y,ge=H-W.current.y,Ie=N-W.current.x;if(!g&&Math.sqrt(ne*ne+te*te)>=g0&&(E(!0),$===null)){const He=u.includes("left")||u.includes("right"),nt=u.includes("up")||u.includes("down");if(He&&nt){const st=Math.abs(ne),Re=Math.abs(te);M(st>Re?"horizontal":"vertical")}}let xe;if(!R.current)$==="vertical"?te>0?xe="down":te<0&&(xe="up"):$==="horizontal"?ne>0?xe="right":ne<0&&(xe="left"):Math.abs(ne)>=Math.abs(te)?xe=ne>0?"right":"left":xe=te>0?"down":"up",xe&&u.includes(xe)&&(R.current=xe,D.current=uu(xe,ne,te),m(xe));else{const Ge=R.current,He=uu(Ge,Ie,ge);He>mo?(j.current=!1,m(Ge)):!(u.includes("left")&&u.includes("right"))&&!(u.includes("up")&&u.includes("down"))&&D.current-He>=m0&&(j.current=!0)}const Ce=se(ne,te);let ke=P.current.x,ze=P.current.y;$==="horizontal"?(u.includes("left")||u.includes("right"))&&(ke+=Ce.x):($==="vertical"||(u.includes("left")||u.includes("right"))&&(ke+=Ce.x),(u.includes("up")||u.includes("down"))&&(ze+=Ce.y)),x({x:ke,y:ze})}function Y(_){if(!y)return;if(v(!1),E(!1),M(null),k.current?.releasePointerCapture(_.pointerId),j.current){x({x:T.x,y:T.y}),m(void 0);return}let H=!1;const N=b.x-T.x,L=b.y-T.y;let Q;for(const ne of u){switch(ne){case"right":N>mo&&(H=!0,Q="right");break;case"left":N<-mo&&(H=!0,Q="left");break;case"down":L>mo&&(H=!0,Q="down");break;case"up":L<-mo&&(H=!0,Q="up");break}if(H)break}H?(m(Q),S(!0),d.closeToast(r.id)):(x({x:T.x,y:T.y}),m(void 0))}function me(){y&&(v(!1),E(!1),M(null),x({x:T.x,y:T.y}),m(void 0))}function ye(_){if(_.key==="Escape"){if(!k.current||!we(k.current,kt(Oe(k.current))))return;d.closeToast(r.id)}}p.useEffect(()=>{if(!f)return;const _=k.current;if(!_)return;function H(N){we(_,ut(N))&&N.preventDefault()}return Le(_,"touchmove",H,{passive:!1})},[f]);function de(){if(!y&&b.x===T.x&&b.y===T.y&&!C)return{[ir.swipeMovementX]:"0px",[ir.swipeMovementY]:"0px"};const _=b.x-T.x,H=b.y-T.y;return{transition:y?"none":void 0,transform:y?`translateX(${b.x}px) translateY(${b.y}px) scale(${T.scale})`:void 0,[ir.swipeMovementX]:`${_}px`,[ir.swipeMovementY]:`${H}px`}}const ue=r.priority==="high",ce={role:ue?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":z,"aria-describedby":F,"aria-hidden":ue&&!X?!0:void 0,onPointerDown:f?ae:void 0,onPointerMove:f?pe:void 0,onPointerUp:f?Y:void 0,onPointerCancel:f?me:void 0,onKeyDown:ye,inert:os(r.limited),style:{...de(),[ir.index]:r.transitionStatus==="ending"?U:G,[ir.offsetY]:`${B}px`,[ir.height]:r.height?`${r.height}px`:void 0}},ve=p.useMemo(()=>({rootRef:k,toast:r,titleId:z,setTitleId:A,descriptionId:F,setDescriptionId:V,swiping:y,swipeDirection:h,recalculateHeight:J,index:U,visibleIndex:G,expanded:K}),[r,z,F,y,h,J,U,G,K]),le={transitionStatus:r.transitionStatus,expanded:K,limited:r.limited||!1,type:r.type,swiping:ve.swiping,swipeDirection:ve.swipeDirection},Se=qe("div",t,{ref:[n,ve.rootRef],state:le,stateAttributesMapping:h0,props:[ce,c]});return w.jsx(au.Provider,{value:ve,children:Se})}),w0={...p};let fu=0;function S0(e,t="mui"){const[n,r]=p.useState(e),o=e||n;return p.useEffect(()=>{n==null&&(fu+=1,r(`${t}-${fu}`))},[n,t]),o}const du=w0.useId;function Xn(e,t){if(du!==void 0){const n=du();return e??(t?`${t}-${n}`:n)}return S0(e,t)}const x0=p.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,children:a,...c}=t,{toast:l,setDescriptionId:u}=r0(),f=a??l.description,d=!!f,h=Xn(i);he(()=>{if(d)return u(h),()=>{u(void 0)}},[d,h,u]);const m={type:l.type},y=qe("p",t,{ref:n,state:m,props:{...c,id:h,children:f}});return d?y:null}),E0=p.createContext(void 0);function C0(e=!1){const t=p.useContext(E0);if(t===void 0&&!e)throw new Error(dt(16));return t}function P0(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,i=r&&t!==!1,a=r&&t===!1;return{props:p.useMemo(()=>{const l={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return r||(l.tabIndex=o,!s&&n&&(l.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||a)&&(l.disabled=n),l},[r,n,t,i,a,s,o])}}function Dr(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0,composite:s}=e,i=p.useRef(null),a=C0(!0),c=s??a!==void 0,{props:l}=P0({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:o}),u=p.useCallback(()=>{const h=i.current;Qi(h)&&c&&t&&l.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,l.disabled,c]);he(u,[u]);const f=p.useCallback((h={})=>{const{onClick:m,onMouseDown:y,onKeyUp:v,onKeyDown:g,onPointerDown:E,...C}=h;return Sn({type:o?"button":void 0,onClick(b){if(t){b.preventDefault();return}m?.(b)},onMouseDown(b){t||y?.(b)},onKeyDown(b){if(t||(rs(b),g?.(b),b.baseUIHandlerPrevented))return;const x=b.target===b.currentTarget,T=b.currentTarget,I=Qi(T),z=!o&&T0(T),A=x&&(o?I:!z),F=b.key==="Enter",V=b.key===" ",$=T.getAttribute("role"),M=$?.startsWith("menuitem")||$==="option"||$==="gridcell";if(x&&c&&V){if(b.defaultPrevented&&M)return;b.preventDefault(),z||o&&I?(T.click(),b.preventBaseUIHandler()):A&&(m?.(b),b.preventBaseUIHandler());return}A&&(!o&&(V||F)&&b.preventDefault(),!o&&F&&m?.(b))},onKeyUp(b){if(!t){if(rs(b),v?.(b),b.target===b.currentTarget&&o&&c&&Qi(b.currentTarget)&&b.key===" "){b.preventDefault();return}b.baseUIHandlerPrevented||b.target===b.currentTarget&&!o&&!c&&b.key===" "&&m?.(b)}},onPointerDown(b){if(t){b.preventDefault();return}E?.(b)}},o?void 0:{role:"button"},l,C)},[t,l,c,o]),d=ie(h=>{i.current=h,u()});return{getButtonProps:f,buttonRef:d}}function Qi(e){return it(e)&&e.tagName==="BUTTON"}function T0(e){return!!(e?.tagName==="A"&&e?.href)}function k0(e,t){return t!=null&&!uo(t)?0:typeof e=="function"?e():e}function ea(e,t,n){const r=k0(e,n);return typeof r=="number"?r:r?.[t]}function pu(e){return typeof e=="function"?e():e}function hu(e,t){return t||e==="click"||e==="mousedown"}const ar="none",Nr="trigger-press",Nt="trigger-hover",ta="outside-press",na="item-press",I0="close-press",cr="focus-out",mu="escape-key",O0="close-watcher",ra="list-navigation",_0="cancel-open",gu="imperative-action",ss="swipe",R0="window-resize";function De(e,t,n,r){let o=!1,s=!1;const i=mt;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...i}}function M0(e,t,n){const r=mt;return{reason:e,event:t??new Event("base-ui"),...r}}function vt(e){const t=wt(A0,e).current;return t.next=e,he(t.effect),t}function A0(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function is(e){return`data-base-ui-${e}`}let as=0;function cs(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(as);const s=()=>e?.focus({preventScroll:n});if(o)return s(),Et;const i=requestAnimationFrame(s);return as=i,()=>{as===i&&(cancelAnimationFrame(i),as=0)}}const oa={inert:new WeakMap,"aria-hidden":new WeakMap},yu="data-base-ui-inert",sa={inert:new WeakSet,"aria-hidden":new WeakSet};let go=new WeakMap,ia=0;function D0(e){return sa[e]}function vu(e){return e?Or(e)?e.host:vu(e.parentNode):null}const aa=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=vu(n);return e.contains(r)?r:null}).filter(n=>n!=null),bu=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},wu=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{_t(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function N0(e,t,n,r,{mark:o=!0,markerIgnoreElements:s=[]}){const i=r?"inert":n?"aria-hidden":null;let a=null,c=null;const l=aa(t,e),u=o?aa(t,s):[],f=new Set(u),d=o?wu(t,bu(l),new Set(l)).filter(y=>!f.has(y)):[],h=[],m=[];if(i){const y=oa[i],v=D0(i);c=v,a=y;const g=aa(t,Array.from(t.querySelectorAll("[aria-live]"))),E=l.concat(g);wu(t,bu(E),new Set(E)).forEach(S=>{const b=S.getAttribute(i),x=b!==null&&b!=="false",T=(y.get(S)||0)+1;y.set(S,T),h.push(S),T===1&&x&&v.add(S),x||S.setAttribute(i,i==="inert"?"":"true")})}return o&&d.forEach(y=>{const v=(go.get(y)||0)+1;go.set(y,v),m.push(y),v===1&&y.setAttribute(yu,"")}),ia+=1,()=>{a&&h.forEach(y=>{const g=(a.get(y)||0)-1;a.set(y,g),g||(!c?.has(y)&&i&&y.removeAttribute(i),c?.delete(y))}),o&&m.forEach(y=>{const v=(go.get(y)||0)-1;go.set(y,v),v||y.removeAttribute(yu)}),ia-=1,ia||(oa.inert=new WeakMap,oa["aria-hidden"]=new WeakMap,sa.inert=new WeakSet,sa["aria-hidden"]=new WeakSet,go=new WeakMap)}}function Su(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0,markerIgnoreElements:s=[]}=t,i=Oe(e[0]).body;return N0(e,i,n,r,{mark:o,markerIgnoreElements:s})}const xu=p.createContext(null),Eu=()=>p.useContext(xu),F0=is("portal");function Cu(e={}){const{ref:t,container:n,componentProps:r=mt,elementProps:o}=e,s=Xn(),a=Eu()?.portalNode,[c,l]=p.useState(null),[u,f]=p.useState(null),d=ie(v=>{v!==null&&f(v)}),h=p.useRef(null);he(()=>{if(n===null){h.current&&(h.current=null,f(null),l(null));return}if(s==null)return;const v=(n&&(ki(n)?n:n.current))??a??document.body;if(v==null){h.current&&(h.current=null,f(null),l(null));return}h.current!==v&&(h.current=v,f(null),l(v))},[n,a,s]);const m=qe("div",r,{ref:[t,d],props:[{id:s,[F0]:""},o]});return{portalNode:u,portalSubtree:c&&m?Kt.createPortal(m,c):null}}const ca=p.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,renderGuards:a,style:c,...l}=t,{portalNode:u,portalSubtree:f}=Cu({container:o,ref:n,componentProps:t,elementProps:l}),d=p.useRef(null),h=p.useRef(null),m=p.useRef(null),y=p.useRef(null),[v,g]=p.useState(null),E=p.useRef(!1),C=v?.modal,S=v?.open,b=typeof a=="boolean"?a:!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||C)return;function T(I){u&&I.relatedTarget&&Ar(I)&&(I.type==="focusin"?E.current&&(ql(u),E.current=!1):(Lv(u),E.current=!0))}return gn(Le(u,"focusin",T,!0),Le(u,"focusout",T,!0))},[u,C]),p.useEffect(()=>{!u||S!==!1||(ql(u),E.current=!1)},[S,u]);const x=p.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:h,beforeInsideRef:m,afterInsideRef:y,portalNode:u,setFocusManagerState:g}),[u]);return w.jsxs(p.Fragment,{children:[f,w.jsxs(xu.Provider,{value:x,children:[b&&u&&w.jsx(An,{"data-type":"outside",ref:d,onFocus:T=>{if(Ar(T,u))m.current?.focus();else{const I=v?v.domReference:null;Yl(I)?.focus()}}}),b&&u&&w.jsx("span",{"aria-owns":u.id,style:p0}),u&&Kt.createPortal(r,u),b&&u&&w.jsx(An,{"data-type":"outside",ref:h,onFocus:T=>{if(Ar(T,u))y.current?.focus();else{const I=v?v.domReference:null;Yi(I)?.focus(),v?.closeOnFocusOut&&v?.onOpenChange(!1,De(cr,T.nativeEvent))}}})]})]})});function Pu(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class L0{nodesRef={current:[]};events=Pu();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Tu=p.createContext(null),ku=p.createContext(null),qn=()=>p.useContext(Tu)?.id||null,lr=e=>{const t=p.useContext(ku);return e??t};function z0(e){const t=Xn(),n=lr(e),r=qn();return he(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function $0(e){const{children:t,id:n}=e,r=qn();return w.jsx(Tu.Provider,{value:p.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function V0(e){const{children:t,externalTree:n}=e,r=wt(()=>n??new L0).current;return w.jsx(ku.Provider,{value:r,children:t})}function j0(e,t){const n=tt(ut(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||(e.detail===0?"keyboard":"mouse"):""}const Iu=20;let Kn=[];function la(){Kn=Kn.filter(e=>e.deref()?.isConnected)}function H0(e){la(),e&&_t(e)!=="body"&&(Kn.push(new WeakRef(e)),Kn.length>Iu&&(Kn=Kn.slice(-Iu)))}function ua(){return la(),Kn[Kn.length-1]?.deref()}function Z0(e){return e?Gi(e)?e:po(e)[0]||e:null}function Ou(e,t){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const r=Bl(e).filter(s=>{const i=s.getAttribute("data-tabindex")||"";return Gi(s)||s.hasAttribute("data-tabindex")&&!i.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ls(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:c=!0,openInteractionType:l="",nextFocusableElement:u,previousFocusableElement:f,beforeContentFocusGuardRef:d,externalTree:h,getInsideElements:m}=e,y="rootStore"in t?t.rootStore:t,v=y.useState("open"),g=y.useState("domReferenceElement"),E=y.useState("floatingElement"),{events:C,dataRef:S}=y.context,b=ie(()=>S.current.floatingContext?.nodeId),x=o===!1,T=Li(g)&&x,I=p.useRef(["content"]),z=vt(o),A=vt(s),F=vt(l),V=lr(h),$=Eu(),M=p.useRef(!1),k=p.useRef(!1),O=p.useRef(!1),P=p.useRef(null),R=p.useRef(""),D=p.useRef(""),j=p.useRef(null),W=p.useRef(null),Z=or(j,d,$?.beforeInsideRef),U=or(W,$?.afterInsideRef),G=Gt(),B=Gt(),X=io(),K=$!=null,J=lo(E),se=ie((Y=J)=>Y?po(Y):[]),ae=ie(()=>m?.().filter(Y=>Y!=null)??[]);p.useEffect(()=>{if(r||!a)return;function Y(ye){ye.key==="Tab"&&we(J,kt(Oe(J)))&&se().length===0&&!T&&Yt(ye)}const me=Oe(J);return Le(me,"keydown",Y)},[r,g,J,a,I,T,se]),p.useEffect(()=>{if(r||!v)return;const Y=Oe(J);function me(){O.current=!1}function ye(ue){const ce=ut(ue),ve=ae(),le=we(E,ce)||we(g,ce)||we($?.portalNode,ce)||ve.some(Se=>Se===ce||we(Se,ce));O.current=!le,D.current=ue.pointerType||"keyboard",ce?.closest(`[${Ji}]`)&&(k.current=!0)}function de(){D.current="keyboard"}return gn(Le(Y,"pointerdown",ye,!0),Le(Y,"pointerup",me,!0),Le(Y,"pointercancel",me,!0),Le(Y,"keydown",de,!0))},[r,E,g,J,v,$,ae]),p.useEffect(()=>{if(r||!c)return;const Y=Oe(J);function me(){k.current=!0,B.start(0,()=>{k.current=!1})}function ye(ve){const le=ut(ve);Gi(le)&&(P.current=le)}function de(ve){const le=ve.relatedTarget,Se=ve.currentTarget,_=ut(ve);queueMicrotask(()=>{const H=b(),N=y.context.triggerElements,L=ae(),Q=le?.hasAttribute(is("focus-guard"))&&[j.current,W.current,$?.beforeInsideRef.current,$?.afterInsideRef.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,Dn(f),Dn(u)].includes(le),ne=!(we(g,le)||we(E,le)||we(le,E)||we($?.portalNode,le)||L.some(te=>te===le||we(te,le))||le!=null&&N.hasElement(le)||N.hasMatchingElement(te=>we(te,le))||Q||V&&(vn(V.nodesRef.current,H).find(te=>we(te.context?.elements.floating,le)||we(te.context?.elements.domReference,le))||Ml(V.nodesRef.current,H).find(te=>[te.context?.elements.floating,lo(te.context?.elements.floating)].includes(le)||te.context?.elements.domReference===le)));if(Se===g&&J&&Ou(J,I),i&&Se!==g&&!Qo(_)&&kt(Y)===Y.body){if(it(J)&&(J.focus(),i==="popup")){X.request(()=>{J.focus()});return}const te=se(),ge=P.current,Ie=(ge&&te.includes(ge)?ge:null)||te[te.length-1]||J;it(Ie)&&Ie.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(T||!a)&&le&&ne&&!k.current&&(T||le!==ua())&&(M.current=!0,y.setOpen(!1,De(cr,ve)))})}function ue(){O.current||(S.current.insideReactTree=!0,G.start(0,()=>{S.current.insideReactTree=!1}))}const ce=it(g)?g:null;if(!(!E&&!ce))return gn(ce&&Le(ce,"focusout",de),ce&&Le(ce,"pointerdown",me),E&&Le(E,"focusin",ye),E&&Le(E,"focusout",de),E&&$&&Le(E,"focusout",ue,!0))},[r,g,E,J,a,V,$,y,c,i,se,T,b,I,S,G,B,X,u,f,ae]),p.useEffect(()=>{if(r||!E||!v)return;const Y=Array.from($?.portalNode?.querySelectorAll(`[${is("portal")}]`)||[]),ye=(V?Ml(V.nodesRef.current,b()):[]).find(Se=>Li(Se.context?.elements.domReference||null))?.context?.elements.domReference,ue=[...[E,...Y,j.current,W.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,...ae()],ye,Dn(f),Dn(u),T?g:null].filter(Se=>Se!=null),ce=Su(ue,{ariaHidden:a||T,mark:!1}),ve=[E,...Y].filter(Se=>Se!=null),le=Su(ve);return()=>{le(),ce()}},[v,r,g,E,a,I,$,T,V,b,u,f,ae]),he(()=>{if(!v||r||!it(J))return;const Y=Oe(J),me=kt(Y);queueMicrotask(()=>{const ye=z.current,de=typeof ye=="function"?ye(F.current||""):ye;if(de===void 0||de===!1||we(J,me))return;let ce=null;const ve=()=>(ce==null&&(ce=se(J)),ce[0]||J);let le;de===!0||de===null?le=ve():le=Dn(de),le=le||ve(),cs(le,{preventScroll:le===J})})},[r,v,J,x,se,z,F]),he(()=>{if(r||!J)return;const Y=Oe(J),me=kt(Y);H0(me);function ye(ue){if(ue.open||(R.current=j0(ue.nativeEvent,D.current)),ue.reason===Nt&&ue.nativeEvent.type==="mouseleave"&&(M.current=!0),ue.reason===ta)if(ue.nested)M.current=!1;else if(Al(ue.nativeEvent)||Dl(ue.nativeEvent))M.current=!1;else{let ce=!1;Oe(J).createElement("div").focus({get preventScroll(){return ce=!0,!1}}),ce?M.current=!1:M.current=!0}}C.on("openchange",ye);function de(){const ue=A.current;let ce=typeof ue=="function"?ue(R.current):ue;if(ce===void 0||ce===!1)return null;if(ce===null&&(ce=!0),typeof ce=="boolean"){const le=g||ua();return le&&le.isConnected?le:null}const ve=g||ua();return Dn(ce)||ve||null}return()=>{C.off("openchange",ye);const ue=kt(Y),ce=ae(),ve=we(E,ue)||ce.some(_=>_===ue||we(_,ue))||V&&vn(V.nodesRef.current,b(),!1).some(_=>we(_.context?.elements.floating,ue)),le=A.current,Se=de();queueMicrotask(()=>{const _=Z0(Se),H=typeof le!="boolean";le&&!M.current&&it(_)&&(!(!H&&_!==ue&&ue!==Y.body)||ve)&&_.focus({preventScroll:!0}),M.current=!1})}},[r,E,J,A,S,C,V,g,b,ae]),he(()=>{if(!Ai||v||!E)return;const Y=kt(Oe(E));!it(Y)||!Fi(Y)||we(E,Y)&&Y.blur()},[v,E]),he(()=>{if(!(r||!$))return $.setFocusManagerState({modal:a,closeOnFocusOut:c,open:v,onOpenChange:y.setOpen,domReference:g}),()=>{$.setFocusManagerState(null)}},[r,$,a,v,y,c,g]),he(()=>{if(!(r||!J))return Ou(J,I),()=>{queueMicrotask(la)}},[r,J,I]);const pe=!r&&(a?!T:!0)&&(K||a);return w.jsxs(p.Fragment,{children:[pe&&w.jsx(An,{"data-type":"inside",ref:Z,onFocus:Y=>{if(a){const me=se();cs(me[me.length-1])}else $?.portalNode&&(M.current=!1,Ar(Y,$.portalNode)?Yi(g)?.focus():Dn(f??$.beforeOutsideRef)?.focus())}}),n,pe&&w.jsx(An,{"data-type":"inside",ref:U,onFocus:Y=>{a?cs(se()[0]):$?.portalNode&&(c&&(M.current=!0),Ar(Y,$.portalNode)?Yl(g)?.focus():Dn(u??$.afterOutsideRef)?.focus())}})]})}function fa(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:u=Nr}=t,f=p.useRef(void 0),d=io(),h=Gt(),m=p.useMemo(()=>({onPointerDown(y){f.current=y.pointerType},onMouseDown(y){const v=f.current,g=y.nativeEvent,E=n.select("open");if(y.button!==0||s==="click"||uo(v,!0)&&a)return;const C=r.current.openEvent,S=C?.type,b=n.select("domReferenceElement")!==y.currentTarget,x=E&&b||!(E&&i&&(!(C&&c)||S==="click"||S==="mousedown")),T=ut(g);if(Fi(T)){const z=De(u,g,T);x&&v==="touch"&&l>0?h.start(l,()=>{n.setOpen(!0,z)}):n.setOpen(x,z);return}const I=y.currentTarget;d.request(()=>{const z=De(u,g,I);x&&v==="touch"&&l>0?h.start(l,()=>{n.setOpen(!0,z)}):n.setOpen(x,z)})},onClick(y){if(s==="mousedown-only")return;const v=f.current;if(s==="mousedown"&&v){f.current=void 0;return}if(uo(v,!0)&&a)return;const g=n.select("open"),E=r.current.openEvent,C=n.select("domReferenceElement")!==y.currentTarget,S=g&&C||!(g&&i&&(!(E&&c)||Nl(E))),b=De(u,y.nativeEvent,y.currentTarget);S&&v==="touch"&&l>0?h.start(l,()=>{n.setOpen(!0,b)}):n.setOpen(S,b)},onKeyDown(){f.current=void 0}}),[r,s,a,n,c,i,d,h,l,u]);return p.useMemo(()=>o?{reference:m}:mt,[o,m])}const W0={intentional:"onClick",sloppy:"onPointerDown"};function U0(){return!1}function B0(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function da(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),{dataRef:s}=n.context,{enabled:i=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:l="sloppy",referencePress:u=U0,referencePressEvent:f="sloppy",bubbles:d,externalTree:h}=t,m=lr(h),y=ie(typeof c=="function"?c:()=>!1),v=typeof c=="function"?y:c,g=v!==!1,E=ie(()=>l),C=p.useRef(!1),S=p.useRef(!1),b=p.useRef(!1),{escapeKey:x,outsidePress:T}=B0(d),I=p.useRef(null),z=Gt(),A=Gt(),F=ie(()=>{A.clear(),s.current.insideReactTree=!1}),V=p.useRef(!1),$=p.useRef(""),M=ie(u),k=ie(W=>{if(!r||!i||!a||W.key!=="Escape"||V.current)return;const Z=s.current.floatingContext?.nodeId,U=m?vn(m.nodesRef.current,Z):[];if(!x&&U.length>0){let X=!0;if(U.forEach(K=>{K.context?.open&&!K.context.dataRef.current.__escapeKeyBubbles&&(X=!1)}),!X)return}const G=mv(W)?W.nativeEvent:W,B=De(mu,G);n.setOpen(!1,B),!x&&!B.isPropagationAllowed&&W.stopPropagation()}),O=ie(()=>{s.current.insideReactTree=!0,A.start(0,F)});p.useEffect(()=>{if(!r||!i)return;s.current.__escapeKeyBubbles=x,s.current.__outsidePressBubbles=T;const W=new Bt,Z=new Bt;function U(){W.clear(),V.current=!0}function G(){W.start(Wo()?5:0,()=>{V.current=!1})}function B(){b.current=!0,Z.start(0,()=>{b.current=!1})}function X(){C.current=!1,S.current=!1}function K(){const N=$.current,L=N==="pen"||!N?"mouse":N,Q=E(),ne=typeof Q=="function"?Q():Q;return typeof ne=="string"?ne:ne[L]}function J(N){const L=K();return L==="intentional"&&N.type!=="click"||L==="sloppy"&&N.type==="click"}function se(N){const L=s.current.floatingContext?.nodeId,Q=m&&vn(m.nodesRef.current,L).some(ne=>ln(N,ne.context?.elements.floating));return ln(N,n.select("floatingElement"))||ln(N,n.select("domReferenceElement"))||Q}function ae(N){if(J(N)){F();return}if(s.current.insideReactTree){F();return}const L=ut(N),Q=`[${is("inert")}]`,ne=je(L)?L.getRootNode():null,te=Array.from((Or(ne)?ne:Oe(n.select("floatingElement"))).querySelectorAll(Q)),ge=n.context.triggerElements;if(L&&(ge.hasElement(L)||ge.hasMatchingElement(ke=>we(ke,L))))return;let Ie=je(L)?L:null;for(;Ie&&!_n(Ie);){const ke=Rn(Ie);if(_n(ke)||!je(ke))break;Ie=ke}if(te.length&&je(L)&&!pv(L)&&!we(L,n.select("floatingElement"))&&te.every(ke=>!we(Ie,ke)))return;if(it(L)&&!("touches"in N)){const ke=_n(L),ze=At(L),Ge=/auto|scroll/,He=ke||Ge.test(ze.overflowX),nt=ke||Ge.test(ze.overflowY),st=He&&L.clientWidth>0&&L.scrollWidth>L.clientWidth,Re=nt&&L.clientHeight>0&&L.scrollHeight>L.clientHeight,Pe=ze.direction==="rtl",Ze=Re&&(Pe?N.offsetX<=L.offsetWidth-L.clientWidth:N.offsetX>L.clientWidth),We=st&&N.offsetY>L.clientHeight;if(Ze||We)return}if(se(N))return;if(K()==="intentional"&&b.current){Z.clear(),b.current=!1;return}if(typeof v=="function"&&!v(N))return;const xe=s.current.floatingContext?.nodeId,Ce=m?vn(m.nodesRef.current,xe):[];if(Ce.length>0){let ke=!0;if(Ce.forEach(ze=>{ze.context?.open&&!ze.context.dataRef.current.__outsidePressBubbles&&(ke=!1)}),!ke)return}n.setOpen(!1,De(ta,N)),F()}function pe(N){K()!=="sloppy"||N.pointerType==="touch"||!n.select("open")||!i||ln(N,n.select("floatingElement"))||ln(N,n.select("domReferenceElement"))||ae(N)}function Y(N){if(K()!=="sloppy"||!n.select("open")||!i||ln(N,n.select("floatingElement"))||ln(N,n.select("domReferenceElement")))return;const L=N.touches[0];L&&(I.current={startTime:Date.now(),startX:L.clientX,startY:L.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},z.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function me(N,L){const Q=ut(N);if(!Q)return;const ne=Le(Q,N.type,()=>{L(N),ne()})}function ye(N){$.current="touch",me(N,Y)}function de(N){z.clear(),N.type==="pointerdown"&&($.current=N.pointerType),!(N.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)&&me(N,L=>{L.type==="pointerdown"?pe(L):ae(L)})}function ue(N){if(!C.current)return;const L=S.current;if(X(),K()==="intentional"){if(N.type==="pointercancel"){L&&B();return}if(!se(N)){if(L){B();return}typeof v=="function"&&!v(N)||(Z.clear(),b.current=!0,F())}}}function ce(N){if(K()!=="sloppy"||!I.current||ln(N,n.select("floatingElement"))||ln(N,n.select("domReferenceElement")))return;const L=N.touches[0];if(!L)return;const Q=Math.abs(L.clientX-I.current.startX),ne=Math.abs(L.clientY-I.current.startY),te=Math.sqrt(Q*Q+ne*ne);te>5&&(I.current.dismissOnTouchEnd=!0),te>10&&(ae(N),z.clear(),I.current=null)}function ve(N){me(N,ce)}function le(N){K()!=="sloppy"||!I.current||ln(N,n.select("floatingElement"))||ln(N,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&ae(N),z.clear(),I.current=null)}function Se(N){me(N,le)}const _=Oe(o),H=gn(a&&gn(Le(_,"keydown",k),Le(_,"compositionstart",U),Le(_,"compositionend",G)),g&&gn(Le(_,"click",de,!0),Le(_,"pointerdown",de,!0),Le(_,"pointerup",ue,!0),Le(_,"pointercancel",ue,!0),Le(_,"mousedown",de,!0),Le(_,"mouseup",ue,!0),Le(_,"touchstart",ye,!0),Le(_,"touchmove",ve,!0),Le(_,"touchend",Se,!0)));return()=>{H(),W.clear(),Z.clear(),X(),b.current=!1}},[s,o,a,g,v,r,i,x,T,k,F,E,m,n,z]),p.useEffect(F,[v,F]);const P=p.useMemo(()=>({onKeyDown:k,[W0[f]]:W=>{M()&&n.setOpen(!1,De(Nr,W.nativeEvent))},...f!=="intentional"&&{onClick(W){M()&&n.setOpen(!1,De(Nr,W.nativeEvent))}}}),[k,n,f,M]),R=ie(W=>{if(!r||!i||W.button!==0)return;const Z=ut(W.nativeEvent);we(n.select("floatingElement"),Z)&&(C.current||(C.current=!0,S.current=!1))}),D=ie(W=>{!r||!i||(W.defaultPrevented||W.nativeEvent.defaultPrevented)&&C.current&&(S.current=!0)}),j=p.useMemo(()=>({onKeyDown:k,onPointerDown:D,onMouseDown:D,onClickCapture:O,onMouseDownCapture(W){O(),R(W)},onPointerDownCapture(W){O(),R(W)},onMouseUpCapture:O,onTouchEndCapture:O,onTouchMoveCapture:O}),[k,O,R,D]);return p.useMemo(()=>i?{reference:P,floating:j,trigger:P}:{},[i,P,j])}function _u(e,t,n){let{reference:r,floating:o}=e;const s=en(t),i=Hi(t),a=ji(i),c=jt(t),l=s==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Gn(t)){case"start":h[i]-=d*(n&&l?-1:1);break;case"end":h[i]+=d*(n&&l?-1:1);break}return h}async function G0(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Mn(t,e),m=zl(h),v=a[d?f==="floating"?"reference":"floating":f],g=fo(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),E=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},b=fo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:C,strategy:c}):E);return{top:(g.top-b.top+m.top)/S.y,bottom:(b.bottom-g.bottom+m.bottom)/S.y,left:(g.left-b.left+m.left)/S.x,right:(b.right-g.right+m.right)/S.x}}const Y0=50,X0=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:G0},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=_u(l,r,c),d=r,h=0;const m={};for(let y=0;y<s.length;y++){const v=s[y];if(!v)continue;const{name:g,fn:E}=v,{x:C,y:S,data:b,reset:x}=await E({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});u=C??u,f=S??f,m[g]={...m[g],...b},x&&h<Y0&&(h++,typeof x=="object"&&(x.placement&&(d=x.placement),x.rects&&(l=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:u,y:f}=_u(l,d,c)),y=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:m}},q0=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...v}=Mn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=jt(o),E=en(a),C=jt(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),b=d||(C||!y?[qo(a)]:bv(a)),x=m!=="none";!d&&x&&b.push(...Ev(a,y,m,S));const T=[a,...b],I=await c.detectOverflow(t,v),z=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&z.push(I[g]),f){const M=vv(o,i,S);z.push(I[M[0]],I[M[1]])}if(A=[...A,{placement:o,overflows:z}],!z.every(M=>M<=0)){var F,V;const M=(((F=s.flip)==null?void 0:F.index)||0)+1,k=T[M];if(k&&(!(f==="alignment"?E!==en(k):!1)||A.every(R=>en(R.placement)===E?R.overflows[0]>0:!0)))return{data:{index:M,overflows:A},reset:{placement:k}};let O=(V=A.filter(P=>P.overflows[0]<=0).sort((P,R)=>P.overflows[1]-R.overflows[1])[0])==null?void 0:V.placement;if(!O)switch(h){case"bestFit":{var $;const P=($=A.filter(R=>{if(x){const D=en(R.placement);return D===E||D==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(D=>D>0).reduce((D,j)=>D+j,0)]).sort((R,D)=>R[1]-D[1])[0])==null?void 0:$[0];P&&(O=P);break}case"initialPlacement":O=a;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function Ru(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Mu(e){return gv.some(t=>e[t]>=0)}const K0=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Mn(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Ru(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Mu(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Ru(i,n.floating);return{data:{escapedOffsets:a,escaped:Mu(a)}}}default:return{}}}}},Au=new Set(["left","top"]);async function J0(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=jt(n),a=Gn(n),c=en(n)==="y",l=Au.has(i)?-1:1,u=s&&c?-1:1,f=Mn(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const Q0=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await J0(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},eb=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:g=>{let{x:E,y:C}=g;return{x:E,y:C}}},...l}=Mn(e,t),u={x:n,y:r},f=await s.detectOverflow(t,l),d=en(jt(o)),h=Vi(d);let m=u[h],y=u[d];if(i){const g=h==="y"?"top":"left",E=h==="y"?"bottom":"right",C=m+f[g],S=m-f[E];m=$i(C,m,S)}if(a){const g=d==="y"?"top":"left",E=d==="y"?"bottom":"right",C=y+f[g],S=y-f[E];y=$i(C,y,S)}const v=c.fn({...t,[h]:m,[d]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[d]:a}}}}}},tb=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Mn(e,t),u={x:n,y:r},f=en(o),d=Vi(f);let h=u[d],m=u[f];const y=Mn(a,t),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const C=d==="y"?"height":"width",S=s.reference[d]-s.floating[C]+v.mainAxis,b=s.reference[d]+s.reference[C]-v.mainAxis;h<S?h=S:h>b&&(h=b)}if(l){var g,E;const C=d==="y"?"width":"height",S=Au.has(jt(o)),b=s.reference[f]-s.floating[C]+(S&&((g=i.offset)==null?void 0:g[f])||0)+(S?0:v.crossAxis),x=s.reference[f]+s.reference[C]+(S?0:((E=i.offset)==null?void 0:E[f])||0)-(S?v.crossAxis:0);m<b?m=b:m>x&&(m=x)}return{[d]:h,[f]:m}}}},nb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=Mn(e,t),u=await i.detectOverflow(t,l),f=jt(o),d=Gn(o),h=en(o)==="y",{width:m,height:y}=s.floating;let v,g;f==="top"||f==="bottom"?(v=f,g=d===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,v=d==="end"?"top":"bottom");const E=y-u.top-u.bottom,C=m-u.left-u.right,S=Rr(y-u[v],E),b=Rr(m-u[g],C),x=!t.middlewareData.shift;let T=S,I=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=E),x&&!d){const A=Xt(u.left,0),F=Xt(u.right,0),V=Xt(u.top,0),$=Xt(u.bottom,0);h?I=m-2*(A!==0||F!==0?A+F:Xt(u.left,u.right)):T=y-2*(V!==0||$!==0?V+$:Xt(u.top,u.bottom))}await c({...t,availableWidth:I,availableHeight:T});const z=await i.getDimensions(a.floating);return m!==z.width||y!==z.height?{reset:{rects:!0}}:{}}}};function Du(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=it(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Xo(n)!==s||Xo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function pa(e){return je(e)?e:e.contextElement}function Fr(e){const t=pa(e);if(!it(t))return bn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Du(t);let i=(s?Xo(n.width):n.width)/r,a=(s?Xo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const rb=bn(0);function Nu(e){const t=tt(e);return!Wo()||!t.visualViewport?rb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ob(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==tt(e)?!1:t}function ur(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=pa(e);let i=bn(1);t&&(r?je(r)&&(i=Fr(r)):i=Fr(e));const a=ob(s,n,r)?Nu(s):bn(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,f=o.height/i.y;if(s){const d=tt(s),h=r&&je(r)?tt(r):r;let m=d,y=_i(m);for(;y&&r&&h!==m;){const v=Fr(y),g=y.getBoundingClientRect(),E=At(y),C=g.left+(y.clientLeft+parseFloat(E.paddingLeft))*v.x,S=g.top+(y.clientTop+parseFloat(E.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=C,l+=S,m=tt(y),y=_i(m)}}return fo({width:u,height:f,x:c,y:l})}function us(e,t){const n=Uo(e).scrollLeft;return t?t.left+n:ur(mn(e)).left+n}function Fu(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-us(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function sb(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=mn(r),a=t?Zo(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=bn(1);const u=bn(0),f=it(r);if((f||!f&&!s)&&((_t(r)!=="body"||Wn(i))&&(c=Uo(r)),f)){const h=ur(r);l=Fr(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=i&&!f&&!s?Fu(i,c):bn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+d.x,y:n.y*l.y-c.scrollTop*l.y+u.y+d.y}}function ib(e){return Array.from(e.getClientRects())}function ab(e){const t=mn(e),n=Uo(e),r=e.ownerDocument.body,o=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+us(e);const a=-n.scrollTop;return At(r).direction==="rtl"&&(i+=Xt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Lu=25;function cb(e,t){const n=tt(e),r=mn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const u=Wo();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=us(r);if(l<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,m=Math.abs(r.clientWidth-f.clientWidth-h);m<=Lu&&(s-=m)}else l<=Lu&&(s+=l);return{width:s,height:i,x:a,y:c}}function lb(e,t){const n=ur(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=it(e)?Fr(e):bn(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function zu(e,t,n){let r;if(t==="viewport")r=cb(e,n);else if(t==="document")r=ab(mn(e));else if(je(t))r=lb(t,n);else{const o=Nu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return fo(r)}function $u(e,t){const n=Rn(e);return n===t||!je(n)||_n(n)?!1:At(n).position==="fixed"||$u(n,t)}function ub(e,t){const n=t.get(e);if(n)return n;let r=so(e,[],!1).filter(a=>je(a)&&_t(a)!=="body"),o=null;const s=At(e).position==="fixed";let i=s?Rn(e):e;for(;je(i)&&!_n(i);){const a=At(i),c=Oi(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Wn(i)&&!c&&$u(e,i))?r=r.filter(u=>u!==i):o=a,i=Rn(i)}return t.set(e,r),r}function fb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Zo(t)?[]:ub(t,this._c):[].concat(n),r],a=zu(t,i[0],o);let c=a.top,l=a.right,u=a.bottom,f=a.left;for(let d=1;d<i.length;d++){const h=zu(t,i[d],o);c=Xt(h.top,c),l=Rr(h.right,l),u=Rr(h.bottom,u),f=Xt(h.left,f)}return{width:l-f,height:u-c,x:f,y:c}}function db(e){const{width:t,height:n}=Du(e);return{width:t,height:n}}function pb(e,t,n){const r=it(t),o=mn(t),s=n==="fixed",i=ur(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=bn(0);function l(){c.x=us(o)}if(r||!r&&!s)if((_t(t)!=="body"||Wn(o))&&(a=Uo(t)),r){const h=ur(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?Fu(o,a):bn(0),f=i.left+a.scrollLeft-c.x-u.x,d=i.top+a.scrollTop-c.y-u.y;return{x:f,y:d,width:i.width,height:i.height}}function ha(e){return At(e).position==="static"}function Vu(e,t){if(!it(e)||At(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mn(e)===n&&(n=n.ownerDocument.body),n}function ju(e,t){const n=tt(e);if(Zo(e))return n;if(!it(e)){let o=Rn(e);for(;o&&!_n(o);){if(je(o)&&!ha(o))return o;o=Rn(o)}return n}let r=Vu(e,t);for(;r&&rv(r)&&ha(r);)r=Vu(r,t);return r&&_n(r)&&ha(r)&&!Oi(r)?n:r||iv(e)||n}const hb=async function(e){const t=this.getOffsetParent||ju,n=this.getDimensions,r=await n(e.floating);return{reference:pb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mb(e){return At(e).direction==="rtl"}const Hu={convertOffsetParentRelativeRectToViewportRelativeRect:sb,getDocumentElement:mn,getClippingRect:fb,getOffsetParent:ju,getElementRects:hb,getClientRects:ib,getDimensions:db,getScale:Fr,isElement:je,isRTL:mb};function Zu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gb(e,t){let n=null,r;const o=mn(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=l;if(a||t(),!d||!h)return;const m=rr(f),y=rr(o.clientWidth-(u+d)),v=rr(o.clientHeight-(f+h)),g=rr(u),C={rootMargin:-m+"px "+-y+"px "+-v+"px "+-g+"px",threshold:Xt(0,Rr(1,c))||1};let S=!0;function b(x){const T=x[0].intersectionRatio;if(T!==c){if(!S)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Zu(l,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(b,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,C)}n.observe(e)}return i(!0),s}function Wu(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=pa(e),u=o||s?[...l?so(l):[],...t?so(t):[]]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const f=l&&a?gb(l,n):null;let d=-1,h=null;i&&(h=new ResizeObserver(g=>{let[E]=g;E&&E.target===l&&h&&t&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),n()}),l&&!c&&h.observe(l),t&&h.observe(t));let m,y=c?ur(e):null;c&&v();function v(){const g=ur(e);y&&!Zu(y,g)&&n(),y=g,m=requestAnimationFrame(v)}return n(),()=>{var g;u.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),f?.(),(g=h)==null||g.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const yb=Q0,vb=eb,bb=q0,wb=nb,Sb=K0,xb=tb,Eb=(e,t,n)=>{const r=new Map,o={platform:Hu,...n},s={...o.platform,_c:r};return X0(e,t,{...o,platform:s})};var Cb=typeof document<"u",Pb=function(){},fs=Cb?re.useLayoutEffect:Pb;function ds(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ds(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!ds(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Uu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bu(e,t){const n=Uu(e);return Math.round(t*n)/n}function ma(e){const t=p.useRef(e);return fs(()=>{t.current=e}),t}function Tb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=p.useState(r);ds(d,r)||h(r);const[m,y]=p.useState(null),[v,g]=p.useState(null),E=p.useCallback(R=>{R!==x.current&&(x.current=R,y(R))},[]),C=p.useCallback(R=>{R!==T.current&&(T.current=R,g(R))},[]),S=s||m,b=i||v,x=p.useRef(null),T=p.useRef(null),I=p.useRef(u),z=c!=null,A=ma(c),F=ma(o),V=ma(l),$=p.useCallback(()=>{if(!x.current||!T.current)return;const R={placement:t,strategy:n,middleware:d};F.current&&(R.platform=F.current),Eb(x.current,T.current,R).then(D=>{const j={...D,isPositioned:V.current!==!1};M.current&&!ds(I.current,j)&&(I.current=j,Kt.flushSync(()=>{f(j)}))})},[d,t,n,F,V]);fs(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[l]);const M=p.useRef(!1);fs(()=>(M.current=!0,()=>{M.current=!1}),[]),fs(()=>{if(S&&(x.current=S),b&&(T.current=b),S&&b){if(A.current)return A.current(S,b,$);$()}},[S,b,$,A,z]);const k=p.useMemo(()=>({reference:x,floating:T,setReference:E,setFloating:C}),[E,C]),O=p.useMemo(()=>({reference:S,floating:b}),[S,b]),P=p.useMemo(()=>{const R={position:n,left:0,top:0};if(!O.floating)return R;const D=Bu(O.floating,u.x),j=Bu(O.floating,u.y);return a?{...R,transform:"translate("+D+"px, "+j+"px)",...Uu(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:j}},[n,a,O.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:$,refs:k,elements:O,floatingStyles:P}),[u,$,k,O,P])}const kb=(e,t)=>{const n=yb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ib=(e,t)=>{const n=vb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ob=(e,t)=>({fn:xb(e).fn,options:[e,t]}),_b=(e,t)=>{const n=bb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rb=(e,t)=>{const n=wb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mb=(e,t)=>{const n=Sb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ab={open:fe(e=>e.open),transitionStatus:fe(e=>e.transitionStatus),domReferenceElement:fe(e=>e.domReferenceElement),referenceElement:fe(e=>e.positionReference??e.referenceElement),floatingElement:fe(e=>e.floatingElement),floatingId:fe(e=>e.floatingId)};class ga extends jo{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Pu(),nested:r,triggerElements:s},Ab),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&Nl(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function yo(e,t=!1,n=!1){const[r,o]=p.useState(e&&t?"idle":void 0),[s,i]=p.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),he(()=>{if(!e&&s&&r!=="ending"&&n){const a=yn.request(()=>{o("ending")});return()=>{yn.cancel(a)}}},[e,s,r,n]),he(()=>{if(!e||t)return;const a=yn.request(()=>{o(void 0)});return()=>{yn.cancel(a)}},[t,e]),he(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=yn.request(()=>{o("idle")});return()=>{yn.cancel(a)}},[t,e,s,r]),{mounted:s,setMounted:i,transitionStatus:r}}function Db(e,t){const n=p.useRef(null),r=p.useRef(null);return p.useCallback(o=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=r.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,r.current=null}o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function Gu(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=Db(e,n),i=ie(a=>{if(s(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...r});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...r})});return he(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:o}}function Yu(e){const t=e.useState("open");he(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function Xu(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=yo(e);t.useSyncedValues({mounted:r,transitionStatus:s});const i=ie(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return xn({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class ps{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function Nb(){return new ga({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new ps,floatingId:"",syncOnly:!1,nested:!1,onOpenChange:void 0})}function qu(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Nb(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:mt,inactiveTriggerProps:mt,popupProps:mt}}const hs=fe(e=>e.triggerIdProp??e.activeTriggerId),Ku={open:fe(e=>e.openProp??e.open),mounted:fe(e=>e.mounted),transitionStatus:fe(e=>e.transitionStatus),floatingRootContext:fe(e=>e.floatingRootContext),preventUnmountingOnClose:fe(e=>e.preventUnmountingOnClose),payload:fe(e=>e.payload),activeTriggerId:hs,activeTriggerElement:fe(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:fe((e,t)=>t!==void 0&&hs(e)===t),isOpenedByTrigger:fe((e,t)=>t!==void 0&&hs(e)===t&&e.open),isMountedByTrigger:fe((e,t)=>t!==void 0&&hs(e)===t&&e.mounted),triggerProps:fe((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:fe(e=>e.popupProps),popupElement:fe(e=>e.popupElement),positionerElement:fe(e=>e.positionerElement)};function Ju(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=Xn(),s=qn()!=null,i=wt(()=>new ga({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new ps,floatingId:o,syncOnly:!1,nested:s})).current;return he(()=>{const a={open:t,floatingId:o};r.reference!==void 0&&(a.referenceElement=r.reference,a.domReferenceElement=je(r.reference)?r.reference:null),r.floating!==void 0&&(a.floatingElement=r.floating),i.update(a)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i}function Fb(e={}){const{nodeId:t,externalTree:n}=e,r=Ju(e),o=e.rootContext||r,s={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[i,a]=p.useState(null),c=p.useRef(null),l=lr(n);he(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const u=Tb({...e,elements:{...s,...i&&{reference:i}}}),f=p.useCallback(I=>{const z=je(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),getClientRects:()=>I.getClientRects(),contextElement:I}:I;a(z),u.refs.setReference(z)},[u.refs]),[d,h]=p.useState(void 0),[m,y]=p.useState(null);o.useSyncedValue("referenceElement",d??null);const v=je(d)?d:null;o.useSyncedValue("domReferenceElement",d===void 0?s.domReference:v),o.useSyncedValue("floatingElement",m);const g=p.useCallback(I=>{(je(I)||I===null)&&(c.current=I,h(I)),(je(u.refs.reference.current)||u.refs.reference.current===null||I!==null&&!je(I))&&u.refs.setReference(I)},[u.refs,h]),E=p.useCallback(I=>{y(I),u.refs.setFloating(I)},[u.refs]),C=p.useMemo(()=>({...u.refs,setReference:g,setFloating:E,setPositionReference:f,domReference:c}),[u.refs,g,E,f]),S=p.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),b=o.useState("open"),x=o.useState("floatingId"),T=p.useMemo(()=>({...u,dataRef:o.context.dataRef,open:b,onOpenChange:o.setOpen,events:o.context.events,floatingId:x,refs:C,elements:S,nodeId:t,rootStore:o}),[u,C,S,t,o,b,x]);return he(()=>{o.context.dataRef.current.floatingContext=T;const I=l?.nodesRef.current.find(z=>z.id===t);I&&(I.context=T)}),p.useMemo(()=>({...u,context:T,refs:C,elements:S,rootStore:o}),[u,C,S,T,o])}function Qu(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,o=Xn(),s=qn()!=null,i=t.useState("open"),a=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),l=t.context.triggerElements,u=wt(()=>new ga({open:i,transitionStatus:void 0,referenceElement:a,floatingElement:c,triggerElements:l,onOpenChange:r,floatingId:o,syncOnly:!0,nested:s})).current;return he(()=>{const f={open:i,floatingId:o,referenceElement:a,floatingElement:c};je(a)&&(f.domReferenceElement=a),u.state.positionReference===u.state.referenceElement&&(f.positionReference=a),u.update(f)},[i,o,a,c,u]),u.context.onOpenChange=r,u.context.nested=s,u}class ya{constructor(){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 Bt,this.restTimeout=new Bt,this.handleCloseOptions=void 0}static create(){return new ya}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const ms=new WeakMap;function gs(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&ms.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),ms.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function ef(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t,s=ms.get(n);s&&s!==e&&gs(s),gs(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,ms.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function tf(e){const t=wt(ya.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),oo(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function Lb(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,nodeId:l}=t,u=tf(n),f=lr(),d=qn(),h=ie(()=>hu(i.current.openEvent?.type,u.interactedInside)),m=ie(()=>{const S=i.current.openEvent?.type;return S?.includes("mouse")&&S!=="mousedown"}),y=ie(S=>Rl(S,n.context.triggerElements)),v=p.useCallback(S=>{const b=ea(c,"close",u.pointerType),x=()=>{n.setOpen(!1,De(Nt,S)),f?.events.emit("floating.closed",S)};b?u.openChangeTimeout.start(b,x):(u.openChangeTimeout.clear(),x())},[c,n,u,f]),g=ie(()=>{gs(u)}),E=ie(S=>{const b=ut(S);if(!hv(b)){u.interactedInside=!1;return}u.interactedInside=b?.closest("[aria-haspopup]")!=null});he(()=>{r||(u.pointerType=void 0,u.restTimeoutPending=!1,u.interactedInside=!1,g())},[r,u,g]),p.useEffect(()=>g,[g]),he(()=>{if(a&&r&&u.handleCloseOptions?.blockPointerEvents&&m()&&je(s)&&o){const S=s,b=o,x=Oe(o),T=f?.nodesRef.current.find(z=>z.id===d)?.context?.elements.floating;T&&(T.style.pointerEvents="");const I=u.handleCloseOptions?.getScope?.()??u.pointerEventsScopeElement??T??S.closest("[data-rootownerid]")??x.body;return ef(u,{scopeElement:I,referenceElement:S,floatingElement:b}),()=>{g()}}},[a,r,s,o,u,m,f,d,g]);const C=Gt();p.useEffect(()=>{if(!a)return;function S(){u.openChangeTimeout.clear(),C.clear(),f?.events.off("floating.closed",x),g()}function b(I){if(f&&d&&vn(f.nodesRef.current,d).length>0){f.events.on("floating.closed",x);return}if(y(I.relatedTarget))return;const z=i.current.floatingContext?.nodeId??l,A=I.relatedTarget;if(!(f&&z&&je(A)&&vn(f.nodesRef.current,z,!1).some(V=>we(V.context?.elements.floating,A)))){if(u.handler){u.handler(I);return}g(),h()||v(I)}}function x(I){!f||!d||vn(f.nodesRef.current,d).length>0||C.start(0,()=>{f.events.off("floating.closed",x),n.setOpen(!1,De(Nt,I)),f.events.emit("floating.closed",I)})}const T=o;return gn(T&&Le(T,"mouseenter",S),T&&Le(T,"mouseleave",b),T&&Le(T,"pointerdown",E,!0),()=>{f?.events.off("floating.closed",x)})},[a,o,n,i,l,h,y,v,g,E,u,f,d,C])}const zb={current:null};function $b(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:o}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:f=zb,externalTree:d,isActiveTrigger:h=!0,getHandleCloseContext:m,isClosing:y}=t,v=lr(d),g=tf(n),E=p.useRef(!1),C=vt(a),S=vt(i),b=vt(l),x=vt(s),T=vt(y);h&&(g.handleCloseOptions=C.current?.__options);const I=ie(()=>hu(r.current.openEvent?.type,g.interactedInside)),z=ie(M=>Rl(M,n.context.triggerElements)),A=ie((M,k,O)=>{const P=n.context.triggerElements;if(P.hasElement(k))return!M||!we(M,k);if(!je(O))return!1;const R=O;return P.hasMatchingElement(D=>we(D,R))&&(!M||!we(M,R))}),F=ie((M,k=!0)=>{const O=ea(S.current,"close",g.pointerType);O?g.openChangeTimeout.start(O,()=>{n.setOpen(!1,De(Nt,M)),v?.events.emit("floating.closed",M)}):k&&(g.openChangeTimeout.clear(),n.setOpen(!1,De(Nt,M)),v?.events.emit("floating.closed",M))}),V=ie(()=>{if(!g.handler)return;Oe(n.select("domReferenceElement")).removeEventListener("mousemove",g.handler),g.handler=void 0}),$=ie(()=>{gs(g)});return p.useEffect(()=>V,[V]),p.useEffect(()=>{if(!s)return;function M(k){k.open?E.current=!1:(E.current=k.reason===Nt,V(),g.openChangeTimeout.clear(),g.restTimeout.clear(),g.blockMouseMove=!0,g.restTimeoutPending=!1)}return o.on("openchange",M),()=>{o.off("openchange",M)}},[s,o,g,V]),p.useEffect(()=>{if(!s)return;const M=f.current??(h?n.select("domReferenceElement"):null);if(!je(M))return;function k(P){if(g.openChangeTimeout.clear(),g.blockMouseMove=!1,c&&!uo(g.pointerType))return;const R=pu(b.current),D=ea(S.current,"open",g.pointerType),j=ut(P),W=P.currentTarget??null,Z=n.select("domReferenceElement");let U=W;if(je(j)&&!n.context.triggerElements.hasElement(j)){for(const Y of n.context.triggerElements.elements())if(we(Y,j)){U=Y;break}}je(W)&&je(Z)&&!n.context.triggerElements.hasElement(W)&&we(W,Z)&&(U=Z);const G=U==null?!1:A(Z,U,j),B=n.select("open"),X=T.current?.()??n.select("transitionStatus")==="ending",K=!B&&X&&E.current,J=!G&&je(U)&&je(Z)&&we(Z,U)&&K,se=R>0&&!D,ae=G&&(B||K)||J,pe=!B||G;if(ae){n.setOpen(!0,De(Nt,P,U));return}se||(D?g.openChangeTimeout.start(D,()=>{pe&&n.setOpen(!0,De(Nt,P,U))}):pe&&n.setOpen(!0,De(Nt,P,U)))}function O(P){if(I()){$();return}V();const R=n.select("domReferenceElement"),D=Oe(R);g.restTimeout.clear(),g.restTimeoutPending=!1;const j=r.current.floatingContext??m?.();if(z(P.relatedTarget))return;if(C.current&&j){n.select("open")||g.openChangeTimeout.clear();const U=f.current;g.handler=C.current({...j,tree:v,x:P.clientX,y:P.clientY,onClose(){$(),V(),x.current&&!I()&&U===n.select("domReferenceElement")&&F(P,!0)}}),D.addEventListener("mousemove",g.handler),g.handler(P);return}(g.pointerType!=="touch"||!we(n.select("floatingElement"),P.relatedTarget))&&F(P)}return u?gn(Le(M,"mousemove",k,{once:!0}),Le(M,"mouseenter",k),Le(M,"mouseleave",O)):gn(Le(M,"mouseenter",k),Le(M,"mouseleave",O))},[V,$,r,S,F,n,s,C,g,h,A,I,z,c,u,b,f,v,x,m,T]),p.useMemo(()=>{if(!s)return;function M(k){g.pointerType=k.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(k){const{nativeEvent:O}=k,P=k.currentTarget,R=n.select("domReferenceElement"),D=n.select("open"),j=A(R,P,k.target);if(c&&!uo(g.pointerType))return;if(D&&j&&g.handleCloseOptions?.blockPointerEvents){const U=n.select("floatingElement");if(U){const G=g.handleCloseOptions?.getScope?.()??P.ownerDocument.body;ef(g,{scopeElement:G,referenceElement:P,floatingElement:U})}}const W=pu(b.current);if(D&&!j||W===0||!j&&g.restTimeoutPending&&k.movementX**2+k.movementY**2<2)return;g.restTimeout.clear();function Z(){if(g.restTimeoutPending=!1,I())return;const U=n.select("open");!g.blockMouseMove&&(!U||j)&&n.setOpen(!0,De(Nt,O,P))}g.pointerType==="touch"?Kt.flushSync(()=>{Z()}):j&&D?Z():(g.restTimeoutPending=!0,g.restTimeout.start(W,Z))}}},[s,g,I,A,c,n,b])}function vo(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),r=e.map(l=>l?.item),o=e.map(l=>l?.trigger),s=p.useCallback(l=>ys(l,e,"reference"),t),i=p.useCallback(l=>ys(l,e,"floating"),n),a=p.useCallback(l=>ys(l,e,"item"),r),c=p.useCallback(l=>ys(l,e,"trigger"),o);return p.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function ys(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Di]="");for(const i in e)o&&e&&(i===Il||i===Ol)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&nf(s,a,o,r)}return nf(s,e,o,r),s}function nf(e,t,n,r){for(const o in t){const s=t[o];n&&(o===Il||o===Ol)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...i)=>r.get(o)?.map(a=>a(...i)).find(a=>a!==void 0))):e[o]=s)}}const Vb="Escape";function vs(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function bs(e,t){return vs(t,e===Ni||e===co,e===Un||e===Bn)}function va(e,t,n){return vs(t,e===co,n?e===Un:e===Bn)||e==="Enter"||e===" "||e===""}function jb(e,t,n){return vs(t,n?e===Un:e===Bn,e===co)}function Hb(e,t,n,r){const o=n?e===Bn:e===Un,s=e===Ni;return t==="both"||t==="horizontal"&&r&&r>1?e===Vb:vs(t,o,s)}function Zb(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:a,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:f=null,allowEscape:d=!1,loopFocus:h=!1,nested:m=!1,rtl:y=!1,virtual:v=!1,focusItemOnOpen:g="auto",focusItemOnHover:E=!0,openOnArrowKeyDown:C=!0,disabledIndices:S=void 0,orientation:b="vertical",parentOrientation:x,cols:T=1,id:I,resetOnPointerLeave:z=!0,externalTree:A}=t,F=lo(o),V=vt(F),$=qn(),M=lr(A);he(()=>{i.current.orientation=b},[i,b]);const k=Li(s),O=p.useRef(g),P=p.useRef(f??-1),R=p.useRef(null),D=p.useRef(!0),j=ie(_=>{l(P.current===-1?null:P.current,_)}),W=p.useRef(j),Z=p.useRef(!!o),U=p.useRef(r),G=p.useRef(!1),B=p.useRef(!1),X=p.useRef(null),K=vt(S),J=vt(r),se=vt(f),ae=vt(z),pe=ie(()=>{function _(Q){v?M?.events.emit("virtualfocus",Q):X.current=cs(Q,{sync:G.current,preventScroll:!0})}const H=a.current[P.current],N=B.current;H&&_(H),(G.current?Q=>Q():requestAnimationFrame)(()=>{const Q=a.current[P.current]||H;if(!Q)return;H||_(Q),ye&&(N||!D.current)&&Q.scrollIntoView?.({block:"nearest",inline:"nearest"})})});he(()=>{u&&(r&&o?(P.current=f??-1,O.current&&f!=null&&(B.current=!0,j())):Z.current&&(P.current=-1,W.current()))},[u,r,o,f,j]),he(()=>{if(u){if(!r){G.current=!1;return}if(o)if(c==null){if(G.current=!1,se.current!=null)return;if(Z.current&&(P.current=-1,pe()),(!U.current||!Z.current)&&O.current&&(R.current!=null||O.current===!0&&R.current==null)){let _=0;const H=()=>{a.current[0]==null?(_<2&&(_?requestAnimationFrame:queueMicrotask)(H),_+=1):(P.current=R.current==null||va(R.current,b,y)||m?Wi(a):$l(a),R.current=null,j())};H()}}else Jo(a.current,c)||(P.current=c,pe(),B.current=!1)}},[u,r,o,c,se,m,a,b,y,j,pe,K]),he(()=>{if(!u||o||!M||v||!Z.current)return;const _=M.nodesRef.current,H=_.find(Q=>Q.id===$)?.context?.elements.floating,N=kt(Oe(o)),L=_.some(Q=>Q.context&&we(Q.context.elements.floating,N));H&&!L&&D.current&&H.focus({preventScroll:!0})},[u,o,M,$,v]),he(()=>{W.current=j,U.current=r,Z.current=!!o}),he(()=>{r||(R.current=null,O.current=g)},[r,g]);const Y=c!=null,me=ie(_=>{if(!J.current)return;const H=a.current.indexOf(_.currentTarget);H!==-1&&(P.current!==H||c!==H)&&(P.current=H,j(_))}),ye=p.useMemo(()=>({onFocus(H){G.current=!0,me(H)},onClick:({currentTarget:H})=>H.focus({preventScroll:!0}),onMouseMove(H){G.current=!0,B.current=!1,E&&me(H)},onPointerLeave(H){if(!J.current||!D.current||H.pointerType==="touch")return;G.current=!0;const N=H.relatedTarget;if(!(!E||a.current.includes(N))&&ae.current&&(X.current?.(),X.current=null,P.current=-1,j(H),!v)){const L=V.current,Q=kt(Oe(L));L&&we(L,Q)&&L.focus({preventScroll:!0})}}}),[me,J,V,E,a,j,ae,v]),de=p.useCallback(()=>x??M?.nodesRef.current.find(_=>_.id===$)?.context?.dataRef?.current.orientation,[$,M,x]),ue=ie(_=>{if(D.current=!1,G.current=!0,_.which===229||!J.current&&_.currentTarget===V.current)return;if(m&&Hb(_.key,b,y,T)){bs(_.key,de())||Yt(_),n.setOpen(!1,De(ra,_.nativeEvent)),it(s)&&(v?M?.events.emit("virtualfocus",s):s.focus());return}const H=P.current,N=Wi(a,S),L=$l(a,S);if(k||(_.key==="Home"&&(Yt(_),P.current=N,j(_)),_.key==="End"&&(Yt(_),P.current=L,j(_))),T>1){const Q=Array.from({length:a.current.length},()=>({width:1,height:1})),ne=Tv(Q,T),te=ne.findIndex(xe=>xe!=null&&!Mr(a.current,xe,S)),ge=ne.reduce((xe,Ce,ke)=>Ce!=null&&!Mr(a.current,Ce,S)?ke:xe,-1),Ie=ne[Pv(ne.map(xe=>xe!=null?a.current[xe]:null),{event:_,orientation:b,loopFocus:h,rtl:y,cols:T,disabledIndices:Iv([...(typeof S!="function"?S:null)||a.current.map((xe,Ce)=>Mr(a.current,Ce,S)?Ce:void 0),void 0],ne),minIndex:te,maxIndex:ge,prevIndex:kv(P.current>L?N:P.current,Q,ne,T,_.key===co?"bl":_.key===(y?Un:Bn)?"tr":"tl"),stopEvent:!0})];if(Ie!=null&&(P.current=Ie,j(_)),b==="both")return}if(bs(_.key,b)){if(Yt(_),r&&!v&&kt(_.currentTarget.ownerDocument)===_.currentTarget){P.current=va(_.key,b,y)?N:L,j(_);return}va(_.key,b,y)?h?H>=L?d&&H!==a.current.length?P.current=-1:(G.current=!1,P.current=N):P.current=Dt(a.current,{startingIndex:H,disabledIndices:S}):P.current=Math.min(L,Dt(a.current,{startingIndex:H,disabledIndices:S})):h?H<=N?d&&H!==-1?P.current=a.current.length:(G.current=!1,P.current=L):P.current=Dt(a.current,{startingIndex:H,decrement:!0,disabledIndices:S}):P.current=Math.max(N,Dt(a.current,{startingIndex:H,decrement:!0,disabledIndices:S})),Jo(a.current,P.current)&&(P.current=-1),j(_)}}),ce=p.useMemo(()=>v&&r&&Y&&{"aria-activedescendant":`${I}-${c}`},[v,r,Y,I,c]),ve=p.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,...k?{}:ce,onKeyDown(_){if(_.key==="Tab"&&_.shiftKey&&r&&!v){const H=ut(_.nativeEvent);if(H&&!we(V.current,H))return;Yt(_),n.setOpen(!1,De(cr,_.nativeEvent)),it(s)&&s.focus();return}ue(_)},onPointerMove(){D.current=!0}}),[ce,ue,V,b,k,n,r,v,s]),le=p.useMemo(()=>{function _(N){g==="auto"&&Al(N.nativeEvent)&&(O.current=!v)}function H(N){O.current=g,g==="auto"&&Dl(N.nativeEvent)&&(O.current=!0)}return{onKeyDown(N){const L=n.select("open");D.current=!1;const Q=N.key.startsWith("Arrow"),ne=jb(N.key,de(),y),te=bs(N.key,b),ge=(m?ne:te)||N.key==="Enter"||N.key.trim()==="";if(v&&L)return ue(N);if(!(!L&&!C&&Q)){if(ge){const Ie=bs(N.key,de());R.current=m&&Ie?null:N.key}if(m){ne&&(Yt(N),L?(P.current=Wi(a,K.current),j(N)):n.setOpen(!0,De(ra,N.nativeEvent,N.currentTarget)));return}te&&(se.current!=null&&(P.current=se.current),Yt(N),!L&&C?n.setOpen(!0,De(ra,N.nativeEvent,N.currentTarget)):ue(N),L&&j(N))}},onFocus(N){n.select("open")&&!v&&(P.current=-1,j(N))},onPointerDown:H,onPointerEnter:H,onMouseDown:_,onClick:_}},[ue,K,g,a,m,j,n,C,b,de,y,se,v]),Se=p.useMemo(()=>({...ce,...le}),[ce,le]);return p.useMemo(()=>u?{reference:Se,floating:ve,item:ye,trigger:le}:{},[u,Se,ve,le,ye])}const Wb=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function rf(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{role:a="dialog"}=t,c=Xn(),l=s?.id||c,u=p.useMemo(()=>lo(i)?.id||o,[i,o]),f=Wb.get(a)??a,h=qn()!=null,m=p.useMemo(()=>f==="tooltip"||a==="label"?mt:{"aria-haspopup":f==="alertdialog"?"dialog":f,"aria-expanded":"false",...f==="listbox"&&{role:"combobox"},...f==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[f,h,a]),y=p.useMemo(()=>f==="tooltip"||a==="label"?{[`aria-${a==="label"?"labelledby":"describedby"}`]:r?u:void 0}:{...m,"aria-expanded":r?"true":"false","aria-controls":r?u:void 0,...f==="menu"&&{id:l}},[f,u,r,l,a,m]),v=p.useMemo(()=>{const E={id:u,...f&&{role:f}};return f==="tooltip"||a==="label"?E:{...E,...f==="menu"&&{"aria-labelledby":l}}},[f,u,l,a]),g=p.useCallback(({active:E,selected:C})=>{const S={role:"option",...E&&{id:`${u}-fui-option`}};switch(a){case"select":case"combobox":return{...S,"aria-selected":C}}return{}},[u,a]);return p.useMemo(()=>({reference:y,floating:v,item:g,trigger:m}),[y,v,m,g])}function Ub(e,t){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,o=n.useState("open"),{listRef:s,elementsRef:i,activeIndex:a,onMatch:c,onTypingChange:l,enabled:u=!0,resetMs:f=750,selectedIndex:d=null}=t,h=Gt(),m=p.useRef(""),y=p.useRef(d??a??-1),v=p.useRef(null);he(()=>{!o&&d!==null||(h.clear(),v.current=null,m.current!==""&&(m.current=""))},[o,d,h]),he(()=>{o&&m.current===""&&(y.current=d??a??-1)},[o,d,a]);const g=ie(x=>{x?r.current.typing||(r.current.typing=x,l?.(x)):r.current.typing&&(r.current.typing=x,l?.(x))}),E=ie(x=>{function T(k){const O=i?.current[k];return!O||Qo(O)}function I(k,O,P=0){if(k.length===0)return-1;const R=(P%k.length+k.length)%k.length,D=O.toLocaleLowerCase();for(let j=0;j<k.length;j+=1){const W=(R+j)%k.length;if(!(!k[W]?.toLocaleLowerCase().startsWith(D)||!T(W)))return W}return-1}const z=s.current;if(m.current.length>0&&x.key===" "&&(Yt(x),g(!0)),m.current.length>0&&m.current[0]!==" "&&I(z,m.current)===-1&&x.key!==" "&&g(!1),z==null||x.key.length!==1||x.ctrlKey||x.metaKey||x.altKey)return;o&&x.key!==" "&&(Yt(x),g(!0));const A=m.current==="";A&&(y.current=d??a??-1),z.every(k=>k?k[0]?.toLocaleLowerCase()!==k[1]?.toLocaleLowerCase():!0)&&m.current===x.key&&(m.current="",y.current=v.current),m.current+=x.key,h.start(f,()=>{m.current="",y.current=v.current,g(!1)});const $=((A?d??a??-1:y.current)??0)+1,M=I(z,m.current,$);M!==-1?(c?.(M),v.current=M):x.key!==" "&&(m.current="",g(!1))}),C=ie(x=>{const T=x.relatedTarget,I=n.select("domReferenceElement"),z=n.select("floatingElement"),A=we(I,T),F=we(z,T);A||F||(h.clear(),m.current="",y.current=v.current,g(!1))}),S=p.useMemo(()=>({onKeyDown:E,onBlur:C}),[E,C]),b=p.useMemo(()=>({onKeyDown:E,onBlur:C}),[E,C]);return p.useMemo(()=>u?{reference:S,floating:b}:{},[u,S,b])}const of=.1,Bb=of*of,rt=.5;function ws(e,t,n,r,o,s){return r>=t!=s>=t&&e<=(o-n)*(t-r)/(s-r)+n}function Ss(e,t,n,r,o,s,i,a,c,l){let u=!1;return ws(e,t,n,r,o,s)&&(u=!u),ws(e,t,o,s,i,a)&&(u=!u),ws(e,t,i,a,c,l)&&(u=!u),ws(e,t,c,l,n,r)&&(u=!u),u}function Gb(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function xs(e,t,n,r,o,s){const i=Math.min(n,o),a=Math.max(n,o),c=Math.min(r,s),l=Math.max(r,s);return e>=i&&e<=a&&t>=c&&t<=l}function Yb(e={}){const{blockPointerEvents:t=!1}=e,n=new Bt,r=({x:o,y:s,placement:i,elements:a,onClose:c,nodeId:l,tree:u})=>{const f=i?.split("-")[0];let d=!1,h=null,m=null,y=typeof performance<"u"?performance.now():0;function v(E,C){const S=performance.now(),b=S-y;if(h===null||m===null||b===0)return h=E,m=C,y=S,!1;const x=E-h,T=C-m,I=x*x+T*T,z=b*b*Bb;return h=E,m=C,y=S,I<z}function g(){n.clear(),c()}return function(C){n.clear();const S=a.domReference,b=a.floating;if(!S||!b||f==null||o==null||s==null)return;const{clientX:x,clientY:T}=C,I=ut(C),z=C.type==="mouseleave",A=we(b,I),F=we(S,I);if(A&&(d=!0,!z))return;if(F&&(d=!1,!z)){d=!0;return}if(z&&je(C.relatedTarget)&&we(b,C.relatedTarget))return;function V(){return!!(u&&vn(u.nodesRef.current,l).length>0)}function $(){V()||g()}if(V())return;const M=S.getBoundingClientRect(),k=b.getBoundingClientRect(),O=o>k.right-k.width/2,P=s>k.bottom-k.height/2,R=k.width>M.width,D=k.height>M.height,j=(R?M:k).left,W=(R?M:k).right,Z=(D?M:k).top,U=(D?M:k).bottom;if(f==="top"&&s>=M.bottom-1||f==="bottom"&&s<=M.top+1||f==="left"&&o>=M.right-1||f==="right"&&o<=M.left+1){$();return}let G=!1;switch(f){case"top":G=xs(x,T,j,M.top+1,W,k.bottom-1);break;case"bottom":G=xs(x,T,j,k.top+1,W,M.bottom-1);break;case"left":G=xs(x,T,k.right-1,U,M.left+1,Z);break;case"right":G=xs(x,T,M.right-1,U,k.left+1,Z);break}if(G)return;if(d&&!Gb(x,T,M)){$();return}if(!z&&v(x,T)){$();return}let B=!1;switch(f){case"top":{const X=R?rt/2:rt*4,K=R||O?o+X:o-X,J=R?o-X:O?o+X:o-X,se=s+rt+1,ae=O||R?k.bottom-rt:k.top,pe=O?R?k.bottom-rt:k.top:k.bottom-rt;B=Ss(x,T,K,se,J,se,k.left,ae,k.right,pe);break}case"bottom":{const X=R?rt/2:rt*4,K=R||O?o+X:o-X,J=R?o-X:O?o+X:o-X,se=s-rt,ae=O||R?k.top+rt:k.bottom,pe=O?R?k.top+rt:k.bottom:k.top+rt;B=Ss(x,T,K,se,J,se,k.left,ae,k.right,pe);break}case"left":{const X=D?rt/2:rt*4,K=D||P?s+X:s-X,J=D?s-X:P?s+X:s-X,se=o+rt+1,ae=P||D?k.right-rt:k.left,pe=P?D?k.right-rt:k.left:k.right-rt;B=Ss(x,T,ae,k.top,pe,k.bottom,se,K,se,J);break}case"right":{const X=D?rt/2:rt*4,K=D||P?s+X:s-X,J=D?s-X:P?s+X:s-X,se=o-rt,ae=P||D?k.left+rt:k.right,pe=P?D?k.left+rt:k.right:k.left+rt;B=Ss(x,T,se,K,se,J,ae,k.top,pe,k.bottom);break}}B?d||n.start(40,$):$()}};return r.__options={...e,blockPointerEvents:t},r}const Xb=p.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,style:a,...c}=t,{portalNode:l,portalSubtree:u}=Cu({container:o,ref:n,componentProps:t,elementProps:c});return!u&&!l?null:w.jsxs(p.Fragment,{children:[u,l&&Kt.createPortal(r,l)]})}),qb=p.createContext(void 0);function sf(){return p.useContext(qb)?.direction??"ltr"}const Kb=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:f="real"}=Mn(e,t)||{};if(l==null)return{};const d=zl(u),h={x:n,y:r},m=Hi(o),y=ji(m),v=await i.getDimensions(l),g=m==="y",E=g?"top":"left",C=g?"bottom":"right",S=g?"clientHeight":"clientWidth",b=s.reference[y]+s.reference[m]-h[m]-s.floating[y],x=h[m]-s.reference[m],T=f==="real"?await i.getOffsetParent?.(l):a.floating;let I=a.floating[S]||s.floating[y];(!I||!await i.isElement?.(T))&&(I=a.floating[S]||s.floating[y]);const z=b/2-x/2,A=I/2-v[y]/2-1,F=Math.min(d[E],A),V=Math.min(d[C],A),$=F,M=I-v[y]-V,k=I/2-v[y]/2+z,O=$i($,k,M),P=!c.arrow&&Gn(o)!=null&&k!==O&&s.reference[y]/2-(k<$?F:V)-v[y]/2<0,R=P?k<$?k-$:k-M:0;return{[m]:h[m]+R,data:{[m]:O,centerOffset:k-O-R,...P&&{alignmentOffset:R}},reset:P}}}),Jb=(e,t)=>({...Kb(e),options:[e,t]}),Qb={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await Mb().fn(e)).data?.referenceHidden||s}}}},Es={sideX:"left",sideY:"top"},ew={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:s,strategy:i,placement:a}=e,c=tt(o),l=c.getComputedStyle(o);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:Es};const f=await s.getOffsetParent?.(o);let d={width:0,height:0};if(i==="fixed"&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const E=Oe(o);d={width:E.documentElement.clientWidth,height:E.documentElement.clientHeight}}else await s.isElement?.(f)&&(d=await s.getDimensions(f));const h=jt(a);let m=t,y=n;h==="left"&&(m=d.width-(t+r.width)),h==="top"&&(y=d.height-(n+r.height));const v=h==="left"?"right":Es.sideX,g=h==="top"?"bottom":Es.sideY;return{x:m,y,data:{sideX:v,sideY:g}}}};function af(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function cf(e,t,n){const{rects:r,placement:o}=e;return{side:af(t,jt(o),n),align:Gn(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function lf(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:d=!1,floatingRootContext:h,mounted:m,collisionAvoidance:y,shiftCrossAxis:v=!1,nodeId:g,adaptiveOrigin:E,lazyFlip:C=!1,externalTree:S}=e,[b,x]=p.useState(null);!m&&b!==null&&x(null);const T=y.side||"flip",I=y.align||"flip",z=y.fallbackAxisSide||"end",A=typeof t=="function"?t:void 0,F=ie(A),V=A?F:t,$=vt(t),M=vt(m),O=sf()==="rtl",P=b||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":O?"left":"right","inline-start":O?"right":"left"}[r],R=s==="center"?P:`${P}-${s}`;let D=c;const j=1,W=r==="bottom"?j:0,Z=r==="top"?j:0,U=r==="right"?j:0,G=r==="left"?j:0;typeof D=="number"?D={top:D+W,right:D+G,bottom:D+Z,left:D+U}:D&&(D={top:(D.top||0)+W,right:(D.right||0)+G,bottom:(D.bottom||0)+Z,left:(D.left||0)+U});const B={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:D},X=p.useRef(null),K=vt(o),J=vt(i),pe=[kb(Re=>{const Pe=cf(Re,r,O),Ze=typeof K.current=="function"?K.current(Pe):K.current,We=typeof J.current=="function"?J.current(Pe):J.current;return{mainAxis:Ze,crossAxis:We,alignmentAxis:We}},[typeof o!="function"?o:0,typeof i!="function"?i:0,O,r])],Y=I==="none"&&T!=="shift",me=!Y&&(l||v||T==="shift"),ye=T==="none"?null:_b({...B,padding:{top:D.top+j,right:D.right+j,bottom:D.bottom+j,left:D.left+j},mainAxis:!v&&T==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),de=Y?null:Ib(Re=>{const Pe=Oe(Re.elements.floating).documentElement;return{...B,rootBoundary:v?{x:0,y:0,width:Pe.clientWidth,height:Pe.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:me,limiter:l||v?void 0:Ob(Ze=>{if(!X.current)return{};const{width:We,height:ct}=X.current.getBoundingClientRect(),Ye=en(jt(Ze.placement)),Zt=Ye==="y"?We:ct,Vt=Ye==="y"?D.left+D.right:D.top+D.bottom;return{offset:Zt/2+Vt/2}})}},[B,l,v,D,I]);T==="shift"||I==="shift"||s==="center"?pe.push(de,ye):pe.push(ye,de),pe.push(Rb({...B,apply({elements:{floating:Re},availableWidth:Pe,availableHeight:Ze,rects:We}){if(!M.current)return;const ct=Re.style;ct.setProperty("--available-width",`${Pe}px`),ct.setProperty("--available-height",`${Ze}px`);const Ye=tt(Re).devicePixelRatio||1,{x:Zt,y:Vt,width:Ke,height:q}=We.reference,oe=(Math.round((Zt+Ke)*Ye)-Math.round(Zt*Ye))/Ye,be=(Math.round((Vt+q)*Ye)-Math.round(Vt*Ye))/Ye;ct.setProperty("--anchor-width",`${oe}px`),ct.setProperty("--anchor-height",`${be}px`)}}),Jb(()=>({element:X.current||Oe(X.current).createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(Re){const{elements:Pe,middlewareData:Ze,placement:We,rects:ct,y:Ye}=Re,Zt=jt(We),Vt=en(Zt),Ke=X.current,q=Ze.arrow?.x||0,oe=Ze.arrow?.y||0,be=Ke?.clientWidth||0,Fe=Ke?.clientHeight||0,Ve=q+be/2,Ne=oe+Fe/2,Qe=Math.abs(Ze.shift?.y||0),Te=ct.reference.height/2,Ee=typeof o=="function"?o(cf(Re,r,O)):o,Me=Qe>Ee,Ae={top:`${Ve}px calc(100% + ${Ee}px)`,bottom:`${Ve}px ${-Ee}px`,left:`calc(100% + ${Ee}px) ${Ne}px`,right:`${-Ee}px ${Ne}px`}[Zt],Xe=`${Ve}px ${ct.reference.y+Te-Ye}px`;return Pe.floating.style.setProperty("--transform-origin",me&&Vt==="y"&&Me?Xe:Ae),{}}},Qb,E),he(()=>{!m&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,h]);const ue=p.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:ce,elements:ve,x:le,y:Se,middlewareData:_,update:H,placement:N,context:L,isPositioned:Q,floatingStyles:ne}=Fb({rootContext:h,open:d?m:void 0,placement:R,middleware:pe,strategy:n,whileElementsMounted:d?void 0:(...Re)=>Wu(...Re,ue),nodeId:g,externalTree:S}),{sideX:te,sideY:ge}=_.adaptiveOrigin||Es,Ie=Q?n:"fixed",xe=p.useMemo(()=>{const Re=E?{position:Ie,[te]:le,[ge]:Se}:{position:Ie,...ne};return Q||(Re.opacity=0),Re},[E,Ie,te,le,ge,Se,ne,Q]),Ce=p.useRef(null);he(()=>{if(!m)return;const Re=$.current,Pe=typeof Re=="function"?Re():Re,We=(uf(Pe)?Pe.current:Pe)||null||null;We!==Ce.current&&(ce.setPositionReference(We),Ce.current=We)},[m,ce,V,$]),p.useEffect(()=>{if(!m)return;const Re=$.current;typeof Re!="function"&&uf(Re)&&Re.current!==Ce.current&&(ce.setPositionReference(Re.current),Ce.current=Re.current)},[m,ce,V,$]),p.useEffect(()=>{if(d&&m&&ve.domReference&&ve.floating)return Wu(ve.domReference,ve.floating,H,ue)},[d,m,ve,H,ue]);const ke=jt(N),ze=af(r,ke,O),Ge=Gn(N)||"center",He=!!_.hide?.referenceHidden;he(()=>{C&&m&&Q&&x(ke)},[C,m,Q,ke]);const nt=p.useMemo(()=>({position:"absolute",top:_.arrow?.y,left:_.arrow?.x}),[_.arrow]),st=_.arrow?.centerOffset!==0;return p.useMemo(()=>({positionerStyles:xe,arrowStyles:nt,arrowRef:X,arrowUncentered:st,side:ze,align:Ge,physicalSide:ke,anchorHidden:He,refs:ce,context:L,isPositioned:Q,update:H}),[xe,nt,X,st,ze,Ge,ke,He,ce,L,Q,H])}function uf(e){return e!=null&&"current"in e}let Ft=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=sr.startingStyle]="startingStyle",e[e.endingStyle=sr.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),ba=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const tw={[ba.popupOpen]:""},nw={[ba.popupOpen]:"",[ba.pressed]:""},rw={[Ft.open]:""},ow={[Ft.closed]:""},sw={[Ft.anchorHidden]:""},ff={open(e){return e?tw:null}},df={open(e){return e?nw:null}},En={open(e){return e?rw:ow},anchorHidden(e){return e?sw:null}};function wa(e){return e==="starting"?a0:mt}function pf(e,t,{styles:n,transitionStatus:r,props:o,refs:s,hidden:i,inert:a=!1}){const c={...n};return a&&(c.pointerEvents="none"),qe("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:c},wa(r),o],stateAttributesMapping:En})}function hf(){const e=p.useContext(wi);if(!e)throw new Error(dt(73));const t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function fr(...e){return bi(tl(e))}const mf={Viewport:"_Viewport_ai81v_1",Toast:"_Toast_ai81v_14"};let Lr=null,bo=3e3;function iw({timeout:e}){const t=hf();return p.useEffect(()=>(Lr=t,bo=e,()=>{Lr=null}),[t,e]),null}const Ct={success:(e,t)=>Lr?.add({description:e,timeout:t?.timeout||bo}),error:(e,t)=>Lr?.add({description:e,timeout:t?.timeout||bo}),info:(e,t)=>Lr?.add({description:e,timeout:t?.timeout||bo}),warning:(e,t)=>Lr?.add({description:e,timeout:t?.timeout||bo})};function aw({toastConfigs:e}){const t=e?.timeout??3e3;return w.jsxs($v,{timeout:t,children:[w.jsx(iw,{timeout:t}),w.jsx(cw,{configs:e})]})}function cw({configs:e}){const{toasts:t}=hf();return w.jsx(Xb,{children:w.jsx(n0,{className:fr(mf.Viewport,e?.viewportClassName),children:t.map(n=>w.jsx(b0,{toast:n,className:fr("pointer-events-none flex items-center justify-center px-6 py-3 min-w-[200px] max-w-[80vw]","text-white text-base rounded-md bg-black/80",mf.Toast,e?.className),style:e?.style,children:w.jsx(x0,{className:"text-xs",children:n.description})},n.id))})})}class lw{baseUrl;credentials;interceptors;timeout;onError;headers;constructor({baseUrl:t,timeout:n=1/0,responseInterceptor:r=c=>c.data,requestInterceptor:o=c=>c,onError:s=()=>{},headers:i,credentials:a="include"}){this.baseUrl=t,this.timeout=n,this.credentials=a,this.interceptors={request:o,response:r},this.headers=new Headers({"Content-Type":"application/json",...i}),this.onError=s}async request(t){const n=new AbortController;t.url=`${this.baseUrl}${t.url}`,t=this.interceptors.request(t);const r=new Headers(this.headers);Object.entries(t.headers||{}).forEach(([a,c])=>{r.set(a,c)});const o=this.headers.get("content-type");let s=null;if(t.data instanceof FormData)s=t.data,r.delete("Content-Type");else if(t.data!==void 0&&t.method!=="GET")if(o==="application/x-www-form-urlencoded"){const a=new URLSearchParams;for(const c in t.data)t.data[c]!==void 0&&a.append(c,t.data[c]);s=a.toString()}else s=JSON.stringify(t.data);else if(t.method==="GET"){const a=new URLSearchParams;for(const l in t.data)t.data[l]!==void 0&&a.append(l,t.data[l]);const c=a.toString();t.url+=c?`?${c}`:""}const i=fetch(t.url,{method:t.method,headers:r,body:s,signal:t.signal||n.signal,credentials:this.credentials});try{const a=t.timeout||this.timeout,{timeoutId:c,timeoutPromise:l}=this._setTimeout(a,n),u=await Promise.race([i,l].filter(Boolean));if(c&&clearTimeout(c),u.ok){const f=await u.json();return this.interceptors.response(f,u).catch(d=>(this.onError({data:d,response:u}),Promise.reject(f)))}else{const f=await u.json();return this.onError({data:f,response:u}),Promise.reject(f)}}catch(a){return a.name!=="AbortError"&&this.onError({}),Promise.reject(a)}}_setTimeout(t,n){let r=null,o=null;return t!==1/0&&(o=new Promise((s,i)=>{r=setTimeout(()=>{i(new Error("请求超时")),n.abort()},t)})),{timeoutPromise:o,timeoutId:r}}get(t,n,r){return this.request({...r,url:t,method:"GET",data:n})}post(t,n,r){return this.request({...r,url:t,method:"POST",data:n})}put(t,n,r){return this.request({...r,url:t,method:"PUT",data:n})}delete(t,n){return this.request({...n,url:t,method:"DELETE"})}patch(t,n,r){return this.request({...r,url:t,method:"PATCH",data:n})}}const It=new lw({baseUrl:"https://apis.sdk.mobileztgame.com",credentials:"omit",headers:{"Content-Type":"application/x-www-form-urlencoded"},async responseInterceptor(e,t){if(["/passport-api/v2/ztgame/auth/login","/passport-api/v2/sms-captchas","/passport-api/v2/ztgame/auth/mobile-register","/passport-api/v2/ztgame/auth/auth","/passport-api/v2/ztgame/auth/re-auth","/passport-api/v2/ztgame/user-center/forget-password/forget-password-keys","/passport-api/v2/ztgame/user-center/forget-password/","/passport-api/v2/ztgame/user-center/forget-password/sms-captchas","/passport-api/v2/ztgame/user-center/forget-password/forget-password-update","/idcard"].some(r=>t.url.includes(r))){const r=t.headers.get("set-authentication")||t.headers.get("Set-Authentication")||"";return{...e,_auth:r}}if(e?.code!==0)throw new Error(e.error);return e},onError({response:e,data:t}){if(e&&e?.status!==401){const n=`${t?.message||t?.detail||"未知错误"}`;Ct.error(n)}}});function gf(e){It.headers.set("Authentication",e)}const at={ROLE_ID:"roleid",GIANT:"giant",MOBILE:"mobile"},Cs={default:{types:[at.GIANT,at.MOBILE],default:at.GIANT},5327:{types:[at.GIANT,at.MOBILE],default:at.MOBILE},5273:{types:[at.ROLE_ID],default:at.ROLE_ID},5199:{types:[at.ROLE_ID],default:at.ROLE_ID},5012:{types:[at.ROLE_ID],default:at.ROLE_ID},5242:{types:[at.GIANT,at.MOBILE],default:at.MOBILE}};function gt(...e){return bi(tl(e))}function uw(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(Number.parseInt(n,16))))}function fw(e){return e==="5199"||e==="5012"}function dw(e){const{entity:t,gaplaySign:n}=e;return uw(`${JSON.stringify(t)}$$${n}`)}function Ps(e,t){return t||Cs[e]?.types||Cs.default?.types||[]}function pw(e,t){return t||Cs[e]?.default||Cs.default?.default}function yf({loginTypes:e,gameId:t}){return Ps(t,e).includes(at.GIANT)}function vf({loginTypes:e,gameId:t}){return Ps(t,e).includes(at.ROLE_ID)}function bf({loginTypes:e,gameId:t}){return Ps(t,e).includes(at.MOBILE)}function wf({gameId:e}){It.headers.set("X-GAME-ID",e),It.headers.set("X-Login-H5","1");const t=localStorage.getItem("UNIQUE_ID");t&&It.headers.set("X-Client-Info",JSON.stringify({sdk_version:"3.0.0",device_udid:t,appunid:t}))}async function hw({gameId:e}){wf({gameId:e});let t=localStorage.getItem("UNIQUE_ID");t||(t=(await(await Gg.load()).get()).visitorId,localStorage.setItem("UNIQUE_ID",t)),It.headers.set("X-Client-Info",JSON.stringify({sdk_version:"3.0.0",device_udid:t,appunid:t}))}const mw=[{code:"86",name:"中国大陆"},{code:"886",name:"台湾地区"},{code:"852",name:"香港特别行政区"},{code:"853",name:"澳门特别行政区"},{code:"1",name:"美国"},{code:"81",name:"日本"},{code:"376",name:"安道尔"},{code:"971",name:"阿拉伯联合酋长国"},{code:"93",name:"阿富汗"},{code:"1268",name:"安提瓜和巴布达"},{code:"1264",name:"安圭拉"},{code:"355",name:"阿尔巴尼亚"},{code:"374",name:"亚美尼亚"},{code:"244",name:"安哥拉"},{code:"54",name:"阿根廷"},{code:"1684",name:"美属萨摩亚"},{code:"43",name:"奥地利"},{code:"61",name:"澳大利亚"},{code:"297",name:"阿鲁巴"},{code:"994",name:"阿塞拜疆"},{code:"387",name:"波斯尼亚和黑塞哥维那"},{code:"1246",name:"巴巴多斯"},{code:"880",name:"孟加拉国"},{code:"32",name:"比利时"},{code:"226",name:"布基纳法索"},{code:"359",name:"保加利亚"},{code:"973",name:"巴林"},{code:"257",name:"布隆迪"},{code:"229",name:"贝宁"},{code:"1441",name:"百慕大群岛"},{code:"673",name:"文莱"},{code:"591",name:"玻利维亚"},{code:"599",name:"荷兰加勒比"},{code:"55",name:"巴西"},{code:"1242",name:"巴哈马"},{code:"975",name:"不丹"},{code:"267",name:"博茨瓦纳"},{code:"375",name:"白俄罗斯"},{code:"501",name:"伯利兹"},{code:"1",name:"加拿大"},{code:"243",name:"刚果民主共和国"},{code:"236",name:"中非共和国"},{code:"242",name:"刚果共和国"},{code:"41",name:"瑞士"},{code:"225",name:"象牙海岸"},{code:"682",name:"库克群岛"},{code:"56",name:"智利"},{code:"237",name:"喀麦隆"},{code:"57",name:"哥伦比亚"},{code:"506",name:"哥斯达黎加"},{code:"53",name:"古巴"},{code:"238",name:"佛得角共和国"},{code:"599",name:"库拉索"},{code:"357",name:"塞浦路斯"},{code:"420",name:"捷克"},{code:"49",name:"德国"},{code:"253",name:"吉布提"},{code:"45",name:"丹麦"},{code:"1767",name:"多米尼加"},{code:"1809",name:"多米尼加共和国"},{code:"213",name:"阿尔及利亚"},{code:"593",name:"厄瓜多尔"},{code:"372",name:"爱沙尼亚"},{code:"20",name:"埃及"},{code:"291",name:"厄立特里亚"},{code:"34",name:"西班牙"},{code:"251",name:"埃塞俄比亚"},{code:"358",name:"芬兰"},{code:"679",name:"斐济"},{code:"691",name:"密克罗尼西亚"},{code:"298",name:"法罗群岛"},{code:"33",name:"法国"},{code:"241",name:"加蓬"},{code:"44",name:"英国"},{code:"1473",name:"格林纳达"},{code:"995",name:"格鲁吉亚"},{code:"594",name:"法属圭亚那"},{code:"233",name:"加纳"},{code:"350",name:"直布罗陀"},{code:"299",name:"格陵兰岛"},{code:"220",name:"冈比亚"},{code:"224",name:"几内亚"},{code:"590",name:"瓜德罗普岛"},{code:"240",name:"赤道几内亚"},{code:"30",name:"希腊"},{code:"502",name:"瓜地马拉"},{code:"1671",name:"关岛"},{code:"245",name:"几内亚比绍共和国"},{code:"592",name:"圭亚那"},{code:"504",name:"洪都拉斯"},{code:"385",name:"克罗地亚"},{code:"509",name:"海地"},{code:"36",name:"匈牙利"},{code:"62",name:"印度尼西亚"},{code:"353",name:"爱尔兰"},{code:"972",name:"以色列"},{code:"91",name:"印度"},{code:"964",name:"伊拉克"},{code:"98",name:"伊朗"},{code:"354",name:"冰岛"},{code:"39",name:"意大利"},{code:"1876",name:"牙买加"},{code:"962",name:"约旦"},{code:"254",name:"肯尼亚"},{code:"996",name:"吉尔吉斯斯坦"},{code:"855",name:"柬埔寨"},{code:"686",name:"基里巴斯"},{code:"269",name:"科摩罗"},{code:"1869",name:"圣基茨和尼维斯"},{code:"850",name:"朝鲜"},{code:"82",name:"韩国"},{code:"965",name:"科威特"},{code:"1345",name:"开曼群岛"},{code:"7",name:"哈萨克斯坦"},{code:"856",name:"老挝"},{code:"961",name:"黎巴嫩"},{code:"1758",name:"圣露西亚"},{code:"423",name:"列支敦士登"},{code:"94",name:"斯里兰卡"},{code:"231",name:"利比里亚"},{code:"266",name:"莱索托"},{code:"370",name:"立陶宛"},{code:"352",name:"卢森堡"},{code:"371",name:"拉脱维亚"},{code:"218",name:"利比亚"},{code:"212",name:"摩洛哥"},{code:"377",name:"摩纳哥"},{code:"373",name:"摩尔多瓦"},{code:"382",name:"黑山"},{code:"261",name:"马达加斯加"},{code:"692",name:"马绍尔群岛"},{code:"389",name:"北马其顿"},{code:"223",name:"马里"},{code:"95",name:"缅甸"},{code:"976",name:"蒙古"},{code:"222",name:"毛里塔尼亚"},{code:"1664",name:"蒙特塞拉特岛"},{code:"356",name:"马耳他"},{code:"230",name:"毛里求斯"},{code:"960",name:"马尔代夫"},{code:"265",name:"马拉维"},{code:"52",name:"墨西哥"},{code:"60",name:"马来西亚"},{code:"258",name:"莫桑比克"},{code:"264",name:"纳米比亚"},{code:"687",name:"新喀里多尼亚"},{code:"227",name:"尼日尔"},{code:"234",name:"尼日利亚"},{code:"505",name:"尼加拉瓜"},{code:"31",name:"荷兰"},{code:"47",name:"挪威"},{code:"977",name:"尼泊尔"},{code:"674",name:"拿鲁岛"},{code:"64",name:"新西兰"},{code:"968",name:"阿曼"},{code:"507",name:"巴拿马"},{code:"51",name:"秘鲁"},{code:"689",name:"法属波利尼西亚"},{code:"675",name:"巴布亚新几内亚"},{code:"63",name:"菲律宾"},{code:"92",name:"巴基斯坦"},{code:"48",name:"波兰"},{code:"508",name:"圣彼埃尔和密克隆岛"},{code:"1787",name:"波多黎各"},{code:"351",name:"葡萄牙"},{code:"680",name:"帕劳"},{code:"595",name:"巴拉圭"},{code:"974",name:"卡塔尔"},{code:"262",name:"留尼汪"},{code:"40",name:"罗马尼亚"},{code:"381",name:"塞尔维亚"},{code:"7",name:"俄罗斯"},{code:"250",name:"卢旺达"},{code:"966",name:"沙特阿拉伯"},{code:"677",name:"所罗门群岛"},{code:"248",name:"塞舌尔"},{code:"249",name:"苏丹"},{code:"46",name:"瑞典"},{code:"65",name:"新加坡"},{code:"386",name:"斯洛文尼亚"},{code:"421",name:"斯洛伐克"},{code:"232",name:"塞拉利昂"},{code:"378",name:"圣马力诺"},{code:"221",name:"塞内加尔"},{code:"252",name:"索马里"},{code:"597",name:"苏里南"},{code:"239",name:"圣多美和普林西比"},{code:"503",name:"萨尔瓦多"},{code:"963",name:"叙利亚"},{code:"268",name:"埃斯瓦蒂尼"},{code:"1649",name:"特克斯和凯科斯群岛"},{code:"235",name:"乍得"},{code:"228",name:"多哥"},{code:"66",name:"泰国"},{code:"992",name:"塔吉克斯坦"},{code:"670",name:"东帝汶"},{code:"993",name:"土库曼斯坦"},{code:"216",name:"突尼斯"},{code:"676",name:"汤加"},{code:"90",name:"土耳其"},{code:"1868",name:"特立尼达和多巴哥"},{code:"255",name:"坦桑尼亚"},{code:"380",name:"乌克兰"},{code:"256",name:"乌干达"},{code:"598",name:"乌拉圭"},{code:"998",name:"乌兹别克斯坦"},{code:"1784",name:"圣文森特和格林纳丁斯"},{code:"58",name:"委内瑞拉"},{code:"1284",name:"英属处女群岛"},{code:"84",name:"越南"},{code:"678",name:"瓦努阿图"},{code:"685",name:"萨摩亚"},{code:"967",name:"也门"},{code:"269",name:"马约特"},{code:"27",name:"南非"},{code:"260",name:"赞比亚"},{code:"263",name:"津巴布韦"}].map(e=>({label:e.name,value:e.code,id:`${e.code}-${e.name}`}));function gw(e){return mw}function yw(e){return"account"in e}function vw({gameId:e,serverUserInfo:t,extraState:n}){const r={game_id:e,xToken:dw(t),saveTime:t.entity.time,$version:"v2",extraState:n};if(yw(t))r.openid=t.entity.openid,r.gaplaySign=t.gaplaySign,r.account=t.account,r.username=t.account.view_name,r.loginByRoleMail=!1,r.channelId=t.channel||6;else if(t.gaplaySign){const{ZONEID:o,openid:s,CHARID:i,NAME:a,REALZONEID:c,ZONENAME:l}=t.entity;r.openid=s,r.zone={zoneid:c||o,zonename:l,area:o},r.char={...t.entity,CHARID:i,NAME:a,GAMEPOINT:t.entity.GAMEPOINT,VIPLEVEL:t.entity.VIPLEVEL},r.loginByRoleMail=!0,r.gaplaySign=t.gaplaySign}else{const{ZONEID:o,CHARID:s,NAME:i,REALZONEID:a,ZONENAME:c,OPENID:l,CHANNELID:u,GAMEPOINT:f,VIPLEVEL:d}=t.entity;r.openid=l,r.channelId=u,r.char={CHARID:s,NAME:i,GAMEPOINT:f,VIPLEVEL:d},r.loginByRoleMail=!1,r.username=i,r.zone={zoneid:a||o,zonename:c,area:o},r.xToken=void 0}return r}function Sf(){try{const e=localStorage.getItem("userInfo")||"[]";return JSON.parse(e)}catch{return[]}}function Sa(e){return Sf().find(n=>n.game_id===e)}function bw(e){const t=localStorage.getItem("userInfo")||"[]",n=JSON.parse(t),r=n.find(s=>s.game_id===e);r?.openid&&xf(r.openid,e);const o=n.filter(s=>s.game_id!==e);localStorage.setItem("userInfo",JSON.stringify(o))}function ww(e){const t=Sf(),n=Sa(e.game_id),r=t.findIndex(o=>o.game_id===e.game_id);n?t[r]=e:t.push(e),localStorage.setItem("userInfo",JSON.stringify(t))}const wo="LOGIN_SDK_ACCOUNTS";function zr(e){try{const t=JSON.parse(localStorage.getItem(wo)||"[]");return e?t.filter(n=>n.gameId===e):t}catch{return[]}}function Ts(e,t,n){if(!n)return;const r=JSON.parse(localStorage.getItem(wo)||"[]");let o=1;const s=r.filter(c=>c.openid===e.accid&&c.gameId===n?(o=(c.loginCnt||1)+1,!1):!0),a=[{openid:e.accid,username:e.account?.view_name||"",uid:e.account?.uid||"",mobile:e.account?.mobile||"",accountType:e.account?.account_type||0,authorization:t,loginAt:Date.now(),loginCnt:o,gameId:n},...s].slice(0,20);localStorage.setItem(wo,JSON.stringify(a))}function xf(e,t){if(!t)return;const r=JSON.parse(localStorage.getItem(wo)||"[]").filter(o=>!(o.openid===e&&o.gameId===t));localStorage.setItem(wo,JSON.stringify(r))}let Ef={};function Cf(e){Ef=e}function dr(e){const t=e||Ef.gameId;if(!t)throw new Error("gameId is required. Call init({ gameId }) first or pass it as an argument.");return t}const Pf=re.createContext(void 0),Sw={enabled:!0,days:7},Tf={"--primary-color":"#787bf4","--icon-color":"#a9aad1","--input-border-color":"#cad0e0","--input-label-color":"var(--jssdk-primary-color)","--input-bg-color":"#fff","--backdrop-bg-color":"rgba(0, 0, 0, 0.7)"};function Nn(){const e=re.use(Pf);if(!e)throw new Error("useConfig 必须在 ConfigProvider 中使用");return e}function kf({children:e,value:t}){const n=dr(t.gameId),r=Ps(n,t.loginTypes),o=pw(n,t.defaultLoginType),s=re.useRef(null);wf({gameId:n});const i=re.useMemo(()=>!t.defaultLoginType&&zr(n).length>0?"quick":o,[t.defaultLoginType,n,o]),[a,c]=re.useState(i),[l,u]=re.useState(!0),[f,d]=re.useState(!1),[h,m]=re.useState(!1),[y,v]=re.useState(""),g=()=>{d(!0)};re.useEffect(()=>{hw({gameId:n})},[n]);const E={...t,gameId:n,loginTypes:r,defaultLoginType:o,autoLoginConfig:{...Sw,...t.autoLoginConfig}};re.useEffect(()=>{document.body.classList.add(`game-${n}`)},[n]);function C(S){Object.entries(S).forEach(([b,x])=>{const T=`--jssdk-${b.replace(/^--/,"")}`;document.documentElement.style.setProperty(T,x)})}return re.useEffect(()=>{const S=s.current;if(S){const b={...Tf,...t.styleVars};C(b)}return()=>{S&&C(Tf)}},[t.styleVars]),w.jsx("div",{ref:s,children:w.jsx(Pf,{value:{...E,currentLoginType:a,setCurrentLoginType:c,isShowGiantLogo:l,setIsShowGiantLogo:u,showRealNameModal:f,setShowRealNameModal:d,triggerRealNameAuth:g,isAutoLoggingIn:h,setIsAutoLoggingIn:m,autoLoginAccountName:y,setAutoLoginAccountName:v,onClose:t.onClose},children:e})})}function So({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=p.useRef(e!==void 0),[s,i]=p.useState(t),a=o?e:s,c=p.useCallback(l=>{o||i(l)},[]);return[a,c]}const If=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function xw(){return p.useContext(If)}function Ew(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=ie(o),i=p.useRef(0),a=wt(Pw).current,c=wt(Cw).current,[l,u]=p.useState(0),f=p.useRef(l),d=ie((g,E)=>{c.set(g,E??null),f.current+=1,u(f.current)}),h=ie(g=>{c.delete(g),f.current+=1,u(f.current)}),m=p.useMemo(()=>{const g=new Map;return Array.from(c.keys()).filter(C=>C.isConnected).sort(Tw).forEach((C,S)=>{const b=c.get(C)??{};g.set(C,{...b,index:S})}),g},[c,l]);he(()=>{if(typeof MutationObserver!="function"||m.size===0)return;const g=new MutationObserver(E=>{const C=new Set,S=b=>C.has(b)?C.delete(b):C.add(b);E.forEach(b=>{b.removedNodes.forEach(S),b.addedNodes.forEach(S)}),C.size===0&&(f.current+=1,u(f.current))});return m.forEach((E,C)=>{C.parentElement&&g.observe(C.parentElement,{childList:!0})}),()=>{g.disconnect()}},[m]),he(()=>{f.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),i.current=m.size),s(m)},[s,m,n,r,l]),he(()=>()=>{n.current=[]},[n]),he(()=>()=>{r&&(r.current=[])},[r]);const y=ie(g=>(a.add(g),()=>{a.delete(g)}));he(()=>{a.forEach(g=>g(m))},[a,m]);const v=p.useMemo(()=>({register:d,unregister:h,subscribeMapChange:y,elementsRef:n,labelsRef:r,nextIndexRef:i}),[d,h,y,n,r,i]);return w.jsx(If.Provider,{value:v,children:t})}function Cw(){return new Map}function Pw(){return new Set}function Tw(e,t){const 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}function qt(e){return Xn(e,"base-ui")}let Of=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function kw(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:s}=e,{register:i,unregister:a,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:f}=xw(),d=p.useRef(-1),[h,m]=p.useState(s??(o===Of.GuessFromOrder?()=>{if(d.current===-1){const g=f.current;f.current+=1,d.current=g}return d.current}:-1)),y=p.useRef(null),v=p.useCallback(g=>{if(y.current=g,h!==-1&&g!==null&&(l.current[h]=g,u)){const E=t!==void 0;u.current[h]=E?t:r?.current?.textContent??g.textContent}},[h,l,u,t,r]);return he(()=>{if(s!=null)return;const g=y.current;if(g)return i(g,n),()=>{a(g)}},[s,i,a,n]),he(()=>{if(s==null)return c(g=>{const E=y.current?g.get(y.current)?.index:null;E!=null&&m(E)})},[s,c,m]),p.useMemo(()=>({ref:v,index:h}),[h,v])}const _f="ArrowUp",Rf="ArrowDown",Mf="ArrowLeft",Af="ArrowRight",Df="Home",Nf="End",Iw=new Set([Mf,Af]),Ow=new Set([_f,Rf]),_w=new Set([...Iw,...Ow]);[..._w];const ks=new Set([_f,Rf,Mf,Af,Df,Nf]);function xa(e){const t=p.useRef(!0);t.current&&(t.current=!1,e())}let Ff={},Lf={},zf="";function Rw(e){if(typeof document>"u")return!1;const t=Oe(e);return tt(t).innerWidth-t.documentElement.clientWidth>0}function Mw(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Oe(e),r=n.documentElement,o=n.body,s=Wn(r)?r:o,i=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const l=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,c===l}function Aw(e){const t=Oe(e),n=t.documentElement,r=t.body,o=Wn(n)?n:r,s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Dw(e){const t=Oe(e),n=t.documentElement,r=t.body,o=tt(n);let s=0,i=0,a=!1;const c=yn.create();if(Ai&&(o.visualViewport?.scale??1)!==1)return()=>{};function l(){const h=o.getComputedStyle(n),m=o.getComputedStyle(r),g=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Ff={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},zf=n.style.scrollBehavior,Lf={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const E=n.scrollHeight>n.clientHeight,C=n.scrollWidth>n.clientWidth,S=h.overflowY==="scroll"||m.overflowY==="scroll",b=h.overflowX==="scroll"||m.overflowX==="scroll",x=Math.max(0,o.innerWidth-r.clientWidth),T=Math.max(0,o.innerHeight-r.clientHeight),I=parseFloat(m.marginTop)+parseFloat(m.marginBottom),z=parseFloat(m.marginLeft)+parseFloat(m.marginRight),A=Wn(n)?n:r;if(a=Mw(e),a){n.style.scrollbarGutter=g,A.style.overflowY="hidden",A.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:g,overflowY:"hidden",overflowX:"hidden"}),(E||S)&&(n.style.overflowY="scroll"),(C||b)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:I||T?`calc(100dvh - ${I+T}px)`:"100dvh",width:z||x?`calc(100vw - ${z+x}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,Ff),Object.assign(r.style,Lf),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=zf)}function f(){u(),c.request(l)}l();const d=Le(o,"resize",f);return()=>{c.cancel(),u(),typeof o.removeEventListener=="function"&&d()}}class Nw{lockCount=0;restore=null;timeoutLock=Bt.create();timeoutUnlock=Bt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Oe(t).documentElement,o=tt(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=Et;return}const s=Tl||!Rw(t);this.restore=s?Aw(t):Dw(t)}}const Fw=new Nw;function $f(e=!0,t=null){he(()=>{if(e)return Fw.acquire(t)},[e,t])}function Lw(e){const t=p.useRef(""),n=p.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:p.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function Is(e,t){const n=p.useRef(e),r=ie(t);he(()=>{n.current!==e&&r(n.current)},[e,r]),he(()=>{n.current=e},[e])}function Ea(e){const[t,n]=p.useState(null),r=ie((i,a)=>{e||n(a||(Tl?"touch":""))});Is(e,i=>{i&&!e&&n(null)});const{onClick:o,onPointerDown:s}=Lw(r);return p.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:s}}),[t,o,s])}function zw(e){const{store:t,parentContext:n,actionsRef:r,isDrawer:o}=e,s=t.useState("open"),i=t.useState("disablePointerDismissal"),a=t.useState("modal"),c=t.useState("popupElement"),{openMethod:l,triggerProps:u}=Ea(s);Yu(t);const{forceUnmount:f}=Xu(s,t),d=p.useCallback(()=>{t.setOpen(!1,De(gu))},[t]);p.useImperativeHandle(r,()=>({unmount:f,close:d}),[f,d]);const h=Qu({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[m,y]=p.useState(0),[v,g]=p.useState(0),E=m===0,C=rf(h),S=da(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(F){if(!t.context.outsidePressEnabledRef.current||"button"in F&&F.button!==0||"touches"in F&&F.touches.length!==1)return!1;const V=ut(F);if(E&&!i){const $=V;return a&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===$||t.context.backdropRef.current===$||we($,c)&&!$?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:E});$f(s&&a===!0,c);const{getReferenceProps:b,getFloatingProps:x,getTriggerProps:T}=vo([C,S]);t.useContextCallback("onNestedDialogOpen",(F,V)=>{y(F),g(V)}),t.useContextCallback("onNestedDialogClose",()=>{y(0),g(0)}),p.useEffect(()=>(n?.onNestedDialogOpen&&s&&n.onNestedDialogOpen(m+1,v+(o?1:0)),n?.onNestedDialogClose&&!s&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&s&&n.onNestedDialogClose()}),[o,s,m,v,n]);const I=p.useMemo(()=>b(u),[b,u]),z=p.useMemo(()=>T(u),[T,u]),A=p.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:l,activeTriggerProps:I,inactiveTriggerProps:z,popupProps:A,floatingRootContext:h,nestedOpenDialogCount:m,nestedOpenDrawerCount:v})}const Vf=p.createContext(void 0);function Lt(e){const t=p.useContext(Vf);if(e===!1&&t===void 0)throw new Error(dt(27));return t}const $w={...Ku,modal:fe(e=>e.modal),nested:fe(e=>e.nested),nestedOpenDialogCount:fe(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:fe(e=>e.nestedOpenDrawerCount),disablePointerDismissal:fe(e=>e.disablePointerDismissal),openMethod:fe(e=>e.openMethod),descriptionElementId:fe(e=>e.descriptionElementId),titleElementId:fe(e=>e.titleElementId),viewportElement:fe(e=>e.viewportElement),role:fe(e=>e.role)};class Ca extends jo{constructor(t){super(Vw(t),{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new ps,onOpenChange:void 0,onOpenChangeComplete:void 0},$w)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t},o=n.trigger?.id??null;(o||t)&&(r.activeTriggerId=o,r.activeTriggerElement=n.trigger??null),this.update(r)};static useStore(t,n){const r=wt(()=>new Ca(n)).current;return t??r}}function Vw(e={}){return{...qu(),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}}const Pa=p.createContext(!1);function Ta(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:f=null}=e,d=Lt(!0),h=p.useContext(Pa),m=!!d,y=Ca.useStore(l?.store,{open:r,openProp:n,activeTriggerId:f,triggerIdProp:u,modal:a,disablePointerDismissal:i,nested:m});xa(()=>{n===void 0&&y.state.open===!1&&r===!0&&y.update({open:!0,activeTriggerId:f})}),y.useControlledProp("openProp",n),y.useControlledProp("triggerIdProp",u),y.useSyncedValues({disablePointerDismissal:i,nested:m,modal:a}),y.useContextCallback("onOpenChange",o),y.useContextCallback("onOpenChangeComplete",s);const v=y.useState("payload");zw({store:y,actionsRef:c,parentContext:d?.store.context,isDrawer:h});const g=p.useMemo(()=>({store:y}),[y]);return w.jsx(Pa.Provider,{value:!1,children:w.jsx(Vf.Provider,{value:g,children:typeof t=="function"?t({payload:v}):t})})}const jw={...En,...tn},jf=p.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,{store:c}=Lt(),l=c.useState("open"),u=c.useState("nested"),f=c.useState("mounted"),d=c.useState("transitionStatus");return qe("div",t,{state:{open:l,transitionStatus:d},ref:[c.context.backdropRef,n],stateAttributesMapping:jw,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:i||!u})}),Hf=p.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,style:a,...c}=t,{store:l}=Lt(),u=l.useState("open");function f(y){u&&l.setOpen(!1,De(I0,y.nativeEvent))}const{getButtonProps:d,buttonRef:h}=Dr({disabled:s,native:i});return qe("button",t,{state:{disabled:s},ref:[n,h],props:[{onClick:f},c,d]})}),Zf=p.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,{store:c}=Lt(),l=qt(i);return c.useSyncedValueWithCleanup("descriptionElementId",l),qe("p",t,{ref:n,props:[{id:l},a]})});let Hw=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Zw=(function(e){return e[e.open=Ft.open]="open",e[e.closed=Ft.closed]="closed",e[e.startingStyle=Ft.startingStyle]="startingStyle",e[e.endingStyle=Ft.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Wf=p.createContext(void 0);function ka(){const e=p.useContext(Wf);if(e===void 0)throw new Error(dt(26));return e}const Ww={...En,...tn,nestedDialogOpen(e){return e?{[Zw.nestedDialogOpen]:""}:null}},Uf=p.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,style:a,...c}=t,{store:l}=Lt(),u=l.useState("descriptionElementId"),f=l.useState("disablePointerDismissal"),d=l.useState("floatingRootContext"),h=l.useState("popupProps"),m=l.useState("modal"),y=l.useState("mounted"),v=l.useState("nested"),g=l.useState("nestedOpenDialogCount"),E=l.useState("open"),C=l.useState("openMethod"),S=l.useState("titleElementId"),b=l.useState("transitionStatus"),x=l.useState("role");ka(),xn({open:E,ref:l.context.popupRef,onComplete(){E&&l.context.onOpenChangeComplete?.(!0)}});function T(V){return V==="touch"?l.context.popupRef.current:!0}const I=s===void 0?T:s,z=g>0,F=qe("div",t,{state:{open:E,nested:v,transitionStatus:b,nestedDialogOpen:z},props:[h,{"aria-labelledby":S??void 0,"aria-describedby":u??void 0,role:x,tabIndex:-1,hidden:!y,onKeyDown(V){ks.has(V.key)&&V.stopPropagation()},style:{[Hw.nestedDialogs]:g}},c],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:Ww});return w.jsx(ls,{context:d,openInteractionType:C,disabled:!y,closeOnFocusOut:!f,initialFocus:I,returnFocus:o,modal:m!==!1,restoreFocus:"popup",children:F})}),Ia=p.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return w.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),Oa=p.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=Lt(),i=s.useState("mounted"),a=s.useState("modal"),c=s.useState("open");return i||r?w.jsx(Wf.Provider,{value:r,children:w.jsxs(ca,{ref:n,...o,children:[i&&a===!0&&w.jsx(Ia,{ref:s.context.internalBackdropRef,inert:os(!c)}),t.children]})}):null}),_a=p.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,{store:c}=Lt(),l=qt(i);return c.useSyncedValueWithCleanup("titleElementId",l),qe("h2",t,{ref:n,props:[{id:l},a]})}),Ra=p.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,id:a,payload:c,handle:l,style:u,...f}=t,d=Lt(!0),h=l?.store??d?.store;if(!h)throw new Error(dt(79));const m=qt(a),y=h.useState("floatingRootContext"),v=h.useState("isOpenedByTrigger",m),g=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:C}=Gu(m,g,h,{payload:c}),{getButtonProps:S,buttonRef:b}=Dr({disabled:s,native:i}),x=fa(y,{enabled:y!=null}),T=vo([x]),I={disabled:s,open:v},z=h.useState("triggerProps",C);return qe("button",t,{state:I,ref:[b,n,E,g],props:[T.getReferenceProps(),z,{[Ji]:"",id:m},f,S],stateAttributesMapping:ff})});let Bf=(function(e){return e[e.open=Ft.open]="open",e[e.closed=Ft.closed]="closed",e[e.startingStyle=Ft.startingStyle]="startingStyle",e[e.endingStyle=Ft.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Uw={...En,...tn,nested(e){return e?{[Bf.nested]:""}:null},nestedDialogOpen(e){return e?{[Bf.nestedDialogOpen]:""}:null}},Bw=p.forwardRef(function(t,n){const{className:r,render:o,children:s,style:i,...a}=t,c=ka(),{store:l}=Lt(),u=l.useState("open"),f=l.useState("nested"),d=l.useState("transitionStatus"),h=l.useState("nestedOpenDialogCount"),m=l.useState("mounted"),y=h>0;return qe("div",t,{enabled:c||m,state:{open:u,nested:f,transitionStatus:d,nestedDialogOpen:y},ref:[n,l.useStateSetter("viewportElement")],stateAttributesMapping:Uw,props:[{role:"presentation",hidden:!m,style:{pointerEvents:u?void 0:"none"},children:s},a]})}),Gw=(e,t)=>Object.is(e,t);function $r(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Yw(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:$r(t,r,n))}function xo(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:$r(r,t,n))}function Xw(e,t,n){return e.filter(r=>!$r(t,r,n))}function Ma(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function qw(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Kw(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(qw(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function Jw(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Ma(e)}function Vr(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Ma(e.value):Ma(e)}let Gf=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Os={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Eo={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Qw={disabled:!1,...Eo},pr={valid(e){return e===null?null:e?{[Gf.valid]:""}:{[Gf.invalid]:""}}},Yf=p.createContext({invalid:void 0,name:void 0,validityData:{state:Os,errors:[],error:"",value:"",initialValue:null},setValidityData:Et,disabled:void 0,touched:Eo.touched,setTouched:Et,dirty:Eo.dirty,setDirty:Et,filled:Eo.filled,setFilled:Et,focused:Eo.focused,setFocused:Et,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Qw,markedDirtyRef:{current:!1},registerFieldControl:Et,validation:{getValidationProps:(e=mt)=>e,getInputValidationProps:(e=mt)=>e,inputRef:{current:null},commit:async()=>{}}});function hr(e=!0){const t=p.useContext(Yf);if(t.setValidityData===Et&&!e)throw new Error(dt(28));return t}function Aa(e,t){const{enabled:n=!0,getValue:r,id:o,value:s}=t,{registerFieldControl:i}=hr(),a=p.useRef(null);a.current||(a.current=Symbol()),he(()=>{const c=a.current;if(!(!c||!n))return i(c,{controlRef:e,getValue:r,id:o,value:s}),()=>{i(c,void 0)}},[e,n,r,o,i,s])}const Xf=p.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Et,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function jr(){return p.useContext(Xf)}const qf=p.createContext({controlId:void 0,registerControlId:Et,labelId:void 0,setLabelId:Et,messageIds:[],setMessageIds:Et,getDescriptionProps:e=>e});function Fn(){return p.useContext(qf)}function Da(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:s}=Fn(),i=qt(t),a=n?o:void 0,c=wt(()=>Symbol("labelable-control")),l=p.useRef(!1),u=p.useRef(t!=null),f=ie(()=>{!l.current||s===Et||(l.current=!1,s(c.current,void 0))});return he(()=>{if(s===Et)return;let d;if(n){const h=r?.current;je(h)&&h.closest("label")!=null?d=t??null:d=a??i}else if(t!=null)u.current=!0,d=t;else if(u.current)d=i;else{f();return}if(d===void 0){f();return}l.current=!0,s(c.current,d)},[t,r,a,s,n,i,c,f]),p.useEffect(()=>f,[f]),o??i}function eS(e){const t=e.getBoundingClientRect(),n=tt(e),r=n.getComputedStyle(e,"::before"),o=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||o.content!=="none"))return t;const i=parseFloat(r.width)||0,a=parseFloat(r.height)||0,c=parseFloat(o.width)||0,l=parseFloat(o.height)||0,u=Math.max(t.width,i,c),f=Math.max(t.height,a,l),d=u-t.width,h=f-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-h/2,bottom:t.bottom+h/2}}function tS(e,t){return e??t}const nS=20;function Kf(e,t,n,r){const[o,s]=p.useState(!1);he(()=>{if(!e||!t||n==null){s(!1);return}const i=Oe(n).documentElement.clientWidth,a=n.offsetWidth;s(i>0&&a>0&&a>=i-nS)},[e,t,n]),$f(e&&(!t||o),r)}let Jf=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function Qf(e){return p.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[Jf.checked]:""}:{[Jf.unchecked]:""}},...pr}),[e.indeterminate])}const rS=p.createContext({disabled:!1});function oS(){return p.useContext(rS)}function sS(e,t,n,r=!0,o){const[s,i]=p.useState(),a=qt(o?`${o}-label`:void 0),c=e??t??s;return he(()=>{const l=e||t||!r?void 0:iS(n.current,a);s!==l&&i(l)}),c}function iS(e,t){const n=aS(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function aS(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const o=e.nextElementSibling;if(o&&o.htmlFor===n)return o}const r=e.labels;return r&&r[0]}const cS=p.createContext(void 0);function lS(e=!0){const t=p.useContext(cS);if(t===void 0&&!e)throw new Error(dt(3));return t}const ed=p.createContext(void 0);function uS(){const e=p.useContext(ed);if(e===void 0)throw new Error(dt(14));return e}const fS="data-parent",td=p.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,form:c,id:l,indeterminate:u=!1,inputRef:f,name:d,onCheckedChange:h,parent:m=!1,readOnly:y=!1,render:v,required:g=!1,uncheckedValue:E,value:C,nativeButton:S=!1,style:b,...x}=t,{clearErrors:T}=jr(),{disabled:I,name:z,setDirty:A,setFilled:F,setFocused:V,setTouched:$,state:M,validationMode:k,validityData:O,shouldValidateOnChange:P,validation:R}=hr(),D=oS(),{labelId:j,controlId:W,registerControlId:Z,getDescriptionProps:U}=Fn(),G=lS(),B=G?.parent,X=B&&G.allValues,K=I||D.disabled||G?.disabled||a,J=z??d,se=C??J,ae=qt(),pe=qt();let Y=W;X?Y=m?pe:`${B.id}-${se}`:l&&(Y=l);let me={};X&&(m?me=G.parent.getParentProps():se&&(me=G.parent.getChildProps(se)));const ye=ie(h),{checked:de=r,indeterminate:ue=u,onCheckedChange:ce,...ve}=me,le=G?.value,Se=G?.setValue,_=G?.defaultValue,H=p.useRef(null),N=wt(()=>Symbol("checkbox-control")),L=p.useRef(!1),{getButtonProps:Q,buttonRef:ne}=Dr({disabled:K,native:S}),te=G?.validation??R,[ge,Ie]=So({controlled:se&&le&&!m?le.includes(se):de,default:se&&_&&!m?_.includes(se):s,name:"Checkbox",state:"checked"});he(()=>{Z!==Et&&(L.current=!0,Z(N.current,Y))},[Y,G,Z,m,N]),p.useEffect(()=>{const Pe=N.current;return()=>{!L.current||Z===Et||(L.current=!1,Z(Pe,void 0))}},[Z,N]),Aa(H,{enabled:!G,id:ae,value:ge});const xe=p.useRef(null),Ce=or(f,xe,te.inputRef),ke=sS(i,j,xe,!S,Y??void 0);he(()=>{xe.current&&(xe.current.indeterminate=ue,ge&&F(!0))},[ge,ue,F]),Is(ge,()=>{G&&!m||(T(J),F(ge),A(ge!==O.initialValue),P()?te.commit(ge):te.commit(ge,!0))});const ze=Sn({checked:ge,disabled:K,form:c,name:m?void 0:J,id:S?void 0:Y??void 0,required:g,ref:Ce,style:J?Jl:ts,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Pe){if(Pe.nativeEvent.defaultPrevented)return;if(y){Pe.preventDefault();return}const Ze=Pe.currentTarget.checked,We=De(ar,Pe.nativeEvent);if(ce?.(Ze,We),ye(Ze,We),!We.isCanceled&&(Ie(Ze),se&&le&&Se&&!m&&!X)){const ct=Ze?[...le,se]:le.filter(Ye=>Ye!==se);Se(ct,We)}},onFocus(){H.current?.focus()}},C!==void 0?{value:(G?ge&&C:C)||""}:mt,U,G?te.getValidationProps:te.getInputValidationProps),Ge=X?!!de:ge,He=X&&ue||u;p.useEffect(()=>{if(!B||!se)return;const Pe=B.disabledStatesRef.current;return Pe.set(se,K),()=>{Pe.delete(se)}},[B,K,se]);const nt=p.useMemo(()=>({...M,checked:Ge,disabled:K,readOnly:y,required:g,indeterminate:He}),[M,Ge,K,y,g,He]),st=Qf(nt),Re=qe("span",t,{state:nt,ref:[ne,H,n,G?.registerControlRef],props:[{id:S?Y??void 0:ae,role:"checkbox","aria-checked":ue?"mixed":ge,"aria-readonly":y||void 0,"aria-required":g||void 0,"aria-labelledby":ke,[fS]:m?"":void 0,onFocus(){V(!0)},onBlur(){const Pe=xe.current;Pe&&($(!0),V(!1),k==="onBlur"&&te.commit(G?le:Pe.checked))},onClick(Pe){y||K||(Pe.preventDefault(),xe.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:Pe.shiftKey,ctrlKey:Pe.ctrlKey,altKey:Pe.altKey,metaKey:Pe.metaKey})))}},U,te.getValidationProps,x,ve,Q],stateAttributesMapping:st});return w.jsxs(ed.Provider,{value:nt,children:[Re,!ge&&!G&&J&&!m&&E!==void 0&&w.jsx("input",{type:"hidden",form:c,name:J,value:E}),w.jsx("input",{...ze,suppressHydrationWarning:!0})]})}),nd=p.forwardRef(function(t,n){const{render:r,className:o,style:s,keepMounted:i=!1,...a}=t,c=uS(),l=c.checked||c.indeterminate,{mounted:u,transitionStatus:f,setMounted:d}=yo(l),h=p.useRef(null),m={...c,transitionStatus:f};xn({open:l,ref:h,onComplete(){l||d(!1)}});const y=Qf(c),v=p.useMemo(()=>({...y,...tn,...pr}),[y]),g=i||u,E=qe("span",t,{ref:[n,h],state:m,stateAttributesMapping:v,props:a});return g?E:null});function dS(e,t){const n=qt(e);return he(()=>(t(n),()=>{t(void 0)}),[n,t]),n}function pS(e={}){const{id:t,fallbackControlId:n,native:r=!1,setLabelId:o,focusControl:s}=e,{controlId:i,setLabelId:a}=Fn(),c=ie(h=>{a(h),o?.(h)}),l=dS(t,c),u=i??n;function f(h){if(s){s(h,u);return}if(!u)return;const m=Oe(h.currentTarget).getElementById(u);it(m)&&hS(m)}function d(h){ut(h.nativeEvent)?.closest("button,input,select,textarea")||(!h.defaultPrevented&&h.detail>1&&h.preventDefault(),!r&&f(h))}return r?{id:l,htmlFor:u??void 0,onMouseDown:d}:{id:l,onClick:d,onPointerDown(h){h.preventDefault()}}}function hS(e){e.focus({focusVisible:!0})}const mS=p.createContext(void 0);function rd(e){return p.useContext(mS)}function gS(e,t){const n=p.useRef(null),r=ie(s=>{Kt.flushSync(()=>{e.setOpen(!1,De(cr,s.nativeEvent,s.currentTarget))}),Fv(n.current)?.focus()}),o=ie(s=>{const i=e.select("positionerElement");if(i&&Ar(s,i))e.context.beforeContentFocusGuardRef.current?.focus();else{Kt.flushSync(()=>{e.setOpen(!1,De(cr,s.nativeEvent,s.currentTarget))});let a=Nv(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&we(i,a);){const c=a;if(a=Yi(a),a===c)break}a?.focus()}});return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:o}}function yS(e){const[t,n]=p.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}const vS=p.createContext(void 0),bS={disableStyleElements:!1};function wS(){return p.useContext(vS)??bS}let Pt=(function(e){return e.nestedDrawers="--nested-drawers",e.height="--drawer-height",e.frontmostHeight="--drawer-frontmost-height",e.swipeMovementX="--drawer-swipe-movement-x",e.swipeMovementY="--drawer-swipe-movement-y",e.snapPointOffset="--drawer-snap-point-offset",e.swipeStrength="--drawer-swipe-strength",e})({}),Ln=(function(e){return e.swipeProgress="--drawer-swipe-progress",e})({});const SS={...En,...tn},xS=p.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,{store:c}=Lt(),l=c.useState("open"),u=c.useState("nested"),f=c.useState("mounted"),d=c.useState("transitionStatus");return qe("div",t,{state:{open:l,transitionStatus:d},ref:[c.context.backdropRef,n],stateAttributesMapping:SS,props:[{role:"presentation",hidden:!f,style:{pointerEvents:l?void 0:"none",userSelect:"none",WebkitUserSelect:"none",[Ln.swipeProgress]:"0",[Pt.swipeStrength]:"1"}},a],enabled:i||!u})}),od="data-drawer-content",ES=p.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t;return Lt(),qe("div",t,{ref:n,props:[{[od]:""},i]})}),CS=p.createContext(void 0);function sd(e){return p.useContext(CS)}let un=(function(e){return e[e.open=Ft.open]="open",e[e.closed=Ft.closed]="closed",e[e.startingStyle=Ft.startingStyle]="startingStyle",e[e.endingStyle=Ft.endingStyle]="endingStyle",e.expanded="data-expanded",e.nestedDrawerOpen="data-nested-drawer-open",e.nestedDrawerSwiping="data-nested-drawer-swiping",e.swipeDismiss="data-swipe-dismiss",e.swipeDirection="data-swipe-direction",e.swiping="data-swiping",e})({});const id=p.createContext(void 0);function _s(e){const t=p.useContext(id);if(e===!1&&t===void 0)throw new Error(dt(90));return t}function bt(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function ad(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e=="number")return Number.isFinite(e)?e<=1?bt(e,0,1)*t:e:null;const r=e.trim();if(r.endsWith("px")){const o=Number.parseFloat(r);return Number.isFinite(o)?o:null}if(r.endsWith("rem")){const o=Number.parseFloat(r);return Number.isFinite(o)?o*n:null}return null}function PS(e,t){let n=null,r=1/0;for(const o of t){const s=Math.abs(o.height-e);s<r&&(r=s,n=o)}return n}function cd(){const{store:e}=Lt(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:o}=_s(),s=e.useState("viewportElement"),[i,a]=p.useState(0),[c,l]=p.useState(16),u=ie(()=>{const m=Oe(s).documentElement;s&&a(s.offsetHeight),s||a(m.clientHeight);const y=parseFloat(getComputedStyle(m).fontSize);Number.isFinite(y)&&l(y)});he(()=>{if(u(),!s||typeof ResizeObserver!="function")return;const h=new ResizeObserver(u);return h.observe(s),()=>{h.disconnect()}},[u,s]);const f=p.useMemo(()=>{if(!t||t.length===0||i<=0||o<=0)return[];const h=Math.min(o,i);if(!Number.isFinite(h)||h<=0)return[];const m=t.map(g=>{const E=ad(g,i,c);if(E===null||!Number.isFinite(E))return null;const C=bt(E,0,h);return{value:g,height:C,offset:Math.max(0,o-C)}}).filter(g=>!!g);if(m.length<=1)return m;const y=[],v=[];for(let g=m.length-1;g>=0;g-=1){const E=m[g];v.some(S=>Math.abs(S-E.height)<=1)||(v.push(E.height),y.push(E))}return y.reverse(),y},[o,c,t,i]),d=p.useMemo(()=>{if(n===void 0)return f[0];if(n===null)return;const h=f.find(g=>Object.is(g.value,n));if(h)return h;const m=Math.min(o,i),y=ad(n,i,c);if(y===null||!Number.isFinite(y))return;const v=bt(y,0,m);return PS(v,f)??void 0},[n,o,f,c,i]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:o,viewportHeight:i,resolvedSnapPoints:f,activeSnapPointOffset:d?.offset??null}}const ld=p.createContext(null);function TS(e){return p.useContext(ld)}let ud=!1;function kS(){ud||(typeof CSS<"u"&&"registerProperty"in CSS&&([Pt.swipeMovementX,Pt.swipeMovementY,Pt.snapPointOffset].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),[{name:Ln.swipeProgress,initialValue:"0"},{name:Pt.swipeStrength,initialValue:"1"}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:"<number>",inherits:!1,initialValue:t})}catch{}})),ud=!0)}const IS={...En,...tn,expanded(e){return e?{[un.expanded]:""}:null},nestedDrawerOpen(e){return e?{[un.nestedDrawerOpen]:""}:null},nestedDrawerSwiping(e){return e?{[un.nestedDrawerSwiping]:""}:null},swipeDirection(e){return e?{[un.swipeDirection]:e}:null},swiping(e){return e?{[un.swiping]:""}:null}},OS=p.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,style:a,...c}=t,{store:l}=Lt(),{swipeDirection:u,frontmostHeight:f,hasNestedDrawer:d,nestedSwiping:h,nestedSwipeProgressStore:m,onPopupHeightChange:y,notifyParentFrontmostHeight:v,notifyParentHasNestedDrawer:g}=_s(),E=l.useState("descriptionElementId"),C=l.useState("disablePointerDismissal"),S=l.useState("floatingRootContext"),b=l.useState("popupProps"),x=l.useState("modal"),T=l.useState("mounted"),I=l.useState("nested"),z=l.useState("nestedOpenDrawerCount"),A=l.useState("transitionStatus"),F=l.useState("open"),V=l.useState("openMethod"),$=l.useState("titleElementId"),M=l.useState("role"),k=z>0,O=TS(),P=O?.swiping??!1,R=O?.swipeStrength??null,{snapPoints:D,activeSnapPoint:j,activeSnapPointOffset:W}=cd();ka();const[Z,U]=p.useState(0),G=p.useRef(0),B=ie(()=>{const ye=l.context.popupRef.current;if(!ye)return;const de=ye.offsetHeight;if(G.current>0&&f>G.current&&de>G.current)return;if(G.current>0&&d){const ve=G.current;U(ve),y(ve);return}const ce=de;ce!==G.current&&(G.current=ce,U(ce),y(ce))});he(()=>{if(!T){G.current=0,U(0),y(0);return}const ye=l.context.popupRef.current;if(!ye||(kS(),B(),typeof ResizeObserver!="function"))return;const de=new ResizeObserver(B);return de.observe(ye),()=>{de.disconnect()}},[B,T,k,y,l.context.popupRef]),he(()=>{const ye=l.context.popupRef,de=()=>{const ce=ye.current;if(!ce)return;const ve=m.getSnapshot();ve>0?ce.style.setProperty(Ln.swipeProgress,`${ve}`):ce.style.setProperty(Ln.swipeProgress,"0")};de();const ue=m.subscribe(de);return()=>{ue();const ce=ye.current;ce&&ce.style.setProperty(Ln.swipeProgress,"0")}},[m,l.context.popupRef]),p.useEffect(()=>{if(F)return v?.(f),()=>{v?.(0)}},[f,F,v]),p.useEffect(()=>g?(g(F||A==="ending"),()=>{g(!1)}):void 0,[g,F,A]),xn({open:F,ref:l.context.popupRef,onComplete(){F&&l.context.onOpenChangeComplete?.(!0)}});const X=s===void 0?l.context.popupRef:s,K={open:F,nested:I,transitionStatus:A,expanded:j===1,nestedDrawerOpen:k,nestedDrawerSwiping:h,swipeDirection:u,swiping:P};let J;Z&&!(!d&&A!=="ending")&&(J=`${Z}px`);const ae=D&&D.length>0&&(u==="down"||u==="up");let pe=null;ae&&W!==null&&(pe=u==="up"?-W:W);let Y=O?O.getDragStyles():mt;if(ae&&u==="down"){const ye=W??0,de=Number.parseFloat(String(Y[Pt.swipeMovementY]??0)),ue=Number.isFinite(de)?ye+de:ye,ce=ue<0;if(P&&ce&&Number.isFinite(de)){const ve=Math.abs(ue),Se=-Math.sqrt(ve)-ye;Y={...Y,transform:void 0,[Pt.swipeMovementY]:`${Se}px`}}else Y={...Y,transform:void 0}}const me=qe("div",t,{state:K,props:[b,{"aria-labelledby":$,"aria-describedby":E,role:M,tabIndex:-1,hidden:!T,onKeyDown(ye){ks.has(ye.key)&&ye.stopPropagation()},style:{...Y,[Ln.swipeProgress]:"0",[Pt.nestedDrawers]:z,[Pt.height]:J,[Pt.snapPointOffset]:typeof pe=="number"?`${pe}px`:"0px",[Pt.frontmostHeight]:f?`${f}px`:void 0,[Pt.swipeStrength]:typeof R=="number"&&Number.isFinite(R)&&R>0?`${R}`:"1"}},c],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:IS});return w.jsx(ls,{context:S,openInteractionType:V,disabled:!T,closeOnFocusOut:!C,initialFocus:X,returnFocus:o,modal:x!==!1,restoreFocus:"popup",children:me})}),_S=Oa;var fd,dd;function RS(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:f=null,swipeDirection:d="down",snapToSequentialPoints:h=!1,snapPoints:m,snapPoint:y,defaultSnapPoint:v,onSnapPointChange:g}=e,E=ie(g),C=_s(!0),S=C?.onNestedSwipeProgressChange,b=C?.onNestedFrontmostHeightChange,x=C?.onNestedSwipingChange,T=C?.onNestedDrawerPresenceChange,[I,z]=p.useState(0),[A,F]=p.useState(0),[V,$]=p.useState(!1),[M,k]=p.useState(!1),[O]=p.useState(MS),P=v!==void 0?v:m?.[0]??null,R=y!==void 0,[D,j]=So({controlled:y,default:P,name:"Drawer",state:"snapPoint"}),W=p.useRef(!1),Z=ie((Y,me)=>{const ye=me??De(ar);E?.(Y,ye),!ye.isCanceled&&j(Y)}),U=p.useMemo(()=>R||!m||m.length===0?D:D===null||!m.some(Y=>Object.is(Y,D))?P:D,[D,R,P,m]),G=ie(Y=>{z(Y),!W.current&&Y>0&&F(Y)}),B=ie(Y=>{if(Y>0){W.current=!0,F(Y);return}W.current=!1,I>0&&F(I)}),X=ie(Y=>{$(Y)}),K=ie(Y=>{O.set(Y),S?.(Y)}),J=ie(Y=>{k(Y),x?.(Y)}),se=ie((Y,me)=>{o?.(Y,me),!me.isCanceled&&!Y&&m&&m.length>0&&Z(P,De(me.reason,me.event,me.trigger))}),ae=p.useMemo(()=>({swipeDirection:d,snapToSequentialPoints:h,snapPoints:m,activeSnapPoint:U,setActiveSnapPoint:Z,frontmostHeight:A,popupHeight:I,hasNestedDrawer:V,nestedSwiping:M,nestedSwipeProgressStore:O,onNestedDrawerPresenceChange:X,onPopupHeightChange:G,onNestedFrontmostHeightChange:B,onNestedSwipingChange:J,onNestedSwipeProgressChange:K,notifyParentFrontmostHeight:b,notifyParentSwipingChange:x,notifyParentSwipeProgressChange:S,notifyParentHasNestedDrawer:T}),[U,A,V,M,O,T,S,x,b,X,B,K,J,G,I,Z,m,h,d]),pe=typeof t=="function"?Y=>w.jsxs(p.Fragment,{children:[fd||(fd=w.jsx(pd,{})),t(Y)]}):w.jsxs(p.Fragment,{children:[dd||(dd=w.jsx(pd,{})),t]});return w.jsx(id.Provider,{value:ae,children:w.jsx(Pa.Provider,{value:!0,children:w.jsx(Ta,{open:n,defaultOpen:r,onOpenChange:se,onOpenChangeComplete:s,disablePointerDismissal:i,modal:a,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:f,children:pe})})})}function MS(){let e=0;const t=new Set;return{getSnapshot:()=>e,set(n){const r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(o=>{o()}))},subscribe(n){return t.add(n),()=>{t.delete(n)}}}}function pd(){const e=Xn(),t=sd(),n=Lt(!1),r=n.store.useState("open"),o=n.store.useState("nestedOpenDialogCount"),s=n.store.useState("popupElement"),i=o===0;return p.useEffect(()=>{if(!(!t||e==null))return()=>{t.removeDrawer(e)}},[e,t]),p.useEffect(()=>{e!=null&&t?.setDrawerOpen(e,r)},[e,r,t]),p.useEffect(()=>{if(!r||!i||!Yo)return;const c=tt(s).CloseWatcher;if(!c)return;function l(d){n.store.select("open")&&n.store.setOpen(!1,De(O0,d))}const u=new c,f=Le(u,"close",l);return()=>{f(),u.destroy()}},[n.store,i,r,s]),null}function Na(e,t){const n=At(e);if(t==="vertical"){const o=n.overflowY;return(o==="auto"||o==="scroll")&&e.scrollHeight>e.clientHeight}const r=n.overflowX;return(r==="auto"||r==="scroll")&&e.scrollWidth>e.clientWidth}function AS(e,t,n){let r=e;for(;r&&r!==t;){for(const o of n)if(Na(r,o))return!0;r=r.parentElement}return!1}function Hr(e,t,n="vertical"){let r=it(e)?e:null;for(;r&&r!==t;){if(Na(r,n))return r;r=r.parentElement}return Na(t,n)?t:null}function Rs(e,t,n){return typeof e?.elementFromPoint=="function"?e.elementFromPoint(t,n):null}const DS=40,NS=10,FS=1,LS=50,hd=16,zS=80,$S='button,a,input,select,textarea,label,[role="button"]';function Fa(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function VS(e){const n=tt(e).getComputedStyle(e).transform;let r=0,o=0,s=1;if(n&&n!=="none"){const i=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(i){const a=i[1].split(", ").map(parseFloat);a.length===6?(r=a[4],o=a[5],s=Math.sqrt(a[0]*a[0]+a[1]*a[1])):a.length===16&&(r=a[12],o=a[13],s=a[0])}}return{x:r,y:o,scale:s}}function Ms(e){return Number.isFinite(e)&&e>0?e:null}function jS(e){return e%2===1}function La(e,t,n){const r=e[n];if(typeof r=="function")try{r.call(e,t)}catch(o){if(o&&typeof o=="object"&&"name"in o&&o.name==="NotFoundError")return;throw o}}function HS(e){const{enabled:t,directions:n,elementRef:r,movementCssVars:o,canStart:s,ignoreSelectorWhenTouch:i=!0,ignoreScrollableAncestors:a=!1,swipeThreshold:c,onDismiss:l,onProgress:u,onCancel:f,onSwipeStart:d,onRelease:h,onSwipingChange:m,trackDrag:y=!0}=e,v=$S,g=n.length===1?n[0]:void 0,E=Math.max(0,typeof c=="number"?c:DS),C=n.includes("left"),S=n.includes("right"),b=n.includes("up"),x=n.includes("down"),T=C||S,I=b||x,z=p.useMemo(()=>{const q=[];return I&&q.push("vertical"),T&&q.push("horizontal"),q},[T,I]),[A,F]=p.useState(void 0),[V,$]=p.useState(!1),[M,k]=p.useState(!1),[O,P]=p.useState(!1),[R,D]=p.useState({x:0,y:0}),[j,W]=p.useState({x:0,y:0,scale:1}),[Z,U]=p.useState(null),G=p.useRef({x:0,y:0}),B=p.useRef({x:0,y:0}),X=p.useRef(null),K=p.useRef({x:0,y:0,scale:1}),J=p.useRef(void 0),se=p.useRef(0),ae=p.useRef(!1),pe=p.useRef({x:0,y:0}),Y=p.useRef(!1),me=p.useRef(!1),ye=p.useRef(null),de=p.useRef(!1),ue=p.useRef(!1),ce=p.useRef({width:0,height:0}),ve=p.useRef(0),le=p.useRef(E),Se=p.useRef(null),_=p.useRef(null),H=p.useRef({x:0,y:0}),N=p.useRef(null),L=p.useRef(!1),Q=ie(q=>{L.current!==q&&(L.current=q,$(q),m?.(q))});function ne(q){if(!q)return;if(typeof c!="function"){le.current=E;return}const oe=r.current;if(!oe)return;const be=c({element:oe,direction:q});le.current=Math.max(0,be)}const te=ie((q,oe)=>{const be=Number.isFinite(q)?bt(q,0,1):0,Fe=be!==ve.current;let Ve=!1;if(oe){const Ne=N.current;Ve=!Ne||Ne.deltaX!==oe.deltaX||Ne.deltaY!==oe.deltaY||Ne.direction!==oe.direction}!Fe&&!Ve||(ve.current=be,oe?N.current=oe:Fe&&(N.current=null),u?.(be,oe))});function ge(q,oe){if(oe===null)return;const be=_.current;if(be&&oe>be.time){const Fe=Math.max(oe-be.time,hd);H.current={x:(q.x-be.x)/Fe,y:(q.y-be.y)/Fe}}_.current={x:q.x,y:q.y,time:oe}}const Ie=p.useCallback(()=>{F(void 0),Q(!1),k(!1),P(!1),D({x:0,y:0}),W({x:0,y:0,scale:1}),U(null),te(0),le.current=E,G.current={x:0,y:0},B.current={x:0,y:0},K.current={x:0,y:0,scale:1},J.current=void 0,se.current=0,ae.current=!1,pe.current={x:0,y:0},Y.current=!1,X.current=null,me.current=!1,ye.current=null,de.current=!1,ue.current=!1,ce.current={width:0,height:0},Se.current=null,_.current=null,H.current={x:0,y:0},N.current=null},[Q,E,te]);p.useEffect(()=>{typeof c!="function"&&(le.current=E)},[E,c]);function xe(q){if("touches"in q){const oe=q.touches[0];return oe?{x:oe.clientX,y:oe.clientY}:null}return{x:q.clientX,y:q.clientY}}function Ce(q){return"touches"in q?!0:q.pointerType==="touch"}function ke(q,oe){const be=Oe(r.current);return Rs(be,q.x,q.y)??ut(oe)}function ze(q,oe){return T&&!I?Hr(q,oe,"horizontal"):I&&!T?Hr(q,oe,"vertical"):Hr(q,oe,"vertical")??Hr(q,oe,"horizontal")}function Ge(q,oe,be){de.current=!1;const Fe=Ce(q),Ve=ke(oe,q.nativeEvent),Qe=Oe(r.current).body,Te=Fe&&Qe?ze(Ve,Qe):null,Ee=be?.ignoreScrollableTarget??!1;if(Te&&!Ee||(de.current=!!(Te&&Ee),(Ve?Ve.closest(v):!1)&&(!Fe||i)))return!1;const Ae=r.current;if(a&&Ae&&Ve&&z.length>0&&!(be?.ignoreScrollableAncestors??!1)&&AS(Ve,Ae,z))return!1;if(ae.current=!1,J.current=void 0,se.current=0,G.current=oe,Se.current=Ms(q.timeStamp),pe.current=oe,X.current=oe,Ae){ce.current={width:Ae.offsetWidth,height:Ae.offsetHeight},ne(g);const Xe=VS(Ae);K.current=Xe,B.current={x:Xe.x,y:Xe.y},W(Xe),D({x:Xe.x,y:Xe.y}),ge({x:Xe.x,y:Xe.y},Se.current),"touches"in q||La(Ae,q.pointerId,"setPointerCapture")}return d?.(q.nativeEvent),Q(!0),k(!1),U(null),Y.current=!0,te(0),!0}function He(){nt(),de.current=!1,X.current=null}function nt(){me.current=!1,ye.current=null}function st(q){if(He(),!L.current)return;Q(!1),k(!1),U(null);const oe=y?j:K.current;B.current={x:oe.x,y:oe.y},D({x:oe.x,y:oe.y}),F(void 0),ue.current=!1;const be=r.current;be&&La(be,q.pointerId,"releasePointerCapture"),te(0,{deltaX:0,deltaY:0,direction:void 0}),f?.(q.nativeEvent)}function Re(q,oe){const be=Qe=>Qe>=0?Qe**.5:-(Math.abs(Qe)**.5),Fe=(Qe,Te,Ee)=>!Te&&Qe<0||!Ee&&Qe>0?be(Qe):Qe,Ve=T?Fe(q,C,S):be(q),Ne=I?Fe(oe,b,x):be(oe);return{x:Ve,y:Ne}}function Pe(q,oe,be){const Fe=Math.abs(oe),Ve=Math.abs(be);if(I&&be!==0&&(!T||Ve>=Fe)){const Te=Math.max(0,q.scrollHeight-q.clientHeight),Ee=q.scrollTop<=0,Me=q.scrollTop>=Te,Ae=be>0,Xe=be<0;return Ae&&Ee&&x||Xe&&Me&&b}if(T&&oe!==0&&(!I||Fe>Ve)){const Te=Math.max(0,q.scrollWidth-q.clientWidth),Ee=q.scrollLeft<=0,Me=q.scrollLeft>=Te,Ae=oe>0,Xe=oe<0;return Ae&&Ee&&S||Xe&&Me&&C}return null}const Ze=ie(q=>{if(!t||q.defaultPrevented||q.nativeEvent.defaultPrevented||!("touches"in q)&&q.button!==0)return;const oe=xe(q);!oe||(me.current=!0,ye.current=oe,de.current=!1,ue.current=!1,!(s?s(oe,{nativeEvent:q.nativeEvent,direction:g}):!0))||Ge(q,oe)&&nt()});function We(q,oe,be){if(!t||!L.current)return;const Fe=ut(q.nativeEvent);if(Ce(q)&&!de.current){const on=q.currentTarget;if(ze(Fe,on))return}if("touches"in q||q.preventDefault(),Y.current){G.current=oe;const on=Ms(q.timeStamp);on!==null&&(Se.current=on),Y.current=!1}const Ve=oe.x,Ne=oe.y,Qe=be.x,Te=be.y;(Te<0&&Ne>pe.current.y||Te>0&&Ne<pe.current.y)&&(pe.current={x:pe.current.x,y:Ne}),(Qe<0&&Ve>pe.current.x||Qe>0&&Ve<pe.current.x)&&(pe.current={x:Ve,y:pe.current.y});const Ee=Ve-G.current.x,Me=Ne-G.current.y,Ae=Ne-pe.current.y,Xe=Ve-pe.current.x;if(!M&&Math.sqrt(Ee*Ee+Me*Me)>=FS&&(k(!0),Z===null&&T&&I)){const Xr=Math.abs(Ee),lc=Math.abs(Me);U(Xr>lc?"horizontal":"vertical")}let Je;if(!J.current)Z==="vertical"?Me>0?Je="down":Me<0&&(Je="up"):Z==="horizontal"?Ee>0?Je="right":Ee<0&&(Je="left"):Math.abs(Ee)>=Math.abs(Me)?Je=Ee>0?"right":"left":Je=Me>0?"down":"up",Je&&(Je==="left"&&C||Je==="right"&&S||Je==="up"&&b||Je==="down"&&x)&&(J.current=Je,se.current=Fa(Je,Ee,Me),F(Je),ne(Je));else{const on=J.current,Xr=Fa(on,Xe,Ae);Xr>le.current?(ae.current=!1,F(on)):!(C&&S)&&!(b&&x)&&se.current-Xr>=NS&&(ae.current=!0)}const fn=Re(Ee,Me);let rn=K.current.x,Wt=K.current.y;Z==="horizontal"?T&&(rn+=fn.x):(Z==="vertical"||T&&(rn+=fn.x),I&&(Wt+=fn.y)),B.current={x:rn,y:Wt},y&&D({x:rn,y:Wt}),ge({x:rn,y:Wt},Ms(q.timeStamp));const er=rn-K.current.x,Tn=Wt-K.current.y,Sr=J.current,xr=g??J.current;if(!xr){te(0,{deltaX:er,deltaY:Tn,direction:Sr});return}const kn=xr==="left"||xr==="right"?ce.current.width:ce.current.height,dn=K.current.scale||1;if(kn<=0||dn<=0){te(0,{deltaX:er,deltaY:Tn,direction:Sr});return}const Er=Fa(xr,rn-K.current.x,Wt-K.current.y);if(Er<=0){te(0,{deltaX:er,deltaY:Tn,direction:Sr});return}te(Er/(kn*dn),{deltaX:er,deltaY:Tn,direction:Sr})}const ct=ie(q=>{const oe=xe(q);if(!oe)return;if(!("touches"in q)){const Ve=jS(q.buttons);Ve&&(ue.current=!0);const Ne=q.buttons===0&&ue.current;if(q.buttons!==0&&!Ve||Ne){st(q);return}}if(!V&&me.current){if(!Ce(q)&&(q.defaultPrevented||q.nativeEvent.defaultPrevented)){He();return}if(s?s(oe,{nativeEvent:q.nativeEvent,direction:g}):!0){const Ne=ye.current;let Qe=!1;if(Ce(q)){const Ee=r.current;if(Ne&&Ee){const Me=ke(oe,q.nativeEvent),Xe=Oe(Ee).body,Je=Xe?ze(Me,Xe):null;if(Je&&(we(Ee,Je)||we(Je,Ee))){const fn=oe.x-Ne.x,rn=oe.y-Ne.y,Wt=Pe(Je,fn,rn);if(Wt===!1)return;Wt===!0&&(Qe=!0)}}}Ge(q,oe,{ignoreScrollableTarget:Qe,ignoreScrollableAncestors:Qe})&&(Ne&&Qe?(nt(),G.current=Ne,pe.current=Ne,X.current=Ne,Y.current=!1):(nt(),de.current=!1))}}const be=X.current,Fe=be===null?{x:0,y:0}:{x:oe.x-be.x,y:oe.y-be.y};X.current=oe,We(q,oe,Fe)}),Ye=ie(q=>{if(!t)return;const oe=B.current,be=K.current,Fe=oe.x-be.x,Ve=oe.y-be.y,Ne={deltaX:Fe,deltaY:Ve,direction:A??J.current};if(!L.current){He(),te(0,Ne);return}Q(!1),k(!1),U(null),He(),ue.current=!1;const Qe=r.current;Qe&&("touches"in q||La(Qe,q.pointerId,"releasePointerCapture"));const Te=Fe,Ee=Ve,Me=Se.current,Ae=Ms(q.timeStamp),Xe=Me!==null&&Ae!==null&&Ae>Me?Ae-Me:0,Je=Xe>0?Math.max(Xe,LS):0,fn=Je>0?Te/Je:0,rn=Je>0?Ee/Je:0;let Wt=H.current.x,er=H.current.y;const Tn=_.current;if(Tn&&Ae!==null&&Ae>=Tn.time){const Er=Ae-Tn.time;if(Er<=zS){const on=Math.max(Er,hd),Xr=oe.x-Tn.x,lc=oe.y-Tn.y,sh=Xr/on,ih=lc/on;sh!==0&&(Wt=sh),ih!==0&&(er=ih)}else Wt=0,er=0}const Sr=h?.({event:q.nativeEvent,direction:A??J.current,deltaX:Te,deltaY:Ee,velocityX:fn,velocityY:rn,releaseVelocityX:Wt,releaseVelocityY:er}),xr=typeof Sr=="boolean";if(ae.current&&!xr){B.current={x:be.x,y:be.y},D({x:be.x,y:be.y}),F(void 0),te(0,Ne);return}let kn=!1,dn;if(xr)kn=Sr,dn=A??J.current??g;else for(const Er of n){switch(Er){case"right":Te>le.current&&(kn=!0,dn="right");break;case"left":Te<-le.current&&(kn=!0,dn="left");break;case"down":Ee>le.current&&(kn=!0,dn="down");break;case"up":Ee<-le.current&&(kn=!0,dn="up");break}if(kn)break}kn&&dn?(F(dn),P(!0),l?.(q.nativeEvent,{direction:dn})):(B.current={x:be.x,y:be.y},D({x:be.x,y:be.y}),F(void 0),te(0,Ne))}),Zt=p.useCallback(()=>{const q=y?R:B.current,oe=y?j:K.current;if(!V&&q.x===oe.x&&q.y===oe.y&&!O)return{[o.x]:"0px",[o.y]:"0px"};const be=q.x-oe.x,Fe=q.y-oe.y;return{transition:V?"none":void 0,transform:V?`translateX(${q.x}px) translateY(${q.y}px) scale(${oe.scale})`:void 0,[o.x]:`${be}px`,[o.y]:`${Fe}px`}},[O,R,j,V,o,y]),Vt=p.useCallback(()=>t?{onPointerDown:Ze,onPointerMove:ct,onPointerUp:Ye,onPointerCancel:Ye}:{},[t,Ye,ct,Ze]),Ke=p.useCallback(()=>t?{onTouchStart:Ze,onTouchMove:ct,onTouchEnd:Ye,onTouchCancel:Ye}:{},[t,Ye,ct,Ze]);return{swiping:V,swipeDirection:A,dragDismissed:O,getPointerProps:Vt,getTouchProps:Ke,getDragStyles:Zt,reset:Ie}}const ZS=_a,WS=Ra,za=10,md=.5,gd=.5,US=300,yd=4,vd=.2,BS=4,$a=80,bd=360,Va=.1,wd=1,GS=`[${od}]`,YS=p.forwardRef(function(t,n){const{className:r,render:o,style:s,children:i,...a}=t,{store:c}=Lt(),{swipeDirection:l,notifyParentSwipingChange:u,notifyParentSwipeProgressChange:f,frontmostHeight:d,snapToSequentialPoints:h}=_s(),y=sd()?.visualStateStore,v=c.useState("open"),g=c.useState("mounted"),E=c.useState("nested"),C=c.useState("nestedOpenDrawerCount"),S=c.useState("viewportElement"),b=c.useState("popupElement"),x=C>0,T=l==="left"||l==="right"?"horizontal":"vertical",I=T==="vertical",z=I?"horizontal":"vertical",{snapPoints:A,resolvedSnapPoints:F,activeSnapPoint:V,activeSnapPointOffset:$,setActiveSnapPoint:M,popupHeight:k}=cd(),[O,P]=p.useState(null),R=p.useRef(void 0),D=p.useRef(null),j=io(),W=p.useRef(!1),Z=p.useRef(""),U=p.useRef(!1),G=p.useRef(!1),B=p.useRef(null),X=p.useMemo(()=>{if(!A||A.length<2||l!=="down"&&l!=="up"||F.length<2)return null;const _=F.map(ne=>ne.offset).filter(ne=>Number.isFinite(ne)).sort((ne,te)=>ne-te);if(_.length<2)return null;const H=_[0],N=_[1],L=_[_.length-1];let Q=N-H;if(!Number.isFinite(Q)||Q<=0){const ne=L-H;if(!Number.isFinite(ne)||ne<=0)return null;Q=ne}return{minOffset:H,range:Q}},[F,A,l]),K=p.useMemo(()=>!X||$===null?null:bt(($-X.minOffset)/X.range,0,1),[$,X]),J=p.useMemo(()=>A&&A.length>0&&(l==="down"||l==="up")?l==="down"?["down","up"]:["up","down"]:[l],[A,l]),se=ie(_=>{Sd(c.context.popupRef.current,c.context.backdropRef.current,_)}),ae=ie(()=>{se(!1),c.context.popupRef.current?.removeAttribute(sr.endingStyle),P(null)}),pe=ie(()=>{W.current&&(W.current=!1,u?.(!1))}),Y=ie(({resolvedProgress:_,shouldTrackProgress:H,notifyParent:N})=>{const L=v&&!E&&H,Q=L?_:0,ne=v&&H?_:0;N&&f&&(f(ne),ne<=0&&pe()),y?.set({swipeProgress:Q,frontmostHeight:Q>0?d:0});const te=c.context.backdropRef.current;if(te){if(!L||Q<=0){te.style.setProperty(Ln.swipeProgress,"0"),te.style.removeProperty(Pt.height);return}te.style.setProperty(Ln.swipeProgress,`${Q}`),d>0?te.style.setProperty(Pt.height,`${d}px`):te.style.removeProperty(Pt.height)}});function me({direction:_,deltaX:H,deltaY:N,velocityX:L,velocityY:Q,releaseVelocityX:ne,releaseVelocityY:te}){if(!_)return null;const ge=c.context.popupRef.current;if(!ge)return null;const Ie=_==="left"||_==="right"?ge.offsetWidth:ge.offsetHeight;if(!Number.isFinite(Ie)||Ie<=0)return null;const xe=_==="left"||_==="right"?H:N,Ce=A&&A.length>0?$??0:0;let ke=0;_==="down"?ke=Ce:_==="up"&&(ke=-Ce);const ze=ke+xe,Ge=_==="left"||_==="up"?-ze:ze,He=Math.max(0,Ie-Ge);if(!Number.isFinite(He)||He<=0)return null;const nt=_==="left"||_==="right"?ne:te,st=_==="left"||_==="right"?L:Q,Re=Math.abs(nt)>0&&Number.isFinite(nt)?nt:st,Pe=_==="left"||_==="up"?-Re:Re;if(!Number.isFinite(Pe)||Pe<=vd)return null;const Ze=bt(Pe,vd,BS),We=bt(He/Ze,$a,bd);if(!Number.isFinite(We))return null;const ct=(We-$a)/(bd-$a),Ye=bt(Va+ct*(wd-Va),Va,wd);return!Number.isFinite(Ye)||Ye<=0?null:Ye}function ye(_){if(W.current||!_)return;const H=_.direction??l,N=H==="left"||H==="right"?_.deltaX:_.deltaY;!Number.isFinite(N)||Math.abs(N)<za||(W.current=!0,u?.(!0))}const de=HS({enabled:g&&!x,directions:J,elementRef:c.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:Pt.swipeMovementX,y:Pt.swipeMovementY},onSwipeStart(_){if("touches"in _||"pointerType"in _&&_.pointerType==="touch")return;const H=c.context.popupRef.current;if(!H)return;const L=Oe(H).getSelection?.();if(!L||L.isCollapsed)return;const Q=je(L.anchorNode)?L.anchorNode:L.anchorNode?.parentElement,ne=je(L.focusNode)?L.focusNode:L.focusNode?.parentElement;!we(H,Q)&&!we(H,ne)||L.removeAllRanges()},onSwipingChange(_){xd(c.context.backdropRef.current,_),!_&&!f&&pe()},swipeThreshold({element:_,direction:H}){return Ed(_,H)},canStart(_,H){const N=c.context.popupRef.current;if(!N)return!1;const L=N.ownerDocument,Q=Rs(L,_.x,_.y);if(!Q||!we(N,Q))return!1;const ne=H.nativeEvent;return!(("touches"in ne||"pointerType"in ne&&ne.pointerType==="touch")&&Pd(L,N)||ne.type==="touchstart"&&ja(Q))},onProgress(_,H){ye(H);const N=H?.direction??de.swipeDirection,L=N===void 0||N===l,Q=!!(A&&A.length>0),te=Q&&(l==="down"||l==="up")||!Q||l==="left"||l==="right"||L;let ge=_;if(X&&k>0){if(H&&Number.isFinite(H.deltaY)){const Ie=$??X.minOffset,xe=bt(Ie+H.deltaY,0,k);ge=bt((xe-X.minOffset)/X.range,0,1)}else if(K!==null)ge=K;else if(N==="down"||N==="up"){const Ie=_*k,xe=$??X.minOffset,Ce=N==="down"?xe+Ie:xe-Ie;ge=bt((Ce-X.minOffset)/X.range,0,1)}}Y({resolvedProgress:ge,shouldTrackProgress:te,notifyParent:!0})},onRelease({event:_,deltaX:H,deltaY:N,direction:L,velocityX:Q,velocityY:ne,releaseVelocityX:te,releaseVelocityY:ge}){const Ie={deltaX:H,deltaY:N,velocityX:Q,velocityY:ne,releaseVelocityX:te,releaseVelocityY:ge};function xe(Ke){const q=c.context.popupRef.current;q&&(pe(),se(!0),q.style.removeProperty("transition"),q.setAttribute(sr.endingStyle,""),Kt.flushSync(()=>{P(me({direction:Ke,...Ie}))}))}if(!A||A.length===0){if(!L){ae();return}const Ke=c.context.popupRef.current;if(!Ke){ae();return}const q=Ed(Ke,L),oe=L==="left"||L==="right"?H:N;if(!Number.isFinite(oe)){ae();return}const be=L==="left"||L==="up"?-oe:oe;if(be<=0)return ae(),!1;const Fe=L==="left"||L==="right"?Q:ne;if((L==="left"||L==="up"?-Fe:Fe)>=md&&be>0)return xe(L),!0;const Ne=be>q;return Ne?xe(L):ae(),Ne}if(l!=="down"&&l!=="up"){ae();return}if(!k||F.length===0){ae();return}const Ce=l==="down"?N:-N;if(!Number.isFinite(Ce)){ae();return}const ke=Math.sign(Ce),ze=l==="down"?ge:-ge,Ge=l==="down"?ne:-ne;let He=Number.isFinite(ze)?ze:Ge;if(ke!==0&&Math.abs(Ce)>=za&&Number.isFinite(He)){const Ke=Math.sign(He);Ke!==0&&Ke!==ke&&(He=Ge)}const nt=$??0,st=bt(nt+Ce,0,k),Re=Number.isFinite(He)&&Math.abs(He)>=gd?bt(He,-yd,yd)*US:0,Pe=h?st:bt(st+Re,0,k),Ze=De(ss,_),We=()=>(R.current=V,M?.(null,Ze),xe(l),!0);if(h){const Ke=[...F].sort((Me,Ae)=>Me.offset-Ae.offset);if(Ke.length===0)return ae(),!1;let q=0,oe=Math.abs(nt-Ke[0].offset);for(let Me=1;Me<Ke.length;Me+=1){const Ae=Math.abs(nt-Ke[Me].offset);Ae<oe&&(oe=Ae,q=Me)}let be=Ke[0];oe=Math.abs(Pe-be.offset);for(const Me of Ke){const Ae=Math.abs(Pe-Me.offset);Ae<oe&&(oe=Ae,be=Me)}const Fe=Math.sign(He),Ve=ke!==0&&Fe!==0&&Fe===ke&&Math.abs(He)>=gd;let Ne=Pe;if(Ve){const Me=bt(q+ke,0,Ke.length-1);if(Me!==q){const Ae=Ke[Me];(ke>0?Pe<Ae.offset:Pe>Ae.offset)&&(be=Ae,Ne=Ae.offset)}else if(ke>0)return We()}const Te=Math.abs(Ne-k),Ee=Math.abs(Ne-be.offset);return Te<Ee?We():(M?.(be.value,Ze),ae(),!1)}if(He>=md&&Ce>0)return We();let ct=F[0],Ye=Math.abs(Pe-ct.offset);for(const Ke of F){const q=Math.abs(Pe-Ke.offset);q<Ye&&(Ye=q,ct=Ke)}return Math.abs(Pe-k)<Ye?We():(M?.(ct.value,Ze),ae(),!1)},onDismiss(_){y?.set({swipeProgress:0,frontmostHeight:0});const H=c.context.backdropRef.current;H&&(H.style.setProperty(Ln.swipeProgress,"0"),H.style.removeProperty(Pt.height));const N=De(ss,_);if(c.setOpen(!1,N),N.isCanceled){const L=R.current;L!==void 0&&M?.(L,De(ss,_)),R.current=void 0,D.current?.(),ae();return}if(c.select("open")){const L=_;j.request(()=>{if(c.select("open")){const Q=R.current;Q!==void 0&&M?.(Q,De(ss,L)),R.current=void 0,ae(),D.current?.()}else R.current=void 0});return}R.current=void 0,se(!0)}}),ue=de.getPointerProps(),ce=de.getTouchProps(),ve=de.reset;D.current=ve,p.useEffect(()=>{const _=S??b;if(!_)return;const H=_,N=Oe(H),L=tt(N);function Q(ne){if(G.current)return;const te=B.current,ge=ne.touches[0];if(!ge||!te)return;const Ie=I?ge.clientY-te.lastY:ge.clientX-te.lastX;if(Td(ne,L)){te.allowSwipe=!1,mr(te,ge);return}if(ne.touches.length===2){mr(te,ge);return}if(Pd(N,H)||!v||!g||x){mr(te,ge);return}if(JS(te,ge,I)){mr(te,ge);return}const Ce=te.scrollTarget;if(!Ce||Ce===N.documentElement||Ce===N.body){ne.cancelable&&ne.preventDefault(),mr(te,ge);return}if(!QS(Ce,T)){ne.cancelable&&ne.preventDefault(),mr(te,ge);return}const ze=Ie;if(ze!==0){const Ge=t1(Ce,T,l,ze);te.allowSwipe?ne.cancelable&&ne.preventDefault():ne.cancelable&&Ge?(te.allowSwipe=!0,ne.preventDefault()):te.allowSwipe=!1}mr(te,ge)}return Le(N,"touchmove",Q,{passive:!1,capture:!0})},[g,x,v,b,I,T,l,S]),p.useEffect(()=>{if(!X||de.swiping)return;Y({resolvedProgress:!v||E?0:K??0,shouldTrackProgress:!0,notifyParent:!1})},[Y,d,E,f,v,K,X,de.swiping,c,y]),p.useEffect(()=>{if(f)return v||f(0),()=>{f(0)}},[f,v]),p.useEffect(()=>{v&&(ve(),ae())},[ae,v,ve]),p.useEffect(()=>()=>{y?.set({swipeProgress:0,frontmostHeight:0}),xd(c.context.backdropRef.current,!1),pe()},[pe,c,y]);const le=p.useMemo(()=>({swiping:de.swiping,getDragStyles:de.getDragStyles,swipeStrength:O??null,setSwipeDismissed(_){Sd(c.context.popupRef.current,c.context.backdropRef.current,_)}}),[c,de.getDragStyles,de.swiping,O]);function Se(){G.current=!1,B.current=null,Z.current="",U.current=!1}return w.jsx(Bw,{ref:n,className:r,render:o,...Sn(a,{onPointerDown(_){if(Z.current=_.pointerType,U.current=_.pointerType==="pen",!v||!g||x)return;const H=Oe(_.currentTarget),N=Rs(H,_.clientX,_.clientY);ja(N)||XS(N)||_.pointerType!=="touch"&&ue.onPointerDown?.(_)},onPointerMove(_){_.pointerType!=="touch"&&ue.onPointerMove?.(_)},onPointerUp(_){Z.current===_.pointerType&&(Z.current=""),_.pointerType!=="touch"&&ue.onPointerUp?.(_)},onPointerCancel(_){Z.current===_.pointerType&&(Z.current=""),_.pointerType!=="touch"&&ue.onPointerCancel?.(_)},onTouchStart(_){if(Z.current==="pen"&&U.current){U.current=!1,G.current=!1,B.current=null;return}if(!v||!g||x){G.current=!1,B.current=null;return}const N=_.touches[0];if(!N)return;if(kd(_)){G.current=!1,B.current=null;return}const L=Oe(_.currentTarget),Q=Rs(L,N.clientX,N.clientY);if(G.current=ja(Q),G.current){B.current=null;return}const ne=S??b,te=ut(_.nativeEvent),ge=je(te)?te:null;if(ne&&ge&&!we(ne,ge)){G.current=!0,B.current=null;return}let Ie=null,xe=!1;ne&&ge&&(Ie=Hr(ge,ne,T),xe=Hr(ge,ne,z)!=null);let Ce=null;Ie&&(Ce=e1(Ie,T,l)?null:!1),B.current={startX:N.clientX,startY:N.clientY,lastX:N.clientX,lastY:N.clientY,scrollTarget:Ie,hasCrossAxisScrollableContent:xe,allowSwipe:Ce,preserveNativeCrossAxisScroll:!1},ce.onTouchStart?.(_)},onTouchMove(_){if(G.current||kd(_))return;const H=B.current;H?.preserveNativeCrossAxisScroll||H?.allowSwipe===!1||H?.scrollTarget!=null&&!H.allowSwipe||ce.onTouchMove?.(_)},onTouchEnd(_){Se(),ce.onTouchEnd?.(_)},onTouchCancel(_){Se(),ce.onTouchCancel?.(_)},"data-nested-dialog-open":void 0}),children:w.jsx(ld.Provider,{value:le,children:i})})});function Sd(e,t,n){if(n){e?.setAttribute(un.swipeDismiss,""),t?.setAttribute(un.swipeDismiss,"");return}e?.removeAttribute(un.swipeDismiss),t?.removeAttribute(un.swipeDismiss)}function xd(e,t){if(e){if(t){e.setAttribute(un.swiping,"");return}e.removeAttribute(un.swiping)}}function ja(e){return!!e?.closest(lu)}function XS(e){return!!e?.closest(GS)}function Ed(e,t){const n=t==="left"||t==="right"?e.offsetWidth:e.offsetHeight;return Math.max(n*.5,za)}function Cd(e,t){return e instanceof t.HTMLInputElement&&e.type==="range"}function qS(e){return je(e)?e.tagName==="INPUT"||e.tagName==="TEXTAREA":!1}function KS(e,t){const n=je(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=je(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||we(t,n)||we(t,r)}function Pd(e,t){const n=kt(e);if(!!(n&&we(t,n))&&qS(n)){const{selectionStart:s,selectionEnd:i}=n;if(s!=null&&i!=null&&s<i)return!0}const o=e.getSelection?.();return!o||o.isCollapsed?!1:KS(o,t)}function Td(e,t){const n=e.composedPath();return n?n.some(r=>Cd(r,t)):Cd(ut(e),t)}function kd(e){return Td(e.nativeEvent,tt(e.currentTarget))}function mr(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function JS(e,t,n){if(e.preserveNativeCrossAxisScroll)return!0;if(e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;const r=n?t.clientY-e.startY:t.clientX-e.startX,o=n?t.clientX-e.startX:t.clientY-e.startY,s=Math.abs(r),i=Math.abs(o);return i<6||i<=s+2?!1:(e.preserveNativeCrossAxisScroll=!0,!0)}function QS(e,t){return t==="vertical"?e.scrollHeight>e.clientHeight:e.scrollWidth>e.clientWidth}function Id(e,t){if(t==="vertical"){const r=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:r}}const n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function e1(e,t,n){const{offset:r,max:o}=Id(e,t),s=Od(n,t);return s===null?!1:s?r<=0:r>=o}function t1(e,t,n,r){const{offset:o,max:s}=Id(e,t),i=Od(n,t);return i===null||!(i?r>0:r<0)?!1:i?o<=0:o>=s}function Od(e,t){return t==="vertical"?e==="down"?!0:e==="up"?!1:null:e==="right"?!0:e==="left"?!1:null}const n1=p.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function r1(e=!1){const t=p.useContext(n1);if(!t&&!e)throw new Error(dt(86));return t}const o1=function(t){const n=qt(),r=t.controlId===void 0?n:t.controlId,[o,s]=p.useState(r),[i,a]=p.useState(t.labelId),[c,l]=p.useState([]),u=wt(()=>new Map),{messageIds:f}=Fn(),d=ie((y,v)=>{const g=u.current;if(v===void 0){g.delete(y);return}g.set(y,v),s(E=>{if(g.size===0)return;let C;for(const S of g.values()){if(E!==void 0&&S===E)return E;C===void 0&&(C=S)}return C})}),h=p.useCallback(y=>Sn({"aria-describedby":f.concat(c).join(" ")||void 0},y),[f,c]),m=p.useMemo(()=>({controlId:o,registerControlId:d,labelId:i,setLabelId:a,messageIds:c,setMessageIds:l,getDescriptionProps:h}),[o,d,i,a,c,l,h]);return w.jsx(qf.Provider,{value:m,children:t.children})};function As(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Ds=Object.keys(Os);function s1(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of Ds)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function i1(e){const{formRef:t,clearErrors:n}=jr(),{setValidityData:r,validate:o,validityData:s,validationDebounceTime:i,invalid:a,markedDirtyRef:c,state:l,name:u,shouldValidateOnChange:f}=e,{controlId:d,getDescriptionProps:h}=Fn(),m=Gt(),y=p.useRef(null),v=ie(async(C,S=!1)=>{const b=y.current;if(!b)return;if(S){if(l.valid!==!1)return;const $=b.validity;if(!$.valueMissing){const k={value:C,state:{...Os,valid:!0},error:"",errors:[],initialValue:s.initialValue};if(b.setCustomValidity(""),d){const O=t.current.fields.get(d);O&&t.current.fields.set(d,{...O,...As(k,!1)})}r(k);return}const M=Ds.reduce((k,O)=>(k[O]=$[O],k),{});if(!M.valid&&!s1(M))return}function x($){const M=Ds.reduce((O,P)=>(O[P]=$.validity[P],O),{});let k=!1;for(const O of Ds)if(O!=="valid"){if(O==="valueMissing"&&M[O])k=!0;else if(M[O])return M}return k&&!c.current&&(M.valid=!0,M.valueMissing=!1),M}m.clear();let T=null,I=[];const z=x(b);let A;const F=f();if(b.validationMessage&&!F)A=b.validationMessage,I=[b.validationMessage];else{const $=Array.from(t.current.fields.values()).reduce((k,O)=>(O.name&&(k[O.name]=O.getValue()),k),{}),M=o(C,$);typeof M=="object"&&M!==null&&"then"in M?T=await M:T=M,T!==null?(z.valid=!1,z.customError=!0,Array.isArray(T)?(I=T,b.setCustomValidity(T.join(`
|
|
10
|
+
`))):T&&(I=[T],b.setCustomValidity(T))):F&&(b.setCustomValidity(""),z.customError=!1,b.validationMessage?(A=b.validationMessage,I=[b.validationMessage]):b.validity.valid&&!z.valid&&(z.valid=!0))}const V={value:C,state:z,error:A??(Array.isArray(T)?T[0]:T??""),errors:I,initialValue:s.initialValue};if(d){const $=t.current.fields.get(d);$&&t.current.fields.set(d,{...$,...As(V,a)})}r(V)}),g=p.useCallback((C={})=>Sn(h,l.valid===!1?{"aria-invalid":!0}:mt,C),[h,l.valid]),E=p.useCallback((C={})=>Sn({onChange(S){if(S.nativeEvent.defaultPrevented)return;if(n(u),!f()){v(S.currentTarget.value,!0);return}const b=S.currentTarget;if(b.value===""){v(b.value);return}m.clear(),i?m.start(i,()=>{v(b.value)}):v(b.value)}},g(C)),[g,n,u,m,v,i,f]);return p.useMemo(()=>({getValidationProps:g,getInputValidationProps:E,inputRef:y,commit:v}),[g,E,v])}function a1(e){const{commit:t,invalid:n,markedDirtyRef:r,name:o,setValidityData:s,validityData:i}=e,{formRef:a}=jr(),c=p.useRef(null),l=p.useRef(null),u=p.useRef(null),f=ie(()=>{const v=l.current;if(v)return v.getValue?v.getValue():v.value}),d=ie((v=!0)=>{const g=l.current;if(!g)return;let E=g.value;E===void 0&&(E=f()),r.current=!0,v?Kt.flushSync(()=>t(E)):t(E)});function h(){const v=l.current;!v||!v.id||a.current.fields.set(v.id,{getValue:f,name:o,controlRef:v.controlRef??u,validityData:As(i,n),validate:d})}function m(v=l.current?.id){v&&a.current.fields.delete(v)}function y(){const v=l.current;if(!v)return;let g=v.value;g===void 0&&(g=f()),i.initialValue===null&&g!==null&&s(E=>({...E,initialValue:g}))}return he(()=>{const v=l.current;!v||!v.id||a.current.fields.set(v.id,{getValue:f,name:o,controlRef:v.controlRef??u,validityData:As(i,n),validate:d})},[a,f,n,o,d,i]),he(()=>{const v=a.current.fields;return()=>{const g=l.current?.id;g&&v.delete(g)}},[a]),ie((v,g)=>{if(!g){c.current===v&&(c.current=null,m(),l.current=null);return}const E=l.current?.id;c.current=v,l.current=g,E&&E!==g.id&&m(E),y(),h()})}const c1=p.forwardRef(function(t,n){const{errors:r,validationMode:o,submitAttemptedRef:s}=jr(),{render:i,className:a,validate:c,validationDebounceTime:l=0,validationMode:u=o,name:f,disabled:d=!1,invalid:h,dirty:m,touched:y,actionsRef:v,style:g,...E}=t,{disabled:C}=r1(),S=ie(c||(()=>null)),b=C||d,[x,T]=p.useState(!1),[I,z]=p.useState(!1),[A,F]=p.useState(!1),[V,$]=p.useState(!1),M=m??I,k=y??x,O=p.useRef(!1),P=ie(pe=>{m===void 0&&(pe&&(O.current=!0),z(pe))}),R=ie(pe=>{y===void 0&&T(pe)}),D=ie(()=>u==="onChange"||u==="onSubmit"&&s.current),j=!!f&&Object.hasOwn(r,f)&&r[f]!==void 0,W=h===!0||j,[Z,U]=p.useState({state:Os,error:"",errors:[],value:null,initialValue:null}),G=!W&&Z.state.valid,B=p.useMemo(()=>({disabled:b,touched:k,dirty:M,valid:G,filled:A,focused:V}),[b,k,M,G,A,V]),X=i1({setValidityData:U,validate:S,validityData:Z,validationDebounceTime:l,invalid:W,markedDirtyRef:O,state:B,name:f,shouldValidateOnChange:D}),K=p.useCallback(()=>{O.current=!0,X.commit(Z.value)},[X,Z]),J=a1({commit:X.commit,invalid:W,markedDirtyRef:O,name:f,setValidityData:U,validityData:Z});p.useImperativeHandle(v,()=>({validate:K}),[K]);const se=p.useMemo(()=>({invalid:W,name:f,validityData:Z,setValidityData:U,disabled:b,touched:k,setTouched:R,dirty:M,setDirty:P,filled:A,setFilled:F,focused:V,setFocused:$,validate:S,validationMode:u,validationDebounceTime:l,shouldValidateOnChange:D,state:B,markedDirtyRef:O,registerFieldControl:J,validation:X}),[W,f,Z,b,k,R,M,P,A,F,V,$,S,u,l,D,B,J,X]),ae=qe("div",t,{ref:n,state:B,props:E,stateAttributesMapping:pr});return w.jsx(Yf.Provider,{value:se,children:ae})}),Co=p.forwardRef(function(t,n){return w.jsx(o1,{children:w.jsx(c1,{...t,ref:n})})}),_d=p.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,nativeLabel:a=!0,...c}=t,l=hr(!1),{labelId:u}=Fn(),f=p.useRef(null),d=pS({id:u??i,native:a});return qe("label",t,{ref:[n,f],state:l.state,props:[d,c],stateAttributesMapping:pr})}),l1={...pr,...tn},Ha=p.forwardRef(function(t,n){const{render:r,id:o,className:s,match:i,style:a,...c}=t,l=qt(o),{validityData:u,state:f,name:d}=hr(!1),{setMessageIds:h}=Fn(),{errors:m}=jr(),y=d?m[d]:null,v=typeof i=="string";let g=!1;i===!0?g=!0:v?g=!!u.state[i]:g=!!y||u.state.valid===!1;const{mounted:E,transitionStatus:C,setMounted:S}=yo(g);he(()=>{if(!(!g||!l))return h(k=>k.concat(l)),()=>{h(k=>k.filter(O=>O!==l))}},[g,l,h]);const b=p.useRef(null),[x,T]=p.useState(null),[I,z]=p.useState(null),A=u.errors.length>1?w.jsx("ul",{children:u.errors.map(k=>w.jsx("li",{children:k},k))}):u.error,F=v?A:y||A;let V=u.error;y!=null?V=Array.isArray(y)?JSON.stringify(y):y:u.errors.length>1&&(V=JSON.stringify(u.errors)),g&&V!==I&&(z(V),T(F)),xn({open:g,ref:b,onComplete(){g||S(!1)}});const $={...f,transitionStatus:C},M=qe("div",t,{ref:[n,b],state:$,props:[{id:l,children:g?F:x},c],stateAttributesMapping:l1,enabled:E});return E?M:null}),Za=p.forwardRef(function(t,n){const{render:r,className:o,id:s,name:i,value:a,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:f=!1,style:d,...h}=t,{state:m,name:y,disabled:v,setTouched:g,setDirty:E,validityData:C,setFocused:S,setFilled:b,validationMode:x,validation:T}=hr(),I=v||c,z=y??i,A={...m,disabled:I},{labelId:F}=Fn(),V=Da({id:s});he(()=>{const D=a!=null;T.inputRef.current?.value||D&&a!==""?b(!0):D&&a===""&&b(!1)},[T.inputRef,b,a]);const $=p.useRef(null);he(()=>{f&&$.current===kt(Oe($.current))&&S(!0)},[f,S]);const[M]=So({controlled:a,default:u,name:"FieldControl",state:"value"}),k=a!==void 0,O=k?M:void 0,P=ie(()=>T.inputRef.current?.value);return Aa(T.inputRef,{id:V,value:O,getValue:P}),qe("input",t,{ref:[n,$],state:A,props:[{id:V,disabled:I,name:z,ref:T.inputRef,"aria-labelledby":F,autoFocus:f,...k?{value:O}:{defaultValue:u},onChange(D){const j=D.currentTarget.value;l?.(j,De(ar,D.nativeEvent)),E(j!==C.initialValue),b(j!=="")},onFocus(){S(!0)},onBlur(D){g(!0),S(!1),x==="onBlur"&&T.commit(D.currentTarget.value)},onKeyDown(D){D.currentTarget.tagName==="INPUT"&&D.key==="Enter"&&(g(!0),T.commit(D.currentTarget.value))}},T.getInputValidationProps(),h],stateAttributesMapping:pr})}),Ns=p.forwardRef(function(t,n){const{render:r,className:o,validationMode:s="onSubmit",errors:i,onSubmit:a,onFormSubmit:c,actionsRef:l,style:u,...f}=t,d=p.useRef({fields:new Map}),h=p.useRef(!1),m=p.useRef(!1),y=ie(x=>{x&&(x.focus(),x.tagName==="INPUT"&&x.select())}),[v,g]=p.useState(i);Is(i,()=>{g(i)}),p.useEffect(()=>{if(!h.current)return;h.current=!1;const x=Array.from(d.current.fields.values()).filter(T=>T.validityData.state.valid===!1);x.length&&y(x[0].controlRef.current)},[v,y]);const E=p.useCallback(x=>{const T=Array.from(d.current.fields.values());if(x){const I=T.find(z=>z.name===x);I&&I.validate(!1)}else T.forEach(I=>{I.validate(!1)})},[]);p.useImperativeHandle(l,()=>({validate:E}),[E]);const C=qe("form",t,{ref:n,props:[{noValidate:!0,onSubmit(x){m.current=!0;let T=Array.from(d.current.fields.values());T.forEach(z=>{z.validate()}),T=Array.from(d.current.fields.values());const I=T.filter(z=>!z.validityData.state.valid);if(I.length)x.preventDefault(),y(I[0].controlRef.current);else if(h.current=!0,a?.(x),c){x.preventDefault();const z=T.reduce((A,F)=>(F.name&&(A[F.name]=F.getValue()),A),{});c(z,M0(ar,x.nativeEvent))}}},f]}),S=ie(x=>{if(x&&v&&mt.hasOwnProperty.call(v,x)){const T={...v};delete T[x],g(T)}}),b=p.useMemo(()=>({formRef:d,validationMode:s,errors:v??mt,clearErrors:S,submitAttemptedRef:m}),[d,s,v,S]);return w.jsx(Xf.Provider,{value:b,children:C})}),Rd=p.createContext(void 0);function zn(e){const t=p.useContext(Rd);if(t===void 0&&!e)throw new Error(dt(47));return t}function u1(){return{...qu(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const f1={...Ku,disabled:fe(e=>e.disabled),instantType:fe(e=>e.instantType),openMethod:fe(e=>e.openMethod),openChangeReason:fe(e=>e.openChangeReason),modal:fe(e=>e.modal),focusManagerModal:fe(e=>e.focusManagerModal),stickIfOpen:fe(e=>e.stickIfOpen),titleElementId:fe(e=>e.titleElementId),descriptionElementId:fe(e=>e.descriptionElementId),openOnHover:fe(e=>e.openOnHover),closeDelay:fe(e=>e.closeDelay),hasViewport:fe(e=>e.hasViewport)};class Wa extends jo{constructor(t){const n={...u1(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Bt,triggerElements:new ps},f1)}setOpen=(t,n)=>{const r=n.reason===Nt,o=n.reason===Nr&&n.event.detail===0,s=!t&&(n.reason===mu||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const i=()=>{const a={open:t,openChangeReason:n.reason},c=n.trigger?.id??null;(c||t)&&(a.activeTriggerId=c,a.activeTriggerElement=n.trigger??null),this.update(a)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(i0,()=>{this.set("stickIfOpen",!1)}),Kt.flushSync(i)):i(),o||s?this.set("instantType",o?"click":"dismiss"):n.reason===cr?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const r=wt(()=>new Wa(n)).current,o=t??r;return oo(r.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function Md({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,modal:i=!1,handle:a,triggerId:c,defaultTriggerId:l=null}=e,u=Wa.useStore(a?.store,{modal:i,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});xa(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp("openProp",n),u.useControlledProp("triggerIdProp",c);const f=u.useState("open"),d=u.useState("payload");u.useContextCallback("onOpenChange",o),u.useContextCallback("onOpenChangeComplete",s);const{openMethod:h,triggerProps:m}=Ea(f);Yu(u);const{forceUnmount:y}=Xu(f,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});p.useEffect(()=>{f||u.context.stickIfOpenTimeout.clear()},[u,f]);const v=p.useCallback(()=>{u.setOpen(!1,De(gu))},[u]);p.useImperativeHandle(e.actionsRef,()=>({unmount:y,close:v}),[y,v]);const g=Qu({popupStore:u,onOpenChange:u.setOpen}),E=da(g,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),C=rf(g),{getReferenceProps:S,getFloatingProps:b,getTriggerProps:x}=vo([E,C]),T=p.useMemo(()=>S(m),[S,m]),I=p.useMemo(()=>x(m),[x,m]),z=p.useMemo(()=>b(),[b]);u.useSyncedValues({modal:i,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:I,popupProps:z,floatingRootContext:g,nested:qn()!=null});const A=p.useMemo(()=>({store:u}),[u]);return w.jsx(Rd.Provider,{value:A,children:typeof t=="function"?t({payload:d}):t})}function d1(e){return zn(!0)?w.jsx(Md,{props:e}):w.jsx(V0,{children:w.jsx(Md,{props:e})})}const p1=300,h1=p.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,handle:a,payload:c,openOnHover:l=!1,delay:u=p1,closeDelay:f=0,id:d,style:h,...m}=t,y=zn(!0),v=a?.store??y?.store;if(!v)throw new Error(dt(74));const g=qt(d),E=v.useState("isTriggerActive",g),C=v.useState("floatingRootContext"),S=v.useState("isOpenedByTrigger",g),b=p.useRef(null),{registerTrigger:x,isMountedByThisTrigger:T}=Gu(g,b,v,{payload:c,disabled:s,openOnHover:l,closeDelay:f}),I=v.useState("openChangeReason"),z=v.useState("stickIfOpen"),A=v.useState("openMethod"),F=v.useState("focusManagerModal"),V=$b(C,{enabled:C!=null&&l&&(A!=="touch"||I!==Nr),mouseOnly:!0,move:!1,handleClose:Yb(),restMs:u,delay:{close:f},triggerElementRef:b,isActiveTrigger:E,isClosing:()=>v.select("transitionStatus")==="ending"}),$=fa(C,{enabled:C!=null,stickIfOpen:z}),M=vo([$]),k=v.useState("triggerProps",T),O={disabled:s,open:S},{getButtonProps:P,buttonRef:R}=Dr({disabled:s,native:i}),D=p.useMemo(()=>({open(G){return G&&I===Nr?df.open(G):ff.open(G)}}),[I]),j=qe("button",t,{state:O,ref:[R,n,x,b],props:[M.getReferenceProps(),V,k,{[Ji]:"",id:g},m,P],stateAttributesMapping:D}),{preFocusGuardRef:W,handlePreFocusGuardFocus:Z,handleFocusTargetFocus:U}=gS(v,b);return E&&!F?w.jsxs(p.Fragment,{children:[w.jsx(An,{ref:W,onFocus:Z}),w.jsx(p.Fragment,{children:j},g),w.jsx(An,{ref:v.context.triggerFocusTargetRef,onFocus:U})]}):w.jsx(p.Fragment,{children:j},g)}),Ad=p.createContext(void 0);function m1(){const e=p.useContext(Ad);if(e===void 0)throw new Error(dt(45));return e}const g1=p.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=zn();return s.useState("mounted")||r?w.jsx(Ad.Provider,{value:r,children:w.jsx(ca,{ref:n,...o})}):null}),Dd=p.createContext(void 0);function Nd(){const e=p.useContext(Dd);if(!e)throw new Error(dt(46));return e}const y1=p.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:a="bottom",align:c="center",sideOffset:l=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:y=!1,collisionAvoidance:v=d0,style:g,...E}=t,{store:C}=zn(),S=m1(),b=z0(),x=C.useState("floatingRootContext"),T=C.useState("mounted"),I=C.useState("open"),z=C.useState("openChangeReason"),A=C.useState("activeTriggerElement"),F=C.useState("modal"),V=C.useState("openMethod"),$=C.useState("positionerElement"),M=C.useState("instantType"),k=C.useState("transitionStatus"),O=C.useState("hasViewport"),P=p.useRef(null),R=cu($,!1,!1),D=lf({anchor:s,floatingRootContext:x,positionMethod:i,mounted:T,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:m,disableAnchorTracking:y,keepMounted:S,nodeId:b,collisionAvoidance:v,adaptiveOrigin:O?ew:void 0}),j=x.useState("domReferenceElement");he(()=>{const G=j,B=P.current;if(G&&(P.current=G),B&&G&&G!==B){C.set("instantType",void 0);const X=new AbortController;return R(()=>{C.set("instantType","trigger-change")},X.signal),()=>{X.abort()}}},[j,R,C]);const W={open:I,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:M};Kf(I&&F===!0&&z!==Nt,V==="touch",$,A);const Z=p.useCallback(G=>{C.set("positionerElement",G)},[C]),U=pf(t,W,{styles:D.positionerStyles,transitionStatus:k,props:E,refs:[n,Z],hidden:!T,inert:!I});return w.jsxs(Dd.Provider,{value:D,children:[T&&F===!0&&z!==Nt&&w.jsx(Ia,{ref:C.context.internalBackdropRef,inert:os(!I),cutout:A}),w.jsx($0,{id:b,children:U})]})}),v1=p.createContext(void 0);function b1(){const[e,t]=p.useState(0),n=ie(()=>(t(o=>o+1),()=>{t(o=>Math.max(0,o-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function w1(e){const{value:t,children:n}=e;return w.jsx(v1.Provider,{value:t,children:n})}const S1={...En,...tn},x1=p.forwardRef(function(t,n){const{className:r,render:o,initialFocus:s,finalFocus:i,style:a,...c}=t,{store:l}=zn(),u=Nd(),f=rd()!=null,{context:d,hasClosePart:h}=b1(),m=l.useState("open"),y=l.useState("openMethod"),v=l.useState("instantType"),g=l.useState("transitionStatus"),E=l.useState("popupProps"),C=l.useState("titleElementId"),S=l.useState("descriptionElementId"),b=l.useState("modal"),x=l.useState("mounted"),T=l.useState("openChangeReason"),I=l.useState("activeTriggerElement"),z=l.useState("floatingRootContext");xn({open:m,ref:l.context.popupRef,onComplete(){m&&l.context.onOpenChangeComplete?.(!0)}});const A=l.useState("disabled"),F=l.useState("openOnHover"),V=l.useState("closeDelay");Lb(z,{enabled:F&&!A,closeDelay:V});function $(D){return D==="touch"?l.context.popupRef.current:!0}const M=s===void 0?$:s,k={open:m,side:u.side,align:u.align,instant:v,transitionStatus:g},O=b!==!1&&h;l.useSyncedValue("focusManagerModal",O);const P=p.useCallback(D=>{l.set("popupElement",D)},[l]),R=qe("div",t,{state:k,ref:[n,l.context.popupRef,P],props:[E,{"aria-labelledby":C,"aria-describedby":S,onKeyDown(D){f&&ks.has(D.key)&&D.stopPropagation()}},wa(g),c],stateAttributesMapping:S1});return w.jsx(ls,{context:z,openInteractionType:y,modal:O,disabled:!x||T===Nt,initialFocus:M,returnFocus:i,restoreFocus:"popup",previousFocusableElement:it(I)?I:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:w.jsx(w1,{value:d,children:R})})}),E1=p.forwardRef(function(t,n){const{className:r,render:o,style:s,...i}=t,{store:a}=zn(),c=a.useState("open"),{arrowRef:l,side:u,align:f,arrowUncentered:d,arrowStyles:h}=Nd();return qe("div",t,{state:{open:c,side:u,align:f,uncentered:d},ref:[n,l],props:[{style:h,"aria-hidden":!0},i],stateAttributesMapping:En})}),C1={...En,...tn},P1=p.forwardRef(function(t,n){const{className:r,render:o,style:s,...i}=t,{store:a}=zn(),c=a.useState("open"),l=a.useState("mounted"),u=a.useState("transitionStatus"),f=a.useState("openChangeReason");return qe("div",t,{state:{open:c,transitionStatus:u},ref:[a.context.backdropRef,n],props:[{role:"presentation",hidden:!l,style:{pointerEvents:f===Nt?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i],stateAttributesMapping:C1})}),T1=p.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=zn(),c=qt(i.id);return he(()=>(a.set("titleElementId",c),()=>{a.set("titleElementId",void 0)}),[a,c]),qe("h2",t,{ref:n,props:[{id:c},i]})}),k1=p.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=zn(),c=qt(i.id);return he(()=>(a.set("descriptionElementId",c),()=>{a.set("descriptionElementId",void 0)}),[a,c]),qe("p",t,{ref:n,props:[{id:c},i]})}),Fs="base-ui-disable-scrollbar",Fd={className:Fs,getElement(e){return w.jsx("style",{nonce:e,href:Fs,precedence:"base-ui:low",children:`.${Fs}{scrollbar-width:none}.${Fs}::-webkit-scrollbar{display:none}`})}},$n=1;function Ld(e,t){return Math.max(0,e-t)}function I1(e,t){if(t<=0)return 0;const n=bt(e,0,t),r=n,o=t-n,s=r<=$n,i=o<=$n;return s&&i?r<=o?0:t:s?0:i?t:n}const zd=p.createContext(null),$d=p.createContext(null);function Zr(){const e=p.useContext(zd);if(e===null)throw new Error(dt(60));return e}function Vd(){const e=p.useContext($d);if(e===null)throw new Error(dt(61));return e}const Be={id:fe(e=>e.id),labelId:fe(e=>e.labelId),modal:fe(e=>e.modal),multiple:fe(e=>e.multiple),items:fe(e=>e.items),itemToStringLabel:fe(e=>e.itemToStringLabel),itemToStringValue:fe(e=>e.itemToStringValue),isItemEqualToValue:fe(e=>e.isItemEqualToValue),value:fe(e=>e.value),hasSelectedValue:fe(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Vr(t,r)!==""}),hasNullItemLabel:fe((e,t)=>t?Kw(e.items):!1),open:fe(e=>e.open),mounted:fe(e=>e.mounted),forceMount:fe(e=>e.forceMount),transitionStatus:fe(e=>e.transitionStatus),openMethod:fe(e=>e.openMethod),activeIndex:fe(e=>e.activeIndex),selectedIndex:fe(e=>e.selectedIndex),isActive:fe((e,t)=>e.activeIndex===t),isSelected:fe((e,t,n)=>{const r=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(s=>$r(n,s,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:$r(n,o,r)}),isSelectedByFocus:fe((e,t)=>e.selectedIndex===t),popupProps:fe(e=>e.popupProps),triggerProps:fe(e=>e.triggerProps),triggerElement:fe(e=>e.triggerElement),positionerElement:fe(e=>e.positionerElement),listElement:fe(e=>e.listElement),scrollUpArrowVisible:fe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:fe(e=>e.scrollDownArrowVisible),hasScrollArrows:fe(e=>e.hasScrollArrows)};function O1(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:a,name:c,form:l,autoComplete:u,disabled:f=!1,readOnly:d=!1,required:h=!1,modal:m=!0,actionsRef:y,inputRef:v,onOpenChangeComplete:g,items:E,multiple:C=!1,itemToStringLabel:S,itemToStringValue:b,isItemEqualToValue:x=Gw,highlightItemOnHover:T=!0,children:I}=e,{clearErrors:z}=jr(),{setDirty:A,setTouched:F,setFocused:V,shouldValidateOnChange:$,validityData:M,setFilled:k,name:O,disabled:P,validation:R,validationMode:D}=hr(),j=Da({id:t}),W=P||f,Z=O??c,[U,G]=So({controlled:n,default:C?r??Sl:r,name:"Select",state:"value"}),[B,X]=So({controlled:s,default:i,name:"Select",state:"open"}),K=p.useRef([]),J=p.useRef([]),se=p.useRef(null),ae=p.useRef(null),pe=p.useRef(0),Y=p.useRef(null),me=p.useRef([]),ye=p.useRef(!1),de=p.useRef(!1),ue=p.useRef(null),ce=p.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ve=p.useRef(!1),{mounted:le,setMounted:Se,transitionStatus:_}=yo(B),{openMethod:H,triggerProps:N}=Ea(B),L=wt(()=>new wl({id:j,labelId:void 0,modal:m,multiple:C,itemToStringLabel:S,itemToStringValue:b,isItemEqualToValue:x,value:U,open:B,mounted:le,transitionStatus:_,items:E,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Q=Ue(L,Be.activeIndex),ne=Ue(L,Be.selectedIndex),te=Ue(L,Be.triggerElement),ge=Ue(L,Be.positionerElement),Ie=yS(H),xe=H??Ie,Ce=p.useMemo(()=>C&&Array.isArray(U)&&U.length===0?"":Vr(U,b),[C,U,b]),ke=p.useMemo(()=>C&&Array.isArray(U)?U.map(Te=>Vr(Te,b)):Vr(U,b),[C,U,b]),ze=vt(L.state.triggerElement),Ge=ie(()=>ke);Aa(ze,{id:j,value:U,getValue:Ge});const He=p.useRef(U);he(()=>{U!==He.current&&L.set("forceMount",!0)},[L,U]),he(()=>{k(C?Array.isArray(U)&&U.length>0:U!=null)},[C,U,k]),he(function(){if(B)return;const Ee=me.current;if(C){const Ae=Array.isArray(U)?U:[];if(Ae.length===0){L.set("selectedIndex",null);return}const Xe=Ae[Ae.length-1],Je=xo(Ee,Xe,x);L.set("selectedIndex",Je===-1?null:Je);return}const Me=xo(Ee,U,x);L.set("selectedIndex",Me===-1?null:Me)},[C,B,U,me,x,L]),Is(U,()=>{z(Z),A(U!==M.initialValue),$()?R.commit(U):R.commit(U,!0)});const nt=ie((Te,Ee)=>{if(a?.(Te,Ee),!Ee.isCanceled&&(X(Te),!Te&&(Ee.reason===cr||Ee.reason===ta)&&(F(!0),V(!1),D==="onBlur"&&R.commit(U)),!Te&&L.state.activeIndex!==null)){const Me=K.current[L.state.activeIndex];queueMicrotask(()=>{Me?.setAttribute("tabindex","-1")})}}),st=ie(()=>{Se(!1),L.update({activeIndex:null,openMethod:null}),g?.(!1)});xn({enabled:!y,open:B,ref:se,onComplete(){B||st()}}),p.useImperativeHandle(y,()=>({unmount:st}),[st]);const Re=ie((Te,Ee)=>{o?.(Te,Ee),!Ee.isCanceled&&G(Te)}),Pe=ie(()=>{const Te=L.state.listElement||se.current;if(!Te)return;const Ee=Ld(Te.scrollHeight,Te.clientHeight),Me=I1(Te.scrollTop,Ee),Ae=Me>0,Xe=Me<Ee;L.state.scrollUpArrowVisible!==Ae&&L.set("scrollUpArrowVisible",Ae),L.state.scrollDownArrowVisible!==Xe&&L.set("scrollDownArrowVisible",Xe)}),Ze=Ju({open:B,onOpenChange:nt,elements:{reference:te,floating:ge}}),We=fa(Ze,{enabled:!d&&!W,event:"mousedown"}),ct=da(Ze,{bubbles:!1}),Ye=Zb(Ze,{enabled:!d&&!W,listRef:K,activeIndex:Q,selectedIndex:ne,disabledIndices:Sl,onNavigate(Te){Te===null&&!B||L.set("activeIndex",Te)},focusItemOnHover:T}),Zt=Ub(Ze,{enabled:!d&&!W&&(B||!C),listRef:J,activeIndex:Q,selectedIndex:ne,onMatch(Te){B?L.set("activeIndex",Te):Re(me.current[Te],De("none"))},onTypingChange(Te){ye.current=Te}}),{getReferenceProps:Vt,getFloatingProps:Ke,getItemProps:q}=vo([We,ct,Ye,Zt]),oe=p.useMemo(()=>Sn(Vt(),N,j?{id:j}:mt),[Vt,N,j]);xa(()=>{L.update({popupProps:Ke(),triggerProps:oe})}),he(()=>{L.update({id:j,modal:m,multiple:C,value:U,open:B,mounted:le,transitionStatus:_,popupProps:Ke(),triggerProps:oe,items:E,itemToStringLabel:S,itemToStringValue:b,isItemEqualToValue:x,openMethod:xe})},[L,j,m,C,U,B,le,_,Ke,oe,E,S,b,x,xe]);const be=p.useMemo(()=>({store:L,name:Z,required:h,disabled:W,readOnly:d,multiple:C,highlightItemOnHover:T,setValue:Re,setOpen:nt,listRef:K,popupRef:se,scrollHandlerRef:ae,handleScrollArrowVisibility:Pe,scrollArrowsMountedCountRef:pe,getItemProps:q,events:Ze.context.events,valueRef:Y,valuesRef:me,labelsRef:J,typingRef:ye,selectionRef:ce,selectedItemTextRef:ue,validation:R,onOpenChangeComplete:g,keyboardActiveRef:de,alignItemWithTriggerActiveRef:ve,initialValueRef:He}),[L,Z,h,W,d,C,T,Re,nt,q,Ze.context.events,R,g,Pe]),Fe=or(v,R.inputRef),Ve=C&&Array.isArray(U)&&U.length>0,Ne=C?void 0:Z,Qe=p.useMemo(()=>!C||!Array.isArray(U)||!Z?null:U.map(Te=>{const Ee=Vr(Te,b);return w.jsx("input",{type:"hidden",form:l,name:Z,value:Ee},Ee)}),[C,U,l,Z,b]);return w.jsx(zd.Provider,{value:be,children:w.jsxs($d.Provider,{value:Ze,children:[I,w.jsx("input",{...R.getInputValidationProps({onFocus(){L.state.triggerElement?.focus({focusVisible:!0})},onChange(Te){if(Te.nativeEvent.defaultPrevented)return;const Ee=Te.currentTarget.value,Me=De(ar,Te.nativeEvent);function Ae(){if(C)return;const Xe=me.current.find(Je=>Vr(Je,b).toLowerCase()===Ee.toLowerCase()||Jw(Je,S).toLowerCase()===Ee.toLowerCase());Xe!=null&&(A(Xe!==M.initialValue),Re(Xe,Me),$()&&R.commit(Xe))}L.set("forceMount",!0),queueMicrotask(Ae)}}),id:j&&Ne==null?`${j}-hidden-input`:void 0,form:l,name:Ne,autoComplete:u,value:Ce,disabled:W,required:h&&!Ve,readOnly:d,ref:Fe,style:Z?Jl:ts,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Qe]})})}const Ls=2,_1=400,jd=200,R1={...df,...pr,value:()=>null},M1=p.forwardRef(function(t,n){const{render:r,className:o,id:s,disabled:i=!1,nativeButton:a=!0,style:c,...l}=t,{setTouched:u,setFocused:f,validationMode:d,state:h,disabled:m}=hr(),{labelId:y}=Fn(),{store:v,setOpen:g,selectionRef:E,validation:C,readOnly:S,required:b,alignItemWithTriggerActiveRef:x,disabled:T,keyboardActiveRef:I}=Zr(),z=m||T||i,A=Ue(v,Be.open),F=Ue(v,Be.value),V=Ue(v,Be.triggerProps),$=Ue(v,Be.positionerElement),M=Ue(v,Be.listElement),k=Ue(v,Be.id),O=Ue(v,Be.labelId),P=Ue(v,Be.hasSelectedValue),R=!P&&A,D=Ue(v,Be.hasNullItemLabel,R),j=s??k,W=tS(y,O);Da({id:j});const Z=vt($),U=p.useRef(null),{getButtonProps:G,buttonRef:B}=Dr({disabled:z,native:a}),X=ie(de=>{v.set("triggerElement",de)}),K=or(n,U,B,X),J=Gt(),se=Gt(),ae=Gt(),pe=Gt();p.useEffect(()=>{if(A)return!(P||D)?ae.start(_1,()=>{E.current.allowUnselectedMouseUp=!0,E.current.allowSelectedMouseUp=!0}):pe.start(jd,()=>{E.current.allowUnselectedMouseUp=!0,ae.start(jd,()=>{E.current.allowSelectedMouseUp=!0})}),()=>{ae.clear(),pe.clear()};E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},se.clear()},[A,P,D,E,se,ae,pe]);const Y=p.useMemo(()=>M?.id??lo($)?.id,[M,$]),me=Sn(V,{id:j,role:"combobox","aria-expanded":A?"true":"false","aria-haspopup":"listbox","aria-controls":A?Y:void 0,"aria-labelledby":W,"aria-readonly":S||void 0,"aria-required":b||void 0,tabIndex:z?-1:0,ref:K,onFocus(de){f(!0),A&&x.current&&g(!1,De(ar,de.nativeEvent)),J.start(0,()=>{v.set("forceMount",!0)})},onBlur(de){we($,de.relatedTarget)||(u(!0),f(!1),d==="onBlur"&&C.commit(F))},onPointerMove(){I.current=!1},onKeyDown(){I.current=!0},onMouseDown(de){if(A)return;const ue=Oe(de.currentTarget);function ce(ve){if(!U.current)return;const le=ve.target;if(we(U.current,le)||we(Z.current,le)||le===U.current)return;const Se=eS(U.current);ve.clientX>=Se.left-Ls&&ve.clientX<=Se.right+Ls&&ve.clientY>=Se.top-Ls&&ve.clientY<=Se.bottom+Ls||g(!1,De(_0,ve))}se.start(0,()=>{ue.addEventListener("mouseup",ce,{once:!0})})}},C.getValidationProps,l,G);me.role="combobox";const ye={...h,open:A,disabled:z,value:F,readOnly:S,placeholder:!P};return qe("button",t,{ref:[n,U],state:ye,stateAttributesMapping:R1,props:me})}),A1=p.createContext(void 0),D1=p.forwardRef(function(t,n){const{store:r}=Zr(),o=Ue(r,Be.mounted),s=Ue(r,Be.forceMount);return o||s?w.jsx(A1.Provider,{value:!0,children:w.jsx(ca,{ref:n,...t})}):null}),Hd=p.createContext(void 0);function N1(){const e=p.useContext(Hd);if(!e)throw new Error(dt(59));return e}function zs(e,t){e&&Object.assign(e.style,t)}const F1={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},L1={position:"fixed"},z1=p.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:a="bottom",align:c="center",sideOffset:l=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:y,alignItemWithTrigger:v=!0,collisionAvoidance:g=f0,style:E,...C}=t,{store:S,listRef:b,labelsRef:x,alignItemWithTriggerActiveRef:T,selectedItemTextRef:I,valuesRef:z,initialValueRef:A,popupRef:F,setValue:V}=Zr(),$=Vd(),M=Ue(S,Be.open),k=Ue(S,Be.mounted),O=Ue(S,Be.modal),P=Ue(S,Be.value),R=Ue(S,Be.openMethod),D=Ue(S,Be.positionerElement),j=Ue(S,Be.triggerElement),W=Ue(S,Be.isItemEqualToValue),Z=Ue(S,Be.transitionStatus),U=p.useRef(null),G=p.useRef(null),[B,X]=p.useState(v),K=k&&B&&R!=="touch";!k&&B!==v&&X(v),he(()=>{k||(Be.scrollUpArrowVisible(S.state)&&S.set("scrollUpArrowVisible",!1),Be.scrollDownArrowVisible(S.state)&&S.set("scrollDownArrowVisible",!1))},[S,k]),p.useImperativeHandle(T,()=>K),Kf((K||O)&&M,R==="touch",D,j);const J=lf({anchor:r,floatingRootContext:$,positionMethod:o,mounted:k,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:m,disableAnchorTracking:y??K,collisionAvoidance:g,keepMounted:!0}),se=K?"none":J.side,ae=K?L1:J.positionerStyles,pe={open:M,side:se,align:J.align,anchorHidden:J.anchorHidden},Y=ie(ce=>{S.set("positionerElement",ce)}),me=pf(t,pe,{styles:ae,transitionStatus:Z,props:C,refs:[n,Y],hidden:!k,inert:!M}),ye=p.useRef(0),de=ie(ce=>{if(ce.size===0&&ye.current===0||z.current.length===0)return;const ve=ye.current;if(ye.current=ce.size,ce.size===ve)return;const le=De(ar);if(ve!==0&&!S.state.multiple&&P!==null&&xo(z.current,P,W)===-1){const _=A.current,N=_!=null&&xo(z.current,_,W)!==-1?_:null;V(N,le),N===null&&(S.set("selectedIndex",null),I.current=null)}if(ve!==0&&S.state.multiple&&Array.isArray(P)){const Se=H=>xo(z.current,H,W)!==-1,_=P.filter(H=>Se(H));(_.length!==P.length||_.some(H=>!Yw(P,H,W)))&&(V(_,le),_.length===0&&(S.set("selectedIndex",null),I.current=null))}if(M&&K){S.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Se={height:""};zs(D,Se),zs(F.current,Se)}}),ue=p.useMemo(()=>({...J,side:se,alignItemWithTriggerActive:K,setControlledAlignItemWithTrigger:X,scrollUpArrowRef:U,scrollDownArrowRef:G}),[J,se,K,X]);return w.jsx(Ew,{elementsRef:b,labelsRef:x,onMapChange:de,children:w.jsxs(Hd.Provider,{value:ue,children:[k&&O&&w.jsx(Ia,{inert:os(!M),cutout:j}),me]})})}),$1={...En,...tn},V1=p.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:c,popupRef:l,onOpenChangeComplete:u,setOpen:f,valueRef:d,selectedItemTextRef:h,keyboardActiveRef:m,multiple:y,handleScrollArrowVisibility:v,scrollHandlerRef:g,listRef:E,highlightItemOnHover:C}=Zr(),{side:S,align:b,alignItemWithTriggerActive:x,isPositioned:T,setControlledAlignItemWithTrigger:I,scrollDownArrowRef:z,scrollUpArrowRef:A}=N1(),F=rd()!=null,V=Vd(),$=sf(),{nonce:M,disableStyleElements:k}=wS(),O=Ue(c,Be.id),P=Ue(c,Be.open),R=Ue(c,Be.mounted),D=Ue(c,Be.popupProps),j=Ue(c,Be.transitionStatus),W=Ue(c,Be.triggerElement),Z=Ue(c,Be.positionerElement),U=Ue(c,Be.listElement),G=p.useRef(!1),B=p.useRef(!1),X=p.useRef({}),K=io(),J=ie(Y=>{if(!Z||!l.current||!B.current)return;if(G.current||!x){v();return}const me=Z.style.top==="0px",ye=Z.style.bottom==="0px";if(!me&&!ye){v();return}const de=Wd(Z),ue=Po(Z.getBoundingClientRect().height,"y",de),ce=Oe(Z),ve=getComputedStyle(Z),le=parseFloat(ve.marginTop),Se=parseFloat(ve.marginBottom),_=Zd(getComputedStyle(l.current)),H=Math.min(ce.documentElement.clientHeight-le-Se,_),N=Y.scrollTop,L=$s(Y);let Q=0,ne=null,te=!1,ge=!1;const Ie=ze=>{Z.style.height=`${ze}px`},xe=(ze,Ge)=>{const He=bt(ze,0,H-ue);He>0&&Ie(ue+He),Y.scrollTop=Ge,H-(ue+He)<=$n&&(G.current=!0),v()},Ce=me?L-N:N,ke=Math.min(ue+Ce,H);if(Q=ke,Ce<=$n){xe(Ce,me?L:0);return}if(H-ke>$n)me?ge=!0:ne=0;else if(te=!0,ye&&N<L){const ze=ue+Ce-H;ne=N-(Ce-ze)}if(Q=Math.ceil(Q),Q!==0&&Ie(Q),ge||ne!=null){const ze=$s(Y),Ge=ge?ze:bt(ne,0,ze);Math.abs(Y.scrollTop-Ge)>$n&&(Y.scrollTop=Ge)}(te||Q>=H-$n)&&(G.current=!0),v()});p.useImperativeHandle(g,()=>J,[J]),xn({open:P,ref:l,onComplete(){P&&u?.(!0)}});const se={open:P,transitionStatus:j,side:S,align:b};he(()=>{!Z||!l.current||Object.keys(X.current).length||(X.current={top:Z.style.top||"0",left:Z.style.left||"0",right:Z.style.right,height:Z.style.height,bottom:Z.style.bottom,minHeight:Z.style.minHeight,maxHeight:Z.style.maxHeight,marginTop:Z.style.marginTop,marginBottom:Z.style.marginBottom})},[l,Z]),he(()=>{P||x||(B.current=!1,G.current=!1,zs(Z,X.current))},[P,x,Z,l]),he(()=>{const Y=l.current;if(!P||!W||!Z||!Y||x&&!T||c.state.transitionStatus==="ending")return;if(!x){B.current=!0,K.request(v),Y.style.removeProperty("--transform-origin");return}const me=j1(Y);Y.style.removeProperty("--transform-origin");try{const ye=h.current,de=d.current,ue=getComputedStyle(Z),ce=getComputedStyle(Y),ve=Oe(W),le=tt(Z),Se=Wd(W),_=Vs(W.getBoundingClientRect(),Se),H=Vs(Z.getBoundingClientRect(),Se),N=_.height,L=U||Y,Q=L.scrollHeight,ne=parseFloat(ce.borderBottomWidth),te=parseFloat(ue.marginTop)||10,ge=parseFloat(ue.marginBottom)||10,Ie=parseFloat(ue.minHeight)||100,xe=Zd(ce),Ce=5,ke=5,ze=20,Ge=ve.documentElement.clientHeight-te-ge,He=ve.documentElement.clientWidth,nt=Ge-_.bottom+N;let st,Re=$==="rtl"?_.right-H.width:_.left,Pe=0;if(ye&&de){const Fe=Vs(de.getBoundingClientRect(),Se);st=Vs(ye.getBoundingClientRect(),Se),Re=H.left+($==="rtl"?Fe.right-st.right:Fe.left-st.left);const Ve=Fe.top-_.top+Fe.height/2;Pe=st.top-H.top+st.height/2-Ve}const Ze=nt+Pe+ge+ne;let We=Math.min(Ge,Ze);const ct=Ge-te-ge,Ye=Ze-We,Zt=He-ke;Z.style.left=`${bt(Re,Ce,Zt-H.width)}px`,Z.style.height=`${We}px`,Z.style.maxHeight="auto",Z.style.marginTop=`${te}px`,Z.style.marginBottom=`${ge}px`,Y.style.height="100%";const Vt=$s(L),Ke=Ye>=Vt-$n;Ke&&(We=Math.min(Ge,H.height)-(Ye-Vt));const q=_.top<ze||_.bottom>Ge-ze||Math.ceil(We)+$n<Math.min(Q,Ie),oe=(le.visualViewport?.scale??1)!==1&&Ai;if(q||oe){B.current=!0,zs(Z,X.current),I(!1);return}const be=Math.max(Ie,We);if(Ke){const Fe=Math.max(0,Ge-Ze);Z.style.top=H.height>=ct?"0":`${Fe}px`,Z.style.height=`${We}px`,L.scrollTop=$s(L)}else Z.style.bottom="0",L.scrollTop=Ye;if(st){const Fe=H.top,Ve=H.height,Ne=st.top+st.height/2,Qe=Ve>0?(Ne-Fe)/Ve*100:50,Te=bt(Qe,0,100);Y.style.setProperty("--transform-origin",`50% ${Te}%`)}(be===Ge||We>=xe)&&(G.current=!0),v(),C&&c.state.selectedIndex===null&&c.state.activeIndex===null&&E.current[0]!=null&&c.set("activeIndex",0),B.current=!0}finally{me()}},[c,P,Z,W,d,h,l,v,x,I,K,z,A,U,E,C,$,T]),p.useEffect(()=>{if(!x||!Z||!P)return;const Y=tt(Z);function me(ye){f(!1,De(R0,ye))}return Le(Y,"resize",me)},[f,x,Z,P]);const ae={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":y||void 0,id:`${O}-list`},onKeyDown(Y){m.current=!0,F&&ks.has(Y.key)&&Y.stopPropagation()},onMouseMove(){m.current=!1},onScroll(Y){U||J(Y.currentTarget)},...x&&{style:U?{height:"100%"}:F1}},pe=qe("div",t,{ref:[n,l],state:se,stateAttributesMapping:$1,props:[D,ae,wa(j),{className:!U&&x?Fd.className:void 0},a]});return w.jsxs(p.Fragment,{children:[!k&&Fd.getElement(M),w.jsx(ls,{context:V,modal:!1,disabled:!R,returnFocus:i,restoreFocus:!0,children:pe})]})});function Zd(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function $s(e){return Ld(e.scrollHeight,e.clientHeight)}function Wd(e){return Hu.getScale(e)}function Po(e,t,n){return e/n[t]}function Vs(e,t){return fo({x:Po(e.x,"x",t),y:Po(e.y,"y",t),width:Po(e.width,"x",t),height:Po(e.height,"y",t)})}const Ud=[["transform","none"],["scale","1"],["translate","0 0"]];function j1(e){const{style:t}=e,n={};for(const[r,o]of Ud)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of Ud){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}const Bd=p.createContext(void 0);function Ua(){const e=p.useContext(Bd);if(!e)throw new Error(dt(57));return e}const H1=p.memo(p.forwardRef(function(t,n){const{render:r,className:o,value:s=null,label:i,disabled:a=!1,nativeButton:c=!1,style:l,...u}=t,f=p.useRef(null),d=kw({label:i,textRef:f,indexGuessBehavior:Of.GuessFromOrder}),{store:h,getItemProps:m,setOpen:y,setValue:v,selectionRef:g,typingRef:E,valuesRef:C,multiple:S,selectedItemTextRef:b}=Zr(),x=Ue(h,Be.isActive,d.index),T=Ue(h,Be.isSelected,d.index,s),I=Ue(h,Be.isSelectedByFocus,d.index),z=Ue(h,Be.isItemEqualToValue),A=d.index,F=A!==-1,V=p.useRef(null),$=vt(A);he(()=>{if(!F)return;const B=C.current;return B[A]=s,()=>{delete B[A]}},[F,A,s,C]),he(()=>{if(!F)return;const B=h.state.value;let X=B;S&&Array.isArray(B)&&B.length>0&&(X=B[B.length-1]),X!==void 0&&$r(s,X,z)&&(h.set("selectedIndex",A),f.current&&(b.current=f.current))},[F,A,S,z,h,s,b]);const M={disabled:a,selected:T,highlighted:x},k=m({active:x,selected:T});k.id=void 0;const O=p.useRef(null),P=p.useRef("mouse"),R=p.useRef(!1),{getButtonProps:D,buttonRef:j}=Dr({disabled:a,focusableWhenDisabled:!0,native:c,composite:!0});function W(B){const X=h.state.value;if(S){const K=Array.isArray(X)?X:[],J=T?Xw(K,s,z):[...K,s];v(J,De(na,B))}else v(s,De(na,B)),y(!1,De(na,B))}const Z={role:"option","aria-selected":T,tabIndex:x?0:-1,onTouchStart(){g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(B){O.current=B.key,h.set("activeIndex",A),B.key===" "&&E.current&&B.preventDefault()},onClick(B){R.current=!1,!(B.type==="keydown"&&O.current===null)&&(a||B.type==="keydown"&&O.current===" "&&E.current||P.current!=="touch"&&!x||(O.current=null,W(B.nativeEvent)))},onPointerEnter(B){P.current=B.pointerType},onPointerDown(B){P.current=B.pointerType,R.current=!0},onMouseUp(){if(a)return;if(R.current){R.current=!1;return}const B=!g.current.allowSelectedMouseUp&&T,X=!g.current.allowUnselectedMouseUp&&!T;B||X||P.current!=="touch"&&!x||V.current?.click()}},U=qe("div",t,{ref:[j,n,d.ref,V],state:M,props:[k,Z,u,D]}),G=p.useMemo(()=>({selected:T,indexRef:$,textRef:f,selectedByFocus:I,hasRegistered:F}),[T,$,f,I,F]);return w.jsx(Bd.Provider,{value:G,children:U})})),Z1=p.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=Ua();return r||o?w.jsx(W1,{...t,ref:n}):null}),W1=p.memo(p.forwardRef((e,t)=>{const{render:n,className:r,style:o,keepMounted:s,...i}=e,{selected:a}=Ua(),c=p.useRef(null),{transitionStatus:l,setMounted:u}=yo(a),d=qe("span",e,{ref:[t,c],state:{selected:a,transitionStatus:l},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:tn});return xn({open:a,ref:c,onComplete(){a||u(!1)}}),d})),U1=p.memo(p.forwardRef(function(t,n){const{indexRef:r,textRef:o,selectedByFocus:s,hasRegistered:i}=Ua(),{selectedItemTextRef:a}=Zr(),{className:c,render:l,style:u,...f}=t,d=p.useCallback(m=>{if(!m||!i)return;const y=a.current===null||!a.current.isConnected;(s||y&&r.current===0)&&(a.current=m)},[a,r,s,i]);return qe("div",t,{ref:[d,n,o],props:f})})),To=re.forwardRef(({className:e,type:t="primary",htmlType:n,...r},o)=>w.jsx("button",{ref:o,type:n||"button",className:gt("inline-flex items-center justify-center whitespace-nowrap rounded-full transition-colors disabled:pointer-events-none disabled:opacity-50 h-10 px-4",t==="primary"&&"text-white bg-gradient-to-r from-[#497efe] to-[#947afa] shadow-lg",t==="gray"&&"bg-gray-200 text-gray-700 hover:bg-gray-200",e),...r}));To.displayName="Button";const B1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),G1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Gd=e=>{const t=G1(e);return t.charAt(0).toUpperCase()+t.slice(1)},Yd=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Y1=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var X1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const q1=re.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>re.createElement("svg",{ref:c,...X1,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Yd("lucide",o),...!s&&!Y1(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,u])=>re.createElement(l,u)),...Array.isArray(s)?s:[s]]));const Vn=(e,t)=>{const n=re.forwardRef(({className:r,...o},s)=>re.createElement(q1,{ref:s,iconNode:t,className:Yd(`lucide-${B1(Gd(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Gd(e),n};const Ba=Vn("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Xd=Vn("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const qd=Vn("eye-closed",[["path",{d:"m15 18-.722-3.25",key:"1j64jw"}],["path",{d:"M2 8a10.645 10.645 0 0 0 20 0",key:"1e7gxb"}],["path",{d:"m20 15-1.726-2.05",key:"1cnuld"}],["path",{d:"m4 15 1.726-2.05",key:"1dsqqd"}],["path",{d:"m9 18 .722-3.25",key:"ypw2yx"}]]);const Kd=Vn("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const K1=Vn("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);const J1=Vn("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const Q1=Vn("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);const ex=Vn("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"}]]);const Jd=Vn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function tx(e){return It.get("/channel/game/role/mail-captcha",e)}function nx(e){return It.get("/channel/game/role/auth",e)}function rx(e){return It.post("/passport-api/v2/ztgame/auth/login",{account:e.account,password:e.password,channel_login:1,channel_id:6})}function ox(e){return It.post("/passport-api/v2/sms-captchas",{mobile:e.mobile,type:e.type||"register",is_voice:0,nationcode:e.countryCode})}function sx(e){return It.post("/passport-api/v2/ztgame/auth/mobile-register",{mobile:e.mobile,captcha:e.captcha,channel_login:1,channel_id:6,nationcode:e.countryCode,ad_id:""})}function Qd(){return It.post("/passport-api/v2/ztgame/auth/auth",{channel_login:1,channel_id:6})}function ix(e){return It.post(`/passport-api/v2/ztgame/users/${e.uid}/idcard`,{name:e.name,idcard:e.idcard},{headers:{Authentication:e.authorization}})}function ax(e){return It.post("/passport-api/v2/ztgame/auth/re-auth",{type:"auth",channel_id:6,ad_id:"",channel_login:1},{headers:{Authentication:e}})}function cx(e){return It.post("/passport-api/v2/ztgame/user-center/forget-password/",e)}function lx(e){return It.post("/passport-api/v2/ztgame/user-center/forget-password/sms-captchas",e)}function ep(e){return It.post("/passport-api/v2/ztgame/user-center/forget-password/forget-password-keys",e)}function ux(e){return It.post("/passport-api/v2/ztgame/user-center/forget-password/forget-password-update",e)}function zt({as:e,children:t,className:n,disabled:r,...o}){const s=e||"button",i=s==="button";return w.jsx(s,{className:bi("align-middle inline-flex items-center justify-center transition-all cursor-pointer hover:brightness-110 active:brightness-90 active:scale-90 disabled:cursor-not-allowed disabled:grayscale",n),...i?{disabled:r}:{"aria-disabled":r},...r&&!i?{onClick:a=>{a.preventDefault(),a.stopPropagation()}}:{},...o,children:t})}const fx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAYAAADk3wSdAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFJ0lEQVQ4jW2VW4ydVRXHf2tfvu87Z+5znEtnxnLR0pYJatEHWxhBEZUSCE8YESImRnzwQTEEY6KJGrQJXiFGXzAxaowkSkyoIgjYlEqEIIrSS6KmpTPDdJgz55w5t++29/bhjDQFVrKf9lq/rGSt/3/J+v2XExRQgNsKuJbH9QLFKaE4BWqUu6TCvXhGQsajOD6D4BJfQBCuvvaLLE/uhLTN/8PwVlGCxIJZCJ9XYzwYBEIGdLkztBE8d1rvSJWlbSLw/oJy9UZe8AOAGglfNbt4UE2CSkBikASwfKpE6blOncdndtOauAjy3gWM8516wCGiuFGPyT2Mhw+EQvC9wZ+UEAw4UfXZtBU6cZX7Fm+C4IDwBmgAPHdguEGPy1VqSO0MObhewHc9UgC5gAKXKmpbW3fV8i1/8JovsDyzG5ortxK4DpFzwP1A2yAcUpHciwURCLngOgFVBkIOOPBd/qrWir/MrTV/k6nk2N3v/Rx/uHgJmqvfrqb5l3sioBVofTsi18hrDywGqQ46IQBFwHcCRT1QrrmfDjXaP/TrvNRerrIiM/xq98d4bH6ROK3fV3XlV0QU60azajTOGND6R4YIpAqiAsEDVnB1UM30lonQ/t0/G3t4uXkZqxM1TkztpDmUXP7uzVcO2SA3FVrR0hoEOkrRCAFCGDMScUJX3V6lPCEIrqexsb82quVHnji6xJ9PH8Bbtc9G2f4dW42PznbDzc5qerGlnURURMidEPT2sIw5bFTMYVMp94rxEASfyananu6RI0/t49G/f4gdMxu/jExxm/QF1fMURtEdshRKMSo5GZa1OKJlDVSSc1STx4wedi/paomKPMELSfAv9NKY5569jNGk89nIFLeFIAQFISiMC9jCMZzlHJ+cfPn5uem9G6AQBdXkReKoacxw0TDDHhWX4BQqLjY3z4zTaVapVLODIch5YchAHNa7rJ4k1//pit3LRRT9h9a2RCvJJtai7JgbN1ObqOlzqJlzMJxPjF7cZnSkT78V/1Hk/GJLgKBlKyqLfUcX33m0mJu9lLIU4giSGOJ4gjhG2Zn6uxhvk+kqfRvDWPdKc8UrfPgTz+E2R34cUvMwKhAEvOL0Rcud95+pLZw4eeB94N2VGAtRNHjW7qOajBlG+gcb3QXq3XHaZUzFdvfOmY2r5JNnjw39+2/Iz3Z9vGbCDyTORyr94ul/LEbFr+8YhWoLmvJpbDSQqggYPUsSf0TSjYmw0p6nnlnqmWUji8Frp4bzm1eS7PfHf3sJ5eMLjHQtJ/eUPH39GAzNvI2txUdIZ66mtzVwKQGshaHqz00ImsxruqWmkRleS4W1VOvQqBz2OvnJ2aW1B55cXD1BfQqG50fpRbdTn/oG0UQNayC24MIAGllQqiO+FX13pXnp3Sebk5zuaZZ7hvVU86+e5vlMcIWjwDxJmG3i3/5B9PwkageoKWAanAKXDUzCmrMovWRE5V+aH//vcaS8oe+n97/at3ObheLFAtK+h7wCevo6dA10ddsjuxASEAW6UqLNMSR6BpHv4GkaPIjJH1oYXn+onY1E3UJuXE3VPb0tvZ9Cg66A0oNz4FNQMfg20Gkj5lvI+C9Qc8vI1GCJX3d+D6mzlEHy2PhH3lF1B95T8d9ECYQAFBByCH3wLXBnnsWd2QP9Q6CXt+X2Fs6/7Xy5F4oAOyxfQ/sGRfa919NCAX75GVBLmF1AzGBCF8abDp8ARuDVnoJMvo/JSrz/OpIaKJ7CN25Batul4U1AgP8BRjZPP9WeeTQAAAAASUVORK5CYII=";function dx(e){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 500 500",...e,children:[w.jsx("path",{fill:"url(#a)",d:"M0 250C0 111.929 111.929 0 250 0s250 111.929 250 250-111.929 250-250 250S0 388.071 0 250Z"}),w.jsx("path",{fill:"#fff",d:"M159.432 341h-33.008V158.949h33.008V341Zm220.263-76.172c0 11.087-1.946 21.286-5.84 30.596-3.808 9.31-9.098 17.35-15.869 24.121-6.771 6.686-14.811 11.934-24.121 15.742-9.31 3.809-19.424 5.713-30.342 5.713h-89.121c-2.369 0-4.57-.423-6.601-1.27-2.031-.846-3.809-1.988-5.332-3.427-1.439-1.524-2.582-3.301-3.428-5.332-.846-2.032-1.27-4.232-1.27-6.602V175.58c0-2.285.424-4.443 1.27-6.475.846-2.031 1.989-3.808 3.428-5.332a16.354 16.354 0 0 1 5.332-3.554c2.031-.847 4.232-1.27 6.601-1.27h89.121c10.918 0 21.032 1.905 30.342 5.713 9.31 3.809 17.35 9.098 24.121 15.869 6.771 6.686 12.061 14.727 15.869 24.121 3.894 9.31 5.84 19.466 5.84 30.469v29.707Zm-33.007-29.707c0-6.432-1.058-12.314-3.174-17.646-2.032-5.332-4.952-9.86-8.76-13.584-3.809-3.809-8.379-6.729-13.711-8.76-5.247-2.116-11.087-3.174-17.52-3.174h-72.744v116.035h72.744c6.433 0 12.273-1.015 17.52-3.047 5.332-2.116 9.902-5.035 13.711-8.759 3.808-3.809 6.728-8.337 8.76-13.584 2.116-5.332 3.174-11.257 3.174-17.774v-29.707Z"}),w.jsx("defs",{children:w.jsxs("linearGradient",{id:"a",x1:250,x2:250,y1:0,y2:500,gradientUnits:"userSpaceOnUse",children:[w.jsx("stop",{stopColor:"#497EFE"}),w.jsx("stop",{offset:1,stopColor:"#947AFA"})]})})]})}function js(){const{gameId:e,loginTypes:t,currentLoginType:n,setCurrentLoginType:r}=Nn(),o=vf({loginTypes:t,gameId:e}),s=bf({loginTypes:t,gameId:e}),i=yf({loginTypes:t,gameId:e}),a=[];return i&&n!==at.GIANT&&a.push({type:at.GIANT,label:e==="5327"?"账号密码登录":"巨人账号",icon:e==="5327"?null:w.jsx("img",{className:"size-4",src:fx})}),s&&n!==at.MOBILE&&a.push({type:at.MOBILE,label:"手机号登录",icon:w.jsx(K1,{className:"size-4"})}),o&&n!==at.ROLE_ID&&a.push({type:at.ROLE_ID,label:"ID 登录",icon:w.jsx(dx,{className:"size-4"})}),n!=="quick"&&zr(e).length>0&&a.push({type:"quick",label:"快捷登录",icon:w.jsx(ex,{className:"size-4"})}),a.length?w.jsx("div",{className:"text-gray-500 text-xs flex justify-center items-center gap-2 mb-4",children:a.map((c,l)=>w.jsxs(zt,{className:"h-7 px-3 border rounded-full border-gray-300 gap-1.5 text-xs",onClick:()=>r(c.type),children:[c.icon,w.jsx("span",{children:c.label})]},c.type))}):null}function px(e){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 90 90",fill:"currentColor",...e,children:w.jsx("path",{d:"M41.415 1.601c6.427-2.244 13.363 2.04 14.18 8.773.611 5.508-2.959 10.609-8.365 11.833-.408.102-.918.203-1.326.305-.918.204-1.735.409-2.653.613-.306.102-.714.204-1.122.306h-.101c-.816.306-1.633.51-2.448.816-.306.102-.715.306-1.021.408l-2.754 1.223c-.408.103-.714.307-1.02.511-1.224.612-2.346 1.326-3.468 2.142l-.307.306c-.612.409-1.122.919-1.632 1.327-.51.408-1.02.816-1.53 1.326-.408.306-.714.713-1.122 1.02-.408.407-.816.918-1.326 1.428-.306.612-.409 1.224-.612 1.836-.204 1.122-.51 2.143-.714 3.265-.204 1.02-.408 2.04-.51 3.06 0 .611-.103 1.122-.103 1.734v1.632c0 1.02 0 1.938.103 2.958.102 1.02.306 2.143.51 3.163.204.816.408 1.733.612 2.55.204.816.408 1.53.612 2.346.102.306.204.51.408.714.51.612 1.122 1.122 1.632 1.734 1.02.918 2.04 1.836 3.162 2.754.816.612 1.734 1.224 2.55 1.836.51.306.919.612 1.429.918.102 0 .204 0 .204.103.204 0 .306.102.51.204.408.204.714.408 1.122.612.918.408 1.734.714 2.652 1.122.714.204 1.326.51 2.04.714 1.122.306 2.143.612 3.265.918.51.204 1.122.204 1.632 0 .306-.102.51-.102.816-.204.816-.204 1.53-.51 2.346-.714 1.53-.408 2.958-1.02 4.386-1.633h.102c.816-.408 1.735-.815 2.55-1.325.307-.204.714-.408 1.02-.612 1.02-.714 2.04-1.428 3.06-2.244.613-.51 1.123-1.02 1.735-1.53l2.142-2.143c.408-.408.714-.816.816-1.428 0-.102.103-.102.103-.204.306-1.02.611-2.142.815-3.162.306-1.326.612-2.755.714-4.183v-.204c.102-1.224.103-2.448.103-3.672-.102-.816-.102-1.53-.204-2.346 0-.102 0-.204-.102-.205-.918.408-1.735.715-2.55 1.225-1.633.918-3.061 1.938-4.489 3.06-.102.101-.204.102-.306.204-1.02.918-1.938 1.734-2.856 2.652-1.02 1.02-2.041 2.04-2.96 3.162-1.937 2.244-4.487 3.469-7.445 3.673-5.713.306-10.61-3.673-11.324-9.283-.816-5.61 2.959-10.813 8.467-11.935a52.639 52.639 0 0 0 7.856-2.142h.101c.816-.408 1.734-.715 2.55-1.122 3.264-1.53 6.121-3.672 8.773-6.12 1.327-1.327 2.652-2.653 3.876-4.082 2.347-2.55 5.305-3.774 8.773-3.57 5.1.306 9.283 4.285 9.895 9.283.204 1.53.102 3.06-.408 4.489-.612 1.938-1.224 3.876-1.734 5.916-.102 1.02-.408 1.939-.51 2.958-.408 2.449-.51 4.795-.306 7.141v.306c.102.816.204 1.53.306 2.347a46.28 46.28 0 0 0 1.224 5.406c.102 0 .102.102.102.204.51 1.632 1.224 3.264 1.224 4.794.306 3.162-.51 5.917-2.55 8.365-1.632 1.938-3.774 3.06-6.223 3.57-1.734.408-3.57.817-5.304 1.326-.102.102-.204.102-.306.102-1.836.612-3.775 1.326-5.509 2.244h-.101c-.918.408-1.735.919-2.551 1.429-.306.204-.714.51-1.02.714a30.738 30.738 0 0 0-2.856 2.244c-.816.714-1.633 1.53-2.347 2.244a.22.22 0 0 1-.204.204c-.918.918-1.734 1.836-2.55 2.754-2.346 2.55-5.202 3.877-8.67 3.775-3.06-.102-5.61-1.428-7.651-3.672-1.428-1.633-2.958-3.163-4.488-4.591v-.102c-.51-.408-1.02-.918-1.53-1.326-.715-.612-1.53-1.122-2.245-1.734l-1.53-.918c-.612-.306-1.122-.612-1.734-.918l-2.754-1.225c-1.326-.612-2.653-1.02-4.081-1.428-1.326-.407-2.652-.714-3.978-1.02a11.146 11.146 0 0 1-3.673-1.224c-3.264-1.734-5.1-4.489-5.61-8.16-.204-1.633 0-3.265.51-4.795.816-2.244 1.428-4.59 1.938-6.936.102-.102.102-.103.102-.204.102-.715.204-1.531.306-2.347.102-.714.205-1.428.205-2.142V43.63l-.087-.956a39.328 39.328 0 0 0-1.24-6.695c-.102-.102-.102-.205-.102-.306-.51-1.734-1.224-3.469-1.53-5.203-1.122-5.712 2.55-11.22 8.263-12.445.714-.204 1.53-.306 2.244-.51 1.224-.306 2.55-.612 3.775-1.02 1.224-.408 2.448-.816 3.672-1.326l1.223-.612c.918-.408 1.837-.918 2.755-1.428 1.122-.714 2.244-1.53 3.366-2.346.408-.306.715-.612 1.122-.918.408-.408.918-.918 1.428-1.326a40.49 40.49 0 0 0 2.96-2.96c1.53-1.835 3.161-3.16 5.405-3.977Z"})})}function hx(e){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",fill:"currentColor",...e,children:w.jsx("path",{d:"M842.667 384H768V277.333a234.667 234.667 0 1 0-469.333 0V384H224a53.393 53.393 0 0 0-53.333 53.333V928A53.393 53.393 0 0 0 224 981.333h618.667A53.393 53.393 0 0 0 896 928V437.333A53.393 53.393 0 0 0 842.667 384zm-288 295.007v110.326a21.333 21.333 0 0 1-42.667 0V679.007a64 64 0 1 1 42.667 0zM725.333 384h-384V277.333c0-105.866 86.134-192 192-192s192 86.134 192 192z"})})}var Ga,tp;function mx(){if(tp)return Ga;tp=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,c=typeof Vo=="object"&&Vo&&Vo.Object===Object&&Vo,l=typeof self=="object"&&self&&self.Object===Object&&self,u=c||l||Function("return this")(),f=Object.prototype,d=f.toString,h=Math.max,m=Math.min,y=function(){return u.Date.now()};function v(b,x,T){var I,z,A,F,V,$,M=0,k=!1,O=!1,P=!0;if(typeof b!="function")throw new TypeError(e);x=S(x)||0,g(T)&&(k=!!T.leading,O="maxWait"in T,A=O?h(S(T.maxWait)||0,x):A,P="trailing"in T?!!T.trailing:P);function R(K){var J=I,se=z;return I=z=void 0,M=K,F=b.apply(se,J),F}function D(K){return M=K,V=setTimeout(Z,x),k?R(K):F}function j(K){var J=K-$,se=K-M,ae=x-J;return O?m(ae,A-se):ae}function W(K){var J=K-$,se=K-M;return $===void 0||J>=x||J<0||O&&se>=A}function Z(){var K=y();if(W(K))return U(K);V=setTimeout(Z,j(K))}function U(K){return V=void 0,P&&I?R(K):(I=z=void 0,F)}function G(){V!==void 0&&clearTimeout(V),M=0,I=$=z=V=void 0}function B(){return V===void 0?F:U(y())}function X(){var K=y(),J=W(K);if(I=arguments,z=this,$=K,J){if(V===void 0)return D($);if(O)return V=setTimeout(Z,x),R($)}return V===void 0&&(V=setTimeout(Z,x)),F}return X.cancel=G,X.flush=B,X}function g(b){var x=typeof b;return!!b&&(x=="object"||x=="function")}function E(b){return!!b&&typeof b=="object"}function C(b){return typeof b=="symbol"||E(b)&&d.call(b)==n}function S(b){if(typeof b=="number")return b;if(C(b))return t;if(g(b)){var x=typeof b.valueOf=="function"?b.valueOf():b;b=g(x)?x+"":x}if(typeof b!="string")return b===0?b:+b;b=b.replace(r,"");var T=s.test(b);return T||i.test(b)?a(b.slice(2),T?2:8):o.test(b)?t:+b}return Ga=v,Ga}mx();function gx(e=!1){if(typeof e!="boolean")throw new Error("defaultValue must be `true` or `false`");const[t,n]=re.useState(e),r=re.useCallback(()=>{n(!0)},[]),o=re.useCallback(()=>{n(!1)},[]),s=re.useCallback(()=>{n(i=>!i)},[]);return{value:t,setValue:n,setTrue:r,setFalse:o,toggle:s}}var np=typeof window<"u"?re.useLayoutEffect:re.useEffect;function yx(e){const[t,n]=re.useState(e),r=re.useCallback(()=>{n(i=>i+1)},[]),o=re.useCallback(()=>{n(i=>i-1)},[]),s=re.useCallback(()=>{n(e)},[e]);return{count:t,increment:r,decrement:o,reset:s,setCount:n}}function vx(e,t){const n=re.useRef(e);np(()=>{n.current=e},[e]),re.useEffect(()=>{if(t===null)return;const r=setInterval(()=>{n.current()},t);return()=>{clearInterval(r)}},[t])}function bx({countStart:e,countStop:t=0,intervalMs:n=1e3,isIncrement:r=!1}){const{count:o,increment:s,decrement:i,reset:a}=yx(e),{value:c,setTrue:l,setFalse:u}=gx(!1),f=re.useCallback(()=>{u(),a()},[u,a]),d=re.useCallback(()=>{if(o===t){u();return}r?s():i()},[o,t,i,s,r,u]);return vx(d,c?n:null),[o,{startCountdown:l,stopCountdown:u,resetCountdown:f}]}var wx=typeof window>"u";function Sx(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const r=a=>wx?t:window.matchMedia(a).matches,[o,s]=re.useState(()=>n?r(e):t);function i(){s(r(e))}return np(()=>{const a=window.matchMedia(e);return i(),a.addListener?a.addListener(i):a.addEventListener("change",i),()=>{a.removeListener?a.removeListener(i):a.removeEventListener("change",i)}},[e]),o}function rp({trigger:e,title:t,description:n,children:r,open:o,showCloseIcon:s=!0,onOpenChange:i,zIndex:a,classNames:c}){return Sx("(min-width: 1024px)")?w.jsxs(Ta,{open:o,onOpenChange:i,disablePointerDismissal:!0,children:[e&&w.jsx(Ra,{className:c?.trigger,children:e}),w.jsxs(Oa,{children:[w.jsx(jf,{style:{zIndex:a},className:"fixed inset-0 bg-black/70 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm"}),w.jsxs(Uf,{style:{zIndex:a},className:fr("fixed top-1/2 left-1/2 w-96 max-w-[calc(100vw-3rem)] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-gray-50 p-4 text-gray-900 transition-all duration-150 data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 z-[991]",c?.desktopPopup),children:[t&&w.jsx(_a,{className:fr("-mt-1.5 mb-1 text-lg font-medium",c?.title),children:t}),n&&w.jsx(Zf,{className:fr("mb-6 text-base text-gray-600",c?.description),children:n}),s&&w.jsx(Hf,{className:"absolute right-4 top-4 text-gray-700 hover:bg-gray-200 rounded p-0.5",children:w.jsx(Jd,{})}),w.jsx("div",{children:r})]})]})]}):w.jsxs(RS,{open:o,onOpenChange:i,children:[e&&w.jsx(WS,{className:c?.trigger,children:e}),w.jsxs(_S,{children:[w.jsx(xS,{style:{zIndex:a},className:fr("fixed inset-0 bg-black/70 transition-opacity duration-300 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm",c?.backdrop)}),w.jsx(YS,{style:{zIndex:a},className:"fixed inset-0 z-[991]",children:w.jsx(OS,{className:fr("fixed bottom-0 left-0 right-0 rounded-t-xl bg-white p-4 transition-transform duration-300 data-[starting-style]:translate-y-full data-[ending-style]:translate-y-full","[transform:translateY(var(--drawer-swipe-movement-y))]",c?.mobilePopup),children:w.jsxs(ES,{children:[w.jsx("div",{"aria-hidden":!0,className:"mx-auto w-12 h-1.5 flex-shrink-0 rounded-full bg-gray-300 mb-4"}),w.jsx(ZS,{className:"sr-only",children:t}),w.jsx("div",{children:r})]})})})]})]})}function Ya({checked:e,onChange:t,hideCheckbox:n}){const[r,o]=re.useState(!1),[s,i]=re.useState(!1);return w.jsxs("div",{children:[w.jsx(rp,{title:"用户协议",open:r,onOpenChange:o,zIndex:993,classNames:{desktopPopup:"w-[90vw] lg:w-[60vw]"},children:w.jsx("iframe",{src:"https://www.gatribe.com/license-light.html?channel_id=1&game_id=5327",className:"w-full h-[70vh]"})}),w.jsx(rp,{title:"隐私政策",open:s,onOpenChange:i,zIndex:993,classNames:{desktopPopup:"w-[90vw] lg:w-[60vw]"},children:w.jsx("iframe",{src:"https://www.gatribe.com/privacy-light.html?channel_id=1&game_id=5327",className:"w-full h-[70vh]"})}),n?w.jsxs("div",{className:"flex items-center justify-center text-gray-500 text-xs md:text-sm",children:[w.jsx("span",{className:"text-xs md:text-sm",children:"我已详细阅读并同意"}),w.jsx(zt,{className:"text-[var(--jssdk-primary-color)] text-xs md:text-sm",onClick:()=>o(!0),type:"button",children:"《用户协议》"}),w.jsx("span",{className:"text-xs md:text-sm",children:"及"}),w.jsx(zt,{className:"text-[var(--jssdk-primary-color)] text-xs md:text-sm",onClick:()=>i(!0),type:"button",children:"《隐私政策》"})]}):w.jsx(Co,{name:"rememberLogin",children:w.jsxs(_d,{className:"flex items-center justify-center text-gray-500 text-xs md:text-sm",children:[w.jsx(td,{checked:e,className:"size-4 md:size-5 flex items-center justify-center rounded-full border-2 data-[checked]:border-[var(--jssdk-primary-color)] data-[unchecked]:border-[var(--jssdk-input-border-color)]",onCheckedChange:a=>t?.(!!a),children:w.jsx(nd,{children:w.jsx(Ba,{className:"size-3 text-[var(--jssdk-primary-color)]",strokeWidth:4})})}),w.jsx("span",{className:"ml-2 text-xs md:text-sm",children:"我已详细阅读并同意"}),w.jsx(zt,{className:"text-[var(--jssdk-primary-color)] text-xs md:text-sm",onClick:()=>o(!0),type:"button",children:"《用户协议》"}),w.jsx("span",{className:"text-xs md:text-sm",children:"及"}),w.jsx(zt,{className:"text-[var(--jssdk-primary-color)] text-xs md:text-sm",onClick:()=>i(!0),type:"button",children:"《隐私政策》"})]})})]})}function Wr({trigger:e,title:t,description:n,children:r,open:o,showCloseIcon:s=!0,onOpenChange:i,disablePointerDismissal:a=!1,classNames:c}){return w.jsxs(Ta,{open:o,onOpenChange:i,disablePointerDismissal:a,children:[e&&w.jsx(Ra,{className:c?.trigger,children:e}),w.jsxs(Oa,{children:[w.jsx(jf,{className:gt("fixed inset-0 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 z-[990] backdrop-blur-sm",c?.backdrop||"bg-black/70 dark:opacity-70"),forceRender:!0}),w.jsxs(Uf,{className:gt("fixed top-1/2 left-1/2 w-96 max-w-[calc(100vw-3rem)] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-gray-50 p-4 text-gray-900 transition-all duration-150 data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 z-[990]",c?.popup),children:[t&&w.jsx(_a,{className:gt("-mt-1.5 mb-1 text-lg font-medium",c?.title),children:t}),n&&w.jsx(Zf,{className:gt("mb-6 text-base text-gray-600",c?.description),children:n}),s&&w.jsx(Hf,{className:gt("absolute right-4 top-4 text-gray-700 hover:bg-gray-200 rounded p-0.5",c?.close),children:w.jsx(Jd,{})}),w.jsx("div",{children:r})]})]})]})}function op({open:e,onOpenChange:t,onAgree:n,onRefuse:r}){return w.jsx(Wr,{open:e,onOpenChange:t,showCloseIcon:!1,classNames:{popup:"w-[320px] p-6"},children:w.jsxs("div",{className:"flex flex-col items-center",children:[w.jsx(Ya,{hideCheckbox:!0}),w.jsxs("div",{className:"flex justify-between w-full mt-6 gap-4",children:[w.jsx(To,{type:"gray",className:"flex-1",onClick:()=>{r?.(),t?.(!1)},children:"拒绝"}),w.jsx(To,{type:"primary",className:"flex-1",onClick:()=>{n?.(),t?.(!1)},children:"同意并登录"})]})]})})}function Cn({name:e,prefix:t,suffix:n,className:r,inputClassName:o,error:s,...i}){return w.jsxs(Co,{name:e,className:"group",children:[w.jsxs("div",{className:gt("flex items-center border border-[var(--jssdk-input-border-color)] group-data-[focused]:border-[var(--jssdk-primary-color)] group-data-[focused]:shadow-[0_0_6px_color-mix(in_srgb,var(--jssdk-primary-color),transparent_80%)] rounded-full bg-white px-3 gap-2 h-12 transition-all duration-200",s&&"border-red-500",r),children:[t,w.jsx(Za,{className:gt("flex-1 w-0 outline-none rounded-full h-full pl-1",o),...i}),n]}),w.jsx(Ha,{className:"text-red-500 text-xs mt-1 ml-3"})]})}function xx({account:e,forgetPasswordKey:t,onSuccess:n}){const[r,o]=re.useState(""),[s,i]=re.useState(!1),{mutate:a,isPending:c}=sn({mutationFn:()=>ux({account:e,forget_password_key:t,password:r}),onSuccess:u=>{u?.code===0||!u?.error?n():Ct.warning(u.detail||u.error||"重置失败")}}),l=()=>{if(!r){Ct.warning("请输入新密码");return}if(r.length<6||r.length>18){Ct.warning("密码长度需要在6-18位之间");return}a()};return w.jsxs("div",{className:"space-y-4",children:[w.jsx("div",{className:"text-sm text-gray-500 mb-4 text-center",children:"请设置新的登录密码"}),w.jsx(Cn,{name:"password",type:s?"text":"password",autoComplete:"off",inputClassName:"placeholder:text-sm",placeholder:"请输入6-18位由数字、字母组成的密码",value:r,autoFocus:!0,onValueChange:u=>o(u),suffix:w.jsx(zt,{onClick:()=>i(!s),type:"button",children:s?w.jsx(Kd,{className:"size-5 text-gray-400"}):w.jsx(qd,{className:"size-5 text-gray-400"})})}),w.jsx(zt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:l,disabled:!r||c,children:c?"重置中...":"确定修改"})]})}var Ex=function(e){return typeof e=="number"};function Cx(e){var t=re.useRef(e);return t.current=e,t}var Hs={exports:{}},Px=Hs.exports,sp;function Tx(){return sp||(sp=1,(function(e,t){(function(n,r){e.exports=r()})(Px,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",c="hour",l="day",u="week",f="month",d="quarter",h="year",m="date",y="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var k=["th","st","nd","rd"],O=M%100;return"["+M+(k[(O-20)%10]||k[O]||k[0])+"]"}},C=function(M,k,O){var P=String(M);return!P||P.length>=k?M:""+Array(k+1-P.length).join(O)+M},S={s:C,z:function(M){var k=-M.utcOffset(),O=Math.abs(k),P=Math.floor(O/60),R=O%60;return(k<=0?"+":"-")+C(P,2,"0")+":"+C(R,2,"0")},m:function M(k,O){if(k.date()<O.date())return-M(O,k);var P=12*(O.year()-k.year())+(O.month()-k.month()),R=k.clone().add(P,f),D=O-R<0,j=k.clone().add(P+(D?-1:1),f);return+(-(P+(O-R)/(D?R-j:j-R))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:f,y:h,w:u,d:l,D:m,h:c,m:a,s:i,ms:s,Q:d}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},b="en",x={};x[b]=E;var T="$isDayjsObject",I=function(M){return M instanceof V||!(!M||!M[T])},z=function M(k,O,P){var R;if(!k)return b;if(typeof k=="string"){var D=k.toLowerCase();x[D]&&(R=D),O&&(x[D]=O,R=D);var j=k.split("-");if(!R&&j.length>1)return M(j[0])}else{var W=k.name;x[W]=k,R=W}return!P&&R&&(b=R),R||!P&&b},A=function(M,k){if(I(M))return M.clone();var O=typeof k=="object"?k:{};return O.date=M,O.args=arguments,new V(O)},F=S;F.l=z,F.i=I,F.w=function(M,k){return A(M,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var V=(function(){function M(O){this.$L=z(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[T]=!0}var k=M.prototype;return k.parse=function(O){this.$d=(function(P){var R=P.date,D=P.utc;if(R===null)return new Date(NaN);if(F.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var j=R.match(v);if(j){var W=j[2]-1||0,Z=(j[7]||"0").substring(0,3);return D?new Date(Date.UTC(j[1],W,j[3]||1,j[4]||0,j[5]||0,j[6]||0,Z)):new Date(j[1],W,j[3]||1,j[4]||0,j[5]||0,j[6]||0,Z)}}return new Date(R)})(O),this.init()},k.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},k.$utils=function(){return F},k.isValid=function(){return this.$d.toString()!==y},k.isSame=function(O,P){var R=A(O);return this.startOf(P)<=R&&R<=this.endOf(P)},k.isAfter=function(O,P){return A(O)<this.startOf(P)},k.isBefore=function(O,P){return this.endOf(P)<A(O)},k.$g=function(O,P,R){return F.u(O)?this[P]:this.set(R,O)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(O,P){var R=this,D=!!F.u(P)||P,j=F.p(O),W=function(se,ae){var pe=F.w(R.$u?Date.UTC(R.$y,ae,se):new Date(R.$y,ae,se),R);return D?pe:pe.endOf(l)},Z=function(se,ae){return F.w(R.toDate()[se].apply(R.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(ae)),R)},U=this.$W,G=this.$M,B=this.$D,X="set"+(this.$u?"UTC":"");switch(j){case h:return D?W(1,0):W(31,11);case f:return D?W(1,G):W(0,G+1);case u:var K=this.$locale().weekStart||0,J=(U<K?U+7:U)-K;return W(D?B-J:B+(6-J),G);case l:case m:return Z(X+"Hours",0);case c:return Z(X+"Minutes",1);case a:return Z(X+"Seconds",2);case i:return Z(X+"Milliseconds",3);default:return this.clone()}},k.endOf=function(O){return this.startOf(O,!1)},k.$set=function(O,P){var R,D=F.p(O),j="set"+(this.$u?"UTC":""),W=(R={},R[l]=j+"Date",R[m]=j+"Date",R[f]=j+"Month",R[h]=j+"FullYear",R[c]=j+"Hours",R[a]=j+"Minutes",R[i]=j+"Seconds",R[s]=j+"Milliseconds",R)[D],Z=D===l?this.$D+(P-this.$W):P;if(D===f||D===h){var U=this.clone().set(m,1);U.$d[W](Z),U.init(),this.$d=U.set(m,Math.min(this.$D,U.daysInMonth())).$d}else W&&this.$d[W](Z);return this.init(),this},k.set=function(O,P){return this.clone().$set(O,P)},k.get=function(O){return this[F.p(O)]()},k.add=function(O,P){var R,D=this;O=Number(O);var j=F.p(P),W=function(G){var B=A(D);return F.w(B.date(B.date()+Math.round(G*O)),D)};if(j===f)return this.set(f,this.$M+O);if(j===h)return this.set(h,this.$y+O);if(j===l)return W(1);if(j===u)return W(7);var Z=(R={},R[a]=r,R[c]=o,R[i]=n,R)[j]||1,U=this.$d.getTime()+O*Z;return F.w(U,this)},k.subtract=function(O,P){return this.add(-1*O,P)},k.format=function(O){var P=this,R=this.$locale();if(!this.isValid())return R.invalidDate||y;var D=O||"YYYY-MM-DDTHH:mm:ssZ",j=F.z(this),W=this.$H,Z=this.$m,U=this.$M,G=R.weekdays,B=R.months,X=R.meridiem,K=function(ae,pe,Y,me){return ae&&(ae[pe]||ae(P,D))||Y[pe].slice(0,me)},J=function(ae){return F.s(W%12||12,ae,"0")},se=X||function(ae,pe,Y){var me=ae<12?"AM":"PM";return Y?me.toLowerCase():me};return D.replace(g,(function(ae,pe){return pe||(function(Y){switch(Y){case"YY":return String(P.$y).slice(-2);case"YYYY":return F.s(P.$y,4,"0");case"M":return U+1;case"MM":return F.s(U+1,2,"0");case"MMM":return K(R.monthsShort,U,B,3);case"MMMM":return K(B,U);case"D":return P.$D;case"DD":return F.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return K(R.weekdaysMin,P.$W,G,2);case"ddd":return K(R.weekdaysShort,P.$W,G,3);case"dddd":return G[P.$W];case"H":return String(W);case"HH":return F.s(W,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return se(W,Z,!0);case"A":return se(W,Z,!1);case"m":return String(Z);case"mm":return F.s(Z,2,"0");case"s":return String(P.$s);case"ss":return F.s(P.$s,2,"0");case"SSS":return F.s(P.$ms,3,"0");case"Z":return j}return null})(ae)||j.replace(":","")}))},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(O,P,R){var D,j=this,W=F.p(P),Z=A(O),U=(Z.utcOffset()-this.utcOffset())*r,G=this-Z,B=function(){return F.m(j,Z)};switch(W){case h:D=B()/12;break;case f:D=B();break;case d:D=B()/3;break;case u:D=(G-U)/6048e5;break;case l:D=(G-U)/864e5;break;case c:D=G/o;break;case a:D=G/r;break;case i:D=G/n;break;default:D=G}return R?D:F.a(D)},k.daysInMonth=function(){return this.endOf(f).$D},k.$locale=function(){return x[this.$L]},k.locale=function(O,P){if(!O)return this.$L;var R=this.clone(),D=z(O,P,!0);return D&&(R.$L=D),R},k.clone=function(){return F.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},M})(),$=V.prototype;return A.prototype=$,[["$ms",s],["$s",i],["$m",a],["$H",c],["$W",l],["$M",f],["$y",h],["$D",m]].forEach((function(M){$[M[1]]=function(k){return this.$g(k,M[0],M[1])}})),A.extend=function(M,k){return M.$i||(M(k,V,A),M.$i=!0),A},A.locale=z,A.isDayjs=I,A.unix=function(M){return A(1e3*M)},A.en=x[b],A.Ls=x,A.p={},A}))})(Hs)),Hs.exports}var kx=Tx();const Ix=Zy(kx);var Xa=function(e){if(!e)return 0;var t=Ix(e).valueOf()-Date.now();return t<0?0:t},Ox=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},ip=function(e){e===void 0&&(e={});var t=e||{},n=t.leftTime,r=t.targetDate,o=t.interval,s=o===void 0?1e3:o,i=t.onEnd,a=re.useMemo(function(){return Ex(n)&&n>0?Date.now()+n:void 0},[n]),c="leftTime"in e?a:r,l=Fh(re.useState(function(){return Xa(c)}),2),u=l[0],f=l[1],d=Cx(i);re.useEffect(function(){if(!c){f(0);return}f(Xa(c));var m=setInterval(function(){var y,v=Xa(c);f(v),v===0&&(clearInterval(m),(y=d.current)===null||y===void 0||y.call(d))},s);return function(){return clearInterval(m)}},[c,s]);var h=re.useMemo(function(){return Ox(u)},[u]);return[u,h]};function _x({account:e,mobile:t,onNext:n}){const[r,o]=re.useState(""),[s,i]=re.useState(),[a]=ip({leftTime:s?s*1e3:void 0,interval:1e3,onEnd(){i(void 0)}}),{mutate:c,isPending:l}=sn({mutationFn:()=>lx({account:e,type:"reset-password",is_voice:0,t:"ctoken"}),onSuccess:h=>{i(h.lock_time),Ct.success("验证码已发送,请注意查收")}}),{mutate:u,isPending:f}=sn({mutationFn:()=>ep({account:e,captcha:r,t:"reset-password"}),onSuccess:h=>{h?.forget_password_key?n(h.forget_password_key):Ct.warning("安全验证失败")},onError:h=>{Ct.warning(h?.message||h?.detail||"验证失败")}}),d=()=>{if(!r){Ct.warning("请输入验证码");return}u()};return w.jsxs("div",{className:"space-y-4",children:[w.jsxs("div",{className:"text-sm text-gray-500 mb-4 text-center",children:["为了您的账号安全,请先进行安全验证",w.jsx("br",{}),"请输入验证码,短信将发送至您的绑定手机"," ",w.jsx("span",{className:"font-semibold text-gray-700",children:t})]}),w.jsx(Cn,{name:"verificationCode",placeholder:"请输入验证码",value:r,type:"number",autoFocus:!0,onValueChange:h=>o(h),suffix:w.jsx("button",{type:"button",className:"enabled:text-[var(--jssdk-primary-color)] text-sm rounded-full h-4/6 px-2 enabled:hover:bg-[var(--jssdk-primary-color)] enabled:hover:text-white inline-flex items-center disabled:cursor-not-allowed disabled:text-gray-500",onClick:()=>c(),disabled:!!s||l,children:l?"发送中...":s?`${Math.round(a/1e3)}s 后重新获取`:"获取验证码"})}),w.jsx(zt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:d,disabled:f,children:f?"验证中...":"下一步"})]})}function Rx({account:e,onNext:t}){const[n,r]=re.useState(""),{mutate:o,isPending:s}=sn({mutationFn:()=>ep({account:e,idcard:n,t:"reset-password"}),onSuccess:a=>{a?.forget_password_key?t(a.forget_password_key):Ct.warning("安全验证失败")}}),i=()=>{if(!n){Ct.warning("请输入身份证号");return}o()};return w.jsxs("div",{className:"space-y-4",children:[w.jsxs("div",{className:"text-sm text-gray-500 mb-4 text-center",children:["为了您的账号安全,请先进行安全验证",w.jsx("br",{}),"该账号未绑定手机,请输入注册时填写的身份证信息"]}),w.jsx(Cn,{name:"idCard",placeholder:"请输入身份证号",value:n,autoFocus:!0,onChange:a=>r(a.currentTarget.value)}),w.jsx(zt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:i,disabled:s,children:s?"验证中...":"下一步"})]})}function Mx({onClose:e,defaultAccount:t=""}){const[n,r]=re.useState("account"),[o,s]=re.useState(t),[i,a]=re.useState(""),[c,l]=re.useState(2),[u,f]=re.useState(""),d=re.useRef(null);re.useEffect(()=>{if(!window.captchaZtgame){const g=document.createElement("script");g.type="text/javascript",g.src=`//nocaptcha.ztgame.com/static/verify2023/js/captcha.js?t=${new Date().getTime()}`,g.id="captchaZtgameScript",document.body.appendChild(g)}},[]);const{mutate:h,isPending:m}=sn({mutationFn:async g=>cx({account:o,nonce:g.nonce,token:g.token,type:g.type,t:"ctoken"}),onSuccess:g=>{const E=g.type;l(E),a(E===2?g.mobile:""),r("secure"),d.current?.onRefresh?.()},onError:g=>{Ct.warning(g?.message||g?.detail||"验证失败"),d.current?.onRefresh?.()}}),y=()=>{if(!o){Ct.warning("请输入账号信息");return}window.captchaZtgame?window.captchaZtgame.init({appsceneid:"pt_login",usertype:"1",el:"captcha-forget-pwd",mode:"popup",styles:{width:300,height:150,fontSize:"14px"},popupStyles:{position:"fixed",top:"30%",left:"50%",zIndex:"99999"},onSuccess(g,E){d.current=g,h({nonce:g.nonce,token:E.data.token,type:g.type})},onLoad(g){d.current=g,g.onVerify()},onFail(){}}):Ct.warning("安全组件未加载,请稍后再试")},v=g=>{f(g),r("reset")};return w.jsxs("div",{className:"space-y-5",children:[w.jsx("div",{id:"captcha-forget-pwd"}),n==="account"&&w.jsxs("div",{className:"space-y-4",children:[w.jsxs("div",{className:"text-sm text-gray-500 mb-4 text-center",children:["为了您的账号安全,请先进行安全验证",w.jsx("br",{}),"请输入您的账号信息"]}),w.jsx(Cn,{name:"account",placeholder:"请输入账号信息",autoFocus:!0,value:o,onChange:g=>s(g.currentTarget.value)}),w.jsx(zt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:y,disabled:!o||m,children:m?"验证中...":"下一步"})]}),n==="secure"&&(c===2?w.jsx(_x,{account:o,mobile:i,onNext:v}):w.jsx(Rx,{account:o,onNext:v})),n==="reset"&&w.jsx(xx,{account:o,forgetPasswordKey:u,onSuccess:()=>r("success")}),n==="success"&&w.jsxs("div",{className:"space-y-4 py-6",children:[w.jsx("div",{className:"text-center text-lg font-medium text-gray-800",children:"重置密码成功"}),w.jsx(zt,{className:"mt-6 h-10 w-full bg-gray-100 text-gray-700 rounded-full hover:bg-gray-200",onClick:()=>e?.(),children:"返回登录"})]})]})}var ap;function ee(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=i.prototype,u=Object.keys(l);for(let f=0;f<u.length;f++){const d=u[f];d in a||(a[d]=l[d].bind(a))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const l=n?.Parent?new s:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Ur extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class cp extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(ap=globalThis).__zod_globalConfig??(ap.__zod_globalConfig={});const qa=globalThis.__zod_globalConfig;function gr(e){return qa}function lp(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Ka(e,t){return typeof t=="bigint"?t.toString():t}function Ja(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Qa(e){return e==null}function ec(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const up=Symbol("evaluating");function ot(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==up)return r===void 0&&(r=up,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function yr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Jn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function fp(e){return JSON.stringify(e)}function Ax(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const dp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Zs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Dx=Ja(()=>{if(qa.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ko(e){if(Zs(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Zs(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function pp(e){return ko(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Nx=new Set(["string","number","symbol"]);function Ws(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function _e(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Fx(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Lx(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Jn(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return yr(this,"shape",i),i},checks:[]});return Qn(e,s)}function zx(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Jn(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return yr(this,"shape",i),i},checks:[]});return Qn(e,s)}function $x(e,t){if(!ko(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Jn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return yr(this,"shape",s),s}});return Qn(e,o)}function Vx(e,t){if(!ko(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Jn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return yr(this,"shape",r),r}});return Qn(e,n)}function jx(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Jn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return yr(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Qn(e,n)}function Hx(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Jn(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return yr(this,"shape",c),c},checks:[]});return Qn(t,i)}function Zx(e,t,n){const r=Jn(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return yr(this,"shape",s),s}});return Qn(t,r)}function Br(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Wx(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function hp(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Us(e){return typeof e=="string"?e:e?.message}function vr(e,t,n){const r=e.message?e.message:Us(e.inst?._zod.def?.error?.(e))??Us(t?.error?.(e))??Us(n.customError?.(e))??Us(n.localeError?.(e))??"Invalid input",{inst:o,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=i),a}function tc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Io(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const mp=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ka,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},gp=ee("$ZodError",mp),yp=ee("$ZodError",mp,{Parent:Error});function Oo(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Ux(e,t=n=>n.message){const n={_errors:[]},r=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{const a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,l=0;for(;l<a.length;){const u=a[l];l===a.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(t(i))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}}};return r(e),n}const nc=e=>(t,n,r,o)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Ur;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>vr(c,s,gr())));throw dp(a,o?.callee),a}return i.value},rc=e=>async(t,n,r,o)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>vr(c,s,gr())));throw dp(a,o?.callee),a}return i.value},Bs=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Ur;return s.issues.length?{success:!1,error:new(e??gp)(s.issues.map(i=>vr(i,o,gr())))}:{success:!0,data:s.value}},Bx=Bs(yp),Gs=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>vr(i,o,gr())))}:{success:!0,data:s.value}},Gx=Gs(yp),Yx=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return nc(e)(t,n,o)},Xx=e=>(t,n,r)=>nc(e)(t,n,r),qx=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return rc(e)(t,n,o)},Kx=e=>async(t,n,r)=>rc(e)(t,n,r),Jx=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Bs(e)(t,n,o)},Qx=e=>(t,n,r)=>Bs(e)(t,n,r),eE=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Gs(e)(t,n,o)},tE=e=>async(t,n,r)=>Gs(e)(t,n,r),nE=/^[cC][0-9a-z]{6,}$/,rE=/^[0-9a-z]+$/,oE=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sE=/^[0-9a-vA-V]{20}$/,iE=/^[A-Za-z0-9]{27}$/,aE=/^[a-zA-Z0-9_-]{21}$/,cE=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lE=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vp=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,uE=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function dE(){return new RegExp(fE,"u")}const pE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hE=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,mE=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,gE=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yE=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bp=/^[A-Za-z0-9_-]*$/,vE=/^https?$/,bE=/^\+[1-9]\d{6,14}$/,wp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wE=new RegExp(`^${wp}$`);function Sp(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function SE(e){return new RegExp(`^${Sp(e)}$`)}function xE(e){const t=Sp({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${wp}T(?:${r})$`)}const EE=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},CE=/^[^A-Z]*$/,PE=/^[^a-z]*$/,Pn=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),TE=ee("$ZodCheckMaxLength",(e,t)=>{var n;Pn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Qa(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=tc(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),kE=ee("$ZodCheckMinLength",(e,t)=>{var n;Pn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Qa(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=tc(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),IE=ee("$ZodCheckLengthEquals",(e,t)=>{var n;Pn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Qa(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const i=tc(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ys=ee("$ZodCheckStringFormat",(e,t)=>{var n,r;Pn.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),OE=ee("$ZodCheckRegex",(e,t)=>{Ys.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_E=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=CE),Ys.init(e,t)}),RE=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=PE),Ys.init(e,t)}),ME=ee("$ZodCheckIncludes",(e,t)=>{Pn.init(e,t);const n=Ws(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),AE=ee("$ZodCheckStartsWith",(e,t)=>{Pn.init(e,t);const n=new RegExp(`^${Ws(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),DE=ee("$ZodCheckEndsWith",(e,t)=>{Pn.init(e,t);const n=new RegExp(`.*${Ws(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),NE=ee("$ZodCheckOverwrite",(e,t)=>{Pn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class FE{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
20
11
|
`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(`
|
|
21
|
-
`))}}const
|
|
22
|
-
if (${
|
|
12
|
+
`))}}const LE={major:4,minor:4,patch:3},St=ee("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=LE;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,c)=>{let l=Br(i),u;for(const f of a){if(f._zod.def.when){if(Wx(i)||!f._zod.def.when(i))continue}else if(l)continue;const d=i.issues.length,h=f._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new Ur;if(u||h instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await h,i.issues.length!==d&&(l||(l=Br(i,d)))});else{if(i.issues.length===d)continue;l||(l=Br(i,d))}}return u?u.then(()=>i):i},s=(i,a,c)=>{if(Br(i))return i.aborted=!0,i;const l=o(a,r,c);if(l instanceof Promise){if(c.async===!1)throw new Ur;return l.then(u=>e._zod.parse(u,c))}return e._zod.parse(l,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const l=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(u=>s(u,i,a)):s(l,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Ur;return c.then(l=>o(l,r,a))}return o(c,r,a)}}ot(e,"~standard",()=>({validate:o=>{try{const s=Bx(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Gx(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),oc=ee("$ZodString",(e,t)=>{St.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??EE(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),pt=ee("$ZodStringFormat",(e,t)=>{Ys.init(e,t),oc.init(e,t)}),zE=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=lE),pt.init(e,t)}),$E=ee("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vp(r))}else t.pattern??(t.pattern=vp());pt.init(e,t)}),VE=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=uE),pt.init(e,t)}),jE=ee("$ZodURL",(e,t)=>{pt.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===vE.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),HE=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=dE()),pt.init(e,t)}),ZE=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=aE),pt.init(e,t)}),WE=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=nE),pt.init(e,t)}),UE=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=rE),pt.init(e,t)}),BE=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=oE),pt.init(e,t)}),GE=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=sE),pt.init(e,t)}),YE=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=iE),pt.init(e,t)}),XE=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=xE(t)),pt.init(e,t)}),qE=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wE),pt.init(e,t)}),KE=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=SE(t)),pt.init(e,t)}),JE=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=cE),pt.init(e,t)}),QE=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=pE),pt.init(e,t),e._zod.bag.format="ipv4"}),eC=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=hE),pt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),tC=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=mE),pt.init(e,t)}),nC=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=gE),pt.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,s]=r;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function xp(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const rC=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yE),pt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{xp(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function oC(e){if(!bp.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return xp(n)}const sC=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=bp),pt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{oC(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),iC=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=bE),pt.init(e,t)});function aC(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const cC=ee("$ZodJWT",(e,t)=>{pt.init(e,t),e._zod.check=n=>{aC(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),lC=ee("$ZodUnknown",(e,t)=>{St.init(e,t),e._zod.parse=n=>n}),uC=ee("$ZodNever",(e,t)=>{St.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Ep(e,t,n){e.issues.length&&t.issues.push(...hp(n,e.issues)),t.value[n]=e.value}const fC=ee("$ZodArray",(e,t)=>{St.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?s.push(c.then(l=>Ep(l,n,i))):Ep(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function Xs(e,t,n,r,o,s){const i=n in r;if(e.issues.length){if(o&&s&&!i)return;t.issues.push(...hp(n,e.issues))}if(!i&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?i&&(t.value[n]=void 0):t.value[n]=e.value}function Cp(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Fx(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Pp(e,t,n,r,o,s){const i=[],a=o.keySet,c=o.catchall._zod,l=c.def.type,u=c.optin==="optional",f=c.optout==="optional";for(const d in t){if(d==="__proto__"||a.has(d))continue;if(l==="never"){i.push(d);continue}const h=c.run({value:t[d],issues:[]},r);h instanceof Promise?e.push(h.then(m=>Xs(m,n,d,t,u,f))):Xs(h,n,d,t,u,f)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const dC=ee("$ZodObject",(e,t)=>{if(St.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Ja(()=>Cp(t));ot(e._zod,"propValues",()=>{const a=t.shape,c={};for(const l in a){const u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(const f of u.values)c[l].add(f)}}return c});const o=Zs,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=r.value);const l=a.value;if(!o(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const u=[],f=i.shape;for(const d of i.keys){const h=f[d],m=h._zod.optin==="optional",y=h._zod.optout==="optional",v=h._zod.run({value:l[d],issues:[]},c);v instanceof Promise?u.push(v.then(g=>Xs(g,a,d,l,m,y))):Xs(v,a,d,l,m,y)}return s?Pp(u,l,a,c,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),pC=ee("$ZodObjectJIT",(e,t)=>{dC.init(e,t);const n=e._zod.parse,r=Ja(()=>Cp(t)),o=d=>{const h=new FE(["shape","payload","ctx"]),m=r.value,y=C=>{const S=fp(C);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let g=0;for(const C of m.keys)v[C]=`key_${g++}`;h.write("const newResult = {};");for(const C of m.keys){const S=v[C],b=fp(C),x=d[C],T=x?._zod?.optin==="optional",I=x?._zod?.optout==="optional";h.write(`const ${S} = ${y(C)};`),T&&I?h.write(`
|
|
13
|
+
if (${S}.issues.length) {
|
|
23
14
|
if (${b} in input) {
|
|
24
|
-
payload.issues = payload.issues.concat(${
|
|
15
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
25
16
|
...iss,
|
|
26
17
|
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
27
18
|
})));
|
|
28
19
|
}
|
|
29
20
|
}
|
|
30
21
|
|
|
31
|
-
if (${
|
|
22
|
+
if (${S}.value === undefined) {
|
|
32
23
|
if (${b} in input) {
|
|
33
24
|
newResult[${b}] = undefined;
|
|
34
25
|
}
|
|
35
26
|
} else {
|
|
36
|
-
newResult[${b}] = ${
|
|
27
|
+
newResult[${b}] = ${S}.value;
|
|
37
28
|
}
|
|
38
29
|
|
|
39
30
|
`):T?h.write(`
|
|
40
|
-
if (${
|
|
41
|
-
payload.issues = payload.issues.concat(${
|
|
31
|
+
if (${S}.issues.length) {
|
|
32
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
42
33
|
...iss,
|
|
43
34
|
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
44
35
|
})));
|
|
45
36
|
}
|
|
46
37
|
|
|
47
|
-
if (${
|
|
38
|
+
if (${S}.value === undefined) {
|
|
48
39
|
if (${b} in input) {
|
|
49
40
|
newResult[${b}] = undefined;
|
|
50
41
|
}
|
|
51
42
|
} else {
|
|
52
|
-
newResult[${b}] = ${
|
|
43
|
+
newResult[${b}] = ${S}.value;
|
|
53
44
|
}
|
|
54
45
|
|
|
55
46
|
`):h.write(`
|
|
56
|
-
const ${
|
|
57
|
-
if (${
|
|
58
|
-
payload.issues = payload.issues.concat(${
|
|
47
|
+
const ${S}_present = ${b} in input;
|
|
48
|
+
if (${S}.issues.length) {
|
|
49
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
59
50
|
...iss,
|
|
60
51
|
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
61
52
|
})));
|
|
62
53
|
}
|
|
63
|
-
if (!${
|
|
54
|
+
if (!${S}_present && !${S}.issues.length) {
|
|
64
55
|
payload.issues.push({
|
|
65
56
|
code: "invalid_type",
|
|
66
57
|
expected: "nonoptional",
|
|
@@ -69,14 +60,14 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
69
60
|
});
|
|
70
61
|
}
|
|
71
62
|
|
|
72
|
-
if (${
|
|
73
|
-
if (${
|
|
63
|
+
if (${S}_present) {
|
|
64
|
+
if (${S}.value === undefined) {
|
|
74
65
|
newResult[${b}] = undefined;
|
|
75
66
|
} else {
|
|
76
|
-
newResult[${b}] = ${
|
|
67
|
+
newResult[${b}] = ${S}.value;
|
|
77
68
|
}
|
|
78
69
|
}
|
|
79
70
|
|
|
80
|
-
`)}h.write("payload.value = newResult;"),h.write("return payload;");const C=h.compile();return(S,E)=>C(p,S,E)};let s;const i=ti,a=!kc.jitless,u=a&&Q1.value,l=t.catchall;let d;e._zod.parse=(p,h)=>{d??(d=r.value);const m=p.value;return i(m)?a&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),p=s(p,h),l?yh([],m,p,h,d,e):p):n(p,h):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),p)}});function vh(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Yr(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>br(i,r,yr())))}),t)}const MC=ee("$ZodUnion",(e,t)=>{Et.init(e,t),ot(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ot(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ot(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ot(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Ac(o.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const i=[];for(const a of t.options){const c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>vh(a,r,e,o)):vh(i,r,e,o)}}),AC=ee("$ZodIntersection",(e,t)=>{Et.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>bh(n,c,u)):bh(n,s,i)}});function zc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_o(e)&&_o(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const i=zc(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=zc(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function bh(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&e.issues.push({...o,keys:s}),Yr(e))return e;const i=zc(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const DC=ee("$ZodEnum",(e,t)=>{Et.init(e,t);const n=th(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>ex.has(typeof o)).map(o=>typeof o=="string"?ni(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),LC=ee("$ZodTransform",(e,t)=>{Et.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new eh(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n.fallback=!0,n));if(o instanceof Promise)throw new Gr;return n.value=o,n.fallback=!0,n}});function wh(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Sh=ee("$ZodOptional",(e,t)=>{Et.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ac(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=n.value,s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>wh(i,o)):wh(s,o)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),FC=ee("$ZodExactOptional",(e,t)=>{Sh.init(e,t),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),VC=ee("$ZodNullable",(e,t)=>{Et.init(e,t),ot(e._zod,"optin",()=>t.innerType._zod.optin),ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ac(n.source)}|null)$`):void 0}),ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),zC=ee("$ZodDefault",(e,t)=>{Et.init(e,t),e._zod.optin="optional",ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Eh(s,t)):Eh(o,t)}});function Eh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const $C=ee("$ZodPrefault",(e,t)=>{Et.init(e,t),e._zod.optin="optional",ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),jC=ee("$ZodNonOptional",(e,t)=>{Et.init(e,t),ot(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>xh(s,e)):xh(o,e)}});function xh(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const HC=ee("$ZodCatch",(e,t)=>{Et.init(e,t),e._zod.optin="optional",ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>br(i,r,yr()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>br(s,r,yr()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),UC=ee("$ZodPipe",(e,t)=>{Et.init(e,t),ot(e._zod,"values",()=>t.in._zod.values),ot(e._zod,"optin",()=>t.in._zod.optin),ot(e._zod,"optout",()=>t.out._zod.optout),ot(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>ui(i,t.in,r)):ui(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>ui(s,t.out,r)):ui(o,t.out,r)}});function ui(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const BC=ee("$ZodReadonly",(e,t)=>{Et.init(e,t),ot(e._zod,"propValues",()=>t.innerType._zod.propValues),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"optin",()=>t.innerType?._zod?.optin),ot(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Ch):Ch(o)}});function Ch(e){return e.value=Object.freeze(e.value),e}const WC=ee("$ZodCustom",(e,t)=>{On.init(e,t),Et.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>Th(s,n,r,e));Th(o,n,r,e)}});function Th(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Io(o))}}var Oh;class ZC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function GC(){return new ZC}(Oh=globalThis).__zod_globalRegistry??(Oh.__zod_globalRegistry=GC());const ko=globalThis.__zod_globalRegistry;function YC(e,t){return new e({type:"string",...ke(t)})}function XC(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function Ph(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function qC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function KC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}function JC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}function QC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}function eT(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}function tT(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}function nT(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}function rT(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}function oT(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}function sT(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}function iT(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}function aT(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}function cT(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}function uT(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}function lT(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}function dT(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}function fT(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}function pT(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}function hT(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}function mT(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}function gT(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}function yT(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}function vT(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}function bT(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}function wT(e){return new e({type:"unknown"})}function ST(e,t){return new e({type:"never",...ke(t)})}function _h(e,t){return new Wx({check:"max_length",...ke(t),maximum:e})}function li(e,t){return new Zx({check:"min_length",...ke(t),minimum:e})}function Ih(e,t){return new Gx({check:"length_equals",...ke(t),length:e})}function ET(e,t){return new Yx({check:"string_format",format:"regex",...ke(t),pattern:e})}function xT(e){return new Xx({check:"string_format",format:"lowercase",...ke(e)})}function CT(e){return new qx({check:"string_format",format:"uppercase",...ke(e)})}function TT(e,t){return new Kx({check:"string_format",format:"includes",...ke(t),includes:e})}function OT(e,t){return new Jx({check:"string_format",format:"starts_with",...ke(t),prefix:e})}function PT(e,t){return new Qx({check:"string_format",format:"ends_with",...ke(t),suffix:e})}function Xr(e){return new eC({check:"overwrite",tx:e})}function _T(e){return Xr(t=>t.normalize(e))}function IT(){return Xr(e=>e.trim())}function kT(){return Xr(e=>e.toLowerCase())}function RT(){return Xr(e=>e.toUpperCase())}function NT(){return Xr(e=>J1(e))}function MT(e,t,n){return new e({type:"array",element:t,...ke(n)})}function AT(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ke(n)})}function DT(e,t){const n=LT(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Io(o,r.value,n._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Io(s))}},e(r.value,r)),t);return n}function LT(e,t){const n=new On({check:"custom",...ke(t)});return n._zod.check=e,n}function kh(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ko,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function It(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{const p=i.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,p,l)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),It(d,t,l),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&zt(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Rh(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=r.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const o=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(i[0])?.id,p=e.external.uri??(m=>m);if(d)return{ref:p(d)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${p("__shared")}#/${a}/${h}`}}if(i[1]===n)return{ref:"#"};const u=`#/${a}/`,l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=o(i);a.def={...a.schema},u&&(a.defId=u);const l=a.schema;for(const d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
71
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");const E=h.compile();return(C,S)=>E(d,C,S)};let s;const i=Zs,a=!qa.jitless,l=a&&Dx.value,u=t.catchall;let f;e._zod.parse=(d,h)=>{f??(f=r.value);const m=d.value;return i(m)?a&&l&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),d=s(d,h),u?Pp([],m,d,h,f,e):d):n(d,h):(d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d)}});function Tp(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Br(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>vr(i,r,gr())))}),t)}const hC=ee("$ZodUnion",(e,t)=>{St.init(e,t),ot(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ot(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ot(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ot(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>ec(o.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const i=[];for(const a of t.options){const c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>Tp(a,r,e,o)):Tp(i,r,e,o)}}),mC=ee("$ZodIntersection",(e,t)=>{St.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,l])=>kp(n,c,l)):kp(n,s,i)}});function sc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ko(e)&&ko(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const i=sc(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=sc(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function kp(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&e.issues.push({...o,keys:s}),Br(e))return e;const i=sc(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const gC=ee("$ZodEnum",(e,t)=>{St.init(e,t);const n=lp(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Nx.has(typeof o)).map(o=>typeof o=="string"?Ws(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),yC=ee("$ZodTransform",(e,t)=>{St.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new cp(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n.fallback=!0,n));if(o instanceof Promise)throw new Ur;return n.value=o,n.fallback=!0,n}});function Ip(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Op=ee("$ZodOptional",(e,t)=>{St.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ec(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=n.value,s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Ip(i,o)):Ip(s,o)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),vC=ee("$ZodExactOptional",(e,t)=>{Op.init(e,t),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),bC=ee("$ZodNullable",(e,t)=>{St.init(e,t),ot(e._zod,"optin",()=>t.innerType._zod.optin),ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ec(n.source)}|null)$`):void 0}),ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),wC=ee("$ZodDefault",(e,t)=>{St.init(e,t),e._zod.optin="optional",ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>_p(s,t)):_p(o,t)}});function _p(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const SC=ee("$ZodPrefault",(e,t)=>{St.init(e,t),e._zod.optin="optional",ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),xC=ee("$ZodNonOptional",(e,t)=>{St.init(e,t),ot(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Rp(s,e)):Rp(o,e)}});function Rp(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const EC=ee("$ZodCatch",(e,t)=>{St.init(e,t),e._zod.optin="optional",ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>vr(i,r,gr()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>vr(s,r,gr()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),CC=ee("$ZodPipe",(e,t)=>{St.init(e,t),ot(e._zod,"values",()=>t.in._zod.values),ot(e._zod,"optin",()=>t.in._zod.optin),ot(e._zod,"optout",()=>t.out._zod.optout),ot(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>qs(i,t.in,r)):qs(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>qs(s,t.out,r)):qs(o,t.out,r)}});function qs(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const PC=ee("$ZodReadonly",(e,t)=>{St.init(e,t),ot(e._zod,"propValues",()=>t.innerType._zod.propValues),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"optin",()=>t.innerType?._zod?.optin),ot(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Mp):Mp(o)}});function Mp(e){return e.value=Object.freeze(e.value),e}const TC=ee("$ZodCustom",(e,t)=>{Pn.init(e,t),St.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>Ap(s,n,r,e));Ap(o,n,r,e)}});function Ap(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Io(o))}}var Dp;class kC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function IC(){return new kC}(Dp=globalThis).__zod_globalRegistry??(Dp.__zod_globalRegistry=IC());const _o=globalThis.__zod_globalRegistry;function OC(e,t){return new e({type:"string",..._e(t)})}function _C(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._e(t)})}function Np(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._e(t)})}function RC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._e(t)})}function MC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._e(t)})}function AC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._e(t)})}function DC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._e(t)})}function NC(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._e(t)})}function FC(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._e(t)})}function LC(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._e(t)})}function zC(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._e(t)})}function $C(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._e(t)})}function VC(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._e(t)})}function jC(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._e(t)})}function HC(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._e(t)})}function ZC(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._e(t)})}function WC(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._e(t)})}function UC(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._e(t)})}function BC(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._e(t)})}function GC(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._e(t)})}function YC(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._e(t)})}function XC(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._e(t)})}function qC(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._e(t)})}function KC(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._e(t)})}function JC(e,t){return new e({type:"string",format:"date",check:"string_format",..._e(t)})}function QC(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._e(t)})}function eP(e,t){return new e({type:"string",format:"duration",check:"string_format",..._e(t)})}function tP(e){return new e({type:"unknown"})}function nP(e,t){return new e({type:"never",..._e(t)})}function Fp(e,t){return new TE({check:"max_length",..._e(t),maximum:e})}function Ks(e,t){return new kE({check:"min_length",..._e(t),minimum:e})}function Lp(e,t){return new IE({check:"length_equals",..._e(t),length:e})}function rP(e,t){return new OE({check:"string_format",format:"regex",..._e(t),pattern:e})}function oP(e){return new _E({check:"string_format",format:"lowercase",..._e(e)})}function sP(e){return new RE({check:"string_format",format:"uppercase",..._e(e)})}function iP(e,t){return new ME({check:"string_format",format:"includes",..._e(t),includes:e})}function aP(e,t){return new AE({check:"string_format",format:"starts_with",..._e(t),prefix:e})}function cP(e,t){return new DE({check:"string_format",format:"ends_with",..._e(t),suffix:e})}function Gr(e){return new NE({check:"overwrite",tx:e})}function lP(e){return Gr(t=>t.normalize(e))}function uP(){return Gr(e=>e.trim())}function fP(){return Gr(e=>e.toLowerCase())}function dP(){return Gr(e=>e.toUpperCase())}function pP(){return Gr(e=>Ax(e))}function hP(e,t,n){return new e({type:"array",element:t,..._e(n)})}function mP(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._e(n)})}function gP(e,t){const n=yP(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Io(o,r.value,n._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Io(s))}},e(r.value,r)),t);return n}function yP(e,t){const n=new Pn({check:"custom",..._e(t)});return n._zod.check=e,n}function zp(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??_o,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ot(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,u);else{const d=i.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,d,u)}const f=e._zod.parent;f&&(i.ref||(i.ref=f),Ot(f,t,u),t.seen.get(f).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&$t(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function $p(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=r.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const o=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(i[0])?.id,d=e.external.uri??(m=>m);if(f)return{ref:d(f)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${d("__shared")}#/${a}/${h}`}}if(i[1]===n)return{ref:"#"};const l=`#/${a}/`,u=i[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+u}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:l}=o(i);a.def={...a.schema},l&&(a.defId=l);const u=a.schema;for(const f in u)delete u[f];u.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
81
72
|
|
|
82
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){s(i);continue}if(e.external){const u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused==="ref"){s(i);continue}}}function Nh(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const c=e.seen.get(a);if(c.ref===null)return;const u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){r(d);const h=e.seen.get(d),m=h.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Object.assign(u,m),Object.assign(u,l),a._zod.parent===d)for(const v in u)v==="$ref"||v==="allOf"||v in l||delete u[v];if(m.$ref&&h.def)for(const v in u)v==="$ref"||v==="allOf"||v in h.def&&JSON.stringify(u[v])===JSON.stringify(h.def[v])&&delete u[v]}const p=a._zod.parent;if(p&&p!==d){r(p);const h=e.seen.get(p);if(h?.schema.$ref&&(u.$ref=h.schema.$ref,h.def))for(const m in u)m==="$ref"||m==="allOf"||m in h.def&&JSON.stringify(u[m])===JSON.stringify(h.def[m])&&delete u[m]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&o.id===s&&delete o.id;const i=e.external?.defs??{};for(const a of e.seen.entries()){const c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:di(t,"input",e.processors),output:di(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function zt(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return zt(r.element,n);if(r.type==="set")return zt(r.valueType,n);if(r.type==="lazy")return zt(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return zt(r.innerType,n);if(r.type==="intersection")return zt(r.left,n)||zt(r.right,n);if(r.type==="record"||r.type==="map")return zt(r.keyType,n)||zt(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:zt(r.in,n)||zt(r.out,n);if(r.type==="object"){for(const o in r.shape)if(zt(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(zt(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(zt(o,n))return!0;return!!(r.rest&&zt(r.rest,n))}return!1}const FT=(e,t={})=>n=>{const r=kh({...n,processors:t});return It(e,r),Rh(r,e),Nh(r,e)},di=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=kh({...o??{},target:s,io:t,processors:n});return It(e,i),Rh(i,e),Nh(i,e)},VT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zT=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=VT[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},$T=(e,t,n,r)=>{n.not={}},jT=(e,t,n,r)=>{},HT=(e,t,n,r)=>{const o=e._zod.def,s=th(o.entries);s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},UT=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},BT=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},WT=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=It(s.element,t,{...r,path:[...r.path,"items"]})},ZT=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const u in i)o.properties[u]=It(i[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const l=s.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=It(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},GT=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>It(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},YT=(e,t,n,r)=>{const o=e._zod.def,s=It(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=It(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},XT=(e,t,n,r)=>{const o=e._zod.def,s=It(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},qT=(e,t,n,r)=>{const o=e._zod.def;It(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},KT=(e,t,n,r)=>{const o=e._zod.def;It(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},JT=(e,t,n,r)=>{const o=e._zod.def;It(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},QT=(e,t,n,r)=>{const o=e._zod.def;It(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},eO=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;It(i,t,r);const a=t.seen.get(e);a.ref=i},tO=(e,t,n,r)=>{const o=e._zod.def;It(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},Mh=(e,t,n,r)=>{const o=e._zod.def;It(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},nO=ee("ZodISODateTime",(e,t)=>{hC.init(e,t),ht.init(e,t)});function rO(e){return gT(nO,e)}const oO=ee("ZodISODate",(e,t)=>{mC.init(e,t),ht.init(e,t)});function sO(e){return yT(oO,e)}const iO=ee("ZodISOTime",(e,t)=>{gC.init(e,t),ht.init(e,t)});function aO(e){return vT(iO,e)}const cO=ee("ZodISODuration",(e,t)=>{yC.init(e,t),ht.init(e,t)});function uO(e){return bT(cO,e)}const nn=ee("ZodError",(e,t)=>{ch.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>lx(e,n)},flatten:{value:n=>oi(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Rc,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Rc,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),lO=Lc(nn),dO=Fc(nn),fO=si(nn),pO=ii(nn),hO=px(nn),mO=hx(nn),gO=mx(nn),yO=gx(nn),vO=yx(nn),bO=vx(nn),wO=bx(nn),SO=wx(nn),Ah=new WeakMap;function fi(e,t,n){const r=Object.getPrototypeOf(e);let o=Ah.get(r);if(o||(o=new Set,Ah.set(r,o)),!o.has(t)){o.add(t);for(const s in n){const i=n[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){const a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const xt=ee("ZodType",(e,t)=>(Et.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:di(e,"input"),output:di(e,"output")}}),e.toJSONSchema=FT(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>lO(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>fO(e,n,r),e.parseAsync=async(n,r)=>dO(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>pO(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>hO(e,n,r),e.decode=(n,r)=>mO(e,n,r),e.encodeAsync=async(n,r)=>gO(e,n,r),e.decodeAsync=async(n,r)=>yO(e,n,r),e.safeEncode=(n,r)=>vO(e,n,r),e.safeDecode=(n,r)=>bO(e,n,r),e.safeEncodeAsync=async(n,r)=>wO(e,n,r),e.safeDecodeAsync=async(n,r)=>SO(e,n,r),fi(e,"ZodType",{check(...n){const r=this.def;return this.clone(Jn(r,{checks:[...r.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Qn(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(pP(n,r))},superRefine(n,r){return this.check(hP(n,r))},overwrite(n){return this.check(Xr(n))},optional(){return $h(this)},exactOptional(){return eP(this)},nullable(){return jh(this)},nullish(){return $h(jh(this))},nonoptional(n){return iP(this,n)},array(){return BO(this)},or(n){return GO([this,n])},and(n){return XO(this,n)},transform(n){return Uh(this,JO(n))},default(n){return rP(this,n)},prefault(n){return sP(this,n)},catch(n){return cP(this,n)},pipe(n){return Uh(this,n)},readonly(){return dP(this)},describe(n){const r=this.clone();return ko.add(r,{description:n}),r},meta(...n){if(n.length===0)return ko.get(this);const r=this.clone();return ko.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return ko.get(e)?.description},configurable:!0}),e)),Dh=ee("_ZodString",(e,t)=>{Vc.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>zT(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,fi(e,"_ZodString",{regex(...r){return this.check(ET(...r))},includes(...r){return this.check(TT(...r))},startsWith(...r){return this.check(OT(...r))},endsWith(...r){return this.check(PT(...r))},min(...r){return this.check(li(...r))},max(...r){return this.check(_h(...r))},length(...r){return this.check(Ih(...r))},nonempty(...r){return this.check(li(1,...r))},lowercase(r){return this.check(xT(r))},uppercase(r){return this.check(CT(r))},trim(){return this.check(IT())},normalize(...r){return this.check(_T(...r))},toLowerCase(){return this.check(kT())},toUpperCase(){return this.check(RT())},slugify(){return this.check(NT())}})}),EO=ee("ZodString",(e,t)=>{Vc.init(e,t),Dh.init(e,t),e.email=n=>e.check(XC(xO,n)),e.url=n=>e.check(eT(CO,n)),e.jwt=n=>e.check(mT(zO,n)),e.emoji=n=>e.check(tT(TO,n)),e.guid=n=>e.check(Ph(Lh,n)),e.uuid=n=>e.check(qC(hi,n)),e.uuidv4=n=>e.check(KC(hi,n)),e.uuidv6=n=>e.check(JC(hi,n)),e.uuidv7=n=>e.check(QC(hi,n)),e.nanoid=n=>e.check(nT(OO,n)),e.guid=n=>e.check(Ph(Lh,n)),e.cuid=n=>e.check(rT(PO,n)),e.cuid2=n=>e.check(oT(_O,n)),e.ulid=n=>e.check(sT(IO,n)),e.base64=n=>e.check(fT(LO,n)),e.base64url=n=>e.check(pT(FO,n)),e.xid=n=>e.check(iT(kO,n)),e.ksuid=n=>e.check(aT(RO,n)),e.ipv4=n=>e.check(cT(NO,n)),e.ipv6=n=>e.check(uT(MO,n)),e.cidrv4=n=>e.check(lT(AO,n)),e.cidrv6=n=>e.check(dT(DO,n)),e.e164=n=>e.check(hT(VO,n)),e.datetime=n=>e.check(rO(n)),e.date=n=>e.check(sO(n)),e.time=n=>e.check(aO(n)),e.duration=n=>e.check(uO(n))});function pi(e){return YC(EO,e)}const ht=ee("ZodStringFormat",(e,t)=>{pt.init(e,t),Dh.init(e,t)}),xO=ee("ZodEmail",(e,t)=>{sC.init(e,t),ht.init(e,t)}),Lh=ee("ZodGUID",(e,t)=>{rC.init(e,t),ht.init(e,t)}),hi=ee("ZodUUID",(e,t)=>{oC.init(e,t),ht.init(e,t)}),CO=ee("ZodURL",(e,t)=>{iC.init(e,t),ht.init(e,t)}),TO=ee("ZodEmoji",(e,t)=>{aC.init(e,t),ht.init(e,t)}),OO=ee("ZodNanoID",(e,t)=>{cC.init(e,t),ht.init(e,t)}),PO=ee("ZodCUID",(e,t)=>{uC.init(e,t),ht.init(e,t)}),_O=ee("ZodCUID2",(e,t)=>{lC.init(e,t),ht.init(e,t)}),IO=ee("ZodULID",(e,t)=>{dC.init(e,t),ht.init(e,t)}),kO=ee("ZodXID",(e,t)=>{fC.init(e,t),ht.init(e,t)}),RO=ee("ZodKSUID",(e,t)=>{pC.init(e,t),ht.init(e,t)}),NO=ee("ZodIPv4",(e,t)=>{vC.init(e,t),ht.init(e,t)}),MO=ee("ZodIPv6",(e,t)=>{bC.init(e,t),ht.init(e,t)}),AO=ee("ZodCIDRv4",(e,t)=>{wC.init(e,t),ht.init(e,t)}),DO=ee("ZodCIDRv6",(e,t)=>{SC.init(e,t),ht.init(e,t)}),LO=ee("ZodBase64",(e,t)=>{EC.init(e,t),ht.init(e,t)}),FO=ee("ZodBase64URL",(e,t)=>{CC.init(e,t),ht.init(e,t)}),VO=ee("ZodE164",(e,t)=>{TC.init(e,t),ht.init(e,t)}),zO=ee("ZodJWT",(e,t)=>{PC.init(e,t),ht.init(e,t)}),$O=ee("ZodUnknown",(e,t)=>{_C.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jT()});function Fh(){return wT($O)}const jO=ee("ZodNever",(e,t)=>{IC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$T(e,n,r)});function HO(e){return ST(jO,e)}const UO=ee("ZodArray",(e,t)=>{kC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>WT(e,n,r,o),e.element=t.element,fi(e,"ZodArray",{min(n,r){return this.check(li(n,r))},nonempty(n){return this.check(li(1,n))},max(n,r){return this.check(_h(n,r))},length(n,r){return this.check(Ih(n,r))},unwrap(){return this.element}})});function BO(e,t){return MT(UO,e,t)}const WO=ee("ZodObject",(e,t)=>{NC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ZT(e,n,r,o),ot(e,"shape",()=>t.shape),fi(e,"ZodObject",{keyof(){return qO(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Fh()})},loose(){return this.clone({...this._zod.def,catchall:Fh()})},strict(){return this.clone({...this._zod.def,catchall:HO()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return ox(this,n)},safeExtend(n){return sx(this,n)},merge(n){return ix(this,n)},pick(n){return nx(this,n)},omit(n){return rx(this,n)},partial(...n){return ax(zh,this,n[0])},required(...n){return cx(Hh,this,n[0])}})});function Vh(e,t){const n={type:"object",shape:e??{},...ke(t)};return new WO(n)}const ZO=ee("ZodUnion",(e,t)=>{MC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>GT(e,n,r,o),e.options=t.options});function GO(e,t){return new ZO({type:"union",options:e,...ke(t)})}const YO=ee("ZodIntersection",(e,t)=>{AC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>YT(e,n,r,o)});function XO(e,t){return new YO({type:"intersection",left:e,right:t})}const $c=ee("ZodEnum",(e,t)=>{DC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>HT(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new $c({...t,checks:[],...ke(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new $c({...t,checks:[],...ke(o),entries:s})}});function qO(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new $c({type:"enum",entries:n,...ke(t)})}const KO=ee("ZodTransform",(e,t)=>{LC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>BT(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new eh(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Io(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Io(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});function JO(e){return new KO({type:"transform",transform:e})}const zh=ee("ZodOptional",(e,t)=>{Sh.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mh(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function $h(e){return new zh({type:"optional",innerType:e})}const QO=ee("ZodExactOptional",(e,t)=>{FC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mh(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function eP(e){return new QO({type:"optional",innerType:e})}const tP=ee("ZodNullable",(e,t)=>{VC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>XT(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function jh(e){return new tP({type:"nullable",innerType:e})}const nP=ee("ZodDefault",(e,t)=>{zC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>KT(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function rP(e,t){return new nP({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():sh(t)}})}const oP=ee("ZodPrefault",(e,t)=>{$C.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>JT(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function sP(e,t){return new oP({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():sh(t)}})}const Hh=ee("ZodNonOptional",(e,t)=>{jC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>qT(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function iP(e,t){return new Hh({type:"nonoptional",innerType:e,...ke(t)})}const aP=ee("ZodCatch",(e,t)=>{HC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>QT(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function cP(e,t){return new aP({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const uP=ee("ZodPipe",(e,t)=>{UC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>eO(e,n,r,o),e.in=t.in,e.out=t.out});function Uh(e,t){return new uP({type:"pipe",in:e,out:t})}const lP=ee("ZodReadonly",(e,t)=>{BC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tO(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function dP(e){return new lP({type:"readonly",innerType:e})}const fP=ee("ZodCustom",(e,t)=>{WC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>UT(e,n)});function pP(e,t={}){return AT(fP,e,t)}function hP(e,t){return DT(e,t)}const wr={trigger:"_trigger_1e3h3_1",popup:"_popup_1e3h3_5",item:"_item_1e3h3_24",indicator:"_indicator_1e3h3_40",itemText:"_itemText_1e3h3_44",itemCode:"_itemCode_1e3h3_48",itemLabel:"_itemLabel_1e3h3_52"};function mP({value:e,onValueChange:t}){const{gameId:n}=Dn(),r=dS(),o=f.useMemo(()=>r.find(i=>i.id===e||i.value===e)?.id||e,[r,e]);return w.jsxs(n1,{value:o,onValueChange:s=>{const i=r.find(a=>a.id===s);i&&t?.(i.value)},children:[w.jsxs(Pp,{className:wr.trigger,children:[w.jsx("span",{children:r.find(s=>s.id===o)?.value}),w.jsx(jp,{className:"size-4"})]}),w.jsx(Ip,{children:w.jsx(kp,{className:"outline-none z-[999]",sideOffset:-4,align:"start",children:w.jsx(Rp,{className:wr.popup,children:r.map(({label:s,value:i,id:a})=>w.jsxs(Dp,{value:a,className:wr.item,children:[w.jsx(Lp,{className:wr.indicator,children:w.jsx(Pc,{className:"size-3"})}),w.jsxs(Vp,{className:wr.itemText,children:[w.jsx("span",{className:wr.itemCode,children:i}),w.jsx("span",{className:wr.itemLabel,children:s})]})]},a))})})})]})}const Bh=Vh({phoneNumber:pi().regex(/^[1-9]\d{10}$/,"请输入正确的手机号"),verificationCode:pi().length(4,"请输入 6 位验证码")});function Wh(){const{mobileLoginConfig:e={},gameId:t,onPhoneLoginSuccess:n,onLoginSuccess:r,onLoginError:o,triggerRealNameAuth:s}=Dn(),[i,a]=oe.useState("86"),[c,u]=oe.useState(""),l=oe.useRef(null),[d,p]=oe.useState(""),[h,m]=oe.useState(),[g,v]=oe.useState(!0),[y,C]=oe.useState({}),[S,E]=oe.useState(!1),[b]=Jp({leftTime:h?h*1e3:void 0,interval:1e3,onEnd(){m(void 0)}}),{mutate:x,isPending:T}=sn({mutationFn:()=>E1({mobile:c,countryCode:i,type:e.smsType}),onSuccess:L=>{E(!0),m(L.lock_time),gt.success("验证码已发送,请注意查收")}}),{mutate:P,isPending:$}=sn({mutationFn:async()=>{const L=await x1({mobile:c,countryCode:i,captcha:d});m(void 0);const D={account:L.account,entity:L.channel_info.entity,token:L.channel_info.token,sign:L.channel_info.sign,accid:L.channel_info.entity.openid,extra_data:L.channel_info.extra_data,gaplaySign:L.channel_info.gaplaySign,realname:L.channel_info.realname};if(Ns(D,L._auth,t),D.realname&&D.realname.reject>=2){s();return}return n&&await n(D),r?.(D),L},onError:L=>{o?.(L)}});function M(){if(!g){gt.warning("请先阅读并同意用户协议和隐私政策");return}const L=new FormData(l.current),D=Bh.pick({phoneNumber:!0}).safeParse(Object.fromEntries(L));if(!D.success){C(oi(D.error).fieldErrors);return}x()}async function V(L){if(L.preventDefault(),!g)return gt.warning("请先阅读并同意用户协议和隐私政策"),{errors:{}};const D=new FormData(L.currentTarget),R=Bh.safeParse(Object.fromEntries(D));return R.success?(P(),{errors:{}}):{errors:oi(R.error).fieldErrors}}return w.jsx(w.Fragment,{children:w.jsxs(To,{ref:l,errors:y,onSubmit:async L=>{const D=await V(L);C(D.errors)},className:"space-y-5",children:[w.jsx(Tn,{name:"phoneNumber",placeholder:"请输入手机号码",autoFocus:!0,type:"tel",onChange:L=>u(L.currentTarget.value),prefix:w.jsx(mP,{value:i,onValueChange:a})}),w.jsx(Tn,{name:"verificationCode",placeholder:"请输入验证码",value:d,type:"number",onValueChange:L=>{const D=L;p(D),D.length===4&&S&&setTimeout(()=>{l.current?.requestSubmit()},0)},suffix:w.jsx("button",{type:"button",className:"enabled:text-[var(--jssdk-primary-color)] text-sm rounded-full h-4/6 px-2 enabled:hover:bg-[var(--jssdk-primary-color)] enabled:hover:text-white inline-flex items-center disabled:cursor-not-allowed disabled:text-gray-500",onClick:()=>M(),disabled:!!h||T,children:T?"发送中...":h?`${Math.round(b/1e3)}s 后重新获取`:"获取验证码"})}),w.jsx(Rt,{className:St("my-5 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",e.buttonClassName),disabled:$,type:"submit",children:$?"登录中...":e.buttonText||"登录"}),w.jsx(Qs,{}),w.jsx(qp,{checked:g,onChange:v})]})})}function gP(e){return w.jsxs("svg",{width:"20",height:"10",viewBox:"0 0 20 10",fill:"none",...e,children:[w.jsx("path",{d:"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",className:"fill-current"}),w.jsx("path",{d:"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z",className:"fill-current"})]})}function yP({children:e,title:t,description:n,content:r,classNames:o={}}){return w.jsxs(YE,{children:[w.jsx(hp,{className:o.trigger,delay:0,children:e}),w.jsxs(mp,{children:[w.jsx(Sp,{className:St("fixed inset-0 bg-black/20 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",o.backdrop)}),w.jsx(yp,{sideOffset:8,className:o.positioner,children:w.jsxs(bp,{className:St("origin-[var(--transform-origin)] bg-white p-1 rounded shadow-sm text-gray-900 transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 dark:shadow-none dark:-outline-offset-1 dark:outline-gray-300",o.popup),children:[w.jsx(wp,{className:St("data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",o.arrow),children:w.jsx(gP,{})}),t&&w.jsx(Ep,{className:"text-base font-medium",children:t}),n&&w.jsx(xp,{className:"text-base text-gray-600",children:n}),r]})})]})]})}const Sr={uidGet:"_uidGet_os9yc_1",mailCodeGet:"_mailCodeGet_os9yc_5",uidGetPopup:"_uidGetPopup_os9yc_79",uidGetArrow:"_uidGetArrow_os9yc_83",inputControl:"_inputControl_os9yc_86",form:"_form_os9yc_89"};function Zh({onUidLoginSuccess:e,customSendUidMailCaptcha:t,customValidateUidMailCaptcha:n}={}){const{gameId:r,autoLoginConfig:o,sceneId:s,onUidLoginSuccess:i,onLoginSuccess:a,onLoginError:c,uidLoginConfig:u={}}=Dn(),l=oe.useRef(null),[d,p]=oe.useState(""),[h,m]=oe.useState(""),[g,v]=oe.useState(!0),[y,C]=oe.useState(!1),[S,{startCountdown:E,resetCountdown:b}]=F1({countStart:120,intervalMs:1e3}),{mutate:x}=sn({mutationFn:()=>{const M=o.enabled?o.days:void 0;return n?n({gameId:r,captcha:h,expireInDays:g?M:void 0,accountId:d,sceneId:s}):w1({game_id:r,charid:d,captcha_type:"login",captcha:h,expires_day:g?M:void 0,scene_id:s,...u.uidMailExtraParams})},onSuccess:M=>{i?.(M),e?.(M),a?.(M)},onError:M=>{c?.(M)}}),{mutate:T,isPending:P}=sn({mutationFn:()=>t?t({gameId:r,accountId:d}):b1({game_id:r,captcha_type:"login",charid:d,scene_id:s,...u.uidMailExtraParams}),onSuccess:M=>{E(),gt.success(M.error)}});async function $(M){M.preventDefault(),x()}return oe.useEffect(()=>{h.length===6&&d&&setTimeout(()=>{l.current?.requestSubmit()},0)},[h,d]),oe.useEffect(()=>{S===0&&b(),C(S!==120)},[S,b]),w.jsxs(To,{ref:l,onSubmit:$,className:St("space-y-6",Sr.form),autoComplete:"off",children:[["5199","5012"].includes(r)?w.jsx("p",{className:"text-center text-xs text-white/80",children:"请点击游戏右上角“设置”查看账号ID"}):null,w.jsx(Tn,{name:"accountId",className:St(Sr.inputControl,"bg-[var(--jssdk-input-bg-color)]"),inputClassName:"bg-inherit",placeholder:"请输入账号 ID",autoFocus:!0,type:"tel",onChange:M=>p(M.currentTarget.value),prefix:w.jsx(yP,{content:w.jsx("div",{className:St(Sr.uidGet,u.uidGetterImageClassName)}),classNames:{backdrop:"z-[992]",positioner:"z-[992]",popup:St("rounded-2xl shadow-lg",Sr.uidGetPopup),arrow:Sr.uidGetArrow,trigger:"size-5 lg:size-6 lg:text-2xl rounded-full bg-[var(--jssdk-icon-color)] inline-flex items-center justify-center text-white focus:outline focus:outline-2"},children:w.jsx("span",{children:"!"})})}),w.jsx(Tn,{name:"verificationCode",className:St(Sr.inputControl,"bg-[var(--jssdk-input-bg-color)]"),inputClassName:"bg-inherit",placeholder:"请输入口令码",value:h,type:"tel",onValueChange:M=>m(M),prefix:w.jsx(Po,{trigger:w.jsx("span",{children:"!"}),classNames:{trigger:"size-5 lg:size-6 lg:text-2xl rounded-full bg-[var(--jssdk-icon-color)] inline-flex items-center justify-center text-white focus:outline focus:outline-2",popup:"w-full lg:w-4/5 lg:max-w-5xl p-0 bg-transparent"},children:w.jsx("div",{className:St(Sr.mailCodeGet,u.mailCodeGetterImageClassName)})}),suffix:w.jsx("button",{type:"button",className:"enabled:text-[var(--jssdk-primary-color)] text-sm rounded-full h-4/6 px-2 enabled:hover:bg-[var(--jssdk-primary-color)] enabled:hover:text-[var(--jssdk-primary-foregroud-color)] inline-flex items-center disabled:cursor-not-allowed disabled:text-gray-500",onMouseDown:M=>{M.preventDefault()},onClick:()=>T(),disabled:y||P||!d,children:y?`${S}s`:P?"发送中...":"发送口令码"})}),o.enabled?w.jsx(Wr,{name:"rememberLogin",children:w.jsxs(gc,{className:"flex items-center gap-2 text-gray-500",onMouseDown:M=>{M.preventDefault()},children:[w.jsx(sc,{checked:g,className:"size-5 flex items-center justify-center rounded-full border-2 data-[checked]:border-[var(--jssdk-primary-color)] data-[unchecked]:border-gray-300",onCheckedChange:M=>v(!!M),children:w.jsx(ic,{children:w.jsx(Pc,{className:"size-3 text-[var(--jssdk-primary-color)]",strokeWidth:4})})}),w.jsxs("div",{children:[w.jsx("span",{className:"mr-0.5",children:o.days}),w.jsx("span",{children:"天内自动登录"})]})]})}):null,["5199","5012"].includes(r)?w.jsx("div",{className:"text-[#f59e9e] text-center text-[11px]",children:"请点击游戏内“邮件”查收口令码,未收到请重启游戏再次查看"}):null,w.jsx(Qs,{})]})}const Ht={quickLogin:"_quickLogin_1ibz1_1",quickAccounts:"_quickAccounts_1ibz1_5",selectedAccount:"_selectedAccount_1ibz1_9",accountInfo:"_accountInfo_1ibz1_21",accountName:"_accountName_1ibz1_26",arrow:"_arrow_1ibz1_31",arrowRotate:"_arrowRotate_1ibz1_37",accountList:"_accountList_1ibz1_41",listScroll:"_listScroll_1ibz1_49",accountItem:"_accountItem_1ibz1_58",active:"_active_1ibz1_77",itemName:"_itemName_1ibz1_81",itemInfo:"_itemInfo_1ibz1_86",deleteBtn:"_deleteBtn_1ibz1_97"};function vP(){const{gameId:e,onLoginSuccess:t,triggerRealNameAuth:n,setCurrentLoginType:r,defaultLoginType:o}=Dn(),[s,i]=oe.useState([]),[a,c]=oe.useState(null),[u,l]=oe.useState(!1),[d,p]=oe.useState(!1),[h,m]=oe.useState(!1),[g,v]=oe.useState(-1);oe.useEffect(()=>{y()},[e]);const y=()=>{const x=$r(e);i(x),x.length>0?(!a||!x.find(T=>T.openid===a.openid))&&c(x[0]):c(null)},C=x=>{c(s[x]),l(!1)},S=(x,T)=>{x.stopPropagation(),v(T),m(!0)},E=()=>{const x=s[g];if(x){sf(x.openid,e);const T=$r(e);if(T.length===0){r(o);return}i(T),T.find(P=>P.openid===a?.openid)||c(T[0])}m(!1),v(-1)},b=async()=>{if(a){p(!0);try{Qd(a.authorization);const x=await Wp(),T={account:x.account,entity:x.channel_info.entity,token:x.channel_info.token,sign:x.channel_info.sign,accid:x.channel_info.entity.openid,extra_data:x.channel_info.extra_data,gaplaySign:x.channel_info.gaplaySign,realname:x.channel_info.realname};if(Ns(T,a.authorization,e),T.realname&&T.realname.reject>=2){n();return}t?.(T)}catch(x){gt.error(x?.detail),console.error("Quick login failed:",x)}finally{p(!1)}}};return s.length===0?null:w.jsxs("div",{className:Ht.quickLogin,children:[w.jsxs("div",{className:Ht.quickAccounts,children:[w.jsxs("div",{className:Ht.selectedAccount,onClick:()=>l(!u),children:[w.jsx("div",{className:Ht.accountInfo,children:w.jsx("span",{className:Ht.accountName,children:a?.username})}),w.jsx(jp,{className:St(Ht.arrow,u&&Ht.arrowRotate)})]}),u&&w.jsx("div",{className:Ht.accountList,children:w.jsx("div",{className:Ht.listScroll,children:s.map((x,T)=>w.jsxs("div",{className:St(Ht.accountItem,x.openid===a?.openid&&Ht.active),onClick:()=>C(T),children:[w.jsx("div",{className:Ht.itemInfo,children:w.jsx("span",{className:Ht.itemName,children:x.username})}),w.jsx("div",{className:Ht.deleteBtn,onClick:P=>S(P,T),children:w.jsx(g1,{className:"size-4 text-gray-400 hover:text-red-500"})})]},x.openid))})})]}),w.jsx(Rt,{className:"w-full h-10 mt-4 mb-6 text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",disabled:d,onClick:b,children:d?"登录中...":"登录"}),w.jsx(Qs,{}),w.jsx(Po,{open:h,onOpenChange:m,showCloseIcon:!1,classNames:{popup:"w-[300px] p-6"},children:w.jsxs("div",{className:"text-center",children:[w.jsxs("div",{className:"mb-4",children:[w.jsx("p",{className:"text-base font-medium text-gray-900",children:"是否确认删除该条账号登录记录?"}),w.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"删除后登录记录将不会保存。"})]}),w.jsxs("div",{className:"flex gap-3 mt-6",children:[w.jsx(Rt,{className:"flex-1 h-9 border border-gray-300 rounded-full text-gray-600",onClick:()=>m(!1),children:"取消"}),w.jsx(Rt,{className:"flex-1 h-9 bg-gradient-to-r from-[#497efe] to-[#947afa] text-white rounded-full",onClick:E,children:"确认删除"})]})]})})]})}const bP=Vh({name:pi().refine(e=>e.length>=1,{error:"请输入真实姓名",abort:!0}).refine(e=>/^[\u4e00-\u9fa5]{2,6}$/.test(e),{error:"姓名须由 2-6 个汉字组成",abort:!0}),idcard:pi().refine(e=>e.length>=1,{error:"请输入身份证号",abort:!0}).refine(e=>/^\d{17}(\d|X|x)$/.test(e),{error:"身份证号格式不正确",abort:!0})});function wP(){const{gameId:e,onLoginSuccess:t,onAccountLoginSuccess:n,onPhoneLoginSuccess:r,showRealNameModal:o,setShowRealNameModal:s,onClose:i}=Dn(),[a,c]=f.useState({}),{mutate:u,isPending:l}=sn({mutationFn:async p=>{const m=$r(e)[0];if(!m)throw new Error("未找到登录账号信息");await C1({uid:m.uid,authorization:m.authorization,name:p.name,idcard:p.idcard});const g=await T1(m.authorization),v={account:g.account,entity:g.channel_info.entity,token:g.channel_info.token,sign:g.channel_info.sign,accid:g.channel_info.entity.openid,extra_data:g.channel_info.extra_data,gaplaySign:g.channel_info.gaplaySign,realname:g.channel_info.realname};gt.success("实名认证成功"),s(!1),v.account?.mobile?r?.(v):n?.(v),t?.(v)},onError:p=>{gt.error(p.message||"实名认证失败")}}),d=p=>{const h=bP.safeParse(p);if(!h.success){c(oi(h.error).fieldErrors);return}c({}),u(h.data)};return w.jsxs(Po,{open:o,onOpenChange:s,title:"实名认证",showCloseIcon:!1,disablePointerDismissal:!0,classNames:{popup:"w-[400px] p-6 rounded-2xl",title:"text-center text-xl mb-3"},children:[w.jsx("div",{className:"text-sm text-gray-500 mb-6 text-center",children:"根据《关于防止未成年人沉迷网络游戏的通知》,游戏用户需使用有效身份证进行实名认证。"}),w.jsxs(To,{onFormSubmit:d,errors:a,className:"space-y-4",children:[w.jsxs(Wr,{name:"name",children:[w.jsx("div",{className:"flex items-center border border-gray-300 rounded-full px-4 h-12 focus-within:border-[#787bf4] transition-colors",children:w.jsx(Gs,{className:"flex-1 outline-none text-base bg-transparent",placeholder:"请输入您的真实姓名"})}),w.jsx(Zs,{className:"mt-1 ml-2 text-xs text-red-500"})]}),w.jsxs(Wr,{name:"idcard",children:[w.jsx("div",{className:"flex items-center border border-gray-300 rounded-full px-4 h-12 focus-within:border-[#787bf4] transition-colors",children:w.jsx(Gs,{className:"flex-1 outline-none text-base bg-transparent",placeholder:"请输入您的身份证号",maxLength:18})}),w.jsx(Zs,{className:"mt-1 ml-2 text-xs text-red-500"})]}),w.jsx(Rt,{type:"submit",className:"w-full h-12 mt-6 text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full font-bold shadow-lg disabled:opacity-50",disabled:l,children:l?"提交中...":"提交认证"}),w.jsx("button",{type:"button",className:"w-full mt-4 text-sm text-gray-400 hover:text-gray-600 transition-colors",onClick:i,children:"退出游戏"})]})]})}const Gh={modal:"_modal_1pbx2_2",close:"_close_1pbx2_8"},mi={autoLoginHint:"_autoLoginHint_h58ls_1",left:"_left_h58ls_22",loading:"_loading_h58ls_28",switchBtn:"_switchBtn_h58ls_37"};function SP({onSwitch:e}){const{autoLoginAccountName:t,setIsAutoLoggingIn:n}=Dn(),r=()=>{n(!1),e()};return w.jsxs("div",{className:mi.autoLoginHint,children:[w.jsxs("div",{className:mi.left,children:[w.jsx("div",{className:mi.loading}),w.jsxs("span",{children:[t," 正在登录..."]})]}),w.jsx("button",{className:mi.switchBtn,onClick:r,children:"切换账号"})]})}function EP({open:e,onOpenChange:t}){const{gameId:n,loginTypes:r,currentLoginType:o,closeable:s,isShowGiantLogo:i,onLoginSuccess:a,triggerRealNameAuth:c,showRealNameModal:u,setIsAutoLoggingIn:l,setAutoLoginAccountName:d}=Dn(),[p,h]=oe.useState(!1),m=oe.useMemo(()=>$r(n),[n,e]),g=e&&m.length>0&&!p;oe.useEffect(()=>{if(!e){h(!1),l(!1);return}if(g){const S=m[0];(async()=>{if(!S){h(!0);return}l(!0),d(S.username);try{Qd(S.authorization);const b=await Wp(),x={account:b.account,entity:b.channel_info.entity,token:b.channel_info.token,sign:b.channel_info.sign,accid:b.channel_info.entity.openid,extra_data:b.channel_info.extra_data,gaplaySign:b.channel_info.gaplaySign,realname:b.channel_info.realname};if(Ns(x,S.authorization,n),x.realname&&x.realname.reject>=2){l(!1),h(!0),c();return}l(!1),h(!0),t?.(!1),a?.(x)}catch(b){console.error("Auto quick login failed:",b),l(!1),h(!0)}})()}},[e,n,g]);const v=tf({loginTypes:r,gameId:n}),y=nf({loginTypes:r,gameId:n}),C=ef({loginTypes:r,gameId:n});return w.jsxs(w.Fragment,{children:[g&&w.jsx(SP,{onSwitch:()=>h(!0)}),w.jsxs(Po,{open:e&&!g&&!u,onOpenChange:t,classNames:{popup:St("w-[400px] p-5",Gh.modal),close:Gh.close},showCloseIcon:s,children:[i&&!iS(n)&&w.jsx("section",{className:"flex items-center justify-center mb-6",children:w.jsx("img",{src:n==="5327"?"https://cdn-imgs.sdk.mobileztgame.com/paycenter/260511150749961295.png":"https://h5.sdk.mobileztgame.com/dist/bg_logo.png",className:"aspect-[240/85] w-32"})}),w.jsxs("section",{children:[o==="quick"&&w.jsx(vP,{}),o===at.MOBILE&&y&&w.jsx(Wh,{}),o===at.ROLE_ID&&v&&w.jsx(Zh,{}),o===at.GIANT&&C&&w.jsx(K1,{})]})]}),w.jsx(wP,{})]})}class xP extends oe.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){console.error("[Login SDK] Uncaught error:",t)}render(){return this.state.hasError?null:this.props.children}}function jc({open:e,onOpenChange:t,sceneId:n,onPhoneLoginSuccess:r,onAccountLoginSuccess:o,onUidLoginSuccess:s,onLoginSuccess:i,onLoginError:a,closeable:c=!0,mountToaster:u=!0,toastConfigs:l,...d}){const[p]=oe.useState(()=>new Tm);return w.jsxs(oe.StrictMode,{children:[w.jsx(_m,{client:p,children:w.jsx(df,{value:{sceneId:n,onPhoneLoginSuccess:r,onAccountLoginSuccess:o,onUidLoginSuccess:s,onLoginSuccess:h=>{mS(pS({gameId:pr(d.gameId),serverUserInfo:h})),i?.(h)},onLoginError:a,closeable:c,onClose:()=>t?.(!1),...d},children:w.jsx(xP,{children:w.jsx(EP,{open:e,onOpenChange:t})})})}),u&&w.jsx(nS,{toastConfigs:l})]})}const Yh=e=>za(pr(e)),Xh=e=>hS(pr(e)),qh=e=>!!za(pr(e));function Kh({loginTypes:e,defaultLoginType:t,gameId:n,onLoginSuccess:r,onLoginError:o}){const s=pr(n);if(document.querySelector(".login-sdk-container"))return console.warn("Login component is already active. Multiple instances are not allowed."),{close:()=>{}};const i=document.createElement("div");i.className="login-sdk-container",document.body.appendChild(i);const a=em.createRoot(i),c=()=>{setTimeout(()=>{a.unmount(),i.remove()},200)},u=()=>{a.render(w.jsx(jc,{gameId:s,loginTypes:e,defaultLoginType:t,open:!1,onOpenChange:l,onLoginSuccess:r,onLoginError:o})),c()},l=d=>{d||u()};return a.render(w.jsx(jc,{gameId:s,loginTypes:e,defaultLoginType:t,open:!0,onOpenChange:l,onLoginSuccess:r,onLoginError:o})),{close:u}}const CP={init:cf,login:Kh,logout:Xh,getUserInfo:Yh,isLoggedIn:qh};yt.ConfigProvider=df,yt.Login=jc,yt.MobileLogin=Wh,yt.SDK=CP,yt.UidLogin=Zh,yt.getGameId=pr,yt.getUserInfo=Yh,yt.init=cf,yt.isLoggedIn=qh,yt.login=Kh,yt.logout=Xh,Object.defineProperty(yt,Symbol.toStringTag,{value:"Module"})}));
|
|
73
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){s(i);continue}if(e.external){const l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused==="ref"){s(i);continue}}}function Vp(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const c=e.seen.get(a);if(c.ref===null)return;const l=c.def??c.schema,u={...l},f=c.ref;if(c.ref=null,f){r(f);const h=e.seen.get(f),m=h.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,u),a._zod.parent===f)for(const v in l)v==="$ref"||v==="allOf"||v in u||delete l[v];if(m.$ref&&h.def)for(const v in l)v==="$ref"||v==="allOf"||v in h.def&&JSON.stringify(l[v])===JSON.stringify(h.def[v])&&delete l[v]}const d=a._zod.parent;if(d&&d!==f){r(d);const h=e.seen.get(d);if(h?.schema.$ref&&(l.$ref=h.schema.$ref,h.def))for(const m in l)m==="$ref"||m==="allOf"||m in h.def&&JSON.stringify(l[m])===JSON.stringify(h.def[m])&&delete l[m]}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&o.id===s&&delete o.id;const i=e.external?.defs??{};for(const a of e.seen.entries()){const c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Js(t,"input",e.processors),output:Js(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function $t(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return $t(r.element,n);if(r.type==="set")return $t(r.valueType,n);if(r.type==="lazy")return $t(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return $t(r.innerType,n);if(r.type==="intersection")return $t(r.left,n)||$t(r.right,n);if(r.type==="record"||r.type==="map")return $t(r.keyType,n)||$t(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:$t(r.in,n)||$t(r.out,n);if(r.type==="object"){for(const o in r.shape)if($t(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if($t(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if($t(o,n))return!0;return!!(r.rest&&$t(r.rest,n))}return!1}const vP=(e,t={})=>n=>{const r=zp({...n,processors:t});return Ot(e,r),$p(r,e),Vp(r,e)},Js=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=zp({...o??{},target:s,io:t,processors:n});return Ot(e,i),$p(i,e),Vp(i,e)},bP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},wP=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=bP[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),l&&(o.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},SP=(e,t,n,r)=>{n.not={}},xP=(e,t,n,r)=>{},EP=(e,t,n,r)=>{const o=e._zod.def,s=lp(o.entries);s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},CP=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},PP=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},TP=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Ot(s.element,t,{...r,path:[...r.path,"items"]})},kP=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const l in i)o.properties[l]=Ot(i[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(l=>{const u=s.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Ot(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},IP=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>Ot(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},OP=(e,t,n,r)=>{const o=e._zod.def,s=Ot(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=Ot(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},_P=(e,t,n,r)=>{const o=e._zod.def,s=Ot(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},RP=(e,t,n,r)=>{const o=e._zod.def;Ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},MP=(e,t,n,r)=>{const o=e._zod.def;Ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},AP=(e,t,n,r)=>{const o=e._zod.def;Ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},DP=(e,t,n,r)=>{const o=e._zod.def;Ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},NP=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;Ot(i,t,r);const a=t.seen.get(e);a.ref=i},FP=(e,t,n,r)=>{const o=e._zod.def;Ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},jp=(e,t,n,r)=>{const o=e._zod.def;Ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},LP=ee("ZodISODateTime",(e,t)=>{XE.init(e,t),ht.init(e,t)});function zP(e){return KC(LP,e)}const $P=ee("ZodISODate",(e,t)=>{qE.init(e,t),ht.init(e,t)});function VP(e){return JC($P,e)}const jP=ee("ZodISOTime",(e,t)=>{KE.init(e,t),ht.init(e,t)});function HP(e){return QC(jP,e)}const ZP=ee("ZodISODuration",(e,t)=>{JE.init(e,t),ht.init(e,t)});function WP(e){return eP(ZP,e)}const nn=ee("ZodError",(e,t)=>{gp.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Ux(e,n)},flatten:{value:n=>Oo(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ka,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ka,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),UP=nc(nn),BP=rc(nn),GP=Bs(nn),YP=Gs(nn),XP=Yx(nn),qP=Xx(nn),KP=qx(nn),JP=Kx(nn),QP=Jx(nn),eT=Qx(nn),tT=eE(nn),nT=tE(nn),Hp=new WeakMap;function Qs(e,t,n){const r=Object.getPrototypeOf(e);let o=Hp.get(r);if(o||(o=new Set,Hp.set(r,o)),!o.has(t)){o.add(t);for(const s in n){const i=n[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){const a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const xt=ee("ZodType",(e,t)=>(St.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Js(e,"input"),output:Js(e,"output")}}),e.toJSONSchema=vP(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>UP(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>GP(e,n,r),e.parseAsync=async(n,r)=>BP(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>YP(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>XP(e,n,r),e.decode=(n,r)=>qP(e,n,r),e.encodeAsync=async(n,r)=>KP(e,n,r),e.decodeAsync=async(n,r)=>JP(e,n,r),e.safeEncode=(n,r)=>QP(e,n,r),e.safeDecode=(n,r)=>eT(e,n,r),e.safeEncodeAsync=async(n,r)=>tT(e,n,r),e.safeDecodeAsync=async(n,r)=>nT(e,n,r),Qs(e,"ZodType",{check(...n){const r=this.def;return this.clone(Jn(r,{checks:[...r.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Qn(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(YT(n,r))},superRefine(n,r){return this.check(XT(n,r))},overwrite(n){return this.check(Gr(n))},optional(){return Gp(this)},exactOptional(){return NT(this)},nullable(){return Yp(this)},nullish(){return Gp(Yp(this))},nonoptional(n){return jT(this,n)},array(){return PT(this)},or(n){return IT([this,n])},and(n){return _T(this,n)},transform(n){return qp(this,AT(n))},default(n){return zT(this,n)},prefault(n){return VT(this,n)},catch(n){return ZT(this,n)},pipe(n){return qp(this,n)},readonly(){return BT(this)},describe(n){const r=this.clone();return _o.add(r,{description:n}),r},meta(...n){if(n.length===0)return _o.get(this);const r=this.clone();return _o.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return _o.get(e)?.description},configurable:!0}),e)),Zp=ee("_ZodString",(e,t)=>{oc.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>wP(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Qs(e,"_ZodString",{regex(...r){return this.check(rP(...r))},includes(...r){return this.check(iP(...r))},startsWith(...r){return this.check(aP(...r))},endsWith(...r){return this.check(cP(...r))},min(...r){return this.check(Ks(...r))},max(...r){return this.check(Fp(...r))},length(...r){return this.check(Lp(...r))},nonempty(...r){return this.check(Ks(1,...r))},lowercase(r){return this.check(oP(r))},uppercase(r){return this.check(sP(r))},trim(){return this.check(uP())},normalize(...r){return this.check(lP(...r))},toLowerCase(){return this.check(fP())},toUpperCase(){return this.check(dP())},slugify(){return this.check(pP())}})}),rT=ee("ZodString",(e,t)=>{oc.init(e,t),Zp.init(e,t),e.email=n=>e.check(_C(oT,n)),e.url=n=>e.check(NC(sT,n)),e.jwt=n=>e.check(qC(wT,n)),e.emoji=n=>e.check(FC(iT,n)),e.guid=n=>e.check(Np(Wp,n)),e.uuid=n=>e.check(RC(ei,n)),e.uuidv4=n=>e.check(MC(ei,n)),e.uuidv6=n=>e.check(AC(ei,n)),e.uuidv7=n=>e.check(DC(ei,n)),e.nanoid=n=>e.check(LC(aT,n)),e.guid=n=>e.check(Np(Wp,n)),e.cuid=n=>e.check(zC(cT,n)),e.cuid2=n=>e.check($C(lT,n)),e.ulid=n=>e.check(VC(uT,n)),e.base64=n=>e.check(GC(yT,n)),e.base64url=n=>e.check(YC(vT,n)),e.xid=n=>e.check(jC(fT,n)),e.ksuid=n=>e.check(HC(dT,n)),e.ipv4=n=>e.check(ZC(pT,n)),e.ipv6=n=>e.check(WC(hT,n)),e.cidrv4=n=>e.check(UC(mT,n)),e.cidrv6=n=>e.check(BC(gT,n)),e.e164=n=>e.check(XC(bT,n)),e.datetime=n=>e.check(zP(n)),e.date=n=>e.check(VP(n)),e.time=n=>e.check(HP(n)),e.duration=n=>e.check(WP(n))});function Yr(e){return OC(rT,e)}const ht=ee("ZodStringFormat",(e,t)=>{pt.init(e,t),Zp.init(e,t)}),oT=ee("ZodEmail",(e,t)=>{VE.init(e,t),ht.init(e,t)}),Wp=ee("ZodGUID",(e,t)=>{zE.init(e,t),ht.init(e,t)}),ei=ee("ZodUUID",(e,t)=>{$E.init(e,t),ht.init(e,t)}),sT=ee("ZodURL",(e,t)=>{jE.init(e,t),ht.init(e,t)}),iT=ee("ZodEmoji",(e,t)=>{HE.init(e,t),ht.init(e,t)}),aT=ee("ZodNanoID",(e,t)=>{ZE.init(e,t),ht.init(e,t)}),cT=ee("ZodCUID",(e,t)=>{WE.init(e,t),ht.init(e,t)}),lT=ee("ZodCUID2",(e,t)=>{UE.init(e,t),ht.init(e,t)}),uT=ee("ZodULID",(e,t)=>{BE.init(e,t),ht.init(e,t)}),fT=ee("ZodXID",(e,t)=>{GE.init(e,t),ht.init(e,t)}),dT=ee("ZodKSUID",(e,t)=>{YE.init(e,t),ht.init(e,t)}),pT=ee("ZodIPv4",(e,t)=>{QE.init(e,t),ht.init(e,t)}),hT=ee("ZodIPv6",(e,t)=>{eC.init(e,t),ht.init(e,t)}),mT=ee("ZodCIDRv4",(e,t)=>{tC.init(e,t),ht.init(e,t)}),gT=ee("ZodCIDRv6",(e,t)=>{nC.init(e,t),ht.init(e,t)}),yT=ee("ZodBase64",(e,t)=>{rC.init(e,t),ht.init(e,t)}),vT=ee("ZodBase64URL",(e,t)=>{sC.init(e,t),ht.init(e,t)}),bT=ee("ZodE164",(e,t)=>{iC.init(e,t),ht.init(e,t)}),wT=ee("ZodJWT",(e,t)=>{cC.init(e,t),ht.init(e,t)}),ST=ee("ZodUnknown",(e,t)=>{lC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xP()});function Up(){return tP(ST)}const xT=ee("ZodNever",(e,t)=>{uC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>SP(e,n,r)});function ET(e){return nP(xT,e)}const CT=ee("ZodArray",(e,t)=>{fC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>TP(e,n,r,o),e.element=t.element,Qs(e,"ZodArray",{min(n,r){return this.check(Ks(n,r))},nonempty(n){return this.check(Ks(1,n))},max(n,r){return this.check(Fp(n,r))},length(n,r){return this.check(Lp(n,r))},unwrap(){return this.element}})});function PT(e,t){return hP(CT,e,t)}const TT=ee("ZodObject",(e,t)=>{pC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kP(e,n,r,o),ot(e,"shape",()=>t.shape),Qs(e,"ZodObject",{keyof(){return RT(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Up()})},loose(){return this.clone({...this._zod.def,catchall:Up()})},strict(){return this.clone({...this._zod.def,catchall:ET()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return $x(this,n)},safeExtend(n){return Vx(this,n)},merge(n){return jx(this,n)},pick(n){return Lx(this,n)},omit(n){return zx(this,n)},partial(...n){return Hx(Bp,this,n[0])},required(...n){return Zx(Xp,this,n[0])}})});function ic(e,t){const n={type:"object",shape:e??{},..._e(t)};return new TT(n)}const kT=ee("ZodUnion",(e,t)=>{hC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>IP(e,n,r,o),e.options=t.options});function IT(e,t){return new kT({type:"union",options:e,..._e(t)})}const OT=ee("ZodIntersection",(e,t)=>{mC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>OP(e,n,r,o)});function _T(e,t){return new OT({type:"intersection",left:e,right:t})}const ac=ee("ZodEnum",(e,t)=>{gC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>EP(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new ac({...t,checks:[],..._e(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new ac({...t,checks:[],..._e(o),entries:s})}});function RT(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ac({type:"enum",entries:n,..._e(t)})}const MT=ee("ZodTransform",(e,t)=>{yC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>PP(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new cp(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Io(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Io(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});function AT(e){return new MT({type:"transform",transform:e})}const Bp=ee("ZodOptional",(e,t)=>{Op.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Gp(e){return new Bp({type:"optional",innerType:e})}const DT=ee("ZodExactOptional",(e,t)=>{vC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function NT(e){return new DT({type:"optional",innerType:e})}const FT=ee("ZodNullable",(e,t)=>{bC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_P(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Yp(e){return new FT({type:"nullable",innerType:e})}const LT=ee("ZodDefault",(e,t)=>{wC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>MP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zT(e,t){return new LT({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():pp(t)}})}const $T=ee("ZodPrefault",(e,t)=>{SC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>AP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function VT(e,t){return new $T({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():pp(t)}})}const Xp=ee("ZodNonOptional",(e,t)=>{xC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>RP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function jT(e,t){return new Xp({type:"nonoptional",innerType:e,..._e(t)})}const HT=ee("ZodCatch",(e,t)=>{EC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>DP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ZT(e,t){return new HT({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const WT=ee("ZodPipe",(e,t)=>{CC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>NP(e,n,r,o),e.in=t.in,e.out=t.out});function qp(e,t){return new WT({type:"pipe",in:e,out:t})}const UT=ee("ZodReadonly",(e,t)=>{PC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>FP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function BT(e){return new UT({type:"readonly",innerType:e})}const GT=ee("ZodCustom",(e,t)=>{TC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>CP(e,n)});function YT(e,t={}){return mP(GT,e,t)}function XT(e,t){return gP(e,t)}const qT=ic({account:Yr().min(1,"请输入账号"),password:Yr().min(1,"请输入密码")});function KT(){const{gameId:e,onAccountLoginSuccess:t,onLoginSuccess:n,onLoginError:r,triggerRealNameAuth:o,defaultAgreeProtocol:s=!1}=Nn(),i=re.useRef(null),[a,c]=re.useState(""),[l,u]=re.useState(""),[f,d]=re.useState(!1),[h,m]=re.useState(s),[y,v]=re.useState(!1),[g,E]=re.useState(!1),[C,S]=re.useState({}),{mutate:b,isPending:x}=sn({mutationFn:()=>rx({account:a,password:l}),onSuccess:I=>{const z={account:I.account,entity:I.channel_info.entity,token:I.channel_info.token,sign:I.channel_info.sign,accid:I.channel_info.entity.openid,extra_data:I.channel_info.extra_data,gaplaySign:I.channel_info.gaplaySign,realname:I.channel_info.realname};if(Ts(z,I._auth,e),z.realname&&z.realname.reject>=2){o();return}t?.(z),n?.(z)},onError:I=>{r?.(I)}});async function T(I){I.preventDefault();const z=new FormData(I.currentTarget),A=qT.safeParse(Object.fromEntries(z));return A.success?h?(b(),{errors:{}}):(E(!0),{errors:{}}):{errors:Oo(A.error).fieldErrors}}return w.jsxs(w.Fragment,{children:[w.jsxs(Ns,{ref:i,errors:C,onSubmit:async I=>{const z=await T(I);S(z?.errors||{})},className:"space-y-5",children:[w.jsx(Cn,{name:"account",placeholder:e==="5327"?"请输入账号":"请输入巨人通行证账号",autoFocus:!0,onChange:I=>c(I.currentTarget.value),prefix:e==="5327"?w.jsx(Q1,{className:"size-5 text-gray-400"}):w.jsx(px,{className:"size-5 text-gray-400"})}),w.jsx(Cn,{name:"password",type:f?"text":"password",autoComplete:"off",placeholder:"请输入密码",value:l,onValueChange:I=>u(I),prefix:w.jsx(hx,{className:"size-5 text-gray-400"}),suffix:w.jsx("button",{onClick:()=>d(!f),type:"button",className:"text-gray-400 hover:text-gray-600 focus:outline-none",children:f?w.jsx(Kd,{className:"size-5"}):w.jsx(qd,{className:"size-5"})})}),w.jsxs("section",{children:[w.jsx("div",{className:"flex justify-end mb-1",children:w.jsx(Wr,{title:"忘记密码",open:y,onOpenChange:v,trigger:w.jsx("button",{type:"button",className:"text-[var(--jssdk-primary-color)] text-sm",children:"忘记密码"}),children:w.jsx(Mx,{onClose:()=>v(!1),defaultAccount:a})})}),w.jsx(To,{className:"w-full",type:"primary",htmlType:"submit",disabled:x,children:"登录"})]}),w.jsx(js,{}),w.jsx(Ya,{checked:h,onChange:m})]}),w.jsx(op,{open:g,onOpenChange:E,onAgree:()=>{m(!0),b()}})]})}const br={trigger:"_trigger_1e3h3_1",popup:"_popup_1e3h3_5",item:"_item_1e3h3_24",indicator:"_indicator_1e3h3_40",itemText:"_itemText_1e3h3_44",itemCode:"_itemCode_1e3h3_48",itemLabel:"_itemLabel_1e3h3_52"};function JT({value:e,onValueChange:t}){const{gameId:n}=Nn(),r=gw(),o=p.useMemo(()=>r.find(i=>i.id===e||i.value===e)?.id||e,[r,e]);return w.jsxs(O1,{value:o,onValueChange:s=>{const i=r.find(a=>a.id===s);i&&t?.(i.value)},children:[w.jsxs(M1,{className:br.trigger,children:[w.jsx("span",{children:r.find(s=>s.id===o)?.value}),w.jsx(Xd,{className:"size-4"})]}),w.jsx(D1,{children:w.jsx(z1,{className:"outline-none z-[999]",sideOffset:-4,align:"start",children:w.jsx(V1,{className:br.popup,children:r.map(({label:s,value:i,id:a})=>w.jsxs(H1,{value:a,className:br.item,children:[w.jsx(Z1,{className:br.indicator,children:w.jsx(Ba,{className:"size-3"})}),w.jsxs(U1,{className:br.itemText,children:[w.jsx("span",{className:br.itemCode,children:i}),w.jsx("span",{className:br.itemLabel,children:s})]})]},a))})})})]})}const Kp=ic({phoneNumber:Yr().regex(/^[1-9]\d{10}$/,"请输入正确的手机号"),verificationCode:Yr().length(4,"请输入 6 位验证码")});function Jp(){const{mobileLoginConfig:e={},gameId:t,onPhoneLoginSuccess:n,onLoginSuccess:r,onLoginError:o,triggerRealNameAuth:s,defaultAgreeProtocol:i=!1}=Nn(),[a,c]=re.useState("86"),[l,u]=re.useState(""),f=re.useRef(null),[d,h]=re.useState(""),[m,y]=re.useState(),[v,g]=re.useState(i),[E,C]=re.useState({}),[S,b]=re.useState(!1),[x,T]=re.useState(!1),[I,z]=re.useState("login"),[A]=ip({leftTime:m?m*1e3:void 0,interval:1e3,onEnd(){y(void 0)}}),{mutate:F,isPending:V}=sn({mutationFn:()=>ox({mobile:l,countryCode:a,type:e.smsType}),onSuccess:P=>{b(!0),y(P.lock_time),Ct.success("验证码已发送,请注意查收")}}),{mutate:$,isPending:M}=sn({mutationFn:async()=>{const P=await sx({mobile:l,countryCode:a,captcha:d});y(void 0);const R={account:P.account,entity:P.channel_info.entity,token:P.channel_info.token,sign:P.channel_info.sign,accid:P.channel_info.entity.openid,extra_data:P.channel_info.extra_data,gaplaySign:P.channel_info.gaplaySign,realname:P.channel_info.realname};if(Ts(R,P._auth,t),R.realname&&R.realname.reject>=2){s();return}return n&&await n(R),r?.(R),P},onError:P=>{o?.(P)}});function k(){const P=new FormData(f.current),R=Kp.pick({phoneNumber:!0}).safeParse(Object.fromEntries(P));if(!R.success){C(Oo(R.error).fieldErrors);return}if(!v){z("sendCode"),T(!0);return}F()}async function O(P){P.preventDefault();const R=new FormData(P.currentTarget),D=Kp.safeParse(Object.fromEntries(R));return D.success?v?($(),{errors:{}}):(z("login"),T(!0),{errors:{}}):{errors:Oo(D.error).fieldErrors}}return w.jsxs(w.Fragment,{children:[w.jsxs(Ns,{ref:f,errors:E,onSubmit:async P=>{const R=await O(P);C(R.errors)},className:"space-y-5",children:[w.jsx(Cn,{name:"phoneNumber",placeholder:"请输入手机号码",autoFocus:!0,type:"tel",onChange:P=>u(P.currentTarget.value),prefix:w.jsx(JT,{value:a,onValueChange:c})}),w.jsx(Cn,{name:"verificationCode",placeholder:"请输入验证码",value:d,type:"number",onValueChange:P=>{const R=P;h(R),R.length===4&&S&&setTimeout(()=>{f.current?.requestSubmit()},0)},suffix:w.jsx("button",{type:"button",className:"enabled:text-[var(--jssdk-primary-color)] text-sm rounded-full h-4/6 px-2 enabled:hover:bg-[var(--jssdk-primary-color)] enabled:hover:text-white inline-flex items-center disabled:cursor-not-allowed disabled:text-gray-500",onClick:()=>k(),disabled:!!m||V,children:V?"发送中...":m?`${Math.round(A/1e3)}s 后重新获取`:"获取验证码"})}),w.jsx(To,{className:gt("my-5 w-full",e.buttonClassName),disabled:M,type:"primary",htmlType:"submit",children:M?"登录中...":e.buttonText||"登录"}),w.jsx(js,{}),w.jsx(Ya,{checked:v,onChange:g})]}),w.jsx(op,{open:x,onOpenChange:T,onAgree:()=>{g(!0),I==="sendCode"?F():$()}})]})}function QT(e){return w.jsxs("svg",{width:"20",height:"10",viewBox:"0 0 20 10",fill:"none",...e,children:[w.jsx("path",{d:"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",className:"fill-current"}),w.jsx("path",{d:"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z",className:"fill-current"})]})}function e2({children:e,title:t,description:n,content:r,classNames:o={}}){return w.jsxs(d1,{children:[w.jsx(h1,{className:o.trigger,delay:0,children:e}),w.jsxs(g1,{children:[w.jsx(P1,{className:gt("fixed inset-0 bg-black/20 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",o.backdrop)}),w.jsx(y1,{sideOffset:8,className:o.positioner,children:w.jsxs(x1,{className:gt("origin-[var(--transform-origin)] bg-white p-1 rounded shadow-sm text-gray-900 transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 dark:shadow-none dark:-outline-offset-1 dark:outline-gray-300",o.popup),children:[w.jsx(E1,{className:gt("data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",o.arrow),children:w.jsx(QT,{})}),t&&w.jsx(T1,{className:"text-base font-medium",children:t}),n&&w.jsx(k1,{className:"text-base text-gray-600",children:n}),r]})})]})]})}const wr={uidGet:"_uidGet_os9yc_1",mailCodeGet:"_mailCodeGet_os9yc_5",uidGetPopup:"_uidGetPopup_os9yc_79",uidGetArrow:"_uidGetArrow_os9yc_83",inputControl:"_inputControl_os9yc_86",form:"_form_os9yc_89"};function Qp({onUidLoginSuccess:e,customSendUidMailCaptcha:t,customValidateUidMailCaptcha:n}={}){const{gameId:r,autoLoginConfig:o,sceneId:s,onUidLoginSuccess:i,onLoginSuccess:a,onLoginError:c,uidLoginConfig:l={}}=Nn(),u=re.useRef(null),[f,d]=re.useState(""),[h,m]=re.useState(""),[y,v]=re.useState(!0),[g,E]=re.useState(!1),[C,{startCountdown:S,resetCountdown:b}]=bx({countStart:120,intervalMs:1e3}),{mutate:x}=sn({mutationFn:()=>{const A=o.enabled?o.days:void 0;return n?n({gameId:r,captcha:h,expireInDays:y?A:void 0,accountId:f,sceneId:s}):nx({game_id:r,charid:f,captcha_type:"login",captcha:h,expires_day:y?A:void 0,scene_id:s,...l.uidMailExtraParams})},onSuccess:A=>{i?.(A),e?.(A),a?.(A)},onError:A=>{c?.(A)}}),{mutate:T,isPending:I}=sn({mutationFn:()=>t?t({gameId:r,accountId:f}):tx({game_id:r,captcha_type:"login",charid:f,scene_id:s,...l.uidMailExtraParams}),onSuccess:A=>{S(),Ct.success(A.error)}});async function z(A){A.preventDefault(),x()}return re.useEffect(()=>{h.length===6&&f&&setTimeout(()=>{u.current?.requestSubmit()},0)},[h,f]),re.useEffect(()=>{C===0&&b(),E(C!==120)},[C,b]),w.jsxs(Ns,{ref:u,onSubmit:z,className:gt("space-y-6",wr.form),autoComplete:"off",children:[["5199","5012"].includes(r)?w.jsx("p",{className:"text-center text-xs text-white/80",children:"请点击游戏右上角“设置”查看账号ID"}):null,w.jsx(Cn,{name:"accountId",className:gt(wr.inputControl,"bg-[var(--jssdk-input-bg-color)]"),inputClassName:"bg-inherit",placeholder:"请输入账号 ID",autoFocus:!0,type:"tel",onChange:A=>d(A.currentTarget.value),prefix:w.jsx(e2,{content:w.jsx("div",{className:gt(wr.uidGet,l.uidGetterImageClassName)}),classNames:{backdrop:"z-[992]",positioner:"z-[992]",popup:gt("rounded-2xl shadow-lg",wr.uidGetPopup),arrow:wr.uidGetArrow,trigger:"size-5 lg:size-6 lg:text-2xl rounded-full bg-[var(--jssdk-icon-color)] inline-flex items-center justify-center text-white focus:outline focus:outline-2"},children:w.jsx("span",{children:"!"})})}),w.jsx(Cn,{name:"verificationCode",className:gt(wr.inputControl,"bg-[var(--jssdk-input-bg-color)]"),inputClassName:"bg-inherit",placeholder:"请输入口令码",value:h,type:"tel",onValueChange:A=>m(A),prefix:w.jsx(Wr,{trigger:w.jsx("span",{children:"!"}),classNames:{trigger:"size-5 lg:size-6 lg:text-2xl rounded-full bg-[var(--jssdk-icon-color)] inline-flex items-center justify-center text-white focus:outline focus:outline-2",popup:"w-full lg:w-4/5 lg:max-w-5xl p-0 bg-transparent"},children:w.jsx("div",{className:gt(wr.mailCodeGet,l.mailCodeGetterImageClassName)})}),suffix:w.jsx("button",{type:"button",className:"enabled:text-[var(--jssdk-primary-color)] text-sm rounded-full h-4/6 px-2 enabled:hover:bg-[var(--jssdk-primary-color)] enabled:hover:text-[var(--jssdk-primary-foregroud-color)] inline-flex items-center disabled:cursor-not-allowed disabled:text-gray-500",onMouseDown:A=>{A.preventDefault()},onClick:()=>T(),disabled:g||I||!f,children:g?`${C}s`:I?"发送中...":"发送口令码"})}),o.enabled?w.jsx(Co,{name:"rememberLogin",children:w.jsxs(_d,{className:"flex items-center gap-2 text-gray-500",onMouseDown:A=>{A.preventDefault()},children:[w.jsx(td,{checked:y,className:"size-5 flex items-center justify-center rounded-full border-2 data-[checked]:border-[var(--jssdk-primary-color)] data-[unchecked]:border-gray-300",onCheckedChange:A=>v(!!A),children:w.jsx(nd,{children:w.jsx(Ba,{className:"size-3 text-[var(--jssdk-primary-color)]",strokeWidth:4})})}),w.jsxs("div",{children:[w.jsx("span",{className:"mr-0.5",children:o.days}),w.jsx("span",{children:"天内自动登录"})]})]})}):null,["5199","5012"].includes(r)?w.jsx("div",{className:"text-[#f59e9e] text-center text-[11px]",children:"请点击游戏内“邮件”查收口令码,未收到请重启游戏再次查看"}):null,w.jsx(js,{})]})}const Ht={quickLogin:"_quickLogin_1ibz1_1",quickAccounts:"_quickAccounts_1ibz1_5",selectedAccount:"_selectedAccount_1ibz1_9",accountInfo:"_accountInfo_1ibz1_21",accountName:"_accountName_1ibz1_26",arrow:"_arrow_1ibz1_31",arrowRotate:"_arrowRotate_1ibz1_37",accountList:"_accountList_1ibz1_41",listScroll:"_listScroll_1ibz1_49",accountItem:"_accountItem_1ibz1_58",active:"_active_1ibz1_77",itemName:"_itemName_1ibz1_81",itemInfo:"_itemInfo_1ibz1_86",deleteBtn:"_deleteBtn_1ibz1_97"};function t2(){const{gameId:e,onLoginSuccess:t,triggerRealNameAuth:n,setCurrentLoginType:r,defaultLoginType:o}=Nn(),[s,i]=re.useState([]),[a,c]=re.useState(null),[l,u]=re.useState(!1),[f,d]=re.useState(!1),[h,m]=re.useState(!1),[y,v]=re.useState(-1);re.useEffect(()=>{g()},[e]);const g=()=>{const x=zr(e);i(x),x.length>0?(!a||!x.find(T=>T.openid===a.openid))&&c(x[0]):c(null)},E=x=>{c(s[x]),u(!1)},C=(x,T)=>{x.stopPropagation(),v(T),m(!0)},S=()=>{const x=s[y];if(x){xf(x.openid,e);const T=zr(e);if(T.length===0){r(o);return}i(T),T.find(I=>I.openid===a?.openid)||c(T[0])}m(!1),v(-1)},b=async()=>{if(a){d(!0);try{gf(a.authorization);const x=await Qd(),T={account:x.account,entity:x.channel_info.entity,token:x.channel_info.token,sign:x.channel_info.sign,accid:x.channel_info.entity.openid,extra_data:x.channel_info.extra_data,gaplaySign:x.channel_info.gaplaySign,realname:x.channel_info.realname};if(Ts(T,a.authorization,e),T.realname&&T.realname.reject>=2){n();return}t?.(T)}catch(x){Ct.error(x?.detail),console.error("Quick login failed:",x)}finally{d(!1)}}};return s.length===0?null:w.jsxs("div",{className:Ht.quickLogin,children:[w.jsxs("div",{className:Ht.quickAccounts,children:[w.jsxs("div",{className:Ht.selectedAccount,onClick:()=>u(!l),children:[w.jsx("div",{className:Ht.accountInfo,children:w.jsx("span",{className:Ht.accountName,children:a?.username})}),w.jsx(Xd,{className:gt(Ht.arrow,l&&Ht.arrowRotate)})]}),l&&w.jsx("div",{className:Ht.accountList,children:w.jsx("div",{className:Ht.listScroll,children:s.map((x,T)=>w.jsxs("div",{className:gt(Ht.accountItem,x.openid===a?.openid&&Ht.active),onClick:()=>E(T),children:[w.jsx("div",{className:Ht.itemInfo,children:w.jsx("span",{className:Ht.itemName,children:x.username})}),w.jsx("div",{className:Ht.deleteBtn,onClick:I=>C(I,T),children:w.jsx(J1,{className:"size-4 text-gray-400 hover:text-red-500"})})]},x.openid))})})]}),w.jsx(zt,{className:"w-full h-10 mt-4 mb-6 text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",disabled:f,onClick:b,children:f?"登录中...":"登录"}),w.jsx(js,{}),w.jsx(Wr,{open:h,onOpenChange:m,showCloseIcon:!1,classNames:{popup:"w-[300px] p-6"},children:w.jsxs("div",{className:"text-center",children:[w.jsxs("div",{className:"mb-4",children:[w.jsx("p",{className:"text-base font-medium text-gray-900",children:"是否确认删除该条账号登录记录?"}),w.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"删除后登录记录将不会保存。"})]}),w.jsxs("div",{className:"flex gap-3 mt-6",children:[w.jsx(zt,{className:"flex-1 h-9 border border-gray-300 rounded-full text-gray-600",onClick:()=>m(!1),children:"取消"}),w.jsx(zt,{className:"flex-1 h-9 bg-gradient-to-r from-[#497efe] to-[#947afa] text-white rounded-full",onClick:S,children:"确认删除"})]})]})})]})}const n2=ic({name:Yr().refine(e=>e.length>=1,{error:"请输入真实姓名",abort:!0}).refine(e=>/^[\u4e00-\u9fa5]{2,6}$/.test(e),{error:"姓名须由 2-6 个汉字组成",abort:!0}),idcard:Yr().refine(e=>e.length>=1,{error:"请输入身份证号",abort:!0}).refine(e=>/^\d{17}(\d|X|x)$/.test(e),{error:"身份证号格式不正确",abort:!0})});function r2(){const{gameId:e,onLoginSuccess:t,onAccountLoginSuccess:n,onPhoneLoginSuccess:r,showRealNameModal:o,setShowRealNameModal:s,onClose:i}=Nn(),[a,c]=p.useState({}),{mutate:l,isPending:u}=sn({mutationFn:async d=>{const m=zr(e)[0];if(!m)throw new Error("未找到登录账号信息");await ix({uid:m.uid,authorization:m.authorization,name:d.name,idcard:d.idcard});const y=await ax(m.authorization),v={account:y.account,entity:y.channel_info.entity,token:y.channel_info.token,sign:y.channel_info.sign,accid:y.channel_info.entity.openid,extra_data:y.channel_info.extra_data,gaplaySign:y.channel_info.gaplaySign,realname:y.channel_info.realname};Ct.success("实名认证成功"),s(!1),v.account?.mobile?r?.(v):n?.(v),t?.(v)},onError:d=>{Ct.error(d.message||"实名认证失败")}}),f=d=>{const h=n2.safeParse(d);if(!h.success){c(Oo(h.error).fieldErrors);return}c({}),l(h.data)};return w.jsxs(Wr,{open:o,onOpenChange:s,title:"实名认证",showCloseIcon:!1,disablePointerDismissal:!0,classNames:{popup:"w-[400px] p-6 rounded-2xl",title:"text-center text-xl mb-3"},children:[w.jsx("div",{className:"text-sm text-gray-500 mb-6 text-center",children:"根据《关于防止未成年人沉迷网络游戏的通知》,游戏用户需使用有效身份证进行实名认证。"}),w.jsxs(Ns,{onFormSubmit:f,errors:a,className:"space-y-4",children:[w.jsxs(Co,{name:"name",children:[w.jsx("div",{className:"flex items-center border border-gray-300 rounded-full px-4 h-12 focus-within:border-[#787bf4] transition-colors",children:w.jsx(Za,{className:"flex-1 outline-none text-base bg-transparent",placeholder:"请输入您的真实姓名"})}),w.jsx(Ha,{className:"mt-1 ml-2 text-xs text-red-500"})]}),w.jsxs(Co,{name:"idcard",children:[w.jsx("div",{className:"flex items-center border border-gray-300 rounded-full px-4 h-12 focus-within:border-[#787bf4] transition-colors",children:w.jsx(Za,{className:"flex-1 outline-none text-base bg-transparent",placeholder:"请输入您的身份证号",maxLength:18})}),w.jsx(Ha,{className:"mt-1 ml-2 text-xs text-red-500"})]}),w.jsx(zt,{type:"submit",className:"w-full h-12 mt-6 text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full font-bold shadow-lg disabled:opacity-50",disabled:u,children:u?"提交中...":"提交认证"}),w.jsx("button",{type:"button",className:"w-full mt-4 text-sm text-gray-400 hover:text-gray-600 transition-colors",onClick:i,children:"退出游戏"})]})]})}const eh={modal:"_modal_1pbx2_2",close:"_close_1pbx2_8"},ti={autoLoginHint:"_autoLoginHint_h58ls_1",left:"_left_h58ls_22",loading:"_loading_h58ls_28",switchBtn:"_switchBtn_h58ls_37"};function o2({onSwitch:e}){const{autoLoginAccountName:t,setIsAutoLoggingIn:n}=Nn(),r=()=>{n(!1),e()};return w.jsxs("div",{className:ti.autoLoginHint,children:[w.jsxs("div",{className:ti.left,children:[w.jsx("div",{className:ti.loading}),w.jsxs("span",{children:[t," 正在登录..."]})]}),w.jsx("button",{className:ti.switchBtn,onClick:r,children:"切换账号"})]})}function s2({open:e,onOpenChange:t}){const{gameId:n,loginTypes:r,currentLoginType:o,closeable:s,isShowGiantLogo:i,onLoginSuccess:a,triggerRealNameAuth:c,showRealNameModal:l,setIsAutoLoggingIn:u,setAutoLoginAccountName:f}=Nn(),[d,h]=re.useState(!1),m=re.useMemo(()=>zr(n),[n,e]),y=e&&m.length>0&&!d;re.useEffect(()=>{if(!e){h(!1),u(!1);return}if(y){const C=m[0];(async()=>{if(!C){h(!0);return}u(!0),f(C.username);try{gf(C.authorization);const b=await Qd(),x={account:b.account,entity:b.channel_info.entity,token:b.channel_info.token,sign:b.channel_info.sign,accid:b.channel_info.entity.openid,extra_data:b.channel_info.extra_data,gaplaySign:b.channel_info.gaplaySign,realname:b.channel_info.realname};if(Ts(x,C.authorization,n),x.realname&&x.realname.reject>=2){u(!1),h(!0),c();return}u(!1),h(!0),t?.(!1),a?.(x)}catch(b){console.error("Auto quick login failed:",b),u(!1),h(!0)}})()}},[e,n,y]);const v=vf({loginTypes:r,gameId:n}),g=bf({loginTypes:r,gameId:n}),E=yf({loginTypes:r,gameId:n});return w.jsxs(w.Fragment,{children:[y&&w.jsx(o2,{onSwitch:()=>h(!0)}),w.jsxs(Wr,{open:e&&!y&&!l,onOpenChange:t,classNames:{popup:gt("w-[400px] p-5",eh.modal),close:eh.close,backdrop:"!bg-[var(--jssdk-backdrop-bg-color,rgba(0,0,0,0.7))]"},showCloseIcon:s,children:[i&&!fw(n)&&w.jsx("section",{className:"flex items-center justify-center mb-6",children:w.jsx("img",{src:n==="5327"?"https://cdn-imgs.sdk.mobileztgame.com/paycenter/260511150749961295.png":"https://h5.sdk.mobileztgame.com/dist/bg_logo.png",className:"aspect-[240/85] w-32"})}),w.jsxs("section",{children:[o==="quick"&&w.jsx(t2,{}),o===at.MOBILE&&g&&w.jsx(Jp,{}),o===at.ROLE_ID&&v&&w.jsx(Qp,{}),o===at.GIANT&&E&&w.jsx(KT,{})]})]}),w.jsx(r2,{})]})}class i2 extends re.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){console.error("[Login SDK] Uncaught error:",t)}render(){return this.state.hasError?null:this.props.children}}function cc({open:e,onOpenChange:t,sceneId:n,onPhoneLoginSuccess:r,onAccountLoginSuccess:o,onUidLoginSuccess:s,onLoginSuccess:i,onLoginError:a,closeable:c=!0,mountToaster:l=!0,toastConfigs:u,...f}){const[d]=re.useState(()=>new Mh);return w.jsxs(re.StrictMode,{children:[w.jsx(Nh,{client:d,children:w.jsx(kf,{value:{sceneId:n,onPhoneLoginSuccess:r,onAccountLoginSuccess:o,onUidLoginSuccess:s,onLoginSuccess:h=>{ww(vw({gameId:dr(f.gameId),serverUserInfo:h})),i?.(h)},onLoginError:a,closeable:c,onClose:()=>t?.(!1),...f},children:w.jsx(i2,{children:w.jsx(s2,{open:e,onOpenChange:t})})})}),l&&w.jsx(aw,{toastConfigs:u})]})}const th=e=>Sa(dr(e)),nh=e=>bw(dr(e)),rh=e=>!!Sa(dr(e));function oh({loginTypes:e,defaultLoginType:t,gameId:n,styleVars:r,onLoginSuccess:o,onLoginError:s}){const i=dr(n);if(document.querySelector(".login-sdk-container"))return console.warn("Login component is already active. Multiple instances are not allowed."),{close:()=>{}};const a=document.createElement("div");a.className="login-sdk-container",document.body.appendChild(a);const c=ah.createRoot(a),l=()=>{setTimeout(()=>{c.unmount(),a.remove()},200)},u=()=>{c.render(w.jsx(cc,{gameId:i,loginTypes:e,defaultLoginType:t,styleVars:r,open:!1,onOpenChange:f,onLoginSuccess:o,onLoginError:s})),l()},f=d=>{d||u()};return c.render(w.jsx(cc,{gameId:i,loginTypes:e,defaultLoginType:t,styleVars:r,open:!0,onOpenChange:f,onLoginSuccess:o,onLoginError:s})),{close:u}}const a2={init:Cf,login:oh,logout:nh,getUserInfo:th,isLoggedIn:rh};yt.ConfigProvider=kf,yt.Login=cc,yt.MobileLogin=Jp,yt.SDK=a2,yt.UidLogin=Qp,yt.getGameId=dr,yt.getUserInfo=th,yt.init=Cf,yt.isLoggedIn=rh,yt.login=oh,yt.logout=nh,Object.defineProperty(yt,Symbol.toStringTag,{value:"Module"})}));
|