@iccandle/reactjs-widget 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +186 -244
- package/dist/widget-iccandle.cjs +2 -2
- package/dist/widget-iccandle.js +4 -4
- package/package.json +1 -1
package/dist/widget-iccandle.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.iccandle-toaster{--iccandle-secondary: oklch( from var(--iccandle-background) clamp(.92, calc(l - .06) , .98) c h / .92 )}[data-sonner-toaster][data-sonner-theme=dark].iccandle-toaster{--iccandle-secondary: oklch( from var(--iccandle-background) clamp(.22, calc(l + .22) , .34) c h / .92 )}.custom-toast{display:flex;width:100%;gap:12px;border:1px solid var(--iccandle-border, #e5e7eb);border-radius:12px;padding:16px;background:var(--iccandle-background, #ffffff);color:var(--iccandle-text, #111827);box-shadow:0 8px 24px #0f172a1f}.custom-toast__icon-wrap{display:flex;height:40px;width:40px;align-items:center;justify-content:center;border-radius:9999px;background:var(--iccandle-secondary, #f3f4f6);flex-shrink:0}.custom-toast__icon{height:20px;width:20px;color:var(--iccandle-text, #4b5563);opacity:.7}.custom-toast__content{flex:1;min-width:0}.custom-toast__header{display:flex;align-items:flex-start;justify-content:space-between}.custom-toast__title{margin:0;color:var(--iccandle-text, #111827);font-size:14px;line-height:20px;font-weight:600}.custom-toast__description{margin:4px 0 0;color:var(--iccandle-text, #4b5563);font-size:14px;line-height:20px;opacity:.75}.custom-toast__actions{margin-top:12px;display:flex;gap:12px}.custom-toast__button{border:0;border-radius:6px;background:transparent;padding:8px 12px;font-size:14px;line-height:20px;font-weight:500;cursor:pointer}.custom-toast__button:hover{background:color-mix(in oklab,var(--iccandle-border, #e5e7eb) 35%,transparent)}.custom-toast__button--action{color:var(--iccandle-primary, #2563eb)}.custom-toast__button--dismiss{color:var(--iccandle-text, #4b5563);opacity:.85}.iccandle-scanner-popup{position:absolute!important;top:25%!important;left:25%!important;z-index:20!important;display:flex!important;flex-direction:column!important;align-items:center!important;gap:.5rem!important;height:38px!important;padding:.25rem!important;background-color:var(--iccandle-background);border:1px solid var(--iccandle-border)!important;border-radius:1rem!important;color:var(--iccandle-text);box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a!important}@media(max-width:640px){.iccandle-scanner-popup{left:2rem!important}}.iccandle-scanner-popup__inner{display:flex!important;height:100%!important;width:100%!important;align-items:center!important;gap:.25rem!important}.iccandle-scanner-popup__grip{cursor:move!important}.iccandle-scanner-popup__divider{width:2px!important;height:2rem!important;margin-top:.25rem!important;margin-bottom:.25rem!important;background-color:var(--iccandle-border)}.iccandle-scanner-popup__bars{margin-left:.5rem!important;margin-right:.5rem!important;width:100%!important;min-width:3rem!important;flex:1 1 0%!important;white-space:nowrap!important;font-size:.75rem!important;font-weight:600!important;height:100%!important}.iccandle-scanner-popup__action-btn{touch-action:none!important;display:flex!important;height:2rem!important;width:100%!important;align-items:center!important;justify-content:center!important;gap:.5rem!important;margin-left:.25rem!important;margin-right:.25rem!important;font-size:.75rem!important;font-weight:600!important;cursor:pointer!important;padding:.25rem!important;border-radius:.125rem!important;background-color:transparent;border:none!important;outline:none!important;color:var(--iccandle-border);transition:background-color .2s ease-in-out}.iccandle-scanner-popup__action-btn:hover{background-color:color-mix(in srgb,var(--iccandle-background) 40%,transparent)}.iccandle-scanner-popup__action-btn--with-gap{gap:.25rem!important;padding-left:.25rem!important}@keyframes iccandle-scanner-label-gradient{0%{background-position:0% 50%}to{background-position:200% 50%}}.iccandle-scanner-popup__label{background:linear-gradient(90deg,var(--iccandle-primary) 0%,var(--iccandle-primary-gradient-end) 50%,var(--iccandle-primary) 100%);background-size:200% 100%!important;-webkit-background-clip:text!important;background-clip:text!important;color:transparent;text-wrap:nowrap!important;animation:iccandle-scanner-label-gradient 2s linear infinite}.iccandle-scanner-popup__action-row{display:flex!important;width:100%!important;align-items:center!important;gap:.25rem!important;flex:1!important}.iccandle-scanner-popup__logo{min-width:1.25rem!important;min-height:1.25rem!important}.iccandle-scanner-popup__settings{touch-action:none!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:.25rem!important;cursor:pointer!important;border-radius:.125rem!important;border:none!important;background:transparent;color:inherit}.iccandle-scanner-popup__settings:hover{background-color:color-mix(in srgb,var(--iccandle-background) 40%,transparent)}.iccandle-scanner-popup__toggle{display:flex!important;height:2rem!important;margin-right:.25rem!important;align-items:center!important;justify-content:center!important;gap:.25rem!important;padding-left:.25rem!important;font-size:.75rem!important;font-weight:600!important;color:var(--iccandle-border);transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.iccandle-scanner-popup__toggle:hover{background-color:color-mix(in srgb,var(--iccandle-background) 40%,transparent)}.iccandle-simple-tooltip-wrapper{position:relative!important;display:inline-flex!important}.iccandle-simple-tooltip-trigger{display:inline-flex!important;align-items:flex-start!important;gap:4px!important}.iccandle-simple-tooltip-content{position:absolute!important;left:50%!important;bottom:100%!important;transform:translate(-50%)!important;margin-bottom:4px!important;background-color:var(--iccandle-secondary)!important;color:var(--iccandle-text)!important;padding:4px 6px!important;font-size:12px;line-height:1.25;border-radius:2px!important;border:none!important;box-shadow:0 1px 3px #0000001f!important;z-index:50!important;max-width:240px!important;pointer-events:none!important;text-wrap:nowrap!important}.iccandle-simple-tooltip-content p{margin:0!important}.iccandle-scanner-advanced-options{display:flex!important;flex-direction:column!important;gap:1rem!important;width:100%!important;max-width:20rem!important;margin:1rem 0!important}.iccandle-scanner-advanced-options__row{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.75rem!important}.iccandle-scanner-advanced-options__label{display:flex!important;align-items:center!important;gap:.5rem!important;flex:1!important;min-width:0!important}.iccandle-scanner-advanced-options__native-select-wrap{position:relative!important;display:inline-flex!important;align-items:center!important;flex-shrink:0!important}.iccandle-scanner-advanced-options__native-select-wrap--small{width:6rem!important;min-width:6rem!important}.iccandle-scanner-advanced-options__native-select-wrap--large{width:12rem!important;min-width:12rem!important}.iccandle-scanner-advanced-options__native-select{width:100%!important;height:2.25rem!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0 1rem 0 .5rem!important;border-radius:.375rem!important;background-color:var(--iccandle-background);border:1px solid var(--iccandle-border)!important;color:var(--iccandle-text);font-size:.875rem;cursor:pointer!important}.iccandle-scanner-advanced-options__native-select::-ms-expand{display:none!important}.iccandle-scanner-advanced-options__native-select option,.iccandle-scanner-advanced-options__native-select optgroup{background-color:var(--iccandle-background);color:var(--iccandle-text);font-size:.875rem}.iccandle-scanner-advanced-options__native-select option:checked{background-color:var(--iccandle-border)}.iccandle-scanner-advanced-options__native-select:focus{outline:none!important;border-color:color-mix(in oklab,var(--iccandle-border) 55%,var(--iccandle-text));box-shadow:0 0 0 2px color-mix(in oklab,var(--iccandle-text) 25%,transparent)!important}.iccandle-scanner-advanced-options__native-select:disabled{opacity:.6!important;cursor:not-allowed!important}.iccandle-scanner-advanced-options__select{display:inline-flex!important;align-items:center!important;justify-content:space-between!important;gap:.5rem!important;height:2.25rem!important;padding:0 .5rem!important;border-radius:.375rem!important;background-color:var(--iccandle-background);border:1px solid var(--iccandle-border)!important;color:var(--iccandle-text);font-size:.875rem;cursor:pointer!important;flex-shrink:0!important}.iccandle-scanner-advanced-options__select:hover{border-color:color-mix(in oklab,var(--iccandle-border) 60%,var(--iccandle-text))}.iccandle-scanner-advanced-options__select:focus{outline:none!important;border-color:color-mix(in oklab,var(--iccandle-border) 55%,var(--iccandle-text));box-shadow:0 0 0 2px color-mix(in oklab,var(--iccandle-text) 25%,transparent)!important}.iccandle-scanner-advanced-options__select--open{border-color:color-mix(in oklab,var(--iccandle-border) 50%,var(--iccandle-text))}.iccandle-scanner-advanced-options__select--small{width:6rem!important;min-width:6rem!important}.iccandle-scanner-advanced-options__select--large{width:12rem!important;min-width:12rem!important}.iccandle-scanner-advanced-options__select-value{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-scanner-advanced-options__select-caret{width:0!important;height:0!important;border-left:5px solid transparent!important;border-right:5px solid transparent!important;border-top:6px solid var(--iccandle-text)!important}.iccandle-scanner-advanced-options__menu{position:fixed!important;z-index:60!important;max-height:16rem!important;overflow:auto!important;padding:.25rem!important;border-radius:.75rem!important;background-color:var(--iccandle-background);border:1px solid var(--iccandle-border)!important;box-shadow:0 20px 25px -5px #0003,0 8px 10px -6px #0003!important;-webkit-backdrop-filter:blur(10px)!important;backdrop-filter:blur(10px)!important}.iccandle-scanner-advanced-options__option{width:100%!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.75rem!important;padding:.5rem .75rem!important;border-radius:.625rem!important;color:var(--iccandle-text);background:transparent;border:none!important;cursor:pointer!important;text-align:left!important}.iccandle-scanner-advanced-options__option:hover{background-color:var(--iccandle-background)}.iccandle-scanner-advanced-options__option--selected{background-color:var(--iccandle-border)}.iccandle-scanner-advanced-options__option-label{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-scanner-advanced-options__option-check{width:.75rem!important;height:.75rem!important;border-radius:.25rem!important;background-color:var(--iccandle-text);box-shadow:inset 0 0 0 2px color-mix(in oklab,var(--iccandle-background) 90%,transparent)!important}@media(min-width:640px){.iccandle-scanner-advanced-options{height:434px!important}}.iccandle-forexIcons{position:relative!important;width:24px!important;min-width:24px!important;height:24px!important;min-height:24px!important}.iccandle-forexIcons__img{position:absolute!important;border-radius:9999px!important;border-width:2px!important;border-style:solid!important;border-color:var(--iccandle-background);box-sizing:border-box!important}.iccandle-forexIcons__img--single{top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important}.iccandle-forexIcons__img--left{bottom:0!important;left:0!important;z-index:8!important}.iccandle-forexIcons__img--right{top:0!important;right:0!important}.iccandle-scanner-symbol-search{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important;color:var(--iccandle-text)!important}.iccandle-scanner-symbol-search__bar{position:relative!important;display:flex!important;flex-shrink:0!important;align-items:center!important;gap:.25rem!important;padding:.5rem .75rem!important}.iccandle-scanner-symbol-search__search-icon{width:1rem!important;height:1rem!important}.iccandle-scanner-symbol-search__input{width:100%!important;height:2rem!important;font-size:.875rem;background-color:var(--iccandle-background)}.iccandle-scanner-symbol-search__input:focus{outline:none!important}.iccandle-dark .iccandle-scanner-symbol-search__input{background-color:inherit}.iccandle-scanner-symbol-search__count-badge{position:absolute!important;right:.5rem!important;display:inline-flex!important;align-items:center!important;gap:.25rem!important;padding:.25rem .5rem!important;border:1px solid var(--iccandle-border)!important;border-radius:999px!important;background-color:var(--iccandle-background)}.iccandle-scanner-symbol-search__count-desktop{display:none!important;font-size:.75rem;font-weight:600}.iccandle-scanner-symbol-search__count-mobile{display:block!important;font-size:.75rem;font-weight:400}.iccandle-scanner-symbol-search__types-wrap{flex-shrink:0!important;padding:.5rem .75rem!important}.iccandle-scanner-symbol-search__types-list{display:flex!important;gap:.25rem!important;overflow-x:auto!important}.iccandle-scanner-symbol-search__type-badge{cursor:pointer!important;font-size:.75rem;border:1px solid var(--iccandle-border)!important;border-radius:999px!important;padding:.25rem .5rem!important}.iccandle-scanner-symbol-search__type-badge--active{border-color:var(--iccandle-primary)}.iccandle-scanner-symbol-search__type-badge--inactive{background-color:var(--iccandle-secondary)}.iccandle-scanner-symbol-search__type-label{font-size:.75rem;font-weight:400}.iccandle-scanner-symbol-search__type-label--active{color:var(--iccandle-primary)}.iccandle-scanner-symbol-search__type-label--inactive{color:var(--iccandle-text)}.iccandle-scanner-symbol-search__table-wrap{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important;padding:.5rem .75rem 0!important}.iccandle-scanner-symbol-search__table-head{display:flex!important;flex-shrink:0!important;align-items:center!important;margin-bottom:.5rem!important}.iccandle-scanner-symbol-search__checkbox{width:.75rem!important;height:.75rem!important;margin-right:.5rem!important;flex-shrink:0!important;-webkit-appearance:none!important;appearance:none!important;display:grid!important;place-content:center!important;border:1px solid var(--iccandle-border, #d1d5dc)!important;border-radius:.2rem!important;border-color:var(--iccandle-primary, #00dfb9);background-color:var(--iccandle-background, #ffffff)}.iccandle-scanner-symbol-search__checkbox:checked{background-color:var(--iccandle-primary, #00dfb9);border-color:var(--iccandle-primary, #00dfb9);accent-color:var(--iccandle-primary, #00dfb9)}.iccandle-scanner-symbol-search__checkbox:checked:after{content:""!important;width:.25rem!important;height:.45rem!important;border:2px solid var(--iccandle-background, #ffffff)!important;border-top:0!important;border-left:0!important;transform:translateY(-.02rem) rotate(45deg)!important}.iccandle-scanner-symbol-search__checkbox--row{margin-right:.25rem!important}.iccandle-scanner-symbol-search__symbol-title{width:5rem!important;font-size:.75rem;font-weight:400}.iccandle-scanner-symbol-search__description-title{flex:1!important;font-size:.75rem;font-weight:400}.iccandle-scanner-symbol-search__list-container{display:flex!important;min-height:0!important;flex:1 1 auto!important;overflow:auto!important}.iccandle-scanner-symbol-search__symbol-list{min-width:7rem!important}.iccandle-scanner-symbol-search__symbol-row{display:flex!important;align-items:center!important;gap:.25rem!important;min-height:2.5rem!important;padding:.25rem 0!important}.iccandle-scanner-symbol-search__symbol-name{color:var(--iccandle-text);overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-scanner-symbol-search__description-list{width:100%!important}.iccandle-scanner-symbol-search__description-row{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.25rem!important;width:100%!important;min-height:2.5rem!important;padding:.25rem 0!important}.iccandle-scanner-symbol-search__description-text{flex:1!important;min-width:0!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:1!important;line-clamp:1!important;overflow:hidden!important}.iccandle-scanner-symbol-search__type-text{font-size:.875rem;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-scanner-symbol-search__row-divider{border-color:var(--iccandle-border)}@media(min-width:640px){.iccandle-scanner-symbol-search__bar{gap:.5rem!important;padding:0 1.25rem!important}.iccandle-scanner-symbol-search__search-icon{width:1.25rem!important;height:1.25rem!important}.iccandle-scanner-symbol-search__input{height:2.5rem!important}.iccandle-scanner-symbol-search__count-desktop{display:block!important;font-size:.875rem}.iccandle-scanner-symbol-search__count-mobile{display:none!important}.iccandle-scanner-symbol-search__types-wrap{padding:.75rem 1.25rem!important}.iccandle-scanner-symbol-search__types-list{gap:.5rem!important}.iccandle-scanner-symbol-search__type-badge,.iccandle-scanner-symbol-search__type-label{font-size:.875rem}.iccandle-scanner-symbol-search__table-wrap{padding:.75rem 1.25rem 0!important}.iccandle-scanner-symbol-search__table-head{margin-bottom:.75rem!important}.iccandle-scanner-symbol-search__checkbox{width:1rem!important;height:1rem!important;margin-right:1rem!important}.iccandle-scanner-symbol-search__checkbox--row{margin-right:.5rem!important}.iccandle-scanner-symbol-search__symbol-title{width:8rem!important;font-size:.875rem}.iccandle-scanner-symbol-search__description-title{font-size:.875rem}.iccandle-scanner-symbol-search__symbol-list{min-width:10rem!important}.iccandle-scanner-symbol-search__symbol-row,.iccandle-scanner-symbol-search__description-row{gap:.5rem!important;padding:.5rem 0!important}}@media(min-width:768px){.iccandle-scanner-symbol-search__symbol-title{width:10rem!important}.iccandle-scanner-symbol-search__symbol-list{min-width:12rem!important}}.iccandle-scanner-option{position:fixed!important;inset:0!important;z-index:40!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0 .5rem!important;background-color:hsl(from var(--iccandle-background) h s l / .5)}.iccandle-scanner-option__card{position:relative!important;display:flex!important;width:100%!important;max-width:56rem!important;flex-direction:column!important;padding-bottom:.75rem!important;height:min(80vh,48rem)!important;overflow:hidden!important;background-color:var(--iccandle-background);border-radius:.5rem!important;border:1px solid var(--iccandle-border)!important;color:var(--iccandle-text);box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a!important}.iccandle-scanner-option__form{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important}.iccandle-scanner-option__body{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important;padding:.75rem 0!important}.iccandle-scanner-option__header{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.5rem!important;margin-bottom:.75rem!important;padding:1rem 1.25rem 0!important;font-weight:600;color:var(--iccandle-border)}.iccandle-scanner-option__close-btn{padding:.25rem!important;border-radius:.125rem!important}.iccandle-scanner-option__close-btn:hover{background-color:var(--iccandle-secondary)}.iccandle-scanner-option__tabs{display:grid!important;width:100%!important;max-height:2.5rem!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.25rem!important;padding:.25rem!important;background-color:color-mix(in oklab,var(--iccandle-secondary) 66%,transparent)}.iccandle-scanner-option__tab{position:relative!important;padding:.375rem 0!important;font-size:.875rem;font-weight:600;border-radius:.125rem!important;transition:all .2s ease;cursor:pointer!important}.iccandle-scanner-option__tab--active{background-color:var(--iccandle-background)}.iccandle-scanner-option__tab--inactive:hover{background-color:color-mix(in oklab,var(--iccandle-secondary) 50%,transparent)}.iccandle-scanner-option__advanced-content{padding:0 1.25rem!important}.iccandle-scanner-option__content--visible{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important}.iccandle-scanner-option__advanced-content.iccandle-scanner-option__content--visible{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important}.iccandle-scanner-option__content--hidden{display:none!important}.iccandle-scanner-option__actions{display:flex!important;justify-content:flex-end!important;gap:1rem!important;margin-top:auto!important;padding:.75rem 1rem 0!important;border-top:1px solid var(--iccandle-border)!important}.iccandle-scanner-option__title{color:var(--iccandle-text)}.iccandle-scanner-option__btn{height:2.25rem!important;padding:0 .875rem!important;border-radius:.375rem!important;font-size:.875rem;font-weight:600;cursor:pointer!important;border:1px solid transparent!important}.iccandle-scanner-option__btn--outline{background:transparent;border-color:var(--iccandle-border);color:var(--iccandle-text)}.iccandle-scanner-option__btn--outline:hover{background-color:color-mix(in oklab,var(--iccandle-secondary) 20%,transparent)}.iccandle-scanner-option__btn--primary{background-color:color-mix(in srgb,var(--iccandle-primary) 30%,transparent);color:var(--iccandle-text);border:1px solid var(--iccandle-primary)!important}.iccandle-scanner-option__btn--primary:hover{filter:brightness(.95)}.iccandle-selector-widget{--iccandle-primary: #00dfb9;--iccandle-primary-gradient-end: #ffb84d;--iccandle-background: #ffffff;--iccandle-border: #d1d5dc;--iccandle-text: #000000;--iccandle-secondary: oklch(from var(--iccandle-background) clamp(.92, calc(l - .06) , .98) c h / .92);font-family:var( --iccandle-font, "Inter Tight", ui-sans-serif, system-ui, sans-serif );position:relative!important;height:100%!important}.iccandle-selector-widget :where(img,picture,video,canvas,svg){display:revert;max-width:revert}.iccandle-dark{--iccandle-primary: #00dfb9;--iccandle-primary-gradient-end: #ffb84d;--iccandle-background: #1a1a1a;--iccandle-border: rgba(255, 255, 255, .2);--iccandle-text: #ffffff;--iccandle-secondary: oklch(from var(--iccandle-background) clamp(.22, calc(l + .22) , .34) c h / .92)}.iccandle-selector-widget__overlay{position:fixed!important;inset:0!important;z-index:8!important}.iccandle-pattern-alert-name{display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;min-height:24rem!important;background-color:var(--iccandle-background)!important;border-radius:1.5rem!important;overflow:hidden!important}.iccandle-pattern-alert-name__header{height:fit-content!important;padding:1rem 1rem 0!important;display:flex!important;flex-direction:column!important;gap:.5rem!important;text-align:left!important}.iccandle-pattern-alert-name__title-row{display:flex!important;align-items:center!important;justify-content:space-between!important}.iccandle-pattern-alert-name__title{display:flex!important;align-items:center!important;gap:.5rem!important;margin:0!important;font-size:1.125rem!important;font-weight:600!important;line-height:1!important;color:var(--iccandle-text)}.iccandle-pattern-alert-name__title-icon{flex-shrink:0!important;color:var(--iccandle-primary)}.iccandle-pattern-alert-name__close-btn{display:flex!important;align-items:center!important;justify-content:center!important;width:2rem!important;height:2rem!important;padding:0!important;border:none!important;border-radius:.375rem!important;background:transparent!important;color:var(--iccandle-text);cursor:pointer!important}.iccandle-pattern-alert-name__close-btn:hover{background-color:color-mix(in oklab,var(--iccandle-secondary) 20%,transparent)}@media(min-width:640px){.iccandle-pattern-alert-name__close-btn{display:none!important}}.iccandle-pattern-alert-name__description{margin:0!important;font-size:.875rem!important;color:color-mix(in oklab,var(--iccandle-text) 70%,transparent)}.iccandle-pattern-alert-name__content{display:flex!important;flex:1!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:1.5rem!important;padding:1rem!important}.iccandle-pattern-alert-name__bell-icon{color:var(--iccandle-primary)}.iccandle-pattern-alert-name__form{width:100%!important}.iccandle-pattern-alert-name__field{display:grid!important;width:100%!important;align-items:center!important;gap:.5rem!important}.iccandle-pattern-alert-name__label{font-size:.875rem!important;font-weight:500!important;color:var(--iccandle-text)}.iccandle-pattern-alert-name__input{width:100%!important;height:2.25rem!important;padding:0 .75rem!important;border:1px solid var(--iccandle-border)!important;border-radius:.375rem!important;font-size:.875rem!important;background-color:var(--iccandle-background);color:var(--iccandle-text)}.iccandle-pattern-alert-name__input::placeholder{color:color-mix(in oklab,var(--iccandle-text) 50%,transparent)}.iccandle-pattern-alert-name__input:focus{outline:none!important;border-color:var(--iccandle-primary)!important}.iccandle-pattern-alert-name__error{margin:0!important;font-size:.75rem!important;color:#ef4444}.iccandle-pattern-alert-name__footer-wrap{height:fit-content!important}@media(min-width:640px){.iccandle-pattern-alert-name__footer-wrap{height:25%!important}}.iccandle-pattern-alert-name__divider{margin:0!important;border:none!important;border-top:1px solid var(--iccandle-border)!important}.iccandle-pattern-alert-name__footer{display:flex!important;width:100%!important;align-items:center!important;justify-content:flex-end!important;gap:1rem!important;padding:1rem!important;font-weight:600!important;color:color-mix(in oklab,var(--iccandle-text) 80%,transparent)}.iccandle-pattern-alert-name__btn{height:2.25rem!important;padding:0 .875rem!important;border-radius:.5rem!important;font-size:.875rem!important;font-weight:600!important;cursor:pointer!important;border:1px solid transparent!important}.iccandle-pattern-alert-name__btn--outline{background:transparent;border-color:var(--iccandle-border)!important;color:var(--iccandle-text)}.iccandle-pattern-alert-name__btn--outline:hover{background-color:color-mix(in oklab,var(--iccandle-secondary) 20%,transparent)}.iccandle-pattern-alert-name__btn--primary{width:fit-content!important;background-color:color-mix(in srgb,var(--iccandle-primary) 30%,transparent);color:var(--iccandle-primary);border:1px solid var(--iccandle-primary)!important}.iccandle-pattern-alert-name__btn--primary:hover:not(:disabled){filter:brightness(.95)}.iccandle-pattern-alert-name__btn--primary:disabled{opacity:.5!important;cursor:not-allowed!important}.iccandle-scanner-timeframe-search{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important}.iccandle-scanner-timeframe-search__bar{position:relative!important;display:flex!important;flex-shrink:0!important;align-items:center!important;gap:.25rem!important;color:var(--iccandle-text)!important}.iccandle-scanner-timeframe-search__search-icon{width:1rem!important;height:1rem!important}.iccandle-scanner-timeframe-search__input{width:100%!important;height:2rem!important;font-size:.875rem;background-color:var(--iccandle-background)}.iccandle-scanner-timeframe-search__input:focus{outline:none!important}.iccandle-dark .iccandle-scanner-timeframe-search__input{background-color:inherit}.iccandle-scanner-timeframe-search__count-badge{position:absolute!important;right:.5rem!important;display:inline-flex!important;align-items:center!important;gap:.25rem!important;padding:.25rem .5rem!important;border:1px solid var(--iccandle-border)!important;border-radius:999px!important;background-color:var(--iccandle-background)}.iccandle-scanner-timeframe-search__count-desktop{display:none!important;font-size:.75rem;font-weight:600}.iccandle-scanner-timeframe-search__count-mobile{display:block!important;font-size:.75rem;font-weight:400}.iccandle-scanner-timeframe-search__types-wrap{flex-shrink:0!important;padding:.5rem .75rem!important}.iccandle-scanner-timeframe-search__types-list{display:flex!important;gap:.25rem!important;overflow-x:auto!important}.iccandle-scanner-timeframe-search__type-badge{cursor:pointer!important;font-size:.75rem;border:1px solid var(--iccandle-border)!important;border-radius:999px!important;padding:.25rem .5rem!important}.iccandle-scanner-timeframe-search__type-badge--active{border-color:var(--iccandle-primary)}.iccandle-scanner-timeframe-search__type-badge--inactive{background-color:var(--iccandle-secondary)}.iccandle-scanner-timeframe-search__type-label{font-size:.75rem;font-weight:400}.iccandle-scanner-timeframe-search__type-label--active{color:var(--iccandle-primary)}.iccandle-scanner-timeframe-search__type-label--inactive{color:var(--iccandle-text)}.iccandle-scanner-timeframe-search__table-wrap{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important;padding:1rem 0!important;color:var(--iccandle-text)!important}.iccandle-scanner-timeframe-search__table-head{display:flex!important;flex-shrink:0!important;align-items:center!important;margin-bottom:.5rem!important}.iccandle-scanner-timeframe-search__checkbox{width:.75rem!important;height:.75rem!important;margin-right:.5rem!important;flex-shrink:0!important;-webkit-appearance:none!important;appearance:none!important;display:grid!important;place-content:center!important;border:1px solid var(--iccandle-border, #d1d5dc)!important;border-radius:.2rem!important;border-color:var(--iccandle-primary, #00dfb9);background-color:var(--iccandle-background, #ffffff)}.iccandle-scanner-timeframe-search__checkbox:checked{background-color:var(--iccandle-primary, #00dfb9);border-color:var(--iccandle-primary, #00dfb9);accent-color:var(--iccandle-primary, #00dfb9)}.iccandle-scanner-timeframe-search__checkbox:checked:after{content:""!important;width:.25rem!important;height:.45rem!important;border:2px solid var(--iccandle-background, #ffffff)!important;border-top:0!important;border-left:0!important;transform:translateY(-.02rem) rotate(45deg)!important}.iccandle-scanner-timeframe-search__checkbox--row{margin-right:.25rem!important}.iccandle-scanner-timeframe-search__timeframe-title{width:5rem!important;font-size:.75rem;font-weight:400}.iccandle-scanner-timeframe-search__description-title{flex:1!important;font-size:.75rem;font-weight:400}.iccandle-scanner-timeframe-search__list-container{display:flex!important;min-height:0!important;flex:1 1 auto!important;overflow:auto!important}.iccandle-scanner-timeframe-search__timeframe-list{min-width:7rem!important}.iccandle-scanner-timeframe-search__timeframe-row{display:flex!important;align-items:center!important;gap:.25rem!important;min-height:2.5rem!important;padding:.25rem 0!important}.iccandle-scanner-timeframe-search__timeframe-name{color:var(--iccandle-text);overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-scanner-timeframe-search__description-list{width:100%!important}.iccandle-scanner-timeframe-search__description-row{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.25rem!important;width:100%!important;min-height:2.5rem!important;padding:.25rem 0!important}.iccandle-scanner-timeframe-search__description-text{flex:1!important;min-width:0!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:1!important;line-clamp:1!important;overflow:hidden!important}.iccandle-scanner-timeframe-search__row-divider{border-color:var(--iccandle-border)}@media(min-width:640px){.iccandle-scanner-timeframe-search__bar{gap:.5rem!important}.iccandle-scanner-timeframe-search__search-icon{width:1.25rem!important;height:1.25rem!important}.iccandle-scanner-timeframe-search__input{height:2.5rem!important}.iccandle-scanner-timeframe-search__count-desktop{display:block!important;font-size:.875rem}.iccandle-scanner-timeframe-search__count-mobile{display:none!important}.iccandle-scanner-timeframe-search__types-wrap{padding:.75rem 0!important}.iccandle-scanner-timeframe-search__types-list{gap:.5rem!important}.iccandle-scanner-timeframe-search__type-badge,.iccandle-scanner-timeframe-search__type-label{font-size:.875rem}.iccandle-scanner-timeframe-search__table-head{margin-bottom:.75rem!important}.iccandle-scanner-timeframe-search__checkbox{width:1rem!important;height:1rem!important;margin-right:1rem!important}.iccandle-scanner-timeframe-search__checkbox--row{margin-right:.5rem!important}.iccandle-scanner-timeframe-search__timeframe-title{width:8rem!important;font-size:.875rem}.iccandle-scanner-timeframe-search__description-title{font-size:.875rem}.iccandle-scanner-timeframe-search__timeframe-list{min-width:10rem!important}.iccandle-scanner-timeframe-search__timeframe-row,.iccandle-scanner-timeframe-search__description-row{gap:.5rem!important;padding:.5rem 0!important}}@media(min-width:768px){.iccandle-scanner-timeframe-search__timeframe-title{width:10rem!important}.iccandle-scanner-timeframe-search__timeframe-list{min-width:12rem!important}}.iccandle-timeframes-tab{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;gap:.5rem!important;padding:0 1rem 1rem!important}@media(min-width:640px){.iccandle-timeframes-tab{padding-left:1.5rem!important;padding-right:1.5rem!important}}.iccandle-timeframes-tab__search-wrap{min-height:0!important;flex:1 1 auto!important;overflow:hidden!important;border-radius:.5rem!important;border:1px solid var(--iccandle-border)!important}.iccandle-symbols-tab{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;gap:.5rem!important;padding:0 1rem 1rem!important}@media(min-width:640px){.iccandle-symbols-tab{padding-left:1.5rem!important;padding-right:1.5rem!important}}.iccandle-symbols-tab__search-wrap{min-height:0!important;flex:1 1 auto!important;overflow:hidden!important;border-radius:.5rem!important;border:1px solid var(--iccandle-border)!important}.iccandle-time-config-section{display:flex!important;flex-direction:column!important;gap:1rem!important;height:100%!important;max-width:100%!important;min-width:0!important;font-size:.875rem!important;color:var(--iccandle-text);overflow-x:hidden!important;overflow-y:auto!important}.iccandle-time-config-section__header{padding:.5rem 1rem!important;border-bottom:1px solid var(--iccandle-border)!important}.iccandle-time-config-section__title{margin:0!important;font-size:1.125rem!important;font-weight:600!important;color:var(--iccandle-text)}.iccandle-time-config-section__description{margin:.25rem 0 0!important;font-size:.875rem!important;color:color-mix(in oklab,var(--iccandle-text) 55%,transparent)}.iccandle-time-config-section__fields{display:flex!important;flex-direction:column!important;gap:.75rem!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:0 1rem!important}@media(min-width:640px){.iccandle-time-config-section__fields{flex-direction:row!important;align-items:center!important}}.iccandle-time-config-section__field,.iccandle-time-config-section__timezone{display:flex!important;flex-direction:column!important;gap:.25rem!important;min-width:0!important;flex:1 1 auto!important}.iccandle-time-config-section__timezone{padding:0 1rem 1rem!important}.iccandle-time-config-section__label{font-size:.75rem!important;font-weight:500!important;color:color-mix(in oklab,var(--iccandle-text) 65%,transparent)}.iccandle-time-config-section__input{height:2.25rem!important;width:100%!important;padding:.25rem .75rem!important;border:1px solid var(--iccandle-border)!important;border-radius:.375rem!important;font-size:.875rem!important;color:var(--iccandle-text);background-color:var(--iccandle-background)}.iccandle-time-config-section__input:disabled{opacity:.5!important;cursor:not-allowed!important}.iccandle-time-config-section__select-wrap{position:relative!important}.iccandle-time-config-section__select-wrap--open{z-index:100!important}.iccandle-time-config-section__select-btn{display:flex!important;align-items:center!important;justify-content:space-between!important;width:100%!important;height:2.5rem!important;padding:.5rem .75rem!important;border:1px solid var(--iccandle-border)!important;border-radius:.375rem!important;font-size:.875rem!important;text-align:left!important;color:var(--iccandle-text);background-color:var(--iccandle-background);cursor:pointer!important}.iccandle-time-config-section__select-btn:disabled{opacity:.5!important;cursor:not-allowed!important}.iccandle-time-config-section__select-label{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-time-config-section__dropdown{position:absolute!important;inset-inline:0!important;z-index:50!important;margin-top:.25rem!important;width:100%!important;border:1px solid var(--iccandle-border)!important;border-radius:.375rem!important;background-color:var(--iccandle-background);box-shadow:0 4px 12px color-mix(in oklab,var(--iccandle-text) 12%,transparent)!important}.iccandle-time-config-section__dropdown-header{padding:.5rem .75rem!important;border-bottom:1px solid var(--iccandle-border)!important}.iccandle-time-config-section__dropdown-title{margin:0!important;font-size:.875rem!important;font-weight:500!important;color:var(--iccandle-text)}.iccandle-time-config-section__dropdown-subtitle{margin:.125rem 0 0!important;font-size:.75rem!important;color:color-mix(in oklab,var(--iccandle-text) 55%,transparent)}.iccandle-time-config-section__dropdown-search{padding:.5rem!important;border-bottom:1px solid var(--iccandle-border)!important}.iccandle-time-config-section__dropdown-search-input{width:100%!important;height:2rem!important;padding:0 .5rem!important;border:1px solid var(--iccandle-border)!important;border-radius:.25rem!important;font-size:.875rem!important;color:var(--iccandle-text);background-color:var(--iccandle-background)}.iccandle-time-config-section__dropdown-search-input:focus{outline:none!important;border-color:var(--iccandle-primary, #00dfb9)!important}.iccandle-time-config-section__dropdown-list{max-height:40vh!important;margin:0!important;padding:.25rem 0!important;list-style:none!important;overflow-y:auto!important}.iccandle-time-config-section__dropdown-group-label{padding:.375rem .75rem!important;font-size:.75rem!important;font-weight:500!important;color:color-mix(in oklab,var(--iccandle-text) 55%,transparent)}.iccandle-time-config-section__dropdown-item{display:flex!important;align-items:center!important;width:100%!important;padding:.5rem .75rem!important;border:none!important;font-size:.875rem!important;text-align:left!important;color:var(--iccandle-text);background-color:transparent;cursor:pointer!important}.iccandle-time-config-section__dropdown-item:hover,.iccandle-time-config-section__dropdown-item--selected{background-color:color-mix(in oklab,var(--iccandle-text) 6%,transparent)!important}.iccandle-time-config-section__dropdown-empty{padding:.75rem!important;font-size:.875rem!important;text-align:center!important;color:color-mix(in oklab,var(--iccandle-text) 55%,transparent)}.iccandle-time-config-section__check{width:1rem!important;height:1rem!important;margin-right:.5rem!important;opacity:0!important}.iccandle-time-config-section__check--visible{opacity:1!important}.iccandle-pattern-alert-settings{display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;min-height:0!important;max-width:100%!important;min-width:0!important;gap:.5rem!important;overflow:hidden!important;background-color:var(--iccandle-background)!important;border-radius:1.5rem!important}@media(min-width:640px){.iccandle-pattern-alert-settings{gap:.75rem!important}}.iccandle-pattern-alert-settings__header-row{display:flex!important;align-items:flex-start!important;gap:.5rem!important;padding:1rem 1rem 0!important}@media(min-width:640px){.iccandle-pattern-alert-settings__header-row{align-items:center!important;gap:1rem!important}}.iccandle-pattern-alert-settings__header-icon{flex-shrink:0!important;margin-top:.125rem!important;color:var(--iccandle-primary)}@media(min-width:640px){.iccandle-pattern-alert-settings__header-icon{margin-top:0!important}}.iccandle-pattern-alert-settings__header{height:fit-content!important;width:100%!important;min-width:0!important;display:flex!important;flex-direction:column!important;gap:.5rem!important;text-align:left!important}.iccandle-pattern-alert-settings__title-row{display:flex!important;width:100%!important;align-items:flex-start!important;justify-content:space-between!important;gap:.5rem!important}@media(min-width:640px){.iccandle-pattern-alert-settings__title-row{align-items:center!important}}.iccandle-pattern-alert-settings__title{min-width:0!important;margin:0!important;font-size:1rem!important;font-weight:600!important;line-height:1.25!important;color:var(--iccandle-text)}@media(min-width:640px){.iccandle-pattern-alert-settings__title{font-size:1.125rem!important}}.iccandle-pattern-alert-settings__title-text{display:block!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-pattern-alert-settings__close-btn{display:flex!important;flex-shrink:0!important;align-items:center!important;justify-content:center!important;width:2rem!important;height:2rem!important;padding:0!important;border:none!important;border-radius:.375rem!important;background:transparent!important;color:var(--iccandle-text);cursor:pointer!important}.iccandle-pattern-alert-settings__close-btn:hover{background-color:color-mix(in oklab,var(--iccandle-background) 20%,transparent)}@media(min-width:640px){.iccandle-pattern-alert-settings__close-btn{display:none!important}}.iccandle-pattern-alert-settings__description{margin:0!important;font-size:.875rem!important;text-align:left!important;color:color-mix(in oklab,var(--iccandle-text) 70%,transparent)}.iccandle-pattern-alert-settings__form{display:flex!important;height:100%!important;min-height:0!important;max-width:100%!important;min-width:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important}.iccandle-pattern-alert-settings__tabs{display:flex!important;height:100%!important;min-height:0!important;width:100%!important;max-width:100%!important;min-width:0!important;flex:1 1 auto!important;flex-direction:column!important;gap:0!important}.iccandle-pattern-alert-settings__tabs-list{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;height:auto!important;max-width:100%!important;min-width:0!important;margin:0 1rem!important;padding:.25rem!important;border-radius:.5rem!important;background-color:color-mix(in oklab,var(--iccandle-border) 40%,var(--iccandle-background))!important;width:auto!important}.iccandle-pattern-alert-settings__tab-trigger{display:inline-flex!important;align-items:center!important;justify-content:center!important;height:100%!important;padding:.25rem!important;border:1px solid transparent!important;border-radius:.375rem!important;font-size:.6875rem!important;font-weight:500!important;color:color-mix(in oklab,var(--iccandle-text) 60%,transparent);background:transparent!important;cursor:pointer!important;transition:color .15s ease,background-color .15s ease!important}@media(min-width:640px){.iccandle-pattern-alert-settings__tab-trigger{justify-content:flex-start!important;font-size:.875rem!important}}.iccandle-pattern-alert-settings__tab-trigger[data-state=active]{color:var(--iccandle-text)!important;background-color:var(--iccandle-background)!important;border-color:var(--iccandle-border)!important;box-shadow:0 1px 2px color-mix(in oklab,var(--iccandle-text) 8%,transparent)!important}.iccandle-pattern-alert-settings__tab-trigger:disabled{opacity:.5!important;pointer-events:none!important;cursor:not-allowed!important}.iccandle-pattern-alert-settings__tab-label--mobile{display:inline!important}.iccandle-pattern-alert-settings__tab-label--desktop{display:none!important;flex-direction:column!important;align-items:flex-start!important;gap:.25rem!important;margin-left:.5rem!important;margin-right:auto!important}@media(min-width:640px){.iccandle-pattern-alert-settings__tab-label--mobile{display:none!important}.iccandle-pattern-alert-settings__tab-label--desktop{display:flex!important}}.iccandle-pattern-alert-settings__tab-step{font-size:.75rem!important;color:color-mix(in oklab,var(--iccandle-text) 55%,transparent)}.iccandle-pattern-alert-settings__tabs-content-wrap{display:flex!important;flex-direction:column!important;min-height:0!important;width:100%!important;max-width:100%!important;min-width:0!important;flex:1 1 auto!important;overflow:hidden!important;padding-top:1rem!important}@media(min-width:640px){.iccandle-pattern-alert-settings__tabs-content-wrap{padding-top:1.5rem!important}}.iccandle-pattern-alert-settings__tab-content{display:flex!important;flex-direction:column!important;margin-top:0!important;height:100%!important;min-height:0!important;min-width:0!important;flex:1 1 auto!important;overflow:hidden!important}.iccandle-pattern-alert-settings__footer{display:flex!important;height:fit-content!important;max-width:100%!important;min-width:0!important;flex-direction:column!important;gap:.5rem!important;border-top:1px solid var(--iccandle-border)!important}@media(min-width:640px){.iccandle-pattern-alert-settings__footer{flex-direction:row!important;align-items:center!important;justify-content:space-between!important}}.iccandle-pattern-alert-settings__error{max-width:100%!important;min-width:0!important;margin:0!important;padding:0 1rem!important;font-size:.875rem!important;font-weight:500!important;color:#ef4444;overflow-wrap:break-word!important;opacity:0!important;transition:opacity 1s ease-in-out!important}.iccandle-pattern-alert-settings__error--visible{opacity:1!important}@media(min-width:640px){.iccandle-pattern-alert-settings__error{font-size:1rem!important;white-space:nowrap!important}}.iccandle-pattern-alert-settings__actions{display:flex!important;width:100%!important;align-items:center!important;justify-content:flex-end!important;gap:.75rem!important;padding:0 1rem 1rem!important;font-weight:600!important;color:color-mix(in oklab,var(--iccandle-text) 80%,transparent)}@media(min-width:640px){.iccandle-pattern-alert-settings__actions{gap:1rem!important;padding:1rem!important}}.iccandle-pattern-alert-settings__btn{height:2.25rem!important;width:100%!important;padding:0 .875rem!important;border-radius:.5rem!important;font-size:.875rem!important;font-weight:600!important;cursor:pointer!important;border:1px solid transparent!important}@media(min-width:640px){.iccandle-pattern-alert-settings__btn{width:fit-content!important}}.iccandle-pattern-alert-settings__btn--outline{background:transparent;border-color:var(--iccandle-border)!important;color:var(--iccandle-text)}.iccandle-pattern-alert-settings__btn--outline:hover{background-color:color-mix(in oklab,var(--iccandle-background) 20%,transparent)}.iccandle-pattern-alert-settings__btn--primary{background-color:var(--iccandle-primary)!important;color:var(--iccandle-background)!important;border-color:var(--iccandle-primary)!important}.iccandle-pattern-alert-settings__btn--primary:hover:not(:disabled){filter:brightness(.95)}.iccandle-pattern-alert-settings__btn--primary:disabled{opacity:.5!important;cursor:not-allowed!important}.iccandle-pattern-tracker-modal{position:fixed!important;inset:0!important;z-index:50!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:1rem!important;background-color:#00000080!important}.iccandle-pattern-tracker-modal__content{position:relative!important;display:flex!important;flex-direction:column!important;width:100%!important;max-width:calc(100% - 2rem)!important;padding:0!important;border-radius:1.5rem!important;overflow:hidden!important;outline:none!important;box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a!important}@media(min-width:640px){.iccandle-pattern-tracker-modal__content{max-height:90%!important;max-width:425px!important}}.iccandle-pattern-tracker-modal__content--settings{height:100%!important;max-width:56rem!important}.iccandle-event-info-modal{position:fixed!important;inset:0!important;z-index:60!important}.iccandle-event-info-modal__dialog{position:fixed!important;width:302px!important;padding:1.5rem!important;border-radius:.375rem!important;border:1px solid var(--iccandle-border)!important;background:var(--iccandle-background)!important;color:var(--iccandle-text)!important;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a!important;box-sizing:border-box!important}.iccandle-event-info-modal__header{display:flex!important;align-items:center!important;justify-content:space-between!important;margin-bottom:1rem!important;gap:.5rem!important}.iccandle-event-info-modal__title-row{display:flex!important;align-items:center!important;gap:.5rem!important;min-width:0!important}.iccandle-event-info-modal__title{margin:0!important;font-size:1.125rem!important;font-weight:700!important;line-height:1.4!important;overflow:hidden!important;text-overflow:ellipsis!important}.iccandle-event-info-modal__close{display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:.25rem!important;border:none!important;border-radius:.125rem!important;background:transparent!important;color:inherit!important;cursor:pointer!important;flex-shrink:0!important}.iccandle-event-info-modal__close:hover{background:color-mix(in srgb,var(--iccandle-text) 8%,transparent)!important}.iccandle-event-info-modal__date{margin:0 0 1rem!important;font-size:.875rem!important;color:color-mix(in srgb,var(--iccandle-text) 60%,transparent)!important}.iccandle-event-info-modal__rows{display:flex!important;flex-direction:column!important;gap:.5rem!important;font-size:.875rem!important}.iccandle-event-info-modal__row{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.75rem!important}.iccandle-event-info-modal__label{color:color-mix(in srgb,var(--iccandle-text) 55%,transparent)!important}.iccandle-event-info-modal__value{font-weight:600!important;color:var(--iccandle-text)!important}.iccandle-event-info-modal__actions{display:flex!important;flex-direction:column-reverse!important;gap:.5rem!important;margin-top:1.5rem!important}.iccandle-event-info-modal__actions .iccandle-event-info-modal__btn{width:100%!important}@media(min-width:640px){.iccandle-event-info-modal__actions{flex-direction:row!important;justify-content:flex-end!important}.iccandle-event-info-modal__actions .iccandle-event-info-modal__btn{width:auto!important}}.iccandle-event-info-modal__loading,.iccandle-event-info-modal__empty{display:flex!important;align-items:center!important;justify-content:center!important;min-height:12rem!important;min-width:16rem!important;padding:2rem 0!important;font-size:.875rem!important;color:color-mix(in srgb,var(--iccandle-text) 55%,transparent)!important;text-align:center!important}.iccandle-event-info-modal__spinner{width:1.5rem!important;height:1.5rem!important;animation:iccandle-event-info-spin .8s linear infinite!important}@keyframes iccandle-event-info-spin{to{transform:rotate(360deg)}}')),document.head.appendChild(t)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.iccandle-toaster{--iccandle-secondary: oklch( from var(--iccandle-background) clamp(.92, calc(l - .06) , .98) c h / .92 )}[data-sonner-toaster][data-sonner-theme=dark].iccandle-toaster{--iccandle-secondary: oklch( from var(--iccandle-background) clamp(.22, calc(l + .22) , .34) c h / .92 )}.custom-toast{display:flex;width:100%;gap:12px;border:1px solid var(--iccandle-border, #e5e7eb);border-radius:12px;padding:16px;background:var(--iccandle-background, #ffffff);color:var(--iccandle-text, #111827);box-shadow:0 8px 24px #0f172a1f}.custom-toast__icon-wrap{display:flex;height:40px;width:40px;align-items:center;justify-content:center;border-radius:9999px;background:var(--iccandle-secondary, #f3f4f6);flex-shrink:0}.custom-toast__icon{height:20px;width:20px;color:var(--iccandle-text, #4b5563);opacity:.7}.custom-toast__content{flex:1;min-width:0}.custom-toast__header{display:flex;align-items:flex-start;justify-content:space-between}.custom-toast__title{margin:0;color:var(--iccandle-text, #111827);font-size:14px;line-height:20px;font-weight:600}.custom-toast__description{margin:4px 0 0;color:var(--iccandle-text, #4b5563);font-size:14px;line-height:20px;opacity:.75}.custom-toast__actions{margin-top:12px;display:flex;gap:12px}.custom-toast__button{border:0;border-radius:6px;background:transparent;padding:8px 12px;font-size:14px;line-height:20px;font-weight:500;cursor:pointer}.custom-toast__button:hover{background:color-mix(in oklab,var(--iccandle-border, #e5e7eb) 35%,transparent)}.custom-toast__button--action{color:var(--iccandle-primary, #2563eb)}.custom-toast__button--dismiss{color:var(--iccandle-text, #4b5563);opacity:.85}.iccandle-scanner-popup{position:absolute!important;top:25%!important;left:25%!important;z-index:20!important;display:flex!important;flex-direction:column!important;align-items:center!important;gap:.5rem!important;height:38px!important;padding:.25rem!important;background-color:var(--iccandle-background);border:1px solid var(--iccandle-border)!important;border-radius:1rem!important;color:var(--iccandle-text);box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a!important}@media(max-width:640px){.iccandle-scanner-popup{left:2rem!important}}.iccandle-scanner-popup__inner{display:flex!important;height:100%!important;width:100%!important;align-items:center!important;gap:.25rem!important}.iccandle-scanner-popup__grip{cursor:move!important}.iccandle-scanner-popup__divider{width:2px!important;height:2rem!important;margin-top:.25rem!important;margin-bottom:.25rem!important;background-color:var(--iccandle-border)}.iccandle-scanner-popup__bars{margin-left:.5rem!important;margin-right:.5rem!important;width:100%!important;min-width:3rem!important;flex:1 1 0%!important;white-space:nowrap!important;font-size:.75rem!important;font-weight:600!important;height:100%!important}.iccandle-scanner-popup__action-btn{touch-action:none!important;display:flex!important;height:2rem!important;width:100%!important;align-items:center!important;justify-content:center!important;gap:.5rem!important;margin-left:.25rem!important;margin-right:.25rem!important;font-size:.75rem!important;font-weight:600!important;cursor:pointer!important;padding:.25rem!important;border-radius:.125rem!important;background-color:transparent;border:none!important;outline:none!important;color:var(--iccandle-border);transition:background-color .2s ease-in-out}.iccandle-scanner-popup__action-btn:hover{background-color:color-mix(in srgb,var(--iccandle-background) 40%,transparent)}.iccandle-scanner-popup__action-btn--with-gap{gap:.25rem!important;padding-left:.25rem!important}@keyframes iccandle-scanner-label-gradient{0%{background-position:0% 50%}to{background-position:200% 50%}}.iccandle-scanner-popup__label{background:linear-gradient(90deg,var(--iccandle-primary) 0%,var(--iccandle-primary-gradient-end) 50%,var(--iccandle-primary) 100%);background-size:200% 100%!important;-webkit-background-clip:text!important;background-clip:text!important;color:transparent;text-wrap:nowrap!important;animation:iccandle-scanner-label-gradient 2s linear infinite}.iccandle-scanner-popup__action-row{display:flex!important;width:100%!important;align-items:center!important;gap:.25rem!important;flex:1!important}.iccandle-scanner-popup__logo{min-width:1.25rem!important;min-height:1.25rem!important}.iccandle-scanner-popup__settings{touch-action:none!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:.25rem!important;cursor:pointer!important;border-radius:.125rem!important;border:none!important;background:transparent;color:inherit}.iccandle-scanner-popup__settings:hover{background-color:color-mix(in srgb,var(--iccandle-background) 40%,transparent)}.iccandle-scanner-popup__toggle{display:flex!important;height:2rem!important;margin-right:.25rem!important;align-items:center!important;justify-content:center!important;gap:.25rem!important;padding-left:.25rem!important;font-size:.75rem!important;font-weight:600!important;color:var(--iccandle-border);transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.iccandle-scanner-popup__toggle:hover{background-color:color-mix(in srgb,var(--iccandle-background) 40%,transparent)}.iccandle-simple-tooltip-wrapper{position:relative!important;display:inline-flex!important}.iccandle-simple-tooltip-trigger{display:inline-flex!important;align-items:flex-start!important;gap:4px!important}.iccandle-simple-tooltip-content{position:absolute!important;left:50%!important;bottom:100%!important;transform:translate(-50%)!important;margin-bottom:4px!important;background-color:var(--iccandle-secondary)!important;color:var(--iccandle-text)!important;padding:4px 6px!important;font-size:12px;line-height:1.25;border-radius:2px!important;border:none!important;box-shadow:0 1px 3px #0000001f!important;z-index:50!important;max-width:240px!important;pointer-events:none!important;text-wrap:nowrap!important}.iccandle-simple-tooltip-content p{margin:0!important}.iccandle-scanner-advanced-options{display:flex!important;flex-direction:column!important;gap:1rem!important;width:100%!important;max-width:20rem!important;margin:1rem 0!important}.iccandle-scanner-advanced-options__row{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.75rem!important}.iccandle-scanner-advanced-options__label{display:flex!important;align-items:center!important;gap:.5rem!important;flex:1!important;min-width:0!important}.iccandle-scanner-advanced-options__native-select-wrap{position:relative!important;display:inline-flex!important;align-items:center!important;flex-shrink:0!important}.iccandle-scanner-advanced-options__native-select-wrap--small{width:6rem!important;min-width:6rem!important}.iccandle-scanner-advanced-options__native-select-wrap--large{width:12rem!important;min-width:12rem!important}.iccandle-scanner-advanced-options__native-select{width:100%!important;height:2.25rem!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0 1rem 0 .5rem!important;border-radius:.375rem!important;background-color:var(--iccandle-background);border:1px solid var(--iccandle-border)!important;color:var(--iccandle-text);font-size:.875rem;cursor:pointer!important}.iccandle-scanner-advanced-options__native-select::-ms-expand{display:none!important}.iccandle-scanner-advanced-options__native-select option,.iccandle-scanner-advanced-options__native-select optgroup{background-color:var(--iccandle-background);color:var(--iccandle-text);font-size:.875rem}.iccandle-scanner-advanced-options__native-select option:checked{background-color:var(--iccandle-border)}.iccandle-scanner-advanced-options__native-select:focus{outline:none!important;border-color:color-mix(in oklab,var(--iccandle-border) 55%,var(--iccandle-text));box-shadow:0 0 0 2px color-mix(in oklab,var(--iccandle-text) 25%,transparent)!important}.iccandle-scanner-advanced-options__native-select:disabled{opacity:.6!important;cursor:not-allowed!important}.iccandle-scanner-advanced-options__select{display:inline-flex!important;align-items:center!important;justify-content:space-between!important;gap:.5rem!important;height:2.25rem!important;padding:0 .5rem!important;border-radius:.375rem!important;background-color:var(--iccandle-background);border:1px solid var(--iccandle-border)!important;color:var(--iccandle-text);font-size:.875rem;cursor:pointer!important;flex-shrink:0!important}.iccandle-scanner-advanced-options__select:hover{border-color:color-mix(in oklab,var(--iccandle-border) 60%,var(--iccandle-text))}.iccandle-scanner-advanced-options__select:focus{outline:none!important;border-color:color-mix(in oklab,var(--iccandle-border) 55%,var(--iccandle-text));box-shadow:0 0 0 2px color-mix(in oklab,var(--iccandle-text) 25%,transparent)!important}.iccandle-scanner-advanced-options__select--open{border-color:color-mix(in oklab,var(--iccandle-border) 50%,var(--iccandle-text))}.iccandle-scanner-advanced-options__select--small{width:6rem!important;min-width:6rem!important}.iccandle-scanner-advanced-options__select--large{width:12rem!important;min-width:12rem!important}.iccandle-scanner-advanced-options__select-value{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-scanner-advanced-options__select-caret{width:0!important;height:0!important;border-left:5px solid transparent!important;border-right:5px solid transparent!important;border-top:6px solid var(--iccandle-text)!important}.iccandle-scanner-advanced-options__menu{position:fixed!important;z-index:60!important;max-height:16rem!important;overflow:auto!important;padding:.25rem!important;border-radius:.75rem!important;background-color:var(--iccandle-background);border:1px solid var(--iccandle-border)!important;box-shadow:0 20px 25px -5px #0003,0 8px 10px -6px #0003!important;-webkit-backdrop-filter:blur(10px)!important;backdrop-filter:blur(10px)!important}.iccandle-scanner-advanced-options__option{width:100%!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.75rem!important;padding:.5rem .75rem!important;border-radius:.625rem!important;color:var(--iccandle-text);background:transparent;border:none!important;cursor:pointer!important;text-align:left!important}.iccandle-scanner-advanced-options__option:hover{background-color:var(--iccandle-background)}.iccandle-scanner-advanced-options__option--selected{background-color:var(--iccandle-border)}.iccandle-scanner-advanced-options__option-label{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-scanner-advanced-options__option-check{width:.75rem!important;height:.75rem!important;border-radius:.25rem!important;background-color:var(--iccandle-text);box-shadow:inset 0 0 0 2px color-mix(in oklab,var(--iccandle-background) 90%,transparent)!important}@media(min-width:640px){.iccandle-scanner-advanced-options{height:434px!important}}.iccandle-forexIcons{position:relative!important;width:24px!important;min-width:24px!important;height:24px!important;min-height:24px!important}.iccandle-forexIcons__img{position:absolute!important;border-radius:9999px!important;border-width:2px!important;border-style:solid!important;border-color:var(--iccandle-background);box-sizing:border-box!important}.iccandle-forexIcons__img--single{top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important}.iccandle-forexIcons__img--left{bottom:0!important;left:0!important;z-index:8!important}.iccandle-forexIcons__img--right{top:0!important;right:0!important}.iccandle-scanner-symbol-search{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important;color:var(--iccandle-text)!important}.iccandle-scanner-symbol-search__bar{position:relative!important;display:flex!important;flex-shrink:0!important;align-items:center!important;gap:.25rem!important;padding:.5rem .75rem!important}.iccandle-scanner-symbol-search__search-icon{width:1rem!important;height:1rem!important}.iccandle-scanner-symbol-search__input{width:100%!important;height:2rem!important;font-size:.875rem;background-color:var(--iccandle-background)}.iccandle-scanner-symbol-search__input:focus{outline:none!important}.iccandle-dark .iccandle-scanner-symbol-search__input{background-color:inherit}.iccandle-scanner-symbol-search__count-badge{position:absolute!important;right:.5rem!important;display:inline-flex!important;align-items:center!important;gap:.25rem!important;padding:.25rem .5rem!important;border:1px solid var(--iccandle-border)!important;border-radius:999px!important;background-color:var(--iccandle-background)}.iccandle-scanner-symbol-search__count-desktop{display:none!important;font-size:.75rem;font-weight:600}.iccandle-scanner-symbol-search__count-mobile{display:block!important;font-size:.75rem;font-weight:400}.iccandle-scanner-symbol-search__types-wrap{flex-shrink:0!important;padding:.5rem .75rem!important}.iccandle-scanner-symbol-search__types-list{display:flex!important;gap:.25rem!important;overflow-x:auto!important}.iccandle-scanner-symbol-search__type-badge{cursor:pointer!important;font-size:.75rem;border:1px solid var(--iccandle-border)!important;border-radius:999px!important;padding:.25rem .5rem!important}.iccandle-scanner-symbol-search__type-badge--active{border-color:var(--iccandle-primary)}.iccandle-scanner-symbol-search__type-badge--inactive{background-color:var(--iccandle-secondary)}.iccandle-scanner-symbol-search__type-label{font-size:.75rem;font-weight:400}.iccandle-scanner-symbol-search__type-label--active{color:var(--iccandle-primary)}.iccandle-scanner-symbol-search__type-label--inactive{color:var(--iccandle-text)}.iccandle-scanner-symbol-search__table-wrap{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important;padding:.5rem .75rem 0!important}.iccandle-scanner-symbol-search__table-head{display:flex!important;flex-shrink:0!important;align-items:center!important;margin-bottom:.5rem!important}.iccandle-scanner-symbol-search__checkbox{width:.75rem!important;height:.75rem!important;margin-right:.5rem!important;flex-shrink:0!important;-webkit-appearance:none!important;appearance:none!important;display:grid!important;place-content:center!important;border:1px solid var(--iccandle-border, #d1d5dc)!important;border-radius:.2rem!important;border-color:var(--iccandle-primary, #00dfb9);background-color:var(--iccandle-background, #ffffff)}.iccandle-scanner-symbol-search__checkbox:checked{background-color:var(--iccandle-primary, #00dfb9);border-color:var(--iccandle-primary, #00dfb9);accent-color:var(--iccandle-primary, #00dfb9)}.iccandle-scanner-symbol-search__checkbox:checked:after{content:""!important;width:.25rem!important;height:.45rem!important;border:2px solid var(--iccandle-background, #ffffff)!important;border-top:0!important;border-left:0!important;transform:translateY(-.02rem) rotate(45deg)!important}.iccandle-scanner-symbol-search__checkbox--row{margin-right:.25rem!important}.iccandle-scanner-symbol-search__symbol-title{width:5rem!important;font-size:.75rem;font-weight:400}.iccandle-scanner-symbol-search__description-title{flex:1!important;font-size:.75rem;font-weight:400}.iccandle-scanner-symbol-search__list-container{display:flex!important;min-height:0!important;flex:1 1 auto!important;overflow:auto!important}.iccandle-scanner-symbol-search__symbol-list{min-width:7rem!important}.iccandle-scanner-symbol-search__symbol-row{display:flex!important;align-items:center!important;gap:.25rem!important;min-height:2.5rem!important;padding:.25rem 0!important}.iccandle-scanner-symbol-search__symbol-name{color:var(--iccandle-text);overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-scanner-symbol-search__description-list{width:100%!important}.iccandle-scanner-symbol-search__description-row{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.25rem!important;width:100%!important;min-height:2.5rem!important;padding:.25rem 0!important}.iccandle-scanner-symbol-search__description-text{flex:1!important;min-width:0!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:1!important;line-clamp:1!important;overflow:hidden!important}.iccandle-scanner-symbol-search__type-text{font-size:.875rem;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-scanner-symbol-search__row-divider{border-color:var(--iccandle-border)}@media(min-width:640px){.iccandle-scanner-symbol-search__bar{gap:.5rem!important;padding:0 1.25rem!important}.iccandle-scanner-symbol-search__search-icon{width:1.25rem!important;height:1.25rem!important}.iccandle-scanner-symbol-search__input{height:2.5rem!important}.iccandle-scanner-symbol-search__count-desktop{display:block!important;font-size:.875rem}.iccandle-scanner-symbol-search__count-mobile{display:none!important}.iccandle-scanner-symbol-search__types-wrap{padding:.75rem 1.25rem!important}.iccandle-scanner-symbol-search__types-list{gap:.5rem!important}.iccandle-scanner-symbol-search__type-badge,.iccandle-scanner-symbol-search__type-label{font-size:.875rem}.iccandle-scanner-symbol-search__table-wrap{padding:.75rem 1.25rem 0!important}.iccandle-scanner-symbol-search__table-head{margin-bottom:.75rem!important}.iccandle-scanner-symbol-search__checkbox{width:1rem!important;height:1rem!important;margin-right:1rem!important}.iccandle-scanner-symbol-search__checkbox--row{margin-right:.5rem!important}.iccandle-scanner-symbol-search__symbol-title{width:8rem!important;font-size:.875rem}.iccandle-scanner-symbol-search__description-title{font-size:.875rem}.iccandle-scanner-symbol-search__symbol-list{min-width:10rem!important}.iccandle-scanner-symbol-search__symbol-row,.iccandle-scanner-symbol-search__description-row{gap:.5rem!important;padding:.5rem 0!important}}@media(min-width:768px){.iccandle-scanner-symbol-search__symbol-title{width:10rem!important}.iccandle-scanner-symbol-search__symbol-list{min-width:12rem!important}}.iccandle-scanner-option{position:fixed!important;inset:0!important;z-index:40!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0 .5rem!important;background-color:hsl(from var(--iccandle-background) h s l / .5)}.iccandle-scanner-option__card{position:relative!important;display:flex!important;width:100%!important;max-width:56rem!important;flex-direction:column!important;padding-bottom:.75rem!important;height:min(80vh,48rem)!important;overflow:hidden!important;background-color:var(--iccandle-background);border-radius:.5rem!important;border:1px solid var(--iccandle-border)!important;color:var(--iccandle-text);box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a!important}.iccandle-scanner-option__form{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important}.iccandle-scanner-option__body{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important;padding:.75rem 0!important}.iccandle-scanner-option__header{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.5rem!important;margin-bottom:.75rem!important;padding:1rem 1.25rem 0!important;font-weight:600;color:var(--iccandle-border)}.iccandle-scanner-option__close-btn{padding:.25rem!important;border-radius:.125rem!important}.iccandle-scanner-option__close-btn:hover{background-color:var(--iccandle-secondary)}.iccandle-scanner-option__tabs{display:grid!important;width:100%!important;max-height:2.5rem!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.25rem!important;padding:.25rem!important;background-color:color-mix(in oklab,var(--iccandle-secondary) 66%,transparent)}.iccandle-scanner-option__tab{position:relative!important;padding:.375rem 0!important;font-size:.875rem;font-weight:600;border-radius:.125rem!important;transition:all .2s ease;cursor:pointer!important}.iccandle-scanner-option__tab--active{background-color:var(--iccandle-background)}.iccandle-scanner-option__tab--inactive:hover{background-color:color-mix(in oklab,var(--iccandle-secondary) 50%,transparent)}.iccandle-scanner-option__advanced-content{padding:0 1.25rem!important}.iccandle-scanner-option__content--visible{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important}.iccandle-scanner-option__advanced-content.iccandle-scanner-option__content--visible{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important}.iccandle-scanner-option__content--hidden{display:none!important}.iccandle-scanner-option__actions{display:flex!important;justify-content:flex-end!important;gap:1rem!important;margin-top:auto!important;padding:.75rem 1rem 0!important;border-top:1px solid var(--iccandle-border)!important}.iccandle-scanner-option__title{color:var(--iccandle-text)}.iccandle-scanner-option__btn{height:2.25rem!important;padding:0 .875rem!important;border-radius:.375rem!important;font-size:.875rem;font-weight:600;cursor:pointer!important;border:1px solid transparent!important}.iccandle-scanner-option__btn--outline{background:transparent;border-color:var(--iccandle-border);color:var(--iccandle-text)}.iccandle-scanner-option__btn--outline:hover{background-color:color-mix(in oklab,var(--iccandle-secondary) 20%,transparent)}.iccandle-scanner-option__btn--primary{background-color:color-mix(in srgb,var(--iccandle-primary) 30%,transparent);color:var(--iccandle-text);border:1px solid var(--iccandle-primary)!important}.iccandle-scanner-option__btn--primary:hover{filter:brightness(.95)}.iccandle-selector-widget{--iccandle-primary: #00dfb9;--iccandle-primary-gradient-end: #ffb84d;--iccandle-background: #ffffff;--iccandle-border: #d1d5dc;--iccandle-text: #000000;--iccandle-secondary: oklch( from var(--iccandle-background) clamp(.92, calc(l - .06) , .98) c h / .92 );font-family:var( --iccandle-font, "Inter Tight", ui-sans-serif, system-ui, sans-serif );position:relative!important;height:100%!important;width:100%!important}.iccandle-selector-widget :where(img,picture,video,canvas,svg){display:revert;max-width:revert}.iccandle-selector-widget__container{height:100%!important;width:100%!important;display:flex!important}.iccandle-selector-widget__iframe{height:100%!important;width:30%!important}@media(max-width:1023px){.iccandle-selector-widget__container{flex-direction:column!important}.iccandle-selector-widget__iframe,.iccandle-selector-widget{width:100%!important}}.iccandle-dark{--iccandle-primary: #00dfb9;--iccandle-primary-gradient-end: #ffb84d;--iccandle-background: #1a1a1a;--iccandle-border: rgba(255, 255, 255, .2);--iccandle-text: #ffffff;--iccandle-secondary: oklch( from var(--iccandle-background) clamp(.22, calc(l + .22) , .34) c h / .92 )}.iccandle-selector-widget__overlay{position:fixed!important;inset:0!important;z-index:8!important}.iccandle-pattern-alert-name{display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;min-height:24rem!important;background-color:var(--iccandle-background)!important;border-radius:1.5rem!important;overflow:hidden!important}.iccandle-pattern-alert-name__header{height:fit-content!important;padding:1rem 1rem 0!important;display:flex!important;flex-direction:column!important;gap:.5rem!important;text-align:left!important}.iccandle-pattern-alert-name__title-row{display:flex!important;align-items:center!important;justify-content:space-between!important}.iccandle-pattern-alert-name__title{display:flex!important;align-items:center!important;gap:.5rem!important;margin:0!important;font-size:1.125rem!important;font-weight:600!important;line-height:1!important;color:var(--iccandle-text)}.iccandle-pattern-alert-name__title-icon{flex-shrink:0!important;color:var(--iccandle-primary)}.iccandle-pattern-alert-name__close-btn{display:flex!important;align-items:center!important;justify-content:center!important;width:2rem!important;height:2rem!important;padding:0!important;border:none!important;border-radius:.375rem!important;background:transparent!important;color:var(--iccandle-text);cursor:pointer!important}.iccandle-pattern-alert-name__close-btn:hover{background-color:color-mix(in oklab,var(--iccandle-secondary) 20%,transparent)}@media(min-width:640px){.iccandle-pattern-alert-name__close-btn{display:none!important}}.iccandle-pattern-alert-name__description{margin:0!important;font-size:.875rem!important;color:color-mix(in oklab,var(--iccandle-text) 70%,transparent)}.iccandle-pattern-alert-name__content{display:flex!important;flex:1!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:1.5rem!important;padding:1rem!important}.iccandle-pattern-alert-name__bell-icon{color:var(--iccandle-primary)}.iccandle-pattern-alert-name__form{width:100%!important}.iccandle-pattern-alert-name__field{display:grid!important;width:100%!important;align-items:center!important;gap:.5rem!important}.iccandle-pattern-alert-name__label{font-size:.875rem!important;font-weight:500!important;color:var(--iccandle-text)}.iccandle-pattern-alert-name__input{width:100%!important;height:2.25rem!important;padding:0 .75rem!important;border:1px solid var(--iccandle-border)!important;border-radius:.375rem!important;font-size:.875rem!important;background-color:var(--iccandle-background);color:var(--iccandle-text)}.iccandle-pattern-alert-name__input::placeholder{color:color-mix(in oklab,var(--iccandle-text) 50%,transparent)}.iccandle-pattern-alert-name__input:focus{outline:none!important;border-color:var(--iccandle-primary)!important}.iccandle-pattern-alert-name__error{margin:0!important;font-size:.75rem!important;color:#ef4444}.iccandle-pattern-alert-name__footer-wrap{height:fit-content!important}@media(min-width:640px){.iccandle-pattern-alert-name__footer-wrap{height:25%!important}}.iccandle-pattern-alert-name__divider{margin:0!important;border:none!important;border-top:1px solid var(--iccandle-border)!important}.iccandle-pattern-alert-name__footer{display:flex!important;width:100%!important;align-items:center!important;justify-content:flex-end!important;gap:1rem!important;padding:1rem!important;font-weight:600!important;color:color-mix(in oklab,var(--iccandle-text) 80%,transparent)}.iccandle-pattern-alert-name__btn{height:2.25rem!important;padding:0 .875rem!important;border-radius:.5rem!important;font-size:.875rem!important;font-weight:600!important;cursor:pointer!important;border:1px solid transparent!important}.iccandle-pattern-alert-name__btn--outline{background:transparent;border-color:var(--iccandle-border)!important;color:var(--iccandle-text)}.iccandle-pattern-alert-name__btn--outline:hover{background-color:color-mix(in oklab,var(--iccandle-secondary) 20%,transparent)}.iccandle-pattern-alert-name__btn--primary{width:fit-content!important;background-color:color-mix(in srgb,var(--iccandle-primary) 30%,transparent);color:var(--iccandle-primary);border:1px solid var(--iccandle-primary)!important}.iccandle-pattern-alert-name__btn--primary:hover:not(:disabled){filter:brightness(.95)}.iccandle-pattern-alert-name__btn--primary:disabled{opacity:.5!important;cursor:not-allowed!important}.iccandle-scanner-timeframe-search{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important}.iccandle-scanner-timeframe-search__bar{position:relative!important;display:flex!important;flex-shrink:0!important;align-items:center!important;gap:.25rem!important;color:var(--iccandle-text)!important}.iccandle-scanner-timeframe-search__search-icon{width:1rem!important;height:1rem!important}.iccandle-scanner-timeframe-search__input{width:100%!important;height:2rem!important;font-size:.875rem;background-color:var(--iccandle-background)}.iccandle-scanner-timeframe-search__input:focus{outline:none!important}.iccandle-dark .iccandle-scanner-timeframe-search__input{background-color:inherit}.iccandle-scanner-timeframe-search__count-badge{position:absolute!important;right:.5rem!important;display:inline-flex!important;align-items:center!important;gap:.25rem!important;padding:.25rem .5rem!important;border:1px solid var(--iccandle-border)!important;border-radius:999px!important;background-color:var(--iccandle-background)}.iccandle-scanner-timeframe-search__count-desktop{display:none!important;font-size:.75rem;font-weight:600}.iccandle-scanner-timeframe-search__count-mobile{display:block!important;font-size:.75rem;font-weight:400}.iccandle-scanner-timeframe-search__types-wrap{flex-shrink:0!important;padding:.5rem .75rem!important}.iccandle-scanner-timeframe-search__types-list{display:flex!important;gap:.25rem!important;overflow-x:auto!important}.iccandle-scanner-timeframe-search__type-badge{cursor:pointer!important;font-size:.75rem;border:1px solid var(--iccandle-border)!important;border-radius:999px!important;padding:.25rem .5rem!important}.iccandle-scanner-timeframe-search__type-badge--active{border-color:var(--iccandle-primary)}.iccandle-scanner-timeframe-search__type-badge--inactive{background-color:var(--iccandle-secondary)}.iccandle-scanner-timeframe-search__type-label{font-size:.75rem;font-weight:400}.iccandle-scanner-timeframe-search__type-label--active{color:var(--iccandle-primary)}.iccandle-scanner-timeframe-search__type-label--inactive{color:var(--iccandle-text)}.iccandle-scanner-timeframe-search__table-wrap{display:flex!important;min-height:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important;padding:1rem 0!important;color:var(--iccandle-text)!important}.iccandle-scanner-timeframe-search__table-head{display:flex!important;flex-shrink:0!important;align-items:center!important;margin-bottom:.5rem!important}.iccandle-scanner-timeframe-search__checkbox{width:.75rem!important;height:.75rem!important;margin-right:.5rem!important;flex-shrink:0!important;-webkit-appearance:none!important;appearance:none!important;display:grid!important;place-content:center!important;border:1px solid var(--iccandle-border, #d1d5dc)!important;border-radius:.2rem!important;border-color:var(--iccandle-primary, #00dfb9);background-color:var(--iccandle-background, #ffffff)}.iccandle-scanner-timeframe-search__checkbox:checked{background-color:var(--iccandle-primary, #00dfb9);border-color:var(--iccandle-primary, #00dfb9);accent-color:var(--iccandle-primary, #00dfb9)}.iccandle-scanner-timeframe-search__checkbox:checked:after{content:""!important;width:.25rem!important;height:.45rem!important;border:2px solid var(--iccandle-background, #ffffff)!important;border-top:0!important;border-left:0!important;transform:translateY(-.02rem) rotate(45deg)!important}.iccandle-scanner-timeframe-search__checkbox--row{margin-right:.25rem!important}.iccandle-scanner-timeframe-search__timeframe-title{width:5rem!important;font-size:.75rem;font-weight:400}.iccandle-scanner-timeframe-search__description-title{flex:1!important;font-size:.75rem;font-weight:400}.iccandle-scanner-timeframe-search__list-container{display:flex!important;min-height:0!important;flex:1 1 auto!important;overflow:auto!important}.iccandle-scanner-timeframe-search__timeframe-list{min-width:7rem!important}.iccandle-scanner-timeframe-search__timeframe-row{display:flex!important;align-items:center!important;gap:.25rem!important;min-height:2.5rem!important;padding:.25rem 0!important}.iccandle-scanner-timeframe-search__timeframe-name{color:var(--iccandle-text);overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-scanner-timeframe-search__description-list{width:100%!important}.iccandle-scanner-timeframe-search__description-row{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.25rem!important;width:100%!important;min-height:2.5rem!important;padding:.25rem 0!important}.iccandle-scanner-timeframe-search__description-text{flex:1!important;min-width:0!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:1!important;line-clamp:1!important;overflow:hidden!important}.iccandle-scanner-timeframe-search__row-divider{border-color:var(--iccandle-border)}@media(min-width:640px){.iccandle-scanner-timeframe-search__bar{gap:.5rem!important}.iccandle-scanner-timeframe-search__search-icon{width:1.25rem!important;height:1.25rem!important}.iccandle-scanner-timeframe-search__input{height:2.5rem!important}.iccandle-scanner-timeframe-search__count-desktop{display:block!important;font-size:.875rem}.iccandle-scanner-timeframe-search__count-mobile{display:none!important}.iccandle-scanner-timeframe-search__types-wrap{padding:.75rem 0!important}.iccandle-scanner-timeframe-search__types-list{gap:.5rem!important}.iccandle-scanner-timeframe-search__type-badge,.iccandle-scanner-timeframe-search__type-label{font-size:.875rem}.iccandle-scanner-timeframe-search__table-head{margin-bottom:.75rem!important}.iccandle-scanner-timeframe-search__checkbox{width:1rem!important;height:1rem!important;margin-right:1rem!important}.iccandle-scanner-timeframe-search__checkbox--row{margin-right:.5rem!important}.iccandle-scanner-timeframe-search__timeframe-title{width:8rem!important;font-size:.875rem}.iccandle-scanner-timeframe-search__description-title{font-size:.875rem}.iccandle-scanner-timeframe-search__timeframe-list{min-width:10rem!important}.iccandle-scanner-timeframe-search__timeframe-row,.iccandle-scanner-timeframe-search__description-row{gap:.5rem!important;padding:.5rem 0!important}}@media(min-width:768px){.iccandle-scanner-timeframe-search__timeframe-title{width:10rem!important}.iccandle-scanner-timeframe-search__timeframe-list{min-width:12rem!important}}.iccandle-timeframes-tab{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;gap:.5rem!important;padding:0 1rem 1rem!important}@media(min-width:640px){.iccandle-timeframes-tab{padding-left:1.5rem!important;padding-right:1.5rem!important}}.iccandle-timeframes-tab__search-wrap{min-height:0!important;flex:1 1 auto!important;overflow:hidden!important;border-radius:.5rem!important;border:1px solid var(--iccandle-border)!important}.iccandle-symbols-tab{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;gap:.5rem!important;padding:0 1rem 1rem!important}@media(min-width:640px){.iccandle-symbols-tab{padding-left:1.5rem!important;padding-right:1.5rem!important}}.iccandle-symbols-tab__search-wrap{min-height:0!important;flex:1 1 auto!important;overflow:hidden!important;border-radius:.5rem!important;border:1px solid var(--iccandle-border)!important}.iccandle-time-config-section{display:flex!important;flex-direction:column!important;gap:1rem!important;height:100%!important;max-width:100%!important;min-width:0!important;font-size:.875rem!important;color:var(--iccandle-text);overflow-x:hidden!important;overflow-y:auto!important}.iccandle-time-config-section__header{padding:.5rem 1rem!important;border-bottom:1px solid var(--iccandle-border)!important}.iccandle-time-config-section__title{margin:0!important;font-size:1.125rem!important;font-weight:600!important;color:var(--iccandle-text)}.iccandle-time-config-section__description{margin:.25rem 0 0!important;font-size:.875rem!important;color:color-mix(in oklab,var(--iccandle-text) 55%,transparent)}.iccandle-time-config-section__fields{display:flex!important;flex-direction:column!important;gap:.75rem!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:0 1rem!important}@media(min-width:640px){.iccandle-time-config-section__fields{flex-direction:row!important;align-items:center!important}}.iccandle-time-config-section__field,.iccandle-time-config-section__timezone{display:flex!important;flex-direction:column!important;gap:.25rem!important;min-width:0!important;flex:1 1 auto!important}.iccandle-time-config-section__timezone{padding:0 1rem 1rem!important}.iccandle-time-config-section__label{font-size:.75rem!important;font-weight:500!important;color:color-mix(in oklab,var(--iccandle-text) 65%,transparent)}.iccandle-time-config-section__input{height:2.25rem!important;width:100%!important;padding:.25rem .75rem!important;border:1px solid var(--iccandle-border)!important;border-radius:.375rem!important;font-size:.875rem!important;color:var(--iccandle-text);background-color:var(--iccandle-background)}.iccandle-time-config-section__input:disabled{opacity:.5!important;cursor:not-allowed!important}.iccandle-time-config-section__select-wrap{position:relative!important}.iccandle-time-config-section__select-wrap--open{z-index:100!important}.iccandle-time-config-section__select-btn{display:flex!important;align-items:center!important;justify-content:space-between!important;width:100%!important;height:2.5rem!important;padding:.5rem .75rem!important;border:1px solid var(--iccandle-border)!important;border-radius:.375rem!important;font-size:.875rem!important;text-align:left!important;color:var(--iccandle-text);background-color:var(--iccandle-background);cursor:pointer!important}.iccandle-time-config-section__select-btn:disabled{opacity:.5!important;cursor:not-allowed!important}.iccandle-time-config-section__select-label{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-time-config-section__dropdown{position:absolute!important;inset-inline:0!important;z-index:50!important;margin-top:.25rem!important;width:100%!important;border:1px solid var(--iccandle-border)!important;border-radius:.375rem!important;background-color:var(--iccandle-background);box-shadow:0 4px 12px color-mix(in oklab,var(--iccandle-text) 12%,transparent)!important}.iccandle-time-config-section__dropdown-header{padding:.5rem .75rem!important;border-bottom:1px solid var(--iccandle-border)!important}.iccandle-time-config-section__dropdown-title{margin:0!important;font-size:.875rem!important;font-weight:500!important;color:var(--iccandle-text)}.iccandle-time-config-section__dropdown-subtitle{margin:.125rem 0 0!important;font-size:.75rem!important;color:color-mix(in oklab,var(--iccandle-text) 55%,transparent)}.iccandle-time-config-section__dropdown-search{padding:.5rem!important;border-bottom:1px solid var(--iccandle-border)!important}.iccandle-time-config-section__dropdown-search-input{width:100%!important;height:2rem!important;padding:0 .5rem!important;border:1px solid var(--iccandle-border)!important;border-radius:.25rem!important;font-size:.875rem!important;color:var(--iccandle-text);background-color:var(--iccandle-background)}.iccandle-time-config-section__dropdown-search-input:focus{outline:none!important;border-color:var(--iccandle-primary, #00dfb9)!important}.iccandle-time-config-section__dropdown-list{max-height:40vh!important;margin:0!important;padding:.25rem 0!important;list-style:none!important;overflow-y:auto!important}.iccandle-time-config-section__dropdown-group-label{padding:.375rem .75rem!important;font-size:.75rem!important;font-weight:500!important;color:color-mix(in oklab,var(--iccandle-text) 55%,transparent)}.iccandle-time-config-section__dropdown-item{display:flex!important;align-items:center!important;width:100%!important;padding:.5rem .75rem!important;border:none!important;font-size:.875rem!important;text-align:left!important;color:var(--iccandle-text);background-color:transparent;cursor:pointer!important}.iccandle-time-config-section__dropdown-item:hover,.iccandle-time-config-section__dropdown-item--selected{background-color:color-mix(in oklab,var(--iccandle-text) 6%,transparent)!important}.iccandle-time-config-section__dropdown-empty{padding:.75rem!important;font-size:.875rem!important;text-align:center!important;color:color-mix(in oklab,var(--iccandle-text) 55%,transparent)}.iccandle-time-config-section__check{width:1rem!important;height:1rem!important;margin-right:.5rem!important;opacity:0!important}.iccandle-time-config-section__check--visible{opacity:1!important}.iccandle-pattern-alert-settings{display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;min-height:0!important;max-width:100%!important;min-width:0!important;gap:.5rem!important;overflow:hidden!important;background-color:var(--iccandle-background)!important;border-radius:1.5rem!important}@media(min-width:640px){.iccandle-pattern-alert-settings{gap:.75rem!important}}.iccandle-pattern-alert-settings__header-row{display:flex!important;align-items:flex-start!important;gap:.5rem!important;padding:1rem 1rem 0!important}@media(min-width:640px){.iccandle-pattern-alert-settings__header-row{align-items:center!important;gap:1rem!important}}.iccandle-pattern-alert-settings__header-icon{flex-shrink:0!important;margin-top:.125rem!important;color:var(--iccandle-primary)}@media(min-width:640px){.iccandle-pattern-alert-settings__header-icon{margin-top:0!important}}.iccandle-pattern-alert-settings__header{height:fit-content!important;width:100%!important;min-width:0!important;display:flex!important;flex-direction:column!important;gap:.5rem!important;text-align:left!important}.iccandle-pattern-alert-settings__title-row{display:flex!important;width:100%!important;align-items:flex-start!important;justify-content:space-between!important;gap:.5rem!important}@media(min-width:640px){.iccandle-pattern-alert-settings__title-row{align-items:center!important}}.iccandle-pattern-alert-settings__title{min-width:0!important;margin:0!important;font-size:1rem!important;font-weight:600!important;line-height:1.25!important;color:var(--iccandle-text)}@media(min-width:640px){.iccandle-pattern-alert-settings__title{font-size:1.125rem!important}}.iccandle-pattern-alert-settings__title-text{display:block!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.iccandle-pattern-alert-settings__close-btn{display:flex!important;flex-shrink:0!important;align-items:center!important;justify-content:center!important;width:2rem!important;height:2rem!important;padding:0!important;border:none!important;border-radius:.375rem!important;background:transparent!important;color:var(--iccandle-text);cursor:pointer!important}.iccandle-pattern-alert-settings__close-btn:hover{background-color:color-mix(in oklab,var(--iccandle-background) 20%,transparent)}@media(min-width:640px){.iccandle-pattern-alert-settings__close-btn{display:none!important}}.iccandle-pattern-alert-settings__description{margin:0!important;font-size:.875rem!important;text-align:left!important;color:color-mix(in oklab,var(--iccandle-text) 70%,transparent)}.iccandle-pattern-alert-settings__form{display:flex!important;height:100%!important;min-height:0!important;max-width:100%!important;min-width:0!important;flex:1 1 auto!important;flex-direction:column!important;overflow:hidden!important}.iccandle-pattern-alert-settings__tabs{display:flex!important;height:100%!important;min-height:0!important;width:100%!important;max-width:100%!important;min-width:0!important;flex:1 1 auto!important;flex-direction:column!important;gap:0!important}.iccandle-pattern-alert-settings__tabs-list{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;height:auto!important;max-width:100%!important;min-width:0!important;margin:0 1rem!important;padding:.25rem!important;border-radius:.5rem!important;background-color:color-mix(in oklab,var(--iccandle-border) 40%,var(--iccandle-background))!important;width:auto!important}.iccandle-pattern-alert-settings__tab-trigger{display:inline-flex!important;align-items:center!important;justify-content:center!important;height:100%!important;padding:.25rem!important;border:1px solid transparent!important;border-radius:.375rem!important;font-size:.6875rem!important;font-weight:500!important;color:color-mix(in oklab,var(--iccandle-text) 60%,transparent);background:transparent!important;cursor:pointer!important;transition:color .15s ease,background-color .15s ease!important}@media(min-width:640px){.iccandle-pattern-alert-settings__tab-trigger{justify-content:flex-start!important;font-size:.875rem!important}}.iccandle-pattern-alert-settings__tab-trigger[data-state=active]{color:var(--iccandle-text)!important;background-color:var(--iccandle-background)!important;border-color:var(--iccandle-border)!important;box-shadow:0 1px 2px color-mix(in oklab,var(--iccandle-text) 8%,transparent)!important}.iccandle-pattern-alert-settings__tab-trigger:disabled{opacity:.5!important;pointer-events:none!important;cursor:not-allowed!important}.iccandle-pattern-alert-settings__tab-label--mobile{display:inline!important}.iccandle-pattern-alert-settings__tab-label--desktop{display:none!important;flex-direction:column!important;align-items:flex-start!important;gap:.25rem!important;margin-left:.5rem!important;margin-right:auto!important}@media(min-width:640px){.iccandle-pattern-alert-settings__tab-label--mobile{display:none!important}.iccandle-pattern-alert-settings__tab-label--desktop{display:flex!important}}.iccandle-pattern-alert-settings__tab-step{font-size:.75rem!important;color:color-mix(in oklab,var(--iccandle-text) 55%,transparent)}.iccandle-pattern-alert-settings__tabs-content-wrap{display:flex!important;flex-direction:column!important;min-height:0!important;width:100%!important;max-width:100%!important;min-width:0!important;flex:1 1 auto!important;overflow:hidden!important;padding-top:1rem!important}@media(min-width:640px){.iccandle-pattern-alert-settings__tabs-content-wrap{padding-top:1.5rem!important}}.iccandle-pattern-alert-settings__tab-content{display:flex!important;flex-direction:column!important;margin-top:0!important;height:100%!important;min-height:0!important;min-width:0!important;flex:1 1 auto!important;overflow:hidden!important}.iccandle-pattern-alert-settings__footer{display:flex!important;height:fit-content!important;max-width:100%!important;min-width:0!important;flex-direction:column!important;gap:.5rem!important;border-top:1px solid var(--iccandle-border)!important}@media(min-width:640px){.iccandle-pattern-alert-settings__footer{flex-direction:row!important;align-items:center!important;justify-content:space-between!important}}.iccandle-pattern-alert-settings__error{max-width:100%!important;min-width:0!important;margin:0!important;padding:0 1rem!important;font-size:.875rem!important;font-weight:500!important;color:#ef4444;overflow-wrap:break-word!important;opacity:0!important;transition:opacity 1s ease-in-out!important}.iccandle-pattern-alert-settings__error--visible{opacity:1!important}@media(min-width:640px){.iccandle-pattern-alert-settings__error{font-size:1rem!important;white-space:nowrap!important}}.iccandle-pattern-alert-settings__actions{display:flex!important;width:100%!important;align-items:center!important;justify-content:flex-end!important;gap:.75rem!important;padding:0 1rem 1rem!important;font-weight:600!important;color:color-mix(in oklab,var(--iccandle-text) 80%,transparent)}@media(min-width:640px){.iccandle-pattern-alert-settings__actions{gap:1rem!important;padding:1rem!important}}.iccandle-pattern-alert-settings__btn{height:2.25rem!important;width:100%!important;padding:0 .875rem!important;border-radius:.5rem!important;font-size:.875rem!important;font-weight:600!important;cursor:pointer!important;border:1px solid transparent!important}@media(min-width:640px){.iccandle-pattern-alert-settings__btn{width:fit-content!important}}.iccandle-pattern-alert-settings__btn--outline{background:transparent;border-color:var(--iccandle-border)!important;color:var(--iccandle-text)}.iccandle-pattern-alert-settings__btn--outline:hover{background-color:color-mix(in oklab,var(--iccandle-background) 20%,transparent)}.iccandle-pattern-alert-settings__btn--primary{background-color:var(--iccandle-primary)!important;color:var(--iccandle-background)!important;border-color:var(--iccandle-primary)!important}.iccandle-pattern-alert-settings__btn--primary:hover:not(:disabled){filter:brightness(.95)}.iccandle-pattern-alert-settings__btn--primary:disabled{opacity:.5!important;cursor:not-allowed!important}.iccandle-pattern-tracker-modal{position:fixed!important;inset:0!important;z-index:50!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:1rem!important;background-color:#00000080!important}.iccandle-pattern-tracker-modal__content{position:relative!important;display:flex!important;flex-direction:column!important;width:100%!important;max-width:calc(100% - 2rem)!important;padding:0!important;border-radius:1.5rem!important;overflow:hidden!important;outline:none!important;box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a!important}@media(min-width:640px){.iccandle-pattern-tracker-modal__content{max-height:90%!important;max-width:425px!important}}.iccandle-pattern-tracker-modal__content--settings{height:100%!important;max-width:56rem!important}.iccandle-event-info-modal{position:fixed!important;inset:0!important;z-index:60!important}.iccandle-event-info-modal__dialog{position:fixed!important;width:302px!important;padding:1.5rem!important;border-radius:.375rem!important;border:1px solid var(--iccandle-border)!important;background:var(--iccandle-background)!important;color:var(--iccandle-text)!important;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a!important;box-sizing:border-box!important}.iccandle-event-info-modal__header{display:flex!important;align-items:center!important;justify-content:space-between!important;margin-bottom:1rem!important;gap:.5rem!important}.iccandle-event-info-modal__title-row{display:flex!important;align-items:center!important;gap:.5rem!important;min-width:0!important}.iccandle-event-info-modal__title{margin:0!important;font-size:1.125rem!important;font-weight:700!important;line-height:1.4!important;overflow:hidden!important;text-overflow:ellipsis!important}.iccandle-event-info-modal__close{display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:.25rem!important;border:none!important;border-radius:.125rem!important;background:transparent!important;color:inherit!important;cursor:pointer!important;flex-shrink:0!important}.iccandle-event-info-modal__close:hover{background:color-mix(in srgb,var(--iccandle-text) 8%,transparent)!important}.iccandle-event-info-modal__date{margin:0 0 1rem!important;font-size:.875rem!important;color:color-mix(in srgb,var(--iccandle-text) 60%,transparent)!important}.iccandle-event-info-modal__rows{display:flex!important;flex-direction:column!important;gap:.5rem!important;font-size:.875rem!important}.iccandle-event-info-modal__row{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:.75rem!important}.iccandle-event-info-modal__label{color:color-mix(in srgb,var(--iccandle-text) 55%,transparent)!important}.iccandle-event-info-modal__value{font-weight:600!important;color:var(--iccandle-text)!important}.iccandle-event-info-modal__actions{display:flex!important;flex-direction:column-reverse!important;gap:.5rem!important;margin-top:1.5rem!important}.iccandle-event-info-modal__actions .iccandle-event-info-modal__btn{width:100%!important}@media(min-width:640px){.iccandle-event-info-modal__actions{flex-direction:row!important;justify-content:flex-end!important}.iccandle-event-info-modal__actions .iccandle-event-info-modal__btn{width:auto!important}}.iccandle-event-info-modal__loading,.iccandle-event-info-modal__empty{display:flex!important;align-items:center!important;justify-content:center!important;min-height:12rem!important;min-width:16rem!important;padding:2rem 0!important;font-size:.875rem!important;color:color-mix(in srgb,var(--iccandle-text) 55%,transparent)!important;text-align:center!important}.iccandle-event-info-modal__spinner{width:1.5rem!important;height:1.5rem!important;animation:iccandle-event-info-spin .8s linear infinite!important}@keyframes iccandle-event-info-spin{to{transform:rotate(360deg)}}')),document.head.appendChild(t)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
|
|
2
2
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),Dn=require("react-dom");function Go(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const I=Go(w),Bo=Go(Dn);function nc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bn={exports:{}},yn={};var Za;function ic(){if(Za)return yn;Za=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,a,r){var o=null;if(r!==void 0&&(o=""+r),a.key!==void 0&&(o=""+a.key),"key"in a){r={};for(var s in a)s!=="key"&&(r[s]=a[s])}else r=a;return a=r.ref,{$$typeof:e,type:i,key:o,ref:a!==void 0?a:null,props:r}}return yn.Fragment=t,yn.jsx=n,yn.jsxs=n,yn}var bn={};var Qa;function ac(){return Qa||(Qa=1,process.env.NODE_ENV!=="production"&&(function(){function e(N){if(N==null)return null;if(typeof N=="function")return N.$$typeof===H?null:N.displayName||N.name||null;if(typeof N=="string")return N;switch(N){case b:return"Fragment";case k:return"Profiler";case P:return"StrictMode";case A:return"Suspense";case x:return"SuspenseList";case L:return"Activity"}if(typeof N=="object")switch(typeof N.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),N.$$typeof){case y:return"Portal";case v:return N.displayName||"Context";case T:return(N._context.displayName||"Context")+".Consumer";case g:var z=N.render;return N=N.displayName,N||(N=z.displayName||z.name||"",N=N!==""?"ForwardRef("+N+")":"ForwardRef"),N;case S:return z=N.displayName||null,z!==null?z:e(N.type)||"Memo";case D:z=N._payload,N=N._init;try{return e(N(z))}catch{}}return null}function t(N){return""+N}function n(N){try{t(N);var z=!1}catch{z=!0}if(z){z=console;var B=z.error,U=typeof Symbol=="function"&&Symbol.toStringTag&&N[Symbol.toStringTag]||N.constructor.name||"Object";return B.call(z,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",U),t(N)}}function i(N){if(N===b)return"<>";if(typeof N=="object"&&N!==null&&N.$$typeof===D)return"<...>";try{var z=e(N);return z?"<"+z+">":"<...>"}catch{return"<...>"}}function a(){var N=j.A;return N===null?null:N.getOwner()}function r(){return Error("react-stack-top-frame")}function o(N){if(G.call(N,"key")){var z=Object.getOwnPropertyDescriptor(N,"key").get;if(z&&z.isReactWarning)return!1}return N.key!==void 0}function s(N,z){function B(){F||(F=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",z))}B.isReactWarning=!0,Object.defineProperty(N,"key",{get:B,configurable:!0})}function u(){var N=e(this.type);return W[N]||(W[N]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),N=this.props.ref,N!==void 0?N:null}function c(N,z,B,U,_,X){var J=B.ref;return N={$$typeof:p,type:N,key:z,props:B,_owner:U},(J!==void 0?J:null)!==null?Object.defineProperty(N,"ref",{enumerable:!1,get:u}):Object.defineProperty(N,"ref",{enumerable:!1,value:null}),N._store={},Object.defineProperty(N._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(N,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(N,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:_}),Object.defineProperty(N,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(N.props),Object.freeze(N)),N}function d(N,z,B,U,_,X){var J=z.children;if(J!==void 0)if(U)if(q(J)){for(U=0;U<J.length;U++)l(J[U]);Object.freeze&&Object.freeze(J)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else l(J);if(G.call(z,"key")){J=e(N);var $=Object.keys(z).filter(function(le){return le!=="key"});U=0<$.length?"{key: someKey, "+$.join(": ..., ")+": ...}":"{key: someKey}",E[J+U]||($=0<$.length?"{"+$.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
3
3
|
let props = %s;
|
|
4
4
|
<%s {...props} />
|
|
@@ -119,4 +119,4 @@ by subscribing annually`,monthly:"Monthly",yearly:"Yearly",yearlyBadge:"-20%",co
|
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
|
|
122
|
-
`,tg=[{name:"All",value:"all"},{name:"Forex",value:"forex"},{name:"Crypto",value:"crypto"},{name:"Indices",value:"indices"},{name:"Commodities",value:"commodity"},{name:"Stock",value:"stock"}],ng={interval:"60"},ig={D:"1440",H4:"240",H2:"120",H1:"60",M30:"30",M15:"15",M5:"5",M1:"1"};function xs(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=xs(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Ps(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=xs(e))&&(i&&(i+=" "),i+=t);return i}const ag=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},rg=(e,t)=>({classGroupId:e,validator:t}),Ss=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ii="-",Wr=[],og="arbitrary..",sg=e=>{const t=cg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return lg(o);const s=o.split(ii),u=s[0]===""&&s.length>1?1:0;return Ts(s,u,t)},getConflictingClassGroupIds:(o,s)=>{if(s){const u=i[o],c=n[o];return u?c?ag(c,u):u:c||Wr}return n[o]||Wr}}},Ts=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],r=n.nextPart.get(a);if(r){const c=Ts(e,t+1,r);if(c)return c}const o=n.validators;if(o===null)return;const s=t===0?e.join(ii):e.slice(t).join(ii),u=o.length;for(let c=0;c<u;c++){const d=o[c];if(d.validator(s))return d.classGroupId}},lg=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?og+i:void 0})(),cg=e=>{const{theme:t,classGroups:n}=e;return ug(n,t)},ug=(e,t)=>{const n=Ss();for(const i in e){const a=e[i];Na(a,n,i,t)}return n},Na=(e,t,n,i)=>{const a=e.length;for(let r=0;r<a;r++){const o=e[r];dg(o,t,n,i)}},dg=(e,t,n,i)=>{if(typeof e=="string"){hg(e,t,n);return}if(typeof e=="function"){pg(e,t,n,i);return}mg(e,t,n,i)},hg=(e,t,n)=>{const i=e===""?t:ks(t,e);i.classGroupId=n},pg=(e,t,n,i)=>{if(fg(e)){Na(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(rg(n,e))},mg=(e,t,n,i)=>{const a=Object.entries(e),r=a.length;for(let o=0;o<r;o++){const[s,u]=a[o];Na(u,ks(t,s),n,i)}},ks=(e,t)=>{let n=e;const i=t.split(ii),a=i.length;for(let r=0;r<a;r++){const o=i[r];let s=n.nextPart.get(o);s||(s=Ss(),n.nextPart.set(o,s)),n=s}return n},fg=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,gg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const a=(r,o)=>{n[r]=o,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(r){let o=n[r];if(o!==void 0)return o;if((o=i[r])!==void 0)return a(r,o),o},set(r,o){r in n?n[r]=o:a(r,o)}}},aa="!",qr=":",yg=[],_r=(e,t,n,i,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:a}),bg=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=a=>{const r=[];let o=0,s=0,u=0,c;const d=a.length;for(let y=0;y<d;y++){const b=a[y];if(o===0&&s===0){if(b===qr){r.push(a.slice(u,y)),u=y+1;continue}if(b==="/"){c=y;continue}}b==="["?o++:b==="]"?o--:b==="("?s++:b===")"&&s--}const l=r.length===0?a:a.slice(u);let m=l,f=!1;l.endsWith(aa)?(m=l.slice(0,-1),f=!0):l.startsWith(aa)&&(m=l.slice(1),f=!0);const p=c&&c>u?c-u:void 0;return _r(r,f,m,p)};if(t){const a=t+qr,r=i;i=o=>o.startsWith(a)?r(o.slice(a.length)):_r(yg,!1,o,void 0,!0)}if(n){const a=i;i=r=>n({className:r,parseClassName:a})}return i},vg=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let a=[];for(let r=0;r<n.length;r++){const o=n[r],s=o[0]==="[",u=t.has(o);s||u?(a.length>0&&(a.sort(),i.push(...a),a=[]),i.push(o)):a.push(o)}return a.length>0&&(a.sort(),i.push(...a)),i}},wg=e=>({cache:gg(e.cacheSize),parseClassName:bg(e),sortModifiers:vg(e),...sg(e)}),xg=/\s+/,Pg=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:a,sortModifiers:r}=t,o=[],s=e.trim().split(xg);let u="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:l,modifiers:m,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:y}=n(d);if(l){u=d+(u.length>0?" "+u:u);continue}let b=!!y,P=i(b?p.substring(0,y):p);if(!P){if(!b){u=d+(u.length>0?" "+u:u);continue}if(P=i(p),!P){u=d+(u.length>0?" "+u:u);continue}b=!1}const k=m.length===0?"":m.length===1?m[0]:r(m).join(":"),T=f?k+aa:k,v=T+P;if(o.indexOf(v)>-1)continue;o.push(v);const g=a(P,b);for(let A=0;A<g.length;++A){const x=g[A];o.push(T+x)}u=d+(u.length>0?" "+u:u)}return u},Sg=(...e)=>{let t=0,n,i,a="";for(;t<e.length;)(n=e[t++])&&(i=Cs(n))&&(a&&(a+=" "),a+=i);return a},Cs=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=Cs(e[i]))&&(n&&(n+=" "),n+=t);return n},Tg=(e,...t)=>{let n,i,a,r;const o=u=>{const c=t.reduce((d,l)=>l(d),e());return n=wg(c),i=n.cache.get,a=n.cache.set,r=s,s(u)},s=u=>{const c=i(u);if(c)return c;const d=Pg(u,n);return a(u,d),d};return r=o,(...u)=>r(Sg(...u))},kg=[],je=e=>{const t=n=>n[e]||kg;return t.isThemeGetter=!0,t},As=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ns=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Cg=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ag=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ng=/\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$/,Dg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Rg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Eg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gt=e=>Cg.test(e),he=e=>!!e&&!Number.isNaN(Number(e)),Bt=e=>!!e&&Number.isInteger(Number(e)),zi=e=>e.endsWith("%")&&he(e.slice(0,-1)),Rt=e=>Ag.test(e),Ds=()=>!0,Og=e=>Ng.test(e)&&!Dg.test(e),Da=()=>!1,Mg=e=>Rg.test(e),Ig=e=>Eg.test(e),Lg=e=>!ie(e)&&!ae(e),Fg=e=>Ht(e,Os,Da),ie=e=>As.test(e),_t=e=>Ht(e,Ms,Og),Vr=e=>Ht(e,Wg,he),Gg=e=>Ht(e,Ls,Ds),Bg=e=>Ht(e,Is,Da),Kr=e=>Ht(e,Rs,Da),jg=e=>Ht(e,Es,Ig),qn=e=>Ht(e,Fs,Mg),ae=e=>Ns.test(e),Pn=e=>en(e,Ms),Ug=e=>en(e,Is),Jr=e=>en(e,Rs),zg=e=>en(e,Os),Yg=e=>en(e,Es),_n=e=>en(e,Fs,!0),Hg=e=>en(e,Ls,!0),Ht=(e,t,n)=>{const i=As.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},en=(e,t,n=!1)=>{const i=Ns.exec(e);return i?i[1]?t(i[1]):n:!1},Rs=e=>e==="position"||e==="percentage",Es=e=>e==="image"||e==="url",Os=e=>e==="length"||e==="size"||e==="bg-size",Ms=e=>e==="length",Wg=e=>e==="number",Is=e=>e==="family-name",Ls=e=>e==="number"||e==="weight",Fs=e=>e==="shadow",qg=()=>{const e=je("color"),t=je("font"),n=je("text"),i=je("font-weight"),a=je("tracking"),r=je("leading"),o=je("breakpoint"),s=je("container"),u=je("spacing"),c=je("radius"),d=je("shadow"),l=je("inset-shadow"),m=je("text-shadow"),f=je("drop-shadow"),p=je("blur"),y=je("perspective"),b=je("aspect"),P=je("ease"),k=je("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],g=()=>[...v(),ae,ie],A=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],S=()=>[ae,ie,u],D=()=>[Gt,"full","auto",...S()],L=()=>[Bt,"none","subgrid",ae,ie],H=()=>["auto",{span:["full",Bt,ae,ie]},Bt,ae,ie],j=()=>[Bt,"auto",ae,ie],G=()=>["auto","min","max","fr",ae,ie],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...S()],W=()=>[Gt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],Q=()=>[Gt,"screen","full","dvw","lvw","svw","min","max","fit",...S()],se=()=>[Gt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],E=()=>[e,ae,ie],N=()=>[...v(),Jr,Kr,{position:[ae,ie]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",zg,Fg,{size:[ae,ie]}],U=()=>[zi,Pn,_t],_=()=>["","none","full",c,ae,ie],X=()=>["",he,Pn,_t],J=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[he,zi,Jr,Kr],le=()=>["","none",p,ae,ie],pe=()=>["none",he,ae,ie],V=()=>["none",he,ae,ie],xe=()=>[he,ae,ie],Ee=()=>[Gt,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Rt],breakpoint:[Rt],color:[Ds],container:[Rt],"drop-shadow":[Rt],ease:["in","out","in-out"],font:[Lg],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Rt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Rt],shadow:[Rt],spacing:["px",he],text:[Rt],"text-shadow":[Rt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gt,ie,ae,b]}],container:["container"],columns:[{columns:[he,ie,ae,s]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:g()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{"inset-s":D(),start:D()}],end:[{"inset-e":D(),end:D()}],"inset-bs":[{"inset-bs":D()}],"inset-be":[{"inset-be":D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[Bt,"auto",ae,ie]}],basis:[{basis:[Gt,"full","auto",s,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[he,Gt,"auto","initial","none",ie]}],grow:[{grow:["",he,ae,ie]}],shrink:[{shrink:["",he,ae,ie]}],order:[{order:[Bt,"first","last","none",ae,ie]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...Q()]}],"min-inline-size":[{"min-inline":["auto",...Q()]}],"max-inline-size":[{"max-inline":["none",...Q()]}],"block-size":[{block:["auto",...se()]}],"min-block-size":[{"min-block":["auto",...se()]}],"max-block-size":[{"max-block":["none",...se()]}],w:[{w:[s,"screen",...W()]}],"min-w":[{"min-w":[s,"screen","none",...W()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,Pn,_t]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Hg,Gg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zi,ie]}],"font-family":[{font:[Ug,Bg,t]}],"font-features":[{"font-features":[ie]}],"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:[a,ae,ie]}],"line-clamp":[{"line-clamp":[he,"none",ae,Vr]}],leading:[{leading:[r,...S()]}],"list-image":[{"list-image":["none",ae,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ae,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[he,"from-font","auto",ae,_t]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[he,"auto",ae,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ae,ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ae,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bt,ae,ie],radial:["",ae,ie],conic:[Bt,ae,ie]},Yg,jg]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:_()}],"rounded-s":[{"rounded-s":_()}],"rounded-e":[{"rounded-e":_()}],"rounded-t":[{"rounded-t":_()}],"rounded-r":[{"rounded-r":_()}],"rounded-b":[{"rounded-b":_()}],"rounded-l":[{"rounded-l":_()}],"rounded-ss":[{"rounded-ss":_()}],"rounded-se":[{"rounded-se":_()}],"rounded-ee":[{"rounded-ee":_()}],"rounded-es":[{"rounded-es":_()}],"rounded-tl":[{"rounded-tl":_()}],"rounded-tr":[{"rounded-tr":_()}],"rounded-br":[{"rounded-br":_()}],"rounded-bl":[{"rounded-bl":_()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[he,ae,ie]}],"outline-w":[{outline:["",he,Pn,_t]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",d,_n,qn]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",l,_n,qn]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[he,_t]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",m,_n,qn]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[he,ae,ie]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[he]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[ae,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[he]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ae,ie]}],filter:[{filter:["","none",ae,ie]}],blur:[{blur:le()}],brightness:[{brightness:[he,ae,ie]}],contrast:[{contrast:[he,ae,ie]}],"drop-shadow":[{"drop-shadow":["","none",f,_n,qn]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",he,ae,ie]}],"hue-rotate":[{"hue-rotate":[he,ae,ie]}],invert:[{invert:["",he,ae,ie]}],saturate:[{saturate:[he,ae,ie]}],sepia:[{sepia:["",he,ae,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",ae,ie]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[he,ae,ie]}],"backdrop-contrast":[{"backdrop-contrast":[he,ae,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",he,ae,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[he,ae,ie]}],"backdrop-invert":[{"backdrop-invert":["",he,ae,ie]}],"backdrop-opacity":[{"backdrop-opacity":[he,ae,ie]}],"backdrop-saturate":[{"backdrop-saturate":[he,ae,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",he,ae,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ae,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[he,"initial",ae,ie]}],ease:[{ease:["linear","initial",P,ae,ie]}],delay:[{delay:[he,ae,ie]}],animate:[{animate:["none",k,ae,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,ae,ie]}],"perspective-origin":[{"perspective-origin":g()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[ae,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:g()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ae,ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",ae,ie]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[he,Pn,_t,Vr]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},_g=Tg(qg);function ft(...e){return _g(Ps(e))}function Vg(e,t){let n;return(i,a)=>{clearTimeout(n),n=setTimeout(()=>e(i,a),t)}}const ln=(e,t)=>{if(t==="1D"||t==="D"||t==="1440"){const n=new Date(e*1e3);return n.setUTCHours(0,0,0,0),n.getTime()}return e.toString().length>11?e:e*1e3};var Ln=e=>e.type==="checkbox",Xt=e=>e instanceof Date,et=e=>e==null;const Gs=e=>typeof e=="object";var Ge=e=>!et(e)&&!Array.isArray(e)&&Gs(e)&&!Xt(e),Bs=e=>Ge(e)&&e.target?Ln(e.target)?e.target.checked:e.target.value:e,Kg=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,js=(e,t)=>e.has(Kg(t)),Jg=e=>{const t=e.constructor&&e.constructor.prototype;return Ge(t)&&t.hasOwnProperty("isPrototypeOf")},Ra=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Le(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Ra&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Ge(e)&&Jg(e)))return e;const i=n?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(i[a]=Le(e[a]));return i}var wi=e=>/^\w*$/.test(e),Re=e=>e===void 0,Ea=e=>Array.isArray(e)?e.filter(Boolean):[],Oa=e=>Ea(e.replace(/["|']|\]/g,"").split(/\.|\[/)),te=(e,t,n)=>{if(!t||!Ge(e))return n;const i=(wi(t)?[t]:Oa(t)).reduce((a,r)=>et(a)?a:a[r],e);return Re(i)||i===e?Re(e[t])?n:e[t]:i},it=e=>typeof e=="boolean",Je=e=>typeof e=="function",Ae=(e,t,n)=>{let i=-1;const a=wi(t)?[t]:Oa(t),r=a.length,o=r-1;for(;++i<r;){const s=a[i];let u=n;if(i!==o){const c=e[s];u=Ge(c)||Array.isArray(c)?c:isNaN(+a[i+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=u,e=e[s]}};const ai={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ht={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Et={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ma=w.createContext(null);Ma.displayName="HookFormControlContext";const Ia=()=>w.useContext(Ma);var Us=(e,t,n,i=!0)=>{const a={defaultValues:t._defaultValues};for(const r in e)Object.defineProperty(a,r,{get:()=>{const o=r;return t._proxyFormState[o]!==ht.all&&(t._proxyFormState[o]=!i||ht.all),n&&(n[o]=!0),e[o]}});return a};const La=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Xg(e){const t=Ia(),{control:n=t,disabled:i,name:a,exact:r}=e||{},[o,s]=w.useState(n._formState),u=w.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return La(()=>n._subscribe({name:a,formState:u.current,exact:r,callback:c=>{!i&&s({...n._formState,...c})}}),[a,i,r]),w.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),w.useMemo(()=>Us(o,n,u.current,!1),[o,n])}var rt=e=>typeof e=="string",ra=(e,t,n,i,a)=>rt(e)?(i&&t.watch.add(e),te(n,e,a)):Array.isArray(e)?e.map(r=>(i&&t.watch.add(r),te(n,r))):(i&&(t.watchAll=!0),n),oa=e=>et(e)||!Gs(e);function pt(e,t,n=new WeakSet){if(oa(e)||oa(t))return Object.is(e,t);if(Xt(e)&&Xt(t))return Object.is(e.getTime(),t.getTime());const i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const r of i){const o=e[r];if(!a.includes(r))return!1;if(r!=="ref"){const s=t[r];if(Xt(o)&&Xt(s)||Ge(o)&&Ge(s)||Array.isArray(o)&&Array.isArray(s)?!pt(o,s,n):!Object.is(o,s))return!1}}return!0}function Qn(e){const t=Ia(),{control:n=t,name:i,defaultValue:a,disabled:r,exact:o,compute:s}=e||{},u=w.useRef(a),c=w.useRef(s),d=w.useRef(void 0),l=w.useRef(n),m=w.useRef(i);c.current=s;const[f,p]=w.useState(()=>{const v=n._getWatch(i,u.current);return c.current?c.current(v):v}),y=w.useCallback(v=>{const g=ra(i,n._names,v||n._formValues,!1,u.current);return c.current?c.current(g):g},[n._formValues,n._names,i]),b=w.useCallback(v=>{if(!r){const g=ra(i,n._names,v||n._formValues,!1,u.current);if(c.current){const A=c.current(g);pt(A,d.current)||(p(A),d.current=A)}else p(g)}},[n._formValues,n._names,r,i]);La(()=>((l.current!==n||!pt(m.current,i))&&(l.current=n,m.current=i,b()),n._subscribe({name:i,formState:{values:!0},exact:o,callback:v=>{b(v.values)}})),[n,o,i,b]),w.useEffect(()=>n._removeUnmounted());const P=l.current!==n,k=m.current,T=w.useMemo(()=>{if(r)return null;const v=!P&&!pt(k,i);return P||v?y():null},[r,P,i,k,y]);return T!==null?T:f}function Zg(e){const t=Ia(),{name:n,disabled:i,control:a=t,shouldUnregister:r,defaultValue:o,exact:s=!0}=e,u=js(a._names.array,n),c=w.useMemo(()=>te(a._formValues,n,te(a._defaultValues,n,o)),[a,n,o]),d=Qn({control:a,name:n,defaultValue:c,exact:s}),l=Xg({control:a,name:n,exact:s}),m=w.useRef(e),f=w.useRef(void 0),p=w.useRef(a.register(n,{...e.rules,value:d,...it(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const y=w.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!te(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!te(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!te(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!te(l.validatingFields,n)},error:{enumerable:!0,get:()=>te(l.errors,n)}}),[l,n]),b=w.useCallback(v=>p.current.onChange({target:{value:Bs(v),name:n},type:ai.CHANGE}),[n]),P=w.useCallback(()=>p.current.onBlur({target:{value:te(a._formValues,n),name:n},type:ai.BLUR}),[n,a._formValues]),k=w.useCallback(v=>{const g=te(a._fields,n);g&&g._f&&v&&(g._f.ref={focus:()=>Je(v.focus)&&v.focus(),select:()=>Je(v.select)&&v.select(),setCustomValidity:A=>Je(v.setCustomValidity)&&v.setCustomValidity(A),reportValidity:()=>Je(v.reportValidity)&&v.reportValidity()})},[a._fields,n]),T=w.useMemo(()=>({name:n,value:d,...it(i)||l.disabled?{disabled:l.disabled||i}:{},onChange:b,onBlur:P,ref:k}),[n,i,l.disabled,b,P,k,d]);return w.useEffect(()=>{const v=a._options.shouldUnregister||r,g=f.current;g&&g!==n&&!u&&a.unregister(g),a.register(n,{...m.current.rules,...it(m.current.disabled)?{disabled:m.current.disabled}:{}});const A=(x,S)=>{const D=te(a._fields,x);D&&D._f&&(D._f.mount=S)};if(A(n,!0),v){const x=Le(te(a._options.defaultValues,n,m.current.defaultValue));Ae(a._defaultValues,n,x),Re(te(a._formValues,n))&&Ae(a._formValues,n,x)}return!u&&a.register(n),f.current=n,()=>{(u?v&&!a._state.action:v)?a.unregister(n):A(n,!1)}},[n,a,u,r]),w.useEffect(()=>{a._setDisabledField({disabled:i,name:n})},[i,n,a]),w.useMemo(()=>({field:T,formState:l,fieldState:y}),[T,l,y])}const Yi=e=>e.render(Zg(e)),zs=w.createContext(null);zs.displayName="HookFormContext";const Qg=e=>{const{children:t,watch:n,getValues:i,getFieldState:a,setError:r,clearErrors:o,setValue:s,trigger:u,formState:c,resetField:d,reset:l,handleSubmit:m,unregister:f,control:p,register:y,setFocus:b,subscribe:P}=e;return w.createElement(zs.Provider,{value:w.useMemo(()=>({watch:n,getValues:i,getFieldState:a,setError:r,clearErrors:o,setValue:s,trigger:u,formState:c,resetField:d,reset:l,handleSubmit:m,unregister:f,control:p,register:y,setFocus:b,subscribe:P}),[o,p,c,a,i,m,y,l,d,r,b,s,P,u,f,n])},w.createElement(Ma.Provider,{value:p},t))};var $g=(e,t,n,i,a)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[i]:a||!0}}:{},Tn=e=>Array.isArray(e)?e:[e],Xr=()=>{let e=[];return{get observers(){return e},next:a=>{for(const r of e)r.next&&r.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(r=>r!==a)}}),unsubscribe:()=>{e=[]}}};function Ys(e,t){const n={};for(const i in e)if(e.hasOwnProperty(i)){const a=e[i],r=t[i];if(a&&Ge(a)&&r){const o=Ys(a,r);Ge(o)&&(n[i]=o)}else e[i]&&(n[i]=r)}return n}var Ke=e=>Ge(e)&&!Object.keys(e).length,Fa=e=>e.type==="file",ri=e=>{if(!Ra)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Hs=e=>e.type==="select-multiple",Ga=e=>e.type==="radio",ey=e=>Ga(e)||Ln(e),Hi=e=>ri(e)&&e.isConnected;function ty(e,t){const n=t.slice(0,-1).length;let i=0;for(;i<n;)e=Re(e)?i++:e[t[i++]];return e}function ny(e){for(const t in e)if(e.hasOwnProperty(t)&&!Re(e[t]))return!1;return!0}function Fe(e,t){const n=Array.isArray(t)?t:wi(t)?[t]:Oa(t),i=n.length===1?e:ty(e,n),a=n.length-1,r=n[a];return i&&delete i[r],a!==0&&(Ge(i)&&Ke(i)||Array.isArray(i)&&ny(i))&&Fe(e,n.slice(0,-1)),e}var iy=e=>{for(const t in e)if(Je(e[t]))return!0;return!1};function Ws(e){return Array.isArray(e)||Ge(e)&&!iy(e)}function sa(e,t={}){for(const n in e){const i=e[n];Ws(i)?(t[n]=Array.isArray(i)?[]:{},sa(i,t[n])):Re(i)||(t[n]=!0)}return t}function sn(e,t,n){n||(n=sa(t));for(const i in e){const a=e[i];if(Ws(a))Re(t)||oa(n[i])?n[i]=sa(a,Array.isArray(a)?[]:{}):sn(a,et(t)?{}:t[i],n[i]);else{const r=t[i];n[i]=!pt(a,r)}}return n}const Zr={value:!1,isValid:!1},Qr={value:!0,isValid:!0};var qs=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Re(e[0].attributes.value)?Re(e[0].value)||e[0].value===""?Qr:{value:e[0].value,isValid:!0}:Qr:Zr}return Zr},_s=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:i})=>Re(e)?e:t?e===""?NaN:e&&+e:n&&rt(e)?new Date(e):i?i(e):e;const $r={isValid:!1,value:null};var Vs=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,$r):$r;function eo(e){const t=e.ref;return Fa(t)?t.files:Ga(t)?Vs(e.refs).value:Hs(t)?[...t.selectedOptions].map(({value:n})=>n):Ln(t)?qs(e.refs).value:_s(Re(t.value)?e.ref.value:t.value,e)}var ay=(e,t,n,i)=>{const a={};for(const r of e){const o=te(t,r);o&&Ae(a,r,o._f)}return{criteriaMode:n,names:[...e],fields:a,shouldUseNativeValidation:i}},oi=e=>e instanceof RegExp,Sn=e=>Re(e)?e:oi(e)?e.source:Ge(e)?oi(e.value)?e.value.source:e.value:e,to=e=>({isOnSubmit:!e||e===ht.onSubmit,isOnBlur:e===ht.onBlur,isOnChange:e===ht.onChange,isOnAll:e===ht.all,isOnTouch:e===ht.onTouched});const no="AsyncFunction";var ry=e=>!!e&&!!e.validate&&!!(Je(e.validate)&&e.validate.constructor.name===no||Ge(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===no)),oy=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),io=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const kn=(e,t,n,i)=>{for(const a of n||Object.keys(e)){const r=te(e,a);if(r){const{_f:o,...s}=r;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],a)&&!i)return!0;if(o.ref&&t(o.ref,o.name)&&!i)return!0;if(kn(s,t))break}else if(Ge(s)&&kn(s,t))break}}};function ao(e,t,n){const i=te(e,n);if(i||wi(n))return{error:i,name:n};const a=n.split(".");for(;a.length;){const r=a.join("."),o=te(t,r),s=te(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(s&&s.type)return{name:r,error:s};if(s&&s.root&&s.root.type)return{name:`${r}.root`,error:s.root};a.pop()}return{name:n}}var sy=(e,t,n,i)=>{n(e);const{name:a,...r}=e;return Ke(r)||Object.keys(r).length>=Object.keys(t).length||Object.keys(r).find(o=>t[o]===(!i||ht.all))},ly=(e,t,n)=>!e||!t||e===t||Tn(e).some(i=>i&&(n?i===t:i.startsWith(t)||t.startsWith(i))),cy=(e,t,n,i,a)=>a.isOnAll?!1:!n&&a.isOnTouch?!(t||e):(n?i.isOnBlur:a.isOnBlur)?!e:(n?i.isOnChange:a.isOnChange)?e:!0,uy=(e,t)=>!Ea(te(e,t)).length&&Fe(e,t),dy=(e,t,n)=>{const i=Tn(te(e,n));return Ae(i,"root",t[n]),Ae(e,n,i),e};function ro(e,t,n="validate"){if(rt(e)||Array.isArray(e)&&e.every(rt)||it(e)&&!e)return{type:n,message:rt(e)?e:"",ref:t}}var on=e=>Ge(e)&&!oi(e)?e:{value:e,message:""},oo=async(e,t,n,i,a,r)=>{const{ref:o,refs:s,required:u,maxLength:c,minLength:d,min:l,max:m,pattern:f,validate:p,name:y,valueAsNumber:b,mount:P}=e._f,k=te(n,y);if(!P||t.has(y))return{};const T=s?s[0]:o,v=j=>{a&&T.reportValidity&&(T.setCustomValidity(it(j)?"":j||""),T.reportValidity())},g={},A=Ga(o),x=Ln(o),S=A||x,D=(b||Fa(o))&&Re(o.value)&&Re(k)||ri(o)&&o.value===""||k===""||Array.isArray(k)&&!k.length,L=$g.bind(null,y,i,g),H=(j,G,q,Z=Et.maxLength,F=Et.minLength)=>{const W=j?G:q;g[y]={type:j?Z:F,message:W,ref:o,...L(j?Z:F,W)}};if(r?!Array.isArray(k)||!k.length:u&&(!S&&(D||et(k))||it(k)&&!k||x&&!qs(s).isValid||A&&!Vs(s).isValid)){const{value:j,message:G}=rt(u)?{value:!!u,message:u}:on(u);if(j&&(g[y]={type:Et.required,message:G,ref:T,...L(Et.required,G)},!i))return v(G),g}if(!D&&(!et(l)||!et(m))){let j,G;const q=on(m),Z=on(l);if(!et(k)&&!isNaN(k)){const F=o.valueAsNumber||k&&+k;et(q.value)||(j=F>q.value),et(Z.value)||(G=F<Z.value)}else{const F=o.valueAsDate||new Date(k),W=E=>new Date(new Date().toDateString()+" "+E),Q=o.type=="time",se=o.type=="week";rt(q.value)&&k&&(j=Q?W(k)>W(q.value):se?k>q.value:F>new Date(q.value)),rt(Z.value)&&k&&(G=Q?W(k)<W(Z.value):se?k<Z.value:F<new Date(Z.value))}if((j||G)&&(H(!!j,q.message,Z.message,Et.max,Et.min),!i))return v(g[y].message),g}if((c||d)&&!D&&(rt(k)||r&&Array.isArray(k))){const j=on(c),G=on(d),q=!et(j.value)&&k.length>+j.value,Z=!et(G.value)&&k.length<+G.value;if((q||Z)&&(H(q,j.message,G.message),!i))return v(g[y].message),g}if(f&&!D&&rt(k)){const{value:j,message:G}=on(f);if(oi(j)&&!k.match(j)&&(g[y]={type:Et.pattern,message:G,ref:o,...L(Et.pattern,G)},!i))return v(G),g}if(p){if(Je(p)){const j=await p(k,n),G=ro(j,T);if(G&&(g[y]={...G,...L(Et.validate,G.message)},!i))return v(G.message),g}else if(Ge(p)){let j={};for(const G in p){if(!Ke(j)&&!i)break;const q=ro(await p[G](k,n),T,G);q&&(j={...q,...L(G,q.message)},v(q.message),i&&(g[y]=j))}if(!Ke(j)&&(g[y]={ref:T,...j},!i))return g}}return v(!0),g};const hy={mode:ht.onSubmit,reValidateMode:ht.onChange,shouldFocusError:!0};function py(e={}){let t={...hy,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Je(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},i={},a=Ge(t.defaultValues)||Ge(t.values)?Le(t.defaultValues||t.values)||{}:{},r=t.shouldUnregister?{}:Le(a),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},l={...d};let m={...l};const f={array:Xr(),state:Xr()},p=t.criteriaMode===ht.all,y=C=>R=>{clearTimeout(c),c=setTimeout(C,R)},b=async C=>{if(!o.keepIsValid&&!t.disabled&&(l.isValid||m.isValid||C)){let R;t.resolver?(R=Ke((await S()).errors),P()):R=await L(i,!0),R!==n.isValid&&f.state.next({isValid:R})}},P=(C,R)=>{!t.disabled&&(l.isValidating||l.validatingFields||m.isValidating||m.validatingFields)&&((C||Array.from(s.mount)).forEach(M=>{M&&(R?Ae(n.validatingFields,M,R):Fe(n.validatingFields,M))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Ke(n.validatingFields)}))},k=(C,R=[],M,ee,K=!0,Y=!0)=>{if(ee&&M&&!t.disabled){if(o.action=!0,Y&&Array.isArray(te(i,C))){const oe=M(te(i,C),ee.argA,ee.argB);K&&Ae(i,C,oe)}if(Y&&Array.isArray(te(n.errors,C))){const oe=M(te(n.errors,C),ee.argA,ee.argB);K&&Ae(n.errors,C,oe),uy(n.errors,C)}if((l.touchedFields||m.touchedFields)&&Y&&Array.isArray(te(n.touchedFields,C))){const oe=M(te(n.touchedFields,C),ee.argA,ee.argB);K&&Ae(n.touchedFields,C,oe)}(l.dirtyFields||m.dirtyFields)&&(n.dirtyFields=sn(a,r)),f.state.next({name:C,isDirty:j(C,R),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ae(r,C,R)},T=(C,R)=>{Ae(n.errors,C,R),f.state.next({errors:n.errors})},v=C=>{n.errors=C,f.state.next({errors:n.errors,isValid:!1})},g=(C,R,M,ee)=>{const K=te(i,C);if(K){const Y=te(r,C,Re(M)?te(a,C):M);Re(Y)||ee&&ee.defaultChecked||R?Ae(r,C,R?Y:eo(K._f)):Z(C,Y),o.mount&&!o.action&&b()}},A=(C,R,M,ee,K)=>{let Y=!1,oe=!1;const me={name:C};if(!t.disabled){if(!M||ee){(l.isDirty||m.isDirty)&&(oe=n.isDirty,n.isDirty=me.isDirty=j(),Y=oe!==me.isDirty);const fe=pt(te(a,C),R);oe=!!te(n.dirtyFields,C),fe?Fe(n.dirtyFields,C):Ae(n.dirtyFields,C,!0),me.dirtyFields=n.dirtyFields,Y=Y||(l.dirtyFields||m.dirtyFields)&&oe!==!fe}if(M){const fe=te(n.touchedFields,C);fe||(Ae(n.touchedFields,C,M),me.touchedFields=n.touchedFields,Y=Y||(l.touchedFields||m.touchedFields)&&fe!==M)}Y&&K&&f.state.next(me)}return Y?me:{}},x=(C,R,M,ee)=>{const K=te(n.errors,C),Y=(l.isValid||m.isValid)&&it(R)&&n.isValid!==R;if(t.delayError&&M?(u=y(()=>T(C,M)),u(t.delayError)):(clearTimeout(c),u=null,M?Ae(n.errors,C,M):Fe(n.errors,C)),(M?!pt(K,M):K)||!Ke(ee)||Y){const oe={...ee,...Y&&it(R)?{isValid:R}:{},errors:n.errors,name:C};n={...n,...oe},f.state.next(oe)}},S=async C=>(P(C,!0),await t.resolver(r,t.context,ay(C||s.mount,i,t.criteriaMode,t.shouldUseNativeValidation))),D=async C=>{const{errors:R}=await S(C);if(P(C),C)for(const M of C){const ee=te(R,M);ee?Ae(n.errors,M,ee):Fe(n.errors,M)}else n.errors=R;return R},L=async(C,R,M={valid:!0})=>{for(const ee in C){const K=C[ee];if(K){const{_f:Y,...oe}=K;if(Y){const me=s.array.has(Y.name),fe=K._f&&ry(K._f);fe&&l.validatingFields&&P([Y.name],!0);const Ce=await oo(K,s.disabled,r,p,t.shouldUseNativeValidation&&!R,me);if(fe&&l.validatingFields&&P([Y.name]),Ce[Y.name]&&(M.valid=!1,R||e.shouldUseNativeValidation))break;!R&&(te(Ce,Y.name)?me?dy(n.errors,Ce,Y.name):Ae(n.errors,Y.name,Ce[Y.name]):Fe(n.errors,Y.name))}!Ke(oe)&&await L(oe,R,M)}}return M.valid},H=()=>{for(const C of s.unMount){const R=te(i,C);R&&(R._f.refs?R._f.refs.every(M=>!Hi(M)):!Hi(R._f.ref))&&$(C)}s.unMount=new Set},j=(C,R)=>!t.disabled&&(C&&R&&Ae(r,C,R),!pt(N(),a)),G=(C,R,M)=>ra(C,s,{...o.mount?r:Re(R)?a:rt(C)?{[C]:R}:R},M,R),q=C=>Ea(te(o.mount?r:a,C,t.shouldUnregister?te(a,C,[]):[])),Z=(C,R,M={})=>{const ee=te(i,C);let K=R;if(ee){const Y=ee._f;Y&&(!Y.disabled&&Ae(r,C,_s(R,Y)),K=ri(Y.ref)&&et(R)?"":R,Hs(Y.ref)?[...Y.ref.options].forEach(oe=>oe.selected=K.includes(oe.value)):Y.refs?Ln(Y.ref)?Y.refs.forEach(oe=>{(!oe.defaultChecked||!oe.disabled)&&(Array.isArray(K)?oe.checked=!!K.find(me=>me===oe.value):oe.checked=K===oe.value||!!K)}):Y.refs.forEach(oe=>oe.checked=oe.value===K):Fa(Y.ref)?Y.ref.value="":(Y.ref.value=K,Y.ref.type||f.state.next({name:C,values:Le(r)})))}(M.shouldDirty||M.shouldTouch)&&A(C,K,M.shouldTouch,M.shouldDirty,!0),M.shouldValidate&&E(C)},F=(C,R,M)=>{for(const ee in R){if(!R.hasOwnProperty(ee))return;const K=R[ee],Y=C+"."+ee,oe=te(i,Y);(s.array.has(C)||Ge(K)||oe&&!oe._f)&&!Xt(K)?F(Y,K,M):Z(Y,K,M)}},W=(C,R,M={})=>{const ee=te(i,C),K=s.array.has(C),Y=Le(R);Ae(r,C,Y),K?(f.array.next({name:C,values:Le(r)}),(l.isDirty||l.dirtyFields||m.isDirty||m.dirtyFields)&&M.shouldDirty&&f.state.next({name:C,dirtyFields:sn(a,r),isDirty:j(C,Y)})):ee&&!ee._f&&!et(Y)?F(C,Y,M):Z(C,Y,M),io(C,s)?f.state.next({...n,name:C,values:Le(r)}):f.state.next({name:o.mount?C:void 0,values:Le(r)})},Q=async C=>{o.mount=!0;const R=C.target;let M=R.name,ee=!0;const K=te(i,M),Y=fe=>{ee=Number.isNaN(fe)||Xt(fe)&&isNaN(fe.getTime())||pt(fe,te(r,M,fe))},oe=to(t.mode),me=to(t.reValidateMode);if(K){let fe,Ce;const ct=R.type?eo(K._f):Bs(C),He=C.type===ai.BLUR||C.type===ai.FOCUS_OUT,re=!oy(K._f)&&!t.resolver&&!te(n.errors,M)&&!K._f.deps||cy(He,te(n.touchedFields,M),n.isSubmitted,me,oe),Te=io(M,s,He);Ae(r,M,ct),He?(!R||!R.readOnly)&&(K._f.onBlur&&K._f.onBlur(C),u&&u(0)):K._f.onChange&&K._f.onChange(C);const Ue=A(M,ct,He),de=!Ke(Ue)||Te;if(!He&&f.state.next({name:M,type:C.type,values:Le(r)}),re)return(l.isValid||m.isValid)&&(t.mode==="onBlur"?He&&b():He||b()),de&&f.state.next({name:M,...Te?{}:Ue});if(!He&&Te&&f.state.next({...n}),t.resolver){const{errors:Be}=await S([M]);if(P([M]),Y(ct),ee){const Xe=ao(n.errors,i,M),ze=ao(Be,i,Xe.name||M);fe=ze.error,M=ze.name,Ce=Ke(Be)}}else P([M],!0),fe=(await oo(K,s.disabled,r,p,t.shouldUseNativeValidation))[M],P([M]),Y(ct),ee&&(fe?Ce=!1:(l.isValid||m.isValid)&&(Ce=await L(i,!0)));ee&&(K._f.deps&&(!Array.isArray(K._f.deps)||K._f.deps.length>0)&&E(K._f.deps),x(M,Ce,fe,Ue))}},se=(C,R)=>{if(te(n.errors,R)&&C.focus)return C.focus(),1},E=async(C,R={})=>{let M,ee;const K=Tn(C);if(t.resolver){const Y=await D(Re(C)?C:K);M=Ke(Y),ee=C?!K.some(oe=>te(Y,oe)):M}else C?(ee=(await Promise.all(K.map(async Y=>{const oe=te(i,Y);return await L(oe&&oe._f?{[Y]:oe}:oe)}))).every(Boolean),!(!ee&&!n.isValid)&&b()):ee=M=await L(i);return f.state.next({...!rt(C)||(l.isValid||m.isValid)&&M!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:M}:{},errors:n.errors}),R.shouldFocus&&!ee&&kn(i,se,C?K:s.mount),ee},N=(C,R)=>{let M={...o.mount?r:a};return R&&(M=Ys(R.dirtyFields?n.dirtyFields:n.touchedFields,M)),Re(C)?M:rt(C)?te(M,C):C.map(ee=>te(M,ee))},z=(C,R)=>({invalid:!!te((R||n).errors,C),isDirty:!!te((R||n).dirtyFields,C),error:te((R||n).errors,C),isValidating:!!te(n.validatingFields,C),isTouched:!!te((R||n).touchedFields,C)}),B=C=>{const R=C?Tn(C):void 0;R?.forEach(M=>Fe(n.errors,M)),R?R.forEach(M=>{f.state.next({name:M,errors:n.errors})}):f.state.next({errors:{}})},U=(C,R,M)=>{const ee=(te(i,C,{_f:{}})._f||{}).ref,K=te(n.errors,C)||{},{ref:Y,message:oe,type:me,...fe}=K;Ae(n.errors,C,{...fe,...R,ref:ee}),f.state.next({name:C,errors:n.errors,isValid:!1}),M&&M.shouldFocus&&ee&&ee.focus&&ee.focus()},_=(C,R)=>Je(C)?f.state.subscribe({next:M=>"values"in M&&C(G(void 0,R),M)}):G(C,R,!0),X=C=>f.state.subscribe({next:R=>{ly(C.name,R.name,C.exact)&&sy(R,C.formState||l,nn,C.reRenderRoot)&&C.callback({values:{...r},...n,...R,defaultValues:a})}}).unsubscribe,J=C=>(o.mount=!0,m={...m,...C.formState},X({...C,formState:{...d,...C.formState}})),$=(C,R={})=>{for(const M of C?Tn(C):s.mount)s.mount.delete(M),s.array.delete(M),R.keepValue||(Fe(i,M),Fe(r,M)),!R.keepError&&Fe(n.errors,M),!R.keepDirty&&Fe(n.dirtyFields,M),!R.keepTouched&&Fe(n.touchedFields,M),!R.keepIsValidating&&Fe(n.validatingFields,M),!t.shouldUnregister&&!R.keepDefaultValue&&Fe(a,M);f.state.next({values:Le(r)}),f.state.next({...n,...R.keepDirty?{isDirty:j()}:{}}),!R.keepIsValid&&b()},ne=({disabled:C,name:R})=>{if(it(C)&&o.mount||C||s.disabled.has(R)){const K=s.disabled.has(R)!==!!C;C?s.disabled.add(R):s.disabled.delete(R),K&&o.mount&&!o.action&&b()}},le=(C,R={})=>{let M=te(i,C);const ee=it(R.disabled)||it(t.disabled);return Ae(i,C,{...M||{},_f:{...M&&M._f?M._f:{ref:{name:C}},name:C,mount:!0,...R}}),s.mount.add(C),M?ne({disabled:it(R.disabled)?R.disabled:t.disabled,name:C}):g(C,!0,R.value),{...ee?{disabled:R.disabled||t.disabled}:{},...t.progressive?{required:!!R.required,min:Sn(R.min),max:Sn(R.max),minLength:Sn(R.minLength),maxLength:Sn(R.maxLength),pattern:Sn(R.pattern)}:{},name:C,onChange:Q,onBlur:Q,ref:K=>{if(K){le(C,R),M=te(i,C);const Y=Re(K.value)&&K.querySelectorAll&&K.querySelectorAll("input,select,textarea")[0]||K,oe=ey(Y),me=M._f.refs||[];if(oe?me.find(fe=>fe===Y):Y===M._f.ref)return;Ae(i,C,{_f:{...M._f,...oe?{refs:[...me.filter(Hi),Y,...Array.isArray(te(a,C))?[{}]:[]],ref:{type:Y.type,name:C}}:{ref:Y}}}),g(C,!1,void 0,Y)}else M=te(i,C,{}),M._f&&(M._f.mount=!1),(t.shouldUnregister||R.shouldUnregister)&&!(js(s.array,C)&&o.action)&&s.unMount.add(C)}}},pe=()=>t.shouldFocusError&&kn(i,se,s.mount),V=C=>{it(C)&&(f.state.next({disabled:C}),kn(i,(R,M)=>{const ee=te(i,M);ee&&(R.disabled=ee._f.disabled||C,Array.isArray(ee._f.refs)&&ee._f.refs.forEach(K=>{K.disabled=ee._f.disabled||C}))},0,!1))},xe=(C,R)=>async M=>{let ee;M&&(M.preventDefault&&M.preventDefault(),M.persist&&M.persist());let K=Le(r);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:Y,values:oe}=await S();P(),n.errors=Y,K=Le(oe)}else await L(i);if(s.disabled.size)for(const Y of s.disabled)Fe(K,Y);if(Fe(n.errors,"root"),Ke(n.errors)){f.state.next({errors:{}});try{await C(K,M)}catch(Y){ee=Y}}else R&&await R({...n.errors},M),pe(),setTimeout(pe);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ke(n.errors)&&!ee,submitCount:n.submitCount+1,errors:n.errors}),ee)throw ee},Ee=(C,R={})=>{te(i,C)&&(Re(R.defaultValue)?W(C,Le(te(a,C))):(W(C,R.defaultValue),Ae(a,C,Le(R.defaultValue))),R.keepTouched||Fe(n.touchedFields,C),R.keepDirty||(Fe(n.dirtyFields,C),n.isDirty=R.defaultValue?j(C,Le(te(a,C))):j()),R.keepError||(Fe(n.errors,C),l.isValid&&b()),f.state.next({...n}))},st=(C,R={})=>{const M=C?Le(C):a,ee=Le(M),K=Ke(C),Y=K?a:ee;if(R.keepDefaultValues||(a=M),!R.keepValues){if(R.keepDirtyValues){const oe=new Set([...s.mount,...Object.keys(sn(a,r))]);for(const me of Array.from(oe)){const fe=te(n.dirtyFields,me),Ce=te(r,me),ct=te(Y,me);fe&&!Re(Ce)?Ae(Y,me,Ce):!fe&&!Re(ct)&&W(me,ct)}}else{if(Ra&&Re(C))for(const oe of s.mount){const me=te(i,oe);if(me&&me._f){const fe=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(ri(fe)){const Ce=fe.closest("form");if(Ce){Ce.reset();break}}}}if(R.keepFieldsRef)for(const oe of s.mount)W(oe,te(Y,oe));else i={}}r=t.shouldUnregister?R.keepDefaultValues?Le(a):{}:Le(Y),f.array.next({values:{...Y}}),f.state.next({values:{...Y}})}s={mount:R.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!l.isValid||!!R.keepIsValid||!!R.keepDirtyValues||!t.shouldUnregister&&!Ke(Y),o.watch=!!t.shouldUnregister,o.keepIsValid=!!R.keepIsValid,o.action=!1,R.keepErrors||(n.errors={}),f.state.next({submitCount:R.keepSubmitCount?n.submitCount:0,isDirty:K?!1:R.keepDirty?n.isDirty:!!(R.keepDefaultValues&&!pt(C,a)),isSubmitted:R.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:K?{}:R.keepDirtyValues?R.keepDefaultValues&&r?sn(a,r):n.dirtyFields:R.keepDefaultValues&&C?sn(a,C):R.keepDirty?n.dirtyFields:{},touchedFields:R.keepTouched?n.touchedFields:{},errors:R.keepErrors?n.errors:{},isSubmitSuccessful:R.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},qt=(C,R)=>st(Je(C)?C(r):C,{...t.resetOptions,...R}),Dt=(C,R={})=>{const M=te(i,C),ee=M&&M._f;if(ee){const K=ee.refs?ee.refs[0]:ee.ref;K.focus&&setTimeout(()=>{K.focus(),R.shouldSelect&&Je(K.select)&&K.select()})}},nn=C=>{n={...n,...C}},an={control:{register:le,unregister:$,getFieldState:z,handleSubmit:xe,setError:U,_subscribe:X,_runSchema:S,_updateIsValidating:P,_focusError:pe,_getWatch:G,_getDirty:j,_setValid:b,_setFieldArray:k,_setDisabledField:ne,_setErrors:v,_getFieldArray:q,_reset:st,_resetDefaultValues:()=>Je(t.defaultValues)&&t.defaultValues().then(C=>{qt(C,t.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:H,_disableForm:V,_subjects:f,_proxyFormState:l,get _fields(){return i},get _formValues(){return r},get _state(){return o},set _state(C){o=C},get _defaultValues(){return a},get _names(){return s},set _names(C){s=C},get _formState(){return n},get _options(){return t},set _options(C){t={...t,...C}}},subscribe:J,trigger:E,register:le,handleSubmit:xe,watch:_,setValue:W,getValues:N,reset:qt,resetField:Ee,clearErrors:B,unregister:$,setError:U,setFocus:Dt,getFieldState:z};return{...an,formControl:an}}function Ks(e={}){const t=w.useRef(void 0),n=w.useRef(void 0),[i,a]=w.useState({isDirty:!1,isValidating:!1,isLoading:Je(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Je(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!Je(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=py(e);t.current={...s,formState:i}}const r=t.current.control;return r._options=e,La(()=>{const o=r._subscribe({formState:r._proxyFormState,callback:()=>a({...r._formState}),reRenderRoot:!0});return a(s=>({...s,isReady:!0})),r._formState.isReady=!0,o},[r]),w.useEffect(()=>r._disableForm(e.disabled),[r,e.disabled]),w.useEffect(()=>{e.mode&&(r._options.mode=e.mode),e.reValidateMode&&(r._options.reValidateMode=e.reValidateMode)},[r,e.mode,e.reValidateMode]),w.useEffect(()=>{e.errors&&(r._setErrors(e.errors),r._focusError())},[r,e.errors]),w.useEffect(()=>{e.shouldUnregister&&r._subjects.state.next({values:r._getWatch()})},[r,e.shouldUnregister]),w.useEffect(()=>{if(r._proxyFormState.isDirty){const o=r._getDirty();o!==i.isDirty&&r._subjects.state.next({isDirty:o})}},[r,i.isDirty]),w.useEffect(()=>{var o;e.values&&!pt(e.values,n.current)?(r._reset(e.values,{keepFieldsRef:!0,...r._options.resetOptions}),!((o=r._options.resetOptions)===null||o===void 0)&&o.keepIsValid||r._setValid(),n.current=e.values,a(s=>({...s}))):r._resetDefaultValues()},[r,e.values]),w.useEffect(()=>{r._state.mount||(r._setValid(),r._state.mount=!0),r._state.watch&&(r._state.watch=!1,r._subjects.state.next({...r._formState})),r._removeUnmounted()}),t.current.formState=w.useMemo(()=>Us(i,r),[r,i]),t.current}function so(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Js(...e){return t=>{let n=!1;const i=e.map(a=>{const r=so(a,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let a=0;a<i.length;a++){const r=i[a];typeof r=="function"?r():so(e[a],null)}}}}function tn(...e){return I.useCallback(Js(...e),e)}function Xs(e){const t=fy(e),n=I.forwardRef((i,a)=>{const{children:r,...o}=i,s=I.Children.toArray(r),u=s.find(yy);if(u){const c=u.props.children,d=s.map(l=>l===u?I.Children.count(c)>1?I.Children.only(null):I.isValidElement(c)?c.props.children:null:l);return h.jsx(t,{...o,ref:a,children:I.isValidElement(c)?I.cloneElement(c,void 0,d):null})}return h.jsx(t,{...o,ref:a,children:r})});return n.displayName=`${e}.Slot`,n}var my=Xs("Slot");function fy(e){const t=I.forwardRef((n,i)=>{const{children:a,...r}=n;if(I.isValidElement(a)){const o=vy(a),s=by(r,a.props);return a.type!==I.Fragment&&(s.ref=i?Js(i,o):o),I.cloneElement(a,s)}return I.Children.count(a)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zs=Symbol("radix.slottable");function gy(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Zs,t}function yy(e){return I.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zs}function by(e,t){const n={...t};for(const i in t){const a=e[i],r=t[i];/^on[A-Z]/.test(i)?a&&r?n[i]=(...s)=>{const u=r(...s);return a(...s),u}:a&&(n[i]=a):i==="style"?n[i]={...a,...r}:i==="className"&&(n[i]=[a,r].filter(Boolean).join(" "))}return{...e,...n}}function vy(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wt=wy.reduce((e,t)=>{const n=Xs(`Primitive.${t}`),i=I.forwardRef((a,r)=>{const{asChild:o,...s}=a,u=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(u,{...s,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function xy(e,t){e&&Bo.flushSync(()=>e.dispatchEvent(t))}var Py=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Sy="VisuallyHidden",Qs=I.forwardRef((e,t)=>h.jsx(Wt.span,{...e,ref:t,style:{...Py,...e.style}}));Qs.displayName=Sy;var Ty=Qs;function $s(e,t=[]){let n=[];function i(r,o){const s=I.createContext(o),u=n.length;n=[...n,o];const c=l=>{const{scope:m,children:f,...p}=l,y=m?.[e]?.[u]||s,b=I.useMemo(()=>p,Object.values(p));return h.jsx(y.Provider,{value:b,children:f})};c.displayName=r+"Provider";function d(l,m){const f=m?.[e]?.[u]||s,p=I.useContext(f);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[c,d]}const a=()=>{const r=n.map(o=>I.createContext(o));return function(s){const u=s?.[e]||r;return I.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return a.scopeName=e,[i,ky(a,...t)]}function ky(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(r){const o=i.reduce((s,{useScope:u,scopeName:c})=>{const l=u(r)[`__scope${c}`];return{...s,...l}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Ot(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}var Ut=globalThis?.document?I.useLayoutEffect:()=>{},Cy=I[" useInsertionEffect ".trim().toString()]||Ut;function Ay({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[a,r,o]=Ny({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:a;{const d=I.useRef(e!==void 0);I.useEffect(()=>{const l=d.current;l!==s&&console.warn(`${i} is changing from ${l?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,i])}const c=I.useCallback(d=>{if(s){const l=Dy(d)?d(e):d;l!==e&&o.current?.(l)}else r(d)},[s,e,r,o]);return[u,c]}function Ny({defaultProp:e,onChange:t}){const[n,i]=I.useState(e),a=I.useRef(n),r=I.useRef(t);return Cy(()=>{r.current=t},[t]),I.useEffect(()=>{a.current!==n&&(r.current?.(n),a.current=n)},[n,a]),[n,i,r]}function Dy(e){return typeof e=="function"}function Ry(e,t){return I.useReducer((n,i)=>t[n][i]??n,e)}var Ba=e=>{const{present:t,children:n}=e,i=Ey(t),a=typeof n=="function"?n({present:i.isPresent}):I.Children.only(n),r=tn(i.ref,Oy(a));return typeof n=="function"||i.isPresent?I.cloneElement(a,{ref:r}):null};Ba.displayName="Presence";function Ey(e){const[t,n]=I.useState(),i=I.useRef(null),a=I.useRef(e),r=I.useRef("none"),o=e?"mounted":"unmounted",[s,u]=Ry(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return I.useEffect(()=>{const c=Vn(i.current);r.current=s==="mounted"?c:"none"},[s]),Ut(()=>{const c=i.current,d=a.current;if(d!==e){const m=r.current,f=Vn(c);e?u("MOUNT"):f==="none"||c?.display==="none"?u("UNMOUNT"):u(d&&m!==f?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),Ut(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,l=f=>{const y=Vn(i.current).includes(CSS.escape(f.animationName));if(f.target===t&&y&&(u("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=f=>{f.target===t&&(r.current=Vn(i.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:I.useCallback(c=>{i.current=c?getComputedStyle(c):null,n(c)},[])}}function Vn(e){return e?.animationName||"none"}function Oy(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var My=I[" useId ".trim().toString()]||(()=>{}),Iy=0;function Ly(e){const[t,n]=I.useState(My());return Ut(()=>{n(i=>i??String(Iy++))},[e]),t?`radix-${t}`:""}function xi(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...n)=>t.current?.(...n),[])}function Fy(e,t=globalThis?.document){const n=xi(e);I.useEffect(()=>{const i=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var Gy="DismissableLayer",la="dismissableLayer.update",By="dismissableLayer.pointerDownOutside",jy="dismissableLayer.focusOutside",lo,el=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tl=I.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:r,onInteractOutside:o,onDismiss:s,...u}=e,c=I.useContext(el),[d,l]=I.useState(null),m=d?.ownerDocument??globalThis?.document,[,f]=I.useState({}),p=tn(t,x=>l(x)),y=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),P=y.indexOf(b),k=d?y.indexOf(d):-1,T=c.layersWithOutsidePointerEventsDisabled.size>0,v=k>=P,g=Yy(x=>{const S=x.target,D=[...c.branches].some(L=>L.contains(S));!v||D||(a?.(x),o?.(x),x.defaultPrevented||s?.())},m),A=Hy(x=>{const S=x.target;[...c.branches].some(L=>L.contains(S))||(r?.(x),o?.(x),x.defaultPrevented||s?.())},m);return Fy(x=>{k===c.layers.size-1&&(i?.(x),!x.defaultPrevented&&s&&(x.preventDefault(),s()))},m),I.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(lo=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),co(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=lo)}},[d,m,n,c]),I.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),co())},[d,c]),I.useEffect(()=>{const x=()=>f({});return document.addEventListener(la,x),()=>document.removeEventListener(la,x)},[]),h.jsx(Wt.div,{...u,ref:p,style:{pointerEvents:T?v?"auto":"none":void 0,...e.style},onFocusCapture:Ot(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ot(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ot(e.onPointerDownCapture,g.onPointerDownCapture)})});tl.displayName=Gy;var Uy="DismissableLayerBranch",zy=I.forwardRef((e,t)=>{const n=I.useContext(el),i=I.useRef(null),a=tn(t,i);return I.useEffect(()=>{const r=i.current;if(r)return n.branches.add(r),()=>{n.branches.delete(r)}},[n.branches]),h.jsx(Wt.div,{...e,ref:a})});zy.displayName=Uy;function Yy(e,t=globalThis?.document){const n=xi(e),i=I.useRef(!1),a=I.useRef(()=>{});return I.useEffect(()=>{const r=s=>{if(s.target&&!i.current){let u=function(){nl(By,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=u,t.addEventListener("click",a.current,{once:!0})):u()}else t.removeEventListener("click",a.current);i.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",r),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>i.current=!0}}function Hy(e,t=globalThis?.document){const n=xi(e),i=I.useRef(!1);return I.useEffect(()=>{const a=r=>{r.target&&!i.current&&nl(jy,n,{originalEvent:r},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function co(){const e=new CustomEvent(la);document.dispatchEvent(e)}function nl(e,t,n,{discrete:i}){const a=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),i?xy(a,r):a.dispatchEvent(r)}var Wy="Portal",il=I.forwardRef((e,t)=>{const{container:n,...i}=e,[a,r]=I.useState(!1);Ut(()=>r(!0),[]);const o=n||a&&globalThis?.document?.body;return o?Dn.createPortal(h.jsx(Wt.div,{...i,ref:t}),o):null});il.displayName=Wy;function qy(e){const[t,n]=I.useState(void 0);return Ut(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const r=a[0];let o,s;if("borderBoxSize"in r){const u=r.borderBoxSize,c=Array.isArray(u)?u[0]:u;o=c.inlineSize,s=c.blockSize}else o=e.offsetWidth,s=e.offsetHeight;n({width:o,height:s})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}const _y=["top","right","bottom","left"],zt=Math.min,at=Math.max,si=Math.round,Kn=Math.floor,St=e=>({x:e,y:e}),Vy={left:"right",right:"left",bottom:"top",top:"bottom"},Ky={start:"end",end:"start"};function ca(e,t,n){return at(e,zt(t,n))}function Mt(e,t){return typeof e=="function"?e(t):e}function It(e){return e.split("-")[0]}function mn(e){return e.split("-")[1]}function ja(e){return e==="x"?"y":"x"}function Ua(e){return e==="y"?"height":"width"}const Jy=new Set(["top","bottom"]);function xt(e){return Jy.has(It(e))?"y":"x"}function za(e){return ja(xt(e))}function Xy(e,t,n){n===void 0&&(n=!1);const i=mn(e),a=za(e),r=Ua(a);let o=a==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=li(o)),[o,li(o)]}function Zy(e){const t=li(e);return[ua(e),t,ua(t)]}function ua(e){return e.replace(/start|end/g,t=>Ky[t])}const uo=["left","right"],ho=["right","left"],Qy=["top","bottom"],$y=["bottom","top"];function eb(e,t,n){switch(e){case"top":case"bottom":return n?t?ho:uo:t?uo:ho;case"left":case"right":return t?Qy:$y;default:return[]}}function tb(e,t,n,i){const a=mn(e);let r=eb(It(e),n==="start",i);return a&&(r=r.map(o=>o+"-"+a),t&&(r=r.concat(r.map(ua)))),r}function li(e){return e.replace(/left|right|bottom|top/g,t=>Vy[t])}function nb(e){return{top:0,right:0,bottom:0,left:0,...e}}function al(e){return typeof e!="number"?nb(e):{top:e,right:e,bottom:e,left:e}}function ci(e){const{x:t,y:n,width:i,height:a}=e;return{width:i,height:a,top:n,left:t,right:t+i,bottom:n+a,x:t,y:n}}function po(e,t,n){let{reference:i,floating:a}=e;const r=xt(t),o=za(t),s=Ua(o),u=It(t),c=r==="y",d=i.x+i.width/2-a.width/2,l=i.y+i.height/2-a.height/2,m=i[s]/2-a[s]/2;let f;switch(u){case"top":f={x:d,y:i.y-a.height};break;case"bottom":f={x:d,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:l};break;case"left":f={x:i.x-a.width,y:l};break;default:f={x:i.x,y:i.y}}switch(mn(t)){case"start":f[o]-=m*(n&&c?-1:1);break;case"end":f[o]+=m*(n&&c?-1:1);break}return f}async function ib(e,t){var n;t===void 0&&(t={});const{x:i,y:a,platform:r,rects:o,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:l="floating",altBoundary:m=!1,padding:f=0}=Mt(t,e),p=al(f),b=s[m?l==="floating"?"reference":"floating":l],P=ci(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(b)))==null||n?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:u})),k=l==="floating"?{x:i,y:a,width:o.floating.width,height:o.floating.height}:o.reference,T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),v=await(r.isElement==null?void 0:r.isElement(T))?await(r.getScale==null?void 0:r.getScale(T))||{x:1,y:1}:{x:1,y:1},g=ci(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:k,offsetParent:T,strategy:u}):k);return{top:(P.top-g.top+p.top)/v.y,bottom:(g.bottom-P.bottom+p.bottom)/v.y,left:(P.left-g.left+p.left)/v.x,right:(g.right-P.right+p.right)/v.x}}const ab=async(e,t,n)=>{const{placement:i="bottom",strategy:a="absolute",middleware:r=[],platform:o}=n,s=r.filter(Boolean),u=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:l}=po(c,i,u),m=i,f={},p=0;for(let b=0;b<s.length;b++){var y;const{name:P,fn:k}=s[b],{x:T,y:v,data:g,reset:A}=await k({x:d,y:l,initialPlacement:i,placement:m,strategy:a,middlewareData:f,rects:c,platform:{...o,detectOverflow:(y=o.detectOverflow)!=null?y:ib},elements:{reference:e,floating:t}});d=T??d,l=v??l,f={...f,[P]:{...f[P],...g}},A&&p<=50&&(p++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(c=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:d,y:l}=po(c,m,u)),b=-1)}return{x:d,y:l,placement:m,strategy:a,middlewareData:f}},rb=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:a,rects:r,platform:o,elements:s,middlewareData:u}=t,{element:c,padding:d=0}=Mt(e,t)||{};if(c==null)return{};const l=al(d),m={x:n,y:i},f=za(a),p=Ua(f),y=await o.getDimensions(c),b=f==="y",P=b?"top":"left",k=b?"bottom":"right",T=b?"clientHeight":"clientWidth",v=r.reference[p]+r.reference[f]-m[f]-r.floating[p],g=m[f]-r.reference[f],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let x=A?A[T]:0;(!x||!await(o.isElement==null?void 0:o.isElement(A)))&&(x=s.floating[T]||r.floating[p]);const S=v/2-g/2,D=x/2-y[p]/2-1,L=zt(l[P],D),H=zt(l[k],D),j=L,G=x-y[p]-H,q=x/2-y[p]/2+S,Z=ca(j,q,G),F=!u.arrow&&mn(a)!=null&&q!==Z&&r.reference[p]/2-(q<j?L:H)-y[p]/2<0,W=F?q<j?q-j:q-G:0;return{[f]:m[f]+W,data:{[f]:Z,centerOffset:q-Z-W,...F&&{alignmentOffset:W}},reset:F}}}),ob=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:a,middlewareData:r,rects:o,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:l=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:y=!0,...b}=Mt(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const P=It(a),k=xt(s),T=It(s)===s,v=await(u.isRTL==null?void 0:u.isRTL(c.floating)),g=m||(T||!y?[li(s)]:Zy(s)),A=p!=="none";!m&&A&&g.push(...tb(s,y,p,v));const x=[s,...g],S=await u.detectOverflow(t,b),D=[];let L=((i=r.flip)==null?void 0:i.overflows)||[];if(d&&D.push(S[P]),l){const q=Xy(a,o,v);D.push(S[q[0]],S[q[1]])}if(L=[...L,{placement:a,overflows:D}],!D.every(q=>q<=0)){var H,j;const q=(((H=r.flip)==null?void 0:H.index)||0)+1,Z=x[q];if(Z&&(!(l==="alignment"?k!==xt(Z):!1)||L.every(Q=>xt(Q.placement)===k?Q.overflows[0]>0:!0)))return{data:{index:q,overflows:L},reset:{placement:Z}};let F=(j=L.filter(W=>W.overflows[0]<=0).sort((W,Q)=>W.overflows[1]-Q.overflows[1])[0])==null?void 0:j.placement;if(!F)switch(f){case"bestFit":{var G;const W=(G=L.filter(Q=>{if(A){const se=xt(Q.placement);return se===k||se==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(se=>se>0).reduce((se,E)=>se+E,0)]).sort((Q,se)=>Q[1]-se[1])[0])==null?void 0:G[0];W&&(F=W);break}case"initialPlacement":F=s;break}if(a!==F)return{reset:{placement:F}}}return{}}}};function mo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fo(e){return _y.some(t=>e[t]>=0)}const sb=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:a="referenceHidden",...r}=Mt(e,t);switch(a){case"referenceHidden":{const o=await i.detectOverflow(t,{...r,elementContext:"reference"}),s=mo(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:fo(s)}}}case"escaped":{const o=await i.detectOverflow(t,{...r,altBoundary:!0}),s=mo(o,n.floating);return{data:{escapedOffsets:s,escaped:fo(s)}}}default:return{}}}}},rl=new Set(["left","top"]);async function lb(e,t){const{placement:n,platform:i,elements:a}=e,r=await(i.isRTL==null?void 0:i.isRTL(a.floating)),o=It(n),s=mn(n),u=xt(n)==="y",c=rl.has(o)?-1:1,d=r&&u?-1:1,l=Mt(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:p}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return s&&typeof p=="number"&&(f=s==="end"?p*-1:p),u?{x:f*d,y:m*c}:{x:m*c,y:f*d}}const cb=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:a,y:r,placement:o,middlewareData:s}=t,u=await lb(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:a+u.x,y:r+u.y,data:{...u,placement:o}}}}},ub=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:a,platform:r}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:u={fn:P=>{let{x:k,y:T}=P;return{x:k,y:T}}},...c}=Mt(e,t),d={x:n,y:i},l=await r.detectOverflow(t,c),m=xt(It(a)),f=ja(m);let p=d[f],y=d[m];if(o){const P=f==="y"?"top":"left",k=f==="y"?"bottom":"right",T=p+l[P],v=p-l[k];p=ca(T,p,v)}if(s){const P=m==="y"?"top":"left",k=m==="y"?"bottom":"right",T=y+l[P],v=y-l[k];y=ca(T,y,v)}const b=u.fn({...t,[f]:p,[m]:y});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[f]:o,[m]:s}}}}}},db=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:i,placement:a,rects:r,middlewareData:o}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=Mt(e,t),d={x:n,y:i},l=xt(a),m=ja(l);let f=d[m],p=d[l];const y=Mt(s,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){const T=m==="y"?"height":"width",v=r.reference[m]-r.floating[T]+b.mainAxis,g=r.reference[m]+r.reference[T]-b.mainAxis;f<v?f=v:f>g&&(f=g)}if(c){var P,k;const T=m==="y"?"width":"height",v=rl.has(It(a)),g=r.reference[l]-r.floating[T]+(v&&((P=o.offset)==null?void 0:P[l])||0)+(v?0:b.crossAxis),A=r.reference[l]+r.reference[T]+(v?0:((k=o.offset)==null?void 0:k[l])||0)-(v?b.crossAxis:0);p<g?p=g:p>A&&(p=A)}return{[m]:f,[l]:p}}}},hb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,i;const{placement:a,rects:r,platform:o,elements:s}=t,{apply:u=()=>{},...c}=Mt(e,t),d=await o.detectOverflow(t,c),l=It(a),m=mn(a),f=xt(a)==="y",{width:p,height:y}=r.floating;let b,P;l==="top"||l==="bottom"?(b=l,P=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(P=l,b=m==="end"?"top":"bottom");const k=y-d.top-d.bottom,T=p-d.left-d.right,v=zt(y-d[b],k),g=zt(p-d[P],T),A=!t.middlewareData.shift;let x=v,S=g;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=T),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(x=k),A&&!m){const L=at(d.left,0),H=at(d.right,0),j=at(d.top,0),G=at(d.bottom,0);f?S=p-2*(L!==0||H!==0?L+H:at(d.left,d.right)):x=y-2*(j!==0||G!==0?j+G:at(d.top,d.bottom))}await u({...t,availableWidth:S,availableHeight:x});const D=await o.getDimensions(s.floating);return p!==D.width||y!==D.height?{reset:{rects:!0}}:{}}}};function Pi(){return typeof window<"u"}function fn(e){return ol(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Nt(e){var t;return(t=(ol(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ol(e){return Pi()?e instanceof Node||e instanceof ot(e).Node:!1}function gt(e){return Pi()?e instanceof Element||e instanceof ot(e).Element:!1}function kt(e){return Pi()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function go(e){return!Pi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}const pb=new Set(["inline","contents"]);function Fn(e){const{overflow:t,overflowX:n,overflowY:i,display:a}=yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!pb.has(a)}const mb=new Set(["table","td","th"]);function fb(e){return mb.has(fn(e))}const gb=[":popover-open",":modal"];function Si(e){return gb.some(t=>{try{return e.matches(t)}catch{return!1}})}const yb=["transform","translate","scale","rotate","perspective"],bb=["transform","translate","scale","rotate","perspective","filter"],vb=["paint","layout","strict","content"];function Ya(e){const t=Ha(),n=gt(e)?yt(e):e;return yb.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||bb.some(i=>(n.willChange||"").includes(i))||vb.some(i=>(n.contain||"").includes(i))}function wb(e){let t=Yt(e);for(;kt(t)&&!dn(t);){if(Ya(t))return t;if(Si(t))return null;t=Yt(t)}return null}function Ha(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const xb=new Set(["html","body","#document"]);function dn(e){return xb.has(fn(e))}function yt(e){return ot(e).getComputedStyle(e)}function Ti(e){return gt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yt(e){if(fn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||go(e)&&e.host||Nt(e);return go(t)?t.host:t}function sl(e){const t=Yt(e);return dn(t)?e.ownerDocument?e.ownerDocument.body:e.body:kt(t)&&Fn(t)?t:sl(t)}function An(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=sl(e),r=a===((i=e.ownerDocument)==null?void 0:i.body),o=ot(a);if(r){const s=da(o);return t.concat(o,o.visualViewport||[],Fn(a)?a:[],s&&n?An(s):[])}return t.concat(a,An(a,[],n))}function da(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ll(e){const t=yt(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const a=kt(e),r=a?e.offsetWidth:n,o=a?e.offsetHeight:i,s=si(n)!==r||si(i)!==o;return s&&(n=r,i=o),{width:n,height:i,$:s}}function Wa(e){return gt(e)?e:e.contextElement}function cn(e){const t=Wa(e);if(!kt(t))return St(1);const n=t.getBoundingClientRect(),{width:i,height:a,$:r}=ll(t);let o=(r?si(n.width):n.width)/i,s=(r?si(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const Pb=St(0);function cl(e){const t=ot(e);return!Ha()||!t.visualViewport?Pb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ot(e)?!1:t}function $t(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),r=Wa(e);let o=St(1);t&&(i?gt(i)&&(o=cn(i)):o=cn(e));const s=Sb(r,n,i)?cl(r):St(0);let u=(a.left+s.x)/o.x,c=(a.top+s.y)/o.y,d=a.width/o.x,l=a.height/o.y;if(r){const m=ot(r),f=i&>(i)?ot(i):i;let p=m,y=da(p);for(;y&&i&&f!==p;){const b=cn(y),P=y.getBoundingClientRect(),k=yt(y),T=P.left+(y.clientLeft+parseFloat(k.paddingLeft))*b.x,v=P.top+(y.clientTop+parseFloat(k.paddingTop))*b.y;u*=b.x,c*=b.y,d*=b.x,l*=b.y,u+=T,c+=v,p=ot(y),y=da(p)}}return ci({width:d,height:l,x:u,y:c})}function ki(e,t){const n=Ti(e).scrollLeft;return t?t.left+n:$t(Nt(e)).left+n}function ul(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-ki(e,n),a=n.top+t.scrollTop;return{x:i,y:a}}function Tb(e){let{elements:t,rect:n,offsetParent:i,strategy:a}=e;const r=a==="fixed",o=Nt(i),s=t?Si(t.floating):!1;if(i===o||s&&r)return n;let u={scrollLeft:0,scrollTop:0},c=St(1);const d=St(0),l=kt(i);if((l||!l&&!r)&&((fn(i)!=="body"||Fn(o))&&(u=Ti(i)),kt(i))){const f=$t(i);c=cn(i),d.x=f.x+i.clientLeft,d.y=f.y+i.clientTop}const m=o&&!l&&!r?ul(o,u):St(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-u.scrollTop*c.y+d.y+m.y}}function kb(e){return Array.from(e.getClientRects())}function Cb(e){const t=Nt(e),n=Ti(e),i=e.ownerDocument.body,a=at(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=at(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+ki(e);const s=-n.scrollTop;return yt(i).direction==="rtl"&&(o+=at(t.clientWidth,i.clientWidth)-a),{width:a,height:r,x:o,y:s}}const yo=25;function Ab(e,t){const n=ot(e),i=Nt(e),a=n.visualViewport;let r=i.clientWidth,o=i.clientHeight,s=0,u=0;if(a){r=a.width,o=a.height;const d=Ha();(!d||d&&t==="fixed")&&(s=a.offsetLeft,u=a.offsetTop)}const c=ki(i);if(c<=0){const d=i.ownerDocument,l=d.body,m=getComputedStyle(l),f=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(i.clientWidth-l.clientWidth-f);p<=yo&&(r-=p)}else c<=yo&&(r+=c);return{width:r,height:o,x:s,y:u}}const Nb=new Set(["absolute","fixed"]);function Db(e,t){const n=$t(e,!0,t==="fixed"),i=n.top+e.clientTop,a=n.left+e.clientLeft,r=kt(e)?cn(e):St(1),o=e.clientWidth*r.x,s=e.clientHeight*r.y,u=a*r.x,c=i*r.y;return{width:o,height:s,x:u,y:c}}function bo(e,t,n){let i;if(t==="viewport")i=Ab(e,n);else if(t==="document")i=Cb(Nt(e));else if(gt(t))i=Db(t,n);else{const a=cl(e);i={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return ci(i)}function dl(e,t){const n=Yt(e);return n===t||!gt(n)||dn(n)?!1:yt(n).position==="fixed"||dl(n,t)}function Rb(e,t){const n=t.get(e);if(n)return n;let i=An(e,[],!1).filter(s=>gt(s)&&fn(s)!=="body"),a=null;const r=yt(e).position==="fixed";let o=r?Yt(e):e;for(;gt(o)&&!dn(o);){const s=yt(o),u=Ya(o);!u&&s.position==="fixed"&&(a=null),(r?!u&&!a:!u&&s.position==="static"&&!!a&&Nb.has(a.position)||Fn(o)&&!u&&dl(e,o))?i=i.filter(d=>d!==o):a=s,o=Yt(o)}return t.set(e,i),i}function Eb(e){let{element:t,boundary:n,rootBoundary:i,strategy:a}=e;const o=[...n==="clippingAncestors"?Si(t)?[]:Rb(t,this._c):[].concat(n),i],s=o[0],u=o.reduce((c,d)=>{const l=bo(t,d,a);return c.top=at(l.top,c.top),c.right=zt(l.right,c.right),c.bottom=zt(l.bottom,c.bottom),c.left=at(l.left,c.left),c},bo(t,s,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Ob(e){const{width:t,height:n}=ll(e);return{width:t,height:n}}function Mb(e,t,n){const i=kt(t),a=Nt(t),r=n==="fixed",o=$t(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const u=St(0);function c(){u.x=ki(a)}if(i||!i&&!r)if((fn(t)!=="body"||Fn(a))&&(s=Ti(t)),i){const f=$t(t,!0,r,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else a&&c();r&&!i&&a&&c();const d=a&&!i&&!r?ul(a,s):St(0),l=o.left+s.scrollLeft-u.x-d.x,m=o.top+s.scrollTop-u.y-d.y;return{x:l,y:m,width:o.width,height:o.height}}function Wi(e){return yt(e).position==="static"}function vo(e,t){if(!kt(e)||yt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Nt(e)===n&&(n=n.ownerDocument.body),n}function hl(e,t){const n=ot(e);if(Si(e))return n;if(!kt(e)){let a=Yt(e);for(;a&&!dn(a);){if(gt(a)&&!Wi(a))return a;a=Yt(a)}return n}let i=vo(e,t);for(;i&&fb(i)&&Wi(i);)i=vo(i,t);return i&&dn(i)&&Wi(i)&&!Ya(i)?n:i||wb(e)||n}const Ib=async function(e){const t=this.getOffsetParent||hl,n=this.getDimensions,i=await n(e.floating);return{reference:Mb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Lb(e){return yt(e).direction==="rtl"}const Fb={convertOffsetParentRelativeRectToViewportRelativeRect:Tb,getDocumentElement:Nt,getClippingRect:Eb,getOffsetParent:hl,getElementRects:Ib,getClientRects:kb,getDimensions:Ob,getScale:cn,isElement:gt,isRTL:Lb};function pl(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,i;const a=Nt(e);function r(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function o(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),r();const c=e.getBoundingClientRect(),{left:d,top:l,width:m,height:f}=c;if(s||t(),!m||!f)return;const p=Kn(l),y=Kn(a.clientWidth-(d+m)),b=Kn(a.clientHeight-(l+f)),P=Kn(d),T={rootMargin:-p+"px "+-y+"px "+-b+"px "+-P+"px",threshold:at(0,zt(1,u))||1};let v=!0;function g(A){const x=A[0].intersectionRatio;if(x!==u){if(!v)return o();x?o(!1,x):i=setTimeout(()=>{o(!1,1e-7)},1e3)}x===1&&!pl(c,e.getBoundingClientRect())&&o(),v=!1}try{n=new IntersectionObserver(g,{...T,root:a.ownerDocument})}catch{n=new IntersectionObserver(g,T)}n.observe(e)}return o(!0),r}function Bb(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,c=Wa(e),d=a||r?[...c?An(c):[],...An(t)]:[];d.forEach(P=>{a&&P.addEventListener("scroll",n,{passive:!0}),r&&P.addEventListener("resize",n)});const l=c&&s?Gb(c,n):null;let m=-1,f=null;o&&(f=new ResizeObserver(P=>{let[k]=P;k&&k.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=f)==null||T.observe(t)})),n()}),c&&!u&&f.observe(c),f.observe(t));let p,y=u?$t(e):null;u&&b();function b(){const P=$t(e);y&&!pl(y,P)&&n(),y=P,p=requestAnimationFrame(b)}return n(),()=>{var P;d.forEach(k=>{a&&k.removeEventListener("scroll",n),r&&k.removeEventListener("resize",n)}),l?.(),(P=f)==null||P.disconnect(),f=null,u&&cancelAnimationFrame(p)}}const jb=cb,Ub=ub,zb=ob,Yb=hb,Hb=sb,wo=rb,Wb=db,qb=(e,t,n)=>{const i=new Map,a={platform:Fb,...n},r={...a.platform,_c:i};return ab(e,t,{...a,platform:r})};var _b=typeof document<"u",Vb=function(){},$n=_b?w.useLayoutEffect:Vb;function ui(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,i,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!ui(e[i],t[i]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,a[i]))return!1;for(i=n;i--!==0;){const r=a[i];if(!(r==="_owner"&&e.$$typeof)&&!ui(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function ml(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xo(e,t){const n=ml(e);return Math.round(t*n)/n}function qi(e){const t=I.useRef(e);return $n(()=>{t.current=e}),t}function Kb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:a,elements:{reference:r,floating:o}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[d,l]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=I.useState(i);ui(m,i)||f(i);const[p,y]=I.useState(null),[b,P]=I.useState(null),k=I.useCallback(Q=>{Q!==A.current&&(A.current=Q,y(Q))},[]),T=I.useCallback(Q=>{Q!==x.current&&(x.current=Q,P(Q))},[]),v=r||p,g=o||b,A=I.useRef(null),x=I.useRef(null),S=I.useRef(d),D=u!=null,L=qi(u),H=qi(a),j=qi(c),G=I.useCallback(()=>{if(!A.current||!x.current)return;const Q={placement:t,strategy:n,middleware:m};H.current&&(Q.platform=H.current),qb(A.current,x.current,Q).then(se=>{const E={...se,isPositioned:j.current!==!1};q.current&&!ui(S.current,E)&&(S.current=E,Bo.flushSync(()=>{l(E)}))})},[m,t,n,H,j]);$n(()=>{c===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,l(Q=>({...Q,isPositioned:!1})))},[c]);const q=I.useRef(!1);$n(()=>(q.current=!0,()=>{q.current=!1}),[]),$n(()=>{if(v&&(A.current=v),g&&(x.current=g),v&&g){if(L.current)return L.current(v,g,G);G()}},[v,g,G,L,D]);const Z=I.useMemo(()=>({reference:A,floating:x,setReference:k,setFloating:T}),[k,T]),F=I.useMemo(()=>({reference:v,floating:g}),[v,g]),W=I.useMemo(()=>{const Q={position:n,left:0,top:0};if(!F.floating)return Q;const se=xo(F.floating,d.x),E=xo(F.floating,d.y);return s?{...Q,transform:"translate("+se+"px, "+E+"px)",...ml(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:se,top:E}},[n,s,F.floating,d.x,d.y]);return I.useMemo(()=>({...d,update:G,refs:Z,elements:F,floatingStyles:W}),[d,G,Z,F,W])}const Jb=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:a}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?wo({element:i.current,padding:a}).fn(n):{}:i?wo({element:i,padding:a}).fn(n):{}}}},Xb=(e,t)=>({...jb(e),options:[e,t]}),Zb=(e,t)=>({...Ub(e),options:[e,t]}),Qb=(e,t)=>({...Wb(e),options:[e,t]}),$b=(e,t)=>({...zb(e),options:[e,t]}),ev=(e,t)=>({...Yb(e),options:[e,t]}),tv=(e,t)=>({...Hb(e),options:[e,t]}),nv=(e,t)=>({...Jb(e),options:[e,t]});var iv="Arrow",fl=I.forwardRef((e,t)=>{const{children:n,width:i=10,height:a=5,...r}=e;return h.jsx(Wt.svg,{...r,ref:t,width:i,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});fl.displayName=iv;var av=fl,qa="Popper",[gl,yl]=$s(qa),[rv,bl]=gl(qa),vl=e=>{const{__scopePopper:t,children:n}=e,[i,a]=I.useState(null);return h.jsx(rv,{scope:t,anchor:i,onAnchorChange:a,children:n})};vl.displayName=qa;var wl="PopperAnchor",xl=I.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:i,...a}=e,r=bl(wl,n),o=I.useRef(null),s=tn(t,o),u=I.useRef(null);return I.useEffect(()=>{const c=u.current;u.current=i?.current||o.current,c!==u.current&&r.onAnchorChange(u.current)}),i?null:h.jsx(Wt.div,{...a,ref:s})});xl.displayName=wl;var _a="PopperContent",[ov,sv]=gl(_a),Pl=I.forwardRef((e,t)=>{const{__scopePopper:n,side:i="bottom",sideOffset:a=0,align:r="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:l="partial",hideWhenDetached:m=!1,updatePositionStrategy:f="optimized",onPlaced:p,...y}=e,b=bl(_a,n),[P,k]=I.useState(null),T=tn(t,J=>k(J)),[v,g]=I.useState(null),A=qy(v),x=A?.width??0,S=A?.height??0,D=i+(r!=="center"?"-"+r:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},H=Array.isArray(c)?c:[c],j=H.length>0,G={padding:L,boundary:H.filter(cv),altBoundary:j},{refs:q,floatingStyles:Z,placement:F,isPositioned:W,middlewareData:Q}=Kb({strategy:"fixed",placement:D,whileElementsMounted:(...J)=>Bb(...J,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[Xb({mainAxis:a+S,alignmentAxis:o}),u&&Zb({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?Qb():void 0,...G}),u&&$b({...G}),ev({...G,apply:({elements:J,rects:$,availableWidth:ne,availableHeight:le})=>{const{width:pe,height:V}=$.reference,xe=J.floating.style;xe.setProperty("--radix-popper-available-width",`${ne}px`),xe.setProperty("--radix-popper-available-height",`${le}px`),xe.setProperty("--radix-popper-anchor-width",`${pe}px`),xe.setProperty("--radix-popper-anchor-height",`${V}px`)}}),v&&nv({element:v,padding:s}),uv({arrowWidth:x,arrowHeight:S}),m&&tv({strategy:"referenceHidden",...G})]}),[se,E]=kl(F),N=xi(p);Ut(()=>{W&&N?.()},[W,N]);const z=Q.arrow?.x,B=Q.arrow?.y,U=Q.arrow?.centerOffset!==0,[_,X]=I.useState();return Ut(()=>{P&&X(window.getComputedStyle(P).zIndex)},[P]),h.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:W?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_,"--radix-popper-transform-origin":[Q.transformOrigin?.x,Q.transformOrigin?.y].join(" "),...Q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(ov,{scope:n,placedSide:se,onArrowChange:g,arrowX:z,arrowY:B,shouldHideArrow:U,children:h.jsx(Wt.div,{"data-side":se,"data-align":E,...y,ref:T,style:{...y.style,animation:W?void 0:"none"}})})})});Pl.displayName=_a;var Sl="PopperArrow",lv={top:"bottom",right:"left",bottom:"top",left:"right"},Tl=I.forwardRef(function(t,n){const{__scopePopper:i,...a}=t,r=sv(Sl,i),o=lv[r.placedSide];return h.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:h.jsx(av,{...a,ref:n,style:{...a.style,display:"block"}})})});Tl.displayName=Sl;function cv(e){return e!==null}var uv=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:i,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,s=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[c,d]=kl(n),l={start:"0%",center:"50%",end:"100%"}[d],m=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+u/2;let p="",y="";return c==="bottom"?(p=o?l:`${m}px`,y=`${-u}px`):c==="top"?(p=o?l:`${m}px`,y=`${i.floating.height+u}px`):c==="right"?(p=`${-u}px`,y=o?l:`${f}px`):c==="left"&&(p=`${i.floating.width+u}px`,y=o?l:`${f}px`),{data:{x:p,y}}}});function kl(e){const[t,n="center"]=e.split("-");return[t,n]}var dv=vl,hv=xl,pv=Pl,mv=Tl,[Ci]=$s("Tooltip",[yl]),Ai=yl(),Cl="TooltipProvider",fv=700,ha="tooltip.open",[gv,Va]=Ci(Cl),Al=e=>{const{__scopeTooltip:t,delayDuration:n=fv,skipDelayDuration:i=300,disableHoverableContent:a=!1,children:r}=e,o=I.useRef(!0),s=I.useRef(!1),u=I.useRef(0);return I.useEffect(()=>{const c=u.current;return()=>window.clearTimeout(c)},[]),h.jsx(gv,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{window.clearTimeout(u.current),o.current=!1},[]),onClose:I.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,i)},[i]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(c=>{s.current=c},[]),disableHoverableContent:a,children:r})};Al.displayName=Cl;var Nn="Tooltip",[yv,Gn]=Ci(Nn),Nl=e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:a,onOpenChange:r,disableHoverableContent:o,delayDuration:s}=e,u=Va(Nn,e.__scopeTooltip),c=Ai(t),[d,l]=I.useState(null),m=Ly(),f=I.useRef(0),p=o??u.disableHoverableContent,y=s??u.delayDuration,b=I.useRef(!1),[P,k]=Ay({prop:i,defaultProp:a??!1,onChange:x=>{x?(u.onOpen(),document.dispatchEvent(new CustomEvent(ha))):u.onClose(),r?.(x)},caller:Nn}),T=I.useMemo(()=>P?b.current?"delayed-open":"instant-open":"closed",[P]),v=I.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b.current=!1,k(!0)},[k]),g=I.useCallback(()=>{window.clearTimeout(f.current),f.current=0,k(!1)},[k]),A=I.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{b.current=!0,k(!0),f.current=0},y)},[y,k]);return I.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),h.jsx(dv,{...c,children:h.jsx(yv,{scope:t,contentId:m,open:P,stateAttribute:T,trigger:d,onTriggerChange:l,onTriggerEnter:I.useCallback(()=>{u.isOpenDelayedRef.current?A():v()},[u.isOpenDelayedRef,A,v]),onTriggerLeave:I.useCallback(()=>{p?g():(window.clearTimeout(f.current),f.current=0)},[g,p]),onOpen:v,onClose:g,disableHoverableContent:p,children:n})})};Nl.displayName=Nn;var pa="TooltipTrigger",Dl=I.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,a=Gn(pa,n),r=Va(pa,n),o=Ai(n),s=I.useRef(null),u=tn(t,s,a.onTriggerChange),c=I.useRef(!1),d=I.useRef(!1),l=I.useCallback(()=>c.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),h.jsx(hv,{asChild:!0,...o,children:h.jsx(Wt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...i,ref:u,onPointerMove:Ot(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!r.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ot(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:Ot(e.onPointerDown,()=>{a.open&&a.onClose(),c.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:Ot(e.onFocus,()=>{c.current||a.onOpen()}),onBlur:Ot(e.onBlur,a.onClose),onClick:Ot(e.onClick,a.onClose)})})});Dl.displayName=pa;var Ka="TooltipPortal",[bv,vv]=Ci(Ka,{forceMount:void 0}),Rl=e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:a}=e,r=Gn(Ka,t);return h.jsx(bv,{scope:t,forceMount:n,children:h.jsx(Ba,{present:n||r.open,children:h.jsx(il,{asChild:!0,container:a,children:i})})})};Rl.displayName=Ka;var hn="TooltipContent",El=I.forwardRef((e,t)=>{const n=vv(hn,e.__scopeTooltip),{forceMount:i=n.forceMount,side:a="top",...r}=e,o=Gn(hn,e.__scopeTooltip);return h.jsx(Ba,{present:i||o.open,children:o.disableHoverableContent?h.jsx(Ol,{side:a,...r,ref:t}):h.jsx(wv,{side:a,...r,ref:t})})}),wv=I.forwardRef((e,t)=>{const n=Gn(hn,e.__scopeTooltip),i=Va(hn,e.__scopeTooltip),a=I.useRef(null),r=tn(t,a),[o,s]=I.useState(null),{trigger:u,onClose:c}=n,d=a.current,{onPointerInTransitChange:l}=i,m=I.useCallback(()=>{s(null),l(!1)},[l]),f=I.useCallback((p,y)=>{const b=p.currentTarget,P={x:p.clientX,y:p.clientY},k=kv(P,b.getBoundingClientRect()),T=Cv(P,k),v=Av(y.getBoundingClientRect()),g=Dv([...T,...v]);s(g),l(!0)},[l]);return I.useEffect(()=>()=>m(),[m]),I.useEffect(()=>{if(u&&d){const p=b=>f(b,d),y=b=>f(b,u);return u.addEventListener("pointerleave",p),d.addEventListener("pointerleave",y),()=>{u.removeEventListener("pointerleave",p),d.removeEventListener("pointerleave",y)}}},[u,d,f,m]),I.useEffect(()=>{if(o){const p=y=>{const b=y.target,P={x:y.clientX,y:y.clientY},k=u?.contains(b)||d?.contains(b),T=!Nv(P,o);k?m():T&&(m(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[u,d,o,c,m]),h.jsx(Ol,{...e,ref:r})}),[xv,Pv]=Ci(Nn,{isInside:!1}),Sv=gy("TooltipContent"),Ol=I.forwardRef((e,t)=>{const{__scopeTooltip:n,children:i,"aria-label":a,onEscapeKeyDown:r,onPointerDownOutside:o,...s}=e,u=Gn(hn,n),c=Ai(n),{onClose:d}=u;return I.useEffect(()=>(document.addEventListener(ha,d),()=>document.removeEventListener(ha,d)),[d]),I.useEffect(()=>{if(u.trigger){const l=m=>{m.target?.contains(u.trigger)&&d()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[u.trigger,d]),h.jsx(tl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l=>l.preventDefault(),onDismiss:d,children:h.jsxs(pv,{"data-state":u.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Sv,{children:i}),h.jsx(xv,{scope:n,isInside:!0,children:h.jsx(Ty,{id:u.contentId,role:"tooltip",children:a||i})})]})})});El.displayName=hn;var Ml="TooltipArrow",Tv=I.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,a=Ai(n);return Pv(Ml,n).isInside?null:h.jsx(mv,{...a,...i,ref:t})});Tv.displayName=Ml;function kv(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,i,a,r)){case r:return"left";case a:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function Cv(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function Av(e){const{top:t,right:n,bottom:i,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:i},{x:a,y:i}]}function Nv(e,t){const{x:n,y:i}=e;let a=!1;for(let r=0,o=t.length-1;r<t.length;o=r++){const s=t[r],u=t[o],c=s.x,d=s.y,l=u.x,m=u.y;d>i!=m>i&&n<(l-c)*(i-d)/(m-d)+c&&(a=!a)}return a}function Dv(e){const t=e.slice();return t.sort((n,i)=>n.x<i.x?-1:n.x>i.x?1:n.y<i.y?-1:n.y>i.y?1:0),Rv(t)}function Rv(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i<e.length;i++){const a=e[i];for(;t.length>=2;){const r=t[t.length-1],o=t[t.length-2];if((r.x-o.x)*(a.y-o.y)>=(r.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const a=e[i];for(;n.length>=2;){const r=n[n.length-1],o=n[n.length-2];if((r.x-o.x)*(a.y-o.y)>=(r.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ev=Al,Ov=Nl,Mv=Dl,Iv=Rl,Il=El;const Lv=({delayDuration:e=0,...t})=>h.jsx(Ev,{delayDuration:e,...t}),Fv=Ov,Gv=Mv,Ll=I.forwardRef(({className:e,sideOffset:t=4,...n},i)=>h.jsx(Iv,{children:h.jsx(Il,{ref:i,sideOffset:t,className:ft("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md border px-3 py-1.5 text-sm shadow-md",e),...n})}));Ll.displayName=Il.displayName;const _i=({text:e,children:t})=>h.jsx(Lv,{children:h.jsxs(Fv,{children:[h.jsx(Gv,{asChild:!0,children:h.jsx("span",{className:"inline-flex items-start gap-1",children:t&&t})}),h.jsx(Ll,{className:"rounded-sm border-none bg-gray-200 p-1 text-xs",children:e&&h.jsx("p",{children:e})})]})}),Bv=[{label:"15M",value:"15"},{label:"30M",value:"30"},{label:"1H",value:"60"},{label:"2H",value:"120"},{label:"4H",value:"240"},{label:"1D",value:"1D"}],jv=[{labelKey:"Selector.periodAll",value:0},{labelKey:"Selector.periodLastYear",value:1},{labelKey:"Selector.periodLast3Years",value:3},{labelKey:"Selector.periodLast5Years",value:5},{labelKey:"Selector.periodLast15Years",value:15}],Uv=[10,20,25,30,40],zv=({control:e})=>{const{t}=At();return h.jsxs("div",{className:"iccandle-scanner-advanced-options",children:[h.jsxs("div",{className:"iccandle-scanner-advanced-options__row",children:[h.jsxs("label",{className:"iccandle-scanner-advanced-options__label",children:[t("Selector.topResults"),h.jsx(_i,{text:t("Selector.topResultsTooltip")})]}),h.jsx(Yi,{control:e,name:"top_k",render:({field:n})=>h.jsx("div",{className:"iccandle-scanner-advanced-options__native-select-wrap iccandle-scanner-advanced-options__native-select-wrap--small",children:h.jsx("select",{className:"iccandle-scanner-advanced-options__native-select",value:String(n.value??10),onChange:i=>n.onChange(Number(i.target.value)||0),children:Uv.map(i=>h.jsx("option",{value:String(i),children:i},i))})})})]}),h.jsxs("div",{className:"iccandle-scanner-advanced-options__row",children:[h.jsxs("label",{className:"iccandle-scanner-advanced-options__label",children:[t("Common.timeframe"),h.jsx(_i,{text:t("Selector.timeframeTooltip")})]}),h.jsx(Yi,{control:e,name:"timeframe",render:({field:n})=>h.jsx("div",{className:"iccandle-scanner-advanced-options__native-select-wrap iccandle-scanner-advanced-options__native-select-wrap--small",children:h.jsx("select",{className:"iccandle-scanner-advanced-options__native-select",value:n.value,onChange:i=>n.onChange(i.target.value),children:Bv.map(i=>h.jsx("option",{value:i.value,children:i.label},i.value))})})})]}),h.jsxs("div",{className:"iccandle-scanner-advanced-options__row",children:[h.jsxs("label",{className:"iccandle-scanner-advanced-options__label",children:[t("Selector.period"),h.jsx(_i,{text:t("Selector.periodTooltip")})]}),h.jsx(Yi,{control:e,name:"period",render:({field:n})=>h.jsx("div",{className:"iccandle-scanner-advanced-options__native-select-wrap iccandle-scanner-advanced-options__native-select-wrap--large",children:h.jsx("select",{className:"iccandle-scanner-advanced-options__native-select",value:String(n.value??0),onChange:i=>n.onChange(Number(i.target.value)||0),children:jv.map(i=>h.jsx("option",{value:String(i.value),children:t(i.labelKey)},i.value))})})})]})]})},Vt={min:10,max:50,custom:[60,70,80,90,100]},Tt=[{ticker:"EUR_JPY",display_name:"EURJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"EUR JPY",type:"forex",session:"1700-1700"},{ticker:"GBP_JPY",display_name:"GBPJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"GBP JPY",type:"forex",session:"1700-1700"},{ticker:"AUD_JPY",display_name:"AUDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/AUD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"AUD JPY",type:"forex",session:"1700-1700"},{ticker:"NZD_JPY",display_name:"NZDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"NZD JPY",type:"forex",session:"1700-1700"},{ticker:"CAD_JPY",display_name:"CADJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/CAD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"CAD JPY",type:"forex",session:"1700-1700"},{ticker:"CHF_JPY",display_name:"CHFJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/CHF.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"CHF JPY",type:"forex",session:"1700-1700"},{ticker:"USD_JPY",display_name:"USDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"USD JPY",type:"forex",session:"1700-1700"},{ticker:"EUR_USD",display_name:"EURUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"EUR USD",type:"forex",session:"1700-1700"},{ticker:"AUD_USD",display_name:"AUDUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/AUD.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"AUD USD",type:"forex",session:"1700-1700"},{ticker:"NZD_USD",display_name:"NZDUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"NZD USD",type:"forex",session:"1700-1700"},{ticker:"USD_CHF",display_name:"USDCHF",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/CHF.svg"],description:"USD CHF",type:"forex",session:"1700-1700"},{ticker:"USD_CAD",display_name:"USDCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"USD CAD",type:"forex",session:"1700-1700"},{ticker:"GBP_AUD",display_name:"GBPAUD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/AUD.svg"],description:"GBP AUD",type:"forex",session:"1700-1700"},{ticker:"GBP_CAD",display_name:"GBPCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"GBP CAD",type:"forex",session:"1700-1700"},{ticker:"GBP_CHF",display_name:"GBPCHF",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/CHF.svg"],description:"GBP CHF",type:"forex",session:"1700-1700"},{ticker:"GBP_NZD",display_name:"GBPNZD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/NZD.svg"],description:"GBP NZD",type:"forex",session:"1700-1700"},{ticker:"GBP_USD",display_name:"GBPUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"GBP USD",type:"forex",session:"1700-1700"},{ticker:"NZD_CAD",display_name:"NZDCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"NZD CAD",type:"forex",session:"1700-1700"},{ticker:"EUR_CAD",display_name:"EURCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"EUR CAD",type:"forex",session:"1700-1700"},{ticker:"EUR_AUD",display_name:"EURAUD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/AUD.svg"],description:"EUR AUD",type:"forex",session:"1700-1700"},{ticker:"XAU_USD",display_name:"XAUUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XAU.svg"],description:"Gold",type:"commodity",session:"1700-1700"},{ticker:"BCO_USD",display_name:"BCOUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/BCO.svg"],description:"Brent Crude Oil",type:"commodity",session:"1700-1700"},{ticker:"SPX500_USD",display_name:"S&P500",logo_urls:["https://cdn.iccandle.ai/web-assets/SPX500.svg"],description:"S&P 500",type:"indices",session:"1700-1700"},{ticker:"NAS100_USD",display_name:"NASDAQ100",logo_urls:["https://cdn.iccandle.ai/web-assets/NAS100.svg"],description:"NASDAQ 100",type:"indices",session:"1700-1700"},{ticker:"US30_USD",display_name:"US30",logo_urls:["https://cdn.iccandle.ai/web-assets/US30.svg"],description:"US Wall St 30",type:"indices",session:"1700-1700"},{ticker:"BTCUSDT",display_name:"BTCUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/BTC.svg"],description:"BTCUSDT",type:"crypto",session:"24x7"},{ticker:"ETHUSDT",display_name:"ETHUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/ETH.svg"],description:"ETHUSDT",type:"crypto",session:"24x7"},{ticker:"XRPUSDT",display_name:"XRPUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/XRP.svg"],description:"XRPUSDT",type:"crypto",session:"24x7"},{ticker:"SOLUSDT",display_name:"SOLUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/SOL.svg"],description:"SOLUSDT",type:"crypto",session:"24x7"},{ticker:"ADAUSDT",display_name:"ADAUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/ADA.svg"],description:"ADAUSDT",type:"crypto",session:"24x7"},{ticker:"AVAUSDT",display_name:"AVAUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/AVA.svg"],description:"AVAUSDT",type:"crypto",session:"24x7"},{ticker:"AVAXUSDT",display_name:"AVAXUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/AVAX.svg"],description:"AVAXUSDT",type:"crypto",session:"24x7"},{ticker:"BNBUSDT",display_name:"BNBUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/BNB.svg"],description:"BNBUSDT",type:"crypto",session:"24x7"},{ticker:"DOGEUSDT",display_name:"DOGEUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/DOGE.svg"],description:"DOGEUSDT",type:"crypto",session:"24x7"},{ticker:"DOTUSDT",display_name:"DOTUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/DOT.svg"],description:"DOTUSDT",type:"crypto",session:"24x7"},{ticker:"TRXUSDT",display_name:"TRXUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/TRX.svg"],description:"TRXUSDT",type:"crypto",session:"24x7"},{ticker:"AAPL",display_name:"AAPL",logo_urls:["https://cdn.iccandle.ai/web-assets/AAPL.svg"],description:"Apple Inc.",type:"stock",session:"24x7"},{ticker:"AMZN",display_name:"AMZN",logo_urls:["https://cdn.iccandle.ai/web-assets/AMZN.svg"],description:"Amazon.Com Inc",type:"stock",session:"24x7"},{ticker:"BRK.B",display_name:"BRK.B",logo_urls:["https://cdn.iccandle.ai/web-assets/BRK.B.svg"],description:"BERKSHIRE HATHAWAY Class B",type:"stock",session:"24x7"},{ticker:"GOOGL",display_name:"GOOGL",logo_urls:["https://cdn.iccandle.ai/web-assets/GOOGL.svg"],description:"Alphabet Inc. Class A Common Stock",type:"stock",session:"24x7"},{ticker:"KO",display_name:"KO",logo_urls:["https://cdn.iccandle.ai/web-assets/KO.svg"],description:"Coca-Cola Company",type:"stock",session:"24x7"},{ticker:"META",display_name:"META",logo_urls:["https://cdn.iccandle.ai/web-assets/META.svg"],description:"Meta Platforms, Inc. Class A Common Stock",type:"stock",session:"24x7"},{ticker:"MSFT",display_name:"MSFT",logo_urls:["https://cdn.iccandle.ai/web-assets/MSFT.svg"],description:"Microsoft Corp",type:"stock",session:"24x7"},{ticker:"NFLX",display_name:"NFLX",logo_urls:["https://cdn.iccandle.ai/web-assets/NFLX.svg"],description:"NetFlix Inc",type:"stock",session:"24x7"},{ticker:"NKE",display_name:"NKE",logo_urls:["https://cdn.iccandle.ai/web-assets/NKE.svg"],description:"Nike, Inc.",type:"stock",session:"24x7"},{ticker:"NVDA",display_name:"NVDA",logo_urls:["https://cdn.iccandle.ai/web-assets/NVDA.svg"],description:"Nvidia Corp",type:"stock",session:"24x7"},{ticker:"TME",display_name:"TME",logo_urls:["https://cdn.iccandle.ai/web-assets/TME.svg"],description:"Tencent Music Entertainment Group American Depositary Shares, each representing two Class A Ordinary Shares",type:"stock",session:"24x7"},{ticker:"TSLA",display_name:"TSLA",logo_urls:["https://cdn.iccandle.ai/web-assets/TSLA.svg"],description:"Tesla, Inc. Common Stock",type:"stock",session:"24x7"},{ticker:"XAG_USD",display_name:"XAGUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XAG.svg"],description:"Silver",type:"commodity",session:"1700-1700"},{ticker:"XCU_USD",display_name:"XCUUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XCU.svg"],description:"Copper",type:"commodity",session:"1700-1700"}],Fl=({name:e})=>{const t=Tt?.find(n=>n.ticker===e)?.logo_urls.map(n=>n)||[];return h.jsxs("div",{className:"iccandle-forexIcons",children:[t.length===1&&h.jsx("img",{src:t[0],alt:"forex icon",width:24,height:24,className:"iccandle-forexIcons__img iccandle-forexIcons__img--single"}),t.length===2&&h.jsxs(h.Fragment,{children:[h.jsx("img",{src:t[0],alt:"forex icon 1",width:18,height:18,className:"iccandle-forexIcons__img iccandle-forexIcons__img--left"}),h.jsx("img",{src:t[1],alt:"forex icon 2",width:18,height:18,className:"iccandle-forexIcons__img iccandle-forexIcons__img--right"})]})]})},Yv={all:"Common.all",forex:"Layout.helperBar.groupForex",crypto:"Layout.helperBar.groupCrypto",indices:"Layout.helperBar.groupIndices",commodity:"Layout.helperBar.groupCommodity",stock:"Layout.helperBar.groupStock"},Gl=({searchTerm:e,onSearchChange:t,selectedType:n,onTypeChange:i,selectAll:a,onSelectAll:r,selectedSymbols:o,onSymbolChange:s,filteredSymbols:u})=>{const{t:c}=At(),d=Object.values(o).filter(Boolean).length,l=d<=1?c("Pattern.symbolSelected",{count:d}):c("Pattern.symbolsSelected",{count:d});return h.jsxs("div",{className:"iccandle-scanner-symbol-search",children:[h.jsxs("div",{className:"iccandle-scanner-symbol-search__bar",children:[h.jsx(qo,{strokeWidth:.5,className:"iccandle-scanner-symbol-search__search-icon"}),h.jsx("input",{className:"iccandle-scanner-symbol-search__input",placeholder:c("Selector.searchSymbol"),value:e,onChange:m=>t(m.target.value.toUpperCase())}),h.jsxs("span",{className:"iccandle-scanner-symbol-search__count-badge",children:[h.jsx("span",{className:"iccandle-scanner-symbol-search__count-desktop",children:l}),h.jsx("span",{className:"iccandle-scanner-symbol-search__count-mobile",children:!d})]})]}),h.jsx("div",{className:"iccandle-scanner-symbol-search__types-wrap",children:h.jsx("div",{className:"iccandle-scanner-symbol-search__types-list",children:tg.map((m,f)=>h.jsx("button",{type:"button",className:ft("iccandle-scanner-symbol-search__type-badge",n===m.value?"iccandle-scanner-symbol-search__type-badge--active":"iccandle-scanner-symbol-search__type-badge--inactive"),onClick:()=>i(m.value),children:h.jsx("span",{className:ft("iccandle-scanner-symbol-search__type-label",n===m.value?"iccandle-scanner-symbol-search__type-label--active":"iccandle-scanner-symbol-search__type-label--inactive"),children:c(Yv[m.value]??"Common.all")})},f))})}),h.jsxs("div",{className:"iccandle-scanner-symbol-search__table-wrap",children:[h.jsxs("div",{className:"iccandle-scanner-symbol-search__table-head",children:[h.jsx("input",{type:"checkbox",className:"iccandle-scanner-symbol-search__checkbox",checked:a,onChange:m=>r(m.target.checked),"aria-label":c("Selector.selectAll")}),h.jsx("span",{className:"iccandle-scanner-symbol-search__symbol-title",children:c("Common.columnSymbol")}),h.jsx("span",{className:"iccandle-scanner-symbol-search__description-title",children:c("Common.columnDescription")})]}),h.jsxs("div",{className:"iccandle-scanner-symbol-search__list-container",children:[h.jsx("ul",{className:"iccandle-scanner-symbol-search__symbol-list",children:u?.map(m=>h.jsxs(w.Fragment,{children:[h.jsxs("li",{className:"iccandle-scanner-symbol-search__symbol-row",children:[h.jsx("input",{type:"checkbox",className:"iccandle-scanner-symbol-search__checkbox iccandle-scanner-symbol-search__checkbox--row",checked:!!o[m.ticker],onChange:f=>s(m.ticker,f.target.checked),"aria-label":c("Selector.selectSymbolAria",{symbol:m.ticker})}),h.jsx(Fl,{name:m.ticker}),h.jsx("span",{className:"iccandle-scanner-symbol-search__symbol-name",children:m.display_name})]}),h.jsx("hr",{className:"iccandle-scanner-symbol-search__row-divider"})]},m.ticker))}),h.jsx("ul",{className:"iccandle-scanner-symbol-search__description-list",children:u?.map(m=>h.jsxs(w.Fragment,{children:[h.jsxs("li",{className:"iccandle-scanner-symbol-search__description-row",children:[h.jsx("span",{className:"iccandle-scanner-symbol-search__description-text",children:m.description}),h.jsx("span",{className:"iccandle-scanner-symbol-search__type-text",children:m.type})]}),h.jsx("hr",{className:"iccandle-scanner-symbol-search__row-divider"})]},m.ticker))})]})]})]})},Po=["Selector.tabSymbols","Selector.tabAdvancedOptions"],Hv=({handleCloseDialog:e,timeframe:t,setResolution:n})=>{const{t:i}=At(),[a,r]=w.useState(Po[0]),o=typeof window<"u"?JSON.parse(localStorage.getItem("search-filter")||"{}"):null,[s,u]=w.useState(""),[c,d]=w.useState("all"),[l,m]=w.useState(()=>o?.symbols?o.symbols.reduce((g,A)=>(g[A]=!0,g),{}):{}),f=Tt?.filter(g=>{const A=g.display_name.toLowerCase().includes(s.toLowerCase()),x=c?c==="all"?!0:g.type===c:!0;return A&&x}),p=f?.length?f.every(g=>l[g.ticker]):!1,[y,b]=w.useState(p);w.useEffect(()=>{b(p)},[p]);const P=g=>{if(!f)return;const A=f.reduce((x,S)=>(x[S.ticker]=g,x),{});m(x=>({...x,...A})),b(g)},k=(g,A)=>{m(x=>({...x,[g]:A}))},T=Ks({defaultValues:{probability:o?.probability||0,top_k:o?.top_k||25,timeframe:t==="1"||t==="5"?"60":t||"60",period:o?.period||0}}),v=g=>{const A=Object.entries(l).filter(([L,H])=>H).map(([L])=>L),x=Array.from(new Set(Tt.filter(L=>A.includes(L.ticker)).map(L=>L.type))),S=Tt?.every(L=>l[L.ticker])??!1,D={...typeof g=="object"&&g!==null?g:{},symbols:A,symbolTypes:x,isAllSelected:S};localStorage.setItem("search-filter",JSON.stringify(D)),n(g?.timeframe),e()};return w.useEffect(()=>{y&&(f?.every(A=>l[A.ticker])||b(!1))},[l,f,y]),w.useEffect(()=>{const g=A=>{A.key==="Escape"&&e()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[e]),h.jsx("div",{className:"iccandle-scanner-option",role:"dialog","aria-modal":"true","aria-label":i("Selector.scannerOptions"),onPointerDown:g=>{g.target===g.currentTarget&&e()},children:h.jsxs("div",{className:"iccandle-scanner-option__card",onPointerDown:g=>g.stopPropagation(),children:[h.jsxs("div",{className:"iccandle-scanner-option__header",children:[h.jsx("div",{className:"iccandle-scanner-option__title",children:i("Selector.scannerOptions")}),h.jsx("button",{type:"button",onClick:e,className:"iccandle-scanner-option__close-btn","aria-label":i("Common.close"),children:h.jsx(_o,{size:20})})]}),h.jsx("div",{className:"iccandle-scanner-option__tabs",children:Po.map(g=>h.jsx("button",{type:"button",onClick:()=>r(g),className:ft("iccandle-scanner-option__tab",a===g?"iccandle-scanner-option__tab--active":"iccandle-scanner-option__tab--inactive"),children:i(g)},g))}),h.jsxs("form",{className:"iccandle-scanner-option__form",onSubmit:T.handleSubmit(v),children:[h.jsxs("div",{className:"iccandle-scanner-option__body",children:[h.jsx("div",{className:ft("iccandle-scanner-option__advanced-content",a!=="Selector.tabSymbols"?"iccandle-scanner-option__content--visible":"iccandle-scanner-option__content--hidden"),children:h.jsx(zv,{control:T.control})}),h.jsx("div",{className:ft(a==="Selector.tabSymbols"?"iccandle-scanner-option__content--visible":"iccandle-scanner-option__content--hidden"),children:h.jsx(Gl,{searchTerm:s,onSearchChange:u,selectedType:c,onTypeChange:d,selectAll:y,onSelectAll:P,selectedSymbols:l,onSymbolChange:k,filteredSymbols:f})})]}),h.jsxs("div",{className:"iccandle-scanner-option__actions",children:[h.jsx("button",{type:"button",className:"iccandle-scanner-option__btn iccandle-scanner-option__btn--outline",onClick:e,children:i("Common.cancel")}),h.jsx("button",{type:"submit",className:"iccandle-scanner-option__btn iccandle-scanner-option__btn--primary",children:i("Selector.saveOptions")})]})]})]})})};function Wv(e,t){w.useEffect(()=>{const n=async({origin:i,data:a})=>{if(i!==Jt||typeof a!="string")return;const r=JSON.parse(a),o=JSON.parse(localStorage.getItem(ni)||"[]"),s=e?.activeChart?.();await e?.headerReady(),r.length<o.length&&await new Promise(u=>{setTimeout(()=>{s?.clearMarks(2),u(!0)},150)}),localStorage.setItem(ni,JSON.stringify(r)),s?.refreshMarks();try{if(t.current&&t.current.length>0&&(t.current.forEach(u=>{try{s?.removeEntity(u)}catch{}}),t.current=[]),r.length===0)return;for(const u of r)try{const c=await s?.createShape({time:Math.floor(u.timestamp/1e3)},{shape:"vertical_line",lock:!0,disableSelection:!0,overrides:{linestyle:2,linewidth:1}});c&&(s?.getShapeById(c)?.setSavingEnabled(!1),t.current.push(c))}catch{}}catch{}};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)},[e,t])}function qv(e,t,n=1){if(t===0||!isFinite(t))return n;const i=e/t;return isFinite(i)?i:n}function So(e){if(e.length===0)return 0;const t=[...e].sort((i,a)=>i-a),n=Math.floor(t.length/2);return t.length%2!==0?t[n]:(t[n-1]+t[n])/2}function _v(e,t,n=[]){if(e.length===0)return[];const i=n.map(d=>Math.abs(d.c-d.o)),a=e.map(d=>Math.abs(d.c-d.o)),r=So(a),o=So(i),s=qv(o,r),u=e[0].o,c=t.c;return e.map(d=>{const l=(d.o-u)*s+c,m=(d.h-u)*s+c,f=(d.l-u)*s+c,p=(d.c-u)*s+c;return{o:l,h:Math.max(m,l,p),l:Math.min(f,l,p),c:p}})}const ei=8,Bl=4,ma=6,fa=5,jl=e=>{const t=new Date(e+ei*60*60*1e3),n=t.getUTCDay(),i=t.getUTCHours();return n===0?!1:n===1?i>=ma:n===6?i<Bl:i!==fa},Ul=e=>{const t=new Date(e+ei*60*60*1e3),n=t.getUTCDay(),i=t.getUTCHours();if(n===0||n===1&&i<ma||n===6&&i>=Bl){const a=(8-n)%7;return t.setUTCDate(t.getUTCDate()+a),t.setUTCHours(ma,0,0,0),t.getTime()-ei*60*60*1e3}return n>=2&&n<=5&&i===fa?(t.setUTCHours(fa+1,0,0,0),t.getTime()-ei*60*60*1e3):e},Vv=(e,t,n)=>{const i=mt(t)*1e3,a=[];let r=e;for(let o=0;o<n;o++)r+=i,jl(r)||(r=Ul(r)),a.push(r);return a},To=(e,t,n,i)=>{if(n<=0)return[];if(i==="24x7"){const r=mt(t)*1e3;return Array.from({length:n},(o,s)=>e+(s+1)*r)}if(i==="1700-1700")return Vv(e,t,n);const a=mt(t)*1e3;return Array.from({length:n},(r,o)=>e+(o+1)*a)},Kv=(e,t,n,i)=>{if(i==="24x7"){const r=mt(n)*1e3;return Math.max(0,Math.floor((t-e)/r))}if(i==="1700-1700"){const r=mt(n)*1e3;let o=0,s=e;for(;s<t;)s+=r,jl(s)||(s=Ul(s)),s<=t&&o++;return o}const a=mt(n)*1e3;return Math.max(0,Math.floor((t-e)/a))},ko=e=>{let t;const n=new Set,i=(c,d)=>{const l=typeof c=="function"?c(t):c;if(!Object.is(l,t)){const m=t;t=d??(typeof l!="object"||l===null)?l:Object.assign({},t,l),n.forEach(f=>f(t,m))}},a=()=>t,s={setState:i,getState:a,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=t=e(i,a,s);return s},Jv=(e=>e?ko(e):ko),Xv=e=>e;function Zv(e,t=Xv){const n=w.useSyncExternalStore(e.subscribe,w.useCallback(()=>t(e.getState()),[e,t]),w.useCallback(()=>t(e.getInitialState()),[e,t]));return w.useDebugValue(n),n}const Co=e=>{const t=Jv(e),n=i=>Zv(t,i);return Object.assign(n,t),n},zl=(e=>e?Co(e):Co);zl(e=>({patterns:[],setPatterns:t=>e({patterns:t}),addPattern:t=>e(n=>({patterns:[...n.patterns,t]})),removePattern:t=>e(n=>({patterns:n.patterns.filter(i=>i.id!==t)})),clearPatterns:()=>e({patterns:[]})}));const Ye=zl((e,t)=>({activeTab:"patterns",setActiveTab:n=>e({activeTab:n}),selectedPattern:null,setSelectedPattern:n=>e({selectedPattern:n}),playEndTimestamp:null,setPlayEndTimestamp:n=>e(()=>({playEndTimestamp:n})),getPlayEndTimestamp:()=>t().playEndTimestamp,targetCandles:[],setTargetCandles:n=>e({targetCandles:n}),gapCount:0,setGapCount:n=>e({gapCount:n})}));let ga=null,ya=!1,Yl=!1;function Qv(e){return typeof e=="function"&&typeof e.onReady!="function"}function $v(e){if(typeof e?.onReady!="function")throw new Error("withPlayChart: expected a TradingView datafeed object with onReady(). If you use a factory, call it first: withPlayChart(yourDataFeed(...)) or pass factory args: withPlayChart(yourDataFeed, arg1, arg2).")}function ew(e){return ga=e,t=>{!ya&&Yl||e(t)}}function Ao(e){$v(e);const t=e.subscribeBars?.bind(e);return t?Object.assign(Object.create(Object.getPrototypeOf(e)),e,{subscribeBars(n,i,a,r,o){return t(n,i,ew(a),r,o)}}):e}function tw(e,...t){if(Qv(e)){if(t.length>0)return Ao(e(...t));throw new Error("withPlayChart: received a datafeed factory. Call it before passing to TradingView: withPlayChart(yourDataFeed(...)) or pass factory arguments: withPlayChart(yourDataFeed, arg1, arg2).")}return Ao(e)}function Pt(e){Yl=e}function No(e){if(!ga)return!1;ya=!0;try{ga(e)}finally{ya=!1}return!0}let Hl=[];const Vi=e=>{Hl=e},nw=()=>Hl,di=e=>e>1e11?e:e*1e3,Wl=(e,t)=>{const n=di(e);return t.find(i=>di(i.time)===n)},ba="Generated Candles - By iC Candle",va="Generated Candles Background - By iC Candle",Ni="revealed_count",ql={id:Ni,name:"Revealed Count",type:"integer",defval:0,isHidden:!0,min:0},_l=e=>{const t=Math.max(0,Number(e(0))||0);return nw().slice(0,t)},Vl=(e,t)=>!!Wl(e,t),iw=({id:e,description:t,shortDescription:n,isHiddenStudy:i,bodyColors:a,wickColors:r,borderColors:o})=>({_metainfoVersion:51,id:e,description:t,shortDescription:n,isCustomIndicator:!0,is_hidden_study:i,is_price_study:!0,linkedToSeries:!0,format:{type:"price",precision:2},inputs:[ql],palettes:{palette_bar:{colors:{0:{name:"Bullish"},1:{name:"Bearish"}},valToIndex:{0:0,1:1}},palette_wick:{colors:{0:{name:"Bullish Wick"},1:{name:"Bearish Wick"}},valToIndex:{0:0,1:1}},palette_border:{colors:{0:{name:"Bullish Border"},1:{name:"Bearish Border"}},valToIndex:{0:0,1:1}}},plots:[{id:"plot_open",type:"ohlc_open",target:"plot_candle"},{id:"plot_high",type:"ohlc_high",target:"plot_candle"},{id:"plot_low",type:"ohlc_low",target:"plot_candle"},{id:"plot_close",type:"ohlc_close",target:"plot_candle"},{id:"plot_bar_color",type:"ohlc_colorer",palette:"palette_bar",target:"plot_candle"},{id:"plot_wick_color",type:"wick_colorer",palette:"palette_wick",target:"plot_candle"},{id:"plot_border_color",type:"border_colorer",palette:"palette_border",target:"plot_candle"}],ohlcPlots:{plot_candle:{title:n,forceOverlay:!0}},styles:{},defaults:{styles:{},ohlcPlots:{plot_candle:{borderColor:o[0],color:a[0],drawBorder:!0,drawWick:!0,plottype:"ohlc_candles",visible:!0,wickColor:r[0]}},palettes:{palette_bar:{colors:{0:{color:a[0],width:1,style:0},1:{color:a[1],width:1,style:0}}},palette_wick:{colors:{0:{color:r[0],width:1,style:0},1:{color:r[1],width:1,style:0}}},palette_border:{colors:{0:{color:o[0],width:1,style:0},1:{color:o[1],width:1,style:0}}}},precision:2,inputs:{[Ni]:0}}}),Do=0,Ja=(e="light")=>e==="dark"?"#131722":"#ffffff",wa=[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN],aw=e=>function(){this.init=function(t){this._context=t},this.main=function(t,n){this._context=t;const i=t.symbol.time,a=_l(n);return!Number.isFinite(i)||!a.length?[...wa]:Vl(i,a)?e(t,a):[...wa]}},rw=(e="light")=>{const t=Ja(e),n={name:va,metainfo:{_metainfoVersion:51,id:"Generated Candles Background - By iC Candle@tv-basicstudies-1",description:va,shortDescription:"Generated Candles Background",isCustomIndicator:!0,is_hidden_study:!0,is_price_study:!0,linkedToSeries:!0,format:{type:"inherit"},inputs:[ql],palettes:{prediction_bar_palette:{colors:{0:{name:"Predicted Bar"}},valToIndex:{[Do]:0}},prediction_mask_palette:{colors:{0:{name:"Predicted Mask"}},valToIndex:{0:0}}},plots:[{id:"bar",type:"bar_colorer",palette:"prediction_bar_palette"},{id:"mask_open",type:"ohlc_open",target:"mask_candle"},{id:"mask_high",type:"ohlc_high",target:"mask_candle"},{id:"mask_low",type:"ohlc_low",target:"mask_candle"},{id:"mask_close",type:"ohlc_close",target:"mask_candle"},{id:"mask_bar_color",type:"ohlc_colorer",palette:"prediction_mask_palette",target:"mask_candle"},{id:"mask_wick_color",type:"wick_colorer",palette:"prediction_mask_palette",target:"mask_candle"},{id:"mask_border_color",type:"border_colorer",palette:"prediction_mask_palette",target:"mask_candle"}],ohlcPlots:{mask_candle:{title:"Predicted Mask Candle",forceOverlay:!0}},defaults:{ohlcPlots:{mask_candle:{borderColor:t,color:t,drawBorder:!0,drawWick:!0,plottype:"ohlc_candles",visible:!0,wickColor:t}},palettes:{prediction_bar_palette:{colors:{0:{color:t,width:1,style:1}}},prediction_mask_palette:{colors:{0:{color:t,width:1,style:0}}}},inputs:{[Ni]:0}}},constructor:function(){this.init=function(a){this._context=a},this.main=function(a,r){this._context=a;const o=a.symbol.time,s=_l(r);if(!Number.isFinite(o)||!Vl(o,s))return[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN];const{open:u,high:c,low:d,close:l}=a.symbol,m=Math.max(c-d,Math.abs(l-u),Math.abs(l)*1e-4,.01);return[Do,u,c+m,d-m,l,0,0,0]}}},i={name:ba,metainfo:iw({id:"Generated Candles - By iC Candle@tv-basicstudies-1",description:ba,shortDescription:"Generated Candles",isHiddenStudy:!1,bodyColors:["#00dfb9","#ffb84d"],wickColors:["#00dfb9","#ffb84d"],borderColors:["#00dfb9","#ffb84d"]}),constructor:aw((a,r)=>{const o=Wl(a.symbol.time,r);if(!o)return[...wa];const u=o.close<o.open?1:0;return[o.open,o.high,o.low,o.close,u,u,u]})};return Promise.resolve([n,i])},Ro=(e,t)=>{if(t)try{e.removeEntity(t)}catch{}},ow=e=>({"predicted mask candle.color":e,"predicted mask candle.bordercolor":e,"predicted mask candle.wickcolor":e,"predicted bar.color.0":e,"predicted mask.color.0":e}),Kl=(e,t)=>{try{e.getSeries().sendToBack()}catch{}const n=t.generatedCandlesStudyIdRef.current;n&&e.bringToFront([n])},sw=e=>{try{e.getSeries().bringToFront()}catch{}},Jl=async(e,t,n="light")=>{Ro(e,t.generatedCandlesStudyIdRef.current),Ro(e,t.generatedCandlesBackgroundStudyIdRef.current),t.generatedCandlesStudyIdRef.current=null,t.generatedCandlesBackgroundStudyIdRef.current=null;const i=Ja(n),a=await e.createStudy(va,!0,!0,void 0,ow(i));a&&(t.generatedCandlesBackgroundStudyIdRef.current=a);const r=await e.createStudy(ba,!0,!0);r&&(t.generatedCandlesStudyIdRef.current=r),Kl(e,t)},Ki=(e,t,n)=>{const i={id:Ni,value:n};for(const a of[t.generatedCandlesBackgroundStudyIdRef,t.generatedCandlesStudyIdRef])if(a.current)try{e.getStudyById(a.current).setInputValues([i])}catch{}},lw=(e,t,n,i,a)=>{const r=t?.highlightBarsRef,o=Ye(d=>d.targetCandles),s=Ye(d=>d.gapCount),u=w.useRef(a),c=w.useRef(null);w.useEffect(()=>{let d=!1,l;const m=()=>{l&&(clearInterval(l),l=void 0)},f=v=>{if(!(!e||!t))try{Ki(e.activeChart(),t,v)}catch{}},p=(v,g,A=[])=>{if(!(!e||!a?.length)&&!(!v.length&&!A.length))try{const x=e.activeChart(),S=fs(n),L=ln(o[0].timestamp,n)/1e3-(jt*S+S*100);if(g>0&&v.length>0){const Z=di(v[g-1].time)/1e3+jt/3*S;x.setVisibleRange({from:L,to:Z});return}const H=v[v.length-1]??A[A.length-1],G=(H?di(H.time):ln(o[o.length-1].timestamp,n))/1e3+jt/3*S;x.setVisibleRange({from:L,to:G})}catch(x){console.error("Error setting visible range:",x)}},y=(v,g,A=[])=>{requestAnimationFrame(()=>{d||p(v,g,A)})},b=(v,g,A)=>new Promise(x=>{if(!v.length){x();return}let S=0,D=0;const L=()=>{m(),x()},H=()=>{if(d){L();return}if(S>=v.length){L();return}if(No(v[S])){S++,D=0,A?.(S),S>=v.length&&L();return}D++,D>200&&L()};H(),S<v.length&&!d&&(l=setInterval(H,Math.max(g,1)))}),P=async()=>{if(!(!e||!t?.generatedCandlesStudyIdRef||!t?.generatedCandlesBackgroundStudyIdRef))try{await new Promise(v=>{e.onChartReady(async()=>{try{await Jl(e.activeChart(),t,e.getTheme())}catch(g){console.error("Failed to recreate generated candle studies:",g)}v()})})}catch{}},k=(v,g)=>{d||(Pt(!1),c.current=a,r&&(r.current=v),p(v,v.length,g))},T=async(v,g=[])=>{if(!d&&(Pt(!0),Vi(v),r&&(r.current=[]),await P(),!d)){if(p(v,0,g),g.length>0){for(const A of g){if(d)return;No(A)}p(v,0,g)}if(await b(v,_d,A=>{f(A),y(v,A,g),r&&(r.current=v.slice(0,A))}),!d){if(e&&t)try{Kl(e.activeChart(),t)}catch{}k(v,g)}}};return(async()=>{if(!d){if(a?.length&&o.length>0){if(c.current===a)return;const g=[...a].slice(-50-(s||0)),A=_v(g,o[o.length-1],o),S=Tt.find(F=>F.ticker===i||F.display_name===i)?.session||"24x7",D=ln(o[o.length-1].timestamp,n),L=o[o.length-1].c,H=To(D,n,s||0,S),j=H.map(F=>({open:L,high:L,low:L,close:L,time:F})),G=To(s?H[H.length-1]:D,n,A.length,S),Z=[...A.map((F,W)=>({open:F.o,high:F.h,low:F.l,close:F.c,time:ln(G[W],n)}))].sort((F,W)=>F.time-W.time);try{e?.onChartReady(()=>{T(Z,j)})}catch{T(Z,j)}}else{if(Pt(!1),Vi([]),c.current=null,r&&(r.current=[]),e&&t)try{Ki(e.activeChart(),t,0)}catch{}try{e?.onChartReady(()=>{sw(e.activeChart())})}catch{}}u.current=a}})(),()=>{d=!0,m(),Pt(!1)}},[a,o,s,r,t,n,i,e]),w.useEffect(()=>{if(a===null&&(Vi([]),r&&(r.current=[]),e&&t))try{Ki(e.activeChart(),t,0)}catch{}},[t,e,r,a])},cw=(e,t)=>{if(t.current){try{const n=e?.activeChart?.();if(n)try{n.removeEntity(t.current)}catch{}}catch{}t.current=null}},uw=e=>{try{localStorage.removeItem(Cn)}catch{}try{const t=e?.activeChart?.();if(!t)return;t.clearMarks(2),t.refreshMarks()}catch{}},dw=(e,t)=>{try{localStorage.setItem(Cn,JSON.stringify(t))}catch{}try{e?.activeChart?.()?.refreshMarks()}catch{}},hw=async(e,t)=>{if(!(!e||!Number.isFinite(t)||t<=0))try{await e.headerReady();const n=e.activeChart(),i=Math.floor(t/1e3),a=n.getVisibleRange();let r;if(a?.from!=null&&a?.to!=null&&a.to>a.from)r=(a.to-a.from)/2;else{const o=mt(n.resolution());r=jt*o/2}await n.setVisibleRange({from:i-r,to:i+r}),await new Promise(o=>{let s=!1;const u=()=>{s||(s=!0,o())};n.onDataLoaded().subscribe(null,u,!0),setTimeout(u,300)})}catch(n){console.error("Error centering visible range on event",n)}},Xl=async(e,t,n)=>{if(!e||!Number.isFinite(t)||t<=0)return;await e?.headerReady();const i=e?.activeChart?.();if(i)try{if(n.current){try{i.removeEntity(n.current)}catch{}n.current=null}try{const a=mt(i.resolution()),r=Math.floor(t/1e3),o=r-r%a,s=await i.createShape({time:o},{shape:"vertical_line",lock:!0,disableSelection:!0,overrides:{linestyle:2,linewidth:1}});s&&(i.getShapeById(s)?.setSavingEnabled(!1),n.current=s)}catch{}}catch{}},pw=async(e,t)=>{if(!(!e||!Number.isFinite(t)||t<=0))try{await e.headerReady();const n=e.activeChart(),i=mt(n.resolution()),{data:a}=await n.exportData();if(!a?.length)return;const r=a[a.length-1][0],o=Math.floor(t/1e3);await n.setVisibleRange({from:r-jt*i,to:o+jt/3*i})}catch(n){console.error("Error expanding visible range for future event",n)}},Zl=async(e,t,n)=>{if(!e||!n||!Number.isFinite(t)||t<=0)return!1;try{await e.headerReady();const i=e.activeChart(),a=i.resolution(),r=mt(a),o=Math.floor(t/1e3),s=o-o%r,{data:u}=await i.exportData();if(!u?.length)return!1;const d=u[u.length-1][0],l=i.symbol(),m=Tt.find(y=>y.ticker===l||y.display_name===l)?.session||"24x7";if(n.clearSelectedCandles(),Ye.getState().setPlayEndTimestamp(null),Pt(!1),s>d){const y=ln(d,a),b=ln(s,a),P=Kv(y,b,a,m);Ye.getState().setGapCount(P);const k=u.slice(-50).map(T=>({o:T[1],h:T[2],l:T[3],c:T[4],timestamp:T[0]}));return k.length===0||n.setTargetCandles(k),!0}Ye.getState().setGapCount(0);let f=u.findIndex(y=>y[0]===s);if(f===-1){let y=Number.POSITIVE_INFINITY;for(let b=0;b<u.length;b++){const P=Math.abs(u[b][0]-s);P<y&&(y=P,f=b)}}if(f<0)return!1;const p=u.slice(Math.max(0,f-49),f+1).map(y=>({o:y[1],h:y[2],l:y[3],c:y[4],timestamp:y[0]}));return p.length===0||n.setTargetCandles(p),!1}catch(i){return console.error("Error preparing event target candles",i),!1}},hi=e=>{if(e)try{e.onChartReady(()=>{try{e.activeChart().resetData(),e.resetCache?.()}catch(t){console.error("Error resetting chart data",t)}})}catch(t){console.error("Error resetting chart data",t)}},Ji=(e,t)=>{t([]),Ye.getState().setPlayEndTimestamp(null),Pt(!1),hi(e)},Ql=(e,t)=>{if(e)try{const n=e.activeChart?.();if(!n)return;if(t.current){try{n.removeEntity(t.current)}catch{}t.current=null}n.getAllShapes().filter(a=>a.name==="date_range").forEach(a=>{try{n.removeEntity(a.id)}catch{}})}catch{}},mw=e=>ig[e]||e,fw=e=>{if(!e)return null;const t=Object.keys(e)[0],n=Number(t);return Number.isFinite(n)&&n>0?n:null},gw=async(e,t,n,i,a)=>{if(!e)return;const{end_timestamp:r,symbol:o,timeframe:s}=t,u=fw(a);if(!(!o||!s||!Number.isFinite(r)||r<=0||u==null))try{await e.headerReady();const c=mw(s),d=mt(c);i?.clearSelectedCandles(),Ye.getState().setPlayEndTimestamp(null),Pt(!1),i&&(i.applyingPatternRef.current=!0);try{await new Promise(A=>{e.setSymbol(o,c,()=>A())});const l=e.activeChart();Ql(e,n);const m=r-(u-1)*d;try{await l.setVisibleRange({from:m-(jt*d+d*u+d*100),to:r+jt/3*d})}catch(A){console.error("Error setting visible range for pattern",A)}const{data:f}=await l.exportData();let p=f.findIndex(A=>A[0]===r);p===-1&&(p=f.length-1);const y=Math.max(0,p-u+1),b=f.slice(y,p+1),P=b[0]?.[0]??r,k=b[b.length-1]?.[0]??r,T=t.pattern?.trim()||"",v=ia(),g=await l.createMultipointShape([{time:P},{time:k}],{...v,overrides:{...v.overrides,title:T||"Pattern range"}});if(g){const A=l.getShapeById(g);A&&(T&&A.setProperties({customText:{visible:!0,text:T,color:"#ffffff",fontsize:14,bold:!0}}),A.setSavingEnabled(!1)),n.current=g,i&&(i.lastEntity.current=g)}if(i&&b.length>0){const A=b.map(S=>({o:S[1],h:S[2],l:S[3],c:S[4],timestamp:S[0]})),x=A.slice(-50);i.setSymbol(o),i.setResolution(c),i.setTimeframe(c),i.setWindowSize(A.length),i.setCandles(A),i.setTargetCandles(x),i.setHasActiveShape(!0)}}finally{i&&setTimeout(()=>{i.applyingPatternRef.current=!1},600)}}catch(c){console.error("Error drawing pattern date range",c),i&&setTimeout(()=>{i.applyingPatternRef.current=!1},600)}};function yw(e,t,n,i,a,r,o){const s=w.useRef(n),u=w.useRef(e),c=w.useRef(t),d=w.useRef(i),l=w.useRef(a),m=w.useRef(r),f=w.useRef(o),p=w.useRef(null),y=w.useRef(null),b=w.useRef(null);w.useEffect(()=>{s.current=n},[n]),w.useEffect(()=>{u.current=e},[e]),w.useEffect(()=>{c.current=t},[t]),w.useEffect(()=>{d.current=i},[i]),w.useEffect(()=>{l.current=a},[a]),w.useEffect(()=>{m.current=r},[r]),w.useEffect(()=>{f.current=o},[o]),w.useEffect(()=>{const P=({origin:k,data:T})=>{if(k!==Jt)return;let v;try{v=typeof T=="string"?JSON.parse(T):T}catch{return}if(console.log("parsed",v),"type"in v&&v.type==="play-chart"){const A=v.payload.candles;c.current(A);const x=s.current;x!=null&&Number.isFinite(x)&&Ye.getState().setPlayEndTimestamp(x),A===null&&(Ye.getState().setPlayEndTimestamp(null),Pt(!1),hi(u.current))}else if("type"in v&&v.type==="close-result")c.current([]),Ye.getState().setPlayEndTimestamp(null),l.current?.();else if("type"in v&&v.type==="loading"){const g=v;d.current(g.payload)}else if("type"in v&&v.type==="sign-in-success"){const g=v;localStorage.setItem("iccandle_token",g.payload.id_token||"")}else if("action"in v&&v.action==="eventClicked"){const A=v.data?.event;if(!A?.timestamp)return;b.current=A.timestamp,dw(u.current,A),(async()=>(await Zl(u.current,A.timestamp,m.current)?await pw(u.current,A.timestamp):await hw(u.current,A.timestamp),await Xl(u.current,A.timestamp,p)))()}else if("action"in v&&v.action==="replay"){const g=v.data;if(!g)return;if(!g.isReplay){Ji(u.current,c.current);return}const A=(g.selectedCandles??[]).map(S=>({o:S.o,h:S.h,l:S.l,c:S.c,timestamp:S.timestamp}));if(A.length===0)return;c.current(A);const x=g.playEndTimestamp??(b.current!=null?Math.floor(b.current/1e3):s.current);x!=null&&Number.isFinite(x)&&Ye.getState().setPlayEndTimestamp(x)}else if("action"in v&&v.action==="back")cw(u.current,p),uw(u.current),Ji(u.current,c.current),b.current=null,Ye.getState().setGapCount(0),m.current?.setTargetCandles([]);else if("action"in v&&v.action==="back-to-similar-events")Ji(u.current,c.current);else if("type"in v&&(v.type==="pattern_selected"||v.type==="custom_pattern_selected")){console.log("pattern_selected",v);const g=v.pattern,A=g?.compared_pattern;if(!A)return;console.log("working 1",g),gw(u.current,A,y,m.current,g?.results?.matches_by_window)}else if("type"in v&&(v.type==="clear_pattern_selected"||v.type==="clear_custom_pattern_selected")){Ql(u.current,y);const g=m.current;g&&(g.lastEntity.current=null,g.setHasActiveShape(!1),g.setCandles([]),g.setTargetCandles([]))}else if("action"in v&&v.action==="nav-click"){const g=v.data;g?.href&&f.current?.(g.href)}};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[])}const bw=({patternName:e,onPatternNameChange:t,onNext:n,onCancel:i})=>{const{t:a}=At();return h.jsxs("div",{className:"iccandle-pattern-alert-name",children:[h.jsxs("div",{className:"iccandle-pattern-alert-name__header",children:[h.jsxs("div",{className:"iccandle-pattern-alert-name__title-row",children:[h.jsxs("h2",{className:"iccandle-pattern-alert-name__title",children:[h.jsx(gs,{size:20,className:"iccandle-pattern-alert-name__title-icon"}),a("Pattern.addToPatternTracker")]}),h.jsx("button",{type:"button",className:"iccandle-pattern-alert-name__close-btn",onClick:i,"aria-label":a("Common.close"),children:h.jsx(ys,{size:20})})]}),h.jsx("p",{className:"iccandle-pattern-alert-name__description",children:a("Pattern.addToPatternTrackerDescription")})]}),h.jsxs("div",{className:"iccandle-pattern-alert-name__content",children:[h.jsx(Kd,{size:64,className:"iccandle-pattern-alert-name__bell-icon"}),h.jsx("div",{className:"iccandle-pattern-alert-name__form",children:h.jsxs("div",{className:"iccandle-pattern-alert-name__field",children:[h.jsx("label",{htmlFor:"patternName",className:"iccandle-pattern-alert-name__label",children:a("Pattern.patternName")}),h.jsx("input",{id:"patternName",className:"iccandle-pattern-alert-name__input",placeholder:a("Pattern.patternNamePlaceholder"),value:e,maxLength:20,minLength:5,onChange:r=>t(r.target.value.slice(0,20))}),e.length===20&&h.jsx("p",{className:"iccandle-pattern-alert-name__error",children:a("Pattern.patternNameMaxChars")}),e.trim().length>0&&e.trim().length<5&&h.jsx("p",{className:"iccandle-pattern-alert-name__error",children:a("Pattern.patternNameMinChars")})]})})]}),h.jsxs("div",{className:"iccandle-pattern-alert-name__footer-wrap",children:[h.jsx("hr",{className:"iccandle-pattern-alert-name__divider"}),h.jsxs("div",{className:"iccandle-pattern-alert-name__footer",children:[h.jsx("button",{type:"button",className:"iccandle-pattern-alert-name__btn iccandle-pattern-alert-name__btn--outline",onClick:i,children:a("Common.cancel")}),h.jsx("button",{type:"submit",className:"iccandle-pattern-alert-name__btn iccandle-pattern-alert-name__btn--primary",onClick:n,disabled:e.trim().length<5,children:a("Common.next")})]})]})]})},vw=Qg;I.createContext({});I.createContext({});const ww=[{name:"All",value:"all"},{name:"Minutes",value:"minutes"},{name:"Hourly",value:"hourly"},{name:"Daily",value:"daily"}],$l=[{value:"M15",label:"M15",description:"15 Minutes",type:"minutes"},{value:"M30",label:"M30",description:"30 Minutes",type:"minutes"},{value:"H1",label:"H1",description:"1 Hour",type:"hourly"},{value:"H2",label:"H2",description:"2 Hours",type:"hourly"},{value:"H4",label:"H4",description:"4 Hours",type:"hourly"},{value:"D",label:"D",description:"Daily",type:"daily"}],xw={all:"Common.all",minutes:"Selector.timeframeTypeMinutes",hourly:"Common.hourly",daily:"Common.daily"},Pw=({searchTerm:e,onSearchChange:t,selectedType:n,onTypeChange:i,selectAll:a,onSelectAll:r,selectedTimeframes:o,onTimeframeChange:s,filteredTimeframes:u})=>{const{t:c}=At(),d=Object.values(o).filter(Boolean).length,l=u??$l,m=d<=1?c("Pattern.timeframeSelected",{count:d}):c("Pattern.timeframesSelected",{count:d}),f=(p,y)=>{const b=`Pattern.timeframeOptions.${p}.description`,P=c(b);return P===b?y:P};return h.jsxs("div",{className:"iccandle-scanner-timeframe-search",children:[h.jsxs("div",{className:"iccandle-scanner-timeframe-search__bar",children:[h.jsx(qo,{strokeWidth:.5,className:"iccandle-scanner-timeframe-search__search-icon"}),h.jsx("input",{className:"iccandle-scanner-timeframe-search__input",placeholder:c("Selector.searchTimeframe"),value:e,onChange:p=>t(p.target.value.toUpperCase())}),h.jsxs("span",{className:"iccandle-scanner-timeframe-search__count-badge",children:[h.jsx("span",{className:"iccandle-scanner-timeframe-search__count-desktop",children:m}),h.jsx("span",{className:"iccandle-scanner-timeframe-search__count-mobile",children:!d})]})]}),h.jsx("div",{className:"iccandle-scanner-timeframe-search__types-wrap",children:h.jsx("div",{className:"iccandle-scanner-timeframe-search__types-list",children:ww.map(p=>h.jsx("button",{type:"button",className:ft("iccandle-scanner-timeframe-search__type-badge",n===p.value?"iccandle-scanner-timeframe-search__type-badge--active":"iccandle-scanner-timeframe-search__type-badge--inactive"),onClick:()=>i(p.value),children:h.jsx("span",{className:ft("iccandle-scanner-timeframe-search__type-label",n===p.value?"iccandle-scanner-timeframe-search__type-label--active":"iccandle-scanner-timeframe-search__type-label--inactive"),children:c(xw[p.value]??"Common.all")})},p.value))})}),h.jsxs("div",{className:"iccandle-scanner-timeframe-search__table-wrap",children:[h.jsxs("div",{className:"iccandle-scanner-timeframe-search__table-head",children:[h.jsx("input",{type:"checkbox",className:"iccandle-scanner-timeframe-search__checkbox",checked:a,onChange:p=>r(p.target.checked),"aria-label":c("Selector.selectAllTimeframes")}),h.jsx("span",{className:"iccandle-scanner-timeframe-search__timeframe-title",children:c("Common.columnTimeframe")}),h.jsx("span",{className:"iccandle-scanner-timeframe-search__description-title",children:c("Common.columnDescription")})]}),h.jsxs("div",{className:"iccandle-scanner-timeframe-search__list-container",children:[h.jsx("ul",{className:"iccandle-scanner-timeframe-search__timeframe-list",children:l.map(p=>h.jsxs(w.Fragment,{children:[h.jsxs("li",{className:"iccandle-scanner-timeframe-search__timeframe-row",children:[h.jsx("input",{type:"checkbox",className:"iccandle-scanner-timeframe-search__checkbox iccandle-scanner-timeframe-search__checkbox--row",checked:!!o[p.value],onChange:y=>s(p.value,y.target.checked),"aria-label":c("Selector.selectTimeframeAria",{label:p.label})}),h.jsx("span",{className:"iccandle-scanner-timeframe-search__timeframe-name",children:p.label})]}),h.jsx("hr",{className:"iccandle-scanner-timeframe-search__row-divider"})]},p.value))}),h.jsx("ul",{className:"iccandle-scanner-timeframe-search__description-list",children:l.map(p=>h.jsxs(w.Fragment,{children:[h.jsx("li",{className:"iccandle-scanner-timeframe-search__description-row",children:h.jsx("span",{className:"iccandle-scanner-timeframe-search__description-text",children:f(p.value,p.description)})}),h.jsx("hr",{className:"iccandle-scanner-timeframe-search__row-divider"})]},p.value))})]})]})]})},Sw=({form:e})=>{const[t,n]=w.useState(""),[i,a]=w.useState("all"),r=e.watch("timeframes"),o=w.useMemo(()=>$l.filter(m=>{const f=m.label.toLowerCase().includes(t.toLowerCase())||m.description.toLowerCase().includes(t.toLowerCase()),p=i==="all"?!0:m.type===i;return f&&p}),[t,i]),s=w.useMemo(()=>r.reduce((m,f)=>(m[f]=!0,m),{}),[r]),u=o.length?o.every(m=>s[m.value]):!1,c=m=>{e.setValue("timeframes",Object.entries(m).filter(([,f])=>f).map(([f])=>f),{shouldDirty:!0})},d=m=>{const f={...s};o.forEach(p=>{f[p.value]=m}),c(f)},l=(m,f)=>{c({...s,[m]:f})};return h.jsx("div",{className:"iccandle-timeframes-tab",children:h.jsx(Pw,{searchTerm:t,onSearchChange:n,selectedType:i,onTypeChange:a,selectAll:u,onSelectAll:d,selectedTimeframes:s,onTimeframeChange:l,filteredTimeframes:o})})},Tw=({form:e})=>{const[t,n]=w.useState(""),[i,a]=w.useState("all"),r=e.watch("symbols"),o=w.useMemo(()=>r.reduce((m,f)=>(m[f.symbol]=!0,m),{}),[r]),s=Tt.filter(m=>{const f=m.display_name.toLowerCase().includes(t.toLowerCase()),p=i==="all"?!0:m.type===i;return f&&p}),u=s.length?s.every(m=>o[m.ticker]):!1,c=m=>{e.setValue("symbols",Object.entries(m).filter(([,f])=>f).map(([f])=>{const p=Tt.find(y=>y.ticker===f);return{symbol:f,type:p?.type??"forex"}}),{shouldDirty:!0})},d=m=>{const f={...o};s.forEach(p=>{f[p.ticker]=m}),c(f)},l=(m,f)=>{c({...o,[m]:f})};return h.jsx(Gl,{searchTerm:t,onSearchChange:n,selectedType:i,onTypeChange:a,selectAll:u,onSelectAll:d,selectedSymbols:o,onSymbolChange:l,filteredSymbols:s})},Xa=[{value:"new_york",label:"New York Session",timezone:"America/New_York",start:"09:30",end:"16:00"},{value:"london",label:"London Session",timezone:"Europe/London",start:"08:00",end:"16:30"},{value:"tokyo",label:"Tokyo Session",timezone:"Asia/Tokyo",start:"09:00",end:"18:00"},{value:"sydney",label:"Sydney Session",timezone:"Australia/Sydney",start:"09:00",end:"18:00"}],Eo=[{value:"all_time",label:"All time"},...Xa.map(e=>({value:e.value,label:e.label})),{value:"customize",label:"Customize"}],kw=e=>{const t=e.match(/GMT([+-])(\d{1,2})(?::?(\d{2}))?/);if(!t)return 0;const n=t[1]==="-"?-1:1,i=Number(t[2]),a=Number(t[3]??"0");return n*(i*60+a)},Oo=(e,t)=>{const i=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"shortOffset",hour:"2-digit"}).formatToParts(e).find(a=>a.type==="timeZoneName")?.value??"GMT+0";return kw(i)},Mo=(e,t,n)=>{const[i,a]=e.split(":").map(Number),r=new Date,o=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),i,a,0),s=Oo(new Date(o),t);let u=o-s*6e4;const c=Oo(new Date(u),t);return u=o-c*6e4,new Intl.DateTimeFormat("en-GB",{timeZone:n,hour12:!1,hour:"2-digit",minute:"2-digit"}).format(new Date(u))},pi=(e,t)=>{const n=Xa.find(i=>i.value===e);return n?{start_time:Mo(n.start,n.timezone,t),end_time:Mo(n.end,n.timezone,t),timezone:t}:null},Cw=(e,t)=>{if(!e)return"all_time";const n=e.timezone||t,i=!!(e.start_time&&e.end_time);if(e.preset_session){if(e.preset_session==="all_time")return"all_time";if(e.preset_session==="customize")return"customize";const r=pi(e.preset_session,n);if(r&&r.start_time===e.start_time&&r.end_time===e.end_time)return e.preset_session}if(!i)return"customize";const a=Xa.find(r=>{const o=pi(r.value,n);return o&&o.start_time===e.start_time&&o.end_time===e.end_time});return a?a.value:"customize"},Aw=e=>{const t=Intl,n=typeof t.supportedValuesOf=="function"?t.supportedValuesOf("timeZone")??[]:[],i=e||"UTC";return(n.length?n:[i]).filter(Boolean)},Nw={all_time:"TimeConfig.allTime",new_york:"TimeConfig.newYorkSession",london:"TimeConfig.londonSession",tokyo:"TimeConfig.tokyoSession",sydney:"TimeConfig.sydneySession",customize:"TimeConfig.customize"},Dw=(e,t)=>{const n=t.trim().toLowerCase();return n?e.filter(i=>i.toLowerCase().includes(n)):e},Rw=({timeconfig:e,onTimeConfigChange:t,containerClassName:n=""})=>{const{t:i}=At(),[a,r]=w.useState(!1),[o,s]=w.useState(!1),[u,c]=w.useState(""),[d,l]=w.useState(""),m=w.useRef(null),f=w.useRef(null),p=Intl.DateTimeFormat().resolvedOptions().timeZone,y=w.useMemo(()=>Cw(e,p),[e,p]),b=D=>i(Nw[D]),P=e?.timezone?.trim()||p||"UTC",k=y==="all_time"?i("TimeConfig.yourTimezone"):P,T=w.useMemo(()=>Aw(p),[p]),v=w.useMemo(()=>{const D=u.trim().toLowerCase();return D?Eo.filter(L=>b(L.value).toLowerCase().includes(D)||L.value.toLowerCase().includes(D)):Eo},[u,i]),g=w.useMemo(()=>Dw(T,d),[T,d]),A=(D,L)=>{t({...e||{timezone:p},[D]:L,preset_session:"customize"},{shouldDirty:!0})},x=D=>{if(s(!1),c(""),D==="all_time"){e&&t(void 0,{shouldDirty:!0}),r(!1);return}if(D==="customize"){e?e.preset_session!=="customize"&&t({...e,preset_session:"customize"},{shouldDirty:!0}):t({start_time:"08:00",end_time:"23:00",timezone:p,preset_session:"customize"},{shouldDirty:!0});return}const L=pi(D,e?.timezone||p);L&&t({...L,preset_session:D},{shouldDirty:!0})};w.useEffect(()=>{!e||y==="all_time"||e.timezone||t({...e,timezone:p},{shouldDirty:!1})},[e,y,t,p]),w.useEffect(()=>{if(!o&&!a)return;const D=L=>{const H=L.target;o&&m.current&&!m.current.contains(H)&&(s(!1),c("")),a&&f.current&&!f.current.contains(H)&&(r(!1),l(""))};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[o,a]);const S=D=>{if(y!=="customize")return;const L=D.currentTarget;try{L.showPicker?.()}catch{}};return h.jsxs("div",{className:`iccandle-time-config-section ${n}`.trim(),children:[h.jsxs("div",{className:"iccandle-time-config-section__header",children:[h.jsx("h3",{className:"iccandle-time-config-section__title",children:i("TimeConfig.title")}),h.jsx("p",{className:"iccandle-time-config-section__description",children:i("TimeConfig.description")})]}),h.jsxs("div",{className:"iccandle-time-config-section__fields",children:[h.jsxs("div",{className:"iccandle-time-config-section__field",children:[h.jsx("label",{className:"iccandle-time-config-section__label",children:i("TimeConfig.startTime")}),h.jsx("input",{type:"time",disabled:y!=="customize",value:e?.start_time??"",onChange:D=>A("start_time",D.target.value),onClick:S,className:"iccandle-time-config-section__input"})]}),h.jsxs("div",{className:"iccandle-time-config-section__field",children:[h.jsx("label",{className:"iccandle-time-config-section__label",children:i("TimeConfig.endTime")}),h.jsx("input",{type:"time",disabled:y!=="customize",value:e?.end_time??"",onChange:D=>A("end_time",D.target.value),onClick:S,className:"iccandle-time-config-section__input"})]}),h.jsxs("div",{className:"iccandle-time-config-section__field",children:[h.jsx("label",{className:"iccandle-time-config-section__label",children:i("TimeConfig.session")}),h.jsxs("div",{className:`iccandle-time-config-section__select-wrap${o?" iccandle-time-config-section__select-wrap--open":""}`,ref:m,children:[h.jsx("button",{type:"button",className:"iccandle-time-config-section__select-btn",onClick:()=>s(D=>{const L=!D;return L?(r(!1),l("")):c(""),L}),children:h.jsx("span",{className:"iccandle-time-config-section__select-label",children:b(y)||i("TimeConfig.selectSession")})}),o&&h.jsxs("div",{className:"iccandle-time-config-section__dropdown",children:[h.jsx("div",{className:"iccandle-time-config-section__dropdown-search",children:h.jsx("input",{type:"text",className:"iccandle-time-config-section__dropdown-search-input",placeholder:i("TimeConfig.searchSession"),value:u,onChange:D=>c(D.target.value),autoFocus:!0})}),h.jsxs("ul",{className:"iccandle-time-config-section__dropdown-list",role:"listbox",children:[h.jsx("li",{className:"iccandle-time-config-section__dropdown-group-label","aria-hidden":"true",children:i("TimeConfig.sessionsHeading")}),v.length===0?h.jsx("li",{className:"iccandle-time-config-section__dropdown-empty",children:i("TimeConfig.noSessionFound")}):v.map(D=>h.jsx("li",{children:h.jsxs("button",{type:"button",role:"option","aria-selected":y===D.value,className:`iccandle-time-config-section__dropdown-item${y===D.value?" iccandle-time-config-section__dropdown-item--selected":""}`,onClick:()=>x(D.value),children:[h.jsx(Pr,{className:`iccandle-time-config-section__check${y===D.value?" iccandle-time-config-section__check--visible":""}`}),b(D.value)]})},D.value))]})]})]})]})]}),h.jsxs("div",{className:"iccandle-time-config-section__timezone",children:[h.jsx("label",{className:"iccandle-time-config-section__label",children:i("TimeConfig.timezone")}),h.jsxs("div",{className:`iccandle-time-config-section__select-wrap${a?" iccandle-time-config-section__select-wrap--open":""}`,ref:f,children:[h.jsx("button",{type:"button",className:"iccandle-time-config-section__select-btn",disabled:y==="all_time",onClick:()=>r(D=>{const L=!D;return L?(s(!1),c("")):l(""),L}),children:h.jsx("span",{className:"iccandle-time-config-section__select-label",children:k})}),a&&h.jsxs("div",{className:"iccandle-time-config-section__dropdown",children:[h.jsxs("div",{className:"iccandle-time-config-section__dropdown-header",children:[h.jsx("p",{className:"iccandle-time-config-section__dropdown-title",children:i("TimeConfig.selectTimezone")}),h.jsx("p",{className:"iccandle-time-config-section__dropdown-subtitle",children:i("TimeConfig.selectTimezoneHint")})]}),h.jsx("div",{className:"iccandle-time-config-section__dropdown-search",children:h.jsx("input",{type:"text",className:"iccandle-time-config-section__dropdown-search-input",placeholder:i("TimeConfig.searchTimezone"),value:d,onChange:D=>l(D.target.value),autoFocus:!0})}),h.jsxs("ul",{className:"iccandle-time-config-section__dropdown-list",role:"listbox",children:[h.jsx("li",{className:"iccandle-time-config-section__dropdown-group-label","aria-hidden":"true",children:i("TimeConfig.timezonesHeading")}),g.length===0?h.jsx("li",{className:"iccandle-time-config-section__dropdown-empty",children:i("TimeConfig.noTimezoneFound")}):g.map(D=>h.jsx("li",{children:h.jsxs("button",{type:"button",role:"option","aria-selected":P===D,className:`iccandle-time-config-section__dropdown-item${P===D?" iccandle-time-config-section__dropdown-item--selected":""}`,onClick:()=>{const L=D;if(y!=="all_time"&&y!=="customize"){const H=pi(y,L);H&&t({...H,preset_session:y},{shouldDirty:!0})}else t({...e||{},timezone:L},{shouldDirty:!0});r(!1),l("")},children:[h.jsx(Pr,{className:`iccandle-time-config-section__check${P===D?" iccandle-time-config-section__check--visible":""}`}),D]})},D))]})]})]})]})]})},Ew=({form:e,onBack:t,onCancel:n,onSubscribe:i,isSubscribing:a,errorMessage:r,formRef:o})=>{const{t:s}=At(),[u,c]=w.useState(1),[d,l]=w.useState("timeframes"),m=Qn({control:e.control,name:"timeframes"}),f=Qn({control:e.control,name:"symbols"}),p=Qn({control:e.control,name:"timeconfig"}),y=u===1?e.formState.errors.timeframes?.message:u===2?e.formState.errors.symbols?.message:r;w.useEffect(()=>{(m?.length??0)>0&&e.clearErrors("timeframes")},[m,e]),w.useEffect(()=>{(f?.length??0)>0&&e.clearErrors("symbols")},[f,e]);const b=k=>{if(k.preventDefault(),u===1){if(!e.getValues("timeframes")?.length){e.setError("timeframes",{type:"manual",message:s("Pattern.signalDialog.selectOneTimeframe")}),setTimeout(()=>{e.clearErrors("timeframes")},1800);return}e.clearErrors("timeframes"),c(2),l("symbols");return}if(u===2){if(!e.getValues("symbols")?.length){e.setError("symbols",{type:"manual",message:s("Pattern.signalDialog.selectOneSymbol")}),setTimeout(()=>{e.clearErrors("symbols")},1800);return}e.clearErrors("symbols"),c(3),l("timeconfig");return}i()},P=k=>{const T=k;l(T),c(T==="timeframes"?1:T==="symbols"?2:3)};return h.jsxs("div",{className:"iccandle-pattern-alert-settings",children:[h.jsxs("div",{className:"iccandle-pattern-alert-settings__header-row",children:[h.jsx(gs,{size:20,className:"iccandle-pattern-alert-settings__header-icon"}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__header",children:[h.jsxs("div",{className:"iccandle-pattern-alert-settings__title-row",children:[h.jsx("h2",{className:"iccandle-pattern-alert-settings__title",children:h.jsx("span",{className:"iccandle-pattern-alert-settings__title-text",children:s("Pattern.configurePatternTracker")})}),h.jsx("button",{type:"button",className:"iccandle-pattern-alert-settings__close-btn",onClick:n,"aria-label":s("Common.close"),children:h.jsx(ys,{size:16})})]}),h.jsx("p",{className:"iccandle-pattern-alert-settings__description",children:s("Pattern.selectTimeframesAndSymbols")})]})]}),h.jsx(vw,{...e,children:h.jsx("form",{ref:o,onSubmit:b,className:"iccandle-pattern-alert-settings__form",id:"pattern-alert-settings-form",children:h.jsxs("div",{className:"iccandle-pattern-alert-settings__tabs",children:[h.jsxs("div",{role:"tablist",className:"iccandle-pattern-alert-settings__tabs-list",children:[h.jsxs("button",{type:"button",role:"tab","aria-selected":d==="timeframes","data-state":d==="timeframes"?"active":"inactive",disabled:u!==1,className:"iccandle-pattern-alert-settings__tab-trigger",onClick:()=>P("timeframes"),children:[h.jsxs("span",{className:"iccandle-pattern-alert-settings__tab-label--mobile",children:["1. ",s("Common.timeframes")]}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__tab-label--desktop",children:[h.jsx("span",{className:"iccandle-pattern-alert-settings__tab-step",children:s("Common.step",{number:1})}),h.jsx("span",{children:s("Common.timeframes")})]})]}),h.jsxs("button",{type:"button",role:"tab","aria-selected":d==="symbols","data-state":d==="symbols"?"active":"inactive",disabled:u!==2,className:"iccandle-pattern-alert-settings__tab-trigger",onClick:()=>P("symbols"),children:[h.jsxs("span",{className:"iccandle-pattern-alert-settings__tab-label--mobile",children:["2. ",s("Common.symbols")]}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__tab-label--desktop",children:[h.jsx("span",{className:"iccandle-pattern-alert-settings__tab-step",children:s("Common.step",{number:2})}),h.jsx("span",{children:s("Common.symbols")})]})]}),h.jsxs("button",{type:"button",role:"tab","aria-selected":d==="timeconfig","data-state":d==="timeconfig"?"active":"inactive",disabled:u!==3,className:"iccandle-pattern-alert-settings__tab-trigger",onClick:()=>P("timeconfig"),children:[h.jsxs("span",{className:"iccandle-pattern-alert-settings__tab-label--mobile",children:["3. ",s("Pattern.tabTimeShort")]}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__tab-label--desktop",children:[h.jsx("span",{className:"iccandle-pattern-alert-settings__tab-step",children:s("Common.step",{number:3})}),h.jsx("span",{children:s("Common.timeSettings")})]})]})]}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__tabs-content-wrap",children:[d==="timeframes"&&h.jsx("div",{role:"tabpanel",className:"iccandle-pattern-alert-settings__tab-content",children:h.jsx(Sw,{form:e})}),d==="symbols"&&h.jsx("div",{role:"tabpanel",className:"iccandle-pattern-alert-settings__tab-content",children:h.jsx(Tw,{form:e})}),d==="timeconfig"&&h.jsx("div",{role:"tabpanel",className:"iccandle-pattern-alert-settings__tab-content",children:h.jsx(Rw,{timeconfig:p,onTimeConfigChange:(k,T)=>{e.setValue("timeconfig",k,{shouldDirty:T?.shouldDirty??!0,shouldValidate:!1})},containerClassName:"iccandle-pattern-alert-settings__time-config"})})]})]})})}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__footer",children:[h.jsx("p",{className:`iccandle-pattern-alert-settings__error${y?" iccandle-pattern-alert-settings__error--visible":""}`,children:y}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__actions",children:[h.jsx("button",{type:"button",className:"iccandle-pattern-alert-settings__btn iccandle-pattern-alert-settings__btn--outline",onClick:()=>{u===3?(c(2),l("symbols")):u===2?(c(1),l("timeframes")):t()},children:u>1?s("Common.previous"):s("Common.back")}),h.jsx("button",{type:"submit",form:"pattern-alert-settings-form",className:"iccandle-pattern-alert-settings__btn iccandle-pattern-alert-settings__btn--primary",disabled:a,children:a?s("Pattern.subscribing"):u<3?s("Common.nextStep"):s("Pattern.subscribe")})]})]})]})};async function Ow(e){const{data:t}=await Oe.post("https://api.iccandle.ai/custom-pattern/v1/searchless",e,{headers:{Authorization:`Bearer ${localStorage.getItem("iccandle_token")}`}});return t}const ec=e=>{if(typeof e=="string")return e;if(typeof e!="object"||e===null)return jr;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=ec(e[t]);if(n)return n}return jr},Mw=e=>qd(e)?ec(e.response?.data):e.message,Iw=({open:e,onOpenChange:t,resolution:n,type:i,symbol:a,candles:r,percent:o,theme:s="light",themeStyle:u})=>{const{t:c}=At(),[d,l]=w.useState(""),[m,f]=w.useState(!1),[p,y]=w.useState(null),[b,P]=w.useState(!1),k=w.useRef(null),T=Ks({defaultValues:{timeframes:[],symbols:[]}});w.useEffect(()=>{e&&(l(""),f(!1),y(null),P(!1),T.reset({timeframes:[],symbols:[]}))},[e,T]);const v=w.useCallback(()=>{d.trim().length<5||f(!0)},[d]);w.useEffect(()=>{if(!e)return;const x=S=>{if(S.key==="Escape"){t(!1);return}S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),m?k.current?.requestSubmit():v())};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[e,m,v,t]);const g=async()=>{const{symbols:x,timeframes:S,timeconfig:D}=T.getValues();if(!x.length||!S.length){y(c("Pattern.signalDialog.selectOneTimeframeAndSymbol")),setTimeout(()=>{y(null)},1500);return}if(!r.length){y(c("Pattern.noPatternCandles")),setTimeout(()=>{y(null)},1500);return}if(!a.trim()){y(c("Pattern.chartSymbolRequired")),setTimeout(()=>{y(null)},1500);return}const L=D&&(D.start_time||D.end_time||D.timezone)?{start_time:D.start_time,end_time:D.end_time,timezone:D.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone}:void 0,H={resolution:n,type:i,symbol:a,candles:r,custom_name:d.trim(),filter:{symbols:x,timeframes:S,timeconfig:L},percent:o};P(!0);try{await Ow(H),ta({title:c("Pattern.patternSubscribed"),description:c("Pattern.patternSubscribedDesc",{name:d}),variant:"success"}),t(!1)}catch(j){const G=Mw(j);y(G),ta({title:c("Pattern.patternSubscriptionError"),description:G,variant:"error"}),setTimeout(()=>{y(null)},3e3)}finally{P(!1)}},A=()=>{f(!1)};return e?h.jsx("div",{className:ft("iccandle-pattern-tracker-modal","iccandle-selector-widget",s==="dark"&&"iccandle-dark"),role:"dialog","aria-modal":"true","aria-label":c("Pattern.subscriptionModalAria"),onPointerDown:x=>{x.target===x.currentTarget&&t(!1)},children:h.jsx("div",{className:ft("iccandle-pattern-tracker-modal__content",m&&"iccandle-pattern-tracker-modal__content--settings"),style:{...u,height:m?"100%":void 0},onPointerDown:x=>x.stopPropagation(),children:m?h.jsx(Ew,{form:T,onBack:A,onCancel:()=>t(!1),onSubscribe:g,isSubscribing:b,errorMessage:p,formRef:k}):h.jsx(bw,{patternName:d,onPatternNameChange:l,onNext:v,onCancel:()=>t(!1)})})}):null},Io=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Lo=Ps,Lw=(e,t)=>n=>{var i;if(t?.variants==null)return Lo(e,n?.class,n?.className);const{variants:a,defaultVariants:r}=t,o=Object.keys(a).map(c=>{const d=n?.[c],l=r?.[c];if(d===null)return null;const m=Io(d)||Io(l);return a[c][m]}),s=n&&Object.entries(n).reduce((c,d)=>{let[l,m]=d;return m===void 0||(c[l]=m),c},{}),u=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((c,d)=>{let{class:l,className:m,...f}=d;return Object.entries(f).every(p=>{let[y,b]=p;return Array.isArray(b)?b.includes({...r,...s}[y]):{...r,...s}[y]===b})?[...c,l,m]:c},[]);return Lo(e,o,u,n?.class,n?.className)},Fw=Lw("inline-flex items-center text-theme-color cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-[#00dfb9]/10 border-[0.1px] border-[#00dfb9]/50",warning:"bg-amber-500/15 border-[0.1px] border-amber-500/60 text-amber-500 hover:bg-amber-500/25",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});function Fo({className:e,variant:t="default",size:n="default",asChild:i=!1,...a}){const r=i?my:"button";return h.jsx(r,{"data-slot":"button","data-variant":t,"data-size":n,className:ft(Fw({variant:t,size:n,className:e})),...a})}function Gw(e,t){try{return new Intl.DateTimeFormat(t,{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return new Date(e).toLocaleString()}}function Bw({event:e,symbol:t,onClose:n,onGoToEventDetail:i,position:a}){const{t:r,language:o}=At(),s=w.useId(),u=w.useId(),c=w.useRef(null),d=w.useRef(null);w.useEffect(()=>(d.current=document.activeElement,c.current?.focus(),()=>{d.current?.focus?.()}),[]);const l=()=>{const m=e.default_symbol||t;localStorage.setItem("currentSymbolNews",m),i?.(e),n()};return h.jsx("div",{className:"iccandle-event-info-modal",onClick:n,role:"presentation",children:h.jsxs("div",{className:"iccandle-event-info-modal__dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":u,style:a?{left:`${a.x}px`,top:`${a.y}px`,transform:"translate(-50%, -100%)"}:{bottom:"100px",left:"50%",transform:"translateX(-50%)"},onClick:m=>m.stopPropagation(),onKeyDown:m=>{m.key==="Escape"&&n()},children:[h.jsxs("div",{className:"iccandle-event-info-modal__header",children:[h.jsxs("div",{className:"iccandle-event-info-modal__title-row",children:[h.jsx(Fl,{name:e.default_symbol||t||""}),h.jsx("h3",{id:s,className:"iccandle-event-info-modal__title",children:e.event_name})]}),h.jsx("button",{type:"button",onClick:n,className:"iccandle-event-info-modal__close","aria-label":r("Common.close"),ref:c,children:h.jsx(_o,{size:20})})]}),h.jsxs("div",{id:u,children:[e.timestamp?h.jsx("p",{className:"iccandle-event-info-modal__date",children:Gw(e.timestamp,o)}):null,h.jsxs("div",{className:"iccandle-event-info-modal__rows",children:[h.jsxs("div",{className:"iccandle-event-info-modal__row",children:[h.jsxs("span",{className:"iccandle-event-info-modal__label",children:[r("Common.actual"),":"]}),h.jsx("span",{className:"iccandle-event-info-modal__value",children:e.actual||"-"})]}),h.jsxs("div",{className:"iccandle-event-info-modal__row",children:[h.jsxs("span",{className:"iccandle-event-info-modal__label",children:[r("News.previousActual"),":"]}),h.jsx("span",{className:"iccandle-event-info-modal__value",children:e.previous||"-"})]}),h.jsxs("div",{className:"iccandle-event-info-modal__row",children:[h.jsxs("span",{className:"iccandle-event-info-modal__label",children:[r("News.currentForecast"),":"]}),h.jsx("span",{className:"iccandle-event-info-modal__value",children:e.forecast||"-"})]}),h.jsxs("div",{className:"iccandle-event-info-modal__row",children:[h.jsxs("span",{className:"iccandle-event-info-modal__label",children:[r("News.previousForecast"),":"]}),h.jsx("span",{className:"iccandle-event-info-modal__value",children:"-"})]})]})]}),h.jsxs("div",{className:"iccandle-event-info-modal__actions",children:[h.jsx(Fo,{variant:"outline",onClick:n,className:"iccandle-event-info-modal__btn",children:r("Common.close")}),h.jsx(Fo,{onClick:l,className:"iccandle-event-info-modal__btn",children:r("News.goToEventDetail")})]})]})})}function jw({language:e,children:t}){const n=w.useMemo(()=>{const i=bs(e);return{language:i,t:(a,r)=>vs(i,a,r)}},[e]);return h.jsx(ws.Provider,{value:n,children:t})}function Uw(e){try{const t=JSON.parse(localStorage.getItem(Cn)||"null");if(t&&String(t.id)===String(e))return t}catch{}try{return JSON.parse(localStorage.getItem(ni)||"[]").find(n=>String(n.id)===String(e))??null}catch{return null}}function zw(e){return!(!e?.event_name||!e.currency||e.event_name==="Holiday"||e.status==="early")}const Yw=w.memo(function({src:t,iframeRef:n,onLoad:i}){return h.jsx("iframe",{ref:n,src:t,onLoad:i,className:"h-full w-full",title:"ICCandle results"})}),Hw=({chartWidget:e,children:t,theme:n,language:i,onCloseResult:a,iframeLoaded:r})=>{const[o,s]=w.useState(Jt+"/"+i+"?theme="+n),u=w.useRef(null),c=w.useCallback(re=>{s(Te=>Te===re?Te:re)},[]),d=w.useCallback(()=>{const re=u.current?.contentWindow;if(!re)return;if(re.postMessage(JSON.stringify({type:"parent-origin",origin:window.location.origin}),Jt),new URLSearchParams(window.location.search).get("payment")==="success"){const Ue=()=>re.postMessage(JSON.stringify({type:"payment-success"}),Jt);[0,600,1500].forEach(Be=>window.setTimeout(Ue,Be));const de=new URL(window.location.href);["payment","session_id","lookup_key"].forEach(Be=>de.searchParams.delete(Be)),window.history.replaceState({},"",de)}},[]),l=w.useMemo(()=>bs(i),[i]),m=w.useMemo(()=>({highlightBarsRef:{current:[]},generatedCandlesBackgroundStudyIdRef:{current:null},generatedCandlesStudyIdRef:{current:null}}),[]),f=typeof t=="function"?t(m):t,p=w.useRef(null),y=w.useRef(null),b=w.useRef(!1),P=w.useRef(null),k=w.useRef([]),T=w.useRef(null),v=Ye(re=>re.setTargetCandles),[g,A]=w.useState(!1),[x,S]=w.useState(!1),[D,L]=w.useState(null),[H,j]=w.useState(null),[G,q]=w.useState(null),Z=w.useCallback(()=>T.current&&getComputedStyle(T.current).getPropertyValue("--iccandle-primary").trim()||void 0,[]),F=w.useRef(Z);w.useEffect(()=>{F.current=Z},[Z]);const W=w.useMemo(()=>n==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n,[n]),[Q,se]=w.useState(!1),[E,N]=w.useState(!1),[z,B]=w.useState(!1),[U,_]=w.useState(Ui),[X,J]=w.useState([]),[$,ne]=w.useState(!1),[le,pe]=w.useState("60"),[V,xe]=w.useState(ng.interval),[Ee,st]=w.useState(""),[qt,Dt]=w.useState(!0),nn=w.useCallback(re=>{Dt(re!=="/news"),G?.length&&(Ye.getState().setPlayEndTimestamp(null),Ye.getState().setGapCount(0),q(null),Pt(!1),hi(e))},[e,G]),lt=w.useCallback(()=>N(!0),[]),an=w.useCallback(()=>N(!1),[]),C=w.useCallback(()=>{Ye.getState().setPlayEndTimestamp(null),Ye.getState().setGapCount(0);const re=!!G?.length;q(null),Pt(!1),re&&hi(e),P.current?.()},[e,G]),R=w.useCallback(()=>ne(!0),[]),M=w.useCallback(()=>ne(!1),[]),ee=w.useCallback(()=>{S(!1),L(null),j(null)},[]),K=w.useCallback(re=>{const Te=re.default_symbol||Ee,Ue=W==="dark"?"dark":"light";try{const Be=e?.activeChart?.();if(Be){if(p.current){try{Be.removeEntity(p.current)}catch{}p.current=null}Be.getAllShapes().filter(Xe=>Xe.name==="date_range").forEach(Xe=>{try{Be.removeEntity(Xe.id)}catch{}})}}catch{}B(!1),q(null),Ye.getState().setPlayEndTimestamp(null);const de={id:re.id,event_name:re.event_name,timestamp:re.timestamp,actual:re.actual||"",forecast:re.forecast||"",previous:re.previous||"",currency:re.currency||"",metric:"",default_symbol:re.default_symbol,status:re.status};try{localStorage.setItem(Cn,JSON.stringify(de))}catch{}try{e?.activeChart?.()?.refreshMarks()}catch{}(async()=>(await Zl(e,re.timestamp,{lastEntity:p,applyingPatternRef:b,setHasActiveShape:B,setCandles:J,setWindowSize:_,setSymbol:st,setResolution:xe,setTimeframe:pe,setTargetCandles:v,clearSelectedCandles:()=>q(null)}),await Xl(e,re.timestamp,y)))(),c(`${Jt}/${l}/news/similar-events/${re.id}?symbol=${encodeURIComponent(Te)}&theme=${Ue}`)},[e,l,W,v,c,Ee]),Y=w.useCallback(re=>{if(!re||!e)return;let Te;try{Te=e.activeChart()}catch(Pe){console.log("Error getting active chart",Pe);return}if(!Te)return;const Ue=Te.getTimeScale(),de=Te.getVisibleRange();if(!de?.from||!de?.to)return;const Be=T.current?.firstElementChild||T.current;if(!Be)return;const Xe=Be.getBoundingClientRect(),ze=Ue.width(),gn=Pe=>{let ke=0,De=ze,be=ze/2;const Me=.1;for(let Ve=0;Ve<30;Ve++){const Qe=(ke+De)/2,ut=Ue.coordinateToTime(Qe);if(ut===null){const tc=(Pe-de.from)/(de.to-de.from);be=Math.max(0,Math.min(ze,tc*ze));break}const Se=ut-Pe;if(Math.abs(Se)<Me){be=Qe;break}Se>0?De=Qe:ke=Qe,be=Qe}const We=Xe.left+be+53,ye=Xe.bottom-103;return{x:We,y:ye}},Ne=Uw(re);if(!zw(Ne))return;const Ze=Ne.timestamp?Ne.timestamp/1e3:null,_e=de.to-de.from,ce=Ze??de.from+_e*.5,ge=gn(ce);ge&&j(ge),L(Ne),S(!0)},[e]),oe=w.useCallback(()=>{se(!0)},[]),me=w.useCallback(()=>{b.current||(p.current=null,B(!1))},[]),fe=w.useCallback(re=>{pe(re==="1"||re==="5"?"60":re),xe(re),me()},[me]),Ce=w.useCallback(re=>{st(re.library_custom_fields?.ticker||re.ticker||re.name||re.base_name+""||""),me()},[me]);w.useEffect(()=>{let re,Te,Ue;return e&&e.onChartReady(()=>{const de=e.activeChart();if(de){const Be=de.resolution(),Xe=Tt?.find(Ne=>Ne.display_name===de.symbol());pe(Be),xe(Be),st(Xe?.ticker||de.symbol());const ze=async(Ne,Ze)=>{if(de?.getAllShapes()?.filter(ge=>ge.name==="date_range")?.forEach(ge=>{de?.removeEntity(ge.id)}),Ze){const{data:ge}=await de.exportData();let Pe=ge.findIndex(ye=>ye[0]===Ze);Pe===-1&&(Pe=ge.length-1);const ke=ge.findIndex(ye=>ye[0]===Ne),De=Math.floor((ke+Pe)/2),be=Math.floor(Ui/2),Me=ge.slice(De-(be+1),De+be),We=ge.slice(De+be-49,De+be);if(_(Me.length),J(Me.map(ye=>({o:ye[1],h:ye[2],l:ye[3],c:ye[4],timestamp:ye[0]}))),v(We.map(ye=>({o:ye[1],h:ye[2],l:ye[3],c:ye[4],timestamp:ye[0]}))),B(!0),p.current=await de.createMultipointShape([{time:Me[0][0]},{time:Me[Me.length-1][0]}],ia(F.current())),p.current){const ye=de.getShapeById(p.current);ye&&ye.setSavingEnabled&&(ye.setProperties({customText:{visible:!0,text:Hr}}),ye.setSavingEnabled(!1))}}};re=Vg(async(Ne,Ze)=>{if(!b.current&&(Ze==="remove"&&(p.current===Ne&&(p.current=null),B(!1)),Ze==="points_changed"&&de.getAllShapes().filter(_e=>_e.name==="date_range").some(_e=>_e.id===Ne)&&e)){const _e=de.getShapeById(Ne);if(!_e)return;const ce=_e.getPoints(),ge=ce[0].time,Pe=ce[1].time,{data:ke}=await de.exportData();let De=ke.findIndex(Se=>Se[0]===Pe),be=ke.findIndex(Se=>Se[0]===ge);De===-1&&(De=ke.length-2,be=ke.length-1-Ui);let We=ke.slice(be,De+1).length-1;We>Vt.max?(We=Math.round(We/10)*10-1,We>Vt.custom[Vt.custom.length-1]&&(We=Vt.custom[Vt.custom.length-1]-1)):We<=Vt.min&&(We=Vt.min-1),p.current&&de.removeEntity(p.current),de.getAllShapes().filter(Se=>Se.name==="date_range").forEach(Se=>{de.removeEntity(Se.id)});const Qe=ke.slice(De-We,De+1),ut=ke.slice(De-49,De+1);if(p.current=await de.createMultipointShape([{time:Qe[0][0]},{time:Qe[Qe.length-1][0]}],ia(F.current())),_(Qe.length),J(Qe.map(Se=>({o:Se[1],h:Se[2],l:Se[3],c:Se[4],timestamp:Se[0]}))),v(ut.map(Se=>({o:Se[1],h:Se[2],l:Se[3],c:Se[4],timestamp:Se[0]}))),B(!0),p.current){const Se=de.getShapeById(p.current);Se&&Se.setSavingEnabled&&(Se.setProperties({customText:{visible:!0,text:Hr}}),Se.setSavingEnabled(!1))}}},500),P.current=()=>{B(!0);const Ne=de.getVisibleRange();Ne?.from&&Ne?.to&&ze(Ne.from,Ne.to)};const gn=Ne=>{if(!p.current||!Ne)return!1;try{const Ze=de?.getShapeById(p.current);if(!Ze)return!1;const _e=Ze.getPoints();if(_e.length===0)return!1;const ce=_e.map(De=>De.time).filter(De=>typeof De=="number");if(ce.length===0)return!1;const ge=Math.min(...ce);return Math.max(...ce)<Ne.from||ge>Ne.to}catch{return!1}};Ue=Ne=>{Te&&clearTimeout(Te),Te=setTimeout(()=>{gn(Ne)?B(!1):p.current&&B(!0)},150)},de.onIntervalChanged().subscribe(null,fe),de.onSymbolChanged().subscribe(null,Ce),de.onVisibleRangeChanged().subscribe(null,Ue),e.subscribe?.("drawing_event",re)}}),()=>{p.current=null,P.current=null;try{if(Te&&clearTimeout(Te),e){const de=e.activeChart();de&&(Ue&&de.onVisibleRangeChanged().unsubscribe(null,Ue),de.onIntervalChanged().unsubscribe(null,fe),de.onSymbolChanged().unsubscribe(null,Ce)),re&&e.unsubscribe("drawing_event",re)}}catch{}}},[e,fe,Ce,v]),w.useEffect(()=>{if(!e)return;const re=Y;return e.onChartReady(()=>{e.subscribe("onTimescaleMarkClick",re)}),()=>{try{e.unsubscribe("onTimescaleMarkClick",re)}catch{}}},[e,Y]),Wv(e,k);const ct=w.useMemo(()=>({lastEntity:p,applyingPatternRef:b,setHasActiveShape:B,setCandles:J,setWindowSize:_,setSymbol:st,setResolution:xe,setTimeframe:pe,setTargetCandles:v,clearSelectedCandles:()=>q(null)}),[v]);yw(e,q,X[X.length-1]?.timestamp??null,A,a,ct,nn),w.useEffect(()=>{if(!e)return;let re=!1;return e.onChartReady(async()=>{if(!re)try{await Jl(e.activeChart(),m,e.getTheme())}catch(Te){console.error("Failed to create generated candle studies:",Te)}}),()=>{re=!0}},[e,m]),lw(e,m,V,Ee,G);const He=w.useCallback(()=>{try{localStorage.removeItem(ni),localStorage.removeItem(Cn)}catch{}const re=e?.activeChart?.();if(re){k.current&&k.current.length>0&&(k.current.forEach(Te=>{try{re.removeEntity(Te)}catch{}}),k.current=[]);try{re.clearMarks(2)}catch{}}},[e]);return h.jsxs("div",{className:"h-full w-full flex",children:[h.jsx(jw,{language:l,children:h.jsxs("div",{ref:T,lang:l,className:`w-full h-full iccandle-selector-widget ${W==="dark"?"iccandle-dark":""}`,children:[f,qt&&h.jsx($f,{submitCallback:c,handleShowDialog:R,triggerScanner:C,window_size:U,currentSymbol:Ee,resolution:V,timeframe:le,chartWidget:e,candles:X,handleStartDrag:lt,handleStopDrag:an,hasActiveShape:z,theme:W,language:l,clearScannerNewsMarks:He,selectedCandles:G,iframeLoaded:r,isLoading:g,handleTrackPatternClick:oe}),Q&&h.jsx(Iw,{open:Q,onOpenChange:se,resolution:V,type:Tt.find(re=>re.ticker===Ee)?.type??"forex",symbol:Ee,candles:X,percent:90,theme:W}),$&&h.jsx(Hv,{setResolution:pe,timeframe:le,handleCloseDialog:M}),x&&D&&h.jsx(Bw,{event:D,symbol:Ee||localStorage.getItem("tv:latest-symbol")||"XAU_USD",onClose:ee,onGoToEventDetail:K,position:H}),E&&h.jsx("div",{className:"iccandle-selector-widget__overlay"}),h.jsx(Oc,{theme:W,position:"top-right",className:"iccandle-toaster",richColors:!1})]})}),h.jsx(Yw,{src:o,iframeRef:u,onLoad:d})]})};exports.WidgetIccandle=Hw;exports.getCustomIndicators=rw;exports.getGeneratedCandlesMaskColor=Ja;exports.withPlayChart=tw;
|
|
122
|
+
`,tg=[{name:"All",value:"all"},{name:"Forex",value:"forex"},{name:"Crypto",value:"crypto"},{name:"Indices",value:"indices"},{name:"Commodities",value:"commodity"},{name:"Stock",value:"stock"}],ng={interval:"60"},ig={D:"1440",H4:"240",H2:"120",H1:"60",M30:"30",M15:"15",M5:"5",M1:"1"};function xs(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=xs(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Ps(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=xs(e))&&(i&&(i+=" "),i+=t);return i}const ag=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},rg=(e,t)=>({classGroupId:e,validator:t}),Ss=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ii="-",Wr=[],og="arbitrary..",sg=e=>{const t=cg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return lg(o);const s=o.split(ii),u=s[0]===""&&s.length>1?1:0;return Ts(s,u,t)},getConflictingClassGroupIds:(o,s)=>{if(s){const u=i[o],c=n[o];return u?c?ag(c,u):u:c||Wr}return n[o]||Wr}}},Ts=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],r=n.nextPart.get(a);if(r){const c=Ts(e,t+1,r);if(c)return c}const o=n.validators;if(o===null)return;const s=t===0?e.join(ii):e.slice(t).join(ii),u=o.length;for(let c=0;c<u;c++){const d=o[c];if(d.validator(s))return d.classGroupId}},lg=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?og+i:void 0})(),cg=e=>{const{theme:t,classGroups:n}=e;return ug(n,t)},ug=(e,t)=>{const n=Ss();for(const i in e){const a=e[i];Na(a,n,i,t)}return n},Na=(e,t,n,i)=>{const a=e.length;for(let r=0;r<a;r++){const o=e[r];dg(o,t,n,i)}},dg=(e,t,n,i)=>{if(typeof e=="string"){hg(e,t,n);return}if(typeof e=="function"){pg(e,t,n,i);return}mg(e,t,n,i)},hg=(e,t,n)=>{const i=e===""?t:ks(t,e);i.classGroupId=n},pg=(e,t,n,i)=>{if(fg(e)){Na(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(rg(n,e))},mg=(e,t,n,i)=>{const a=Object.entries(e),r=a.length;for(let o=0;o<r;o++){const[s,u]=a[o];Na(u,ks(t,s),n,i)}},ks=(e,t)=>{let n=e;const i=t.split(ii),a=i.length;for(let r=0;r<a;r++){const o=i[r];let s=n.nextPart.get(o);s||(s=Ss(),n.nextPart.set(o,s)),n=s}return n},fg=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,gg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const a=(r,o)=>{n[r]=o,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(r){let o=n[r];if(o!==void 0)return o;if((o=i[r])!==void 0)return a(r,o),o},set(r,o){r in n?n[r]=o:a(r,o)}}},aa="!",qr=":",yg=[],_r=(e,t,n,i,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:a}),bg=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=a=>{const r=[];let o=0,s=0,u=0,c;const d=a.length;for(let y=0;y<d;y++){const b=a[y];if(o===0&&s===0){if(b===qr){r.push(a.slice(u,y)),u=y+1;continue}if(b==="/"){c=y;continue}}b==="["?o++:b==="]"?o--:b==="("?s++:b===")"&&s--}const l=r.length===0?a:a.slice(u);let m=l,f=!1;l.endsWith(aa)?(m=l.slice(0,-1),f=!0):l.startsWith(aa)&&(m=l.slice(1),f=!0);const p=c&&c>u?c-u:void 0;return _r(r,f,m,p)};if(t){const a=t+qr,r=i;i=o=>o.startsWith(a)?r(o.slice(a.length)):_r(yg,!1,o,void 0,!0)}if(n){const a=i;i=r=>n({className:r,parseClassName:a})}return i},vg=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let a=[];for(let r=0;r<n.length;r++){const o=n[r],s=o[0]==="[",u=t.has(o);s||u?(a.length>0&&(a.sort(),i.push(...a),a=[]),i.push(o)):a.push(o)}return a.length>0&&(a.sort(),i.push(...a)),i}},wg=e=>({cache:gg(e.cacheSize),parseClassName:bg(e),sortModifiers:vg(e),...sg(e)}),xg=/\s+/,Pg=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:a,sortModifiers:r}=t,o=[],s=e.trim().split(xg);let u="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:l,modifiers:m,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:y}=n(d);if(l){u=d+(u.length>0?" "+u:u);continue}let b=!!y,P=i(b?p.substring(0,y):p);if(!P){if(!b){u=d+(u.length>0?" "+u:u);continue}if(P=i(p),!P){u=d+(u.length>0?" "+u:u);continue}b=!1}const k=m.length===0?"":m.length===1?m[0]:r(m).join(":"),T=f?k+aa:k,v=T+P;if(o.indexOf(v)>-1)continue;o.push(v);const g=a(P,b);for(let A=0;A<g.length;++A){const x=g[A];o.push(T+x)}u=d+(u.length>0?" "+u:u)}return u},Sg=(...e)=>{let t=0,n,i,a="";for(;t<e.length;)(n=e[t++])&&(i=Cs(n))&&(a&&(a+=" "),a+=i);return a},Cs=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=Cs(e[i]))&&(n&&(n+=" "),n+=t);return n},Tg=(e,...t)=>{let n,i,a,r;const o=u=>{const c=t.reduce((d,l)=>l(d),e());return n=wg(c),i=n.cache.get,a=n.cache.set,r=s,s(u)},s=u=>{const c=i(u);if(c)return c;const d=Pg(u,n);return a(u,d),d};return r=o,(...u)=>r(Sg(...u))},kg=[],je=e=>{const t=n=>n[e]||kg;return t.isThemeGetter=!0,t},As=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ns=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Cg=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ag=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ng=/\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$/,Dg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Rg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Eg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gt=e=>Cg.test(e),he=e=>!!e&&!Number.isNaN(Number(e)),Bt=e=>!!e&&Number.isInteger(Number(e)),zi=e=>e.endsWith("%")&&he(e.slice(0,-1)),Rt=e=>Ag.test(e),Ds=()=>!0,Og=e=>Ng.test(e)&&!Dg.test(e),Da=()=>!1,Mg=e=>Rg.test(e),Ig=e=>Eg.test(e),Lg=e=>!ie(e)&&!ae(e),Fg=e=>Ht(e,Os,Da),ie=e=>As.test(e),_t=e=>Ht(e,Ms,Og),Vr=e=>Ht(e,Wg,he),Gg=e=>Ht(e,Ls,Ds),Bg=e=>Ht(e,Is,Da),Kr=e=>Ht(e,Rs,Da),jg=e=>Ht(e,Es,Ig),qn=e=>Ht(e,Fs,Mg),ae=e=>Ns.test(e),Pn=e=>en(e,Ms),Ug=e=>en(e,Is),Jr=e=>en(e,Rs),zg=e=>en(e,Os),Yg=e=>en(e,Es),_n=e=>en(e,Fs,!0),Hg=e=>en(e,Ls,!0),Ht=(e,t,n)=>{const i=As.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},en=(e,t,n=!1)=>{const i=Ns.exec(e);return i?i[1]?t(i[1]):n:!1},Rs=e=>e==="position"||e==="percentage",Es=e=>e==="image"||e==="url",Os=e=>e==="length"||e==="size"||e==="bg-size",Ms=e=>e==="length",Wg=e=>e==="number",Is=e=>e==="family-name",Ls=e=>e==="number"||e==="weight",Fs=e=>e==="shadow",qg=()=>{const e=je("color"),t=je("font"),n=je("text"),i=je("font-weight"),a=je("tracking"),r=je("leading"),o=je("breakpoint"),s=je("container"),u=je("spacing"),c=je("radius"),d=je("shadow"),l=je("inset-shadow"),m=je("text-shadow"),f=je("drop-shadow"),p=je("blur"),y=je("perspective"),b=je("aspect"),P=je("ease"),k=je("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],g=()=>[...v(),ae,ie],A=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],S=()=>[ae,ie,u],D=()=>[Gt,"full","auto",...S()],L=()=>[Bt,"none","subgrid",ae,ie],H=()=>["auto",{span:["full",Bt,ae,ie]},Bt,ae,ie],j=()=>[Bt,"auto",ae,ie],G=()=>["auto","min","max","fr",ae,ie],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...S()],W=()=>[Gt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],Q=()=>[Gt,"screen","full","dvw","lvw","svw","min","max","fit",...S()],se=()=>[Gt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],E=()=>[e,ae,ie],N=()=>[...v(),Jr,Kr,{position:[ae,ie]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",zg,Fg,{size:[ae,ie]}],U=()=>[zi,Pn,_t],_=()=>["","none","full",c,ae,ie],X=()=>["",he,Pn,_t],J=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[he,zi,Jr,Kr],le=()=>["","none",p,ae,ie],pe=()=>["none",he,ae,ie],V=()=>["none",he,ae,ie],xe=()=>[he,ae,ie],Ee=()=>[Gt,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Rt],breakpoint:[Rt],color:[Ds],container:[Rt],"drop-shadow":[Rt],ease:["in","out","in-out"],font:[Lg],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Rt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Rt],shadow:[Rt],spacing:["px",he],text:[Rt],"text-shadow":[Rt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gt,ie,ae,b]}],container:["container"],columns:[{columns:[he,ie,ae,s]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:g()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{"inset-s":D(),start:D()}],end:[{"inset-e":D(),end:D()}],"inset-bs":[{"inset-bs":D()}],"inset-be":[{"inset-be":D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[Bt,"auto",ae,ie]}],basis:[{basis:[Gt,"full","auto",s,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[he,Gt,"auto","initial","none",ie]}],grow:[{grow:["",he,ae,ie]}],shrink:[{shrink:["",he,ae,ie]}],order:[{order:[Bt,"first","last","none",ae,ie]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...Q()]}],"min-inline-size":[{"min-inline":["auto",...Q()]}],"max-inline-size":[{"max-inline":["none",...Q()]}],"block-size":[{block:["auto",...se()]}],"min-block-size":[{"min-block":["auto",...se()]}],"max-block-size":[{"max-block":["none",...se()]}],w:[{w:[s,"screen",...W()]}],"min-w":[{"min-w":[s,"screen","none",...W()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,Pn,_t]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Hg,Gg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zi,ie]}],"font-family":[{font:[Ug,Bg,t]}],"font-features":[{"font-features":[ie]}],"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:[a,ae,ie]}],"line-clamp":[{"line-clamp":[he,"none",ae,Vr]}],leading:[{leading:[r,...S()]}],"list-image":[{"list-image":["none",ae,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ae,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[he,"from-font","auto",ae,_t]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[he,"auto",ae,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ae,ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ae,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bt,ae,ie],radial:["",ae,ie],conic:[Bt,ae,ie]},Yg,jg]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:_()}],"rounded-s":[{"rounded-s":_()}],"rounded-e":[{"rounded-e":_()}],"rounded-t":[{"rounded-t":_()}],"rounded-r":[{"rounded-r":_()}],"rounded-b":[{"rounded-b":_()}],"rounded-l":[{"rounded-l":_()}],"rounded-ss":[{"rounded-ss":_()}],"rounded-se":[{"rounded-se":_()}],"rounded-ee":[{"rounded-ee":_()}],"rounded-es":[{"rounded-es":_()}],"rounded-tl":[{"rounded-tl":_()}],"rounded-tr":[{"rounded-tr":_()}],"rounded-br":[{"rounded-br":_()}],"rounded-bl":[{"rounded-bl":_()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[he,ae,ie]}],"outline-w":[{outline:["",he,Pn,_t]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",d,_n,qn]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",l,_n,qn]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[he,_t]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",m,_n,qn]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[he,ae,ie]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[he]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[ae,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[he]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ae,ie]}],filter:[{filter:["","none",ae,ie]}],blur:[{blur:le()}],brightness:[{brightness:[he,ae,ie]}],contrast:[{contrast:[he,ae,ie]}],"drop-shadow":[{"drop-shadow":["","none",f,_n,qn]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",he,ae,ie]}],"hue-rotate":[{"hue-rotate":[he,ae,ie]}],invert:[{invert:["",he,ae,ie]}],saturate:[{saturate:[he,ae,ie]}],sepia:[{sepia:["",he,ae,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",ae,ie]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[he,ae,ie]}],"backdrop-contrast":[{"backdrop-contrast":[he,ae,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",he,ae,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[he,ae,ie]}],"backdrop-invert":[{"backdrop-invert":["",he,ae,ie]}],"backdrop-opacity":[{"backdrop-opacity":[he,ae,ie]}],"backdrop-saturate":[{"backdrop-saturate":[he,ae,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",he,ae,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ae,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[he,"initial",ae,ie]}],ease:[{ease:["linear","initial",P,ae,ie]}],delay:[{delay:[he,ae,ie]}],animate:[{animate:["none",k,ae,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,ae,ie]}],"perspective-origin":[{"perspective-origin":g()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[ae,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:g()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ae,ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",ae,ie]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[he,Pn,_t,Vr]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},_g=Tg(qg);function ft(...e){return _g(Ps(e))}function Vg(e,t){let n;return(i,a)=>{clearTimeout(n),n=setTimeout(()=>e(i,a),t)}}const ln=(e,t)=>{if(t==="1D"||t==="D"||t==="1440"){const n=new Date(e*1e3);return n.setUTCHours(0,0,0,0),n.getTime()}return e.toString().length>11?e:e*1e3};var Ln=e=>e.type==="checkbox",Xt=e=>e instanceof Date,et=e=>e==null;const Gs=e=>typeof e=="object";var Ge=e=>!et(e)&&!Array.isArray(e)&&Gs(e)&&!Xt(e),Bs=e=>Ge(e)&&e.target?Ln(e.target)?e.target.checked:e.target.value:e,Kg=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,js=(e,t)=>e.has(Kg(t)),Jg=e=>{const t=e.constructor&&e.constructor.prototype;return Ge(t)&&t.hasOwnProperty("isPrototypeOf")},Ra=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Le(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Ra&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Ge(e)&&Jg(e)))return e;const i=n?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(i[a]=Le(e[a]));return i}var wi=e=>/^\w*$/.test(e),Re=e=>e===void 0,Ea=e=>Array.isArray(e)?e.filter(Boolean):[],Oa=e=>Ea(e.replace(/["|']|\]/g,"").split(/\.|\[/)),te=(e,t,n)=>{if(!t||!Ge(e))return n;const i=(wi(t)?[t]:Oa(t)).reduce((a,r)=>et(a)?a:a[r],e);return Re(i)||i===e?Re(e[t])?n:e[t]:i},it=e=>typeof e=="boolean",Je=e=>typeof e=="function",Ae=(e,t,n)=>{let i=-1;const a=wi(t)?[t]:Oa(t),r=a.length,o=r-1;for(;++i<r;){const s=a[i];let u=n;if(i!==o){const c=e[s];u=Ge(c)||Array.isArray(c)?c:isNaN(+a[i+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=u,e=e[s]}};const ai={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ht={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Et={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ma=w.createContext(null);Ma.displayName="HookFormControlContext";const Ia=()=>w.useContext(Ma);var Us=(e,t,n,i=!0)=>{const a={defaultValues:t._defaultValues};for(const r in e)Object.defineProperty(a,r,{get:()=>{const o=r;return t._proxyFormState[o]!==ht.all&&(t._proxyFormState[o]=!i||ht.all),n&&(n[o]=!0),e[o]}});return a};const La=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Xg(e){const t=Ia(),{control:n=t,disabled:i,name:a,exact:r}=e||{},[o,s]=w.useState(n._formState),u=w.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return La(()=>n._subscribe({name:a,formState:u.current,exact:r,callback:c=>{!i&&s({...n._formState,...c})}}),[a,i,r]),w.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),w.useMemo(()=>Us(o,n,u.current,!1),[o,n])}var rt=e=>typeof e=="string",ra=(e,t,n,i,a)=>rt(e)?(i&&t.watch.add(e),te(n,e,a)):Array.isArray(e)?e.map(r=>(i&&t.watch.add(r),te(n,r))):(i&&(t.watchAll=!0),n),oa=e=>et(e)||!Gs(e);function pt(e,t,n=new WeakSet){if(oa(e)||oa(t))return Object.is(e,t);if(Xt(e)&&Xt(t))return Object.is(e.getTime(),t.getTime());const i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const r of i){const o=e[r];if(!a.includes(r))return!1;if(r!=="ref"){const s=t[r];if(Xt(o)&&Xt(s)||Ge(o)&&Ge(s)||Array.isArray(o)&&Array.isArray(s)?!pt(o,s,n):!Object.is(o,s))return!1}}return!0}function Qn(e){const t=Ia(),{control:n=t,name:i,defaultValue:a,disabled:r,exact:o,compute:s}=e||{},u=w.useRef(a),c=w.useRef(s),d=w.useRef(void 0),l=w.useRef(n),m=w.useRef(i);c.current=s;const[f,p]=w.useState(()=>{const v=n._getWatch(i,u.current);return c.current?c.current(v):v}),y=w.useCallback(v=>{const g=ra(i,n._names,v||n._formValues,!1,u.current);return c.current?c.current(g):g},[n._formValues,n._names,i]),b=w.useCallback(v=>{if(!r){const g=ra(i,n._names,v||n._formValues,!1,u.current);if(c.current){const A=c.current(g);pt(A,d.current)||(p(A),d.current=A)}else p(g)}},[n._formValues,n._names,r,i]);La(()=>((l.current!==n||!pt(m.current,i))&&(l.current=n,m.current=i,b()),n._subscribe({name:i,formState:{values:!0},exact:o,callback:v=>{b(v.values)}})),[n,o,i,b]),w.useEffect(()=>n._removeUnmounted());const P=l.current!==n,k=m.current,T=w.useMemo(()=>{if(r)return null;const v=!P&&!pt(k,i);return P||v?y():null},[r,P,i,k,y]);return T!==null?T:f}function Zg(e){const t=Ia(),{name:n,disabled:i,control:a=t,shouldUnregister:r,defaultValue:o,exact:s=!0}=e,u=js(a._names.array,n),c=w.useMemo(()=>te(a._formValues,n,te(a._defaultValues,n,o)),[a,n,o]),d=Qn({control:a,name:n,defaultValue:c,exact:s}),l=Xg({control:a,name:n,exact:s}),m=w.useRef(e),f=w.useRef(void 0),p=w.useRef(a.register(n,{...e.rules,value:d,...it(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const y=w.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!te(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!te(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!te(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!te(l.validatingFields,n)},error:{enumerable:!0,get:()=>te(l.errors,n)}}),[l,n]),b=w.useCallback(v=>p.current.onChange({target:{value:Bs(v),name:n},type:ai.CHANGE}),[n]),P=w.useCallback(()=>p.current.onBlur({target:{value:te(a._formValues,n),name:n},type:ai.BLUR}),[n,a._formValues]),k=w.useCallback(v=>{const g=te(a._fields,n);g&&g._f&&v&&(g._f.ref={focus:()=>Je(v.focus)&&v.focus(),select:()=>Je(v.select)&&v.select(),setCustomValidity:A=>Je(v.setCustomValidity)&&v.setCustomValidity(A),reportValidity:()=>Je(v.reportValidity)&&v.reportValidity()})},[a._fields,n]),T=w.useMemo(()=>({name:n,value:d,...it(i)||l.disabled?{disabled:l.disabled||i}:{},onChange:b,onBlur:P,ref:k}),[n,i,l.disabled,b,P,k,d]);return w.useEffect(()=>{const v=a._options.shouldUnregister||r,g=f.current;g&&g!==n&&!u&&a.unregister(g),a.register(n,{...m.current.rules,...it(m.current.disabled)?{disabled:m.current.disabled}:{}});const A=(x,S)=>{const D=te(a._fields,x);D&&D._f&&(D._f.mount=S)};if(A(n,!0),v){const x=Le(te(a._options.defaultValues,n,m.current.defaultValue));Ae(a._defaultValues,n,x),Re(te(a._formValues,n))&&Ae(a._formValues,n,x)}return!u&&a.register(n),f.current=n,()=>{(u?v&&!a._state.action:v)?a.unregister(n):A(n,!1)}},[n,a,u,r]),w.useEffect(()=>{a._setDisabledField({disabled:i,name:n})},[i,n,a]),w.useMemo(()=>({field:T,formState:l,fieldState:y}),[T,l,y])}const Yi=e=>e.render(Zg(e)),zs=w.createContext(null);zs.displayName="HookFormContext";const Qg=e=>{const{children:t,watch:n,getValues:i,getFieldState:a,setError:r,clearErrors:o,setValue:s,trigger:u,formState:c,resetField:d,reset:l,handleSubmit:m,unregister:f,control:p,register:y,setFocus:b,subscribe:P}=e;return w.createElement(zs.Provider,{value:w.useMemo(()=>({watch:n,getValues:i,getFieldState:a,setError:r,clearErrors:o,setValue:s,trigger:u,formState:c,resetField:d,reset:l,handleSubmit:m,unregister:f,control:p,register:y,setFocus:b,subscribe:P}),[o,p,c,a,i,m,y,l,d,r,b,s,P,u,f,n])},w.createElement(Ma.Provider,{value:p},t))};var $g=(e,t,n,i,a)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[i]:a||!0}}:{},Tn=e=>Array.isArray(e)?e:[e],Xr=()=>{let e=[];return{get observers(){return e},next:a=>{for(const r of e)r.next&&r.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(r=>r!==a)}}),unsubscribe:()=>{e=[]}}};function Ys(e,t){const n={};for(const i in e)if(e.hasOwnProperty(i)){const a=e[i],r=t[i];if(a&&Ge(a)&&r){const o=Ys(a,r);Ge(o)&&(n[i]=o)}else e[i]&&(n[i]=r)}return n}var Ke=e=>Ge(e)&&!Object.keys(e).length,Fa=e=>e.type==="file",ri=e=>{if(!Ra)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Hs=e=>e.type==="select-multiple",Ga=e=>e.type==="radio",ey=e=>Ga(e)||Ln(e),Hi=e=>ri(e)&&e.isConnected;function ty(e,t){const n=t.slice(0,-1).length;let i=0;for(;i<n;)e=Re(e)?i++:e[t[i++]];return e}function ny(e){for(const t in e)if(e.hasOwnProperty(t)&&!Re(e[t]))return!1;return!0}function Fe(e,t){const n=Array.isArray(t)?t:wi(t)?[t]:Oa(t),i=n.length===1?e:ty(e,n),a=n.length-1,r=n[a];return i&&delete i[r],a!==0&&(Ge(i)&&Ke(i)||Array.isArray(i)&&ny(i))&&Fe(e,n.slice(0,-1)),e}var iy=e=>{for(const t in e)if(Je(e[t]))return!0;return!1};function Ws(e){return Array.isArray(e)||Ge(e)&&!iy(e)}function sa(e,t={}){for(const n in e){const i=e[n];Ws(i)?(t[n]=Array.isArray(i)?[]:{},sa(i,t[n])):Re(i)||(t[n]=!0)}return t}function sn(e,t,n){n||(n=sa(t));for(const i in e){const a=e[i];if(Ws(a))Re(t)||oa(n[i])?n[i]=sa(a,Array.isArray(a)?[]:{}):sn(a,et(t)?{}:t[i],n[i]);else{const r=t[i];n[i]=!pt(a,r)}}return n}const Zr={value:!1,isValid:!1},Qr={value:!0,isValid:!0};var qs=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Re(e[0].attributes.value)?Re(e[0].value)||e[0].value===""?Qr:{value:e[0].value,isValid:!0}:Qr:Zr}return Zr},_s=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:i})=>Re(e)?e:t?e===""?NaN:e&&+e:n&&rt(e)?new Date(e):i?i(e):e;const $r={isValid:!1,value:null};var Vs=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,$r):$r;function eo(e){const t=e.ref;return Fa(t)?t.files:Ga(t)?Vs(e.refs).value:Hs(t)?[...t.selectedOptions].map(({value:n})=>n):Ln(t)?qs(e.refs).value:_s(Re(t.value)?e.ref.value:t.value,e)}var ay=(e,t,n,i)=>{const a={};for(const r of e){const o=te(t,r);o&&Ae(a,r,o._f)}return{criteriaMode:n,names:[...e],fields:a,shouldUseNativeValidation:i}},oi=e=>e instanceof RegExp,Sn=e=>Re(e)?e:oi(e)?e.source:Ge(e)?oi(e.value)?e.value.source:e.value:e,to=e=>({isOnSubmit:!e||e===ht.onSubmit,isOnBlur:e===ht.onBlur,isOnChange:e===ht.onChange,isOnAll:e===ht.all,isOnTouch:e===ht.onTouched});const no="AsyncFunction";var ry=e=>!!e&&!!e.validate&&!!(Je(e.validate)&&e.validate.constructor.name===no||Ge(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===no)),oy=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),io=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const kn=(e,t,n,i)=>{for(const a of n||Object.keys(e)){const r=te(e,a);if(r){const{_f:o,...s}=r;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],a)&&!i)return!0;if(o.ref&&t(o.ref,o.name)&&!i)return!0;if(kn(s,t))break}else if(Ge(s)&&kn(s,t))break}}};function ao(e,t,n){const i=te(e,n);if(i||wi(n))return{error:i,name:n};const a=n.split(".");for(;a.length;){const r=a.join("."),o=te(t,r),s=te(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(s&&s.type)return{name:r,error:s};if(s&&s.root&&s.root.type)return{name:`${r}.root`,error:s.root};a.pop()}return{name:n}}var sy=(e,t,n,i)=>{n(e);const{name:a,...r}=e;return Ke(r)||Object.keys(r).length>=Object.keys(t).length||Object.keys(r).find(o=>t[o]===(!i||ht.all))},ly=(e,t,n)=>!e||!t||e===t||Tn(e).some(i=>i&&(n?i===t:i.startsWith(t)||t.startsWith(i))),cy=(e,t,n,i,a)=>a.isOnAll?!1:!n&&a.isOnTouch?!(t||e):(n?i.isOnBlur:a.isOnBlur)?!e:(n?i.isOnChange:a.isOnChange)?e:!0,uy=(e,t)=>!Ea(te(e,t)).length&&Fe(e,t),dy=(e,t,n)=>{const i=Tn(te(e,n));return Ae(i,"root",t[n]),Ae(e,n,i),e};function ro(e,t,n="validate"){if(rt(e)||Array.isArray(e)&&e.every(rt)||it(e)&&!e)return{type:n,message:rt(e)?e:"",ref:t}}var on=e=>Ge(e)&&!oi(e)?e:{value:e,message:""},oo=async(e,t,n,i,a,r)=>{const{ref:o,refs:s,required:u,maxLength:c,minLength:d,min:l,max:m,pattern:f,validate:p,name:y,valueAsNumber:b,mount:P}=e._f,k=te(n,y);if(!P||t.has(y))return{};const T=s?s[0]:o,v=j=>{a&&T.reportValidity&&(T.setCustomValidity(it(j)?"":j||""),T.reportValidity())},g={},A=Ga(o),x=Ln(o),S=A||x,D=(b||Fa(o))&&Re(o.value)&&Re(k)||ri(o)&&o.value===""||k===""||Array.isArray(k)&&!k.length,L=$g.bind(null,y,i,g),H=(j,G,q,Z=Et.maxLength,F=Et.minLength)=>{const W=j?G:q;g[y]={type:j?Z:F,message:W,ref:o,...L(j?Z:F,W)}};if(r?!Array.isArray(k)||!k.length:u&&(!S&&(D||et(k))||it(k)&&!k||x&&!qs(s).isValid||A&&!Vs(s).isValid)){const{value:j,message:G}=rt(u)?{value:!!u,message:u}:on(u);if(j&&(g[y]={type:Et.required,message:G,ref:T,...L(Et.required,G)},!i))return v(G),g}if(!D&&(!et(l)||!et(m))){let j,G;const q=on(m),Z=on(l);if(!et(k)&&!isNaN(k)){const F=o.valueAsNumber||k&&+k;et(q.value)||(j=F>q.value),et(Z.value)||(G=F<Z.value)}else{const F=o.valueAsDate||new Date(k),W=E=>new Date(new Date().toDateString()+" "+E),Q=o.type=="time",se=o.type=="week";rt(q.value)&&k&&(j=Q?W(k)>W(q.value):se?k>q.value:F>new Date(q.value)),rt(Z.value)&&k&&(G=Q?W(k)<W(Z.value):se?k<Z.value:F<new Date(Z.value))}if((j||G)&&(H(!!j,q.message,Z.message,Et.max,Et.min),!i))return v(g[y].message),g}if((c||d)&&!D&&(rt(k)||r&&Array.isArray(k))){const j=on(c),G=on(d),q=!et(j.value)&&k.length>+j.value,Z=!et(G.value)&&k.length<+G.value;if((q||Z)&&(H(q,j.message,G.message),!i))return v(g[y].message),g}if(f&&!D&&rt(k)){const{value:j,message:G}=on(f);if(oi(j)&&!k.match(j)&&(g[y]={type:Et.pattern,message:G,ref:o,...L(Et.pattern,G)},!i))return v(G),g}if(p){if(Je(p)){const j=await p(k,n),G=ro(j,T);if(G&&(g[y]={...G,...L(Et.validate,G.message)},!i))return v(G.message),g}else if(Ge(p)){let j={};for(const G in p){if(!Ke(j)&&!i)break;const q=ro(await p[G](k,n),T,G);q&&(j={...q,...L(G,q.message)},v(q.message),i&&(g[y]=j))}if(!Ke(j)&&(g[y]={ref:T,...j},!i))return g}}return v(!0),g};const hy={mode:ht.onSubmit,reValidateMode:ht.onChange,shouldFocusError:!0};function py(e={}){let t={...hy,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Je(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},i={},a=Ge(t.defaultValues)||Ge(t.values)?Le(t.defaultValues||t.values)||{}:{},r=t.shouldUnregister?{}:Le(a),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},l={...d};let m={...l};const f={array:Xr(),state:Xr()},p=t.criteriaMode===ht.all,y=C=>R=>{clearTimeout(c),c=setTimeout(C,R)},b=async C=>{if(!o.keepIsValid&&!t.disabled&&(l.isValid||m.isValid||C)){let R;t.resolver?(R=Ke((await S()).errors),P()):R=await L(i,!0),R!==n.isValid&&f.state.next({isValid:R})}},P=(C,R)=>{!t.disabled&&(l.isValidating||l.validatingFields||m.isValidating||m.validatingFields)&&((C||Array.from(s.mount)).forEach(M=>{M&&(R?Ae(n.validatingFields,M,R):Fe(n.validatingFields,M))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Ke(n.validatingFields)}))},k=(C,R=[],M,ee,K=!0,Y=!0)=>{if(ee&&M&&!t.disabled){if(o.action=!0,Y&&Array.isArray(te(i,C))){const oe=M(te(i,C),ee.argA,ee.argB);K&&Ae(i,C,oe)}if(Y&&Array.isArray(te(n.errors,C))){const oe=M(te(n.errors,C),ee.argA,ee.argB);K&&Ae(n.errors,C,oe),uy(n.errors,C)}if((l.touchedFields||m.touchedFields)&&Y&&Array.isArray(te(n.touchedFields,C))){const oe=M(te(n.touchedFields,C),ee.argA,ee.argB);K&&Ae(n.touchedFields,C,oe)}(l.dirtyFields||m.dirtyFields)&&(n.dirtyFields=sn(a,r)),f.state.next({name:C,isDirty:j(C,R),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ae(r,C,R)},T=(C,R)=>{Ae(n.errors,C,R),f.state.next({errors:n.errors})},v=C=>{n.errors=C,f.state.next({errors:n.errors,isValid:!1})},g=(C,R,M,ee)=>{const K=te(i,C);if(K){const Y=te(r,C,Re(M)?te(a,C):M);Re(Y)||ee&&ee.defaultChecked||R?Ae(r,C,R?Y:eo(K._f)):Z(C,Y),o.mount&&!o.action&&b()}},A=(C,R,M,ee,K)=>{let Y=!1,oe=!1;const me={name:C};if(!t.disabled){if(!M||ee){(l.isDirty||m.isDirty)&&(oe=n.isDirty,n.isDirty=me.isDirty=j(),Y=oe!==me.isDirty);const fe=pt(te(a,C),R);oe=!!te(n.dirtyFields,C),fe?Fe(n.dirtyFields,C):Ae(n.dirtyFields,C,!0),me.dirtyFields=n.dirtyFields,Y=Y||(l.dirtyFields||m.dirtyFields)&&oe!==!fe}if(M){const fe=te(n.touchedFields,C);fe||(Ae(n.touchedFields,C,M),me.touchedFields=n.touchedFields,Y=Y||(l.touchedFields||m.touchedFields)&&fe!==M)}Y&&K&&f.state.next(me)}return Y?me:{}},x=(C,R,M,ee)=>{const K=te(n.errors,C),Y=(l.isValid||m.isValid)&&it(R)&&n.isValid!==R;if(t.delayError&&M?(u=y(()=>T(C,M)),u(t.delayError)):(clearTimeout(c),u=null,M?Ae(n.errors,C,M):Fe(n.errors,C)),(M?!pt(K,M):K)||!Ke(ee)||Y){const oe={...ee,...Y&&it(R)?{isValid:R}:{},errors:n.errors,name:C};n={...n,...oe},f.state.next(oe)}},S=async C=>(P(C,!0),await t.resolver(r,t.context,ay(C||s.mount,i,t.criteriaMode,t.shouldUseNativeValidation))),D=async C=>{const{errors:R}=await S(C);if(P(C),C)for(const M of C){const ee=te(R,M);ee?Ae(n.errors,M,ee):Fe(n.errors,M)}else n.errors=R;return R},L=async(C,R,M={valid:!0})=>{for(const ee in C){const K=C[ee];if(K){const{_f:Y,...oe}=K;if(Y){const me=s.array.has(Y.name),fe=K._f&&ry(K._f);fe&&l.validatingFields&&P([Y.name],!0);const Ce=await oo(K,s.disabled,r,p,t.shouldUseNativeValidation&&!R,me);if(fe&&l.validatingFields&&P([Y.name]),Ce[Y.name]&&(M.valid=!1,R||e.shouldUseNativeValidation))break;!R&&(te(Ce,Y.name)?me?dy(n.errors,Ce,Y.name):Ae(n.errors,Y.name,Ce[Y.name]):Fe(n.errors,Y.name))}!Ke(oe)&&await L(oe,R,M)}}return M.valid},H=()=>{for(const C of s.unMount){const R=te(i,C);R&&(R._f.refs?R._f.refs.every(M=>!Hi(M)):!Hi(R._f.ref))&&$(C)}s.unMount=new Set},j=(C,R)=>!t.disabled&&(C&&R&&Ae(r,C,R),!pt(N(),a)),G=(C,R,M)=>ra(C,s,{...o.mount?r:Re(R)?a:rt(C)?{[C]:R}:R},M,R),q=C=>Ea(te(o.mount?r:a,C,t.shouldUnregister?te(a,C,[]):[])),Z=(C,R,M={})=>{const ee=te(i,C);let K=R;if(ee){const Y=ee._f;Y&&(!Y.disabled&&Ae(r,C,_s(R,Y)),K=ri(Y.ref)&&et(R)?"":R,Hs(Y.ref)?[...Y.ref.options].forEach(oe=>oe.selected=K.includes(oe.value)):Y.refs?Ln(Y.ref)?Y.refs.forEach(oe=>{(!oe.defaultChecked||!oe.disabled)&&(Array.isArray(K)?oe.checked=!!K.find(me=>me===oe.value):oe.checked=K===oe.value||!!K)}):Y.refs.forEach(oe=>oe.checked=oe.value===K):Fa(Y.ref)?Y.ref.value="":(Y.ref.value=K,Y.ref.type||f.state.next({name:C,values:Le(r)})))}(M.shouldDirty||M.shouldTouch)&&A(C,K,M.shouldTouch,M.shouldDirty,!0),M.shouldValidate&&E(C)},F=(C,R,M)=>{for(const ee in R){if(!R.hasOwnProperty(ee))return;const K=R[ee],Y=C+"."+ee,oe=te(i,Y);(s.array.has(C)||Ge(K)||oe&&!oe._f)&&!Xt(K)?F(Y,K,M):Z(Y,K,M)}},W=(C,R,M={})=>{const ee=te(i,C),K=s.array.has(C),Y=Le(R);Ae(r,C,Y),K?(f.array.next({name:C,values:Le(r)}),(l.isDirty||l.dirtyFields||m.isDirty||m.dirtyFields)&&M.shouldDirty&&f.state.next({name:C,dirtyFields:sn(a,r),isDirty:j(C,Y)})):ee&&!ee._f&&!et(Y)?F(C,Y,M):Z(C,Y,M),io(C,s)?f.state.next({...n,name:C,values:Le(r)}):f.state.next({name:o.mount?C:void 0,values:Le(r)})},Q=async C=>{o.mount=!0;const R=C.target;let M=R.name,ee=!0;const K=te(i,M),Y=fe=>{ee=Number.isNaN(fe)||Xt(fe)&&isNaN(fe.getTime())||pt(fe,te(r,M,fe))},oe=to(t.mode),me=to(t.reValidateMode);if(K){let fe,Ce;const ct=R.type?eo(K._f):Bs(C),He=C.type===ai.BLUR||C.type===ai.FOCUS_OUT,re=!oy(K._f)&&!t.resolver&&!te(n.errors,M)&&!K._f.deps||cy(He,te(n.touchedFields,M),n.isSubmitted,me,oe),Te=io(M,s,He);Ae(r,M,ct),He?(!R||!R.readOnly)&&(K._f.onBlur&&K._f.onBlur(C),u&&u(0)):K._f.onChange&&K._f.onChange(C);const Ue=A(M,ct,He),de=!Ke(Ue)||Te;if(!He&&f.state.next({name:M,type:C.type,values:Le(r)}),re)return(l.isValid||m.isValid)&&(t.mode==="onBlur"?He&&b():He||b()),de&&f.state.next({name:M,...Te?{}:Ue});if(!He&&Te&&f.state.next({...n}),t.resolver){const{errors:Be}=await S([M]);if(P([M]),Y(ct),ee){const Xe=ao(n.errors,i,M),ze=ao(Be,i,Xe.name||M);fe=ze.error,M=ze.name,Ce=Ke(Be)}}else P([M],!0),fe=(await oo(K,s.disabled,r,p,t.shouldUseNativeValidation))[M],P([M]),Y(ct),ee&&(fe?Ce=!1:(l.isValid||m.isValid)&&(Ce=await L(i,!0)));ee&&(K._f.deps&&(!Array.isArray(K._f.deps)||K._f.deps.length>0)&&E(K._f.deps),x(M,Ce,fe,Ue))}},se=(C,R)=>{if(te(n.errors,R)&&C.focus)return C.focus(),1},E=async(C,R={})=>{let M,ee;const K=Tn(C);if(t.resolver){const Y=await D(Re(C)?C:K);M=Ke(Y),ee=C?!K.some(oe=>te(Y,oe)):M}else C?(ee=(await Promise.all(K.map(async Y=>{const oe=te(i,Y);return await L(oe&&oe._f?{[Y]:oe}:oe)}))).every(Boolean),!(!ee&&!n.isValid)&&b()):ee=M=await L(i);return f.state.next({...!rt(C)||(l.isValid||m.isValid)&&M!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:M}:{},errors:n.errors}),R.shouldFocus&&!ee&&kn(i,se,C?K:s.mount),ee},N=(C,R)=>{let M={...o.mount?r:a};return R&&(M=Ys(R.dirtyFields?n.dirtyFields:n.touchedFields,M)),Re(C)?M:rt(C)?te(M,C):C.map(ee=>te(M,ee))},z=(C,R)=>({invalid:!!te((R||n).errors,C),isDirty:!!te((R||n).dirtyFields,C),error:te((R||n).errors,C),isValidating:!!te(n.validatingFields,C),isTouched:!!te((R||n).touchedFields,C)}),B=C=>{const R=C?Tn(C):void 0;R?.forEach(M=>Fe(n.errors,M)),R?R.forEach(M=>{f.state.next({name:M,errors:n.errors})}):f.state.next({errors:{}})},U=(C,R,M)=>{const ee=(te(i,C,{_f:{}})._f||{}).ref,K=te(n.errors,C)||{},{ref:Y,message:oe,type:me,...fe}=K;Ae(n.errors,C,{...fe,...R,ref:ee}),f.state.next({name:C,errors:n.errors,isValid:!1}),M&&M.shouldFocus&&ee&&ee.focus&&ee.focus()},_=(C,R)=>Je(C)?f.state.subscribe({next:M=>"values"in M&&C(G(void 0,R),M)}):G(C,R,!0),X=C=>f.state.subscribe({next:R=>{ly(C.name,R.name,C.exact)&&sy(R,C.formState||l,nn,C.reRenderRoot)&&C.callback({values:{...r},...n,...R,defaultValues:a})}}).unsubscribe,J=C=>(o.mount=!0,m={...m,...C.formState},X({...C,formState:{...d,...C.formState}})),$=(C,R={})=>{for(const M of C?Tn(C):s.mount)s.mount.delete(M),s.array.delete(M),R.keepValue||(Fe(i,M),Fe(r,M)),!R.keepError&&Fe(n.errors,M),!R.keepDirty&&Fe(n.dirtyFields,M),!R.keepTouched&&Fe(n.touchedFields,M),!R.keepIsValidating&&Fe(n.validatingFields,M),!t.shouldUnregister&&!R.keepDefaultValue&&Fe(a,M);f.state.next({values:Le(r)}),f.state.next({...n,...R.keepDirty?{isDirty:j()}:{}}),!R.keepIsValid&&b()},ne=({disabled:C,name:R})=>{if(it(C)&&o.mount||C||s.disabled.has(R)){const K=s.disabled.has(R)!==!!C;C?s.disabled.add(R):s.disabled.delete(R),K&&o.mount&&!o.action&&b()}},le=(C,R={})=>{let M=te(i,C);const ee=it(R.disabled)||it(t.disabled);return Ae(i,C,{...M||{},_f:{...M&&M._f?M._f:{ref:{name:C}},name:C,mount:!0,...R}}),s.mount.add(C),M?ne({disabled:it(R.disabled)?R.disabled:t.disabled,name:C}):g(C,!0,R.value),{...ee?{disabled:R.disabled||t.disabled}:{},...t.progressive?{required:!!R.required,min:Sn(R.min),max:Sn(R.max),minLength:Sn(R.minLength),maxLength:Sn(R.maxLength),pattern:Sn(R.pattern)}:{},name:C,onChange:Q,onBlur:Q,ref:K=>{if(K){le(C,R),M=te(i,C);const Y=Re(K.value)&&K.querySelectorAll&&K.querySelectorAll("input,select,textarea")[0]||K,oe=ey(Y),me=M._f.refs||[];if(oe?me.find(fe=>fe===Y):Y===M._f.ref)return;Ae(i,C,{_f:{...M._f,...oe?{refs:[...me.filter(Hi),Y,...Array.isArray(te(a,C))?[{}]:[]],ref:{type:Y.type,name:C}}:{ref:Y}}}),g(C,!1,void 0,Y)}else M=te(i,C,{}),M._f&&(M._f.mount=!1),(t.shouldUnregister||R.shouldUnregister)&&!(js(s.array,C)&&o.action)&&s.unMount.add(C)}}},pe=()=>t.shouldFocusError&&kn(i,se,s.mount),V=C=>{it(C)&&(f.state.next({disabled:C}),kn(i,(R,M)=>{const ee=te(i,M);ee&&(R.disabled=ee._f.disabled||C,Array.isArray(ee._f.refs)&&ee._f.refs.forEach(K=>{K.disabled=ee._f.disabled||C}))},0,!1))},xe=(C,R)=>async M=>{let ee;M&&(M.preventDefault&&M.preventDefault(),M.persist&&M.persist());let K=Le(r);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:Y,values:oe}=await S();P(),n.errors=Y,K=Le(oe)}else await L(i);if(s.disabled.size)for(const Y of s.disabled)Fe(K,Y);if(Fe(n.errors,"root"),Ke(n.errors)){f.state.next({errors:{}});try{await C(K,M)}catch(Y){ee=Y}}else R&&await R({...n.errors},M),pe(),setTimeout(pe);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ke(n.errors)&&!ee,submitCount:n.submitCount+1,errors:n.errors}),ee)throw ee},Ee=(C,R={})=>{te(i,C)&&(Re(R.defaultValue)?W(C,Le(te(a,C))):(W(C,R.defaultValue),Ae(a,C,Le(R.defaultValue))),R.keepTouched||Fe(n.touchedFields,C),R.keepDirty||(Fe(n.dirtyFields,C),n.isDirty=R.defaultValue?j(C,Le(te(a,C))):j()),R.keepError||(Fe(n.errors,C),l.isValid&&b()),f.state.next({...n}))},st=(C,R={})=>{const M=C?Le(C):a,ee=Le(M),K=Ke(C),Y=K?a:ee;if(R.keepDefaultValues||(a=M),!R.keepValues){if(R.keepDirtyValues){const oe=new Set([...s.mount,...Object.keys(sn(a,r))]);for(const me of Array.from(oe)){const fe=te(n.dirtyFields,me),Ce=te(r,me),ct=te(Y,me);fe&&!Re(Ce)?Ae(Y,me,Ce):!fe&&!Re(ct)&&W(me,ct)}}else{if(Ra&&Re(C))for(const oe of s.mount){const me=te(i,oe);if(me&&me._f){const fe=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(ri(fe)){const Ce=fe.closest("form");if(Ce){Ce.reset();break}}}}if(R.keepFieldsRef)for(const oe of s.mount)W(oe,te(Y,oe));else i={}}r=t.shouldUnregister?R.keepDefaultValues?Le(a):{}:Le(Y),f.array.next({values:{...Y}}),f.state.next({values:{...Y}})}s={mount:R.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!l.isValid||!!R.keepIsValid||!!R.keepDirtyValues||!t.shouldUnregister&&!Ke(Y),o.watch=!!t.shouldUnregister,o.keepIsValid=!!R.keepIsValid,o.action=!1,R.keepErrors||(n.errors={}),f.state.next({submitCount:R.keepSubmitCount?n.submitCount:0,isDirty:K?!1:R.keepDirty?n.isDirty:!!(R.keepDefaultValues&&!pt(C,a)),isSubmitted:R.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:K?{}:R.keepDirtyValues?R.keepDefaultValues&&r?sn(a,r):n.dirtyFields:R.keepDefaultValues&&C?sn(a,C):R.keepDirty?n.dirtyFields:{},touchedFields:R.keepTouched?n.touchedFields:{},errors:R.keepErrors?n.errors:{},isSubmitSuccessful:R.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},qt=(C,R)=>st(Je(C)?C(r):C,{...t.resetOptions,...R}),Dt=(C,R={})=>{const M=te(i,C),ee=M&&M._f;if(ee){const K=ee.refs?ee.refs[0]:ee.ref;K.focus&&setTimeout(()=>{K.focus(),R.shouldSelect&&Je(K.select)&&K.select()})}},nn=C=>{n={...n,...C}},an={control:{register:le,unregister:$,getFieldState:z,handleSubmit:xe,setError:U,_subscribe:X,_runSchema:S,_updateIsValidating:P,_focusError:pe,_getWatch:G,_getDirty:j,_setValid:b,_setFieldArray:k,_setDisabledField:ne,_setErrors:v,_getFieldArray:q,_reset:st,_resetDefaultValues:()=>Je(t.defaultValues)&&t.defaultValues().then(C=>{qt(C,t.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:H,_disableForm:V,_subjects:f,_proxyFormState:l,get _fields(){return i},get _formValues(){return r},get _state(){return o},set _state(C){o=C},get _defaultValues(){return a},get _names(){return s},set _names(C){s=C},get _formState(){return n},get _options(){return t},set _options(C){t={...t,...C}}},subscribe:J,trigger:E,register:le,handleSubmit:xe,watch:_,setValue:W,getValues:N,reset:qt,resetField:Ee,clearErrors:B,unregister:$,setError:U,setFocus:Dt,getFieldState:z};return{...an,formControl:an}}function Ks(e={}){const t=w.useRef(void 0),n=w.useRef(void 0),[i,a]=w.useState({isDirty:!1,isValidating:!1,isLoading:Je(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Je(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!Je(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=py(e);t.current={...s,formState:i}}const r=t.current.control;return r._options=e,La(()=>{const o=r._subscribe({formState:r._proxyFormState,callback:()=>a({...r._formState}),reRenderRoot:!0});return a(s=>({...s,isReady:!0})),r._formState.isReady=!0,o},[r]),w.useEffect(()=>r._disableForm(e.disabled),[r,e.disabled]),w.useEffect(()=>{e.mode&&(r._options.mode=e.mode),e.reValidateMode&&(r._options.reValidateMode=e.reValidateMode)},[r,e.mode,e.reValidateMode]),w.useEffect(()=>{e.errors&&(r._setErrors(e.errors),r._focusError())},[r,e.errors]),w.useEffect(()=>{e.shouldUnregister&&r._subjects.state.next({values:r._getWatch()})},[r,e.shouldUnregister]),w.useEffect(()=>{if(r._proxyFormState.isDirty){const o=r._getDirty();o!==i.isDirty&&r._subjects.state.next({isDirty:o})}},[r,i.isDirty]),w.useEffect(()=>{var o;e.values&&!pt(e.values,n.current)?(r._reset(e.values,{keepFieldsRef:!0,...r._options.resetOptions}),!((o=r._options.resetOptions)===null||o===void 0)&&o.keepIsValid||r._setValid(),n.current=e.values,a(s=>({...s}))):r._resetDefaultValues()},[r,e.values]),w.useEffect(()=>{r._state.mount||(r._setValid(),r._state.mount=!0),r._state.watch&&(r._state.watch=!1,r._subjects.state.next({...r._formState})),r._removeUnmounted()}),t.current.formState=w.useMemo(()=>Us(i,r),[r,i]),t.current}function so(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Js(...e){return t=>{let n=!1;const i=e.map(a=>{const r=so(a,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let a=0;a<i.length;a++){const r=i[a];typeof r=="function"?r():so(e[a],null)}}}}function tn(...e){return I.useCallback(Js(...e),e)}function Xs(e){const t=fy(e),n=I.forwardRef((i,a)=>{const{children:r,...o}=i,s=I.Children.toArray(r),u=s.find(yy);if(u){const c=u.props.children,d=s.map(l=>l===u?I.Children.count(c)>1?I.Children.only(null):I.isValidElement(c)?c.props.children:null:l);return h.jsx(t,{...o,ref:a,children:I.isValidElement(c)?I.cloneElement(c,void 0,d):null})}return h.jsx(t,{...o,ref:a,children:r})});return n.displayName=`${e}.Slot`,n}var my=Xs("Slot");function fy(e){const t=I.forwardRef((n,i)=>{const{children:a,...r}=n;if(I.isValidElement(a)){const o=vy(a),s=by(r,a.props);return a.type!==I.Fragment&&(s.ref=i?Js(i,o):o),I.cloneElement(a,s)}return I.Children.count(a)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zs=Symbol("radix.slottable");function gy(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Zs,t}function yy(e){return I.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zs}function by(e,t){const n={...t};for(const i in t){const a=e[i],r=t[i];/^on[A-Z]/.test(i)?a&&r?n[i]=(...s)=>{const u=r(...s);return a(...s),u}:a&&(n[i]=a):i==="style"?n[i]={...a,...r}:i==="className"&&(n[i]=[a,r].filter(Boolean).join(" "))}return{...e,...n}}function vy(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wt=wy.reduce((e,t)=>{const n=Xs(`Primitive.${t}`),i=I.forwardRef((a,r)=>{const{asChild:o,...s}=a,u=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(u,{...s,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function xy(e,t){e&&Bo.flushSync(()=>e.dispatchEvent(t))}var Py=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Sy="VisuallyHidden",Qs=I.forwardRef((e,t)=>h.jsx(Wt.span,{...e,ref:t,style:{...Py,...e.style}}));Qs.displayName=Sy;var Ty=Qs;function $s(e,t=[]){let n=[];function i(r,o){const s=I.createContext(o),u=n.length;n=[...n,o];const c=l=>{const{scope:m,children:f,...p}=l,y=m?.[e]?.[u]||s,b=I.useMemo(()=>p,Object.values(p));return h.jsx(y.Provider,{value:b,children:f})};c.displayName=r+"Provider";function d(l,m){const f=m?.[e]?.[u]||s,p=I.useContext(f);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[c,d]}const a=()=>{const r=n.map(o=>I.createContext(o));return function(s){const u=s?.[e]||r;return I.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return a.scopeName=e,[i,ky(a,...t)]}function ky(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(r){const o=i.reduce((s,{useScope:u,scopeName:c})=>{const l=u(r)[`__scope${c}`];return{...s,...l}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Ot(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}var Ut=globalThis?.document?I.useLayoutEffect:()=>{},Cy=I[" useInsertionEffect ".trim().toString()]||Ut;function Ay({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[a,r,o]=Ny({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:a;{const d=I.useRef(e!==void 0);I.useEffect(()=>{const l=d.current;l!==s&&console.warn(`${i} is changing from ${l?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,i])}const c=I.useCallback(d=>{if(s){const l=Dy(d)?d(e):d;l!==e&&o.current?.(l)}else r(d)},[s,e,r,o]);return[u,c]}function Ny({defaultProp:e,onChange:t}){const[n,i]=I.useState(e),a=I.useRef(n),r=I.useRef(t);return Cy(()=>{r.current=t},[t]),I.useEffect(()=>{a.current!==n&&(r.current?.(n),a.current=n)},[n,a]),[n,i,r]}function Dy(e){return typeof e=="function"}function Ry(e,t){return I.useReducer((n,i)=>t[n][i]??n,e)}var Ba=e=>{const{present:t,children:n}=e,i=Ey(t),a=typeof n=="function"?n({present:i.isPresent}):I.Children.only(n),r=tn(i.ref,Oy(a));return typeof n=="function"||i.isPresent?I.cloneElement(a,{ref:r}):null};Ba.displayName="Presence";function Ey(e){const[t,n]=I.useState(),i=I.useRef(null),a=I.useRef(e),r=I.useRef("none"),o=e?"mounted":"unmounted",[s,u]=Ry(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return I.useEffect(()=>{const c=Vn(i.current);r.current=s==="mounted"?c:"none"},[s]),Ut(()=>{const c=i.current,d=a.current;if(d!==e){const m=r.current,f=Vn(c);e?u("MOUNT"):f==="none"||c?.display==="none"?u("UNMOUNT"):u(d&&m!==f?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),Ut(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,l=f=>{const y=Vn(i.current).includes(CSS.escape(f.animationName));if(f.target===t&&y&&(u("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=f=>{f.target===t&&(r.current=Vn(i.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:I.useCallback(c=>{i.current=c?getComputedStyle(c):null,n(c)},[])}}function Vn(e){return e?.animationName||"none"}function Oy(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var My=I[" useId ".trim().toString()]||(()=>{}),Iy=0;function Ly(e){const[t,n]=I.useState(My());return Ut(()=>{n(i=>i??String(Iy++))},[e]),t?`radix-${t}`:""}function xi(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...n)=>t.current?.(...n),[])}function Fy(e,t=globalThis?.document){const n=xi(e);I.useEffect(()=>{const i=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var Gy="DismissableLayer",la="dismissableLayer.update",By="dismissableLayer.pointerDownOutside",jy="dismissableLayer.focusOutside",lo,el=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tl=I.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:r,onInteractOutside:o,onDismiss:s,...u}=e,c=I.useContext(el),[d,l]=I.useState(null),m=d?.ownerDocument??globalThis?.document,[,f]=I.useState({}),p=tn(t,x=>l(x)),y=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),P=y.indexOf(b),k=d?y.indexOf(d):-1,T=c.layersWithOutsidePointerEventsDisabled.size>0,v=k>=P,g=Yy(x=>{const S=x.target,D=[...c.branches].some(L=>L.contains(S));!v||D||(a?.(x),o?.(x),x.defaultPrevented||s?.())},m),A=Hy(x=>{const S=x.target;[...c.branches].some(L=>L.contains(S))||(r?.(x),o?.(x),x.defaultPrevented||s?.())},m);return Fy(x=>{k===c.layers.size-1&&(i?.(x),!x.defaultPrevented&&s&&(x.preventDefault(),s()))},m),I.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(lo=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),co(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=lo)}},[d,m,n,c]),I.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),co())},[d,c]),I.useEffect(()=>{const x=()=>f({});return document.addEventListener(la,x),()=>document.removeEventListener(la,x)},[]),h.jsx(Wt.div,{...u,ref:p,style:{pointerEvents:T?v?"auto":"none":void 0,...e.style},onFocusCapture:Ot(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ot(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ot(e.onPointerDownCapture,g.onPointerDownCapture)})});tl.displayName=Gy;var Uy="DismissableLayerBranch",zy=I.forwardRef((e,t)=>{const n=I.useContext(el),i=I.useRef(null),a=tn(t,i);return I.useEffect(()=>{const r=i.current;if(r)return n.branches.add(r),()=>{n.branches.delete(r)}},[n.branches]),h.jsx(Wt.div,{...e,ref:a})});zy.displayName=Uy;function Yy(e,t=globalThis?.document){const n=xi(e),i=I.useRef(!1),a=I.useRef(()=>{});return I.useEffect(()=>{const r=s=>{if(s.target&&!i.current){let u=function(){nl(By,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=u,t.addEventListener("click",a.current,{once:!0})):u()}else t.removeEventListener("click",a.current);i.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",r),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>i.current=!0}}function Hy(e,t=globalThis?.document){const n=xi(e),i=I.useRef(!1);return I.useEffect(()=>{const a=r=>{r.target&&!i.current&&nl(jy,n,{originalEvent:r},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function co(){const e=new CustomEvent(la);document.dispatchEvent(e)}function nl(e,t,n,{discrete:i}){const a=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),i?xy(a,r):a.dispatchEvent(r)}var Wy="Portal",il=I.forwardRef((e,t)=>{const{container:n,...i}=e,[a,r]=I.useState(!1);Ut(()=>r(!0),[]);const o=n||a&&globalThis?.document?.body;return o?Dn.createPortal(h.jsx(Wt.div,{...i,ref:t}),o):null});il.displayName=Wy;function qy(e){const[t,n]=I.useState(void 0);return Ut(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const r=a[0];let o,s;if("borderBoxSize"in r){const u=r.borderBoxSize,c=Array.isArray(u)?u[0]:u;o=c.inlineSize,s=c.blockSize}else o=e.offsetWidth,s=e.offsetHeight;n({width:o,height:s})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}const _y=["top","right","bottom","left"],zt=Math.min,at=Math.max,si=Math.round,Kn=Math.floor,St=e=>({x:e,y:e}),Vy={left:"right",right:"left",bottom:"top",top:"bottom"},Ky={start:"end",end:"start"};function ca(e,t,n){return at(e,zt(t,n))}function Mt(e,t){return typeof e=="function"?e(t):e}function It(e){return e.split("-")[0]}function mn(e){return e.split("-")[1]}function ja(e){return e==="x"?"y":"x"}function Ua(e){return e==="y"?"height":"width"}const Jy=new Set(["top","bottom"]);function xt(e){return Jy.has(It(e))?"y":"x"}function za(e){return ja(xt(e))}function Xy(e,t,n){n===void 0&&(n=!1);const i=mn(e),a=za(e),r=Ua(a);let o=a==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=li(o)),[o,li(o)]}function Zy(e){const t=li(e);return[ua(e),t,ua(t)]}function ua(e){return e.replace(/start|end/g,t=>Ky[t])}const uo=["left","right"],ho=["right","left"],Qy=["top","bottom"],$y=["bottom","top"];function eb(e,t,n){switch(e){case"top":case"bottom":return n?t?ho:uo:t?uo:ho;case"left":case"right":return t?Qy:$y;default:return[]}}function tb(e,t,n,i){const a=mn(e);let r=eb(It(e),n==="start",i);return a&&(r=r.map(o=>o+"-"+a),t&&(r=r.concat(r.map(ua)))),r}function li(e){return e.replace(/left|right|bottom|top/g,t=>Vy[t])}function nb(e){return{top:0,right:0,bottom:0,left:0,...e}}function al(e){return typeof e!="number"?nb(e):{top:e,right:e,bottom:e,left:e}}function ci(e){const{x:t,y:n,width:i,height:a}=e;return{width:i,height:a,top:n,left:t,right:t+i,bottom:n+a,x:t,y:n}}function po(e,t,n){let{reference:i,floating:a}=e;const r=xt(t),o=za(t),s=Ua(o),u=It(t),c=r==="y",d=i.x+i.width/2-a.width/2,l=i.y+i.height/2-a.height/2,m=i[s]/2-a[s]/2;let f;switch(u){case"top":f={x:d,y:i.y-a.height};break;case"bottom":f={x:d,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:l};break;case"left":f={x:i.x-a.width,y:l};break;default:f={x:i.x,y:i.y}}switch(mn(t)){case"start":f[o]-=m*(n&&c?-1:1);break;case"end":f[o]+=m*(n&&c?-1:1);break}return f}async function ib(e,t){var n;t===void 0&&(t={});const{x:i,y:a,platform:r,rects:o,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:l="floating",altBoundary:m=!1,padding:f=0}=Mt(t,e),p=al(f),b=s[m?l==="floating"?"reference":"floating":l],P=ci(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(b)))==null||n?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:u})),k=l==="floating"?{x:i,y:a,width:o.floating.width,height:o.floating.height}:o.reference,T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),v=await(r.isElement==null?void 0:r.isElement(T))?await(r.getScale==null?void 0:r.getScale(T))||{x:1,y:1}:{x:1,y:1},g=ci(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:k,offsetParent:T,strategy:u}):k);return{top:(P.top-g.top+p.top)/v.y,bottom:(g.bottom-P.bottom+p.bottom)/v.y,left:(P.left-g.left+p.left)/v.x,right:(g.right-P.right+p.right)/v.x}}const ab=async(e,t,n)=>{const{placement:i="bottom",strategy:a="absolute",middleware:r=[],platform:o}=n,s=r.filter(Boolean),u=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:l}=po(c,i,u),m=i,f={},p=0;for(let b=0;b<s.length;b++){var y;const{name:P,fn:k}=s[b],{x:T,y:v,data:g,reset:A}=await k({x:d,y:l,initialPlacement:i,placement:m,strategy:a,middlewareData:f,rects:c,platform:{...o,detectOverflow:(y=o.detectOverflow)!=null?y:ib},elements:{reference:e,floating:t}});d=T??d,l=v??l,f={...f,[P]:{...f[P],...g}},A&&p<=50&&(p++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(c=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:d,y:l}=po(c,m,u)),b=-1)}return{x:d,y:l,placement:m,strategy:a,middlewareData:f}},rb=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:a,rects:r,platform:o,elements:s,middlewareData:u}=t,{element:c,padding:d=0}=Mt(e,t)||{};if(c==null)return{};const l=al(d),m={x:n,y:i},f=za(a),p=Ua(f),y=await o.getDimensions(c),b=f==="y",P=b?"top":"left",k=b?"bottom":"right",T=b?"clientHeight":"clientWidth",v=r.reference[p]+r.reference[f]-m[f]-r.floating[p],g=m[f]-r.reference[f],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let x=A?A[T]:0;(!x||!await(o.isElement==null?void 0:o.isElement(A)))&&(x=s.floating[T]||r.floating[p]);const S=v/2-g/2,D=x/2-y[p]/2-1,L=zt(l[P],D),H=zt(l[k],D),j=L,G=x-y[p]-H,q=x/2-y[p]/2+S,Z=ca(j,q,G),F=!u.arrow&&mn(a)!=null&&q!==Z&&r.reference[p]/2-(q<j?L:H)-y[p]/2<0,W=F?q<j?q-j:q-G:0;return{[f]:m[f]+W,data:{[f]:Z,centerOffset:q-Z-W,...F&&{alignmentOffset:W}},reset:F}}}),ob=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:a,middlewareData:r,rects:o,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:l=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:y=!0,...b}=Mt(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const P=It(a),k=xt(s),T=It(s)===s,v=await(u.isRTL==null?void 0:u.isRTL(c.floating)),g=m||(T||!y?[li(s)]:Zy(s)),A=p!=="none";!m&&A&&g.push(...tb(s,y,p,v));const x=[s,...g],S=await u.detectOverflow(t,b),D=[];let L=((i=r.flip)==null?void 0:i.overflows)||[];if(d&&D.push(S[P]),l){const q=Xy(a,o,v);D.push(S[q[0]],S[q[1]])}if(L=[...L,{placement:a,overflows:D}],!D.every(q=>q<=0)){var H,j;const q=(((H=r.flip)==null?void 0:H.index)||0)+1,Z=x[q];if(Z&&(!(l==="alignment"?k!==xt(Z):!1)||L.every(Q=>xt(Q.placement)===k?Q.overflows[0]>0:!0)))return{data:{index:q,overflows:L},reset:{placement:Z}};let F=(j=L.filter(W=>W.overflows[0]<=0).sort((W,Q)=>W.overflows[1]-Q.overflows[1])[0])==null?void 0:j.placement;if(!F)switch(f){case"bestFit":{var G;const W=(G=L.filter(Q=>{if(A){const se=xt(Q.placement);return se===k||se==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(se=>se>0).reduce((se,E)=>se+E,0)]).sort((Q,se)=>Q[1]-se[1])[0])==null?void 0:G[0];W&&(F=W);break}case"initialPlacement":F=s;break}if(a!==F)return{reset:{placement:F}}}return{}}}};function mo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fo(e){return _y.some(t=>e[t]>=0)}const sb=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:a="referenceHidden",...r}=Mt(e,t);switch(a){case"referenceHidden":{const o=await i.detectOverflow(t,{...r,elementContext:"reference"}),s=mo(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:fo(s)}}}case"escaped":{const o=await i.detectOverflow(t,{...r,altBoundary:!0}),s=mo(o,n.floating);return{data:{escapedOffsets:s,escaped:fo(s)}}}default:return{}}}}},rl=new Set(["left","top"]);async function lb(e,t){const{placement:n,platform:i,elements:a}=e,r=await(i.isRTL==null?void 0:i.isRTL(a.floating)),o=It(n),s=mn(n),u=xt(n)==="y",c=rl.has(o)?-1:1,d=r&&u?-1:1,l=Mt(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:p}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return s&&typeof p=="number"&&(f=s==="end"?p*-1:p),u?{x:f*d,y:m*c}:{x:m*c,y:f*d}}const cb=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:a,y:r,placement:o,middlewareData:s}=t,u=await lb(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:a+u.x,y:r+u.y,data:{...u,placement:o}}}}},ub=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:a,platform:r}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:u={fn:P=>{let{x:k,y:T}=P;return{x:k,y:T}}},...c}=Mt(e,t),d={x:n,y:i},l=await r.detectOverflow(t,c),m=xt(It(a)),f=ja(m);let p=d[f],y=d[m];if(o){const P=f==="y"?"top":"left",k=f==="y"?"bottom":"right",T=p+l[P],v=p-l[k];p=ca(T,p,v)}if(s){const P=m==="y"?"top":"left",k=m==="y"?"bottom":"right",T=y+l[P],v=y-l[k];y=ca(T,y,v)}const b=u.fn({...t,[f]:p,[m]:y});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[f]:o,[m]:s}}}}}},db=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:i,placement:a,rects:r,middlewareData:o}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=Mt(e,t),d={x:n,y:i},l=xt(a),m=ja(l);let f=d[m],p=d[l];const y=Mt(s,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){const T=m==="y"?"height":"width",v=r.reference[m]-r.floating[T]+b.mainAxis,g=r.reference[m]+r.reference[T]-b.mainAxis;f<v?f=v:f>g&&(f=g)}if(c){var P,k;const T=m==="y"?"width":"height",v=rl.has(It(a)),g=r.reference[l]-r.floating[T]+(v&&((P=o.offset)==null?void 0:P[l])||0)+(v?0:b.crossAxis),A=r.reference[l]+r.reference[T]+(v?0:((k=o.offset)==null?void 0:k[l])||0)-(v?b.crossAxis:0);p<g?p=g:p>A&&(p=A)}return{[m]:f,[l]:p}}}},hb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,i;const{placement:a,rects:r,platform:o,elements:s}=t,{apply:u=()=>{},...c}=Mt(e,t),d=await o.detectOverflow(t,c),l=It(a),m=mn(a),f=xt(a)==="y",{width:p,height:y}=r.floating;let b,P;l==="top"||l==="bottom"?(b=l,P=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(P=l,b=m==="end"?"top":"bottom");const k=y-d.top-d.bottom,T=p-d.left-d.right,v=zt(y-d[b],k),g=zt(p-d[P],T),A=!t.middlewareData.shift;let x=v,S=g;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=T),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(x=k),A&&!m){const L=at(d.left,0),H=at(d.right,0),j=at(d.top,0),G=at(d.bottom,0);f?S=p-2*(L!==0||H!==0?L+H:at(d.left,d.right)):x=y-2*(j!==0||G!==0?j+G:at(d.top,d.bottom))}await u({...t,availableWidth:S,availableHeight:x});const D=await o.getDimensions(s.floating);return p!==D.width||y!==D.height?{reset:{rects:!0}}:{}}}};function Pi(){return typeof window<"u"}function fn(e){return ol(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Nt(e){var t;return(t=(ol(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ol(e){return Pi()?e instanceof Node||e instanceof ot(e).Node:!1}function gt(e){return Pi()?e instanceof Element||e instanceof ot(e).Element:!1}function kt(e){return Pi()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function go(e){return!Pi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}const pb=new Set(["inline","contents"]);function Fn(e){const{overflow:t,overflowX:n,overflowY:i,display:a}=yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!pb.has(a)}const mb=new Set(["table","td","th"]);function fb(e){return mb.has(fn(e))}const gb=[":popover-open",":modal"];function Si(e){return gb.some(t=>{try{return e.matches(t)}catch{return!1}})}const yb=["transform","translate","scale","rotate","perspective"],bb=["transform","translate","scale","rotate","perspective","filter"],vb=["paint","layout","strict","content"];function Ya(e){const t=Ha(),n=gt(e)?yt(e):e;return yb.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||bb.some(i=>(n.willChange||"").includes(i))||vb.some(i=>(n.contain||"").includes(i))}function wb(e){let t=Yt(e);for(;kt(t)&&!dn(t);){if(Ya(t))return t;if(Si(t))return null;t=Yt(t)}return null}function Ha(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const xb=new Set(["html","body","#document"]);function dn(e){return xb.has(fn(e))}function yt(e){return ot(e).getComputedStyle(e)}function Ti(e){return gt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yt(e){if(fn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||go(e)&&e.host||Nt(e);return go(t)?t.host:t}function sl(e){const t=Yt(e);return dn(t)?e.ownerDocument?e.ownerDocument.body:e.body:kt(t)&&Fn(t)?t:sl(t)}function An(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=sl(e),r=a===((i=e.ownerDocument)==null?void 0:i.body),o=ot(a);if(r){const s=da(o);return t.concat(o,o.visualViewport||[],Fn(a)?a:[],s&&n?An(s):[])}return t.concat(a,An(a,[],n))}function da(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ll(e){const t=yt(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const a=kt(e),r=a?e.offsetWidth:n,o=a?e.offsetHeight:i,s=si(n)!==r||si(i)!==o;return s&&(n=r,i=o),{width:n,height:i,$:s}}function Wa(e){return gt(e)?e:e.contextElement}function cn(e){const t=Wa(e);if(!kt(t))return St(1);const n=t.getBoundingClientRect(),{width:i,height:a,$:r}=ll(t);let o=(r?si(n.width):n.width)/i,s=(r?si(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const Pb=St(0);function cl(e){const t=ot(e);return!Ha()||!t.visualViewport?Pb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ot(e)?!1:t}function $t(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),r=Wa(e);let o=St(1);t&&(i?gt(i)&&(o=cn(i)):o=cn(e));const s=Sb(r,n,i)?cl(r):St(0);let u=(a.left+s.x)/o.x,c=(a.top+s.y)/o.y,d=a.width/o.x,l=a.height/o.y;if(r){const m=ot(r),f=i&>(i)?ot(i):i;let p=m,y=da(p);for(;y&&i&&f!==p;){const b=cn(y),P=y.getBoundingClientRect(),k=yt(y),T=P.left+(y.clientLeft+parseFloat(k.paddingLeft))*b.x,v=P.top+(y.clientTop+parseFloat(k.paddingTop))*b.y;u*=b.x,c*=b.y,d*=b.x,l*=b.y,u+=T,c+=v,p=ot(y),y=da(p)}}return ci({width:d,height:l,x:u,y:c})}function ki(e,t){const n=Ti(e).scrollLeft;return t?t.left+n:$t(Nt(e)).left+n}function ul(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-ki(e,n),a=n.top+t.scrollTop;return{x:i,y:a}}function Tb(e){let{elements:t,rect:n,offsetParent:i,strategy:a}=e;const r=a==="fixed",o=Nt(i),s=t?Si(t.floating):!1;if(i===o||s&&r)return n;let u={scrollLeft:0,scrollTop:0},c=St(1);const d=St(0),l=kt(i);if((l||!l&&!r)&&((fn(i)!=="body"||Fn(o))&&(u=Ti(i)),kt(i))){const f=$t(i);c=cn(i),d.x=f.x+i.clientLeft,d.y=f.y+i.clientTop}const m=o&&!l&&!r?ul(o,u):St(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-u.scrollTop*c.y+d.y+m.y}}function kb(e){return Array.from(e.getClientRects())}function Cb(e){const t=Nt(e),n=Ti(e),i=e.ownerDocument.body,a=at(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=at(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+ki(e);const s=-n.scrollTop;return yt(i).direction==="rtl"&&(o+=at(t.clientWidth,i.clientWidth)-a),{width:a,height:r,x:o,y:s}}const yo=25;function Ab(e,t){const n=ot(e),i=Nt(e),a=n.visualViewport;let r=i.clientWidth,o=i.clientHeight,s=0,u=0;if(a){r=a.width,o=a.height;const d=Ha();(!d||d&&t==="fixed")&&(s=a.offsetLeft,u=a.offsetTop)}const c=ki(i);if(c<=0){const d=i.ownerDocument,l=d.body,m=getComputedStyle(l),f=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(i.clientWidth-l.clientWidth-f);p<=yo&&(r-=p)}else c<=yo&&(r+=c);return{width:r,height:o,x:s,y:u}}const Nb=new Set(["absolute","fixed"]);function Db(e,t){const n=$t(e,!0,t==="fixed"),i=n.top+e.clientTop,a=n.left+e.clientLeft,r=kt(e)?cn(e):St(1),o=e.clientWidth*r.x,s=e.clientHeight*r.y,u=a*r.x,c=i*r.y;return{width:o,height:s,x:u,y:c}}function bo(e,t,n){let i;if(t==="viewport")i=Ab(e,n);else if(t==="document")i=Cb(Nt(e));else if(gt(t))i=Db(t,n);else{const a=cl(e);i={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return ci(i)}function dl(e,t){const n=Yt(e);return n===t||!gt(n)||dn(n)?!1:yt(n).position==="fixed"||dl(n,t)}function Rb(e,t){const n=t.get(e);if(n)return n;let i=An(e,[],!1).filter(s=>gt(s)&&fn(s)!=="body"),a=null;const r=yt(e).position==="fixed";let o=r?Yt(e):e;for(;gt(o)&&!dn(o);){const s=yt(o),u=Ya(o);!u&&s.position==="fixed"&&(a=null),(r?!u&&!a:!u&&s.position==="static"&&!!a&&Nb.has(a.position)||Fn(o)&&!u&&dl(e,o))?i=i.filter(d=>d!==o):a=s,o=Yt(o)}return t.set(e,i),i}function Eb(e){let{element:t,boundary:n,rootBoundary:i,strategy:a}=e;const o=[...n==="clippingAncestors"?Si(t)?[]:Rb(t,this._c):[].concat(n),i],s=o[0],u=o.reduce((c,d)=>{const l=bo(t,d,a);return c.top=at(l.top,c.top),c.right=zt(l.right,c.right),c.bottom=zt(l.bottom,c.bottom),c.left=at(l.left,c.left),c},bo(t,s,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Ob(e){const{width:t,height:n}=ll(e);return{width:t,height:n}}function Mb(e,t,n){const i=kt(t),a=Nt(t),r=n==="fixed",o=$t(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const u=St(0);function c(){u.x=ki(a)}if(i||!i&&!r)if((fn(t)!=="body"||Fn(a))&&(s=Ti(t)),i){const f=$t(t,!0,r,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else a&&c();r&&!i&&a&&c();const d=a&&!i&&!r?ul(a,s):St(0),l=o.left+s.scrollLeft-u.x-d.x,m=o.top+s.scrollTop-u.y-d.y;return{x:l,y:m,width:o.width,height:o.height}}function Wi(e){return yt(e).position==="static"}function vo(e,t){if(!kt(e)||yt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Nt(e)===n&&(n=n.ownerDocument.body),n}function hl(e,t){const n=ot(e);if(Si(e))return n;if(!kt(e)){let a=Yt(e);for(;a&&!dn(a);){if(gt(a)&&!Wi(a))return a;a=Yt(a)}return n}let i=vo(e,t);for(;i&&fb(i)&&Wi(i);)i=vo(i,t);return i&&dn(i)&&Wi(i)&&!Ya(i)?n:i||wb(e)||n}const Ib=async function(e){const t=this.getOffsetParent||hl,n=this.getDimensions,i=await n(e.floating);return{reference:Mb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Lb(e){return yt(e).direction==="rtl"}const Fb={convertOffsetParentRelativeRectToViewportRelativeRect:Tb,getDocumentElement:Nt,getClippingRect:Eb,getOffsetParent:hl,getElementRects:Ib,getClientRects:kb,getDimensions:Ob,getScale:cn,isElement:gt,isRTL:Lb};function pl(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,i;const a=Nt(e);function r(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function o(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),r();const c=e.getBoundingClientRect(),{left:d,top:l,width:m,height:f}=c;if(s||t(),!m||!f)return;const p=Kn(l),y=Kn(a.clientWidth-(d+m)),b=Kn(a.clientHeight-(l+f)),P=Kn(d),T={rootMargin:-p+"px "+-y+"px "+-b+"px "+-P+"px",threshold:at(0,zt(1,u))||1};let v=!0;function g(A){const x=A[0].intersectionRatio;if(x!==u){if(!v)return o();x?o(!1,x):i=setTimeout(()=>{o(!1,1e-7)},1e3)}x===1&&!pl(c,e.getBoundingClientRect())&&o(),v=!1}try{n=new IntersectionObserver(g,{...T,root:a.ownerDocument})}catch{n=new IntersectionObserver(g,T)}n.observe(e)}return o(!0),r}function Bb(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,c=Wa(e),d=a||r?[...c?An(c):[],...An(t)]:[];d.forEach(P=>{a&&P.addEventListener("scroll",n,{passive:!0}),r&&P.addEventListener("resize",n)});const l=c&&s?Gb(c,n):null;let m=-1,f=null;o&&(f=new ResizeObserver(P=>{let[k]=P;k&&k.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=f)==null||T.observe(t)})),n()}),c&&!u&&f.observe(c),f.observe(t));let p,y=u?$t(e):null;u&&b();function b(){const P=$t(e);y&&!pl(y,P)&&n(),y=P,p=requestAnimationFrame(b)}return n(),()=>{var P;d.forEach(k=>{a&&k.removeEventListener("scroll",n),r&&k.removeEventListener("resize",n)}),l?.(),(P=f)==null||P.disconnect(),f=null,u&&cancelAnimationFrame(p)}}const jb=cb,Ub=ub,zb=ob,Yb=hb,Hb=sb,wo=rb,Wb=db,qb=(e,t,n)=>{const i=new Map,a={platform:Fb,...n},r={...a.platform,_c:i};return ab(e,t,{...a,platform:r})};var _b=typeof document<"u",Vb=function(){},$n=_b?w.useLayoutEffect:Vb;function ui(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,i,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!ui(e[i],t[i]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,a[i]))return!1;for(i=n;i--!==0;){const r=a[i];if(!(r==="_owner"&&e.$$typeof)&&!ui(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function ml(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xo(e,t){const n=ml(e);return Math.round(t*n)/n}function qi(e){const t=I.useRef(e);return $n(()=>{t.current=e}),t}function Kb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:a,elements:{reference:r,floating:o}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[d,l]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=I.useState(i);ui(m,i)||f(i);const[p,y]=I.useState(null),[b,P]=I.useState(null),k=I.useCallback(Q=>{Q!==A.current&&(A.current=Q,y(Q))},[]),T=I.useCallback(Q=>{Q!==x.current&&(x.current=Q,P(Q))},[]),v=r||p,g=o||b,A=I.useRef(null),x=I.useRef(null),S=I.useRef(d),D=u!=null,L=qi(u),H=qi(a),j=qi(c),G=I.useCallback(()=>{if(!A.current||!x.current)return;const Q={placement:t,strategy:n,middleware:m};H.current&&(Q.platform=H.current),qb(A.current,x.current,Q).then(se=>{const E={...se,isPositioned:j.current!==!1};q.current&&!ui(S.current,E)&&(S.current=E,Bo.flushSync(()=>{l(E)}))})},[m,t,n,H,j]);$n(()=>{c===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,l(Q=>({...Q,isPositioned:!1})))},[c]);const q=I.useRef(!1);$n(()=>(q.current=!0,()=>{q.current=!1}),[]),$n(()=>{if(v&&(A.current=v),g&&(x.current=g),v&&g){if(L.current)return L.current(v,g,G);G()}},[v,g,G,L,D]);const Z=I.useMemo(()=>({reference:A,floating:x,setReference:k,setFloating:T}),[k,T]),F=I.useMemo(()=>({reference:v,floating:g}),[v,g]),W=I.useMemo(()=>{const Q={position:n,left:0,top:0};if(!F.floating)return Q;const se=xo(F.floating,d.x),E=xo(F.floating,d.y);return s?{...Q,transform:"translate("+se+"px, "+E+"px)",...ml(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:se,top:E}},[n,s,F.floating,d.x,d.y]);return I.useMemo(()=>({...d,update:G,refs:Z,elements:F,floatingStyles:W}),[d,G,Z,F,W])}const Jb=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:a}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?wo({element:i.current,padding:a}).fn(n):{}:i?wo({element:i,padding:a}).fn(n):{}}}},Xb=(e,t)=>({...jb(e),options:[e,t]}),Zb=(e,t)=>({...Ub(e),options:[e,t]}),Qb=(e,t)=>({...Wb(e),options:[e,t]}),$b=(e,t)=>({...zb(e),options:[e,t]}),ev=(e,t)=>({...Yb(e),options:[e,t]}),tv=(e,t)=>({...Hb(e),options:[e,t]}),nv=(e,t)=>({...Jb(e),options:[e,t]});var iv="Arrow",fl=I.forwardRef((e,t)=>{const{children:n,width:i=10,height:a=5,...r}=e;return h.jsx(Wt.svg,{...r,ref:t,width:i,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});fl.displayName=iv;var av=fl,qa="Popper",[gl,yl]=$s(qa),[rv,bl]=gl(qa),vl=e=>{const{__scopePopper:t,children:n}=e,[i,a]=I.useState(null);return h.jsx(rv,{scope:t,anchor:i,onAnchorChange:a,children:n})};vl.displayName=qa;var wl="PopperAnchor",xl=I.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:i,...a}=e,r=bl(wl,n),o=I.useRef(null),s=tn(t,o),u=I.useRef(null);return I.useEffect(()=>{const c=u.current;u.current=i?.current||o.current,c!==u.current&&r.onAnchorChange(u.current)}),i?null:h.jsx(Wt.div,{...a,ref:s})});xl.displayName=wl;var _a="PopperContent",[ov,sv]=gl(_a),Pl=I.forwardRef((e,t)=>{const{__scopePopper:n,side:i="bottom",sideOffset:a=0,align:r="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:l="partial",hideWhenDetached:m=!1,updatePositionStrategy:f="optimized",onPlaced:p,...y}=e,b=bl(_a,n),[P,k]=I.useState(null),T=tn(t,J=>k(J)),[v,g]=I.useState(null),A=qy(v),x=A?.width??0,S=A?.height??0,D=i+(r!=="center"?"-"+r:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},H=Array.isArray(c)?c:[c],j=H.length>0,G={padding:L,boundary:H.filter(cv),altBoundary:j},{refs:q,floatingStyles:Z,placement:F,isPositioned:W,middlewareData:Q}=Kb({strategy:"fixed",placement:D,whileElementsMounted:(...J)=>Bb(...J,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[Xb({mainAxis:a+S,alignmentAxis:o}),u&&Zb({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?Qb():void 0,...G}),u&&$b({...G}),ev({...G,apply:({elements:J,rects:$,availableWidth:ne,availableHeight:le})=>{const{width:pe,height:V}=$.reference,xe=J.floating.style;xe.setProperty("--radix-popper-available-width",`${ne}px`),xe.setProperty("--radix-popper-available-height",`${le}px`),xe.setProperty("--radix-popper-anchor-width",`${pe}px`),xe.setProperty("--radix-popper-anchor-height",`${V}px`)}}),v&&nv({element:v,padding:s}),uv({arrowWidth:x,arrowHeight:S}),m&&tv({strategy:"referenceHidden",...G})]}),[se,E]=kl(F),N=xi(p);Ut(()=>{W&&N?.()},[W,N]);const z=Q.arrow?.x,B=Q.arrow?.y,U=Q.arrow?.centerOffset!==0,[_,X]=I.useState();return Ut(()=>{P&&X(window.getComputedStyle(P).zIndex)},[P]),h.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:W?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_,"--radix-popper-transform-origin":[Q.transformOrigin?.x,Q.transformOrigin?.y].join(" "),...Q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(ov,{scope:n,placedSide:se,onArrowChange:g,arrowX:z,arrowY:B,shouldHideArrow:U,children:h.jsx(Wt.div,{"data-side":se,"data-align":E,...y,ref:T,style:{...y.style,animation:W?void 0:"none"}})})})});Pl.displayName=_a;var Sl="PopperArrow",lv={top:"bottom",right:"left",bottom:"top",left:"right"},Tl=I.forwardRef(function(t,n){const{__scopePopper:i,...a}=t,r=sv(Sl,i),o=lv[r.placedSide];return h.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:h.jsx(av,{...a,ref:n,style:{...a.style,display:"block"}})})});Tl.displayName=Sl;function cv(e){return e!==null}var uv=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:i,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,s=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[c,d]=kl(n),l={start:"0%",center:"50%",end:"100%"}[d],m=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+u/2;let p="",y="";return c==="bottom"?(p=o?l:`${m}px`,y=`${-u}px`):c==="top"?(p=o?l:`${m}px`,y=`${i.floating.height+u}px`):c==="right"?(p=`${-u}px`,y=o?l:`${f}px`):c==="left"&&(p=`${i.floating.width+u}px`,y=o?l:`${f}px`),{data:{x:p,y}}}});function kl(e){const[t,n="center"]=e.split("-");return[t,n]}var dv=vl,hv=xl,pv=Pl,mv=Tl,[Ci]=$s("Tooltip",[yl]),Ai=yl(),Cl="TooltipProvider",fv=700,ha="tooltip.open",[gv,Va]=Ci(Cl),Al=e=>{const{__scopeTooltip:t,delayDuration:n=fv,skipDelayDuration:i=300,disableHoverableContent:a=!1,children:r}=e,o=I.useRef(!0),s=I.useRef(!1),u=I.useRef(0);return I.useEffect(()=>{const c=u.current;return()=>window.clearTimeout(c)},[]),h.jsx(gv,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{window.clearTimeout(u.current),o.current=!1},[]),onClose:I.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,i)},[i]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(c=>{s.current=c},[]),disableHoverableContent:a,children:r})};Al.displayName=Cl;var Nn="Tooltip",[yv,Gn]=Ci(Nn),Nl=e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:a,onOpenChange:r,disableHoverableContent:o,delayDuration:s}=e,u=Va(Nn,e.__scopeTooltip),c=Ai(t),[d,l]=I.useState(null),m=Ly(),f=I.useRef(0),p=o??u.disableHoverableContent,y=s??u.delayDuration,b=I.useRef(!1),[P,k]=Ay({prop:i,defaultProp:a??!1,onChange:x=>{x?(u.onOpen(),document.dispatchEvent(new CustomEvent(ha))):u.onClose(),r?.(x)},caller:Nn}),T=I.useMemo(()=>P?b.current?"delayed-open":"instant-open":"closed",[P]),v=I.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b.current=!1,k(!0)},[k]),g=I.useCallback(()=>{window.clearTimeout(f.current),f.current=0,k(!1)},[k]),A=I.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{b.current=!0,k(!0),f.current=0},y)},[y,k]);return I.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),h.jsx(dv,{...c,children:h.jsx(yv,{scope:t,contentId:m,open:P,stateAttribute:T,trigger:d,onTriggerChange:l,onTriggerEnter:I.useCallback(()=>{u.isOpenDelayedRef.current?A():v()},[u.isOpenDelayedRef,A,v]),onTriggerLeave:I.useCallback(()=>{p?g():(window.clearTimeout(f.current),f.current=0)},[g,p]),onOpen:v,onClose:g,disableHoverableContent:p,children:n})})};Nl.displayName=Nn;var pa="TooltipTrigger",Dl=I.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,a=Gn(pa,n),r=Va(pa,n),o=Ai(n),s=I.useRef(null),u=tn(t,s,a.onTriggerChange),c=I.useRef(!1),d=I.useRef(!1),l=I.useCallback(()=>c.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),h.jsx(hv,{asChild:!0,...o,children:h.jsx(Wt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...i,ref:u,onPointerMove:Ot(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!r.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ot(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:Ot(e.onPointerDown,()=>{a.open&&a.onClose(),c.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:Ot(e.onFocus,()=>{c.current||a.onOpen()}),onBlur:Ot(e.onBlur,a.onClose),onClick:Ot(e.onClick,a.onClose)})})});Dl.displayName=pa;var Ka="TooltipPortal",[bv,vv]=Ci(Ka,{forceMount:void 0}),Rl=e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:a}=e,r=Gn(Ka,t);return h.jsx(bv,{scope:t,forceMount:n,children:h.jsx(Ba,{present:n||r.open,children:h.jsx(il,{asChild:!0,container:a,children:i})})})};Rl.displayName=Ka;var hn="TooltipContent",El=I.forwardRef((e,t)=>{const n=vv(hn,e.__scopeTooltip),{forceMount:i=n.forceMount,side:a="top",...r}=e,o=Gn(hn,e.__scopeTooltip);return h.jsx(Ba,{present:i||o.open,children:o.disableHoverableContent?h.jsx(Ol,{side:a,...r,ref:t}):h.jsx(wv,{side:a,...r,ref:t})})}),wv=I.forwardRef((e,t)=>{const n=Gn(hn,e.__scopeTooltip),i=Va(hn,e.__scopeTooltip),a=I.useRef(null),r=tn(t,a),[o,s]=I.useState(null),{trigger:u,onClose:c}=n,d=a.current,{onPointerInTransitChange:l}=i,m=I.useCallback(()=>{s(null),l(!1)},[l]),f=I.useCallback((p,y)=>{const b=p.currentTarget,P={x:p.clientX,y:p.clientY},k=kv(P,b.getBoundingClientRect()),T=Cv(P,k),v=Av(y.getBoundingClientRect()),g=Dv([...T,...v]);s(g),l(!0)},[l]);return I.useEffect(()=>()=>m(),[m]),I.useEffect(()=>{if(u&&d){const p=b=>f(b,d),y=b=>f(b,u);return u.addEventListener("pointerleave",p),d.addEventListener("pointerleave",y),()=>{u.removeEventListener("pointerleave",p),d.removeEventListener("pointerleave",y)}}},[u,d,f,m]),I.useEffect(()=>{if(o){const p=y=>{const b=y.target,P={x:y.clientX,y:y.clientY},k=u?.contains(b)||d?.contains(b),T=!Nv(P,o);k?m():T&&(m(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[u,d,o,c,m]),h.jsx(Ol,{...e,ref:r})}),[xv,Pv]=Ci(Nn,{isInside:!1}),Sv=gy("TooltipContent"),Ol=I.forwardRef((e,t)=>{const{__scopeTooltip:n,children:i,"aria-label":a,onEscapeKeyDown:r,onPointerDownOutside:o,...s}=e,u=Gn(hn,n),c=Ai(n),{onClose:d}=u;return I.useEffect(()=>(document.addEventListener(ha,d),()=>document.removeEventListener(ha,d)),[d]),I.useEffect(()=>{if(u.trigger){const l=m=>{m.target?.contains(u.trigger)&&d()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[u.trigger,d]),h.jsx(tl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l=>l.preventDefault(),onDismiss:d,children:h.jsxs(pv,{"data-state":u.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Sv,{children:i}),h.jsx(xv,{scope:n,isInside:!0,children:h.jsx(Ty,{id:u.contentId,role:"tooltip",children:a||i})})]})})});El.displayName=hn;var Ml="TooltipArrow",Tv=I.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,a=Ai(n);return Pv(Ml,n).isInside?null:h.jsx(mv,{...a,...i,ref:t})});Tv.displayName=Ml;function kv(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,i,a,r)){case r:return"left";case a:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function Cv(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function Av(e){const{top:t,right:n,bottom:i,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:i},{x:a,y:i}]}function Nv(e,t){const{x:n,y:i}=e;let a=!1;for(let r=0,o=t.length-1;r<t.length;o=r++){const s=t[r],u=t[o],c=s.x,d=s.y,l=u.x,m=u.y;d>i!=m>i&&n<(l-c)*(i-d)/(m-d)+c&&(a=!a)}return a}function Dv(e){const t=e.slice();return t.sort((n,i)=>n.x<i.x?-1:n.x>i.x?1:n.y<i.y?-1:n.y>i.y?1:0),Rv(t)}function Rv(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i<e.length;i++){const a=e[i];for(;t.length>=2;){const r=t[t.length-1],o=t[t.length-2];if((r.x-o.x)*(a.y-o.y)>=(r.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const a=e[i];for(;n.length>=2;){const r=n[n.length-1],o=n[n.length-2];if((r.x-o.x)*(a.y-o.y)>=(r.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ev=Al,Ov=Nl,Mv=Dl,Iv=Rl,Il=El;const Lv=({delayDuration:e=0,...t})=>h.jsx(Ev,{delayDuration:e,...t}),Fv=Ov,Gv=Mv,Ll=I.forwardRef(({className:e,sideOffset:t=4,...n},i)=>h.jsx(Iv,{children:h.jsx(Il,{ref:i,sideOffset:t,className:ft("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md border px-3 py-1.5 text-sm shadow-md",e),...n})}));Ll.displayName=Il.displayName;const _i=({text:e,children:t})=>h.jsx(Lv,{children:h.jsxs(Fv,{children:[h.jsx(Gv,{asChild:!0,children:h.jsx("span",{className:"inline-flex items-start gap-1",children:t&&t})}),h.jsx(Ll,{className:"rounded-sm border-none bg-gray-200 p-1 text-xs",children:e&&h.jsx("p",{children:e})})]})}),Bv=[{label:"15M",value:"15"},{label:"30M",value:"30"},{label:"1H",value:"60"},{label:"2H",value:"120"},{label:"4H",value:"240"},{label:"1D",value:"1D"}],jv=[{labelKey:"Selector.periodAll",value:0},{labelKey:"Selector.periodLastYear",value:1},{labelKey:"Selector.periodLast3Years",value:3},{labelKey:"Selector.periodLast5Years",value:5},{labelKey:"Selector.periodLast15Years",value:15}],Uv=[10,20,25,30,40],zv=({control:e})=>{const{t}=At();return h.jsxs("div",{className:"iccandle-scanner-advanced-options",children:[h.jsxs("div",{className:"iccandle-scanner-advanced-options__row",children:[h.jsxs("label",{className:"iccandle-scanner-advanced-options__label",children:[t("Selector.topResults"),h.jsx(_i,{text:t("Selector.topResultsTooltip")})]}),h.jsx(Yi,{control:e,name:"top_k",render:({field:n})=>h.jsx("div",{className:"iccandle-scanner-advanced-options__native-select-wrap iccandle-scanner-advanced-options__native-select-wrap--small",children:h.jsx("select",{className:"iccandle-scanner-advanced-options__native-select",value:String(n.value??10),onChange:i=>n.onChange(Number(i.target.value)||0),children:Uv.map(i=>h.jsx("option",{value:String(i),children:i},i))})})})]}),h.jsxs("div",{className:"iccandle-scanner-advanced-options__row",children:[h.jsxs("label",{className:"iccandle-scanner-advanced-options__label",children:[t("Common.timeframe"),h.jsx(_i,{text:t("Selector.timeframeTooltip")})]}),h.jsx(Yi,{control:e,name:"timeframe",render:({field:n})=>h.jsx("div",{className:"iccandle-scanner-advanced-options__native-select-wrap iccandle-scanner-advanced-options__native-select-wrap--small",children:h.jsx("select",{className:"iccandle-scanner-advanced-options__native-select",value:n.value,onChange:i=>n.onChange(i.target.value),children:Bv.map(i=>h.jsx("option",{value:i.value,children:i.label},i.value))})})})]}),h.jsxs("div",{className:"iccandle-scanner-advanced-options__row",children:[h.jsxs("label",{className:"iccandle-scanner-advanced-options__label",children:[t("Selector.period"),h.jsx(_i,{text:t("Selector.periodTooltip")})]}),h.jsx(Yi,{control:e,name:"period",render:({field:n})=>h.jsx("div",{className:"iccandle-scanner-advanced-options__native-select-wrap iccandle-scanner-advanced-options__native-select-wrap--large",children:h.jsx("select",{className:"iccandle-scanner-advanced-options__native-select",value:String(n.value??0),onChange:i=>n.onChange(Number(i.target.value)||0),children:jv.map(i=>h.jsx("option",{value:String(i.value),children:t(i.labelKey)},i.value))})})})]})]})},Vt={min:10,max:50,custom:[60,70,80,90,100]},Tt=[{ticker:"EUR_JPY",display_name:"EURJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"EUR JPY",type:"forex",session:"1700-1700"},{ticker:"GBP_JPY",display_name:"GBPJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"GBP JPY",type:"forex",session:"1700-1700"},{ticker:"AUD_JPY",display_name:"AUDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/AUD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"AUD JPY",type:"forex",session:"1700-1700"},{ticker:"NZD_JPY",display_name:"NZDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"NZD JPY",type:"forex",session:"1700-1700"},{ticker:"CAD_JPY",display_name:"CADJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/CAD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"CAD JPY",type:"forex",session:"1700-1700"},{ticker:"CHF_JPY",display_name:"CHFJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/CHF.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"CHF JPY",type:"forex",session:"1700-1700"},{ticker:"USD_JPY",display_name:"USDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"USD JPY",type:"forex",session:"1700-1700"},{ticker:"EUR_USD",display_name:"EURUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"EUR USD",type:"forex",session:"1700-1700"},{ticker:"AUD_USD",display_name:"AUDUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/AUD.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"AUD USD",type:"forex",session:"1700-1700"},{ticker:"NZD_USD",display_name:"NZDUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"NZD USD",type:"forex",session:"1700-1700"},{ticker:"USD_CHF",display_name:"USDCHF",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/CHF.svg"],description:"USD CHF",type:"forex",session:"1700-1700"},{ticker:"USD_CAD",display_name:"USDCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"USD CAD",type:"forex",session:"1700-1700"},{ticker:"GBP_AUD",display_name:"GBPAUD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/AUD.svg"],description:"GBP AUD",type:"forex",session:"1700-1700"},{ticker:"GBP_CAD",display_name:"GBPCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"GBP CAD",type:"forex",session:"1700-1700"},{ticker:"GBP_CHF",display_name:"GBPCHF",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/CHF.svg"],description:"GBP CHF",type:"forex",session:"1700-1700"},{ticker:"GBP_NZD",display_name:"GBPNZD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/NZD.svg"],description:"GBP NZD",type:"forex",session:"1700-1700"},{ticker:"GBP_USD",display_name:"GBPUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"GBP USD",type:"forex",session:"1700-1700"},{ticker:"NZD_CAD",display_name:"NZDCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"NZD CAD",type:"forex",session:"1700-1700"},{ticker:"EUR_CAD",display_name:"EURCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"EUR CAD",type:"forex",session:"1700-1700"},{ticker:"EUR_AUD",display_name:"EURAUD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/AUD.svg"],description:"EUR AUD",type:"forex",session:"1700-1700"},{ticker:"XAU_USD",display_name:"XAUUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XAU.svg"],description:"Gold",type:"commodity",session:"1700-1700"},{ticker:"BCO_USD",display_name:"BCOUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/BCO.svg"],description:"Brent Crude Oil",type:"commodity",session:"1700-1700"},{ticker:"SPX500_USD",display_name:"S&P500",logo_urls:["https://cdn.iccandle.ai/web-assets/SPX500.svg"],description:"S&P 500",type:"indices",session:"1700-1700"},{ticker:"NAS100_USD",display_name:"NASDAQ100",logo_urls:["https://cdn.iccandle.ai/web-assets/NAS100.svg"],description:"NASDAQ 100",type:"indices",session:"1700-1700"},{ticker:"US30_USD",display_name:"US30",logo_urls:["https://cdn.iccandle.ai/web-assets/US30.svg"],description:"US Wall St 30",type:"indices",session:"1700-1700"},{ticker:"BTCUSDT",display_name:"BTCUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/BTC.svg"],description:"BTCUSDT",type:"crypto",session:"24x7"},{ticker:"ETHUSDT",display_name:"ETHUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/ETH.svg"],description:"ETHUSDT",type:"crypto",session:"24x7"},{ticker:"XRPUSDT",display_name:"XRPUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/XRP.svg"],description:"XRPUSDT",type:"crypto",session:"24x7"},{ticker:"SOLUSDT",display_name:"SOLUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/SOL.svg"],description:"SOLUSDT",type:"crypto",session:"24x7"},{ticker:"ADAUSDT",display_name:"ADAUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/ADA.svg"],description:"ADAUSDT",type:"crypto",session:"24x7"},{ticker:"AVAUSDT",display_name:"AVAUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/AVA.svg"],description:"AVAUSDT",type:"crypto",session:"24x7"},{ticker:"AVAXUSDT",display_name:"AVAXUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/AVAX.svg"],description:"AVAXUSDT",type:"crypto",session:"24x7"},{ticker:"BNBUSDT",display_name:"BNBUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/BNB.svg"],description:"BNBUSDT",type:"crypto",session:"24x7"},{ticker:"DOGEUSDT",display_name:"DOGEUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/DOGE.svg"],description:"DOGEUSDT",type:"crypto",session:"24x7"},{ticker:"DOTUSDT",display_name:"DOTUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/DOT.svg"],description:"DOTUSDT",type:"crypto",session:"24x7"},{ticker:"TRXUSDT",display_name:"TRXUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/TRX.svg"],description:"TRXUSDT",type:"crypto",session:"24x7"},{ticker:"AAPL",display_name:"AAPL",logo_urls:["https://cdn.iccandle.ai/web-assets/AAPL.svg"],description:"Apple Inc.",type:"stock",session:"24x7"},{ticker:"AMZN",display_name:"AMZN",logo_urls:["https://cdn.iccandle.ai/web-assets/AMZN.svg"],description:"Amazon.Com Inc",type:"stock",session:"24x7"},{ticker:"BRK.B",display_name:"BRK.B",logo_urls:["https://cdn.iccandle.ai/web-assets/BRK.B.svg"],description:"BERKSHIRE HATHAWAY Class B",type:"stock",session:"24x7"},{ticker:"GOOGL",display_name:"GOOGL",logo_urls:["https://cdn.iccandle.ai/web-assets/GOOGL.svg"],description:"Alphabet Inc. Class A Common Stock",type:"stock",session:"24x7"},{ticker:"KO",display_name:"KO",logo_urls:["https://cdn.iccandle.ai/web-assets/KO.svg"],description:"Coca-Cola Company",type:"stock",session:"24x7"},{ticker:"META",display_name:"META",logo_urls:["https://cdn.iccandle.ai/web-assets/META.svg"],description:"Meta Platforms, Inc. Class A Common Stock",type:"stock",session:"24x7"},{ticker:"MSFT",display_name:"MSFT",logo_urls:["https://cdn.iccandle.ai/web-assets/MSFT.svg"],description:"Microsoft Corp",type:"stock",session:"24x7"},{ticker:"NFLX",display_name:"NFLX",logo_urls:["https://cdn.iccandle.ai/web-assets/NFLX.svg"],description:"NetFlix Inc",type:"stock",session:"24x7"},{ticker:"NKE",display_name:"NKE",logo_urls:["https://cdn.iccandle.ai/web-assets/NKE.svg"],description:"Nike, Inc.",type:"stock",session:"24x7"},{ticker:"NVDA",display_name:"NVDA",logo_urls:["https://cdn.iccandle.ai/web-assets/NVDA.svg"],description:"Nvidia Corp",type:"stock",session:"24x7"},{ticker:"TME",display_name:"TME",logo_urls:["https://cdn.iccandle.ai/web-assets/TME.svg"],description:"Tencent Music Entertainment Group American Depositary Shares, each representing two Class A Ordinary Shares",type:"stock",session:"24x7"},{ticker:"TSLA",display_name:"TSLA",logo_urls:["https://cdn.iccandle.ai/web-assets/TSLA.svg"],description:"Tesla, Inc. Common Stock",type:"stock",session:"24x7"},{ticker:"XAG_USD",display_name:"XAGUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XAG.svg"],description:"Silver",type:"commodity",session:"1700-1700"},{ticker:"XCU_USD",display_name:"XCUUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XCU.svg"],description:"Copper",type:"commodity",session:"1700-1700"}],Fl=({name:e})=>{const t=Tt?.find(n=>n.ticker===e)?.logo_urls.map(n=>n)||[];return h.jsxs("div",{className:"iccandle-forexIcons",children:[t.length===1&&h.jsx("img",{src:t[0],alt:"forex icon",width:24,height:24,className:"iccandle-forexIcons__img iccandle-forexIcons__img--single"}),t.length===2&&h.jsxs(h.Fragment,{children:[h.jsx("img",{src:t[0],alt:"forex icon 1",width:18,height:18,className:"iccandle-forexIcons__img iccandle-forexIcons__img--left"}),h.jsx("img",{src:t[1],alt:"forex icon 2",width:18,height:18,className:"iccandle-forexIcons__img iccandle-forexIcons__img--right"})]})]})},Yv={all:"Common.all",forex:"Layout.helperBar.groupForex",crypto:"Layout.helperBar.groupCrypto",indices:"Layout.helperBar.groupIndices",commodity:"Layout.helperBar.groupCommodity",stock:"Layout.helperBar.groupStock"},Gl=({searchTerm:e,onSearchChange:t,selectedType:n,onTypeChange:i,selectAll:a,onSelectAll:r,selectedSymbols:o,onSymbolChange:s,filteredSymbols:u})=>{const{t:c}=At(),d=Object.values(o).filter(Boolean).length,l=d<=1?c("Pattern.symbolSelected",{count:d}):c("Pattern.symbolsSelected",{count:d});return h.jsxs("div",{className:"iccandle-scanner-symbol-search",children:[h.jsxs("div",{className:"iccandle-scanner-symbol-search__bar",children:[h.jsx(qo,{strokeWidth:.5,className:"iccandle-scanner-symbol-search__search-icon"}),h.jsx("input",{className:"iccandle-scanner-symbol-search__input",placeholder:c("Selector.searchSymbol"),value:e,onChange:m=>t(m.target.value.toUpperCase())}),h.jsxs("span",{className:"iccandle-scanner-symbol-search__count-badge",children:[h.jsx("span",{className:"iccandle-scanner-symbol-search__count-desktop",children:l}),h.jsx("span",{className:"iccandle-scanner-symbol-search__count-mobile",children:!d})]})]}),h.jsx("div",{className:"iccandle-scanner-symbol-search__types-wrap",children:h.jsx("div",{className:"iccandle-scanner-symbol-search__types-list",children:tg.map((m,f)=>h.jsx("button",{type:"button",className:ft("iccandle-scanner-symbol-search__type-badge",n===m.value?"iccandle-scanner-symbol-search__type-badge--active":"iccandle-scanner-symbol-search__type-badge--inactive"),onClick:()=>i(m.value),children:h.jsx("span",{className:ft("iccandle-scanner-symbol-search__type-label",n===m.value?"iccandle-scanner-symbol-search__type-label--active":"iccandle-scanner-symbol-search__type-label--inactive"),children:c(Yv[m.value]??"Common.all")})},f))})}),h.jsxs("div",{className:"iccandle-scanner-symbol-search__table-wrap",children:[h.jsxs("div",{className:"iccandle-scanner-symbol-search__table-head",children:[h.jsx("input",{type:"checkbox",className:"iccandle-scanner-symbol-search__checkbox",checked:a,onChange:m=>r(m.target.checked),"aria-label":c("Selector.selectAll")}),h.jsx("span",{className:"iccandle-scanner-symbol-search__symbol-title",children:c("Common.columnSymbol")}),h.jsx("span",{className:"iccandle-scanner-symbol-search__description-title",children:c("Common.columnDescription")})]}),h.jsxs("div",{className:"iccandle-scanner-symbol-search__list-container",children:[h.jsx("ul",{className:"iccandle-scanner-symbol-search__symbol-list",children:u?.map(m=>h.jsxs(w.Fragment,{children:[h.jsxs("li",{className:"iccandle-scanner-symbol-search__symbol-row",children:[h.jsx("input",{type:"checkbox",className:"iccandle-scanner-symbol-search__checkbox iccandle-scanner-symbol-search__checkbox--row",checked:!!o[m.ticker],onChange:f=>s(m.ticker,f.target.checked),"aria-label":c("Selector.selectSymbolAria",{symbol:m.ticker})}),h.jsx(Fl,{name:m.ticker}),h.jsx("span",{className:"iccandle-scanner-symbol-search__symbol-name",children:m.display_name})]}),h.jsx("hr",{className:"iccandle-scanner-symbol-search__row-divider"})]},m.ticker))}),h.jsx("ul",{className:"iccandle-scanner-symbol-search__description-list",children:u?.map(m=>h.jsxs(w.Fragment,{children:[h.jsxs("li",{className:"iccandle-scanner-symbol-search__description-row",children:[h.jsx("span",{className:"iccandle-scanner-symbol-search__description-text",children:m.description}),h.jsx("span",{className:"iccandle-scanner-symbol-search__type-text",children:m.type})]}),h.jsx("hr",{className:"iccandle-scanner-symbol-search__row-divider"})]},m.ticker))})]})]})]})},Po=["Selector.tabSymbols","Selector.tabAdvancedOptions"],Hv=({handleCloseDialog:e,timeframe:t,setResolution:n})=>{const{t:i}=At(),[a,r]=w.useState(Po[0]),o=typeof window<"u"?JSON.parse(localStorage.getItem("search-filter")||"{}"):null,[s,u]=w.useState(""),[c,d]=w.useState("all"),[l,m]=w.useState(()=>o?.symbols?o.symbols.reduce((g,A)=>(g[A]=!0,g),{}):{}),f=Tt?.filter(g=>{const A=g.display_name.toLowerCase().includes(s.toLowerCase()),x=c?c==="all"?!0:g.type===c:!0;return A&&x}),p=f?.length?f.every(g=>l[g.ticker]):!1,[y,b]=w.useState(p);w.useEffect(()=>{b(p)},[p]);const P=g=>{if(!f)return;const A=f.reduce((x,S)=>(x[S.ticker]=g,x),{});m(x=>({...x,...A})),b(g)},k=(g,A)=>{m(x=>({...x,[g]:A}))},T=Ks({defaultValues:{probability:o?.probability||0,top_k:o?.top_k||25,timeframe:t==="1"||t==="5"?"60":t||"60",period:o?.period||0}}),v=g=>{const A=Object.entries(l).filter(([L,H])=>H).map(([L])=>L),x=Array.from(new Set(Tt.filter(L=>A.includes(L.ticker)).map(L=>L.type))),S=Tt?.every(L=>l[L.ticker])??!1,D={...typeof g=="object"&&g!==null?g:{},symbols:A,symbolTypes:x,isAllSelected:S};localStorage.setItem("search-filter",JSON.stringify(D)),n(g?.timeframe),e()};return w.useEffect(()=>{y&&(f?.every(A=>l[A.ticker])||b(!1))},[l,f,y]),w.useEffect(()=>{const g=A=>{A.key==="Escape"&&e()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[e]),h.jsx("div",{className:"iccandle-scanner-option",role:"dialog","aria-modal":"true","aria-label":i("Selector.scannerOptions"),onPointerDown:g=>{g.target===g.currentTarget&&e()},children:h.jsxs("div",{className:"iccandle-scanner-option__card",onPointerDown:g=>g.stopPropagation(),children:[h.jsxs("div",{className:"iccandle-scanner-option__header",children:[h.jsx("div",{className:"iccandle-scanner-option__title",children:i("Selector.scannerOptions")}),h.jsx("button",{type:"button",onClick:e,className:"iccandle-scanner-option__close-btn","aria-label":i("Common.close"),children:h.jsx(_o,{size:20})})]}),h.jsx("div",{className:"iccandle-scanner-option__tabs",children:Po.map(g=>h.jsx("button",{type:"button",onClick:()=>r(g),className:ft("iccandle-scanner-option__tab",a===g?"iccandle-scanner-option__tab--active":"iccandle-scanner-option__tab--inactive"),children:i(g)},g))}),h.jsxs("form",{className:"iccandle-scanner-option__form",onSubmit:T.handleSubmit(v),children:[h.jsxs("div",{className:"iccandle-scanner-option__body",children:[h.jsx("div",{className:ft("iccandle-scanner-option__advanced-content",a!=="Selector.tabSymbols"?"iccandle-scanner-option__content--visible":"iccandle-scanner-option__content--hidden"),children:h.jsx(zv,{control:T.control})}),h.jsx("div",{className:ft(a==="Selector.tabSymbols"?"iccandle-scanner-option__content--visible":"iccandle-scanner-option__content--hidden"),children:h.jsx(Gl,{searchTerm:s,onSearchChange:u,selectedType:c,onTypeChange:d,selectAll:y,onSelectAll:P,selectedSymbols:l,onSymbolChange:k,filteredSymbols:f})})]}),h.jsxs("div",{className:"iccandle-scanner-option__actions",children:[h.jsx("button",{type:"button",className:"iccandle-scanner-option__btn iccandle-scanner-option__btn--outline",onClick:e,children:i("Common.cancel")}),h.jsx("button",{type:"submit",className:"iccandle-scanner-option__btn iccandle-scanner-option__btn--primary",children:i("Selector.saveOptions")})]})]})]})})};function Wv(e,t){w.useEffect(()=>{const n=async({origin:i,data:a})=>{if(i!==Jt||typeof a!="string")return;const r=JSON.parse(a),o=JSON.parse(localStorage.getItem(ni)||"[]"),s=e?.activeChart?.();await e?.headerReady(),r.length<o.length&&await new Promise(u=>{setTimeout(()=>{s?.clearMarks(2),u(!0)},150)}),localStorage.setItem(ni,JSON.stringify(r)),s?.refreshMarks();try{if(t.current&&t.current.length>0&&(t.current.forEach(u=>{try{s?.removeEntity(u)}catch{}}),t.current=[]),r.length===0)return;for(const u of r)try{const c=await s?.createShape({time:Math.floor(u.timestamp/1e3)},{shape:"vertical_line",lock:!0,disableSelection:!0,overrides:{linestyle:2,linewidth:1}});c&&(s?.getShapeById(c)?.setSavingEnabled(!1),t.current.push(c))}catch{}}catch{}};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)},[e,t])}function qv(e,t,n=1){if(t===0||!isFinite(t))return n;const i=e/t;return isFinite(i)?i:n}function So(e){if(e.length===0)return 0;const t=[...e].sort((i,a)=>i-a),n=Math.floor(t.length/2);return t.length%2!==0?t[n]:(t[n-1]+t[n])/2}function _v(e,t,n=[]){if(e.length===0)return[];const i=n.map(d=>Math.abs(d.c-d.o)),a=e.map(d=>Math.abs(d.c-d.o)),r=So(a),o=So(i),s=qv(o,r),u=e[0].o,c=t.c;return e.map(d=>{const l=(d.o-u)*s+c,m=(d.h-u)*s+c,f=(d.l-u)*s+c,p=(d.c-u)*s+c;return{o:l,h:Math.max(m,l,p),l:Math.min(f,l,p),c:p}})}const ei=8,Bl=4,ma=6,fa=5,jl=e=>{const t=new Date(e+ei*60*60*1e3),n=t.getUTCDay(),i=t.getUTCHours();return n===0?!1:n===1?i>=ma:n===6?i<Bl:i!==fa},Ul=e=>{const t=new Date(e+ei*60*60*1e3),n=t.getUTCDay(),i=t.getUTCHours();if(n===0||n===1&&i<ma||n===6&&i>=Bl){const a=(8-n)%7;return t.setUTCDate(t.getUTCDate()+a),t.setUTCHours(ma,0,0,0),t.getTime()-ei*60*60*1e3}return n>=2&&n<=5&&i===fa?(t.setUTCHours(fa+1,0,0,0),t.getTime()-ei*60*60*1e3):e},Vv=(e,t,n)=>{const i=mt(t)*1e3,a=[];let r=e;for(let o=0;o<n;o++)r+=i,jl(r)||(r=Ul(r)),a.push(r);return a},To=(e,t,n,i)=>{if(n<=0)return[];if(i==="24x7"){const r=mt(t)*1e3;return Array.from({length:n},(o,s)=>e+(s+1)*r)}if(i==="1700-1700")return Vv(e,t,n);const a=mt(t)*1e3;return Array.from({length:n},(r,o)=>e+(o+1)*a)},Kv=(e,t,n,i)=>{if(i==="24x7"){const r=mt(n)*1e3;return Math.max(0,Math.floor((t-e)/r))}if(i==="1700-1700"){const r=mt(n)*1e3;let o=0,s=e;for(;s<t;)s+=r,jl(s)||(s=Ul(s)),s<=t&&o++;return o}const a=mt(n)*1e3;return Math.max(0,Math.floor((t-e)/a))},ko=e=>{let t;const n=new Set,i=(c,d)=>{const l=typeof c=="function"?c(t):c;if(!Object.is(l,t)){const m=t;t=d??(typeof l!="object"||l===null)?l:Object.assign({},t,l),n.forEach(f=>f(t,m))}},a=()=>t,s={setState:i,getState:a,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=t=e(i,a,s);return s},Jv=(e=>e?ko(e):ko),Xv=e=>e;function Zv(e,t=Xv){const n=w.useSyncExternalStore(e.subscribe,w.useCallback(()=>t(e.getState()),[e,t]),w.useCallback(()=>t(e.getInitialState()),[e,t]));return w.useDebugValue(n),n}const Co=e=>{const t=Jv(e),n=i=>Zv(t,i);return Object.assign(n,t),n},zl=(e=>e?Co(e):Co);zl(e=>({patterns:[],setPatterns:t=>e({patterns:t}),addPattern:t=>e(n=>({patterns:[...n.patterns,t]})),removePattern:t=>e(n=>({patterns:n.patterns.filter(i=>i.id!==t)})),clearPatterns:()=>e({patterns:[]})}));const Ye=zl((e,t)=>({activeTab:"patterns",setActiveTab:n=>e({activeTab:n}),selectedPattern:null,setSelectedPattern:n=>e({selectedPattern:n}),playEndTimestamp:null,setPlayEndTimestamp:n=>e(()=>({playEndTimestamp:n})),getPlayEndTimestamp:()=>t().playEndTimestamp,targetCandles:[],setTargetCandles:n=>e({targetCandles:n}),gapCount:0,setGapCount:n=>e({gapCount:n})}));let ga=null,ya=!1,Yl=!1;function Qv(e){return typeof e=="function"&&typeof e.onReady!="function"}function $v(e){if(typeof e?.onReady!="function")throw new Error("withPlayChart: expected a TradingView datafeed object with onReady(). If you use a factory, call it first: withPlayChart(yourDataFeed(...)) or pass factory args: withPlayChart(yourDataFeed, arg1, arg2).")}function ew(e){return ga=e,t=>{!ya&&Yl||e(t)}}function Ao(e){$v(e);const t=e.subscribeBars?.bind(e);return t?Object.assign(Object.create(Object.getPrototypeOf(e)),e,{subscribeBars(n,i,a,r,o){return t(n,i,ew(a),r,o)}}):e}function tw(e,...t){if(Qv(e)){if(t.length>0)return Ao(e(...t));throw new Error("withPlayChart: received a datafeed factory. Call it before passing to TradingView: withPlayChart(yourDataFeed(...)) or pass factory arguments: withPlayChart(yourDataFeed, arg1, arg2).")}return Ao(e)}function Pt(e){Yl=e}function No(e){if(!ga)return!1;ya=!0;try{ga(e)}finally{ya=!1}return!0}let Hl=[];const Vi=e=>{Hl=e},nw=()=>Hl,di=e=>e>1e11?e:e*1e3,Wl=(e,t)=>{const n=di(e);return t.find(i=>di(i.time)===n)},ba="Generated Candles - By iC Candle",va="Generated Candles Background - By iC Candle",Ni="revealed_count",ql={id:Ni,name:"Revealed Count",type:"integer",defval:0,isHidden:!0,min:0},_l=e=>{const t=Math.max(0,Number(e(0))||0);return nw().slice(0,t)},Vl=(e,t)=>!!Wl(e,t),iw=({id:e,description:t,shortDescription:n,isHiddenStudy:i,bodyColors:a,wickColors:r,borderColors:o})=>({_metainfoVersion:51,id:e,description:t,shortDescription:n,isCustomIndicator:!0,is_hidden_study:i,is_price_study:!0,linkedToSeries:!0,format:{type:"price",precision:2},inputs:[ql],palettes:{palette_bar:{colors:{0:{name:"Bullish"},1:{name:"Bearish"}},valToIndex:{0:0,1:1}},palette_wick:{colors:{0:{name:"Bullish Wick"},1:{name:"Bearish Wick"}},valToIndex:{0:0,1:1}},palette_border:{colors:{0:{name:"Bullish Border"},1:{name:"Bearish Border"}},valToIndex:{0:0,1:1}}},plots:[{id:"plot_open",type:"ohlc_open",target:"plot_candle"},{id:"plot_high",type:"ohlc_high",target:"plot_candle"},{id:"plot_low",type:"ohlc_low",target:"plot_candle"},{id:"plot_close",type:"ohlc_close",target:"plot_candle"},{id:"plot_bar_color",type:"ohlc_colorer",palette:"palette_bar",target:"plot_candle"},{id:"plot_wick_color",type:"wick_colorer",palette:"palette_wick",target:"plot_candle"},{id:"plot_border_color",type:"border_colorer",palette:"palette_border",target:"plot_candle"}],ohlcPlots:{plot_candle:{title:n,forceOverlay:!0}},styles:{},defaults:{styles:{},ohlcPlots:{plot_candle:{borderColor:o[0],color:a[0],drawBorder:!0,drawWick:!0,plottype:"ohlc_candles",visible:!0,wickColor:r[0]}},palettes:{palette_bar:{colors:{0:{color:a[0],width:1,style:0},1:{color:a[1],width:1,style:0}}},palette_wick:{colors:{0:{color:r[0],width:1,style:0},1:{color:r[1],width:1,style:0}}},palette_border:{colors:{0:{color:o[0],width:1,style:0},1:{color:o[1],width:1,style:0}}}},precision:2,inputs:{[Ni]:0}}}),Do=0,Ja=(e="light")=>e==="dark"?"#131722":"#ffffff",wa=[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN],aw=e=>function(){this.init=function(t){this._context=t},this.main=function(t,n){this._context=t;const i=t.symbol.time,a=_l(n);return!Number.isFinite(i)||!a.length?[...wa]:Vl(i,a)?e(t,a):[...wa]}},rw=(e="light")=>{const t=Ja(e),n={name:va,metainfo:{_metainfoVersion:51,id:"Generated Candles Background - By iC Candle@tv-basicstudies-1",description:va,shortDescription:"Generated Candles Background",isCustomIndicator:!0,is_hidden_study:!0,is_price_study:!0,linkedToSeries:!0,format:{type:"inherit"},inputs:[ql],palettes:{prediction_bar_palette:{colors:{0:{name:"Predicted Bar"}},valToIndex:{[Do]:0}},prediction_mask_palette:{colors:{0:{name:"Predicted Mask"}},valToIndex:{0:0}}},plots:[{id:"bar",type:"bar_colorer",palette:"prediction_bar_palette"},{id:"mask_open",type:"ohlc_open",target:"mask_candle"},{id:"mask_high",type:"ohlc_high",target:"mask_candle"},{id:"mask_low",type:"ohlc_low",target:"mask_candle"},{id:"mask_close",type:"ohlc_close",target:"mask_candle"},{id:"mask_bar_color",type:"ohlc_colorer",palette:"prediction_mask_palette",target:"mask_candle"},{id:"mask_wick_color",type:"wick_colorer",palette:"prediction_mask_palette",target:"mask_candle"},{id:"mask_border_color",type:"border_colorer",palette:"prediction_mask_palette",target:"mask_candle"}],ohlcPlots:{mask_candle:{title:"Predicted Mask Candle",forceOverlay:!0}},defaults:{ohlcPlots:{mask_candle:{borderColor:t,color:t,drawBorder:!0,drawWick:!0,plottype:"ohlc_candles",visible:!0,wickColor:t}},palettes:{prediction_bar_palette:{colors:{0:{color:t,width:1,style:1}}},prediction_mask_palette:{colors:{0:{color:t,width:1,style:0}}}},inputs:{[Ni]:0}}},constructor:function(){this.init=function(a){this._context=a},this.main=function(a,r){this._context=a;const o=a.symbol.time,s=_l(r);if(!Number.isFinite(o)||!Vl(o,s))return[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN];const{open:u,high:c,low:d,close:l}=a.symbol,m=Math.max(c-d,Math.abs(l-u),Math.abs(l)*1e-4,.01);return[Do,u,c+m,d-m,l,0,0,0]}}},i={name:ba,metainfo:iw({id:"Generated Candles - By iC Candle@tv-basicstudies-1",description:ba,shortDescription:"Generated Candles",isHiddenStudy:!1,bodyColors:["#00dfb9","#ffb84d"],wickColors:["#00dfb9","#ffb84d"],borderColors:["#00dfb9","#ffb84d"]}),constructor:aw((a,r)=>{const o=Wl(a.symbol.time,r);if(!o)return[...wa];const u=o.close<o.open?1:0;return[o.open,o.high,o.low,o.close,u,u,u]})};return Promise.resolve([n,i])},Ro=(e,t)=>{if(t)try{e.removeEntity(t)}catch{}},ow=e=>({"predicted mask candle.color":e,"predicted mask candle.bordercolor":e,"predicted mask candle.wickcolor":e,"predicted bar.color.0":e,"predicted mask.color.0":e}),Kl=(e,t)=>{try{e.getSeries().sendToBack()}catch{}const n=t.generatedCandlesStudyIdRef.current;n&&e.bringToFront([n])},sw=e=>{try{e.getSeries().bringToFront()}catch{}},Jl=async(e,t,n="light")=>{Ro(e,t.generatedCandlesStudyIdRef.current),Ro(e,t.generatedCandlesBackgroundStudyIdRef.current),t.generatedCandlesStudyIdRef.current=null,t.generatedCandlesBackgroundStudyIdRef.current=null;const i=Ja(n),a=await e.createStudy(va,!0,!0,void 0,ow(i));a&&(t.generatedCandlesBackgroundStudyIdRef.current=a);const r=await e.createStudy(ba,!0,!0);r&&(t.generatedCandlesStudyIdRef.current=r),Kl(e,t)},Ki=(e,t,n)=>{const i={id:Ni,value:n};for(const a of[t.generatedCandlesBackgroundStudyIdRef,t.generatedCandlesStudyIdRef])if(a.current)try{e.getStudyById(a.current).setInputValues([i])}catch{}},lw=(e,t,n,i,a)=>{const r=t?.highlightBarsRef,o=Ye(d=>d.targetCandles),s=Ye(d=>d.gapCount),u=w.useRef(a),c=w.useRef(null);w.useEffect(()=>{let d=!1,l;const m=()=>{l&&(clearInterval(l),l=void 0)},f=v=>{if(!(!e||!t))try{Ki(e.activeChart(),t,v)}catch{}},p=(v,g,A=[])=>{if(!(!e||!a?.length)&&!(!v.length&&!A.length))try{const x=e.activeChart(),S=fs(n),L=ln(o[0].timestamp,n)/1e3-(jt*S+S*100);if(g>0&&v.length>0){const Z=di(v[g-1].time)/1e3+jt/3*S;x.setVisibleRange({from:L,to:Z});return}const H=v[v.length-1]??A[A.length-1],G=(H?di(H.time):ln(o[o.length-1].timestamp,n))/1e3+jt/3*S;x.setVisibleRange({from:L,to:G})}catch(x){console.error("Error setting visible range:",x)}},y=(v,g,A=[])=>{requestAnimationFrame(()=>{d||p(v,g,A)})},b=(v,g,A)=>new Promise(x=>{if(!v.length){x();return}let S=0,D=0;const L=()=>{m(),x()},H=()=>{if(d){L();return}if(S>=v.length){L();return}if(No(v[S])){S++,D=0,A?.(S),S>=v.length&&L();return}D++,D>200&&L()};H(),S<v.length&&!d&&(l=setInterval(H,Math.max(g,1)))}),P=async()=>{if(!(!e||!t?.generatedCandlesStudyIdRef||!t?.generatedCandlesBackgroundStudyIdRef))try{await new Promise(v=>{e.onChartReady(async()=>{try{await Jl(e.activeChart(),t,e.getTheme())}catch(g){console.error("Failed to recreate generated candle studies:",g)}v()})})}catch{}},k=(v,g)=>{d||(Pt(!1),c.current=a,r&&(r.current=v),p(v,v.length,g))},T=async(v,g=[])=>{if(!d&&(Pt(!0),Vi(v),r&&(r.current=[]),await P(),!d)){if(p(v,0,g),g.length>0){for(const A of g){if(d)return;No(A)}p(v,0,g)}if(await b(v,_d,A=>{f(A),y(v,A,g),r&&(r.current=v.slice(0,A))}),!d){if(e&&t)try{Kl(e.activeChart(),t)}catch{}k(v,g)}}};return(async()=>{if(!d){if(a?.length&&o.length>0){if(c.current===a)return;const g=[...a].slice(-50-(s||0)),A=_v(g,o[o.length-1],o),S=Tt.find(F=>F.ticker===i||F.display_name===i)?.session||"24x7",D=ln(o[o.length-1].timestamp,n),L=o[o.length-1].c,H=To(D,n,s||0,S),j=H.map(F=>({open:L,high:L,low:L,close:L,time:F})),G=To(s?H[H.length-1]:D,n,A.length,S),Z=[...A.map((F,W)=>({open:F.o,high:F.h,low:F.l,close:F.c,time:ln(G[W],n)}))].sort((F,W)=>F.time-W.time);try{e?.onChartReady(()=>{T(Z,j)})}catch{T(Z,j)}}else{if(Pt(!1),Vi([]),c.current=null,r&&(r.current=[]),e&&t)try{Ki(e.activeChart(),t,0)}catch{}try{e?.onChartReady(()=>{sw(e.activeChart())})}catch{}}u.current=a}})(),()=>{d=!0,m(),Pt(!1)}},[a,o,s,r,t,n,i,e]),w.useEffect(()=>{if(a===null&&(Vi([]),r&&(r.current=[]),e&&t))try{Ki(e.activeChart(),t,0)}catch{}},[t,e,r,a])},cw=(e,t)=>{if(t.current){try{const n=e?.activeChart?.();if(n)try{n.removeEntity(t.current)}catch{}}catch{}t.current=null}},uw=e=>{try{localStorage.removeItem(Cn)}catch{}try{const t=e?.activeChart?.();if(!t)return;t.clearMarks(2),t.refreshMarks()}catch{}},dw=(e,t)=>{try{localStorage.setItem(Cn,JSON.stringify(t))}catch{}try{e?.activeChart?.()?.refreshMarks()}catch{}},hw=async(e,t)=>{if(!(!e||!Number.isFinite(t)||t<=0))try{await e.headerReady();const n=e.activeChart(),i=Math.floor(t/1e3),a=n.getVisibleRange();let r;if(a?.from!=null&&a?.to!=null&&a.to>a.from)r=(a.to-a.from)/2;else{const o=mt(n.resolution());r=jt*o/2}await n.setVisibleRange({from:i-r,to:i+r}),await new Promise(o=>{let s=!1;const u=()=>{s||(s=!0,o())};n.onDataLoaded().subscribe(null,u,!0),setTimeout(u,300)})}catch(n){console.error("Error centering visible range on event",n)}},Xl=async(e,t,n)=>{if(!e||!Number.isFinite(t)||t<=0)return;await e?.headerReady();const i=e?.activeChart?.();if(i)try{if(n.current){try{i.removeEntity(n.current)}catch{}n.current=null}try{const a=mt(i.resolution()),r=Math.floor(t/1e3),o=r-r%a,s=await i.createShape({time:o},{shape:"vertical_line",lock:!0,disableSelection:!0,overrides:{linestyle:2,linewidth:1}});s&&(i.getShapeById(s)?.setSavingEnabled(!1),n.current=s)}catch{}}catch{}},pw=async(e,t)=>{if(!(!e||!Number.isFinite(t)||t<=0))try{await e.headerReady();const n=e.activeChart(),i=mt(n.resolution()),{data:a}=await n.exportData();if(!a?.length)return;const r=a[a.length-1][0],o=Math.floor(t/1e3);await n.setVisibleRange({from:r-jt*i,to:o+jt/3*i})}catch(n){console.error("Error expanding visible range for future event",n)}},Zl=async(e,t,n)=>{if(!e||!n||!Number.isFinite(t)||t<=0)return!1;try{await e.headerReady();const i=e.activeChart(),a=i.resolution(),r=mt(a),o=Math.floor(t/1e3),s=o-o%r,{data:u}=await i.exportData();if(!u?.length)return!1;const d=u[u.length-1][0],l=i.symbol(),m=Tt.find(y=>y.ticker===l||y.display_name===l)?.session||"24x7";if(n.clearSelectedCandles(),Ye.getState().setPlayEndTimestamp(null),Pt(!1),s>d){const y=ln(d,a),b=ln(s,a),P=Kv(y,b,a,m);Ye.getState().setGapCount(P);const k=u.slice(-50).map(T=>({o:T[1],h:T[2],l:T[3],c:T[4],timestamp:T[0]}));return k.length===0||n.setTargetCandles(k),!0}Ye.getState().setGapCount(0);let f=u.findIndex(y=>y[0]===s);if(f===-1){let y=Number.POSITIVE_INFINITY;for(let b=0;b<u.length;b++){const P=Math.abs(u[b][0]-s);P<y&&(y=P,f=b)}}if(f<0)return!1;const p=u.slice(Math.max(0,f-49),f+1).map(y=>({o:y[1],h:y[2],l:y[3],c:y[4],timestamp:y[0]}));return p.length===0||n.setTargetCandles(p),!1}catch(i){return console.error("Error preparing event target candles",i),!1}},hi=e=>{if(e)try{e.onChartReady(()=>{try{e.activeChart().resetData(),e.resetCache?.()}catch(t){console.error("Error resetting chart data",t)}})}catch(t){console.error("Error resetting chart data",t)}},Ji=(e,t)=>{t([]),Ye.getState().setPlayEndTimestamp(null),Pt(!1),hi(e)},Ql=(e,t)=>{if(e)try{const n=e.activeChart?.();if(!n)return;if(t.current){try{n.removeEntity(t.current)}catch{}t.current=null}n.getAllShapes().filter(a=>a.name==="date_range").forEach(a=>{try{n.removeEntity(a.id)}catch{}})}catch{}},mw=e=>ig[e]||e,fw=e=>{if(!e)return null;const t=Object.keys(e)[0],n=Number(t);return Number.isFinite(n)&&n>0?n:null},gw=async(e,t,n,i,a)=>{if(!e)return;const{end_timestamp:r,symbol:o,timeframe:s}=t,u=fw(a);if(!(!o||!s||!Number.isFinite(r)||r<=0||u==null))try{await e.headerReady();const c=mw(s),d=mt(c);i?.clearSelectedCandles(),Ye.getState().setPlayEndTimestamp(null),Pt(!1),i&&(i.applyingPatternRef.current=!0);try{await new Promise(A=>{e.setSymbol(o,c,()=>A())});const l=e.activeChart();Ql(e,n);const m=r-(u-1)*d;try{await l.setVisibleRange({from:m-(jt*d+d*u+d*100),to:r+jt/3*d})}catch(A){console.error("Error setting visible range for pattern",A)}const{data:f}=await l.exportData();let p=f.findIndex(A=>A[0]===r);p===-1&&(p=f.length-1);const y=Math.max(0,p-u+1),b=f.slice(y,p+1),P=b[0]?.[0]??r,k=b[b.length-1]?.[0]??r,T=t.pattern?.trim()||"",v=ia(),g=await l.createMultipointShape([{time:P},{time:k}],{...v,overrides:{...v.overrides,title:T||"Pattern range"}});if(g){const A=l.getShapeById(g);A&&(T&&A.setProperties({customText:{visible:!0,text:T,color:"#ffffff",fontsize:14,bold:!0}}),A.setSavingEnabled(!1)),n.current=g,i&&(i.lastEntity.current=g)}if(i&&b.length>0){const A=b.map(S=>({o:S[1],h:S[2],l:S[3],c:S[4],timestamp:S[0]})),x=A.slice(-50);i.setSymbol(o),i.setResolution(c),i.setTimeframe(c),i.setWindowSize(A.length),i.setCandles(A),i.setTargetCandles(x),i.setHasActiveShape(!0)}}finally{i&&setTimeout(()=>{i.applyingPatternRef.current=!1},600)}}catch(c){console.error("Error drawing pattern date range",c),i&&setTimeout(()=>{i.applyingPatternRef.current=!1},600)}};function yw(e,t,n,i,a,r,o){const s=w.useRef(n),u=w.useRef(e),c=w.useRef(t),d=w.useRef(i),l=w.useRef(a),m=w.useRef(r),f=w.useRef(o),p=w.useRef(null),y=w.useRef(null),b=w.useRef(null);w.useEffect(()=>{s.current=n},[n]),w.useEffect(()=>{u.current=e},[e]),w.useEffect(()=>{c.current=t},[t]),w.useEffect(()=>{d.current=i},[i]),w.useEffect(()=>{l.current=a},[a]),w.useEffect(()=>{m.current=r},[r]),w.useEffect(()=>{f.current=o},[o]),w.useEffect(()=>{const P=({origin:k,data:T})=>{if(k!==Jt)return;let v;try{v=typeof T=="string"?JSON.parse(T):T}catch{return}if(console.log("parsed",v),"type"in v&&v.type==="play-chart"){const A=v.payload.candles;c.current(A);const x=s.current;x!=null&&Number.isFinite(x)&&Ye.getState().setPlayEndTimestamp(x),A===null&&(Ye.getState().setPlayEndTimestamp(null),Pt(!1),hi(u.current))}else if("type"in v&&v.type==="close-result")c.current([]),Ye.getState().setPlayEndTimestamp(null),l.current?.();else if("type"in v&&v.type==="loading"){const g=v;d.current(g.payload)}else if("type"in v&&v.type==="sign-in-success"){const g=v;localStorage.setItem("iccandle_token",g.payload.id_token||"")}else if("action"in v&&v.action==="eventClicked"){const A=v.data?.event;if(!A?.timestamp)return;b.current=A.timestamp,dw(u.current,A),(async()=>(await Zl(u.current,A.timestamp,m.current)?await pw(u.current,A.timestamp):await hw(u.current,A.timestamp),await Xl(u.current,A.timestamp,p)))()}else if("action"in v&&v.action==="replay"){const g=v.data;if(!g)return;if(!g.isReplay){Ji(u.current,c.current);return}const A=(g.selectedCandles??[]).map(S=>({o:S.o,h:S.h,l:S.l,c:S.c,timestamp:S.timestamp}));if(A.length===0)return;c.current(A);const x=g.playEndTimestamp??(b.current!=null?Math.floor(b.current/1e3):s.current);x!=null&&Number.isFinite(x)&&Ye.getState().setPlayEndTimestamp(x)}else if("action"in v&&v.action==="back")cw(u.current,p),uw(u.current),Ji(u.current,c.current),b.current=null,Ye.getState().setGapCount(0),m.current?.setTargetCandles([]);else if("action"in v&&v.action==="back-to-similar-events")Ji(u.current,c.current);else if("type"in v&&(v.type==="pattern_selected"||v.type==="custom_pattern_selected")){console.log("pattern_selected",v);const g=v.pattern,A=g?.compared_pattern;if(!A)return;console.log("working 1",g),gw(u.current,A,y,m.current,g?.results?.matches_by_window)}else if("type"in v&&(v.type==="clear_pattern_selected"||v.type==="clear_custom_pattern_selected")){Ql(u.current,y);const g=m.current;g&&(g.lastEntity.current=null,g.setHasActiveShape(!1),g.setCandles([]),g.setTargetCandles([]))}else if("action"in v&&v.action==="nav-click"){const g=v.data;g?.href&&f.current?.(g.href)}};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[])}const bw=({patternName:e,onPatternNameChange:t,onNext:n,onCancel:i})=>{const{t:a}=At();return h.jsxs("div",{className:"iccandle-pattern-alert-name",children:[h.jsxs("div",{className:"iccandle-pattern-alert-name__header",children:[h.jsxs("div",{className:"iccandle-pattern-alert-name__title-row",children:[h.jsxs("h2",{className:"iccandle-pattern-alert-name__title",children:[h.jsx(gs,{size:20,className:"iccandle-pattern-alert-name__title-icon"}),a("Pattern.addToPatternTracker")]}),h.jsx("button",{type:"button",className:"iccandle-pattern-alert-name__close-btn",onClick:i,"aria-label":a("Common.close"),children:h.jsx(ys,{size:20})})]}),h.jsx("p",{className:"iccandle-pattern-alert-name__description",children:a("Pattern.addToPatternTrackerDescription")})]}),h.jsxs("div",{className:"iccandle-pattern-alert-name__content",children:[h.jsx(Kd,{size:64,className:"iccandle-pattern-alert-name__bell-icon"}),h.jsx("div",{className:"iccandle-pattern-alert-name__form",children:h.jsxs("div",{className:"iccandle-pattern-alert-name__field",children:[h.jsx("label",{htmlFor:"patternName",className:"iccandle-pattern-alert-name__label",children:a("Pattern.patternName")}),h.jsx("input",{id:"patternName",className:"iccandle-pattern-alert-name__input",placeholder:a("Pattern.patternNamePlaceholder"),value:e,maxLength:20,minLength:5,onChange:r=>t(r.target.value.slice(0,20))}),e.length===20&&h.jsx("p",{className:"iccandle-pattern-alert-name__error",children:a("Pattern.patternNameMaxChars")}),e.trim().length>0&&e.trim().length<5&&h.jsx("p",{className:"iccandle-pattern-alert-name__error",children:a("Pattern.patternNameMinChars")})]})})]}),h.jsxs("div",{className:"iccandle-pattern-alert-name__footer-wrap",children:[h.jsx("hr",{className:"iccandle-pattern-alert-name__divider"}),h.jsxs("div",{className:"iccandle-pattern-alert-name__footer",children:[h.jsx("button",{type:"button",className:"iccandle-pattern-alert-name__btn iccandle-pattern-alert-name__btn--outline",onClick:i,children:a("Common.cancel")}),h.jsx("button",{type:"submit",className:"iccandle-pattern-alert-name__btn iccandle-pattern-alert-name__btn--primary",onClick:n,disabled:e.trim().length<5,children:a("Common.next")})]})]})]})},vw=Qg;I.createContext({});I.createContext({});const ww=[{name:"All",value:"all"},{name:"Minutes",value:"minutes"},{name:"Hourly",value:"hourly"},{name:"Daily",value:"daily"}],$l=[{value:"M15",label:"M15",description:"15 Minutes",type:"minutes"},{value:"M30",label:"M30",description:"30 Minutes",type:"minutes"},{value:"H1",label:"H1",description:"1 Hour",type:"hourly"},{value:"H2",label:"H2",description:"2 Hours",type:"hourly"},{value:"H4",label:"H4",description:"4 Hours",type:"hourly"},{value:"D",label:"D",description:"Daily",type:"daily"}],xw={all:"Common.all",minutes:"Selector.timeframeTypeMinutes",hourly:"Common.hourly",daily:"Common.daily"},Pw=({searchTerm:e,onSearchChange:t,selectedType:n,onTypeChange:i,selectAll:a,onSelectAll:r,selectedTimeframes:o,onTimeframeChange:s,filteredTimeframes:u})=>{const{t:c}=At(),d=Object.values(o).filter(Boolean).length,l=u??$l,m=d<=1?c("Pattern.timeframeSelected",{count:d}):c("Pattern.timeframesSelected",{count:d}),f=(p,y)=>{const b=`Pattern.timeframeOptions.${p}.description`,P=c(b);return P===b?y:P};return h.jsxs("div",{className:"iccandle-scanner-timeframe-search",children:[h.jsxs("div",{className:"iccandle-scanner-timeframe-search__bar",children:[h.jsx(qo,{strokeWidth:.5,className:"iccandle-scanner-timeframe-search__search-icon"}),h.jsx("input",{className:"iccandle-scanner-timeframe-search__input",placeholder:c("Selector.searchTimeframe"),value:e,onChange:p=>t(p.target.value.toUpperCase())}),h.jsxs("span",{className:"iccandle-scanner-timeframe-search__count-badge",children:[h.jsx("span",{className:"iccandle-scanner-timeframe-search__count-desktop",children:m}),h.jsx("span",{className:"iccandle-scanner-timeframe-search__count-mobile",children:!d})]})]}),h.jsx("div",{className:"iccandle-scanner-timeframe-search__types-wrap",children:h.jsx("div",{className:"iccandle-scanner-timeframe-search__types-list",children:ww.map(p=>h.jsx("button",{type:"button",className:ft("iccandle-scanner-timeframe-search__type-badge",n===p.value?"iccandle-scanner-timeframe-search__type-badge--active":"iccandle-scanner-timeframe-search__type-badge--inactive"),onClick:()=>i(p.value),children:h.jsx("span",{className:ft("iccandle-scanner-timeframe-search__type-label",n===p.value?"iccandle-scanner-timeframe-search__type-label--active":"iccandle-scanner-timeframe-search__type-label--inactive"),children:c(xw[p.value]??"Common.all")})},p.value))})}),h.jsxs("div",{className:"iccandle-scanner-timeframe-search__table-wrap",children:[h.jsxs("div",{className:"iccandle-scanner-timeframe-search__table-head",children:[h.jsx("input",{type:"checkbox",className:"iccandle-scanner-timeframe-search__checkbox",checked:a,onChange:p=>r(p.target.checked),"aria-label":c("Selector.selectAllTimeframes")}),h.jsx("span",{className:"iccandle-scanner-timeframe-search__timeframe-title",children:c("Common.columnTimeframe")}),h.jsx("span",{className:"iccandle-scanner-timeframe-search__description-title",children:c("Common.columnDescription")})]}),h.jsxs("div",{className:"iccandle-scanner-timeframe-search__list-container",children:[h.jsx("ul",{className:"iccandle-scanner-timeframe-search__timeframe-list",children:l.map(p=>h.jsxs(w.Fragment,{children:[h.jsxs("li",{className:"iccandle-scanner-timeframe-search__timeframe-row",children:[h.jsx("input",{type:"checkbox",className:"iccandle-scanner-timeframe-search__checkbox iccandle-scanner-timeframe-search__checkbox--row",checked:!!o[p.value],onChange:y=>s(p.value,y.target.checked),"aria-label":c("Selector.selectTimeframeAria",{label:p.label})}),h.jsx("span",{className:"iccandle-scanner-timeframe-search__timeframe-name",children:p.label})]}),h.jsx("hr",{className:"iccandle-scanner-timeframe-search__row-divider"})]},p.value))}),h.jsx("ul",{className:"iccandle-scanner-timeframe-search__description-list",children:l.map(p=>h.jsxs(w.Fragment,{children:[h.jsx("li",{className:"iccandle-scanner-timeframe-search__description-row",children:h.jsx("span",{className:"iccandle-scanner-timeframe-search__description-text",children:f(p.value,p.description)})}),h.jsx("hr",{className:"iccandle-scanner-timeframe-search__row-divider"})]},p.value))})]})]})]})},Sw=({form:e})=>{const[t,n]=w.useState(""),[i,a]=w.useState("all"),r=e.watch("timeframes"),o=w.useMemo(()=>$l.filter(m=>{const f=m.label.toLowerCase().includes(t.toLowerCase())||m.description.toLowerCase().includes(t.toLowerCase()),p=i==="all"?!0:m.type===i;return f&&p}),[t,i]),s=w.useMemo(()=>r.reduce((m,f)=>(m[f]=!0,m),{}),[r]),u=o.length?o.every(m=>s[m.value]):!1,c=m=>{e.setValue("timeframes",Object.entries(m).filter(([,f])=>f).map(([f])=>f),{shouldDirty:!0})},d=m=>{const f={...s};o.forEach(p=>{f[p.value]=m}),c(f)},l=(m,f)=>{c({...s,[m]:f})};return h.jsx("div",{className:"iccandle-timeframes-tab",children:h.jsx(Pw,{searchTerm:t,onSearchChange:n,selectedType:i,onTypeChange:a,selectAll:u,onSelectAll:d,selectedTimeframes:s,onTimeframeChange:l,filteredTimeframes:o})})},Tw=({form:e})=>{const[t,n]=w.useState(""),[i,a]=w.useState("all"),r=e.watch("symbols"),o=w.useMemo(()=>r.reduce((m,f)=>(m[f.symbol]=!0,m),{}),[r]),s=Tt.filter(m=>{const f=m.display_name.toLowerCase().includes(t.toLowerCase()),p=i==="all"?!0:m.type===i;return f&&p}),u=s.length?s.every(m=>o[m.ticker]):!1,c=m=>{e.setValue("symbols",Object.entries(m).filter(([,f])=>f).map(([f])=>{const p=Tt.find(y=>y.ticker===f);return{symbol:f,type:p?.type??"forex"}}),{shouldDirty:!0})},d=m=>{const f={...o};s.forEach(p=>{f[p.ticker]=m}),c(f)},l=(m,f)=>{c({...o,[m]:f})};return h.jsx(Gl,{searchTerm:t,onSearchChange:n,selectedType:i,onTypeChange:a,selectAll:u,onSelectAll:d,selectedSymbols:o,onSymbolChange:l,filteredSymbols:s})},Xa=[{value:"new_york",label:"New York Session",timezone:"America/New_York",start:"09:30",end:"16:00"},{value:"london",label:"London Session",timezone:"Europe/London",start:"08:00",end:"16:30"},{value:"tokyo",label:"Tokyo Session",timezone:"Asia/Tokyo",start:"09:00",end:"18:00"},{value:"sydney",label:"Sydney Session",timezone:"Australia/Sydney",start:"09:00",end:"18:00"}],Eo=[{value:"all_time",label:"All time"},...Xa.map(e=>({value:e.value,label:e.label})),{value:"customize",label:"Customize"}],kw=e=>{const t=e.match(/GMT([+-])(\d{1,2})(?::?(\d{2}))?/);if(!t)return 0;const n=t[1]==="-"?-1:1,i=Number(t[2]),a=Number(t[3]??"0");return n*(i*60+a)},Oo=(e,t)=>{const i=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"shortOffset",hour:"2-digit"}).formatToParts(e).find(a=>a.type==="timeZoneName")?.value??"GMT+0";return kw(i)},Mo=(e,t,n)=>{const[i,a]=e.split(":").map(Number),r=new Date,o=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),i,a,0),s=Oo(new Date(o),t);let u=o-s*6e4;const c=Oo(new Date(u),t);return u=o-c*6e4,new Intl.DateTimeFormat("en-GB",{timeZone:n,hour12:!1,hour:"2-digit",minute:"2-digit"}).format(new Date(u))},pi=(e,t)=>{const n=Xa.find(i=>i.value===e);return n?{start_time:Mo(n.start,n.timezone,t),end_time:Mo(n.end,n.timezone,t),timezone:t}:null},Cw=(e,t)=>{if(!e)return"all_time";const n=e.timezone||t,i=!!(e.start_time&&e.end_time);if(e.preset_session){if(e.preset_session==="all_time")return"all_time";if(e.preset_session==="customize")return"customize";const r=pi(e.preset_session,n);if(r&&r.start_time===e.start_time&&r.end_time===e.end_time)return e.preset_session}if(!i)return"customize";const a=Xa.find(r=>{const o=pi(r.value,n);return o&&o.start_time===e.start_time&&o.end_time===e.end_time});return a?a.value:"customize"},Aw=e=>{const t=Intl,n=typeof t.supportedValuesOf=="function"?t.supportedValuesOf("timeZone")??[]:[],i=e||"UTC";return(n.length?n:[i]).filter(Boolean)},Nw={all_time:"TimeConfig.allTime",new_york:"TimeConfig.newYorkSession",london:"TimeConfig.londonSession",tokyo:"TimeConfig.tokyoSession",sydney:"TimeConfig.sydneySession",customize:"TimeConfig.customize"},Dw=(e,t)=>{const n=t.trim().toLowerCase();return n?e.filter(i=>i.toLowerCase().includes(n)):e},Rw=({timeconfig:e,onTimeConfigChange:t,containerClassName:n=""})=>{const{t:i}=At(),[a,r]=w.useState(!1),[o,s]=w.useState(!1),[u,c]=w.useState(""),[d,l]=w.useState(""),m=w.useRef(null),f=w.useRef(null),p=Intl.DateTimeFormat().resolvedOptions().timeZone,y=w.useMemo(()=>Cw(e,p),[e,p]),b=D=>i(Nw[D]),P=e?.timezone?.trim()||p||"UTC",k=y==="all_time"?i("TimeConfig.yourTimezone"):P,T=w.useMemo(()=>Aw(p),[p]),v=w.useMemo(()=>{const D=u.trim().toLowerCase();return D?Eo.filter(L=>b(L.value).toLowerCase().includes(D)||L.value.toLowerCase().includes(D)):Eo},[u,i]),g=w.useMemo(()=>Dw(T,d),[T,d]),A=(D,L)=>{t({...e||{timezone:p},[D]:L,preset_session:"customize"},{shouldDirty:!0})},x=D=>{if(s(!1),c(""),D==="all_time"){e&&t(void 0,{shouldDirty:!0}),r(!1);return}if(D==="customize"){e?e.preset_session!=="customize"&&t({...e,preset_session:"customize"},{shouldDirty:!0}):t({start_time:"08:00",end_time:"23:00",timezone:p,preset_session:"customize"},{shouldDirty:!0});return}const L=pi(D,e?.timezone||p);L&&t({...L,preset_session:D},{shouldDirty:!0})};w.useEffect(()=>{!e||y==="all_time"||e.timezone||t({...e,timezone:p},{shouldDirty:!1})},[e,y,t,p]),w.useEffect(()=>{if(!o&&!a)return;const D=L=>{const H=L.target;o&&m.current&&!m.current.contains(H)&&(s(!1),c("")),a&&f.current&&!f.current.contains(H)&&(r(!1),l(""))};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[o,a]);const S=D=>{if(y!=="customize")return;const L=D.currentTarget;try{L.showPicker?.()}catch{}};return h.jsxs("div",{className:`iccandle-time-config-section ${n}`.trim(),children:[h.jsxs("div",{className:"iccandle-time-config-section__header",children:[h.jsx("h3",{className:"iccandle-time-config-section__title",children:i("TimeConfig.title")}),h.jsx("p",{className:"iccandle-time-config-section__description",children:i("TimeConfig.description")})]}),h.jsxs("div",{className:"iccandle-time-config-section__fields",children:[h.jsxs("div",{className:"iccandle-time-config-section__field",children:[h.jsx("label",{className:"iccandle-time-config-section__label",children:i("TimeConfig.startTime")}),h.jsx("input",{type:"time",disabled:y!=="customize",value:e?.start_time??"",onChange:D=>A("start_time",D.target.value),onClick:S,className:"iccandle-time-config-section__input"})]}),h.jsxs("div",{className:"iccandle-time-config-section__field",children:[h.jsx("label",{className:"iccandle-time-config-section__label",children:i("TimeConfig.endTime")}),h.jsx("input",{type:"time",disabled:y!=="customize",value:e?.end_time??"",onChange:D=>A("end_time",D.target.value),onClick:S,className:"iccandle-time-config-section__input"})]}),h.jsxs("div",{className:"iccandle-time-config-section__field",children:[h.jsx("label",{className:"iccandle-time-config-section__label",children:i("TimeConfig.session")}),h.jsxs("div",{className:`iccandle-time-config-section__select-wrap${o?" iccandle-time-config-section__select-wrap--open":""}`,ref:m,children:[h.jsx("button",{type:"button",className:"iccandle-time-config-section__select-btn",onClick:()=>s(D=>{const L=!D;return L?(r(!1),l("")):c(""),L}),children:h.jsx("span",{className:"iccandle-time-config-section__select-label",children:b(y)||i("TimeConfig.selectSession")})}),o&&h.jsxs("div",{className:"iccandle-time-config-section__dropdown",children:[h.jsx("div",{className:"iccandle-time-config-section__dropdown-search",children:h.jsx("input",{type:"text",className:"iccandle-time-config-section__dropdown-search-input",placeholder:i("TimeConfig.searchSession"),value:u,onChange:D=>c(D.target.value),autoFocus:!0})}),h.jsxs("ul",{className:"iccandle-time-config-section__dropdown-list",role:"listbox",children:[h.jsx("li",{className:"iccandle-time-config-section__dropdown-group-label","aria-hidden":"true",children:i("TimeConfig.sessionsHeading")}),v.length===0?h.jsx("li",{className:"iccandle-time-config-section__dropdown-empty",children:i("TimeConfig.noSessionFound")}):v.map(D=>h.jsx("li",{children:h.jsxs("button",{type:"button",role:"option","aria-selected":y===D.value,className:`iccandle-time-config-section__dropdown-item${y===D.value?" iccandle-time-config-section__dropdown-item--selected":""}`,onClick:()=>x(D.value),children:[h.jsx(Pr,{className:`iccandle-time-config-section__check${y===D.value?" iccandle-time-config-section__check--visible":""}`}),b(D.value)]})},D.value))]})]})]})]})]}),h.jsxs("div",{className:"iccandle-time-config-section__timezone",children:[h.jsx("label",{className:"iccandle-time-config-section__label",children:i("TimeConfig.timezone")}),h.jsxs("div",{className:`iccandle-time-config-section__select-wrap${a?" iccandle-time-config-section__select-wrap--open":""}`,ref:f,children:[h.jsx("button",{type:"button",className:"iccandle-time-config-section__select-btn",disabled:y==="all_time",onClick:()=>r(D=>{const L=!D;return L?(s(!1),c("")):l(""),L}),children:h.jsx("span",{className:"iccandle-time-config-section__select-label",children:k})}),a&&h.jsxs("div",{className:"iccandle-time-config-section__dropdown",children:[h.jsxs("div",{className:"iccandle-time-config-section__dropdown-header",children:[h.jsx("p",{className:"iccandle-time-config-section__dropdown-title",children:i("TimeConfig.selectTimezone")}),h.jsx("p",{className:"iccandle-time-config-section__dropdown-subtitle",children:i("TimeConfig.selectTimezoneHint")})]}),h.jsx("div",{className:"iccandle-time-config-section__dropdown-search",children:h.jsx("input",{type:"text",className:"iccandle-time-config-section__dropdown-search-input",placeholder:i("TimeConfig.searchTimezone"),value:d,onChange:D=>l(D.target.value),autoFocus:!0})}),h.jsxs("ul",{className:"iccandle-time-config-section__dropdown-list",role:"listbox",children:[h.jsx("li",{className:"iccandle-time-config-section__dropdown-group-label","aria-hidden":"true",children:i("TimeConfig.timezonesHeading")}),g.length===0?h.jsx("li",{className:"iccandle-time-config-section__dropdown-empty",children:i("TimeConfig.noTimezoneFound")}):g.map(D=>h.jsx("li",{children:h.jsxs("button",{type:"button",role:"option","aria-selected":P===D,className:`iccandle-time-config-section__dropdown-item${P===D?" iccandle-time-config-section__dropdown-item--selected":""}`,onClick:()=>{const L=D;if(y!=="all_time"&&y!=="customize"){const H=pi(y,L);H&&t({...H,preset_session:y},{shouldDirty:!0})}else t({...e||{},timezone:L},{shouldDirty:!0});r(!1),l("")},children:[h.jsx(Pr,{className:`iccandle-time-config-section__check${P===D?" iccandle-time-config-section__check--visible":""}`}),D]})},D))]})]})]})]})]})},Ew=({form:e,onBack:t,onCancel:n,onSubscribe:i,isSubscribing:a,errorMessage:r,formRef:o})=>{const{t:s}=At(),[u,c]=w.useState(1),[d,l]=w.useState("timeframes"),m=Qn({control:e.control,name:"timeframes"}),f=Qn({control:e.control,name:"symbols"}),p=Qn({control:e.control,name:"timeconfig"}),y=u===1?e.formState.errors.timeframes?.message:u===2?e.formState.errors.symbols?.message:r;w.useEffect(()=>{(m?.length??0)>0&&e.clearErrors("timeframes")},[m,e]),w.useEffect(()=>{(f?.length??0)>0&&e.clearErrors("symbols")},[f,e]);const b=k=>{if(k.preventDefault(),u===1){if(!e.getValues("timeframes")?.length){e.setError("timeframes",{type:"manual",message:s("Pattern.signalDialog.selectOneTimeframe")}),setTimeout(()=>{e.clearErrors("timeframes")},1800);return}e.clearErrors("timeframes"),c(2),l("symbols");return}if(u===2){if(!e.getValues("symbols")?.length){e.setError("symbols",{type:"manual",message:s("Pattern.signalDialog.selectOneSymbol")}),setTimeout(()=>{e.clearErrors("symbols")},1800);return}e.clearErrors("symbols"),c(3),l("timeconfig");return}i()},P=k=>{const T=k;l(T),c(T==="timeframes"?1:T==="symbols"?2:3)};return h.jsxs("div",{className:"iccandle-pattern-alert-settings",children:[h.jsxs("div",{className:"iccandle-pattern-alert-settings__header-row",children:[h.jsx(gs,{size:20,className:"iccandle-pattern-alert-settings__header-icon"}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__header",children:[h.jsxs("div",{className:"iccandle-pattern-alert-settings__title-row",children:[h.jsx("h2",{className:"iccandle-pattern-alert-settings__title",children:h.jsx("span",{className:"iccandle-pattern-alert-settings__title-text",children:s("Pattern.configurePatternTracker")})}),h.jsx("button",{type:"button",className:"iccandle-pattern-alert-settings__close-btn",onClick:n,"aria-label":s("Common.close"),children:h.jsx(ys,{size:16})})]}),h.jsx("p",{className:"iccandle-pattern-alert-settings__description",children:s("Pattern.selectTimeframesAndSymbols")})]})]}),h.jsx(vw,{...e,children:h.jsx("form",{ref:o,onSubmit:b,className:"iccandle-pattern-alert-settings__form",id:"pattern-alert-settings-form",children:h.jsxs("div",{className:"iccandle-pattern-alert-settings__tabs",children:[h.jsxs("div",{role:"tablist",className:"iccandle-pattern-alert-settings__tabs-list",children:[h.jsxs("button",{type:"button",role:"tab","aria-selected":d==="timeframes","data-state":d==="timeframes"?"active":"inactive",disabled:u!==1,className:"iccandle-pattern-alert-settings__tab-trigger",onClick:()=>P("timeframes"),children:[h.jsxs("span",{className:"iccandle-pattern-alert-settings__tab-label--mobile",children:["1. ",s("Common.timeframes")]}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__tab-label--desktop",children:[h.jsx("span",{className:"iccandle-pattern-alert-settings__tab-step",children:s("Common.step",{number:1})}),h.jsx("span",{children:s("Common.timeframes")})]})]}),h.jsxs("button",{type:"button",role:"tab","aria-selected":d==="symbols","data-state":d==="symbols"?"active":"inactive",disabled:u!==2,className:"iccandle-pattern-alert-settings__tab-trigger",onClick:()=>P("symbols"),children:[h.jsxs("span",{className:"iccandle-pattern-alert-settings__tab-label--mobile",children:["2. ",s("Common.symbols")]}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__tab-label--desktop",children:[h.jsx("span",{className:"iccandle-pattern-alert-settings__tab-step",children:s("Common.step",{number:2})}),h.jsx("span",{children:s("Common.symbols")})]})]}),h.jsxs("button",{type:"button",role:"tab","aria-selected":d==="timeconfig","data-state":d==="timeconfig"?"active":"inactive",disabled:u!==3,className:"iccandle-pattern-alert-settings__tab-trigger",onClick:()=>P("timeconfig"),children:[h.jsxs("span",{className:"iccandle-pattern-alert-settings__tab-label--mobile",children:["3. ",s("Pattern.tabTimeShort")]}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__tab-label--desktop",children:[h.jsx("span",{className:"iccandle-pattern-alert-settings__tab-step",children:s("Common.step",{number:3})}),h.jsx("span",{children:s("Common.timeSettings")})]})]})]}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__tabs-content-wrap",children:[d==="timeframes"&&h.jsx("div",{role:"tabpanel",className:"iccandle-pattern-alert-settings__tab-content",children:h.jsx(Sw,{form:e})}),d==="symbols"&&h.jsx("div",{role:"tabpanel",className:"iccandle-pattern-alert-settings__tab-content",children:h.jsx(Tw,{form:e})}),d==="timeconfig"&&h.jsx("div",{role:"tabpanel",className:"iccandle-pattern-alert-settings__tab-content",children:h.jsx(Rw,{timeconfig:p,onTimeConfigChange:(k,T)=>{e.setValue("timeconfig",k,{shouldDirty:T?.shouldDirty??!0,shouldValidate:!1})},containerClassName:"iccandle-pattern-alert-settings__time-config"})})]})]})})}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__footer",children:[h.jsx("p",{className:`iccandle-pattern-alert-settings__error${y?" iccandle-pattern-alert-settings__error--visible":""}`,children:y}),h.jsxs("div",{className:"iccandle-pattern-alert-settings__actions",children:[h.jsx("button",{type:"button",className:"iccandle-pattern-alert-settings__btn iccandle-pattern-alert-settings__btn--outline",onClick:()=>{u===3?(c(2),l("symbols")):u===2?(c(1),l("timeframes")):t()},children:u>1?s("Common.previous"):s("Common.back")}),h.jsx("button",{type:"submit",form:"pattern-alert-settings-form",className:"iccandle-pattern-alert-settings__btn iccandle-pattern-alert-settings__btn--primary",disabled:a,children:a?s("Pattern.subscribing"):u<3?s("Common.nextStep"):s("Pattern.subscribe")})]})]})]})};async function Ow(e){const{data:t}=await Oe.post("https://api.iccandle.ai/custom-pattern/v1/searchless",e,{headers:{Authorization:`Bearer ${localStorage.getItem("iccandle_token")}`}});return t}const ec=e=>{if(typeof e=="string")return e;if(typeof e!="object"||e===null)return jr;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=ec(e[t]);if(n)return n}return jr},Mw=e=>qd(e)?ec(e.response?.data):e.message,Iw=({open:e,onOpenChange:t,resolution:n,type:i,symbol:a,candles:r,percent:o,theme:s="light",themeStyle:u})=>{const{t:c}=At(),[d,l]=w.useState(""),[m,f]=w.useState(!1),[p,y]=w.useState(null),[b,P]=w.useState(!1),k=w.useRef(null),T=Ks({defaultValues:{timeframes:[],symbols:[]}});w.useEffect(()=>{e&&(l(""),f(!1),y(null),P(!1),T.reset({timeframes:[],symbols:[]}))},[e,T]);const v=w.useCallback(()=>{d.trim().length<5||f(!0)},[d]);w.useEffect(()=>{if(!e)return;const x=S=>{if(S.key==="Escape"){t(!1);return}S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),m?k.current?.requestSubmit():v())};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[e,m,v,t]);const g=async()=>{const{symbols:x,timeframes:S,timeconfig:D}=T.getValues();if(!x.length||!S.length){y(c("Pattern.signalDialog.selectOneTimeframeAndSymbol")),setTimeout(()=>{y(null)},1500);return}if(!r.length){y(c("Pattern.noPatternCandles")),setTimeout(()=>{y(null)},1500);return}if(!a.trim()){y(c("Pattern.chartSymbolRequired")),setTimeout(()=>{y(null)},1500);return}const L=D&&(D.start_time||D.end_time||D.timezone)?{start_time:D.start_time,end_time:D.end_time,timezone:D.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone}:void 0,H={resolution:n,type:i,symbol:a,candles:r,custom_name:d.trim(),filter:{symbols:x,timeframes:S,timeconfig:L},percent:o};P(!0);try{await Ow(H),ta({title:c("Pattern.patternSubscribed"),description:c("Pattern.patternSubscribedDesc",{name:d}),variant:"success"}),t(!1)}catch(j){const G=Mw(j);y(G),ta({title:c("Pattern.patternSubscriptionError"),description:G,variant:"error"}),setTimeout(()=>{y(null)},3e3)}finally{P(!1)}},A=()=>{f(!1)};return e?h.jsx("div",{className:ft("iccandle-pattern-tracker-modal","iccandle-selector-widget",s==="dark"&&"iccandle-dark"),role:"dialog","aria-modal":"true","aria-label":c("Pattern.subscriptionModalAria"),onPointerDown:x=>{x.target===x.currentTarget&&t(!1)},children:h.jsx("div",{className:ft("iccandle-pattern-tracker-modal__content",m&&"iccandle-pattern-tracker-modal__content--settings"),style:{...u,height:m?"100%":void 0},onPointerDown:x=>x.stopPropagation(),children:m?h.jsx(Ew,{form:T,onBack:A,onCancel:()=>t(!1),onSubscribe:g,isSubscribing:b,errorMessage:p,formRef:k}):h.jsx(bw,{patternName:d,onPatternNameChange:l,onNext:v,onCancel:()=>t(!1)})})}):null},Io=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Lo=Ps,Lw=(e,t)=>n=>{var i;if(t?.variants==null)return Lo(e,n?.class,n?.className);const{variants:a,defaultVariants:r}=t,o=Object.keys(a).map(c=>{const d=n?.[c],l=r?.[c];if(d===null)return null;const m=Io(d)||Io(l);return a[c][m]}),s=n&&Object.entries(n).reduce((c,d)=>{let[l,m]=d;return m===void 0||(c[l]=m),c},{}),u=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((c,d)=>{let{class:l,className:m,...f}=d;return Object.entries(f).every(p=>{let[y,b]=p;return Array.isArray(b)?b.includes({...r,...s}[y]):{...r,...s}[y]===b})?[...c,l,m]:c},[]);return Lo(e,o,u,n?.class,n?.className)},Fw=Lw("inline-flex items-center text-theme-color cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-[#00dfb9]/10 border-[0.1px] border-[#00dfb9]/50",warning:"bg-amber-500/15 border-[0.1px] border-amber-500/60 text-amber-500 hover:bg-amber-500/25",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});function Fo({className:e,variant:t="default",size:n="default",asChild:i=!1,...a}){const r=i?my:"button";return h.jsx(r,{"data-slot":"button","data-variant":t,"data-size":n,className:ft(Fw({variant:t,size:n,className:e})),...a})}function Gw(e,t){try{return new Intl.DateTimeFormat(t,{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return new Date(e).toLocaleString()}}function Bw({event:e,symbol:t,onClose:n,onGoToEventDetail:i,position:a}){const{t:r,language:o}=At(),s=w.useId(),u=w.useId(),c=w.useRef(null),d=w.useRef(null);w.useEffect(()=>(d.current=document.activeElement,c.current?.focus(),()=>{d.current?.focus?.()}),[]);const l=()=>{const m=e.default_symbol||t;localStorage.setItem("currentSymbolNews",m),i?.(e),n()};return h.jsx("div",{className:"iccandle-event-info-modal",onClick:n,role:"presentation",children:h.jsxs("div",{className:"iccandle-event-info-modal__dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":u,style:a?{left:`${a.x}px`,top:`${a.y}px`,transform:"translate(-50%, -100%)"}:{bottom:"100px",left:"50%",transform:"translateX(-50%)"},onClick:m=>m.stopPropagation(),onKeyDown:m=>{m.key==="Escape"&&n()},children:[h.jsxs("div",{className:"iccandle-event-info-modal__header",children:[h.jsxs("div",{className:"iccandle-event-info-modal__title-row",children:[h.jsx(Fl,{name:e.default_symbol||t||""}),h.jsx("h3",{id:s,className:"iccandle-event-info-modal__title",children:e.event_name})]}),h.jsx("button",{type:"button",onClick:n,className:"iccandle-event-info-modal__close","aria-label":r("Common.close"),ref:c,children:h.jsx(_o,{size:20})})]}),h.jsxs("div",{id:u,children:[e.timestamp?h.jsx("p",{className:"iccandle-event-info-modal__date",children:Gw(e.timestamp,o)}):null,h.jsxs("div",{className:"iccandle-event-info-modal__rows",children:[h.jsxs("div",{className:"iccandle-event-info-modal__row",children:[h.jsxs("span",{className:"iccandle-event-info-modal__label",children:[r("Common.actual"),":"]}),h.jsx("span",{className:"iccandle-event-info-modal__value",children:e.actual||"-"})]}),h.jsxs("div",{className:"iccandle-event-info-modal__row",children:[h.jsxs("span",{className:"iccandle-event-info-modal__label",children:[r("News.previousActual"),":"]}),h.jsx("span",{className:"iccandle-event-info-modal__value",children:e.previous||"-"})]}),h.jsxs("div",{className:"iccandle-event-info-modal__row",children:[h.jsxs("span",{className:"iccandle-event-info-modal__label",children:[r("News.currentForecast"),":"]}),h.jsx("span",{className:"iccandle-event-info-modal__value",children:e.forecast||"-"})]}),h.jsxs("div",{className:"iccandle-event-info-modal__row",children:[h.jsxs("span",{className:"iccandle-event-info-modal__label",children:[r("News.previousForecast"),":"]}),h.jsx("span",{className:"iccandle-event-info-modal__value",children:"-"})]})]})]}),h.jsxs("div",{className:"iccandle-event-info-modal__actions",children:[h.jsx(Fo,{variant:"outline",onClick:n,className:"iccandle-event-info-modal__btn",children:r("Common.close")}),h.jsx(Fo,{onClick:l,className:"iccandle-event-info-modal__btn",children:r("News.goToEventDetail")})]})]})})}function jw({language:e,children:t}){const n=w.useMemo(()=>{const i=bs(e);return{language:i,t:(a,r)=>vs(i,a,r)}},[e]);return h.jsx(ws.Provider,{value:n,children:t})}function Uw(e){try{const t=JSON.parse(localStorage.getItem(Cn)||"null");if(t&&String(t.id)===String(e))return t}catch{}try{return JSON.parse(localStorage.getItem(ni)||"[]").find(n=>String(n.id)===String(e))??null}catch{return null}}function zw(e){return!(!e?.event_name||!e.currency||e.event_name==="Holiday"||e.status==="early")}const Yw=w.memo(function({src:t,iframeRef:n,onLoad:i}){return h.jsx("iframe",{ref:n,src:t,onLoad:i,className:"iccandle-selector-widget__iframe",title:"ICCandle results"})}),Hw=({chartWidget:e,children:t,theme:n,language:i,onCloseResult:a,iframeLoaded:r})=>{const[o,s]=w.useState(Jt+"/"+i+"?theme="+n),u=w.useRef(null),c=w.useCallback(re=>{s(Te=>Te===re?Te:re)},[]),d=w.useCallback(()=>{const re=u.current?.contentWindow;if(!re)return;if(re.postMessage(JSON.stringify({type:"parent-origin",origin:window.location.origin}),Jt),new URLSearchParams(window.location.search).get("payment")==="success"){const Ue=()=>re.postMessage(JSON.stringify({type:"payment-success"}),Jt);[0,600,1500].forEach(Be=>window.setTimeout(Ue,Be));const de=new URL(window.location.href);["payment","session_id","lookup_key"].forEach(Be=>de.searchParams.delete(Be)),window.history.replaceState({},"",de)}},[]),l=w.useMemo(()=>bs(i),[i]),m=w.useMemo(()=>({highlightBarsRef:{current:[]},generatedCandlesBackgroundStudyIdRef:{current:null},generatedCandlesStudyIdRef:{current:null}}),[]),f=typeof t=="function"?t(m):t,p=w.useRef(null),y=w.useRef(null),b=w.useRef(!1),P=w.useRef(null),k=w.useRef([]),T=w.useRef(null),v=Ye(re=>re.setTargetCandles),[g,A]=w.useState(!1),[x,S]=w.useState(!1),[D,L]=w.useState(null),[H,j]=w.useState(null),[G,q]=w.useState(null),Z=w.useCallback(()=>T.current&&getComputedStyle(T.current).getPropertyValue("--iccandle-primary").trim()||void 0,[]),F=w.useRef(Z);w.useEffect(()=>{F.current=Z},[Z]);const W=w.useMemo(()=>n==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n,[n]),[Q,se]=w.useState(!1),[E,N]=w.useState(!1),[z,B]=w.useState(!1),[U,_]=w.useState(Ui),[X,J]=w.useState([]),[$,ne]=w.useState(!1),[le,pe]=w.useState("60"),[V,xe]=w.useState(ng.interval),[Ee,st]=w.useState(""),[qt,Dt]=w.useState(!0),nn=w.useCallback(re=>{Dt(re!=="/news"),G?.length&&(Ye.getState().setPlayEndTimestamp(null),Ye.getState().setGapCount(0),q(null),Pt(!1),hi(e))},[e,G]),lt=w.useCallback(()=>N(!0),[]),an=w.useCallback(()=>N(!1),[]),C=w.useCallback(()=>{Ye.getState().setPlayEndTimestamp(null),Ye.getState().setGapCount(0);const re=!!G?.length;q(null),Pt(!1),re&&hi(e),P.current?.()},[e,G]),R=w.useCallback(()=>ne(!0),[]),M=w.useCallback(()=>ne(!1),[]),ee=w.useCallback(()=>{S(!1),L(null),j(null)},[]),K=w.useCallback(re=>{const Te=re.default_symbol||Ee,Ue=W==="dark"?"dark":"light";try{const Be=e?.activeChart?.();if(Be){if(p.current){try{Be.removeEntity(p.current)}catch{}p.current=null}Be.getAllShapes().filter(Xe=>Xe.name==="date_range").forEach(Xe=>{try{Be.removeEntity(Xe.id)}catch{}})}}catch{}B(!1),q(null),Ye.getState().setPlayEndTimestamp(null);const de={id:re.id,event_name:re.event_name,timestamp:re.timestamp,actual:re.actual||"",forecast:re.forecast||"",previous:re.previous||"",currency:re.currency||"",metric:"",default_symbol:re.default_symbol,status:re.status};try{localStorage.setItem(Cn,JSON.stringify(de))}catch{}try{e?.activeChart?.()?.refreshMarks()}catch{}(async()=>(await Zl(e,re.timestamp,{lastEntity:p,applyingPatternRef:b,setHasActiveShape:B,setCandles:J,setWindowSize:_,setSymbol:st,setResolution:xe,setTimeframe:pe,setTargetCandles:v,clearSelectedCandles:()=>q(null)}),await Xl(e,re.timestamp,y)))(),c(`${Jt}/${l}/news/similar-events/${re.id}?symbol=${encodeURIComponent(Te)}&theme=${Ue}`)},[e,l,W,v,c,Ee]),Y=w.useCallback(re=>{if(!re||!e)return;let Te;try{Te=e.activeChart()}catch(Pe){console.log("Error getting active chart",Pe);return}if(!Te)return;const Ue=Te.getTimeScale(),de=Te.getVisibleRange();if(!de?.from||!de?.to)return;const Be=T.current?.firstElementChild||T.current;if(!Be)return;const Xe=Be.getBoundingClientRect(),ze=Ue.width(),gn=Pe=>{let ke=0,De=ze,be=ze/2;const Me=.1;for(let Ve=0;Ve<30;Ve++){const Qe=(ke+De)/2,ut=Ue.coordinateToTime(Qe);if(ut===null){const tc=(Pe-de.from)/(de.to-de.from);be=Math.max(0,Math.min(ze,tc*ze));break}const Se=ut-Pe;if(Math.abs(Se)<Me){be=Qe;break}Se>0?De=Qe:ke=Qe,be=Qe}const We=Xe.left+be+53,ye=Xe.bottom-103;return{x:We,y:ye}},Ne=Uw(re);if(!zw(Ne))return;const Ze=Ne.timestamp?Ne.timestamp/1e3:null,_e=de.to-de.from,ce=Ze??de.from+_e*.5,ge=gn(ce);ge&&j(ge),L(Ne),S(!0)},[e]),oe=w.useCallback(()=>{se(!0)},[]),me=w.useCallback(()=>{b.current||(p.current=null,B(!1))},[]),fe=w.useCallback(re=>{pe(re==="1"||re==="5"?"60":re),xe(re),me()},[me]),Ce=w.useCallback(re=>{st(re.library_custom_fields?.ticker||re.ticker||re.name||re.base_name+""||""),me()},[me]);w.useEffect(()=>{let re,Te,Ue;return e&&e.onChartReady(()=>{const de=e.activeChart();if(de){const Be=de.resolution(),Xe=Tt?.find(Ne=>Ne.display_name===de.symbol());pe(Be),xe(Be),st(Xe?.ticker||de.symbol());const ze=async(Ne,Ze)=>{if(de?.getAllShapes()?.filter(ge=>ge.name==="date_range")?.forEach(ge=>{de?.removeEntity(ge.id)}),Ze){const{data:ge}=await de.exportData();let Pe=ge.findIndex(ye=>ye[0]===Ze);Pe===-1&&(Pe=ge.length-1);const ke=ge.findIndex(ye=>ye[0]===Ne),De=Math.floor((ke+Pe)/2),be=Math.floor(Ui/2),Me=ge.slice(De-(be+1),De+be),We=ge.slice(De+be-49,De+be);if(_(Me.length),J(Me.map(ye=>({o:ye[1],h:ye[2],l:ye[3],c:ye[4],timestamp:ye[0]}))),v(We.map(ye=>({o:ye[1],h:ye[2],l:ye[3],c:ye[4],timestamp:ye[0]}))),B(!0),p.current=await de.createMultipointShape([{time:Me[0][0]},{time:Me[Me.length-1][0]}],ia(F.current())),p.current){const ye=de.getShapeById(p.current);ye&&ye.setSavingEnabled&&(ye.setProperties({customText:{visible:!0,text:Hr}}),ye.setSavingEnabled(!1))}}};re=Vg(async(Ne,Ze)=>{if(!b.current&&(Ze==="remove"&&(p.current===Ne&&(p.current=null),B(!1)),Ze==="points_changed"&&de.getAllShapes().filter(_e=>_e.name==="date_range").some(_e=>_e.id===Ne)&&e)){const _e=de.getShapeById(Ne);if(!_e)return;const ce=_e.getPoints(),ge=ce[0].time,Pe=ce[1].time,{data:ke}=await de.exportData();let De=ke.findIndex(Se=>Se[0]===Pe),be=ke.findIndex(Se=>Se[0]===ge);De===-1&&(De=ke.length-2,be=ke.length-1-Ui);let We=ke.slice(be,De+1).length-1;We>Vt.max?(We=Math.round(We/10)*10-1,We>Vt.custom[Vt.custom.length-1]&&(We=Vt.custom[Vt.custom.length-1]-1)):We<=Vt.min&&(We=Vt.min-1),p.current&&de.removeEntity(p.current),de.getAllShapes().filter(Se=>Se.name==="date_range").forEach(Se=>{de.removeEntity(Se.id)});const Qe=ke.slice(De-We,De+1),ut=ke.slice(De-49,De+1);if(p.current=await de.createMultipointShape([{time:Qe[0][0]},{time:Qe[Qe.length-1][0]}],ia(F.current())),_(Qe.length),J(Qe.map(Se=>({o:Se[1],h:Se[2],l:Se[3],c:Se[4],timestamp:Se[0]}))),v(ut.map(Se=>({o:Se[1],h:Se[2],l:Se[3],c:Se[4],timestamp:Se[0]}))),B(!0),p.current){const Se=de.getShapeById(p.current);Se&&Se.setSavingEnabled&&(Se.setProperties({customText:{visible:!0,text:Hr}}),Se.setSavingEnabled(!1))}}},500),P.current=()=>{B(!0);const Ne=de.getVisibleRange();Ne?.from&&Ne?.to&&ze(Ne.from,Ne.to)};const gn=Ne=>{if(!p.current||!Ne)return!1;try{const Ze=de?.getShapeById(p.current);if(!Ze)return!1;const _e=Ze.getPoints();if(_e.length===0)return!1;const ce=_e.map(De=>De.time).filter(De=>typeof De=="number");if(ce.length===0)return!1;const ge=Math.min(...ce);return Math.max(...ce)<Ne.from||ge>Ne.to}catch{return!1}};Ue=Ne=>{Te&&clearTimeout(Te),Te=setTimeout(()=>{gn(Ne)?B(!1):p.current&&B(!0)},150)},de.onIntervalChanged().subscribe(null,fe),de.onSymbolChanged().subscribe(null,Ce),de.onVisibleRangeChanged().subscribe(null,Ue),e.subscribe?.("drawing_event",re)}}),()=>{p.current=null,P.current=null;try{if(Te&&clearTimeout(Te),e){const de=e.activeChart();de&&(Ue&&de.onVisibleRangeChanged().unsubscribe(null,Ue),de.onIntervalChanged().unsubscribe(null,fe),de.onSymbolChanged().unsubscribe(null,Ce)),re&&e.unsubscribe("drawing_event",re)}}catch{}}},[e,fe,Ce,v]),w.useEffect(()=>{if(!e)return;const re=Y;return e.onChartReady(()=>{e.subscribe("onTimescaleMarkClick",re)}),()=>{try{e.unsubscribe("onTimescaleMarkClick",re)}catch{}}},[e,Y]),Wv(e,k);const ct=w.useMemo(()=>({lastEntity:p,applyingPatternRef:b,setHasActiveShape:B,setCandles:J,setWindowSize:_,setSymbol:st,setResolution:xe,setTimeframe:pe,setTargetCandles:v,clearSelectedCandles:()=>q(null)}),[v]);yw(e,q,X[X.length-1]?.timestamp??null,A,a,ct,nn),w.useEffect(()=>{if(!e)return;let re=!1;return e.onChartReady(async()=>{if(!re)try{await Jl(e.activeChart(),m,e.getTheme())}catch(Te){console.error("Failed to create generated candle studies:",Te)}}),()=>{re=!0}},[e,m]),lw(e,m,V,Ee,G);const He=w.useCallback(()=>{try{localStorage.removeItem(ni),localStorage.removeItem(Cn)}catch{}const re=e?.activeChart?.();if(re){k.current&&k.current.length>0&&(k.current.forEach(Te=>{try{re.removeEntity(Te)}catch{}}),k.current=[]);try{re.clearMarks(2)}catch{}}},[e]);return h.jsxs("div",{className:"iccandle-selector-widget__container",children:[h.jsx(jw,{language:l,children:h.jsxs("div",{ref:T,lang:l,className:`iccandle-selector-widget ${W==="dark"?"iccandle-dark":""}`,children:[f,qt&&h.jsx($f,{submitCallback:c,handleShowDialog:R,triggerScanner:C,window_size:U,currentSymbol:Ee,resolution:V,timeframe:le,chartWidget:e,candles:X,handleStartDrag:lt,handleStopDrag:an,hasActiveShape:z,theme:W,language:l,clearScannerNewsMarks:He,selectedCandles:G,iframeLoaded:r,isLoading:g,handleTrackPatternClick:oe}),Q&&h.jsx(Iw,{open:Q,onOpenChange:se,resolution:V,type:Tt.find(re=>re.ticker===Ee)?.type??"forex",symbol:Ee,candles:X,percent:90,theme:W}),$&&h.jsx(Hv,{setResolution:pe,timeframe:le,handleCloseDialog:M}),x&&D&&h.jsx(Bw,{event:D,symbol:Ee||localStorage.getItem("tv:latest-symbol")||"XAU_USD",onClose:ee,onGoToEventDetail:K,position:H}),E&&h.jsx("div",{className:"iccandle-selector-widget__overlay"}),h.jsx(Oc,{theme:W,position:"top-right",className:"iccandle-toaster",richColors:!1})]})}),h.jsx(Yw,{src:o,iframeRef:u,onLoad:d})]})};exports.WidgetIccandle=Hw;exports.getCustomIndicators=rw;exports.getGeneratedCandlesMaskColor=Ja;exports.withPlayChart=tw;
|