@murabei-data-science/pumpwood-ui 1.3.2 → 1.3.3

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.
@@ -37,4 +37,4 @@ var Ua={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
37
37
  *
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
- */!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n');var yi=e=>"number"==typeof e&&!isNaN(e),bi=e=>"string"==typeof e,wi=e=>"function"==typeof e,ki=1,ji=()=>""+ki++,Ni=new Map,Ci=[],_i=new Set,Di=()=>Ni.size>0;function Si(e){if(Di()){if(null==e||(e=>bi(e)||yi(e))(e))Ni.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=Ni.get(e.containerId);t?t.removeToast(e.id):Ni.forEach(t=>{t.removeToast(e.id)})}}else Ci=Ci.filter(t=>null!=e&&t.options.toastId!==e)}function Ei(t,n){(t=>e.isValidElement(t)||bi(t)||wi(t)||yi(t))(t)&&(Di()||Ci.push({content:t,options:n}),Ni.forEach(e=>{e.buildToast(t,n)}))}function Mi(e,t){Ni.forEach(n=>{(null==t||null==t||!t.containerId||(null==t?void 0:t.containerId)===n.id)&&n.toggle(e,null==t?void 0:t.id)})}function Oi(e){return e&&(bi(e.toastId)||yi(e.toastId))?e.toastId:ji()}function Ti(e,t){return Ei(e,t),t.toastId}function Ri(e,t){return{...t,type:t&&t.type||e,toastId:Oi(t)}}function Pi(e){return(t,n)=>Ti(t,Ri(e,n))}function Ai(e,t){return Ti(e,Ri("default",t))}Ai.loading=(e,t)=>Ti(e,Ri("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Ai.promise=function(e,{pending:t,error:n,success:o},r){let a;t&&(a=bi(t)?Ai.loading(t,r):Ai.loading(t.render,{...r,...t}));let i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},s=(e,t,n)=>{if(null==t)return void Ai.dismiss(a);let o={type:e,...i,...r,data:n},s=bi(t)?{render:t}:t;return a?Ai.update(a,{...o,...s}):Ai(s.render,{...o,...s}),n},l=wi(e)?e():e;return l.then(e=>s("success",o,e)).catch(e=>s("error",n,e)),l},Ai.success=Pi("success"),Ai.info=Pi("info"),Ai.error=Pi("error"),Ai.warning=Pi("warning"),Ai.warn=Ai.warning,Ai.dark=(e,t)=>Ti(e,Ri("default",{theme:"dark",...t})),Ai.dismiss=function(e){Si(e)},Ai.clearWaitingQueue=(e={})=>{Ni.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},Ai.isActive=function(e,t){var n;if(t)return!(null==(n=Ni.get(t))||!n.isToastActive(e));let o=!1;return Ni.forEach(t=>{t.isToastActive(e)&&(o=!0)}),o},Ai.update=(e,t={})=>{let n=((e,{containerId:t})=>{var n;return null==(n=Ni.get(t||1))?void 0:n.toasts.get(e)})(e,t);if(n){let{props:o,content:r}=n,a={delay:100,...o,...t,toastId:t.toastId||e,updateId:ji()};a.toastId!==e&&(a.staleId=e);let i=a.render||r;delete a.render,Ti(i,a)}},Ai.done=e=>{Ai.update(e,{progress:1})},Ai.onChange=function(e){return _i.add(e),()=>{_i.delete(e)}},Ai.play=e=>Mi(!0,e),Ai.pause=e=>Mi(!1,e);const Ii={"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.ms-excel":[".xls"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"],"application/vnd.ms-powerpoint":[".ppt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"],"image/jpeg":[".jpg",".jpeg"],"image/png":[".png"],"video/mp4":[".mp4"]};const Fi=e=>e.map(e=>e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`),zi=e=>({"application/octet-stream":Fi(e)});const Li=e.createContext(void 0);function Wi(){const t=e.useContext(Li);if(!t)throw new Error("Sidebar components must be used within a Sidebar.Root");return t}const Bi={Root:function({children:e,isCollapsed:n,isCollapsing:o=!1,onToggleCollapse:r,onTransitionEnd:a,className:i}){const s=n?"smaller:w-20 w-20":"smaller:w-[232px] w-[232px]";return t.jsx(Li.Provider,{value:{isCollapsed:n,isCollapsing:o,onToggleCollapse:r},children:t.jsx("nav",{className:Ie(s,"smaller:p-3 px-2 py-6 flex flex-col items-stretch bg-primary mb-2 rounded-lg transition-all duration-300 ease-in-out h-full min-h-0",i),onTransitionEnd:a,children:e})})},Header:function({children:e,className:n}){return t.jsx("div",{className:Ie("w-full flex justify-between items-center mb-8 gap-4",n),children:e})},Content:function({children:e,className:n}){return t.jsx(Ve,{className:Ie("w-full flex-1 min-h-0 items-stretch gap-1 overflow-y-auto",n),children:e})},Footer:function({children:e,className:n}){return t.jsx("div",{className:Ie("mt-auto w-full",n),children:e})},Toggle:function({className:e}){const{isCollapsed:n,isCollapsing:o,onToggleCollapse:r}=Wi(),a=n&&!o;return t.jsx("div",{className:Ie("w-full flex transition-all duration-300 ease-in-out",a?"justify-center":"justify-end",e),children:t.jsx(Le,{title:a?"Expandir Barra Lateral":"Recolher Barra Lateral",height:48,className:Ie("min-w-[48px] bg-transparent rounded-full hover:bg-white/5 transition-all duration-300 ease-in-out",a?"justify-center":"justify-end"),onClick:r,children:a?t.jsx(fi,{className:"size-[28px] text-white"}):t.jsx(mi,{className:"size-[28px] text-white"})})})},Logo:function({src:e,alt:n,width:o=200,height:r=40,collapsedWidth:a=48,collapsedHeight:i,className:s,ImageComponent:l=({src:e,alt:n,...o})=>t.jsx("img",{src:e,alt:n,...o})}){const{isCollapsed:c,isCollapsing:d}=Wi(),u=c&&!d,p=u?a:o,f=u?i??Math.max(16,Math.round(r/o*a)):r;return t.jsx(Ve,{className:Ie("w-full items-center justify-center py-2",s),children:t.jsx(l,{className:"object-contain transition-all duration-300 ease-in-out",src:e,width:p,height:f,alt:n})})},Link:function({icon:e,children:n,href:o,active:r,className:a,LinkComponent:i=({children:e,...n})=>t.jsx("a",{...n,children:e})}){const{isCollapsed:s,isCollapsing:l}=Wi();return t.jsx(i,{href:o,title:"string"==typeof n?n:void 0,className:Ie("flex w-full h-12 smaller:p-3 p-4 font-bold text-white rounded-md overflow-hidden transition-all duration-300 ease-in-out hover:bg-white/5",r?"bg-white/5":"",a),children:t.jsxs(Ve,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{className:"size-6 shrink-0"}),!s&&!l&&t.jsx("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:n})]})})},NavGroup:function({icon:e,title:n,isExpanded:o,isActive:r=!1,onToggle:a,children:i,className:s}){const{isCollapsed:l,isCollapsing:c}=Wi();return t.jsxs(Ve,{className:Ie("w-full gap-0",s),children:[t.jsx(Le,{type:"button",title:n,onClick:a,variant:"ghost",height:48,className:Ie("w-full smaller:p-3 p-4 font-bold text-white hover:bg-white/5 hover:text-white justify-start rounded-md transition-all duration-300 ease-in-out",r?"bg-white/5":""),children:t.jsxs(Ve,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{className:"size-6 shrink-0"}),!l&&!c&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex-1 text-left transition-opacity duration-300 ease-in-out opacity-100 text-base",children:n}),t.jsx(ti,{width:20,height:20,className:Ie("shrink-0 transition-transform duration-300 ease-in-out",o?"rotate-180":"")})]})]})}),!l&&!c&&t.jsx("div",{className:Ie("overflow-hidden transition-all duration-300 ease-in-out",o?"max-h-96 opacity-100 mt-1":"max-h-0 opacity-0"),children:t.jsx(Ve,{className:"w-full gap-1 pl-9 pr-1",children:i})})]})},NavSubLink:function({title:e,href:n,active:o=!1,className:r,LinkComponent:a=({children:e,...n})=>t.jsx("a",{...n,children:e})}){return t.jsx(a,{href:n,title:e,className:Ie("flex w-full h-10 items-center px-3 text-sm text-white rounded-md transition-all duration-200 ease-in-out hover:bg-white/5",o?"bg-white/10 font-semibold":"",r),children:e})},Action:function({icon:e,label:n,onClick:o,className:r}){const{isCollapsed:a,isCollapsing:i}=Wi();return t.jsx(Le,{title:n,onClick:o,variant:"ghost",height:48,className:Ie("w-full smaller:p-3 p-4 font-bold text-white hover:bg-transparent hover:text-white/80 transition-all duration-300 ease-in-out justify-start",r),children:t.jsxs(Ve,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{width:24,height:24,className:"shrink-0"}),!a&&!i&&t.jsx("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:n})]})})}};var $i=r.createContext(void 0);function qi(e){const t=r.useContext($i);return e||t||"ltr"}var Yi="rovingFocusGroup.onEntryFocus",Hi={bubbles:!1,cancelable:!0},Ki="RovingFocusGroup",[Ui,Vi,Gi]=function(n){const o=n+"CollectionProvider",[r,a]=En(o),[i,s]=r(o,{collectionRef:{current:null},itemMap:new Map}),c=n=>{const{scope:o,children:r}=n,a=e.useRef(null),s=e.useRef(new Map).current;return t.jsx(i,{scope:o,itemMap:s,collectionRef:a,children:r})};c.displayName=o;const d=n+"CollectionSlot",u=zn(d),p=e.forwardRef((e,n)=>{const{scope:o,children:r}=e,a=l(n,s(d,o).collectionRef);return t.jsx(u,{ref:a,children:r})});p.displayName=d;const f=n+"CollectionItemSlot",m="data-radix-collection-item",h=zn(f),v=e.forwardRef((n,o)=>{const{scope:r,children:a,...i}=n,c=e.useRef(null),d=l(o,c),u=s(f,r);return e.useEffect(()=>(u.itemMap.set(c,{ref:c,...i}),()=>{u.itemMap.delete(c)})),t.jsx(h,{[m]:"",ref:d,children:a})});return v.displayName=f,[{Provider:c,Slot:p,ItemSlot:v},function(t){const o=s(n+"CollectionConsumer",t);return e.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},a]}(Ki),[Zi,Xi]=En(Ki,[Gi]),[Qi,Ji]=Zi(Ki),es=r.forwardRef((e,n)=>t.jsx(Ui.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Ui.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(ts,{...e,ref:n})})}));es.displayName=Ki;var ts=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,orientation:a,loop:i=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:u,onEntryFocus:p,preventScrollOnEntryFocus:f=!1,...m}=e,h=r.useRef(null),v=l(n,h),g=qi(s),[x,y]=Fn({prop:c,defaultProp:d??null,onChange:u,caller:Ki}),[b,w]=r.useState(!1),k=qn(p),j=Vi(o),N=r.useRef(!1),[C,_]=r.useState(0);return r.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(Yi,k),()=>e.removeEventListener(Yi,k)},[k]),t.jsx(Qi,{scope:o,orientation:a,dir:g,loop:i,currentTabStopId:x,onItemFocus:r.useCallback(e=>y(e),[y]),onItemShiftTab:r.useCallback(()=>w(!0),[]),onFocusableItemAdd:r.useCallback(()=>_(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>_(e=>e-1),[]),children:t.jsx($n.div,{tabIndex:b||0===C?-1:0,"data-orientation":a,...m,ref:v,style:{outline:"none",...e.style},onMouseDown:On(e.onMouseDown,()=>{N.current=!0}),onFocus:On(e.onFocus,e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(Yi,Hi);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=j().filter(e=>e.focusable);as([e.find(e=>e.active),e.find(e=>e.id===x),...e].filter(Boolean).map(e=>e.ref.current),f)}}N.current=!1}),onBlur:On(e.onBlur,()=>w(!1))})})}),ns="RovingFocusGroupItem",os=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,focusable:a=!0,active:i=!1,tabStopId:s,children:l,...c}=e,d=An(),u=s||d,p=Ji(ns,o),f=p.currentTabStopId===u,m=Vi(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=p;return r.useEffect(()=>{if(a)return h(),()=>v()},[a,h,v]),t.jsx(Ui.ItemSlot,{scope:o,id:u,focusable:a,active:i,children:t.jsx($n.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:n,onMouseDown:On(e.onMouseDown,e=>{a?p.onItemFocus(u):e.preventDefault()}),onFocus:On(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:On(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const o=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(o)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)?void 0:rs[o]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const a=r.indexOf(e.currentTarget);r=p.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>as(r))}var n,o}),children:"function"==typeof l?l({isCurrentTabStop:f,hasTabStop:null!=g}):l})})});os.displayName=ns;var rs={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function as(e,t=!1){const n=document.activeElement;for(const o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}var is=es,ss=os,ls="Tabs",[cs]=En(ls,[Xi]),ds=Xi(),[us,ps]=cs(ls),fs=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=qi(l),[p,f]=Fn({prop:r,onChange:a,defaultProp:i??"",caller:ls});return t.jsx(us,{scope:o,baseId:An(),value:p,onValueChange:f,orientation:s,dir:u,activationMode:c,children:t.jsx($n.div,{dir:u,"data-orientation":s,...d,ref:n})})});fs.displayName=ls;var ms="TabsList",hs=r.forwardRef((e,n)=>{const{__scopeTabs:o,loop:r=!0,...a}=e,i=ps(ms,o),s=ds(o);return t.jsx(is,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:t.jsx($n.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:n})})});hs.displayName=ms;var vs="TabsTrigger",gs=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:r,disabled:a=!1,...i}=e,s=ps(vs,o),l=ds(o),c=bs(s.baseId,r),d=ws(s.baseId,r),u=r===s.value;return t.jsx(ss,{asChild:!0,...l,focusable:!a,active:u,children:t.jsx($n.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:n,onMouseDown:On(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(r)}),onKeyDown:On(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(r)}),onFocus:On(e.onFocus,()=>{const e="manual"!==s.activationMode;u||a||!e||s.onValueChange(r)})})})});gs.displayName=vs;var xs="TabsContent",ys=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:a,forceMount:i,children:s,...l}=e,c=ps(xs,o),d=bs(c.baseId,a),u=ws(c.baseId,a),p=a===c.value,f=r.useRef(p);return r.useEffect(()=>{const e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),t.jsx(co,{present:i||p,children:({present:o})=>t.jsx($n.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!o,id:u,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:o&&s})})});function bs(e,t){return`${e}-trigger-${t}`}function ws(e,t){return`${e}-content-${t}`}ys.displayName=xs;var ks=hs,js=gs,Ns=ys;const Cs=fs,_s=r.forwardRef(({className:e,...n},o)=>t.jsx(ks,{ref:o,className:Ie("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...n}));_s.displayName=ks.displayName;const Ds=r.forwardRef(({className:e,...n},o)=>t.jsx(js,{ref:o,className:Ie("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-[#0E2B63] data-[state=active]:text-[#FFFFFF] data-[state=active]:shadow",e),...n}));Ds.displayName=js.displayName;const Ss=r.forwardRef(({className:e,...n},o)=>t.jsx(Ns,{ref:o,className:Ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n}));function Es(e,n=[]){let o=[];const a=()=>{const t=o.map(e=>r.createContext(e));return function(n){const o=n?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return a.scopeName=e,[function(n,a){const i=r.createContext(a);i.displayName=n+"Context";const s=o.length;o=[...o,a];const l=n=>{const{scope:o,children:a,...l}=n,c=o?.[e]?.[s]||i,d=r.useMemo(()=>l,Object.values(l));return t.jsx(c.Provider,{value:d,children:a})};return l.displayName=n+"Provider",[l,function(t,o){const l=o?.[e]?.[s]||i,c=r.useContext(l);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},Ms(a,...n)]}function Ms(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Os(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Ts(...e){return t=>{let n=!1;const o=e.map(e=>{const o=Os(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():Os(e[t],null)}}}}function Rs(...e){return r.useCallback(Ts(...e),e)}function Ps(e){const t=r.forwardRef((t,n)=>{let{children:o,...a}=t,i=null,s=!1;const l=[];zs(o)&&"function"==typeof Bs&&(o=Bs(o._payload)),r.Children.forEach(o,e=>{if(t=e,r.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===As){s=!0;const t=e;let n="child"in t.props?t.props.child:t.props.children;zs(n)&&"function"==typeof Bs&&(n=Bs(n._payload)),i=Is(t,n),l.push(i?.props?.children)}else l.push(e);var t}),i?i=r.cloneElement(i,void 0,l):!s&&1===r.Children.count(o)&&r.isValidElement(o)&&(i=o);const c=i?function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i):void 0,d=Rs(n,c);if(!i){if(o||0===o)throw new Error(s?Ws(e):Ls(e));return o}const u=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(a,i.props??{});return i.type!==r.Fragment&&(u.ref=n?d:c),r.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}Ss.displayName=Ns.displayName;var As=Symbol.for("radix.slottable");var Is=(e,t)=>{if("child"in e.props){const t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null};var Fs=Symbol.for("react.lazy");function zs(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===Fs&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}var Ls=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Ws=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Bs=r[" use ".trim().toString()];function $s(e){const n=e+"CollectionProvider",[o,a]=Es(n),[i,s]=o(n,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:n,children:o}=e,a=r.useRef(null),s=r.useRef(new Map).current;return t.jsx(i,{scope:n,itemMap:s,collectionRef:a,children:o})};l.displayName=n;const c=e+"CollectionSlot",d=Ps(c),u=r.forwardRef((e,n)=>{const{scope:o,children:r}=e,a=Rs(n,s(c,o).collectionRef);return t.jsx(d,{ref:a,children:r})});u.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",m=Ps(p),h=r.forwardRef((e,n)=>{const{scope:o,children:a,...i}=e,l=r.useRef(null),c=Rs(n,l),d=s(p,o);return r.useEffect(()=>(d.itemMap.set(l,{ref:l,...i}),()=>{d.itemMap.delete(l)})),t.jsx(m,{[f]:"",ref:c,children:a})});return h.displayName=p,[{Provider:l,Slot:u,ItemSlot:h},function(t){const n=s(e+"CollectionConsumer",t);return r.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},a]}function qs(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}var Ys=globalThis?.document?r.useLayoutEffect:()=>{},Hs=r[" useInsertionEffect ".trim().toString()]||Ys;function Ks({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[a,i,s]=function({defaultProp:e,onChange:t}){const[n,o]=r.useState(e),a=r.useRef(n),i=r.useRef(t);return Hs(()=>{i.current=t},[t]),r.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:a;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,o])}const d=r.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[l,e,i,s]);return[c,d]}var Us=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{const o=Ps(`Primitive.${n}`),a=r.forwardRef((e,r)=>{const{asChild:a,...i}=e,s=a?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function Vs(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}var Gs=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=r.useState(),o=r.useRef(null),a=r.useRef(e),i=r.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=Xs(o.current);i.current="mounted"===l?e:"none"},[l]),Ys(()=>{const t=o.current,n=a.current;if(n!==e){const o=i.current,r=Xs(t);if(e)c("MOUNT");else if("none"===r||"none"===t?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),Ys(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=Xs(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&i&&(c("ANIMATION_END"),!a.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)})}},s=e=>{e.target===t&&(i.current=Xs(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),i=function(...e){const t=r.useRef(e);return t.current=e,r.useCallback(e=>{const n=t.current;let o=!1;const r=n.map(t=>{const n=Zs(t,e);return o||"function"!=typeof n||(o=!0),n});if(o)return()=>{for(let e=0;e<r.length;e++){const t=r[e];"function"==typeof t?t():Zs(n[e],null)}}},[])}(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||o.isPresent?r.cloneElement(a,{ref:i}):null};function Zs(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Xs(e){return e?.animationName||"none"}Gs.displayName="Presence";var Qs=r[" useId ".trim().toString()]||(()=>{}),Js=0;function el(e){const[t,n]=r.useState(Qs());return Ys(()=>{n(e=>e??String(Js++))},[e]),t?`radix-${t}`:""}var tl="Collapsible",[nl,ol]=Es(tl),[rl,al]=nl(tl),il=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,open:a,defaultOpen:i,disabled:s,onOpenChange:l,...c}=e,[d,u]=Ks({prop:a,defaultProp:i??!1,onChange:l,caller:tl});return t.jsx(rl,{scope:o,disabled:s,contentId:el(),open:d,onOpenToggle:r.useCallback(()=>u(e=>!e),[u]),children:t.jsx(Us.div,{"data-state":pl(d),"data-disabled":s?"":void 0,...c,ref:n})})});il.displayName=tl;var sl="CollapsibleTrigger",ll=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,...r}=e,a=al(sl,o);return t.jsx(Us.button,{type:"button","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":pl(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:n,onClick:qs(e.onClick,a.onOpenToggle)})});ll.displayName=sl;var cl="CollapsibleContent",dl=r.forwardRef((e,n)=>{const{forceMount:o,...r}=e,a=al(cl,e.__scopeCollapsible);return t.jsx(Gs,{present:o||a.open,children:({present:e})=>t.jsx(ul,{...r,ref:n,present:e})})});dl.displayName=cl;var ul=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,present:a,children:i,...s}=e,l=al(cl,o),[c,d]=r.useState(a),u=r.useRef(null),p=Rs(n,u),f=r.useRef(0),m=f.current,h=r.useRef(0),v=h.current,g=l.open||c,x=r.useRef(g),y=r.useRef(void 0);return r.useEffect(()=>{const e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),Ys(()=>{const e=u.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();f.current=t.height,h.current=t.width,x.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),d(a)}},[l.open,a]),t.jsx(Us.div,{"data-state":pl(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!g,...s,ref:p,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&i})});function pl(e){return e?"open":"closed"}var fl=il,ml=ll,hl=dl,vl=r.createContext(void 0);function gl(e){const t=r.useContext(vl);return e||t||"ltr"}var xl="Accordion",yl=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[bl,wl,kl]=$s(xl),[jl]=Es(xl,[kl,ol]),Nl=ol(),Cl=r.forwardRef((e,n)=>{const{type:o,...r}=e,a=r,i=r;return t.jsx(bl.Provider,{scope:e.__scopeAccordion,children:"multiple"===o?t.jsx(Ol,{...i,ref:n}):t.jsx(Ml,{...a,ref:n})})});Cl.displayName=xl;var[_l,Dl]=jl(xl),[Sl,El]=jl(xl,{collapsible:!1}),Ml=r.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:i=()=>{},collapsible:s=!1,...l}=e,[c,d]=Ks({prop:o,defaultProp:a??"",onChange:i,caller:xl});return t.jsx(_l,{scope:e.__scopeAccordion,value:r.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:r.useCallback(()=>s&&d(""),[s,d]),children:t.jsx(Sl,{scope:e.__scopeAccordion,collapsible:s,children:t.jsx(Pl,{...l,ref:n})})})}),Ol=r.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:i=()=>{},...s}=e,[l,c]=Ks({prop:o,defaultProp:a??[],onChange:i,caller:xl}),d=r.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=r.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return t.jsx(_l,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:u,children:t.jsx(Sl,{scope:e.__scopeAccordion,collapsible:!0,children:t.jsx(Pl,{...s,ref:n})})})}),[Tl,Rl]=jl(xl),Pl=r.forwardRef((e,n)=>{const{__scopeAccordion:o,disabled:a,dir:i,orientation:s="vertical",...l}=e,c=Rs(r.useRef(null),n),d=wl(o),u="ltr"===gl(i),p=qs(e.onKeyDown,e=>{if(!yl.includes(e.key))return;const t=e.target,n=d().filter(e=>!e.ref.current?.disabled),o=n.findIndex(e=>e.ref.current===t),r=n.length;if(-1===o)return;e.preventDefault();let a=o;const i=r-1,l=()=>{a=o+1,a>i&&(a=0)},c=()=>{a=o-1,a<0&&(a=i)};switch(e.key){case"Home":a=0;break;case"End":a=i;break;case"ArrowRight":"horizontal"===s&&(u?l():c());break;case"ArrowDown":"vertical"===s&&l();break;case"ArrowLeft":"horizontal"===s&&(u?c():l());break;case"ArrowUp":"vertical"===s&&c()}const p=a%r;n[p].ref.current?.focus()});return t.jsx(Tl,{scope:o,disabled:a,direction:i,orientation:s,children:t.jsx(bl.Slot,{scope:o,children:t.jsx(Us.div,{...l,"data-orientation":s,ref:c,onKeyDown:a?void 0:p})})})}),Al="AccordionItem",[Il,Fl]=jl(Al),zl=r.forwardRef((e,n)=>{const{__scopeAccordion:o,value:r,...a}=e,i=Rl(Al,o),s=Dl(Al,o),l=Nl(o),c=el(),d=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return t.jsx(Il,{scope:o,open:d,disabled:u,triggerId:c,children:t.jsx(fl,{"data-orientation":i.orientation,"data-state":Hl(d),...l,...a,ref:n,disabled:u,open:d,onOpenChange:e=>{e?s.onItemOpen(r):s.onItemClose(r)}})})});zl.displayName=Al;var Ll="AccordionHeader",Wl=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=Rl(xl,o),i=Fl(Ll,o);return t.jsx(Us.h3,{"data-orientation":a.orientation,"data-state":Hl(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:n})});Wl.displayName=Ll;var Bl="AccordionTrigger",$l=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=Rl(xl,o),i=Fl(Bl,o),s=El(Bl,o),l=Nl(o);return t.jsx(bl.ItemSlot,{scope:o,children:t.jsx(ml,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...r,ref:n})})});$l.displayName=Bl;var ql="AccordionContent",Yl=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=Rl(xl,o),i=Fl(ql,o),s=Nl(o);return t.jsx(hl,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...s,...r,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function Hl(e){return e?"open":"closed"}Yl.displayName=ql;var Kl=zl,Ul=Wl,Vl=$l,Gl=Yl;const Zl=Cl,Xl=r.forwardRef(({className:e,...n},o)=>t.jsx(Kl,{ref:o,className:Ie("border-b",e),...n}));Xl.displayName="AccordionItem";const Ql=r.forwardRef(({className:e,children:n,...o},r)=>t.jsx(Ul,{className:"flex",children:t.jsxs(Vl,{ref:r,className:Ie("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",e),...o,children:[n,t.jsx(ti,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));Ql.displayName=Vl.displayName;const Jl=r.forwardRef(({className:e,children:n,...o},r)=>t.jsx(Gl,{ref:r,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o,children:t.jsx("div",{className:Ie("pb-4 pt-0",e),children:n})}));function ec({className:e,...n}){return t.jsx("div",{"data-slot":"empty",className:Ie("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",e),...n})}function tc({className:e,...n}){return t.jsx("div",{"data-slot":"empty-header",className:Ie("flex max-w-sm flex-col items-center gap-2 text-center",e),...n})}Jl.displayName=Gl.displayName;const nc=w("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function oc({className:e,variant:n="default",...o}){return t.jsx("div",{"data-slot":"empty-icon","data-variant":n,className:Ie(nc({variant:n,className:e})),...o})}function rc({className:e,...n}){return t.jsx("div",{"data-slot":"empty-title",className:Ie("text-lg font-medium tracking-tight",e),...n})}function ac({className:e,...n}){return t.jsx("div",{"data-slot":"empty-description",className:Ie("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...n})}function ic({title:e,description:n}){return t.jsx(ec,{children:t.jsxs(tc,{className:"w-[250px]",children:[t.jsx(oc,{children:t.jsx(Qa,{})}),t.jsx(rc,{children:e}),t.jsx(ac,{children:n})]})})}var sc=.999,lc=/[\\\/_+.#"@\[\(\{&]/,cc=/[\\\/_+.#"@\[\(\{&]/g,dc=/[\s-]/,uc=/[\s-]/g;function pc(e,t,n,o,r,a,i){if(a===t.length)return r===e.length?1:.99;var s=`${r},${a}`;if(void 0!==i[s])return i[s];for(var l,c,d,u,p=o.charAt(a),f=n.indexOf(p,r),m=0;f>=0;)(l=pc(e,t,n,o,f+1,a+1,i))>m&&(f===r?l*=1:lc.test(e.charAt(f-1))?(l*=.8,(d=e.slice(r,f-1).match(cc))&&r>0&&(l*=Math.pow(sc,d.length))):dc.test(e.charAt(f-1))?(l*=.9,(u=e.slice(r,f-1).match(uc))&&r>0&&(l*=Math.pow(sc,u.length))):(l*=.17,r>0&&(l*=Math.pow(sc,f-r))),e.charAt(f)!==t.charAt(a)&&(l*=.9999)),(l<.1&&n.charAt(f-1)===o.charAt(a+1)||o.charAt(a+1)===o.charAt(a)&&n.charAt(f-1)!==o.charAt(a))&&(.1*(c=pc(e,t,n,o,f+1,a+2,i))>l&&(l=.1*c)),l>m&&(m=l),f=n.indexOf(p,f+1);return i[s]=m,m}function fc(e){return e.toLowerCase().replace(uc," ")}function mc(e,t,n){return pc(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,fc(e),fc(t),0,0,{})}var hc='[cmdk-group=""]',vc='[cmdk-group-items=""]',gc='[cmdk-item=""]',xc=`${gc}:not([aria-disabled="true"])`,yc="cmdk-item-select",bc="data-value",wc=(e,t,n)=>mc(e,t,n),kc=r.createContext(void 0),jc=()=>r.useContext(kc),Nc=r.createContext(void 0),Cc=()=>r.useContext(Nc),_c=r.createContext(void 0),Dc=r.forwardRef((e,t)=>{let n=Bc(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Bc(()=>new Set),a=Bc(()=>new Map),i=Bc(()=>new Map),s=Bc(()=>new Set),l=Lc(e),{label:c,children:d,value:u,onValueChange:p,filter:f,shouldFilter:m,loop:h,disablePointerSelection:v=!1,vimBindings:g=!0,...x}=e,y=An(),b=An(),w=An(),k=r.useRef(null),j=Yc();Wc(()=>{if(void 0!==u){let e=u.trim();n.current.value=e,N.emit()}},[u]),Wc(()=>{j(6,M)},[]);let N=r.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,o)=>{var r,a,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)E(),D(),j(1,S);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(r=document.getElementById(y))||r.focus()}if(j(7,()=>{var e;n.current.selectedItemId=null==(e=O())?void 0:e.id,N.emit()}),o||j(5,M),void 0!==(null==(a=l.current)?void 0:a.value)){let e=null!=t?t:"";return void(null==(s=(i=l.current).onValueChange)||s.call(i,e))}}N.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),C=r.useMemo(()=>({value:(e,t,o)=>{var r;t!==(null==(r=i.current.get(e))?void 0:r.value)&&(i.current.set(e,{value:t,keywords:o}),n.current.filtered.items.set(e,_(t,o)),j(2,()=>{D(),N.emit()}))},item:(e,t)=>(o.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),j(3,()=>{E(),D(),n.current.value||S(),N.emit()}),()=>{i.current.delete(e),o.current.delete(e),n.current.filtered.items.delete(e);let t=O();j(4,()=>{E(),(null==t?void 0:t.getAttribute("id"))===e&&S(),N.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{i.current.delete(e),a.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:w,labelId:b,listInnerRef:k}),[]);function _(e,t){var o,r;let a=null!=(r=null==(o=l.current)?void 0:o.filter)?r:wc;return e?a(e,n.current.search,t):0}function D(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let o=a.current.get(n),r=0;o.forEach(t=>{let n=e.get(t);r=Math.max(n,r)}),t.push([n,r])});let o=k.current;T().sort((t,n)=>{var o,r;let a=t.getAttribute("id"),i=n.getAttribute("id");return(null!=(o=e.get(i))?o:0)-(null!=(r=e.get(a))?r:0)}).forEach(e=>{let t=e.closest(vc);t?t.appendChild(e.parentElement===t?e:e.closest(`${vc} > *`)):o.appendChild(e.parentElement===o?e:e.closest(`${vc} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${hc}[${bc}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function S(){let e=T().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(bc);N.setState("value",t||void 0)}function E(){var e,t,r,s;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=o.current.size);n.current.filtered.groups=new Set;let c=0;for(let a of o.current){let o=_(null!=(t=null==(e=i.current.get(a))?void 0:e.value)?t:"",null!=(s=null==(r=i.current.get(a))?void 0:r.keywords)?s:[]);n.current.filtered.items.set(a,o),o>0&&c++}for(let[e,t]of a.current)for(let o of t)if(n.current.filtered.items.get(o)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=c}function M(){var e,t,n;let o=O();o&&((null==(e=o.parentElement)?void 0:e.firstChild)===o&&(null==(n=null==(t=o.closest(hc))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),o.scrollIntoView({block:"nearest"}))}function O(){var e;return null==(e=k.current)?void 0:e.querySelector(`${gc}[aria-selected="true"]`)}function T(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(xc))||[])}function R(e){let t=T()[e];t&&N.setState("value",t.getAttribute(bc))}function P(e){var t;let n=O(),o=T(),r=o.findIndex(e=>e===n),a=o[r+e];null!=(t=l.current)&&t.loop&&(a=r+e<0?o[o.length-1]:r+e===o.length?o[0]:o[r+e]),a&&N.setState("value",a.getAttribute(bc))}function A(e){let t,n=O(),o=null==n?void 0:n.closest(hc);for(;o&&!t;)o=e>0?Fc(o,hc):zc(o,hc),t=null==o?void 0:o.querySelector(xc);t?N.setState("value",t.getAttribute(bc)):P(e)}let I=()=>R(T().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?A(1):P(1)},z=e=>{e.preventDefault(),e.metaKey?R(0):e.altKey?A(-1):P(-1)};return r.createElement($n.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=x.onKeyDown)||t.call(x,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!n)switch(e.key){case"n":case"j":g&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":g&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),R(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let t=O();if(t){let e=new Event(yc);t.dispatchEvent(e)}}}}},r.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:Kc},c),Hc(e,e=>r.createElement(Nc.Provider,{value:N},r.createElement(kc.Provider,{value:C},e))))}),Sc=r.forwardRef((e,t)=>{var n,o;let a=An(),i=r.useRef(null),l=r.useContext(_c),c=jc(),d=Lc(e),u=null!=(o=null==(n=d.current)?void 0:n.forceMount)?o:null==l?void 0:l.forceMount;Wc(()=>{if(!u)return c.item(a,null==l?void 0:l.id)},[u]);let p=qc(a,i,[e.value,e.children,i],e.keywords),f=Cc(),m=$c(e=>e.value&&e.value===p.current),h=$c(e=>!(!u&&!1!==c.filter())||(!e.search||e.filtered.items.get(a)>0));function v(){var e,t;g(),null==(t=(e=d.current).onSelect)||t.call(e,p.current)}function g(){f.setState("value",p.current,!0)}if(r.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(yc,v),()=>t.removeEventListener(yc,v)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:x,value:y,onSelect:b,forceMount:w,keywords:k,...j}=e;return r.createElement($n.div,{ref:s(i,t),...j,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!m,"data-disabled":!!x,"data-selected":!!m,onPointerMove:x||c.getDisablePointerSelection()?void 0:g,onClick:x?void 0:v},e.children)}),Ec=r.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:a,...i}=e,l=An(),c=r.useRef(null),d=r.useRef(null),u=An(),p=jc(),f=$c(e=>!(!a&&!1!==p.filter())||(!e.search||e.filtered.groups.has(l)));Wc(()=>p.group(l),[]),qc(l,c,[e.value,e.heading,d]);let m=r.useMemo(()=>({id:l,forceMount:a}),[a]);return r.createElement($n.div,{ref:s(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!f||void 0},n&&r.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Hc(e,e=>r.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},r.createElement(_c.Provider,{value:m},e))))}),Mc=r.forwardRef((e,t)=>{let{alwaysRender:n,...o}=e,a=r.useRef(null),i=$c(e=>!e.search);return n||i?r.createElement($n.div,{ref:s(a,t),...o,"cmdk-separator":"",role:"separator"}):null}),Oc=r.forwardRef((e,t)=>{let{onValueChange:n,...o}=e,a=null!=e.value,i=Cc(),s=$c(e=>e.search),l=$c(e=>e.selectedItemId),c=jc();return r.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),r.createElement($n.input,{ref:t,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:a?e.value:s,onChange:e=>{a||i.setState("search",e.target.value),null==n||n(e.target.value)}})}),Tc=r.forwardRef((e,t)=>{let{children:n,label:o="Suggestions",...a}=e,i=r.useRef(null),l=r.useRef(null),c=$c(e=>e.selectedItemId),d=jc();return r.useEffect(()=>{if(l.current&&i.current){let e,t=l.current,n=i.current,o=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;n.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return o.observe(t),()=>{cancelAnimationFrame(e),o.unobserve(t)}}},[]),r.createElement($n.div,{ref:s(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":o,id:d.listId},Hc(e,e=>r.createElement("div",{ref:s(l,d.listInnerRef),"cmdk-list-sizer":""},e)))}),Rc=r.forwardRef((e,t)=>{let{open:n,onOpenChange:o,overlayClassName:a,contentClassName:i,container:s,...l}=e;return r.createElement(Wr,{open:n,onOpenChange:o},r.createElement($r,{container:s},r.createElement(qr,{"cmdk-overlay":"",className:a}),r.createElement(Yr,{"aria-label":e.label,"cmdk-dialog":"",className:i},r.createElement(Dc,{ref:t,...l}))))}),Pc=r.forwardRef((e,t)=>$c(e=>0===e.filtered.count)?r.createElement($n.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Ac=r.forwardRef((e,t)=>{let{progress:n,children:o,label:a="Loading...",...i}=e;return r.createElement($n.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Hc(e,e=>r.createElement("div",{"aria-hidden":!0},e)))}),Ic=Object.assign(Dc,{List:Tc,Item:Sc,Input:Oc,Group:Ec,Separator:Mc,Dialog:Rc,Empty:Pc,Loading:Ac});function Fc(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function zc(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Lc(e){let t=r.useRef(e);return Wc(()=>{t.current=e}),t}var Wc="undefined"==typeof window?r.useEffect:r.useLayoutEffect;function Bc(e){let t=r.useRef();return void 0===t.current&&(t.current=e()),t}function $c(e){let t=Cc(),n=()=>e(t.snapshot());return r.useSyncExternalStore(t.subscribe,n,n)}function qc(e,t,n,o=[]){let a=r.useRef(),i=jc();return Wc(()=>{var r;let s=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),l=o.map(e=>e.trim());i.value(e,s,l),null==(r=t.current)||r.setAttribute(bc,s),a.current=s}),a}var Yc=()=>{let[e,t]=r.useState(),n=Bc(()=>new Map);return Wc(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,o)=>{n.current.set(e,o),t({})}};function Hc({asChild:e,children:t},n){return e&&r.isValidElement(t)?r.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var Kc={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Uc=Wr,Vc=Br,Gc=({className:e,...n})=>t.jsx($r,{...n});Gc.displayName=$r.displayName;const Zc=r.forwardRef(({className:e,...n},o)=>t.jsx(qr,{ref:o,className:Ie("fixed inset-0 z-50 overlay-dialog data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));Zc.displayName=qr.displayName;const Xc=r.forwardRef(({className:e,children:n,showCloseButton:o=!0,...r},a)=>t.jsxs(Gc,{children:[t.jsx(Zc,{}),t.jsxs(Yr,{ref:a,className:Ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-2xl md:w-full",e),...r,children:[n,o&&t.jsxs(Ur,{type:"button",className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(xi,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xc.displayName=Yr.displayName;const Qc=({className:e,...n})=>t.jsx("div",{className:Ie("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});Qc.displayName="DialogHeader";const Jc=({className:e,...n})=>t.jsx("div",{className:Ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});Jc.displayName="DialogFooter";const ed=r.forwardRef(({className:e,...n},o)=>t.jsx(Hr,{ref:o,className:Ie("text-lg font-semibold leading-none tracking-tight",e),...n}));ed.displayName=Hr.displayName;const td=r.forwardRef(({className:e,...n},o)=>t.jsx(Kr,{ref:o,className:Ie("text-sm text-muted-foreground",e),...n}));function nd({className:e,...n}){return t.jsx(Ic,{"data-slot":"command",className:Ie("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...n})}function od({className:e,...n}){return t.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[t.jsx(vi,{className:"size-4 shrink-0 opacity-50"}),t.jsx(Ic.Input,{"data-slot":"command-input",className:Ie("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function rd({className:e,...n}){return t.jsx(Ic.List,{"data-slot":"command-list",className:Ie("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function ad({...e}){return t.jsx(Ic.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function id({className:e,...n}){return t.jsx(Ic.Group,{"data-slot":"command-group",className:Ie("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...n})}function sd({className:e,...n}){return t.jsx(Ic.Item,{"data-slot":"command-item",className:Ie("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}td.displayName=Kr.displayName;const ld=["top","right","bottom","left"],cd=Math.min,dd=Math.max,ud=Math.round,pd=Math.floor,fd=e=>({x:e,y:e}),md={left:"right",right:"left",bottom:"top",top:"bottom"},hd={start:"end",end:"start"};function vd(e,t,n){return dd(e,cd(t,n))}function gd(e,t){return"function"==typeof e?e(t):e}function xd(e){return e.split("-")[0]}function yd(e){return e.split("-")[1]}function bd(e){return"x"===e?"y":"x"}function wd(e){return"y"===e?"height":"width"}const kd=new Set(["top","bottom"]);function jd(e){return kd.has(xd(e))?"y":"x"}function Nd(e){return bd(jd(e))}function Cd(e){return e.replace(/start|end/g,e=>hd[e])}const _d=["left","right"],Dd=["right","left"],Sd=["top","bottom"],Ed=["bottom","top"];function Md(e,t,n,o){const r=yd(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Dd:_d:t?_d:Dd;case"left":case"right":return t?Sd:Ed;default:return[]}}(xd(e),"start"===n,o);return r&&(a=a.map(e=>e+"-"+r),t&&(a=a.concat(a.map(Cd)))),a}function Od(e){return e.replace(/left|right|bottom|top/g,e=>md[e])}function Td(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Rd(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Pd(e,t,n){let{reference:o,floating:r}=e;const a=jd(t),i=Nd(t),s=wd(i),l=xd(t),c="y"===a,d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,p=o[s]/2-r[s]/2;let f;switch(l){case"top":f={x:d,y:o.y-r.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-r.width,y:u};break;default:f={x:o.x,y:o.y}}switch(yd(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1)}return f}async function Ad(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=gd(t,e),m=Td(f),h=s[p?"floating"===u?"reference":"floating":u],v=Rd(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(h)))||n?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),g="floating"===u?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),y=await(null==a.isElement?void 0:a.isElement(x))&&await(null==a.getScale?void 0:a.getScale(x))||{x:1,y:1},b=Rd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:x,strategy:l}):g);return{top:(v.top-b.top+m.top)/y.y,bottom:(b.bottom-v.bottom+m.bottom)/y.y,left:(v.left-b.left+m.left)/y.x,right:(b.right-v.right+m.right)/y.x}}function Id(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fd(e){return ld.some(t=>e[t]>=0)}const zd=new Set(["left","top"]);function Ld(){return"undefined"!=typeof window}function Wd(e){return qd(e)?(e.nodeName||"").toLowerCase():"#document"}function Bd(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $d(e){var t;return null==(t=(qd(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function qd(e){return!!Ld()&&(e instanceof Node||e instanceof Bd(e).Node)}function Yd(e){return!!Ld()&&(e instanceof Element||e instanceof Bd(e).Element)}function Hd(e){return!!Ld()&&(e instanceof HTMLElement||e instanceof Bd(e).HTMLElement)}function Kd(e){return!(!Ld()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Bd(e).ShadowRoot)}const Ud=new Set(["inline","contents"]);function Vd(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=iu(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Ud.has(r)}const Gd=new Set(["table","td","th"]);function Zd(e){return Gd.has(Wd(e))}const Xd=[":popover-open",":modal"];function Qd(e){return Xd.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Jd=["transform","translate","scale","rotate","perspective"],eu=["transform","translate","scale","rotate","perspective","filter"],tu=["paint","layout","strict","content"];function nu(e){const t=ou(),n=Yd(e)?iu(e):e;return Jd.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||eu.some(e=>(n.willChange||"").includes(e))||tu.some(e=>(n.contain||"").includes(e))}function ou(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ru=new Set(["html","body","#document"]);function au(e){return ru.has(Wd(e))}function iu(e){return Bd(e).getComputedStyle(e)}function su(e){return Yd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lu(e){if("html"===Wd(e))return e;const t=e.assignedSlot||e.parentNode||Kd(e)&&e.host||$d(e);return Kd(t)?t.host:t}function cu(e){const t=lu(e);return au(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hd(t)&&Vd(t)?t:cu(t)}function du(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=cu(e),a=r===(null==(o=e.ownerDocument)?void 0:o.body),i=Bd(r);if(a){const e=uu(i);return t.concat(i,i.visualViewport||[],Vd(r)?r:[],e&&n?du(e):[])}return t.concat(r,du(r,[],n))}function uu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pu(e){const t=iu(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Hd(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=ud(n)!==a||ud(o)!==i;return s&&(n=a,o=i),{width:n,height:o,$:s}}function fu(e){return Yd(e)?e:e.contextElement}function mu(e){const t=fu(e);if(!Hd(t))return fd(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=pu(t);let i=(a?ud(n.width):n.width)/o,s=(a?ud(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const hu=fd(0);function vu(e){const t=Bd(e);return ou()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:hu}function gu(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=fu(e);let i=fd(1);t&&(o?Yd(o)&&(i=mu(o)):i=mu(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Bd(e))&&t}(a,n,o)?vu(a):fd(0);let l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,d=r.width/i.x,u=r.height/i.y;if(a){const e=Bd(a),t=o&&Yd(o)?Bd(o):o;let n=e,r=uu(n);for(;r&&o&&t!==n;){const e=mu(r),t=r.getBoundingClientRect(),o=iu(r),a=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=a,c+=i,n=Bd(r),r=uu(n)}}return Rd({width:d,height:u,x:l,y:c})}function xu(e,t){const n=su(e).scrollLeft;return t?t.left+n:gu($d(e)).left+n}function yu(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xu(e,n),y:n.top+t.scrollTop}}const bu=new Set(["absolute","fixed"]);function wu(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=Bd(e),o=$d(e),r=n.visualViewport;let a=o.clientWidth,i=o.clientHeight,s=0,l=0;if(r){a=r.width,i=r.height;const e=ou();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=xu(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=$d(e),n=su(e),o=e.ownerDocument.body,r=dd(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=dd(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+xu(e);const s=-n.scrollTop;return"rtl"===iu(o).direction&&(i+=dd(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:s}}($d(e));else if(Yd(t))o=function(e,t){const n=gu(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=Hd(e)?mu(e):fd(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:r*a.x,y:o*a.y}}(t,n);else{const n=vu(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Rd(o)}function ku(e,t){const n=lu(e);return!(n===t||!Yd(n)||au(n))&&("fixed"===iu(n).position||ku(n,t))}function ju(e,t,n){const o=Hd(t),r=$d(t),a="fixed"===n,i=gu(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=fd(0);function c(){l.x=xu(r)}if(o||!o&&!a)if(("body"!==Wd(t)||Vd(r))&&(s=su(t)),o){const e=gu(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&c();a&&!o&&r&&c();const d=!r||o||a?fd(0):yu(r,s);return{x:i.left+s.scrollLeft-l.x-d.x,y:i.top+s.scrollTop-l.y-d.y,width:i.width,height:i.height}}function Nu(e){return"static"===iu(e).position}function Cu(e,t){if(!Hd(e)||"fixed"===iu(e).position)return null;if(t)return t(e);let n=e.offsetParent;return $d(e)===n&&(n=n.ownerDocument.body),n}function _u(e,t){const n=Bd(e);if(Qd(e))return n;if(!Hd(e)){let t=lu(e);for(;t&&!au(t);){if(Yd(t)&&!Nu(t))return t;t=lu(t)}return n}let o=Cu(e,t);for(;o&&Zd(o)&&Nu(o);)o=Cu(o,t);return o&&au(o)&&Nu(o)&&!nu(o)?n:o||function(e){let t=lu(e);for(;Hd(t)&&!au(t);){if(nu(t))return t;if(Qd(t))return null;t=lu(t)}return null}(e)||n}const Du={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a="fixed"===r,i=$d(o),s=!!t&&Qd(t.floating);if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=fd(1);const d=fd(0),u=Hd(o);if((u||!u&&!a)&&(("body"!==Wd(o)||Vd(i))&&(l=su(o)),Hd(o))){const e=gu(o);c=mu(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const p=!i||u||a?fd(0):yu(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}},getDocumentElement:$d,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[..."clippingAncestors"===n?Qd(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=du(e,[],!1).filter(e=>Yd(e)&&"body"!==Wd(e)),r=null;const a="fixed"===iu(e).position;let i=a?lu(e):e;for(;Yd(i)&&!au(i);){const t=iu(i),n=nu(i);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&r&&bu.has(r.position)||Vd(i)&&!n&&ku(e,i))?o=o.filter(e=>e!==i):r=t,i=lu(i)}return t.set(e,o),o}(t,this._c):[].concat(n),o],i=a[0],s=a.reduce((e,n)=>{const o=wu(t,n,r);return e.top=dd(o.top,e.top),e.right=cd(o.right,e.right),e.bottom=cd(o.bottom,e.bottom),e.left=dd(o.left,e.left),e},wu(t,i,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:_u,getElementRects:async function(e){const t=this.getOffsetParent||_u,n=this.getDimensions,o=await n(e.floating);return{reference:ju(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=pu(e);return{width:t,height:n}},getScale:mu,isElement:Yd,isRTL:function(e){return"rtl"===iu(e).direction}};function Su(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Eu(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=fu(e),d=r||a?[...c?du(c):[],...du(t)]:[];d.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const u=c&&s?function(e,t){let n,o=null;const r=$d(e);function a(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:d,top:u,width:p,height:f}=c;if(s||t(),!p||!f)return;const m={rootMargin:-pd(u)+"px "+-pd(r.clientWidth-(d+p))+"px "+-pd(r.clientHeight-(u+f))+"px "+-pd(d)+"px",threshold:dd(0,cd(1,l))||1};let h=!0;function v(t){const o=t[0].intersectionRatio;if(o!==l){if(!h)return i();o?i(!1,o):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||Su(c,e.getBoundingClientRect())||i(),h=!1}try{o=new IntersectionObserver(v,{...m,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(v,m)}o.observe(e)}(!0),a}(c,n):null;let p,f=-1,m=null;i&&(m=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let h=l?gu(e):null;return l&&function t(){const o=gu(e);h&&!Su(h,o)&&n();h=o,p=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{r&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const Mu=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,a=await(null==o.isRTL?void 0:o.isRTL(r.floating)),i=xd(n),s=yd(n),l="y"===jd(n),c=zd.has(i)?-1:1,d=a&&l?-1:1,u=gd(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof m&&(f="end"===s?-1*m:m),l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:i}}}}},Ou=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=gd(e,t),c={x:n,y:o},d=await Ad(t,l),u=jd(xd(r)),p=bd(u);let f=c[p],m=c[u];if(a){const e="y"===p?"bottom":"right";f=vd(f+d["y"===p?"top":"left"],f,f-d[e])}if(i){const e="y"===u?"bottom":"right";m=vd(m+d["y"===u?"top":"left"],m,m-d[e])}const h=s.fn({...t,[p]:f,[u]:m});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:a,[u]:i}}}}}},Tu=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=gd(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const g=xd(r),x=jd(s),y=xd(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(y||!h?[Od(s)]:function(e){const t=Od(e);return[Cd(e),t,Cd(t)]}(s)),k="none"!==m;!p&&k&&w.push(...Md(s,h,m,b));const j=[s,...w],N=await Ad(t,v),C=[];let _=(null==(o=a.flip)?void 0:o.overflows)||[];if(d&&C.push(N[g]),u){const e=function(e,t,n){void 0===n&&(n=!1);const o=yd(e),r=Nd(e),a=wd(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Od(i)),[i,Od(i)]}(r,i,b);C.push(N[e[0]],N[e[1]])}if(_=[..._,{placement:r,overflows:C}],!C.every(e=>e<=0)){var D,S;const e=((null==(D=a.flip)?void 0:D.index)||0)+1,t=j[e];if(t){if(!("alignment"===u&&x!==jd(t))||_.every(e=>jd(e.placement)!==x||e.overflows[0]>0))return{data:{index:e,overflows:_},reset:{placement:t}}}let n=null==(S=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:S.placement;if(!n)switch(f){case"bestFit":{var E;const e=null==(E=_.filter(e=>{if(k){const t=jd(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:E[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},Ru=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=gd(e,t),d=await Ad(t,c),u=xd(r),p=yd(r),f="y"===jd(r),{width:m,height:h}=a.floating;let v,g;"top"===u||"bottom"===u?(v=u,g=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(g=u,v="end"===p?"top":"bottom");const x=h-d.top-d.bottom,y=m-d.left-d.right,b=cd(h-d[v],x),w=cd(m-d[g],y),k=!t.middlewareData.shift;let j=b,N=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(N=y),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(j=x),k&&!p){const e=dd(d.left,0),t=dd(d.right,0),n=dd(d.top,0),o=dd(d.bottom,0);f?N=m-2*(0!==e||0!==t?e+t:dd(d.left,d.right)):j=h-2*(0!==n||0!==o?n+o:dd(d.top,d.bottom))}await l({...t,availableWidth:N,availableHeight:j});const C=await i.getDimensions(s.floating);return m!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}},Pu=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=gd(e,t);switch(o){case"referenceHidden":{const e=Id(await Ad(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Fd(e)}}}case"escaped":{const e=Id(await Ad(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Fd(e)}}}default:return{}}}}},Au=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=gd(e,t)||{};if(null==c)return{};const u=Td(d),p={x:n,y:o},f=Nd(r),m=wd(f),h=await i.getDimensions(c),v="y"===f,g=v?"top":"left",x=v?"bottom":"right",y=v?"clientHeight":"clientWidth",b=a.reference[m]+a.reference[f]-p[f]-a.floating[m],w=p[f]-a.reference[f],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let j=k?k[y]:0;j&&await(null==i.isElement?void 0:i.isElement(k))||(j=s.floating[y]||a.floating[m]);const N=b/2-w/2,C=j/2-h[m]/2-1,_=cd(u[g],C),D=cd(u[x],C),S=_,E=j-h[m]-D,M=j/2-h[m]/2+N,O=vd(S,M,E),T=!l.arrow&&null!=yd(r)&&M!==O&&a.reference[m]/2-(M<S?_:D)-h[m]/2<0,R=T?M<S?M-S:M-E:0;return{[f]:p[f]+R,data:{[f]:O,centerOffset:M-O-R,...T&&{alignmentOffset:R}},reset:T}}}),Iu=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=gd(e,t),d={x:n,y:o},u=jd(r),p=bd(u);let f=d[p],m=d[u];const h=gd(s,t),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const e="y"===p?"height":"width",t=a.reference[p]-a.floating[e]+v.mainAxis,n=a.reference[p]+a.reference[e]-v.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var g,x;const e="y"===p?"width":"height",t=zd.has(xd(r)),n=a.reference[u]-a.floating[e]+(t&&(null==(g=i.offset)?void 0:g[u])||0)+(t?0:v.crossAxis),o=a.reference[u]+a.reference[e]+(t?0:(null==(x=i.offset)?void 0:x[u])||0)-(t?v.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[p]:f,[u]:m}}}},Fu=(e,t,n)=>{const o=new Map,r={platform:Du,...n},a={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=Pd(c,o,l),p=o,f={},m=0;for(let n=0;n<s.length;n++){const{name:a,fn:h}=s[n],{x:v,y:g,data:x,reset:y}=await h({x:d,y:u,initialPlacement:o,placement:p,strategy:r,middlewareData:f,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=g?g:u,f={...f,[a]:{...f[a],...x}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await i.getElementRects({reference:e,floating:t,strategy:r}):y.rects),({x:d,y:u}=Pd(c,p,l))),n=-1)}return{x:d,y:u,placement:p,strategy:r,middlewareData:f}})(e,t,{...r,platform:a})};var zu="undefined"!=typeof document?e.useLayoutEffect:function(){};function Lu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!Lu(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!Lu(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Wu(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bu(e,t){const n=Wu(e);return Math.round(t*n)/n}function $u(e){const t=r.useRef(e);return zu(()=>{t.current=e}),t}function qu(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[p,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=r.useState(o);Lu(m,o)||h(o);const[v,g]=r.useState(null),[x,y]=r.useState(null),b=r.useCallback(e=>{e!==N.current&&(N.current=e,g(e))},[]),w=r.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),k=s||v,j=l||x,N=r.useRef(null),C=r.useRef(null),_=r.useRef(p),D=null!=d,S=$u(d),E=$u(i),M=$u(u),O=r.useCallback(()=>{if(!N.current||!C.current)return;const e={placement:t,strategy:n,middleware:m};E.current&&(e.platform=E.current),Fu(N.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==M.current};T.current&&!Lu(_.current,t)&&(_.current=t,a.flushSync(()=>{f(t)}))})},[m,t,n,E,M]);zu(()=>{!1===u&&_.current.isPositioned&&(_.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const T=r.useRef(!1);zu(()=>(T.current=!0,()=>{T.current=!1}),[]),zu(()=>{if(k&&(N.current=k),j&&(C.current=j),k&&j){if(S.current)return S.current(k,j,O);O()}},[k,j,O,S,D]);const R=r.useMemo(()=>({reference:N,floating:C,setReference:b,setFloating:w}),[b,w]),P=r.useMemo(()=>({reference:k,floating:j}),[k,j]),A=r.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=Bu(P.floating,p.x),o=Bu(P.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...Wu(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}},[n,c,P.floating,p.x,p.y]);return r.useMemo(()=>({...p,update:O,refs:R,elements:P,floatingStyles:A}),[p,O,R,P,A])}const Yu=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:o}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?Au({element:n.current,padding:o}).fn(t):{}:n?Au({element:n,padding:o}).fn(t):{};var r}}),Hu=(e,t)=>({...Mu(e),options:[e,t]}),Ku=(e,t)=>({...Ou(e),options:[e,t]}),Uu=(e,t)=>({...Iu(e),options:[e,t]}),Vu=(e,t)=>({...Tu(e),options:[e,t]}),Gu=(e,t)=>({...Ru(e),options:[e,t]}),Zu=(e,t)=>({...Pu(e),options:[e,t]}),Xu=(e,t)=>({...Yu(e),options:[e,t]});var Qu=r.forwardRef((e,n)=>{const{children:o,width:r=10,height:a=5,...i}=e;return t.jsx($n.svg,{...i,ref:n,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});Qu.displayName="Arrow";var Ju=Qu;var ep="Popper",[tp,np]=En(ep),[op,rp]=tp(ep),ap=e=>{const{__scopePopper:n,children:o}=e,[a,i]=r.useState(null);return t.jsx(op,{scope:n,anchor:a,onAnchorChange:i,children:o})};ap.displayName=ep;var ip="PopperAnchor",sp=r.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:a,...i}=e,s=rp(ip,o),c=r.useRef(null),d=l(n,c),u=r.useRef(null);return r.useEffect(()=>{const e=u.current;u.current=a?.current||c.current,e!==u.current&&s.onAnchorChange(u.current)}),a?null:t.jsx($n.div,{...i,ref:d})});sp.displayName=ip;var lp="PopperContent",[cp,dp]=tp(lp),up=r.forwardRef((e,n)=>{const{__scopePopper:o,side:a="bottom",sideOffset:i=0,align:s="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:u=!0,collisionBoundary:p=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:h=!1,updatePositionStrategy:v="optimized",onPlaced:g,...x}=e,y=rp(lp,o),[b,w]=r.useState(null),k=l(n,e=>w(e)),[j,N]=r.useState(null),C=function(e){const[t,n]=r.useState(void 0);return Tn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,a;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(j),_=C?.width??0,D=C?.height??0,S=a+("center"!==s?"-"+s:""),E="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},M=Array.isArray(p)?p:[p],O=M.length>0,T={padding:E,boundary:M.filter(hp),altBoundary:O},{refs:R,floatingStyles:P,placement:A,isPositioned:I,middlewareData:F}=qu({strategy:"fixed",placement:S,whileElementsMounted:(...e)=>Eu(...e,{animationFrame:"always"===v}),elements:{reference:y.anchor},middleware:[Hu({mainAxis:i+D,alignmentAxis:c}),u&&Ku({mainAxis:!0,crossAxis:!1,limiter:"partial"===m?Uu():void 0,...T}),u&&Vu({...T}),Gu({...T,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),j&&Xu({element:j,padding:d}),vp({arrowWidth:_,arrowHeight:D}),h&&Zu({strategy:"referenceHidden",...T})]}),[z,L]=gp(A),W=qn(g);Tn(()=>{I&&W?.()},[I,W]);const B=F.arrow?.x,$=F.arrow?.y,q=0!==F.arrow?.centerOffset,[Y,H]=r.useState();return Tn(()=>{b&&H(window.getComputedStyle(b).zIndex)},[b]),t.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:I?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(cp,{scope:o,placedSide:z,onArrowChange:N,arrowX:B,arrowY:$,shouldHideArrow:q,children:t.jsx($n.div,{"data-side":z,"data-align":L,...x,ref:k,style:{...x.style,animation:I?void 0:"none"}})})})});up.displayName=lp;var pp="PopperArrow",fp={top:"bottom",right:"left",bottom:"top",left:"right"},mp=r.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,a=dp(pp,o),i=fp[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(Ju,{...r,ref:n,style:{...r.style,display:"block"}})})});function hp(e){return null!==e}mp.displayName=pp;var vp=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=gp(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(r.arrow?.x??0)+i/2,p=(r.arrow?.y??0)+s/2;let f="",m="";return"bottom"===l?(f=a?d:`${u}px`,m=-s+"px"):"top"===l?(f=a?d:`${u}px`,m=`${o.floating.height+s}px`):"right"===l?(f=-s+"px",m=a?d:`${p}px`):"left"===l&&(f=`${o.floating.width+s}px`,m=a?d:`${p}px`),{data:{x:f,y:m}}}});function gp(e){const[t,n="center"]=e.split("-");return[t,n]}var xp=ap,yp=sp,bp=up,wp=mp,kp="Popover",[jp]=En(kp,[np]),Np=np(),[Cp,_p]=jp(kp),Dp=e=>{const{__scopePopover:n,children:o,open:a,defaultOpen:i,onOpenChange:s,modal:l=!1}=e,c=Np(n),d=r.useRef(null),[u,p]=r.useState(!1),[f,m]=Fn({prop:a,defaultProp:i??!1,onChange:s,caller:kp});return t.jsx(xp,{...c,children:t.jsx(Cp,{scope:n,contentId:An(),triggerRef:d,open:f,onOpenChange:m,onOpenToggle:r.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:r.useCallback(()=>p(!0),[]),onCustomAnchorRemove:r.useCallback(()=>p(!1),[]),modal:l,children:o})})};Dp.displayName=kp;var Sp="PopoverAnchor";r.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,i=_p(Sp,o),s=Np(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=i;return r.useEffect(()=>(l(),()=>c()),[l,c]),t.jsx(yp,{...s,...a,ref:n})}).displayName=Sp;var Ep="PopoverTrigger",Mp=r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=_p(Ep,o),i=Np(o),s=l(n,a.triggerRef),c=t.jsx($n.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":$p(a.open),...r,ref:s,onClick:On(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:t.jsx(yp,{asChild:!0,...i,children:c})});Mp.displayName=Ep;var Op="PopoverPortal",[Tp,Rp]=jp(Op,{forceMount:void 0}),Pp=e=>{const{__scopePopover:n,forceMount:o,children:r,container:a}=e,i=_p(Op,n);return t.jsx(Tp,{scope:n,forceMount:o,children:t.jsx(co,{present:o||i.open,children:t.jsx(lo,{asChild:!0,container:a,children:r})})})};Pp.displayName=Op;var Ap="PopoverContent",Ip=r.forwardRef((e,n)=>{const o=Rp(Ap,e.__scopePopover),{forceMount:r=o.forceMount,...a}=e,i=_p(Ap,e.__scopePopover);return t.jsx(co,{present:r||i.open,children:i.modal?t.jsx(zp,{...a,ref:n}):t.jsx(Lp,{...a,ref:n})})});Ip.displayName=Ap;var Fp=zn("PopoverContent.RemoveScroll"),zp=r.forwardRef((e,n)=>{const o=_p(Ap,e.__scopePopover),a=r.useRef(null),i=l(n,a),s=r.useRef(!1);return r.useEffect(()=>{const e=a.current;if(e)return ir(e)},[]),t.jsx(Jo,{as:Fp,allowPinchZoom:!0,children:t.jsx(Wp,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:On(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:On(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;s.current=o},{checkForDefaultPrevented:!1}),onFocusOutside:On(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Lp=r.forwardRef((e,n)=>{const o=_p(Ap,e.__scopePopover),a=r.useRef(!1),i=r.useRef(!1);return t.jsx(Wp,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||o.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const n=t.target,r=o.triggerRef.current?.contains(n);r&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),Wp=r.forwardRef((e,n)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,f=_p(Ap,o),m=Np(o);return fo(),t.jsx(to,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(bp,{"data-state":$p(f.open),role:"dialog",id:f.contentId,...m,...p,ref:n,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Bp="PopoverClose";r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=_p(Bp,o);return t.jsx($n.button,{type:"button",...r,ref:n,onClick:On(e.onClick,()=>a.onOpenChange(!1))})}).displayName=Bp;function $p(e){return e?"open":"closed"}r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=Np(o);return t.jsx(wp,{...a,...r,ref:n})}).displayName="PopoverArrow";var qp=Pp,Yp=Ip;const Hp=Dp,Kp=Mp,Up=r.forwardRef(({className:e,align:n="center",sideOffset:o=4,...r},a)=>t.jsx(qp,{children:t.jsx(Yp,{ref:a,align:n,sideOffset:o,"data-slot":"popover-content",className:Ie("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 origin-[--radix-popover-content-transform-origin]",e),...r})}));function Vp({items:e,value:n,onChange:o,placeholder:a="Select an option...",emptyMessage:i="No items found.",className:s,searchPlaceholder:l="Search...",onSearchChange:c,filterLocally:d=!0,loading:u=!1,displayLabel:p,disabled:f=!1}){const[m,h]=r.useState(!1),[v,g]=r.useState(""),[x,y]=r.useState(null);r.useEffect(()=>{if(!n||""===n)return void y(null);const t=e?.find(e=>String(e.value)===String(n));t&&y(t)},[n,e]);const b=d&&v?e?.filter(e=>e.label.toLowerCase().includes(v.toLowerCase())):e,w=p??x?.label??a,k=!p&&!x;return t.jsxs(Hp,{open:m,onOpenChange:h,children:[t.jsx(Kp,{asChild:!0,children:t.jsxs("button",{type:"button","data-cy":"combobox-trigger",disabled:f,"aria-expanded":m,className:Ie(We,"justify-between truncate",k&&Be,s),children:[t.jsx("span",{className:"truncate",children:w}),t.jsx(ai,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}),t.jsx(Up,{className:"max-w-[700px] p-0 w-full min-w-(--radix-popover-trigger-width)",children:t.jsxs(nd,{shouldFilter:!1,children:[t.jsx(od,{"data-cy":"combobox-input",placeholder:l,value:v,onValueChange:e=>{g(e),c?.(e)},className:"h-9 focus:ring-0 focus:outline-none focus-visible:ring-0 focus-visible:ring-offset-0"}),t.jsxs(rd,{"data-cy":"combobox-list",children:[t.jsx(ad,{children:u?"Loading...":i}),t.jsx(id,{children:b?.map(e=>t.jsxs(sd,{value:String(e?.value??""),onSelect:t=>((e,t)=>{const r=e===n?null:t;o(r?.value??"",r),h(!1),g(""),y(r)})(t,e),className:Ie("cursor-pointer",$e),children:[e.label,t.jsx(ei,{className:Ie("ml-auto size-4",String(n)===String(e.value)?"opacity-100":"opacity-0")})]},e?.value))})]})]})})]})}Up.displayName=Yp.displayName;const Gp={},Zp=({id:n,fetcher:o,resolveValue:r,modelClass:a,labelName:i,valueField:s="pk",placeholder:l="Select item...",emptyMessage:c="No items found",value:d,onChange:u,additionalFilters:p=Gp,fields:f,className:m,debounceWait:h=300})=>{const v=e.useMemo(()=>p??Gp,[p]),[g,x]=e.useState([]),[y,b]=e.useState(""),[w,k]=e.useState(""),[j,N]=e.useState(!1),[C,_]=e.useState();e.useEffect(()=>{const e=setTimeout(()=>{k(y)},h);return()=>clearTimeout(e)},[y,h]);const D=e.useCallback(async()=>{N(!0);try{const e=await o({search:w,modelClass:a,labelName:i,additionalFilters:v,fields:f});x(((e,t,n)=>e.map(e=>({value:e[n]??e.id??e.pk,label:String(e[t]??e.name??e.pk??""),...e})))(e,i,s))}catch(e){console.error("FKSelect fetch error:",e),x([])}finally{N(!1)}},[o,w,a,i,v,f,s]);e.useEffect(()=>{D()},[D]);const S=g.find(e=>String(e.value)===String(d))?.label;e.useEffect(()=>{if(!d)return void _(void 0);if(S)return void _(S);if(!r)return void _(void 0);let e=!0;return r({modelClass:a,value:d}).then(t=>{if(!e||!t)return;const n=String(t[i]??t.name??d);_(n)}).catch(e=>{console.error("FKSelect resolve error:",e)}),()=>{e=!1}},[d,S,r,a,i]);return t.jsx("div",{"data-testid":n,className:Ie("flex w-full min-w-0",m),children:t.jsx(Vp,{items:g,placeholder:l,emptyMessage:c,value:d?String(d):null,onChange:(e,t)=>{t&&u(e,t)},onSearchChange:b,filterLocally:!1,loading:j,displayLabel:C,className:"w-full"})})};function Xp(e,[t,n]){return Math.min(n,Math.max(t,e))}function Qp(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var Jp,ef="dismissableLayer.update",tf="dismissableLayer.pointerDownOutside",nf="dismissableLayer.focusOutside",of=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),rf=r.forwardRef((e,n)=>{const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...u}=e,p=r.useContext(of),[f,m]=r.useState(null),h=f?.ownerDocument??globalThis?.document,[,v]=r.useState({}),g=Rs(n,e=>m(e)),x=Array.from(p.layers),[y]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),b=x.indexOf(y),w=f?x.indexOf(f):-1,k=p.layersWithOutsidePointerEventsDisabled.size>0,j=w>=b,N=r.useRef(!1),C=function(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i}=t,s=Qp(e),l=r.useRef(!1),c=r.useRef(!1),d=r.useRef(new Map),u=r.useRef(()=>{});return r.useEffect(()=>{function e(){c.current=!1,a.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function r(e){if(!c.current)return;const t=e.target;t instanceof Node&&[...i].some(e=>e.contains(t))||d.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&u.current()},0)}function p(e){c.current&&d.current.set(e.type,!1)}const f=r=>{if(r.target&&!l.current){let i=function(){n.removeEventListener("click",u.current);const o=t();e(),o||sf(tf,s,l,{discrete:!0})};const l={originalEvent:r};c.current=!0,a.current=o&&0===r.button,d.current.clear(),o&&0===r.button?(n.removeEventListener("click",u.current),u.current=i,n.addEventListener("click",u.current,{once:!0})):i()}else n.removeEventListener("click",u.current),e();l.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const e of m)n.addEventListener(e,r,!0),n.addEventListener(e,p);const h=window.setTimeout(()=>{n.addEventListener("pointerdown",f)},0);return()=>{window.clearTimeout(h),n.removeEventListener("pointerdown",f),n.removeEventListener("click",u.current);for(const e of m)n.removeEventListener(e,r,!0),n.removeEventListener(e,p)}},[n,s,o,a,i]),{onPointerDownCapture:()=>l.current=!0}}(e=>{const t=e.target;if(!(t instanceof Node))return;const n=[...p.branches].some(e=>e.contains(t));j&&!n&&(s?.(e),c?.(e),e.defaultPrevented||d?.())},{ownerDocument:h,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:p.dismissableSurfaces}),_=function(e,t=globalThis?.document){const n=Qp(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){sf(nf,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{if(a&&N.current)return;const t=e.target;[...p.branches].some(e=>e.contains(t))||(l?.(e),c?.(e),e.defaultPrevented||d?.())},h);return function(e,t=globalThis?.document){const n=Qp(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===p.layers.size-1&&(i?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))},h),r.useEffect(()=>{if(f)return o&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(Jp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(f)),p.layers.add(f),af(),()=>{o&&(p.layersWithOutsidePointerEventsDisabled.delete(f),0===p.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Jp))}},[f,h,o,p]),r.useEffect(()=>()=>{f&&(p.layers.delete(f),p.layersWithOutsidePointerEventsDisabled.delete(f),af())},[f,p]),r.useEffect(()=>{const e=()=>v({});return document.addEventListener(ef,e),()=>document.removeEventListener(ef,e)},[]),t.jsx(Us.div,{...u,ref:g,style:{pointerEvents:k?j?"auto":"none":void 0,...e.style},onFocusCapture:qs(e.onFocusCapture,_.onFocusCapture),onBlurCapture:qs(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:qs(e.onPointerDownCapture,C.onPointerDownCapture)})});rf.displayName="DismissableLayer";function af(){const e=new CustomEvent(ef);document.dispatchEvent(e)}function sf(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Vs(r,a):r.dispatchEvent(a)}r.forwardRef((e,n)=>{const o=r.useContext(of),a=r.useRef(null),i=Rs(n,a);return r.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),t.jsx(Us.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var lf=0,cf=null;function df(){r.useEffect(()=>{cf||(cf={start:uf(),end:uf()});const{start:e,end:t}=cf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),lf++,()=>{1===lf&&(cf?.start.remove(),cf?.end.remove(),cf=null),lf=Math.max(0,lf-1)}},[])}function uf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var pf="focusScope.autoFocusOnMount",ff="focusScope.autoFocusOnUnmount",mf={bubbles:!1,cancelable:!0},hf=r.forwardRef((e,n)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,d]=r.useState(null),u=Qp(i),p=Qp(s),f=r.useRef(null),m=Rs(n,e=>d(e)),h=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(a){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:yf(f.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||yf(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&yf(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return c&&o.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[a,c,h.paused]),r.useEffect(()=>{if(c){bf.add(h);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(pf,mf);c.addEventListener(pf,u),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(yf(o,{select:t}),document.activeElement!==n)return}((e=vf(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&yf(c))}return()=>{c.removeEventListener(pf,u),setTimeout(()=>{const e=new CustomEvent(ff,mf);c.addEventListener(ff,p),c.dispatchEvent(e),e.defaultPrevented||yf(t??document.body,{select:!0}),c.removeEventListener(ff,p),bf.remove(h)},0)}}var e},[c,u,p,h]);const v=r.useCallback(e=>{if(!o&&!a)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=vf(e),n=gf(t,e),o=gf(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&yf(a,{select:!0})):(e.preventDefault(),o&&yf(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return t.jsx(Us.div,{tabIndex:-1,...l,ref:m,onKeyDown:v})});function vf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gf(e,t){for(const n of e)if(!xf(n,{upTo:t}))return n}function xf(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function yf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}hf.displayName="FocusScope";var bf=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=wf(e,t),e.unshift(t)},remove(t){e=wf(e,t),e[0]?.resume()}}}();function wf(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var kf=r.forwardRef((e,n)=>{const{children:o,width:r=10,height:a=5,...i}=e;return t.jsx(Us.svg,{...i,ref:n,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});kf.displayName="Arrow";var jf=kf;function Nf(e){const[t,n]=r.useState(void 0);return Ys(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,a;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var Cf="Popper",[_f,Df]=Es(Cf),[Sf,Ef]=_f(Cf),Mf=e=>{const{__scopePopper:n,children:o}=e,[a,i]=r.useState(null),[s,l]=r.useState(void 0);return t.jsx(Sf,{scope:n,anchor:a,onAnchorChange:i,placementState:s,setPlacementState:l,children:o})};Mf.displayName=Cf;var Of="PopperAnchor",Tf=r.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:a,...i}=e,s=Ef(Of,o),l=r.useRef(null),c=s.onAnchorChange,d=Rs(n,r.useCallback(e=>{l.current=e,e&&c(e)},[c])),u=r.useRef(null);r.useEffect(()=>{if(!a)return;const e=u.current;u.current=a.current,e!==u.current&&c(u.current)});const p=s.placementState&&$f(s.placementState),f=p?.[0],m=p?.[1];return a?null:t.jsx(Us.div,{"data-radix-popper-side":f,"data-radix-popper-align":m,...i,ref:d})});Tf.displayName=Of;var Rf="PopperContent",[Pf,Af]=_f(Rf),If=r.forwardRef((e,n)=>{const{__scopePopper:o,side:a="bottom",sideOffset:i=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=e,x=Ef(Rf,o),[y,b]=r.useState(null),w=Rs(n,e=>b(e)),[k,j]=r.useState(null),N=Nf(k),C=N?.width??0,_=N?.height??0,D=a+("center"!==s?"-"+s:""),S="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},E=Array.isArray(u)?u:[u],M=E.length>0,O={padding:S,boundary:E.filter(Wf),altBoundary:M},{refs:T,floatingStyles:R,placement:P,isPositioned:A,middlewareData:I}=qu({strategy:"fixed",placement:D,whileElementsMounted:(...e)=>Eu(...e,{animationFrame:"always"===h}),elements:{reference:x.anchor},middleware:[Hu({mainAxis:i+_,alignmentAxis:l}),d&&Ku({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Uu():void 0,...O}),d&&Vu({...O}),Gu({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),k&&Xu({element:k,padding:c}),Bf({arrowWidth:C,arrowHeight:_}),m&&Zu({strategy:"referenceHidden",...O,boundary:M?O.boundary:void 0})]}),F=x.setPlacementState;Ys(()=>(F(P),()=>{F(void 0)}),[P,F]);const[z,L]=$f(P),W=Qp(v);Ys(()=>{A&&W?.()},[A,W]);const B=I.arrow?.x,$=I.arrow?.y,q=0!==I.arrow?.centerOffset,[Y,H]=r.useState();return Ys(()=>{y&&H(window.getComputedStyle(y).zIndex)},[y]),t.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:A?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Pf,{scope:o,placedSide:z,placedAlign:L,onArrowChange:j,arrowX:B,arrowY:$,shouldHideArrow:q,children:t.jsx(Us.div,{"data-side":z,"data-align":L,...g,ref:w,style:{...g.style,animation:A?void 0:"none"}})})})});If.displayName=Rf;var Ff="PopperArrow",zf={top:"bottom",right:"left",bottom:"top",left:"right"},Lf=r.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,a=Af(Ff,o),i=zf[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(jf,{...r,ref:n,style:{...r.style,display:"block"}})})});function Wf(e){return null!==e}Lf.displayName=Ff;var Bf=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=$f(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(r.arrow?.x??0)+i/2,p=(r.arrow?.y??0)+s/2;let f="",m="";return"bottom"===l?(f=a?d:`${u}px`,m=-s+"px"):"top"===l?(f=a?d:`${u}px`,m=`${o.floating.height+s}px`):"right"===l?(f=-s+"px",m=a?d:`${p}px`):"left"===l&&(f=`${o.floating.width+s}px`,m=a?d:`${p}px`),{data:{x:f,y:m}}}});function $f(e){const[t,n="center"]=e.split("-");return[t,n]}var qf=Mf,Yf=Tf,Hf=If,Kf=Lf,Uf=r.forwardRef((e,n)=>{const{container:o,...i}=e,[s,l]=r.useState(!1);Ys(()=>l(!0),[]);const c=o||s&&globalThis?.document?.body;return c?a.createPortal(t.jsx(Us.div,{...i,ref:n}),c):null});function Vf(e){const t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Uf.displayName="Portal";var Gf=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"}),Zf=r.forwardRef((e,n)=>t.jsx(Us.span,{...e,ref:n,style:{...Gf,...e.style}}));Zf.displayName="VisuallyHidden";var Xf=Zf,Qf=[" ","Enter","ArrowUp","ArrowDown"],Jf=[" ","Enter"],em="Select",[tm,nm,om]=$s(em),[rm]=Es(em,[om,Df]),am=Df(),[im,sm]=rm(em),[lm,cm]=rm(em);function dm(e){const{__scopeSelect:n,children:o,open:a,defaultOpen:i,onOpenChange:s,value:l,defaultValue:c,onValueChange:d,dir:u,name:p,autoComplete:f,disabled:m,required:h,form:v,internal_do_not_use_render:g}=e,x=am(n),[y,b]=r.useState(null),[w,k]=r.useState(null),[j,N]=r.useState(!1),C=gl(u),[_,D]=Ks({prop:a,defaultProp:i??!1,onChange:s,caller:em}),[S,E]=Ks({prop:l,defaultProp:c,onChange:d,caller:em}),M=r.useRef(null),O=!y||(!!v||!!y.closest("form")),[T,R]=r.useState(new Set),P=el(),A=Array.from(T).map(e=>e.props.value).join(";"),I=r.useCallback(e=>{R(t=>new Set(t).add(e))},[]),F=r.useCallback(e=>{R(t=>{const n=new Set(t);return n.delete(e),n})},[]),z={required:h,trigger:y,onTriggerChange:b,valueNode:w,onValueNodeChange:k,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:P,value:S,onValueChange:E,open:_,onOpenChange:D,dir:C,triggerPointerDownPosRef:M,disabled:m,name:p,autoComplete:f,form:v,nativeOptions:T,nativeSelectKey:A,isFormControl:O};return t.jsx(qf,{...x,children:t.jsx(im,{scope:n,...z,children:t.jsx(tm.Provider,{scope:n,children:t.jsx(lm,{scope:n,onNativeOptionAdd:I,onNativeOptionRemove:F,children:rh(g)?g(z):o})})})})}dm.displayName="SelectProvider";var um=e=>{const{__scopeSelect:n,children:o,...r}=e;return t.jsx(dm,{__scopeSelect:n,...r,internal_do_not_use_render:({isFormControl:e})=>t.jsxs(t.Fragment,{children:[o,e?t.jsx(oh,{__scopeSelect:n}):null]})})};um.displayName=em;var pm="SelectTrigger",fm=r.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:a=!1,...i}=e,s=am(o),l=sm(pm,o),c=l.disabled||a,d=Rs(n,l.onTriggerChange),u=nm(o),p=r.useRef("touch"),[f,m,h]=ih(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),o=sh(t,e,n);void 0!==o&&l.onValueChange(o.value)}),v=e=>{c||(l.onOpenChange(!0),h()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(Yf,{asChild:!0,...s,children:t.jsx(Us.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ah(l.value)?"":void 0,...i,ref:d,onClick:qs(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:qs(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:qs(i.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),t&&" "===e.key||Qf.includes(e.key)&&(v(),e.preventDefault())})})})});fm.displayName=pm;var mm="SelectValue",hm=r.forwardRef((e,n)=>{const{__scopeSelect:o,className:a,style:i,children:s,placeholder:l="",...c}=e,d=sm(mm,o),{onValueNodeHasChildrenChange:u}=d,p=void 0!==s,f=Rs(n,d.onValueNodeChange);Ys(()=>{u(p)},[u,p]);const m=ah(d.value);return t.jsx(Us.span,{...c,asChild:!m&&c.asChild,ref:f,style:{pointerEvents:"none"},children:t.jsx(r.Fragment,{children:m?l:s},m?"placeholder":"value")})});hm.displayName=mm;var vm=r.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,...a}=e;return t.jsx(Us.span,{"aria-hidden":!0,...a,ref:n,children:r||"▼"})});vm.displayName="SelectIcon";var gm="SelectPortal",[xm,ym]=rm(gm,{forceMount:void 0}),bm=e=>{const{__scopeSelect:n,forceMount:o,...r}=e;return t.jsx(xm,{scope:e.__scopeSelect,forceMount:o,children:t.jsx(Uf,{asChild:!0,...r})})};bm.displayName=gm;var wm="SelectContent",km=r.forwardRef((e,n)=>{const o=ym(wm,e.__scopeSelect),{forceMount:a=o.forceMount,...i}=e,s=sm(wm,e.__scopeSelect),[l,c]=r.useState();return Ys(()=>{c(new DocumentFragment)},[]),t.jsx(Gs,{present:a||s.open,children:({present:e})=>e?t.jsx(Sm,{...i,ref:n}):t.jsx(jm,{...i,fragment:l})})});km.displayName=wm;var jm=r.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,fragment:i}=e;return i?a.createPortal(t.jsx(Cm,{scope:o,children:t.jsx(tm.Slot,{scope:o,children:t.jsx("div",{ref:n,children:r})})}),i):null});jm.displayName="SelectContentFragment";var Nm=10,[Cm,_m]=rm(wm),Dm=Ps("SelectContent.RemoveScroll"),Sm=r.forwardRef((e,n)=>{const{__scopeSelect:o}=e,{position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:x,...y}=e,b=sm(wm,o),[w,k]=r.useState(null),[j,N]=r.useState(null),C=Rs(n,e=>k(e)),[_,D]=r.useState(null),[S,E]=r.useState(null),M=nm(o),[O,T]=r.useState(!1),R=r.useRef(!1);r.useEffect(()=>{if(w)return ir(w)},[w]),df();const P=r.useCallback(e=>{const[t,...n]=M().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&j&&(j.scrollTop=0),n===o&&j&&(j.scrollTop=j.scrollHeight),n?.focus(),document.activeElement!==r)return}},[M,j]),A=r.useCallback(()=>P([_,w]),[P,_,w]);r.useEffect(()=>{O&&A()},[O,A]);const{onOpenChange:I,triggerPointerDownPosRef:F}=b;r.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(w)||I(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,I,F]),r.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[z,L]=ih(e=>{const t=M().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=sh(t,e,n);o&&setTimeout(()=>o.ref.current?.focus())}),W=r.useCallback((e,t,n)=>{const o=!R.current&&!n;(void 0!==b.value&&b.value===t||o)&&(D(e),o&&(R.current=!0))},[b.value]),B=r.useCallback(()=>w?.focus(),[w]),$=r.useCallback((e,t,n)=>{const o=!R.current&&!n;(void 0!==b.value&&b.value===t||o)&&E(e)},[b.value]),q="popper"===a?Mm:Em,Y=q===Mm?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:x}:{};return t.jsx(Cm,{scope:o,content:w,viewport:j,onViewportChange:N,itemRefCallback:W,selectedItem:_,onItemLeave:B,itemTextRefCallback:$,focusSelectedItem:A,selectedItemText:S,position:a,isPositioned:O,searchRef:z,children:t.jsx(Jo,{as:Dm,allowPinchZoom:!0,children:t.jsx(hf,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:qs(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(rf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:t.jsx(q,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...Y,onPlaced:()=>T(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:qs(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})});Sm.displayName="SelectContentImpl";var Em=r.forwardRef((e,n)=>{const{__scopeSelect:o,onPlaced:a,...i}=e,s=sm(wm,o),l=_m(wm,o),[c,d]=r.useState(null),[u,p]=r.useState(null),f=Rs(n,e=>p(e)),m=nm(o),h=r.useRef(!1),v=r.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:y,focusSelectedItem:b}=l,w=r.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&g&&x&&y){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),o=y.getBoundingClientRect();if("rtl"!==s.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-Nm,u=Xp(a,[Nm,Math.max(Nm,d-l)]);c.style.minWidth=s+"px",c.style.left=u+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-Nm,u=Xp(a,[Nm,Math.max(Nm,d-l)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const r=m(),i=window.innerHeight-2*Nm,l=g.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),f=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),b=p+f+l+parseInt(d.paddingBottom,10)+v,w=Math.min(5*x.offsetHeight,b),k=window.getComputedStyle(g),j=parseInt(k.paddingTop,10),N=parseInt(k.paddingBottom,10),C=e.top+e.height/2-Nm,_=i-C,D=x.offsetHeight/2,S=p+f+(x.offsetTop+D),E=b-S;if(S<=C){const e=r.length>0&&x===r[r.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=S+Math.max(_,D+(e?N:0)+t+v);c.style.height=n+"px"}else{const e=r.length>0&&x===r[0].ref.current;c.style.top="0px";const t=Math.max(C,p+g.offsetTop+(e?j:0)+D)+E;c.style.height=t+"px",g.scrollTop=S-C+g.offsetTop}c.style.margin=`${Nm}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,c,u,g,x,y,s.dir,a]);Ys(()=>w(),[w]);const[k,j]=r.useState();Ys(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const N=r.useCallback(e=>{e&&!0===v.current&&(w(),b?.(),v.current=!1)},[w,b]);return t.jsx(Om,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:t.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:t.jsx(Us.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Em.displayName="SelectItemAlignedPosition";var Mm=r.forwardRef((e,n)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=Nm,...i}=e,s=am(o);return t.jsx(Hf,{...s,...i,ref:n,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Mm.displayName="SelectPopperPosition";var[Om,Tm]=rm(wm,{}),Rm="SelectViewport",Pm=r.forwardRef((e,n)=>{const{__scopeSelect:o,nonce:a,...i}=e,s=_m(Rm,o),l=Tm(Rm,o),c=Rs(n,s.onViewportChange),d=r.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),t.jsx(tm.Slot,{scope:o,children:t.jsx(Us.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qs(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=l;if(o?.current&&n){const e=Math.abs(d.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*Nm,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(r,a);if(i<o){const r=i+e,a=Math.min(o,r),s=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});Pm.displayName=Rm;var Am="SelectGroup",[Im,Fm]=rm(Am),zm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=el();return t.jsx(Im,{scope:o,id:a,children:t.jsx(Us.div,{role:"group","aria-labelledby":a,...r,ref:n})})});zm.displayName=Am;var Lm="SelectLabel",Wm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=Fm(Lm,o);return t.jsx(Us.div,{id:a.id,...r,ref:n})});Wm.displayName=Lm;var Bm="SelectItem",[$m,qm]=rm(Bm),Ym=r.forwardRef((e,n)=>{const{__scopeSelect:o,value:a,disabled:i=!1,textValue:s,...l}=e,c=sm(Bm,o),d=_m(Bm,o),u=c.value===a,[p,f]=r.useState(s??""),[m,h]=r.useState(!1),v=Rs(n,e=>d.itemRefCallback?.(e,a,i)),g=el(),x=r.useRef("touch"),y=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};return t.jsx($m,{scope:o,value:a,disabled:i,textId:g,isSelected:u,onItemTextChange:r.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:t.jsx(tm.ItemSlot,{scope:o,value:a,disabled:i,textValue:p,children:t.jsx(Us.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:v,onFocus:qs(l.onFocus,()=>h(!0)),onBlur:qs(l.onBlur,()=>h(!1)),onClick:qs(l.onClick,()=>{"mouse"!==x.current&&y()}),onPointerUp:qs(l.onPointerUp,()=>{"mouse"===x.current&&y()}),onPointerDown:qs(l.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:qs(l.onPointerMove,e=>{x.current=e.pointerType,i?d.onItemLeave?.():"mouse"===x.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qs(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:qs(l.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(Jf.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});Ym.displayName=Bm;var Hm="SelectItemText",Km=r.forwardRef((e,n)=>{const{__scopeSelect:o,className:i,style:s,...l}=e,c=sm(Hm,o),d=_m(Hm,o),u=qm(Hm,o),p=cm(Hm,o),[f,m]=r.useState(null),h=Rs(n,e=>m(e),u.onItemTextChange,e=>d.itemTextRefCallback?.(e,u.value,u.disabled)),v=f?.textContent,g=r.useMemo(()=>t.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:x,onNativeOptionRemove:y}=p;return Ys(()=>(x(g),()=>y(g)),[x,y,g]),t.jsxs(t.Fragment,{children:[t.jsx(Us.span,{id:u.textId,...l,ref:h}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!ah(c.value)?a.createPortal(l.children,c.valueNode):null]})});Km.displayName=Hm;var Um="SelectItemIndicator",Vm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return qm(Um,o).isSelected?t.jsx(Us.span,{"aria-hidden":!0,...r,ref:n}):null});Vm.displayName=Um;var Gm="SelectScrollUpButton",Zm=r.forwardRef((e,n)=>{const o=_m(Gm,e.__scopeSelect),a=Tm(Gm,e.__scopeSelect),[i,s]=r.useState(!1),l=Rs(n,a.onScrollButtonChange);return Ys(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t.jsx(Jm,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Zm.displayName=Gm;var Xm="SelectScrollDownButton",Qm=r.forwardRef((e,n)=>{const o=_m(Xm,e.__scopeSelect),a=Tm(Xm,e.__scopeSelect),[i,s]=r.useState(!1),l=Rs(n,a.onScrollButtonChange);return Ys(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t.jsx(Jm,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Qm.displayName=Xm;var Jm=r.forwardRef((e,n)=>{const{__scopeSelect:o,onAutoScroll:a,...i}=e,s=_m("SelectScrollButton",o),l=r.useRef(null),c=nm(o),d=r.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>d(),[d]),Ys(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),t.jsx(Us.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:qs(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:qs(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:qs(i.onPointerLeave,()=>{d()})})}),eh=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return t.jsx(Us.div,{"aria-hidden":!0,...r,ref:n})});eh.displayName="SelectSeparator";var th="SelectArrow";r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=am(o);return"popper"===_m(th,o).position?t.jsx(Kf,{...a,...r,ref:n}):null}).displayName=th;var nh="SelectBubbleInput",oh=r.forwardRef(({__scopeSelect:e,...n},o)=>{const a=sm(nh,e),{value:i,onValueChange:s,required:l,disabled:c,name:d,autoComplete:u,form:p}=a,{nativeOptions:f,nativeSelectKey:m}=a,h=r.useRef(null),v=Rs(o,h),g=i??"",x=Vf(g),y=Array.from(f).some(e=>""===(e.props.value??""));return r.useEffect(()=>{const e=h.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(x!==g&&n){const t=new Event("change",{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[x,g]),t.jsxs(Us.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:d,autoComplete:u,disabled:c,form:p,onChange:e=>s(e.target.value),...n,style:{...Gf,...n.style},ref:v,defaultValue:g,children:[ah(i)&&!y?t.jsx("option",{value:""}):null,Array.from(f)]},m)});function rh(e){return"function"==typeof e}function ah(e){return""===e||void 0===e}function ih(e){const t=Qp(e),n=r.useRef(""),o=r.useRef(0),a=r.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),i=r.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,a,i]}function sh(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let a=(i=e,s=Math.max(r,0),i.map((e,t)=>i[(s+t)%i.length]));var i,s;1===o.length&&(a=a.filter(e=>e!==n));const l=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}oh.displayName=nh;const lh=um,ch=zm,dh=hm,uh=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(fm,{ref:r,"data-slot":"select-trigger",className:Ie(We,"justify-between whitespace-nowrap data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1",e),...o,children:[n,t.jsx(vm,{asChild:!0,children:t.jsx(ti,{className:"h-4 w-4 opacity-50"})})]}));uh.displayName=fm.displayName;const ph=r.forwardRef(({className:e,...n},o)=>t.jsx(Zm,{ref:o,"data-slot":"select-scroll-up-button",className:Ie("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(ri,{className:"h-4 w-4"})}));ph.displayName=Zm.displayName;const fh=r.forwardRef(({className:e,...n},o)=>t.jsx(Qm,{ref:o,"data-slot":"select-scroll-down-button",className:Ie("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(ti,{className:"h-4 w-4"})}));fh.displayName=Qm.displayName;const mh=r.forwardRef(({className:e,children:n,position:o="popper",...r},a)=>t.jsx(bm,{children:t.jsxs(km,{ref:a,"data-slot":"select-content",className:Ie("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 origin-[--radix-select-content-transform-origin]","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...r,children:[t.jsx(ph,{}),t.jsx(Pm,{className:Ie("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(fh,{})]})}));mh.displayName=km.displayName;const hh=r.forwardRef(({className:e,...n},o)=>t.jsx(Wm,{ref:o,"data-slot":"select-label",className:Ie("px-2 py-1.5 text-sm font-semibold",e),...n}));hh.displayName=Wm.displayName;const vh=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(Ym,{ref:r,"data-slot":"select-item",className:Ie("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Vm,{children:t.jsx(ei,{className:"h-4 w-4"})})}),t.jsx(Km,{children:n})]}));vh.displayName=Ym.displayName;const gh=r.forwardRef(({className:e,...n},o)=>t.jsx(eh,{ref:o,"data-slot":"select-separator",className:Ie("-mx-1 my-1 h-px bg-muted",e),...n}));gh.displayName=eh.displayName;const xh=({id:n,placeholder:o,options:r,className:a,value:i,onValueChange:s,required:l,name:c})=>{const[d,u]=e.useState(i||"");e.useEffect(()=>{u(i||"")},[i]);const p=i??d;return t.jsxs(t.Fragment,{children:[c?t.jsx("input",{type:"hidden",name:c,value:p,required:l}):null,t.jsx("div",{className:Ie("flex w-full min-w-0",a),children:t.jsxs(lh,{value:p||void 0,onValueChange:e=>{u(e),s?.(e)},children:[t.jsx(uh,{"data-testid":n,className:"w-full",children:t.jsx(dh,{placeholder:o})}),t.jsx(mh,{children:r.map(e=>t.jsx(vh,{"data-testid":e.value,value:e.value,className:Ie("cursor-pointer",$e,d===e.value?"bg-accent text-accent-foreground":""),children:e.label},e.value))})]})})]})},yh=6048e5,bh=Symbol.for("constructDateFrom");function wh(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&bh in e?e[bh](t):e instanceof Date?new e.constructor(t):new Date(t)}function kh(e,t){return wh(t||e,e)}function jh(e,t,n){const o=kh(e,n?.in);return isNaN(t)?wh(e,NaN):t?(o.setDate(o.getDate()+t),o):o}function Nh(e,t,n){const o=kh(e,n?.in);if(isNaN(t))return wh(e,NaN);if(!t)return o;const r=o.getDate(),a=wh(e,o.getTime());a.setMonth(o.getMonth()+t+1,0);return r>=a.getDate()?a:(o.setFullYear(a.getFullYear(),a.getMonth(),r),o)}let Ch={};function _h(){return Ch}function Dh(e,t){const n=_h(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=kh(e,t?.in),a=r.getDay(),i=(a<o?7:0)+a-o;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Sh(e,t){return Dh(e,{...t,weekStartsOn:1})}function Eh(e,t){const n=kh(e,t?.in),o=n.getFullYear(),r=wh(n,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const a=Sh(r),i=wh(n,0);i.setFullYear(o,0,4),i.setHours(0,0,0,0);const s=Sh(i);return n.getTime()>=a.getTime()?o+1:n.getTime()>=s.getTime()?o:o-1}function Mh(e){const t=kh(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Oh(e,...t){const n=wh.bind(null,t.find(e=>"object"==typeof e));return t.map(n)}function Th(e,t){const n=kh(e,t?.in);return n.setHours(0,0,0,0),n}function Rh(e,t,n){const[o,r]=Oh(0,e,t),a=Th(o),i=Th(r),s=+a-Mh(a),l=+i-Mh(i);return Math.round((s-l)/864e5)}function Ph(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Ah(e,t,n){const[o,r]=Oh(0,e,t);return 12*(o.getFullYear()-r.getFullYear())+(o.getMonth()-r.getMonth())}function Ih(e,t){const[n,o]=Oh(0,t.start,t.end);return{start:n,end:o}}function Fh(e,t){const n=kh(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function zh(e,t){const n=_h(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=kh(e,t?.in),a=r.getDay(),i=6+(a<o?-7:0)-(a-o);return r.setDate(r.getDate()+i),r.setHours(23,59,59,999),r}const Lh={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Wh(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Bh={date:Wh({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Wh({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Wh({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$h={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function qh(e){return(t,n)=>{let o;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;o=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;o=e.values[r]||e.values[t]}return o[e.argumentCallback?e.argumentCallback(t):t]}}const Yh={ordinalNumber:(e,t)=>{const n=Number(e),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:qh({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:qh({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:qh({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:qh({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:qh({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function Hh(e){return(t,n={})=>{const o=n.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],a=t.match(r);if(!a)return null;const i=a[0],s=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,e=>e.test(i)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,e=>e.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}const Kh={ordinalNumber:(Uh={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(Uh.matchPattern);if(!n)return null;const o=n[0],r=e.match(Uh.parsePattern);if(!r)return null;let a=Uh.valueCallback?Uh.valueCallback(r[0]):r[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(o.length)}}),era:Hh({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Hh({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Hh({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Hh({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Hh({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var Uh;const Vh={code:"en-US",formatDistance:(e,t,n)=>{let o;const r=Lh[e];return o="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o},formatLong:Bh,formatRelative:(e,t,n,o)=>$h[e],localize:Yh,match:Kh,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Gh(e,t){const n=kh(e,t?.in),o=+Sh(n)-+function(e,t){const n=Eh(e,t),o=wh(e,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),Sh(o)}(n);return Math.round(o/yh)+1}function Zh(e,t){const n=kh(e,t?.in),o=n.getFullYear(),r=_h(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=wh(t?.in||e,0);i.setFullYear(o+1,0,a),i.setHours(0,0,0,0);const s=Dh(i,t),l=wh(t?.in||e,0);l.setFullYear(o,0,a),l.setHours(0,0,0,0);const c=Dh(l,t);return+n>=+s?o+1:+n>=+c?o:o-1}function Xh(e,t){const n=kh(e,t?.in),o=+Dh(n,t)-+function(e,t){const n=_h(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Zh(e,t),a=wh(t?.in||e,0);return a.setFullYear(r,0,o),a.setHours(0,0,0,0),Dh(a,t)}(n,t);return Math.round(o/yh)+1}function Qh(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Jh={y(e,t){const n=e.getFullYear(),o=n>0?n:1-n;return Qh("yy"===t?o%100:o,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):Qh(n+1,2)},d:(e,t)=>Qh(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>Qh(e.getHours()%12||12,t.length),H:(e,t)=>Qh(e.getHours(),t.length),m:(e,t)=>Qh(e.getMinutes(),t.length),s:(e,t)=>Qh(e.getSeconds(),t.length),S(e,t){const n=t.length,o=e.getMilliseconds();return Qh(Math.trunc(o*Math.pow(10,n-3)),t.length)}},ev="midnight",tv="noon",nv="morning",ov="afternoon",rv="evening",av="night",iv={G:function(e,t,n){const o=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});default:return n.era(o,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),o=t>0?t:1-t;return n.ordinalNumber(o,{unit:"year"})}return Jh.y(e,t)},Y:function(e,t,n,o){const r=Zh(e,o),a=r>0?r:1-r;if("YY"===t){return Qh(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):Qh(a,t.length)},R:function(e,t){return Qh(Eh(e),t.length)},u:function(e,t){return Qh(e.getFullYear(),t.length)},Q:function(e,t,n){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return Qh(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,t,n){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return Qh(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,t,n){const o=e.getMonth();switch(t){case"M":case"MM":return Jh.M(e,t);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(e,t,n){const o=e.getMonth();switch(t){case"L":return String(o+1);case"LL":return Qh(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(e,t,n,o){const r=Xh(e,o);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):Qh(r,t.length)},I:function(e,t,n){const o=Gh(e);return"Io"===t?n.ordinalNumber(o,{unit:"week"}):Qh(o,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Jh.d(e,t)},D:function(e,t,n){const o=function(e,t){const n=kh(e,t?.in);return Rh(n,Fh(n))+1}(e);return"Do"===t?n.ordinalNumber(o,{unit:"dayOfYear"}):Qh(o,t.length)},E:function(e,t,n){const o=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(e,t,n,o){const r=e.getDay(),a=(r-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Qh(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,o){const r=e.getDay(),a=(r-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Qh(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const o=e.getDay(),r=0===o?7:o;switch(t){case"i":return String(r);case"ii":return Qh(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const o=e.getHours();let r;switch(r=12===o?tv:0===o?ev:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const o=e.getHours();let r;switch(r=o>=17?rv:o>=12?ov:o>=4?nv:av,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return Jh.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Jh.H(e,t)},K:function(e,t,n){const o=e.getHours()%12;return"Ko"===t?n.ordinalNumber(o,{unit:"hour"}):Qh(o,t.length)},k:function(e,t,n){let o=e.getHours();return 0===o&&(o=24),"ko"===t?n.ordinalNumber(o,{unit:"hour"}):Qh(o,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Jh.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Jh.s(e,t)},S:function(e,t){return Jh.S(e,t)},X:function(e,t,n){const o=e.getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return lv(o);case"XXXX":case"XX":return cv(o);default:return cv(o,":")}},x:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"x":return lv(o);case"xxxx":case"xx":return cv(o);default:return cv(o,":")}},O:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+sv(o,":");default:return"GMT"+cv(o,":")}},z:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+sv(o,":");default:return"GMT"+cv(o,":")}},t:function(e,t,n){return Qh(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return Qh(+e,t.length)}};function sv(e,t=""){const n=e>0?"-":"+",o=Math.abs(e),r=Math.trunc(o/60),a=o%60;return 0===a?n+String(r):n+String(r)+t+Qh(a,2)}function lv(e,t){if(e%60==0){return(e>0?"-":"+")+Qh(Math.abs(e)/60,2)}return cv(e,t)}function cv(e,t=""){const n=e>0?"-":"+",o=Math.abs(e);return n+Qh(Math.trunc(o/60),2)+t+Qh(o%60,2)}const dv=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},uv=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},pv={p:uv,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],o=n[1],r=n[2];if(!r)return dv(e,t);let a;switch(o){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",dv(o,t)).replace("{{time}}",uv(r,t))}},fv=/^D+$/,mv=/^Y+$/,hv=["D","DD","YY","YYYY"];const vv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xv=/^'([^]*?)'?$/,yv=/''/g,bv=/[a-zA-Z]/;function wv(e,t,n){const o=_h(),r=n?.locale??o.locale??Vh,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,s=kh(e,n?.in);if(!function(e){return!(!Ph(e)&&"number"!=typeof e||isNaN(+kh(e)))}(s))throw new RangeError("Invalid time value");let l=t.match(gv).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,pv[t])(e,r.formatLong)}return e}).join("").match(vv).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:kv(e)};if(iv[t])return{isToken:!0,value:e};if(t.match(bv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(l=r.localize.preprocessor(s,l));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:r};return l.map(o=>{if(!o.isToken)return o.value;const a=o.value;(!n?.useAdditionalWeekYearTokens&&function(e){return mv.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return fv.test(e)}(a))&&function(e,t,n){const o=function(e,t,n){const o="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(o),hv.includes(e))throw new RangeError(o)}(a,t,String(e));return(0,iv[a[0]])(s,a,r.localize,c)}).join("")}function kv(e){const t=e.match(xv);return t?t[1].replace(yv,"'"):e}function jv(e,t,n){const o=kh(e,n?.in),r=o.getFullYear(),a=o.getDate(),i=wh(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=function(e,t){const n=kh(e,t?.in),o=n.getFullYear(),r=n.getMonth(),a=wh(n,0);return a.setFullYear(o,r+1,0),a.setHours(0,0,0,0),a.getDate()}(i);return o.setMonth(t,Math.min(a,s)),o}const Nv={},Cv={};function _v(e,t){try{const n=(Nv[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in Cv?Cv[n]:Sv(n,n.split(":"))}catch{if(e in Cv)return Cv[e];const t=e?.match(Dv);return t?Sv(e,t.slice(1)):NaN}}const Dv=/([+-]\d\d):?(\d\d)?/;function Sv(e,t){const n=+(t[0]||0),o=+(t[1]||0),r=+(t[2]||0)/60;return Cv[e]=60*n+o>0?60*n+o+r:60*n-o-r}class Ev extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(_v(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Tv(this),Ov(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Ev(...t,e):new Ev(Date.now(),e)}withTimeZone(e){return new Ev(+this,e)}getTimezoneOffset(){const e=-_v(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Ov(this),+this}[Symbol.for("constructDateFrom")](e){return new Ev(+new Date(e),this.timeZone)}}const Mv=/^(get|set)(?!UTC)/;function Ov(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(60*-_v(e.timeZone,e)))}function Tv(e){const t=_v(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),o=new Date(+e);o.setUTCHours(o.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),a=r- -new Date(+o).getTimezoneOffset(),i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const s=r-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const l=new Date(+e);l.setUTCSeconds(0);const c=r>0?l.getSeconds():(l.getSeconds()-60)%60,d=Math.round(-60*_v(e.timeZone,e))%60;(d||c)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+c));const u=_v(e.timeZone,e),p=u>0?Math.floor(u):Math.ceil(u),f=-new Date(+e).getTimezoneOffset()-p-s;if(p!==n&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);const t=_v(e.timeZone,e),n=p-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Mv.test(e))return;const t=e.replace(Mv,"$1UTC");Ev.prototype[t]&&(e.startsWith("get")?Ev.prototype[e]=function(){return this.internal[t]()}:(Ev.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Tv(e),+this},Ev.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ov(this),+this}))});class Rv extends Ev{static tz(e,...t){return t.length?new Rv(...t,e):new Rv(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),o=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,o]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${o}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,o]=this.tzComponents();return`${e} GMT${t}${n}${o} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new Rv(+this,e)}[Symbol.for("constructDateFrom")](e){return new Rv(+new Date(e),this.timeZone)}}function Pv(e,t){const n=t.startOfMonth(e),o=n.getDay();return 1===o?n:0===o?t.addDays(n,-6):t.addDays(n,-1*(o-1))}const Av={...Vh,labels:{labelDayButton:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>wv(e,t,{locale:Vh,...n});let a=r(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let o;return o=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>wv(e,n,{locale:Vh,...t}),o(e,"LLLL yyyy")},labelGridcell:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>wv(e,t,{locale:Vh,...n});let a=r(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let o;return o=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>wv(e,n,{locale:Vh,...t}),o(e,"cccc")}}};class Iv{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Rv.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new Rv(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):jh(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):Nh(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return jh(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return Nh(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):Rh(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):Ah(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):function(e){const{start:t,end:n}=Ih(0,e);let o=+t>+n;const r=o?+t:+n,a=o?n:t;a.setHours(0,0,0,0),a.setDate(1);const i=[];for(;+a<=r;)i.push(wh(t,a)),a.setMonth(a.getMonth()+1);return o?i.reverse():i}(e),this.eachYearOfInterval=e=>{const t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):function(e){const{start:t,end:n}=Ih(0,e);let o=+t>+n;const r=o?+t:+n,a=o?n:t;a.setHours(0,0,0,0),a.setMonth(0,1);const i=[];for(;+a<=r;)i.push(wh(t,a)),a.setFullYear(a.getFullYear()+1);return o?i.reverse():i}(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;const o=[];return n.forEach(e=>{o.push(new Date(e,0,1))}),o},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):function(e,t){const n=Pv(e,t),o=function(e,t){const n=t.startOfMonth(e),o=n.getDay()>0?n.getDay():7,r=t.addDays(e,1-o),a=t.addDays(r,34);return t.getMonth(e)===t.getMonth(a)?5:4}(e,t);return t.addDays(n,7*o-1)}(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):function(e,t){return zh(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):function(e,t){const n=kh(e,t?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):zh(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=kh(e,t?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}(e),this.format=(e,t,n)=>{const o=this.overrides?.format?this.overrides.format(e,t,this.options):wv(e,t,this.options);return this.options.numerals&&"latn"!==this.options.numerals?this.replaceDigits(o):o},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):Gh(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):function(e,t){return kh(e,t?.in).getMonth()}(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):function(e,t){return kh(e,t?.in).getFullYear()}(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):Xh(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):function(e,t){return+kh(e)>+kh(t)}(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):function(e,t){return+kh(e)<+kh(t)}(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):Ph(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):function(e,t){const[n,o]=Oh(0,e,t);return+Th(n)===+Th(o)}(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t){const[n,o]=Oh(0,e,t);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()}(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):function(e,t){const[n,o]=Oh(0,e,t);return n.getFullYear()===o.getFullYear()}(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):function(e,t){let n,o=t?.in;return e.forEach(e=>{o||"object"!=typeof e||(o=wh.bind(null,e));const t=kh(e,o);(!n||n<t||isNaN(+t))&&(n=t)}),wh(o,n||NaN)}(e),this.min=e=>this.overrides?.min?this.overrides.min(e):function(e,t){let n,o=t?.in;return e.forEach(e=>{o||"object"!=typeof e||(o=wh.bind(null,e));const t=kh(e,o);(!n||n>t||isNaN(+t))&&(n=t)}),wh(o,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):jv(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const o=kh(e,n?.in);return isNaN(+o)?wh(e,NaN):(o.setFullYear(t),o)}(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):Pv(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):Th(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):Sh(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):function(e,t){const n=kh(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):Dh(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):Fh(e),this.options={locale:Av,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&Iv.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:n,numerals:o}=this.options,r=t?.code;if(r&&Iv.yearFirstLocales.has(r))try{const t=new Intl.DateTimeFormat(r,{month:"long",year:"numeric",timeZone:n,numberingSystem:o});return t.format(e)}catch{}const a="year-first"===this.getMonthYearOrder()?"y LLLL":"LLLL y";return this.format(e,a)}}Iv.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Fv=new Iv;class zv{constructor(e,t,n=Fv){this.date=e,this.displayMonth=t,this.outside=Boolean(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,"yyyy-MM-dd"),this.displayMonthId=n.format(t,"yyyy-MM"),this.dateMonthId=n.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class Lv{constructor(e,t){this.date=e,this.weeks=t}}class Wv{constructor(e,t){this.days=t,this.weekNumber=e}}var Bv,$v,qv,Yv;!function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"}(Bv||(Bv={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}($v||($v={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(qv||(qv={})),function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"}(Yv||(Yv={}));const Hv=e.createContext(void 0);function Kv(){const t=e.useContext(Hv);if(void 0===t)throw new Error("useDayPicker() must be used within a custom component.");return t}var Uv=Object.freeze({__proto__:null,Button:function(t){return e.createElement("button",{...t})},CaptionLabel:function(t){return e.createElement("span",{...t})},Chevron:function(t){const{size:n=24,orientation:o="left",className:r}=t;return e.createElement("svg",{className:r,width:n,height:n,viewBox:"0 0 24 24"},"up"===o&&e.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===o&&e.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===o&&e.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===o&&e.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))},Day:function(t){const{day:n,modifiers:o,...r}=t;return e.createElement("td",{...r})},DayButton:function(t){const{day:n,modifiers:o,...r}=t,a=e.useRef(null);return e.useEffect(()=>{o.focused&&a.current?.focus()},[o.focused]),e.createElement("button",{ref:a,...r})},Dropdown:function(t){const{options:n,className:o,components:r,classNames:a,...i}=t,s=[a[Bv.Dropdown],o].join(" "),l=n?.find(({value:e})=>e===i.value);return e.createElement("span",{"data-disabled":i.disabled,className:a[Bv.DropdownRoot]},e.createElement(r.Select,{className:s,...i},n?.map(({value:t,label:n,disabled:o})=>e.createElement(r.Option,{key:t,value:t,disabled:o},n))),e.createElement("span",{className:a[Bv.CaptionLabel],"aria-hidden":!0},l?.label,e.createElement(r.Chevron,{orientation:"down",size:18,className:a[Bv.Chevron]})))},DropdownNav:function(t){return e.createElement("div",{...t})},Footer:function(t){return e.createElement("div",{...t})},Month:function(t){const{calendarMonth:n,displayIndex:o,...r}=t;return e.createElement("div",{...r},t.children)},MonthCaption:function(t){const{calendarMonth:n,displayIndex:o,...r}=t;return e.createElement("div",{...r})},MonthGrid:function(t){return e.createElement("table",{...t})},Months:function(t){return e.createElement("div",{...t})},MonthsDropdown:function(t){const{components:n}=Kv();return e.createElement(n.Dropdown,{...t})},Nav:function(t){const{onPreviousClick:n,onNextClick:o,previousMonth:r,nextMonth:a,...i}=t,{components:s,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Kv(),u=e.useCallback(e=>{a&&o?.(e)},[a,o]),p=e.useCallback(e=>{r&&n?.(e)},[r,n]);return e.createElement("nav",{...i},e.createElement(s.PreviousMonthButton,{type:"button",className:l[Bv.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":c(r),onClick:p},e.createElement(s.Chevron,{disabled:!r||void 0,className:l[Bv.Chevron],orientation:"left"})),e.createElement(s.NextMonthButton,{type:"button",className:l[Bv.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":!a||void 0,"aria-label":d(a),onClick:u},e.createElement(s.Chevron,{disabled:!a||void 0,orientation:"right",className:l[Bv.Chevron]})))},NextMonthButton:function(t){const{components:n}=Kv();return e.createElement(n.Button,{...t})},Option:function(t){return e.createElement("option",{...t})},PreviousMonthButton:function(t){const{components:n}=Kv();return e.createElement(n.Button,{...t})},Root:function(t){const{rootRef:n,...o}=t;return e.createElement("div",{...o,ref:n})},Select:function(t){return e.createElement("select",{...t})},Week:function(t){const{week:n,...o}=t;return e.createElement("tr",{...o})},WeekNumber:function(t){const{week:n,...o}=t;return e.createElement("th",{...o})},WeekNumberHeader:function(t){return e.createElement("th",{...t})},Weekday:function(t){return e.createElement("th",{...t})},Weekdays:function(t){return e.createElement("thead",{"aria-hidden":!0},e.createElement("tr",{...t}))},Weeks:function(t){return e.createElement("tbody",{...t})},YearsDropdown:function(t){const{components:n}=Kv();return e.createElement(n.Dropdown,{...t})}});function Vv(e,t,n=!1,o=Fv){let{from:r,to:a}=e;const{differenceInCalendarDays:i,isSameDay:s}=o;if(r&&a){i(a,r)<0&&([r,a]=[a,r]);return i(t,r)>=(n?1:0)&&i(a,t)>=(n?1:0)}return!n&&a?s(a,t):!(n||!r)&&s(r,t)}function Gv(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function Zv(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function Xv(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function Qv(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function Jv(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function eg(e,t){return Array.isArray(e)&&e.every(t.isDate)}function tg(e,t,n=Fv){const o=Array.isArray(t)?t:[t],{isSameDay:r,differenceInCalendarDays:a,isAfter:i}=n;return o.some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return r(e,t);if(eg(t,n))return t.some(t=>r(e,t));if(Zv(t))return Vv(t,e,!1,n);if(Jv(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(Gv(t)){const n=a(t.before,e)>0,o=a(t.after,e)<0;return i(t.before,t.after)?o&&n:n||o}return Xv(t)?a(e,t.after)>0:Qv(t)?a(t.before,e)>0:"function"==typeof t&&t(e)})}function ng(e){return{...Uv,...e}}function og(){const e={};for(const t in Bv)e[Bv[t]]=`rdp-${Bv[t]}`;for(const t in $v)e[$v[t]]=`rdp-${$v[t]}`;for(const t in qv)e[qv[t]]=`rdp-${qv[t]}`;for(const t in Yv)e[Yv[t]]=`rdp-${Yv[t]}`;return e}function rg(e,t,n){return(n??new Iv(t)).formatMonthYear(e)}const ag=rg;function ig(e,t=Fv){return t.format(e,"yyyy")}const sg=ig;var lg=Object.freeze({__proto__:null,formatCaption:rg,formatDay:function(e,t,n){return(n??new Iv(t)).format(e,"d")},formatMonthCaption:ag,formatMonthDropdown:function(e,t=Fv){return t.format(e,"LLLL")},formatWeekNumber:function(e,t=Fv){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)},formatWeekNumberHeader:function(){return""},formatWeekdayName:function(e,t,n){return(n??new Iv(t)).format(e,"cccccc")},formatYearCaption:sg,formatYearDropdown:ig});function cg(e,t,n,o){let r=(o??new Iv(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const dg=cg;function ug(e,t,n){return(n??new Iv(t)).formatMonthYear(e)}const pg=ug;function fg(e,t,n,o){let r=(o??new Iv(n)).format(e,"PPPP");return t?.today&&(r=`Today, ${r}`),r}function mg(e){return"Choose the Month"}function hg(){return""}function vg(e,t){return"Go to the Next Month"}function gg(e){return"Go to the Previous Month"}function xg(e,t,n){return(n??new Iv(t)).format(e,"cccc")}function yg(e,t){return`Week ${e}`}function bg(e){return"Week Number"}function wg(e){return"Choose the Year"}var kg=Object.freeze({__proto__:null,labelCaption:pg,labelDay:dg,labelDayButton:cg,labelGrid:ug,labelGridcell:fg,labelMonthDropdown:mg,labelNav:hg,labelNext:vg,labelPrevious:gg,labelWeekNumber:yg,labelWeekNumberHeader:bg,labelWeekday:xg,labelYearDropdown:wg});const jg=(e,t,n)=>t||(n?"function"==typeof n?n:(...e)=>n:e);function Ng(e,t){const n=t.locale?.labels??{};return{...kg,...e??{},labelDayButton:jg(cg,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:jg(mg,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:jg(vg,e?.labelNext,n.labelNext),labelPrevious:jg(gg,e?.labelPrevious,n.labelPrevious),labelWeekNumber:jg(yg,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:jg(wg,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:jg(ug,e?.labelGrid,n.labelGrid),labelGridcell:jg(fg,e?.labelGridcell,n.labelGridcell),labelNav:jg(hg,e?.labelNav,n.labelNav),labelWeekNumberHeader:jg(bg,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:jg(xg,e?.labelWeekday,n.labelWeekday)}}function Cg(e,t,n,o,r){const{startOfMonth:a,startOfYear:i,endOfYear:s,eachMonthOfInterval:l,getMonth:c}=r;return l({start:i(e),end:s(e)}).map(e=>{const i=o.formatMonthDropdown(e,r);return{value:c(e),label:i,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function _g(e,t,n,o,r=!1){if(!e)return;if(!t)return;const{startOfYear:a,endOfYear:i,eachYearOfInterval:s,getYear:l}=o,c=s({start:a(e),end:i(t)});return r&&c.reverse(),c.map(e=>{const t=n.formatYearDropdown(e,o);return{value:l(e),label:t,disabled:!1}})}const Dg=e=>e instanceof HTMLElement?e:null,Sg=e=>[...e.querySelectorAll("[data-animated-month]")??[]],Eg=e=>Dg(e.querySelector("[data-animated-caption]")),Mg=e=>Dg(e.querySelector("[data-animated-weeks]"));function Og(t,n,{classNames:o,months:r,focused:a,dateLib:i}){const s=e.useRef(null),l=e.useRef(r),c=e.useRef(!1);e.useLayoutEffect(()=>{const e=l.current;if(l.current=r,!(n&&t.current&&t.current instanceof HTMLElement&&0!==r.length&&0!==e.length&&r.length===e.length))return;const d=i.isSameMonth(r[0].date,e[0].date),u=i.isAfter(r[0].date,e[0].date),p=u?o[Yv.caption_after_enter]:o[Yv.caption_before_enter],f=u?o[Yv.weeks_after_enter]:o[Yv.weeks_before_enter],m=s.current,h=t.current.cloneNode(!0);if(h instanceof HTMLElement){Sg(h).forEach(e=>{if(!(e instanceof HTMLElement))return;const t=Dg(e.querySelector("[data-animated-month]"));t&&e.contains(t)&&e.removeChild(t);const n=Eg(e);n&&n.classList.remove(p);const o=Mg(e);o&&o.classList.remove(f)}),s.current=h}else s.current=null;if(c.current||d||a)return;const v=m instanceof HTMLElement?Sg(m):[],g=Sg(t.current);if(g?.every(e=>e instanceof HTMLElement)&&v&&v.every(e=>e instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const e=(x=t.current,Dg(x.querySelector("[data-animated-nav]")));e&&(e.style.zIndex="1"),g.forEach((n,r)=>{const a=v[r];if(!a)return;n.style.position="relative",n.style.overflow="hidden";const i=Eg(n);i&&i.classList.add(p);const s=Mg(n);s&&s.classList.add(f);const l=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),e&&(e.style.zIndex=""),i&&i.classList.remove(p),s&&s.classList.remove(f),n.style.position="",n.style.overflow="",n.contains(a)&&n.removeChild(a)};a.style.pointerEvents="none",a.style.position="absolute",a.style.overflow="hidden",a.setAttribute("aria-hidden","true");const d=(e=>Dg(e.querySelector("[data-animated-weekdays]")))(a);d&&(d.style.opacity="0");const m=Eg(a);m&&(m.classList.add(u?o[Yv.caption_before_exit]:o[Yv.caption_after_exit]),m.addEventListener("animationend",l));const h=Mg(a);h&&h.classList.add(u?o[Yv.weeks_before_exit]:o[Yv.weeks_after_exit]),n.insertBefore(a,n.firstChild)})}var x})}function Tg(e,t,n,o){const{month:r,defaultMonth:a,today:i=o.today(),numberOfMonths:s=1}=e;let l=r||a||i;const{differenceInCalendarMonths:c,addMonths:d,startOfMonth:u}=o;if(n&&c(n,l)<s-1){l=d(n,-1*(s-1))}return t&&c(l,t)<0&&(l=t),u(l)}function Rg(t,n){const[o,r]=e.useState(t);return[void 0===n?o:n,r]}function Pg(t,n){const[o,r]=function(e,t){let{startMonth:n,endMonth:o}=e;const{startOfYear:r,startOfDay:a,startOfMonth:i,endOfMonth:s,addYears:l,endOfYear:c,newDate:d,today:u}=t,{fromYear:p,toYear:f,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&p&&(n=t.newDate(p,0,1)),!o&&h&&(o=h),!o&&f&&(o=d(f,11,31));const v="dropdown"===e.captionLayout||"dropdown-years"===e.captionLayout;return n?n=i(n):p?n=d(p,0,1):!n&&v&&(n=r(l(e.today??u(),-100))),o?o=s(o):f?o=d(f,11,31):!o&&v&&(o=c(e.today??u())),[n?a(n):n,o?a(o):o]}(t,n),{startOfMonth:a,endOfMonth:i}=n,s=Tg(t,o,r,n),[l,c]=Rg(s,t.month?s:void 0);e.useEffect(()=>{const e=Tg(t,o,r,n);c(e)},[t.timeZone]);const{months:d,weeks:u,days:p,previousMonth:f,nextMonth:m}=e.useMemo(()=>{const e=function(e,t,n,o){const{numberOfMonths:r=1}=n,a=[];for(let n=0;n<r;n++){const r=o.addMonths(e,n);if(t&&r>t)break;a.push(r)}return a}(l,r,{numberOfMonths:t.numberOfMonths},n),a=function(e,t,n,o){const r=e[0],a=e[e.length-1],{ISOWeek:i,fixedWeeks:s,broadcastCalendar:l}=n??{},{addDays:c,differenceInCalendarDays:d,differenceInCalendarMonths:u,endOfBroadcastWeek:p,endOfISOWeek:f,endOfMonth:m,endOfWeek:h,isAfter:v,startOfBroadcastWeek:g,startOfISOWeek:x,startOfWeek:y}=o,b=l?g(r,o):i?x(r):y(r),w=l?p(a):i?f(m(a)):h(m(a)),k=t&&(l?p(t):i?f(t):h(t)),j=d(k&&v(w,k)?k:w,b),N=u(a,r)+1,C=[];for(let e=0;e<=j;e++){const t=c(b,e);C.push(t)}const _=(l?35:42)*N;if(s&&C.length<_){const e=_-C.length;for(let t=0;t<e;t++){const e=c(C[C.length-1],1);C.push(e)}}return C}(e,t.endMonth?i(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},n),s=function(e,t,n,o){const{addDays:r,endOfBroadcastWeek:a,endOfISOWeek:i,endOfMonth:s,endOfWeek:l,getISOWeek:c,getWeek:d,startOfBroadcastWeek:u,startOfISOWeek:p,startOfWeek:f}=o,m=e.reduce((e,m)=>{const h=n.broadcastCalendar?u(m,o):n.ISOWeek?p(m):f(m),v=n.broadcastCalendar?a(m):n.ISOWeek?i(s(m)):l(s(m)),g=t.filter(e=>e>=h&&e<=v),x=n.broadcastCalendar?35:42;if(n.fixedWeeks&&g.length<x){const e=t.filter(e=>{const t=x-g.length;return e>v&&e<=r(v,t)});g.push(...e)}const y=g.reduce((e,t)=>{const r=n.ISOWeek?c(t):d(t),a=e.find(e=>e.weekNumber===r),i=new zv(t,m,o);return a?a.days.push(i):e.push(new Wv(r,[i])),e},[]),b=new Lv(m,y);return e.push(b),e},[]);return n.reverseMonths?m.reverse():m}(e,a,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},n),c=function(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}(s),d=function(e){const t=[];return e.reduce((e,n)=>{const o=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(o.slice())},t.slice())}(s),u=function(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:a}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=o,c=r?a??1:1,d=i(e);return t&&l(d,t)<=0?void 0:s(d,-c)}(l,o,t,n),p=function(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:a=1}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=o,c=r?a:1,d=i(e);return t&&l(t,e)<a?void 0:s(d,c)}(l,r,t,n);return{months:s,weeks:c,days:d,previousMonth:u,nextMonth:p}},[n,l.getTime(),r?.getTime(),o?.getTime(),t.disableNavigation,t.broadcastCalendar,t.endMonth?.getTime(),t.fixedWeeks,t.ISOWeek,t.numberOfMonths,t.pagedNavigation,t.reverseMonths]),{disableNavigation:h,onMonthChange:v}=t,g=e=>{if(h)return;let t=a(e);o&&t<a(o)&&(t=a(o)),r&&t>a(r)&&(t=a(r)),c(t),v?.(t)};return{months:d,weeks:u,days:p,navStart:o,navEnd:r,previousMonth:f,nextMonth:m,goToMonth:g,goToDay:e=>{(e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))))(e)||g(e.date)}}}var Ag;function Ig(e){return!e[$v.disabled]&&!e[$v.hidden]&&!e[$v.outside]}function Fg(e,t,n,o,r,a,i,s=0){if(s>365)return;const l=function(e,t,n,o,r,a,i){const{ISOWeek:s,broadcastCalendar:l}=a,{addDays:c,addMonths:d,addWeeks:u,addYears:p,endOfBroadcastWeek:f,endOfISOWeek:m,endOfWeek:h,max:v,min:g,startOfBroadcastWeek:x,startOfISOWeek:y,startOfWeek:b}=i;let w={day:c,week:u,month:d,year:p,startOfWeek:e=>l?x(e,i):s?y(e):b(e),endOfWeek:e=>l?f(e):s?m(e):h(e)}[e](n,"after"===t?1:-1);return"before"===t&&o?w=v([o,w]):"after"===t&&r&&(w=g([r,w])),w}(e,t,n.date,o,r,a,i),c=Boolean(a.disabled&&tg(l,a.disabled,i)),d=Boolean(a.hidden&&tg(l,a.hidden,i)),u=new zv(l,l,i);return c||d?Fg(e,t,u,o,r,a,i,s+1):u}function zg(t,n,o,r,a){const{autoFocus:i}=t,[s,l]=e.useState(),c=function(e,t,n,o){let r,a=-1;for(const i of e){const e=t(i);Ig(e)&&(e[$v.focused]&&a<Ag.FocusedModifier?(r=i,a=Ag.FocusedModifier):o?.isEqualTo(i)&&a<Ag.LastFocused?(r=i,a=Ag.LastFocused):n(i.date)&&a<Ag.Selected?(r=i,a=Ag.Selected):e[$v.today]&&a<Ag.Today&&(r=i,a=Ag.Today))}return r||(r=e.find(e=>Ig(t(e)))),r}(n.days,o,r||(()=>!1),s),[d,u]=e.useState(i?c:void 0);return{isFocusTarget:e=>Boolean(c?.isEqualTo(e)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(e,o)=>{if(!d)return;const r=Fg(e,o,d,n.navStart,n.navEnd,t,a);if(r){if(t.disableNavigation){if(!n.days.some(e=>e.isEqualTo(r)))return}n.goToDay(r),u(r)}}}}function Lg(e,t,n=Fv){return Vv(e,t.from,!1,n)||Vv(e,t.to,!1,n)||Vv(t,e.from,!1,n)||Vv(t,e.to,!1,n)}function Wg(e,t,n=Fv){const o=Array.isArray(t)?t:[t];if(o.filter(e=>"function"!=typeof e).some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return Vv(e,t,!1,n);if(eg(t,n))return t.some(t=>Vv(e,t,!1,n));if(Zv(t))return!(!t.from||!t.to)&&Lg(e,{from:t.from,to:t.to},n);if(Jv(t))return function(e,t,n=Fv){const o=Array.isArray(t)?t:[t];let r=e.from;const a=n.differenceInCalendarDays(e.to,e.from),i=Math.min(a,6);for(let e=0;e<=i;e++){if(o.includes(r.getDay()))return!0;r=n.addDays(r,1)}return!1}(e,t.dayOfWeek,n);if(Gv(t)){return n.isAfter(t.before,t.after)?Lg(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):tg(e.from,t,n)||tg(e.to,t,n)}return!(!Xv(t)&&!Qv(t))&&(tg(e.from,t,n)||tg(e.to,t,n))}))return!0;const r=o.filter(e=>"function"==typeof e);if(r.length){let t=e.from;const o=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=o;e++){if(r.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function Bg(e,t){const{disabled:n,excludeDisabled:o,selected:r,required:a,onSelect:i}=e,[s,l]=Rg(r,i?r:void 0),c=i?r:s;return{selected:c,select:(r,s,d)=>{const{min:u,max:p}=e,f=r?function(e,t,n=0,o=0,r=!1,a=Fv){const{from:i,to:s}=t||{},{isSameDay:l,isAfter:c,isBefore:d}=a;let u;if(i||s){if(i&&!s)u=l(i,e)?0===n?{from:i,to:e}:r?{from:i,to:void 0}:void 0:d(e,i)?{from:e,to:i}:{from:i,to:e};else if(i&&s)if(l(i,e)&&l(s,e))u=r?{from:i,to:s}:void 0;else if(l(i,e))u={from:i,to:n>0?void 0:e};else if(l(s,e))u={from:e,to:n>0?void 0:e};else if(d(e,i))u={from:e,to:s};else if(c(e,i))u={from:i,to:e};else{if(!c(e,s))throw new Error("Invalid range");u={from:i,to:e}}}else u={from:e,to:n>0?void 0:e};if(u?.from&&u?.to){const t=a.differenceInCalendarDays(u.to,u.from);(o>0&&t>o||n>1&&t<n)&&(u={from:e,to:void 0})}return u}(r,c,u,p,a,t):void 0;return o&&n&&f?.from&&f.to&&Wg({from:f.from,to:f.to},n,t)&&(f.from=r,f.to=void 0),i||l(f),i?.(f,r,s,d),f},isSelected:e=>c&&Vv(c,e,!1,t)}}function $g(e,t){const n=function(e,t){const{selected:n,required:o,onSelect:r}=e,[a,i]=Rg(n,r?n:void 0),s=r?n:a,{isSameDay:l}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!o&&s&&s&&l(e,s)&&(a=void 0),r||i(a),r?.(a,e,t,n),a},isSelected:e=>!!s&&l(s,e)}}(e,t),o=function(e,t){const{selected:n,required:o,onSelect:r}=e,[a,i]=Rg(n,r?n:void 0),s=r?n:a,{isSameDay:l}=t,c=e=>s?.some(t=>l(t,e))??!1,{min:d,max:u}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(c(e)){if(s?.length===d)return;if(o&&1===s?.length)return;a=s?.filter(t=>!l(t,e))}else a=s?.length===u?[e]:[...a,e];return r||i(a),r?.(a,e,t,n),a},isSelected:c}}(e,t),r=Bg(e,t);switch(e.mode){case"single":return n;case"multiple":return o;case"range":return r;default:return}}function qg(e,t){return e instanceof Rv&&e.timeZone===t?e:new Rv(e,t)}function Yg(e,t,n){return qg(e,t)}function Hg(e,t,n){return"boolean"==typeof e||"function"==typeof e?e:e instanceof Date?Yg(e,t):Array.isArray(e)?e.map(e=>e instanceof Date?Yg(e,t):e):Zv(e)?{...e,from:e.from?qg(e.from,t):e.from,to:e.to?qg(e.to,t):e.to}:Gv(e)?{before:Yg(e.before,t),after:Yg(e.after,t)}:Xv(e)?{after:Yg(e.after,t)}:Qv(e)?{before:Yg(e.before,t)}:e}function Kg(e,t,n){return e?Array.isArray(e)?e.map(e=>Hg(e,t)):Hg(e,t):e}function Ug(t){let n=t;const o=n.timeZone;if(o&&(n={...t,timeZone:o},n.today&&(n.today=qg(n.today,o)),n.month&&(n.month=qg(n.month,o)),n.defaultMonth&&(n.defaultMonth=qg(n.defaultMonth,o)),n.startMonth&&(n.startMonth=qg(n.startMonth,o)),n.endMonth&&(n.endMonth=qg(n.endMonth,o)),"single"===n.mode&&n.selected?n.selected=qg(n.selected,o):"multiple"===n.mode&&n.selected?n.selected=n.selected?.map(e=>qg(e,o)):"range"===n.mode&&n.selected&&(n.selected={from:n.selected.from?qg(n.selected.from,o):n.selected.from,to:n.selected.to?qg(n.selected.to,o):n.selected.to}),void 0!==n.disabled&&(n.disabled=Kg(n.disabled,o)),void 0!==n.hidden&&(n.hidden=Kg(n.hidden,o)),n.modifiers)){const e={};Object.keys(n.modifiers).forEach(t=>{e[t]=Kg(n.modifiers?.[t],o)}),n.modifiers=e}const{components:r,formatters:a,labels:i,dateLib:s,locale:l,classNames:c}=e.useMemo(()=>{const e={...Av,...n.locale},t=n.broadcastCalendar?1:n.weekStartsOn,o=n.noonSafe&&n.timeZone?function(e,t={}){const{weekStartsOn:n,locale:o}=t,r=n??o?.options?.weekStartsOn??0,a=t=>{const n="number"==typeof t||"string"==typeof t?new Date(t):t;return new Rv(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},i=e=>{const t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(Rv.tz(e)),newDate:(t,n,o)=>new Rv(t,n,o,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{const n=a(e),o=t?.weekStartsOn??r,i=(n.getDay()-o+7)%7;return n.setDate(n.getDate()-i),n},startOfISOWeek:e=>{const t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{const t=a(e);return t.setDate(1),t},startOfYear:e=>{const t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{const n=a(e),o=(((t?.weekStartsOn??r)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+o),n},endOfISOWeek:e=>{const t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{const t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{const t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{const n=a(t.start),o=a(t.end),r=[],i=new Rv(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=12*o.getFullYear()+o.getMonth();for(;12*i.getFullYear()+i.getMonth()<=s;)r.push(new Rv(i,e)),i.setMonth(i.getMonth()+1,1);return r},addDays:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+7*t),n},addMonths:(e,t)=>{const n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{const n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{const n=a(t.start),o=a(t.end),r=[],i=new Rv(n.getFullYear(),0,1,12,0,0,e);for(;i.getFullYear()<=o.getFullYear();)r.push(new Rv(i,e)),i.setFullYear(i.getFullYear()+1,0,1);return r},getWeek:(e,t)=>Xh(i(e),{weekStartsOn:t?.weekStartsOn??r,firstWeekContainsDate:t?.firstWeekContainsDate??o?.options?.firstWeekContainsDate??1}),getISOWeek:e=>Gh(i(e)),differenceInCalendarDays:(e,t)=>Rh(i(e),i(t)),differenceInCalendarMonths:(e,t)=>Ah(i(e),i(t))}}(n.timeZone,{weekStartsOn:t,locale:e}):void 0,r=n.dateLib&&o?{...o,...n.dateLib}:n.dateLib??o,a=new Iv({locale:e,weekStartsOn:t,firstWeekContainsDate:n.firstWeekContainsDate,useAdditionalWeekYearTokens:n.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:n.useAdditionalDayOfYearTokens,timeZone:n.timeZone,numerals:n.numerals},r);return{dateLib:a,components:ng(n.components),formatters:(i=n.formatters,i?.formatMonthCaption&&!i.formatCaption&&(i.formatCaption=i.formatMonthCaption),i?.formatYearCaption&&!i.formatYearDropdown&&(i.formatYearDropdown=i.formatYearCaption),{...lg,...i}),labels:Ng(n.labels,a.options),locale:e,classNames:{...og(),...n.classNames}};var i},[n.locale,n.broadcastCalendar,n.weekStartsOn,n.firstWeekContainsDate,n.useAdditionalWeekYearTokens,n.useAdditionalDayOfYearTokens,n.timeZone,n.numerals,n.dateLib,n.noonSafe,n.components,n.formatters,n.labels,n.classNames]);n.today||(n={...n,today:s.today()});const{captionLayout:d,mode:u,navLayout:p,numberOfMonths:f=1,onDayBlur:m,onDayClick:h,onDayFocus:v,onDayKeyDown:g,onDayMouseEnter:x,onDayMouseLeave:y,onNextClick:b,onPrevClick:w,showWeekNumber:k,styles:j}=n,{formatCaption:N,formatDay:C,formatMonthDropdown:_,formatWeekNumber:D,formatWeekNumberHeader:S,formatWeekdayName:E,formatYearDropdown:M}=a,O=Pg(n,s),{days:T,months:R,navStart:P,navEnd:A,previousMonth:I,nextMonth:F,goToMonth:z}=O,L=function(e,t,n,o,r){const{disabled:a,hidden:i,modifiers:s,showOutsideDays:l,broadcastCalendar:c,today:d=r.today()}=t,{isSameDay:u,isSameMonth:p,startOfMonth:f,isBefore:m,endOfMonth:h,isAfter:v}=r,g=n&&f(n),x=o&&h(o),y={[$v.focused]:[],[$v.outside]:[],[$v.disabled]:[],[$v.hidden]:[],[$v.today]:[]},b={};for(const t of e){const{date:e,displayMonth:n}=t,o=Boolean(n&&!p(e,n)),f=Boolean(g&&m(e,g)),h=Boolean(x&&v(e,x)),w=Boolean(a&&tg(e,a,r)),k=Boolean(i&&tg(e,i,r))||f||h||!c&&!l&&o||c&&!1===l&&o,j=u(e,d);o&&y.outside.push(t),w&&y.disabled.push(t),k&&y.hidden.push(t),j&&y.today.push(t),s&&Object.keys(s).forEach(n=>{const o=s?.[n];o&&tg(e,o,r)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{const t={[$v.focused]:!1,[$v.disabled]:!1,[$v.hidden]:!1,[$v.outside]:!1,[$v.today]:!1},n={};for(const n in y){const o=y[n];t[n]=o.some(t=>t===e)}for(const t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}(T,n,P,A,s),{isSelected:W,select:B,selected:$}=$g(n,s)??{},{blur:q,focused:Y,isFocusTarget:H,moveFocus:K,setFocused:U}=zg(n,O,L,W??(()=>!1),s),{labelDayButton:V,labelGridcell:G,labelGrid:Z,labelMonthDropdown:X,labelNav:Q,labelPrevious:J,labelNext:ee,labelWeekday:te,labelWeekNumber:ne,labelWeekNumberHeader:oe,labelYearDropdown:re}=i,ae=e.useMemo(()=>function(e,t,n,o){const r=o??e.today(),a=n?e.startOfBroadcastWeek(r,e):t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let t=0;t<7;t++){const n=e.addDays(a,t);i.push(n)}return i}(s,n.ISOWeek,n.broadcastCalendar,n.today),[s,n.ISOWeek,n.broadcastCalendar,n.today]),ie=void 0!==u||void 0!==h,se=e.useCallback(()=>{I&&(z(I),w?.(I))},[I,z,w]),le=e.useCallback(()=>{F&&(z(F),b?.(F))},[z,F,b]),ce=e.useCallback((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),U(e),t.disabled||(B?.(e.date,t,n),h?.(e.date,t,n))},[B,h,U]),de=e.useCallback((e,t)=>n=>{U(e),v?.(e.date,t,n)},[v,U]),ue=e.useCallback((e,t)=>n=>{q(),m?.(e.date,t,n)},[q,m]),pe=e.useCallback((e,t)=>o=>{const r={ArrowLeft:[o.shiftKey?"month":"day","rtl"===n.dir?"after":"before"],ArrowRight:[o.shiftKey?"month":"day","rtl"===n.dir?"before":"after"],ArrowDown:[o.shiftKey?"year":"week","after"],ArrowUp:[o.shiftKey?"year":"week","before"],PageUp:[o.shiftKey?"year":"month","before"],PageDown:[o.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(r[o.key]){o.preventDefault(),o.stopPropagation();const[e,t]=r[o.key];K(e,t)}g?.(e.date,t,o)},[K,g,n.dir]),fe=e.useCallback((e,t)=>n=>{x?.(e.date,t,n)},[x]),me=e.useCallback((e,t)=>n=>{y?.(e.date,t,n)},[y]),he=e.useCallback(e=>t=>{const n=Number(t.target.value),o=s.setMonth(s.startOfMonth(e),n);z(o)},[s,z]),ve=e.useCallback(e=>t=>{const n=Number(t.target.value),o=s.setYear(s.startOfMonth(e),n);z(o)},[s,z]),{className:ge,style:xe}=e.useMemo(()=>({className:[c[Bv.Root],n.className].filter(Boolean).join(" "),style:{...j?.[Bv.Root],...n.style}}),[c,n.className,n.style,j]),ye=function(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith("data-")&&(t[e]=n)}),t}(n),be=e.useRef(null);Og(be,Boolean(n.animate),{classNames:c,months:R,focused:Y,dateLib:s});const we={dayPickerProps:n,selected:$,select:B,isSelected:W,months:R,nextMonth:F,previousMonth:I,goToMonth:z,getModifiers:L,components:r,classNames:c,styles:j,labels:i,formatters:a};return e.createElement(Hv.Provider,{value:we},e.createElement(r.Root,{rootRef:n.animate?be:void 0,className:ge,style:xe,dir:n.dir,id:n.id,lang:n.lang,nonce:n.nonce,title:n.title,role:n.role,"aria-label":n["aria-label"],"aria-labelledby":n["aria-labelledby"],...ye},e.createElement(r.Months,{className:c[Bv.Months],style:j?.[Bv.Months]},!n.hideNavigation&&!p&&e.createElement(r.Nav,{"data-animated-nav":n.animate?"true":void 0,className:c[Bv.Nav],style:j?.[Bv.Nav],"aria-label":Q(),onPreviousClick:se,onNextClick:le,previousMonth:I,nextMonth:F}),R.map((t,o)=>e.createElement(r.Month,{"data-animated-month":n.animate?"true":void 0,className:c[Bv.Month],style:j?.[Bv.Month],key:o,displayIndex:o,calendarMonth:t},"around"===p&&!n.hideNavigation&&0===o&&e.createElement(r.PreviousMonthButton,{type:"button",className:c[Bv.PreviousMonthButton],tabIndex:I?void 0:-1,"aria-disabled":!I||void 0,"aria-label":J(I),onClick:se,"data-animated-button":n.animate?"true":void 0},e.createElement(r.Chevron,{disabled:!I||void 0,className:c[Bv.Chevron],orientation:"rtl"===n.dir?"right":"left"})),e.createElement(r.MonthCaption,{"data-animated-caption":n.animate?"true":void 0,className:c[Bv.MonthCaption],style:j?.[Bv.MonthCaption],calendarMonth:t,displayIndex:o},d?.startsWith("dropdown")?e.createElement(r.DropdownNav,{className:c[Bv.Dropdowns],style:j?.[Bv.Dropdowns]},(()=>{const o="dropdown"===d||"dropdown-months"===d?e.createElement(r.MonthsDropdown,{key:"month",className:c[Bv.MonthsDropdown],"aria-label":X(),classNames:c,components:r,disabled:Boolean(n.disableNavigation),onChange:he(t.date),options:Cg(t.date,P,A,a,s),style:j?.[Bv.Dropdown],value:s.getMonth(t.date)}):e.createElement("span",{key:"month"},_(t.date,s)),i="dropdown"===d||"dropdown-years"===d?e.createElement(r.YearsDropdown,{key:"year",className:c[Bv.YearsDropdown],"aria-label":re(s.options),classNames:c,components:r,disabled:Boolean(n.disableNavigation),onChange:ve(t.date),options:_g(P,A,a,s,Boolean(n.reverseYears)),style:j?.[Bv.Dropdown],value:s.getYear(t.date)}):e.createElement("span",{key:"year"},M(t.date,s));return"year-first"===s.getMonthYearOrder()?[i,o]:[o,i]})(),e.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},N(t.date,s.options,s))):e.createElement(r.CaptionLabel,{className:c[Bv.CaptionLabel],role:"status","aria-live":"polite"},N(t.date,s.options,s))),"around"===p&&!n.hideNavigation&&o===f-1&&e.createElement(r.NextMonthButton,{type:"button",className:c[Bv.NextMonthButton],tabIndex:F?void 0:-1,"aria-disabled":!F||void 0,"aria-label":ee(F),onClick:le,"data-animated-button":n.animate?"true":void 0},e.createElement(r.Chevron,{disabled:!F||void 0,className:c[Bv.Chevron],orientation:"rtl"===n.dir?"left":"right"})),o===f-1&&"after"===p&&!n.hideNavigation&&e.createElement(r.Nav,{"data-animated-nav":n.animate?"true":void 0,className:c[Bv.Nav],style:j?.[Bv.Nav],"aria-label":Q(),onPreviousClick:se,onNextClick:le,previousMonth:I,nextMonth:F}),e.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===u||"range"===u,"aria-label":Z(t.date,s.options,s)||void 0,className:c[Bv.MonthGrid],style:j?.[Bv.MonthGrid]},!n.hideWeekdays&&e.createElement(r.Weekdays,{"data-animated-weekdays":n.animate?"true":void 0,className:c[Bv.Weekdays],style:j?.[Bv.Weekdays]},k&&e.createElement(r.WeekNumberHeader,{"aria-label":oe(s.options),className:c[Bv.WeekNumberHeader],style:j?.[Bv.WeekNumberHeader],scope:"col"},S()),ae.map(t=>e.createElement(r.Weekday,{"aria-label":te(t,s.options,s),className:c[Bv.Weekday],key:String(t),style:j?.[Bv.Weekday],scope:"col"},E(t,s.options,s)))),e.createElement(r.Weeks,{"data-animated-weeks":n.animate?"true":void 0,className:c[Bv.Weeks],style:j?.[Bv.Weeks]},t.weeks.map(t=>e.createElement(r.Week,{className:c[Bv.Week],key:t.weekNumber,style:j?.[Bv.Week],week:t},k&&e.createElement(r.WeekNumber,{week:t,style:j?.[Bv.WeekNumber],"aria-label":ne(t.weekNumber,{locale:l}),className:c[Bv.WeekNumber],scope:"row",role:"rowheader"},D(t.weekNumber,s)),t.days.map(t=>{const{date:o}=t,a=L(t);if(a[$v.focused]=!a.hidden&&Boolean(Y?.isEqualTo(t)),a[qv.selected]=W?.(o)||a.selected,Zv($)){const{from:e,to:t}=$;a[qv.range_start]=Boolean(e&&t&&s.isSameDay(o,e)),a[qv.range_end]=Boolean(e&&t&&s.isSameDay(o,t)),a[qv.range_middle]=Vv($,o,!0,s)}const i=function(e,t={},n={}){let o={...t?.[Bv.Day]};return Object.entries(e).filter(([,e])=>!0===e).forEach(([e])=>{o={...o,...n?.[e]}}),o}(a,j,n.modifiersStyles),l=function(e,t,n={}){return Object.entries(e).filter(([,e])=>!0===e).reduce((e,[o])=>(n[o]?e.push(n[o]):t[$v[o]]?e.push(t[$v[o]]):t[qv[o]]&&e.push(t[qv[o]]),e),[t[Bv.Day]])}(a,c,n.modifiersClassNames),d=ie||a.hidden?void 0:G(o,a,s.options,s);return e.createElement(r.Day,{key:`${t.isoDate}_${t.displayMonthId}`,day:t,modifiers:a,className:l.join(" "),style:i,role:"gridcell","aria-selected":a.selected||void 0,"aria-label":d,"data-day":t.isoDate,"data-month":t.outside?t.dateMonthId:void 0,"data-selected":a.selected||void 0,"data-disabled":a.disabled||void 0,"data-hidden":a.hidden||void 0,"data-outside":t.outside||void 0,"data-focused":a.focused||void 0,"data-today":a.today||void 0},!a.hidden&&ie?e.createElement(r.DayButton,{className:c[Bv.DayButton],style:j?.[Bv.DayButton],type:"button",day:t,modifiers:a,disabled:!a.focused&&a.disabled||void 0,"aria-disabled":a.focused&&a.disabled||void 0,tabIndex:H(t)?0:-1,"aria-label":V(o,a,s.options,s),onClick:ce(t,a),onBlur:ue(t,a),onFocus:de(t,a),onKeyDown:pe(t,a),onMouseEnter:fe(t,a),onMouseLeave:me(t,a)},C(o,s.options,s)):!a.hidden&&C(t.date,s.options,s))})))))))),n.footer&&e.createElement(r.Footer,{className:c[Bv.Footer],style:j?.[Bv.Footer],role:"status","aria-live":"polite"},n.footer)))}function Vg({className:e,classNames:n,showOutsideDays:o=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:s,...l}){const c=og();return t.jsx(Ug,{showOutsideDays:o,className:Ie("bg-background group/calendar p-3 [--cell-size:2rem]",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:e=>e.toLocaleString("default",{month:"short"}),...i},classNames:{root:Ie("w-fit",c.root),months:Ie("relative flex flex-col gap-4 md:flex-row",c.months),month:Ie("flex w-full flex-col gap-4",c.month),nav:Ie("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:Ie(Fe({variant:a}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:Ie(Fe({variant:a}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:Ie("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:Ie("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:Ie("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:Ie("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:Ie("select-none font-medium","label"===r?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:Ie("flex",c.weekdays),weekday:Ie("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:Ie("mt-2 flex w-full",c.week),week_number_header:Ie("w-[--cell-size] select-none",c.week_number_header),week_number:Ie("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:Ie("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:Ie("bg-accent rounded-l-md",c.range_start),range_middle:Ie("rounded-none",c.range_middle),range_end:Ie("bg-accent rounded-r-md",c.range_end),today:Ie("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:Ie("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:Ie("text-muted-foreground opacity-50",c.disabled),hidden:Ie("invisible",c.hidden),...n},components:{Root:({className:e,rootRef:n,...o})=>t.jsx("div",{"data-slot":"calendar",ref:n,className:Ie(e),...o}),Chevron:({className:e,orientation:n,...o})=>"left"===n?t.jsx(ni,{className:Ie("size-4",e),...o}):"right"===n?t.jsx(oi,{className:Ie("size-4",e),...o}):t.jsx(ti,{className:Ie("size-4",e),...o}),DayButton:Gg,WeekNumber:({children:e,...n})=>t.jsx("td",{...n,children:t.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:e})}),...s},...l})}function Gg({className:e,day:n,modifiers:o,...a}){const i=og(),s=r.useRef(null);return r.useEffect(()=>{o.focused&&s.current?.focus()},[o.focused]),t.jsx(Le,{ref:s,variant:"ghost",size:"icon","data-day":n.date.toLocaleDateString(),"data-selected-single":o.selected&&!o.range_start&&!o.range_end&&!o.range_middle,"data-range-start":o.range_start,"data-range-end":o.range_end,"data-range-middle":o.range_middle,className:Ie("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",i.day,e),...a})}!function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"}(Ag||(Ag={}));const Zg=e=>{if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t};function Xg({title:e="Nenhum resultado",description:n="Nenhum dado encontrado."}){return t.jsx(ic,{title:e,description:n})}const Qg=r.forwardRef(({className:e,...n},o)=>t.jsx("div",{className:"w-full overflow-auto",children:t.jsx("table",{ref:o,className:Ie("w-full caption-bottom text-sm",e),...n})}));Qg.displayName="Table";const Jg=r.forwardRef(({className:e,...n},o)=>t.jsx("thead",{ref:o,className:Ie("rounded-md bg-[#0E2B63] h-[36px]",e),...n}));Jg.displayName="TableHeader";const ex=r.forwardRef(({className:e,...n},o)=>t.jsx("tbody",{ref:o,className:Ie("[&_tr:last-child]:border-0",e),...n}));ex.displayName="TableBody";const tx=r.forwardRef(({className:e,...n},o)=>t.jsx("tfoot",{ref:o,className:Ie("bg-primary font-medium text-primary-foreground",e),...n}));tx.displayName="TableFooter";const nx=r.forwardRef(({className:e,...n},o)=>t.jsx("tr",{ref:o,className:Ie("text-sm text-fontcolor-secondary transition-colors data-[state=selected]:bg-muted",e),...n}));nx.displayName="TableRow";const ox=r.forwardRef(({className:e,...n},o)=>t.jsx("th",{ref:o,className:Ie("text-left px-4 align-middle text-[12px] text-[#FFFFFF] font-medium [&:has([role=checkbox])]:pr-0 first:rounded-l-lg last:rounded-r-lg",e),...n}));ox.displayName="TableHead";const rx=r.forwardRef(({className:e,...n},o)=>t.jsx("td",{ref:o,className:Ie("px-4 py-2 align-middle text-[12px] text-[#333333] [&:has([role=checkbox])]:pr-0",e),...n}));rx.displayName="TableCell";const ax=r.forwardRef(({className:e,...n},o)=>t.jsx("caption",{ref:o,className:Ie("mt-4 text-sm text-muted-foreground",e),...n}));function ix({className:e,...n}){return t.jsx("div",{className:Ie("animate-pulse rounded-md bg-muted",e),...n})}function sx({columns:e,rows:n=5}){const o=function(e){return"number"==typeof e?Array.from({length:e},()=>({})):e}(e),r=Array.from({length:n},(e,t)=>"row-".concat(String(t)));return t.jsx(t.Fragment,{children:r.map(e=>t.jsx(nx,{children:o.map((n,o)=>t.jsx(rx,{className:Ie(n.width,n.cellClassName,"px-2 py-2"),children:t.jsx(ix,{className:"block h-4 w-full"})},e.concat("-col-",String(o))))},e))})}ax.displayName="TableCaption";const lx={Root:Qg,Body:ex,Cell:rx,Head:ox,Header:Jg,Row:nx};function cx({columns:e,ordering:n,onSort:o}){return t.jsx(nx,{children:e.map(e=>{const r=Boolean(e.sortable),a=n===e.key,i=n==="-".concat(e.key),s=a||i;return t.jsx(ox,{className:Ie(e.width,e.className,r?"cursor-pointer":""),onClick:r&&o?()=>o(e.key):void 0,children:t.jsxs(Ve,{direction:"row",gap:1,children:[e.label,r&&s&&(a?t.jsx(Xa,{size:16}):t.jsx(Za,{size:16}))]})},e.key)})})}function dx({item:e,columns:n,onClick:o}){return t.jsx(nx,{className:Ie(o?"hover:bg-secondary cursor-pointer":""),onClick:o,children:n.map(n=>{const o=e[n.key];return t.jsx(rx,{className:Ie(n.width,n.cellClassName),children:n.render?n.render(o,e):String(o??"N/D")},n.key)})})}var ux="Checkbox",[px]=Es(ux),[fx,mx]=px(ux);function hx(e){const{__scopeCheckbox:n,checked:o,children:a,defaultChecked:i,disabled:s,form:l,name:c,onCheckedChange:d,required:u,value:p="on",internal_do_not_use_render:f}=e,[m,h]=Ks({prop:o,defaultProp:i??!1,onChange:d,caller:ux}),[v,g]=r.useState(null),[x,y]=r.useState(null),b=r.useRef(!1),w=!v||(!!l||!!v.closest("form")),k={checked:m,disabled:s,setChecked:h,control:v,setControl:g,name:c,form:l,value:p,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:!Nx(i)&&i,isFormControl:w,bubbleInput:x,setBubbleInput:y};return t.jsx(fx,{scope:n,...k,children:jx(f)?f(k):a})}var vx="CheckboxTrigger",gx=r.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:o,...a},i)=>{const{control:s,value:l,disabled:c,checked:d,required:u,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:v}=mx(vx,e),g=Rs(i,p),x=r.useRef(d);return r.useEffect(()=>{const e=s?.form;if(e){const t=()=>f(x.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[s,f]),t.jsx(Us.button,{type:"button",role:"checkbox","aria-checked":Nx(d)?"mixed":d,"aria-required":u,"data-state":Cx(d),"data-disabled":c?"":void 0,disabled:c,value:l,...a,ref:g,onKeyDown:qs(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:qs(o,e=>{f(e=>!!Nx(e)||!e),v&&h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})});gx.displayName=vx;var xx=r.forwardRef((e,n)=>{const{__scopeCheckbox:o,name:r,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:d,form:u,...p}=e;return t.jsx(hx,{__scopeCheckbox:o,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>t.jsxs(t.Fragment,{children:[t.jsx(gx,{...p,ref:n,__scopeCheckbox:o}),e&&t.jsx(kx,{__scopeCheckbox:o})]})})});xx.displayName=ux;var yx="CheckboxIndicator",bx=r.forwardRef((e,n)=>{const{__scopeCheckbox:o,forceMount:r,...a}=e,i=mx(yx,o);return t.jsx(Gs,{present:r||Nx(i.checked)||!0===i.checked,children:t.jsx(Us.span,{"data-state":Cx(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:n,style:{pointerEvents:"none",...e.style}})})});bx.displayName=yx;var wx="CheckboxBubbleInput",kx=r.forwardRef(({__scopeCheckbox:e,...n},o)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:l,required:c,disabled:d,name:u,value:p,form:f,bubbleInput:m,setBubbleInput:h}=mx(wx,e),v=Rs(o,h),g=Vf(s),x=Nf(a);r.useEffect(()=>{const e=m;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,o=!i.current;if(g!==s&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Nx(s),n.call(e,!Nx(s)&&s),e.dispatchEvent(t)}},[m,g,s,i]);const y=r.useRef(!Nx(s)&&s);return t.jsx(Us.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??y.current,required:c,disabled:d,name:u,value:p,form:f,...n,tabIndex:-1,ref:v,style:{...n.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function jx(e){return"function"==typeof e}function Nx(e){return"indeterminate"===e}function Cx(e){return Nx(e)?"indeterminate":e?"checked":"unchecked"}kx.displayName=wx;const _x=r.forwardRef(({className:e,...n},o)=>t.jsx(xx,{ref:o,className:Ie("bg-white peer w-[18px] h-[18px] shrink-0 rounded-md border-gray-300 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:input-data-checked data-[state=checked]:border-none data-[state=checked]:text-primary-foreground",e),...n,children:t.jsx(bx,{className:Ie("flex items-center justify-center text-current"),children:t.jsx(ei,{className:"h-4 w-4"})})}));_x.displayName=xx.displayName;var Dx=r.forwardRef((e,n)=>t.jsx(Us.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Dx.displayName="Label";var Sx=Dx;const Ex=w("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Mx=r.forwardRef(({className:e,...n},o)=>t.jsx(Sx,{ref:o,className:Ie(Ex(),e),...n}));Mx.displayName=Sx.displayName;var[Ox]=Es("Tooltip",[Df]),Tx=Df(),Rx="TooltipProvider",Px=700,Ax="tooltip.open",[Ix,Fx]=Ox(Rx),zx=e=>{const{__scopeTooltip:n,delayDuration:o=Px,skipDelayDuration:a=300,disableHoverableContent:i=!1,children:s}=e,l=r.useRef(!0),c=r.useRef(!1),d=r.useRef(0);return r.useEffect(()=>{const e=d.current;return()=>window.clearTimeout(e)},[]),t.jsx(Ix,{scope:n,isOpenDelayedRef:l,delayDuration:o,onOpen:r.useCallback(()=>{a<=0||(window.clearTimeout(d.current),l.current=!1)},[a]),onClose:r.useCallback(()=>{a<=0||(window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,a))},[a]),isPointerInTransitRef:c,onPointerInTransitChange:r.useCallback(e=>{c.current=e},[]),disableHoverableContent:i,children:s})};zx.displayName=Rx;var Lx="Tooltip",[Wx,Bx]=Ox(Lx),$x=e=>{const{__scopeTooltip:n,children:o,open:a,defaultOpen:i,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=e,d=Fx(Lx,e.__scopeTooltip),u=Tx(n),[p,f]=r.useState(null),m=el(),h=r.useRef(0),v=l??d.disableHoverableContent,g=c??d.delayDuration,x=r.useRef(!1),[y,b]=Ks({prop:a,defaultProp:i??!1,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(Ax))):d.onClose(),s?.(e)},caller:Lx}),w=r.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),k=r.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x.current=!1,b(!0)},[b]),j=r.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),N=r.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{x.current=!0,b(!0),h.current=0},g)},[g,b]);return r.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),t.jsx(qf,{...u,children:t.jsx(Wx,{scope:n,contentId:m,open:y,stateAttribute:w,trigger:p,onTriggerChange:f,onTriggerEnter:r.useCallback(()=>{d.isOpenDelayedRef.current?N():k()},[d.isOpenDelayedRef,N,k]),onTriggerLeave:r.useCallback(()=>{v?j():(window.clearTimeout(h.current),h.current=0)},[j,v]),onOpen:k,onClose:j,disableHoverableContent:v,children:o})})};$x.displayName=Lx;var qx="TooltipTrigger",Yx=r.forwardRef((e,n)=>{const{__scopeTooltip:o,...a}=e,i=Bx(qx,o),s=Fx(qx,o),l=Tx(o),c=Rs(n,r.useRef(null),i.onTriggerChange),d=r.useRef(!1),u=r.useRef(!1),p=r.useCallback(()=>d.current=!1,[]);return r.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),t.jsx(Yf,{asChild:!0,...l,children:t.jsx(Us.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:c,onPointerMove:qs(e.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||s.isPointerInTransitRef.current||(i.onTriggerEnter(),u.current=!0))}),onPointerLeave:qs(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:qs(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:qs(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:qs(e.onBlur,i.onClose),onClick:qs(e.onClick,i.onClose)})})});Yx.displayName=qx;var[Hx,Kx]=Ox("TooltipPortal",{forceMount:void 0}),Ux="TooltipContent",Vx=r.forwardRef((e,n)=>{const o=Kx(Ux,e.__scopeTooltip),{forceMount:r=o.forceMount,side:a="top",...i}=e,s=Bx(Ux,e.__scopeTooltip);return t.jsx(Gs,{present:r||s.open,children:s.disableHoverableContent?t.jsx(Jx,{side:a,...i,ref:n}):t.jsx(Gx,{side:a,...i,ref:n})})}),Gx=r.forwardRef((e,n)=>{const o=Bx(Ux,e.__scopeTooltip),a=Fx(Ux,e.__scopeTooltip),i=r.useRef(null),s=Rs(n,i),[l,c]=r.useState(null),{trigger:d,onClose:u}=o,p=i.current,{onPointerInTransitChange:f}=a,m=r.useCallback(()=>{c(null),f(!1)},[f]),h=r.useCallback((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}(o,function(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,o,r,a)){case a:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,n.getBoundingClientRect())),a=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}(t.getBoundingClientRect())]);c(a),f(!0)},[f]);return r.useEffect(()=>()=>m(),[m]),r.useEffect(()=>{if(d&&p){const e=e=>h(e,p),t=e=>h(e,d);return d.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[d,p,h,m]),r.useEffect(()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=d?.contains(t)||p?.contains(t),r=!function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>o!=u>o&&n<(d-l)*(o-c)/(u-c)+l&&(r=!r)}return r}(n,l);o?m():r&&(m(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,p,l,u,m]),t.jsx(Jx,{...e,ref:s})}),[Zx,Xx]=Ox(Lx,{isInside:!1}),Qx=function(e){const t=e=>"child"in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=As,t}("TooltipContent"),Jx=r.forwardRef((e,n)=>{const{__scopeTooltip:o,children:a,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=e,d=Bx(Ux,o),u=Tx(o),{onClose:p}=d;return r.useEffect(()=>(document.addEventListener(Ax,p),()=>document.removeEventListener(Ax,p)),[p]),r.useEffect(()=>{if(d.trigger){const e=e=>{e.target instanceof Node&&e.target.contains(d.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[d.trigger,p]),t.jsx(rf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(Hf,{"data-state":d.stateAttribute,...u,...c,ref:n,style:{...c.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:[t.jsx(Qx,{children:a}),t.jsx(Zx,{scope:o,isInside:!0,children:t.jsx(Xf,{id:d.contentId,role:"tooltip",children:i||a})})]})})});Vx.displayName=Ux;var ey="TooltipArrow";r.forwardRef((e,n)=>{const{__scopeTooltip:o,...r}=e,a=Tx(o);return Xx(ey,o).isInside?null:t.jsx(Kf,{...a,...r,ref:n})}).displayName=ey;var ty=Vx;const ny=zx,oy=$x,ry=Yx,ay=r.forwardRef(({className:e,sideOffset:n=4,...o},r)=>t.jsx(ty,{ref:r,sideOffset:n,className:Ie("border border-body rounded-md z-50 overflow-hidden bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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",e),...o}));ay.displayName=ty.displayName;const iy=w("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),sy=r.forwardRef(({className:e,variant:n,...o},r)=>t.jsx("div",{ref:r,role:"alert",className:Ie(iy({variant:n}),e),...o}));sy.displayName="Alert";const ly=r.forwardRef(({className:e,...n},o)=>t.jsx("h5",{ref:o,className:Ie("mb-1 font-medium leading-none tracking-tight",e),...n}));ly.displayName="AlertTitle";const cy=r.forwardRef(({className:e,...n},o)=>t.jsx("div",{ref:o,className:Ie("text-sm [&_p]:leading-relaxed",e),...n}));cy.displayName="AlertDescription";var dy="rovingFocusGroup.onEntryFocus",uy={bubbles:!1,cancelable:!0},py="RovingFocusGroup",[fy,my,hy]=$s(py),[vy,gy]=Es(py,[hy]),[xy,yy]=vy(py),by=r.forwardRef((e,n)=>t.jsx(fy.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(fy.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(wy,{...e,ref:n})})}));by.displayName=py;var wy=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,orientation:a,loop:i=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...f}=e,m=r.useRef(null),h=Rs(n,m),v=gl(s),[g,x]=Ks({prop:l,defaultProp:c??null,onChange:d,caller:py}),[y,b]=r.useState(!1),w=Qp(u),k=my(o),j=r.useRef(!1),[N,C]=r.useState(0);return r.useEffect(()=>{const e=m.current;if(e)return e.addEventListener(dy,w),()=>e.removeEventListener(dy,w)},[w]),t.jsx(xy,{scope:o,orientation:a,dir:v,loop:i,currentTabStopId:g,onItemFocus:r.useCallback(e=>x(e),[x]),onItemShiftTab:r.useCallback(()=>b(!0),[]),onFocusableItemAdd:r.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>C(e=>e-1),[]),children:t.jsx(Us.div,{tabIndex:y||0===N?-1:0,"data-orientation":a,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:qs(e.onMouseDown,()=>{j.current=!0}),onFocus:qs(e.onFocus,e=>{const t=!j.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(dy,uy);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);Cy([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),p)}}j.current=!1}),onBlur:qs(e.onBlur,()=>b(!1))})})}),ky="RovingFocusGroupItem",jy=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,focusable:a=!0,active:i=!1,tabStopId:s,children:l,...c}=e,d=el(),u=s||d,p=yy(ky,o),f=p.currentTabStopId===u,m=my(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=p;return r.useEffect(()=>{if(a)return h(),()=>v()},[a,h,v]),t.jsx(fy.ItemSlot,{scope:o,id:u,focusable:a,active:i,children:t.jsx(Us.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:n,onMouseDown:qs(e.onMouseDown,e=>{a?p.onItemFocus(u):e.preventDefault()}),onFocus:qs(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:qs(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const o=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(o)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)?void 0:Ny[o]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const a=r.indexOf(e.currentTarget);r=p.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>Cy(r))}var n,o}),children:"function"==typeof l?l({isCurrentTabStop:f,hasTabStop:null!=g}):l})})});jy.displayName=ky;var Ny={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cy(e,t=!1){const n=document.activeElement;for(const o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}var _y=by,Dy=jy,Sy=["Enter"," "],Ey=["ArrowUp","PageDown","End"],My=["ArrowDown","PageUp","Home",...Ey],Oy={ltr:[...Sy,"ArrowRight"],rtl:[...Sy,"ArrowLeft"]},Ty={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ry="Menu",[Py,Ay,Iy]=$s(Ry),[Fy,zy]=Es(Ry,[Iy,Df,gy]),Ly=Df(),Wy=gy(),[By,$y]=Fy(Ry),[qy,Yy]=Fy(Ry),Hy=e=>{const{__scopeMenu:n,open:o=!1,children:a,dir:i,onOpenChange:s,modal:l=!0}=e,c=Ly(n),[d,u]=r.useState(null),p=r.useRef(!1),f=Qp(s),m=gl(i);return r.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),r.useEffect(()=>{if(!o)return;const e=()=>f(!1);return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[o,f]),t.jsx(qf,{...c,children:t.jsx(By,{scope:n,open:o,onOpenChange:f,content:d,onContentChange:u,children:t.jsx(qy,{scope:n,onClose:r.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:m,modal:l,children:a})})})};Hy.displayName=Ry;var Ky=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e,a=Ly(o);return t.jsx(Yf,{...a,...r,ref:n})});Ky.displayName="MenuAnchor";var Uy="MenuPortal",[Vy,Gy]=Fy(Uy,{forceMount:void 0}),Zy=e=>{const{__scopeMenu:n,forceMount:o,children:r,container:a}=e,i=$y(Uy,n);return t.jsx(Vy,{scope:n,forceMount:o,children:t.jsx(Gs,{present:o||i.open,children:t.jsx(Uf,{asChild:!0,container:a,children:r})})})};Zy.displayName=Uy;var Xy="MenuContent",[Qy,Jy]=Fy(Xy),eb=r.forwardRef((e,n)=>{const o=Gy(Xy,e.__scopeMenu),{forceMount:r=o.forceMount,...a}=e,i=$y(Xy,e.__scopeMenu),s=Yy(Xy,e.__scopeMenu);return t.jsx(Py.Provider,{scope:e.__scopeMenu,children:t.jsx(Gs,{present:r||i.open,children:t.jsx(Py.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(tb,{...a,ref:n}):t.jsx(nb,{...a,ref:n})})})})}),tb=r.forwardRef((e,n)=>{const o=$y(Xy,e.__scopeMenu),a=r.useRef(null),i=Rs(n,a);return r.useEffect(()=>{const e=a.current;if(e)return ir(e)},[]),t.jsx(rb,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:qs(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),nb=r.forwardRef((e,n)=>{const o=$y(Xy,e.__scopeMenu);return t.jsx(rb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})}),ob=Ps("MenuContent.ScrollLock"),rb=r.forwardRef((e,n)=>{const{__scopeMenu:o,loop:a=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:h,disableOutsideScroll:v,...g}=e,x=$y(Xy,o),y=Yy(Xy,o),b=Ly(o),w=Wy(o),k=Ay(o),[j,N]=r.useState(null),C=r.useRef(null),_=Rs(n,C,x.onContentChange),D=r.useRef(0),S=r.useRef(""),E=r.useRef(0),M=r.useRef(null),O=r.useRef("right"),T=r.useRef(0),R=v?Jo:r.Fragment,P=v?{as:ob,allowPinchZoom:!0}:void 0,A=e=>{const t=S.current+e,n=k().filter(e=>!e.disabled),o=document.activeElement,r=n.find(e=>e.ref.current===o)?.textValue,a=function(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0]),r=o?t[0]:t,a=n?e.indexOf(n):-1;let i=(s=e,l=Math.max(a,0),s.map((e,t)=>s[(l+t)%s.length]));var s,l;1===r.length&&(i=i.filter(e=>e!==n));const c=i.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}(n.map(e=>e.textValue),t,r),i=n.find(e=>e.textValue===a)?.ref.current;!function e(t){S.current=t,window.clearTimeout(D.current),""!==t&&(D.current=window.setTimeout(()=>e(""),1e3))}(t),i&&setTimeout(()=>i.focus())};r.useEffect(()=>()=>window.clearTimeout(D.current),[]),df();const I=r.useCallback(e=>O.current===M.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>o!=u>o&&n<(d-l)*(o-c)/(u-c)+l&&(r=!r)}return r}(n,t)}(e,M.current?.area),[]);return t.jsx(Qy,{scope:o,searchRef:S,onItemEnter:r.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:r.useCallback(e=>{I(e)||(C.current?.focus(),N(null))},[I]),onTriggerLeave:r.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:E,onPointerGraceIntentChange:r.useCallback(e=>{M.current=e},[]),children:t.jsx(R,{...P,children:t.jsx(hf,{asChild:!0,trapped:i,onMountAutoFocus:qs(s,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:t.jsx(rf,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:h,children:t.jsx(_y,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:a,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:qs(d,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(Hf,{role:"menu","aria-orientation":"vertical","data-state":Tb(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...g,ref:_,style:{outline:"none",...g.style},onKeyDown:qs(g.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,o=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&o&&A(e.key));const r=C.current;if(e.target!==r)return;if(!My.includes(e.key))return;e.preventDefault();const a=k().filter(e=>!e.disabled).map(e=>e.ref.current);Ey.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(a)}),onBlur:qs(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),S.current="")}),onPointerMove:qs(e.onPointerMove,Ab(e=>{const t=e.target,n=T.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>T.current?"right":"left";O.current=t,T.current=e.clientX}}))})})})})})})});eb.displayName=Xy;var ab=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Us.div,{role:"group",...r,ref:n})});ab.displayName="MenuGroup";var ib=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Us.div,{...r,ref:n})});ib.displayName="MenuLabel";var sb="MenuItem",lb="menu.itemSelect",cb=r.forwardRef((e,n)=>{const{disabled:o=!1,onSelect:a,...i}=e,s=r.useRef(null),l=Yy(sb,e.__scopeMenu),c=Jy(sb,e.__scopeMenu),d=Rs(n,s),u=r.useRef(!1);return t.jsx(db,{...i,ref:d,disabled:o,onClick:qs(e.onClick,()=>{const e=s.current;if(!o&&e){const t=new CustomEvent(lb,{bubbles:!0,cancelable:!0});e.addEventListener(lb,e=>a?.(e),{once:!0}),Vs(e,t),t.defaultPrevented?u.current=!1:l.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:qs(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:qs(e.onKeyDown,e=>{const t=""!==c.searchRef.current;o||t&&" "===e.key||Sy.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});cb.displayName=sb;var db=r.forwardRef((e,n)=>{const{__scopeMenu:o,disabled:a=!1,textValue:i,...s}=e,l=Jy(sb,o),c=Wy(o),d=r.useRef(null),u=Rs(n,d),[p,f]=r.useState(!1),[m,h]=r.useState("");return r.useEffect(()=>{const e=d.current;e&&h((e.textContent??"").trim())},[s.children]),t.jsx(Py.ItemSlot,{scope:o,disabled:a,textValue:i??m,children:t.jsx(Dy,{asChild:!0,...c,focusable:!a,children:t.jsx(Us.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...s,ref:u,onPointerMove:qs(e.onPointerMove,Ab(e=>{if(a)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:qs(e.onPointerLeave,Ab(e=>l.onItemLeave(e))),onFocus:qs(e.onFocus,()=>f(!0)),onBlur:qs(e.onBlur,()=>f(!1))})})})}),ub=r.forwardRef((e,n)=>{const{checked:o=!1,onCheckedChange:r,...a}=e;return t.jsx(yb,{scope:e.__scopeMenu,checked:o,children:t.jsx(cb,{role:"menuitemcheckbox","aria-checked":Rb(o)?"mixed":o,...a,ref:n,"data-state":Pb(o),onSelect:qs(a.onSelect,()=>r?.(!!Rb(o)||!o),{checkForDefaultPrevented:!1})})})});ub.displayName="MenuCheckboxItem";var pb="MenuRadioGroup",[fb,mb]=Fy(pb,{value:void 0,onValueChange:()=>{}}),hb=r.forwardRef((e,n)=>{const{value:o,onValueChange:r,...a}=e,i=Qp(r);return t.jsx(fb,{scope:e.__scopeMenu,value:o,onValueChange:i,children:t.jsx(ab,{...a,ref:n})})});hb.displayName=pb;var vb="MenuRadioItem",gb=r.forwardRef((e,n)=>{const{value:o,...r}=e,a=mb(vb,e.__scopeMenu),i=o===a.value;return t.jsx(yb,{scope:e.__scopeMenu,checked:i,children:t.jsx(cb,{role:"menuitemradio","aria-checked":i,...r,ref:n,"data-state":Pb(i),onSelect:qs(r.onSelect,()=>a.onValueChange?.(o),{checkForDefaultPrevented:!1})})})});gb.displayName=vb;var xb="MenuItemIndicator",[yb,bb]=Fy(xb,{checked:!1}),wb=r.forwardRef((e,n)=>{const{__scopeMenu:o,forceMount:r,...a}=e,i=bb(xb,o);return t.jsx(Gs,{present:r||Rb(i.checked)||!0===i.checked,children:t.jsx(Us.span,{...a,ref:n,"data-state":Pb(i.checked)})})});wb.displayName=xb;var kb=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Us.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})});kb.displayName="MenuSeparator";var jb=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e,a=Ly(o);return t.jsx(Kf,{...a,...r,ref:n})});jb.displayName="MenuArrow";var Nb="MenuSub",[Cb,_b]=Fy(Nb),Db=e=>{const{__scopeMenu:n,children:o,open:a=!1,onOpenChange:i}=e,s=$y(Nb,n),l=Ly(n),[c,d]=r.useState(null),[u,p]=r.useState(null),f=Qp(i);return r.useEffect(()=>(!1===s.open&&f(!1),()=>f(!1)),[s.open,f]),t.jsx(qf,{...l,children:t.jsx(By,{scope:n,open:a,onOpenChange:f,content:u,onContentChange:p,children:t.jsx(Cb,{scope:n,contentId:el(),triggerId:el(),trigger:c,onTriggerChange:d,children:o})})})};Db.displayName=Nb;var Sb="MenuSubTrigger",Eb=r.forwardRef((e,n)=>{const o=$y(Sb,e.__scopeMenu),a=Yy(Sb,e.__scopeMenu),i=_b(Sb,e.__scopeMenu),s=Jy(Sb,e.__scopeMenu),l=r.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,u={__scopeMenu:e.__scopeMenu},p=r.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return r.useEffect(()=>p,[p]),r.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),d(null)}},[c,d]),t.jsx(Ky,{asChild:!0,...u,children:t.jsx(db,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?i.contentId:void 0,"data-state":Tb(o.open),...e,ref:Ts(n,i.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:qs(e.onPointerMove,Ab(t=>{s.onItemEnter(t),t.defaultPrevented||e.disabled||o.open||l.current||(s.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{o.onOpenChange(!0),p()},100))})),onPointerLeave:qs(e.onPointerLeave,Ab(e=>{p();const t=o.content?.getBoundingClientRect();if(t){const n=o.content?.dataset.side,r="right"===n,a=r?-5:5,i=t[r?"left":"right"],l=t[r?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:i,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:qs(e.onKeyDown,t=>{const n=""!==s.searchRef.current;e.disabled||n&&" "===t.key||Oy[a.dir].includes(t.key)&&(o.onOpenChange(!0),o.content?.focus(),t.preventDefault())})})})});Eb.displayName=Sb;var Mb="MenuSubContent",Ob=r.forwardRef((e,n)=>{const o=Gy(Xy,e.__scopeMenu),{forceMount:a=o.forceMount,align:i="start",...s}=e,l=$y(Xy,e.__scopeMenu),c=Yy(Xy,e.__scopeMenu),d=_b(Mb,e.__scopeMenu),u=r.useRef(null),p=Rs(n,u);return t.jsx(Py.Provider,{scope:e.__scopeMenu,children:t.jsx(Gs,{present:a||l.open,children:t.jsx(Py.Slot,{scope:e.__scopeMenu,children:t.jsx(rb,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:p,align:i,side:"rtl"===c.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:qs(e.onFocusOutside,e=>{e.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:qs(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:qs(e.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=Ty[c.dir].includes(e.key);t&&n&&(l.onOpenChange(!1),d.trigger?.focus(),e.preventDefault())})})})})})});function Tb(e){return e?"open":"closed"}function Rb(e){return"indeterminate"===e}function Pb(e){return Rb(e)?"indeterminate":e?"checked":"unchecked"}function Ab(e){return t=>"mouse"===t.pointerType?e(t):void 0}Ob.displayName=Mb;var Ib=Hy,Fb=Ky,zb=Zy,Lb=eb,Wb=ab,Bb=ib,$b=cb,qb=ub,Yb=hb,Hb=gb,Kb=wb,Ub=kb,Vb=jb,Gb=Db,Zb=Eb,Xb=Ob,Qb="DropdownMenu",[Jb]=Es(Qb,[zy]),ew=zy(),[tw,nw]=Jb(Qb),ow=e=>{const{__scopeDropdownMenu:n,children:o,dir:a,open:i,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=ew(n),u=r.useRef(null),[p,f]=Ks({prop:i,defaultProp:s??!1,onChange:l,caller:Qb});return t.jsx(tw,{scope:n,triggerId:el(),triggerRef:u,contentId:el(),open:p,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),modal:c,children:t.jsx(Ib,{...d,open:p,onOpenChange:f,dir:a,modal:c,children:o})})};ow.displayName=Qb;var rw="DropdownMenuTrigger",aw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,disabled:r=!1,...a}=e,i=nw(rw,o),s=ew(o);return t.jsx(Fb,{asChild:!0,...s,children:t.jsx(Us.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Ts(n,i.triggerRef),onPointerDown:qs(e.onPointerDown,e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:qs(e.onKeyDown,e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});aw.displayName=rw;var iw=e=>{const{__scopeDropdownMenu:n,...o}=e,r=ew(n);return t.jsx(zb,{...r,...o})};iw.displayName="DropdownMenuPortal";var sw="DropdownMenuContent",lw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...a}=e,i=nw(sw,o),s=ew(o),l=r.useRef(!1);return t.jsx(Lb,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...a,ref:n,onCloseAutoFocus:qs(e.onCloseAutoFocus,e=>{l.current||i.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:qs(e.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;i.modal&&!o||(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});lw.displayName=sw;var cw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Wb,{...a,...r,ref:n})});cw.displayName="DropdownMenuGroup";var dw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Bb,{...a,...r,ref:n})});dw.displayName="DropdownMenuLabel";var uw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx($b,{...a,...r,ref:n})});uw.displayName="DropdownMenuItem";var pw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(qb,{...a,...r,ref:n})});pw.displayName="DropdownMenuCheckboxItem";var fw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Yb,{...a,...r,ref:n})});fw.displayName="DropdownMenuRadioGroup";var mw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Hb,{...a,...r,ref:n})});mw.displayName="DropdownMenuRadioItem";var hw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Kb,{...a,...r,ref:n})});hw.displayName="DropdownMenuItemIndicator";var vw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Ub,{...a,...r,ref:n})});vw.displayName="DropdownMenuSeparator";r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Vb,{...a,...r,ref:n})}).displayName="DropdownMenuArrow";var gw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Zb,{...a,...r,ref:n})});gw.displayName="DropdownMenuSubTrigger";var xw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Xb,{...a,...r,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xw.displayName="DropdownMenuSubContent";var yw=iw,bw=lw,ww=dw,kw=uw,jw=pw,Nw=mw,Cw=hw,_w=vw,Dw=gw,Sw=xw;const Ew=ow,Mw=aw,Ow=cw,Tw=yw,Rw=e=>{const{__scopeDropdownMenu:n,children:o,open:r,onOpenChange:a,defaultOpen:i}=e,s=ew(n),[l,c]=Ks({prop:r,defaultProp:i??!1,onChange:a,caller:"DropdownMenuSub"});return t.jsx(Gb,{...s,open:l,onOpenChange:c,children:o})},Pw=fw,Aw=r.forwardRef(({className:e,inset:n,children:o,...r},a)=>t.jsxs(Dw,{ref:a,className:Ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",e),...r,children:[o,t.jsx(oi,{className:"ml-auto h-4 w-4"})]}));Aw.displayName=Dw.displayName;const Iw=r.forwardRef(({className:e,...n},o)=>t.jsx(Sw,{ref:o,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",e),...n}));Iw.displayName=Sw.displayName;const Fw=r.forwardRef(({className:e,sideOffset:n=4,...o},r)=>t.jsx(yw,{children:t.jsx(bw,{ref:r,sideOffset:n,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",e),...o})}));Fw.displayName=bw.displayName;const zw=r.forwardRef(({className:e,inset:n,...o},r)=>t.jsx(kw,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",e),...o}));zw.displayName=kw.displayName;const Lw=r.forwardRef(({className:e,children:n,checked:o,...r},a)=>t.jsxs(jw,{ref:a,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Cw,{children:t.jsx(ei,{className:"h-4 w-4"})})}),n]}));Lw.displayName=jw.displayName;const Ww=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(Nw,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Cw,{children:t.jsx(ii,{className:"h-2 w-2 fill-current"})})}),n]}));Ww.displayName=Nw.displayName;const Bw=r.forwardRef(({className:e,inset:n,...o},r)=>t.jsx(ww,{ref:r,className:Ie("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...o}));Bw.displayName=ww.displayName;const $w=r.forwardRef(({className:e,...n},o)=>t.jsx(_w,{ref:o,className:Ie("-mx-1 my-1 h-px bg-muted",e),...n}));$w.displayName=_w.displayName;const qw=({className:e,...n})=>t.jsx("span",{className:Ie("ml-auto text-xs tracking-widest opacity-60",e),...n});qw.displayName="DropdownMenuShortcut";const Yw=r.forwardRef(({className:e,...n},o)=>t.jsx("input",{type:"radio",className:Ie("h-4 w-4 cursor-pointer accent-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...n}));Yw.displayName="Radio";const Hw=({size:e=8})=>t.jsxs("output",{children:[t.jsxs("svg",{width:4*e,height:4*e,viewBox:"0 0 78 78",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin",role:"img","aria-labelledby":"spinnerTitle",children:[t.jsx("title",{id:"spinnerTitle",children:"Loading..."}),t.jsx("path",{d:"M13.2131 9.74186C7.6162 14.6748 3.55158 21.1095 1.50144 28.2828L9.89497 30.6817C11.4862 25.114 14.641 20.1196 18.9852 16.2909L13.2131 9.74186Z",fill:"#0d406e"}),t.jsx("path",{d:"M55.2865 74.4365C62.0653 71.321 67.8083 66.3265 71.8342 60.0455L64.4847 55.3347C61.36 60.2099 56.9025 64.0864 51.641 66.5046L55.2865 74.4365Z",fill:"#0d406e"}),t.jsx("path",{d:"M71.8342 60.0455C75.8601 53.7645 78 46.4605 78 39H69.2704C69.2704 44.7906 67.6095 50.4596 64.4847 55.3347L71.8342 60.0455Z",fill:"#0d406e"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.2131 9.74186C20.1094 4.11892 24.5245 2.24347 33.0785 0.452148C25.7044 1.58491 18.8101 4.80896 13.2131 9.74186Z",fill:"#0d406e"}),t.jsx("path",{d:"M33.5891 77.6228C40.9774 78.6579 48.5077 77.5521 55.2865 74.4365L51.641 66.5046C46.3795 68.9227 40.5348 69.781 34.8002 68.9776L33.5891 77.6228Z",fill:"#0d406e"}),t.jsx("path",{d:"M13.6026 68.5968C19.2643 73.4552 26.2007 76.5877 33.5891 77.6228L34.8002 68.9776C29.0657 68.1742 23.6818 65.7429 19.2874 61.9719L13.6026 68.5968Z",fill:"#0d406e"}),t.jsx("path",{d:"M1.50144 28.2828C-0.548705 35.4561 -0.498346 43.0669 1.64654 50.2124L10.0076 47.7027C8.34281 42.1566 8.30373 36.2493 9.89497 30.6817L1.50144 28.2828Z",fill:"#0d406e"}),t.jsx("path",{d:"M1.64654 50.2124C3.79143 57.358 7.94084 63.7384 13.6026 68.5968L19.2874 61.9719C14.893 58.201 11.6724 53.2488 10.0076 47.7027L1.64654 50.2124Z",fill:"#0d406e"}),t.jsx("path",{d:"M34.4039 9.08055L33.0785 0.452148C24.5245 2.24347 20.1094 4.11892 13.2131 9.74186L18.9852 16.2909C23.3293 12.4621 28.6805 9.95976 34.4039 9.08055Z",fill:"#0d406e"})]}),t.jsx("span",{className:"sr-only",children:"Loading..."})]});const Kw=async(e,{search:t,modelClass:n,labelName:o,additionalFilters:r={},fields:a})=>{const i={...t?{[`${o}__icontains`]:t}:{},...r},s=a?.length?[o,...a]:[],[l,c]=await e(n,i,s);if(c)throw new Error(c.message);return l??[]};const Uw=({triggerClassName:n,className:o,trigger:r,children:a})=>{const i=e.useId();return t.jsx(ny,{children:t.jsxs(oy,{children:[t.jsx(ry,{asChild:!0,children:t.jsx("div",{className:n,children:r})}),t.jsx(ay,{className:o,children:a})]})},i)};exports.Accordion=Zl,exports.AccordionContent=Jl,exports.AccordionItem=Xl,exports.AccordionTrigger=Ql,exports.Alert=sy,exports.AlertDescription=cy,exports.AlertDialog=ja,exports.AlertDialogAction=Oa,exports.AlertDialogCancel=Ta,exports.AlertDialogContent=_a,exports.AlertDialogDescription=Ma,exports.AlertDialogFooter=Sa,exports.AlertDialogHeader=Da,exports.AlertDialogOverlay=Ca,exports.AlertDialogPortal=Na,exports.AlertDialogTitle=Ea,exports.AlertDialogTrigger=function({...e}){return t.jsx(ha,{"data-slot":"alert-dialog-trigger",...e})},exports.AlertTitle=ly,exports.AlertWithIcon=function({icon:e,title:n,description:o,variant:r="default",className:a}){return t.jsxs(sy,{variant:r,className:a??"w-auto h-auto m-4",children:[e,t.jsx(ly,{children:n}),t.jsx(cy,{children:o})]})},exports.Badge=function({className:e,variant:n,...o}){return t.jsx("div",{"data-slot":"badge",className:Ie($a({variant:n}),e),...o})},exports.Breadcrumb=function({...e}){return t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})},exports.BreadcrumbEllipsis=function({className:e,...n}){return t.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:Ie("flex size-9 items-center justify-center",e),...n,children:[t.jsx(di,{className:"size-4"}),t.jsx("span",{className:"sr-only",children:"More"})]})},exports.BreadcrumbItem=function({className:e,...n}){return t.jsx("li",{"data-slot":"breadcrumb-item",className:Ie("inline-flex items-center gap-1.5",e),...n})},exports.BreadcrumbLink=function({asChild:e,className:n,...o}){const r=e?f:"a";return t.jsx(r,{"data-slot":"breadcrumb-link",className:Ie("hover:text-foreground transition-colors",n),...o})},exports.BreadcrumbList=function({className:e,...n}){return t.jsx("ol",{"data-slot":"breadcrumb-list",className:Ie("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...n})},exports.BreadcrumbPage=function({className:e,...n}){return t.jsx("span",{"data-slot":"breadcrumb-page","aria-disabled":"true","aria-current":"page",className:Ie("text-foreground font-normal",e),...n})},exports.BreadcrumbSeparator=function({children:e,className:n,...o}){return t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Ie("[&>svg]:size-3.5",n),...o,children:e??t.jsx(oi,{})})},exports.Button=Le,exports.Calendar=Vg,exports.Card=Aa,exports.CardContent=La,exports.CardDescription=za,exports.CardFooter=Wa,exports.CardHeader=Ia,exports.CardTitle=Fa,exports.Checkbox=_x,exports.ClearButton=({handleClear:e})=>t.jsx("button",{type:"button",className:"h-10 p-2 mt-1 text-xs bg-white",onClick:e,children:t.jsxs(Ve,{direction:"row",gap:2,className:"items-center",children:["Limpar filtros ",t.jsx(xi,{size:16})]})}),exports.Combobox=Vp,exports.Command=nd,exports.CommandDialog=function({title:e="Command Palette",description:n="Search for a command to run...",children:o,className:r,showCloseButton:a=!0,...i}){return t.jsxs(Uc,{...i,children:[t.jsxs(Qc,{className:"sr-only",children:[t.jsx(ed,{children:e}),t.jsx(td,{children:n})]}),t.jsx(Xc,{className:Ie("overflow-hidden p-0",r),children:t.jsx(nd,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:o})})]})},exports.CommandEmpty=ad,exports.CommandGroup=id,exports.CommandInput=od,exports.CommandItem=sd,exports.CommandList=rd,exports.CommandSeparator=function({className:e,...n}){return t.jsx(Ic.Separator,{"data-slot":"command-separator",className:Ie("bg-border -mx-1 h-px",e),...n})},exports.CommandShortcut=function({className:e,...n}){return t.jsx("span",{"data-slot":"command-shortcut",className:Ie("text-muted-foreground ml-auto text-xs tracking-widest",e),...n})},exports.ConfirmationDialog=Ra,exports.DatePicker=({id:e,placeholder:n,value:o,onValueChange:r,className:a,boundary:i="start",dateFormat:s="dd/MM/yyyy"})=>{const l=Zg(o),c=((e,t)=>{const n=Zg(e);return n?wv(n,t):null})(o,s);return t.jsx("div",{className:Ie("flex w-full min-w-0",a),children:t.jsxs(Hp,{children:[t.jsx(Kp,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":e,className:Ie(We,"justify-start text-left",!c&&Be),children:[t.jsx(Ja,{className:Ie("mr-2","size-4 shrink-0 text-muted-foreground opacity-50")}),c??n]})}),t.jsx(Up,{className:"w-fit p-0",align:"start",children:t.jsx(Vg,{mode:"single",selected:l,onSelect:e=>{if(!e)return void r?.("");const t="end"===i?function(e,t){const n=kh(e,t?.in);return n.setHours(23,59,59,999),n}(e):Th(e);r?.(t.toISOString())},initialFocus:!0})})]})})},exports.DeleteDialog=({openDialog:e,setOpenDialog:n,handleDelete:o,count:r})=>{const a=void 0!==r&&r>1;return t.jsx(Ve,{direction:"row",children:t.jsx(Uc,{open:e,onOpenChange:n,children:t.jsxs(Xc,{className:"max-w-[513px] rounded-xl px-8 py-6 gap-4",children:[t.jsxs(Qc,{children:[t.jsx(ed,{className:"pb-0 border-none",children:a?`Deseja apagar ${r} registros selecionados?`:"Deseja apagar registro atual?"}),t.jsx(td,{})]}),t.jsx("form",{onSubmit:e=>{e.preventDefault(),o()},children:t.jsxs(Ve,{gap:2,children:[t.jsx("p",{className:"text-fontcolor-secondary font-medium text-sm",children:a?`Essa ação não poderá ser desfeita e os ${r} registros serão removidos permanentemente. Tem certeza de que deseja continuar?`:"Essa ação não poderá ser desfeita e o registro será removido permanentemente. Tem certeza de que deseja continuar?"}),t.jsxs(Jc,{className:"mt-4",children:[t.jsx(Rr,{asChild:!0,children:t.jsx(Le,{variant:"ghost",type:"button",children:"Cancelar"})}),t.jsx(Le,{type:"submit",variant:"default",children:a?`Deletar ${r}`:"Deletar"})]})]})})]})})})},exports.Dialog=Uc,exports.DialogContent=Xc,exports.DialogDescription=td,exports.DialogFooter=Jc,exports.DialogHeader=Qc,exports.DialogTitle=ed,exports.DialogTrigger=Vc,exports.DownloadButton=({item:n,modelClass:o,propertyName:r,retrieveFile:a})=>{const[i,s]=e.useState(!1);return t.jsx(Le,{variant:"outline",size:"icon",disabled:i,onClick:async()=>{s(!0);try{const[e,t]=await a(o,Number(n[r]));if(t)return void Ai.error(`Houve algum problema: ${t.message}`);if(!e)return void Ai.error("Nenhum arquivo encontrado");const i=new Blob([new Uint8Array(e.data)],{type:e.contentType}),s=URL.createObjectURL(i),l=document.createElement("a");l.href=s,l.download=n.file.split(/[\\/]/).pop()??n.file,document.body.appendChild(l);try{l.click()}finally{document.body.removeChild(l),URL.revokeObjectURL(s)}Ai.success("Arquivo baixado com sucesso!")}finally{s(!1)}},children:i?t.jsx(pi,{className:"animate-spin"}):t.jsx(ci,{})})},exports.DropdownMenu=Ew,exports.DropdownMenuCheckboxItem=Lw,exports.DropdownMenuContent=Fw,exports.DropdownMenuGroup=Ow,exports.DropdownMenuItem=zw,exports.DropdownMenuLabel=Bw,exports.DropdownMenuPortal=Tw,exports.DropdownMenuRadioGroup=Pw,exports.DropdownMenuRadioItem=Ww,exports.DropdownMenuSeparator=$w,exports.DropdownMenuShortcut=qw,exports.DropdownMenuSub=Rw,exports.DropdownMenuSubContent=Iw,exports.DropdownMenuSubTrigger=Aw,exports.DropdownMenuTrigger=Mw,exports.Dropzone=function({children:n,maxFiles:o=1,maxSize:r=5242880,accept:a={"text/csv":[".csv"]},onFilesAccepted:i}){const[s,l]=e.useState([]),[c,d]=e.useState([]),u=e.useCallback((e,t)=>{const n=t.map(({file:e})=>e);l(n),e.length>0&&(d(e),i(e))},[i]),{getRootProps:p,getInputProps:f,isDragActive:m}=_n({onDrop:u,maxFiles:o,maxSize:r,accept:a,multiple:o>1});return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{...p(),className:"border-2 border-dashed rounded-lg text-center cursor-pointer transition-colors "+(m?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-gray-400"),children:[t.jsx("input",{...f()}),t.jsxs("div",{className:Ie(c.length>0?"p-6 bg-green-100":"p-6","flex flex-col items-center justify-center gap-2"),children:[m&&t.jsx("p",{className:"font-medium text-blue-500",children:"Clique para selecionar os arquivos ou arraste-os aqui"}),!m&&c.length>0&&c.map(e=>t.jsx(Ve,{children:t.jsxs("p",{className:"font-medium",children:[t.jsx("b",{children:"Nome do arquivo:"})," ",e.name]})},e.name)),!m&&0===c.length&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"font-medium",children:"Clique para selecionar os arquivos ou arraste-os aqui"}),t.jsxs("p",{className:"text-sm text-gray-500",children:[r/1024/1024,"MB"]})]})]})]}),c.length>0&&t.jsx("div",{className:"w-full",children:n}),s.length>0&&t.jsxs("div",{className:"text-sm text-red-600",children:[t.jsx("h4",{className:"font-medium mb-2",children:"Rejected files:"}),t.jsx("ul",{className:"space-y-1",children:s.map(e=>t.jsxs("li",{className:"flex items-center justify-between",children:[t.jsxs("span",{children:[e.name," (",(e.size/1024).toFixed(2)," KB)"]}),t.jsx("button",{type:"button",onClick:()=>{return t=e.name,void l(e=>e.filter(e=>e.name!==t));var t},className:"text-red-800 hover:text-red-900",children:"×"})]},e.name))}),t.jsxs("p",{className:"mt-1",children:["File must be ",r/1024/1024,"MB or smaller."]})]})]})},exports.Empty=ec,exports.EmptyContainer=ic,exports.EmptyContent=function({className:e,...n}){return t.jsx("div",{"data-slot":"empty-content",className:Ie("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",e),...n})},exports.EmptyDescription=ac,exports.EmptyHeader=tc,exports.EmptyMedia=oc,exports.EmptyTitle=rc,exports.ErrorBoundary=({children:e,hasError:n,message:o="Um erro inesperado ocorreu."})=>n?t.jsx(sy,{variant:"destructive",className:"my-2",children:o}):t.jsx(t.Fragment,{children:e}),exports.ErrorMessage=({error:e})=>t.jsx(t.Fragment,{children:e&&t.jsx("span",{className:"text-red-500 text-xs",children:e?.message})}),exports.ErrorToastContent=({message:n,error:o})=>{const[r,a]=e.useState(!1),i=JSON.stringify(o,null,2);return t.jsxs(Ve,{children:[t.jsx("p",{children:n}),t.jsx(Zl,{type:"single",collapsible:!0,className:"max-w-60",children:t.jsxs(Xl,{value:"error-details",className:"border-none",children:[t.jsx(Ql,{className:"text-sm py-2 hover:no-underline text-red-100",children:"View Error Details"}),t.jsx(Jl,{children:t.jsx("pre",{className:"text-xs bg-red-950 p-3 rounded overflow-x-auto max-h-40 overflow-y-auto",children:t.jsx("code",{className:"text-red-100",children:i})})})]})}),t.jsx("button",{type:"button",onClick:()=>{const e=JSON.stringify(o,null,2);navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)},className:"flex items-center justify-center gap-2 px-3 py-2 bg-red-600 hover:bg-red-700 text-white text-xs font-medium rounded transition-colors",children:r?t.jsxs(t.Fragment,{children:[t.jsx(ei,{size:14}),t.jsx("span",{children:"Copied!"})]}):t.jsxs(t.Fragment,{children:[t.jsx(li,{size:14}),t.jsx("span",{children:"Copy Error JSON"})]})})]})},exports.FKSelect=Zp,exports.FileDropzone=function({onFileSelected:n,onFileDeleted:o,acceptExtensions:r,accept:a,maxSizeMB:i=25}){const[s,l]=e.useState(null),c=1024*i*1024,d=e.useMemo(()=>a||(r?.length?zi(r):Ii),[a,r]),u=e.useMemo(()=>Object.values(d).reduce((e,t)=>e.concat(t),[]).join(","),[d]),p=e.useCallback((e,t)=>{if(t.length>0){const{errors:e}=t[0],n=e[0];return void("file-too-large"===n.code?Ai.error(`File size must be under ${i} MB`):"file-invalid-type"===n.code?Ai.error(`Invalid file type. Allowed: ${r}`):Ai.error(n.message))}const o=e[0];o&&(l(o),n(new File([o],o.name,{type:o.type,lastModified:o.lastModified})),Ai.success(`File "${o.name}" selected successfully!`))},[n,i,r]),{getRootProps:f,getInputProps:m,isDragActive:h}=_n({onDrop:p,maxFiles:1,maxSize:c,accept:d,multiple:!1});return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("p",{className:"font-bold",children:["Envie um arquivo com até ",i," MB."]}),s?t.jsxs("div",{className:"flex items-center justify-between border rounded-md px-3 py-2 bg-white",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ui,{className:"h-4 w-4 text-gray-600"}),t.jsx("span",{className:"text-sm",children:s.name})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("button",{onClick:()=>{const e=document.createElement("input");e.type="file",e.accept=u,e.onchange=e=>{const t=e.target.files?.[0];if(!t)return;const o=Object.values(d).reduce((e,t)=>e.concat(t),[]);o.some(e=>t.name.toLowerCase().endsWith(e.toLowerCase()))?t.size>c?Ai.error(`File size must be under ${i} MB`):(l(t),n(t),Ai.success(`File "${t.name}" selected successfully!`)):Ai.error(`Invalid file type. Allowed: ${o.join(", ")}`)},e.click()},className:"p-1 hover:bg-gray-100 rounded",children:t.jsx(hi,{className:"h-4 w-4"})}),t.jsx("button",{onClick:()=>{l(null),o?.(),Ai.success("File removed")},className:"p-1 hover:bg-red-50 rounded",children:t.jsx(gi,{className:"h-4 w-4 text-red-600"})})]})]}):t.jsxs("div",{...f(),className:"border rounded-lg text-center cursor-pointer transition-colors h-[300px] "+(h?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-gray-400"),children:[t.jsx("input",{...m()}),t.jsxs("div",{className:"py-16 px-6 flex flex-col items-center",children:[t.jsx(si,{strokeWidth:1,className:"size-[80px] text-[#026CB6]"}),t.jsx("p",{className:"text-muted",children:"Arraste e solte ou selecione um arquivo."}),t.jsxs("p",{className:"text-muted",children:["Arquivos aceitos:",r]})]})]})]})},exports.Input=He,exports.Label=Mx,exports.Loading=function(){return t.jsxs("div",{className:"flex flex-col items-center justify-center mx-auto",children:[t.jsx(Hw,{size:12}),t.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Loading..."})]})},exports.MarkdownEditor=function({value:n,onChange:o,placeholder:r,error:a,disabled:i,className:s}){const l=e.useRef(null),[c,d]=e.useState(null);return e.useEffect(()=>{let e=!0;return Promise.all([import("@toast-ui/react-editor"),import("@toast-ui/editor/dist/toastui-editor.css")]).then(([t])=>{e&&d(()=>t.Editor)}),()=>{e=!1}},[]),c?t.jsxs(Ve,{direction:"col",gap:2,className:s??"w-full",children:[t.jsx(c,{initialValue:n,placeholder:r,usageStatistics:!1,autofocus:!1,initialEditType:"wysiwyg",previewStyle:"disabled",useCommandShortcut:!0,hideModeSwitch:i,onChange:()=>o(l.current?.getMarkdown()||""),ref:l}),a&&t.jsx("p",{className:"text-sm text-destructive",children:a})]}):t.jsx(Ve,{direction:"col",gap:2,className:s??"w-full min-h-[200px]",children:t.jsx("span",{})})},exports.MultiSelectDropdown=function({options:e,selected:n,onChange:o,placeholder:a="Select items...",className:i,maxDisplay:s=3}){const[l,c]=r.useState(!1),d=n.length===e.length&&e.length>0;return t.jsxs(lh,{open:l,onOpenChange:c,children:[t.jsx(uh,{className:Ie("w-full",i),children:t.jsx("span",{className:Ie("truncate flex-1 text-left",0===n.length&&"text-muted-foreground"),children:(()=>{if(0===n.length)return a;if(n.length>s)return`${n.length} items selected`;const t=n.map(t=>e.find(e=>e.value===t)?.label).join(", ");return t.length>80?`${n.length} item${1!==n.length?"s":""} selected`:t})()})}),t.jsxs(mh,{children:[e.length>0&&t.jsx("div",{className:"border-b border-border",children:t.jsxs("div",{className:"flex items-center space-x-2 cursor-pointer p-2 hover:bg-accent hover:text-accent-foreground rounded-sm w-full text-left font-medium",children:[t.jsx(_x,{checked:d,onCheckedChange:()=>{o(d?[]:e.map(e=>e.value))}}),t.jsx("span",{className:"text-sm",children:d?"Unselect All":"Select All"})]})}),t.jsx("div",{className:"p-1 space-y-1",children:e.map(e=>t.jsxs("div",{className:"flex items-center space-x-2 cursor-pointer p-2 hover:bg-accent hover:text-accent-foreground rounded-sm w-full text-left",children:[t.jsx(_x,{checked:n.includes(e.value),onCheckedChange:()=>(e=>{const t=n.includes(e)?n.filter(t=>t!==e):[...n,e];o(t)})(e.value)}),t.jsx("span",{className:"text-sm",children:e.label})]},e.value))}),n.length>0&&t.jsx("div",{className:"border-t border-border p-2 bg-muted",children:t.jsxs("div",{className:"text-xs text-muted-foreground",children:[n.length," item",1!==n.length?"s":""," selected"]})})]})]})},exports.NoResult=Xg,exports.Pagination=({startRecord:e,endRecord:n,hasValidSearchValues:o,tabCount:r,disabledLoadBackButton:a,disabledLoadMoreButton:i,loadBack:s,loadMore:l})=>t.jsxs("div",{className:"flex items-center gap-2 text-fontcolor-secondary",children:[t.jsx("div",{className:"text-sm",children:t.jsxs("p",{children:[e," - ",n," de"," ",o?n:r]})}),t.jsxs("div",{className:"h-[32px] flex items-center",children:[t.jsx(Uw,{className:"bg-zinc-900 text-white",trigger:t.jsx(Le,{variant:"ghost",disabled:a,onClick:()=>s(),type:"button",className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:t.jsx("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:t.jsx(ni,{size:16})})}),children:"Anteriores"}),t.jsx(Uw,{className:"bg-zinc-900 text-white",trigger:t.jsx(Le,{variant:"ghost",disabled:i,onClick:()=>l(),className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:t.jsx("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:t.jsx(oi,{size:16})})}),children:"Próximos"})]})]}),exports.Popover=Hp,exports.PopoverContent=Up,exports.PopoverTrigger=Kp,exports.PumpwoodBadge=function({className:e,variant:n,size:o,...r}){const a=Ie(qa({variant:n,size:o}),e);return t.jsx("div",{className:a,...r})},exports.PumpwoodCard=Ba,exports.PumpwoodTable=lx,exports.Radio=Yw,exports.Select=e=>{if("fk"===e.variant){const{variant:n,...o}=e;return t.jsx(Zp,{...o})}return t.jsx(xh,{...e})},exports.SelectContent=mh,exports.SelectGroup=ch,exports.SelectItem=vh,exports.SelectLabel=hh,exports.SelectPrimitive=lh,exports.SelectScrollDownButton=fh,exports.SelectScrollUpButton=ph,exports.SelectSeparator=gh,exports.SelectTrigger=uh,exports.SelectValue=dh,exports.Sidebar=Bi,exports.Skeleton=ix,exports.Spinner=Hw,exports.Stack=Ve,exports.Table=function({data:e,columns:n,getRowKey:o,ordering:r,onSort:a,onRowClick:i,isLoading:s,hasMore:l,onLoadMore:c,className:d}){const u=Boolean(s&&0===e.length);return t.jsx("div",{className:Ie("flex-1 overflow-auto mt-4",d),children:s||0!==e.length?t.jsxs(Qg,{className:"table-auto w-full",children:[t.jsx(Jg,{className:"sticky top-0 bg-primary text-white z-10",children:t.jsx(cx,{columns:n,ordering:r,onSort:a})}),t.jsxs(ex,{children:[u?t.jsx(sx,{columns:n.map(e=>({width:e.width,cellClassName:e.cellClassName}))}):e.map(e=>t.jsx(dx,{item:e,columns:n,onClick:i?()=>i(e):void 0},o(e))),l&&c&&!u&&t.jsx(nx,{children:t.jsx(rx,{colSpan:n.length,className:"text-center py-6",children:t.jsx(Le,{onClick:c,disabled:s,variant:"outline",children:s?"Carregando...":"Carregar Mais"})})})]})]}):t.jsx("div",{className:"py-20",children:t.jsx(Xg,{})})})},exports.TableBody=ex,exports.TableCaption=ax,exports.TableCell=rx,exports.TableFooter=tx,exports.TableHead=ox,exports.TableHeader=Jg,exports.TablePrimitive=Qg,exports.TableRow=nx,exports.TableSkeleton=sx,exports.Tabs=Cs,exports.TabsContent=Ss,exports.TabsList=_s,exports.TabsTrigger=Ds,exports.TagInput=function({value:n=[],onChange:o,keyPlaceholder:r="Chave",valuePlaceholder:a="Valor",disabled:i=!1}){const[s,l]=e.useState(""),[c,d]=e.useState(""),u=()=>{const e=s.trim(),t=c.trim();if(e&&t){n.some(t=>t.key===e)||(o([...n,{key:e,value:t}]),l(""),d(""))}},p=e=>{"Enter"===e.key&&(e.preventDefault(),u())};return t.jsxs(Ve,{direction:"col",gap:3,children:[t.jsxs(Ve,{direction:"row",gap:2,children:[t.jsx(He,{value:s,onChange:e=>l(e.target.value),onKeyDown:p,placeholder:r,disabled:i,className:"flex-1"}),t.jsx(He,{value:c,onChange:e=>d(e.target.value),onKeyDown:p,placeholder:a,disabled:i,className:"flex-1"}),t.jsx(Le,{type:"button",onClick:u,disabled:!s.trim()||!c.trim()||i,variant:"outline",children:"Adicionar"})]}),n.length>0&&t.jsx(Ve,{direction:"row",gap:2,className:"flex-wrap",children:n.map(e=>t.jsxs(Ve,{direction:"row",gap:1,className:"items-center px-3 py-1 bg-secondary text-secondary-foreground rounded-md text-sm",children:[t.jsxs("span",{className:"font-medium",children:[e.key,":"]}),t.jsx("span",{children:e.value}),t.jsx(Le,{type:"button",onClick:()=>{return t=e.key,void o(n.filter(e=>e.key!==t));var t},disabled:i,variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-secondary-foreground/10 rounded-full","aria-label":`Remover tag ${e.key}`,children:t.jsx(xi,{className:"h-3 w-3"})})]},e.key))})]})},exports.Textarea=Ue,exports.Tooltip=oy,exports.TooltipComponent=Uw,exports.TooltipContent=ay,exports.TooltipProvider=ny,exports.TooltipTrigger=ry,exports.Typography=Pa,exports.badgeVariants=$a,exports.createFKSelectFetcher=(e,t,n={})=>o=>Kw(e,{...o,labelName:t,additionalFilters:n.additionalFilters,fields:n.fields}),exports.fkSelectFetcher=Kw,exports.pumpwoodBadgeVariants=qa,exports.useSidebarCollapse=function({initialCollapsed:t=!1,onPersist:n}={}){const[o,r]=e.useState(t),[a,i]=e.useState(!1),s=e.useCallback(()=>{i(!0),r(e=>{const t=!e;return n?.(t),t})},[n]),l=e.useCallback(()=>{i(!0),r(!1),n?.(!1)},[n]),c=e.useCallback(()=>{i(!1)},[]),[d,u]=e.useState({}),p=e.useCallback(e=>{if(o)return l(),void u({[e]:!0});u(t=>({...t,[e]:!t[e]}))},[o,l]),f=e.useCallback(()=>{u({})},[]);return{isCollapsed:o,isCollapsing:a,expandedItems:d,setExpandedItems:u,toggleCollapse:s,expand:l,handleTransitionEnd:c,toggleExpanded:p,setExpandedOnCollapse:f}};
40
+ */!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n');var yi=e=>"number"==typeof e&&!isNaN(e),bi=e=>"string"==typeof e,wi=e=>"function"==typeof e,ki=1,ji=()=>""+ki++,Ni=new Map,Ci=[],_i=new Set,Di=()=>Ni.size>0;function Si(e){if(Di()){if(null==e||(e=>bi(e)||yi(e))(e))Ni.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=Ni.get(e.containerId);t?t.removeToast(e.id):Ni.forEach(t=>{t.removeToast(e.id)})}}else Ci=Ci.filter(t=>null!=e&&t.options.toastId!==e)}function Ei(t,n){(t=>e.isValidElement(t)||bi(t)||wi(t)||yi(t))(t)&&(Di()||Ci.push({content:t,options:n}),Ni.forEach(e=>{e.buildToast(t,n)}))}function Mi(e,t){Ni.forEach(n=>{(null==t||null==t||!t.containerId||(null==t?void 0:t.containerId)===n.id)&&n.toggle(e,null==t?void 0:t.id)})}function Oi(e){return e&&(bi(e.toastId)||yi(e.toastId))?e.toastId:ji()}function Ti(e,t){return Ei(e,t),t.toastId}function Ri(e,t){return{...t,type:t&&t.type||e,toastId:Oi(t)}}function Pi(e){return(t,n)=>Ti(t,Ri(e,n))}function Ai(e,t){return Ti(e,Ri("default",t))}Ai.loading=(e,t)=>Ti(e,Ri("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Ai.promise=function(e,{pending:t,error:n,success:o},r){let a;t&&(a=bi(t)?Ai.loading(t,r):Ai.loading(t.render,{...r,...t}));let i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},s=(e,t,n)=>{if(null==t)return void Ai.dismiss(a);let o={type:e,...i,...r,data:n},s=bi(t)?{render:t}:t;return a?Ai.update(a,{...o,...s}):Ai(s.render,{...o,...s}),n},l=wi(e)?e():e;return l.then(e=>s("success",o,e)).catch(e=>s("error",n,e)),l},Ai.success=Pi("success"),Ai.info=Pi("info"),Ai.error=Pi("error"),Ai.warning=Pi("warning"),Ai.warn=Ai.warning,Ai.dark=(e,t)=>Ti(e,Ri("default",{theme:"dark",...t})),Ai.dismiss=function(e){Si(e)},Ai.clearWaitingQueue=(e={})=>{Ni.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},Ai.isActive=function(e,t){var n;if(t)return!(null==(n=Ni.get(t))||!n.isToastActive(e));let o=!1;return Ni.forEach(t=>{t.isToastActive(e)&&(o=!0)}),o},Ai.update=(e,t={})=>{let n=((e,{containerId:t})=>{var n;return null==(n=Ni.get(t||1))?void 0:n.toasts.get(e)})(e,t);if(n){let{props:o,content:r}=n,a={delay:100,...o,...t,toastId:t.toastId||e,updateId:ji()};a.toastId!==e&&(a.staleId=e);let i=a.render||r;delete a.render,Ti(i,a)}},Ai.done=e=>{Ai.update(e,{progress:1})},Ai.onChange=function(e){return _i.add(e),()=>{_i.delete(e)}},Ai.play=e=>Mi(!0,e),Ai.pause=e=>Mi(!1,e);const Ii={"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.ms-excel":[".xls"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"],"application/vnd.ms-powerpoint":[".ppt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"],"image/jpeg":[".jpg",".jpeg"],"image/png":[".png"],"video/mp4":[".mp4"]};const Fi=e=>e.map(e=>e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`),zi=e=>({"application/octet-stream":Fi(e)});const Li=e.createContext(void 0);function Wi(){const t=e.useContext(Li);if(!t)throw new Error("Sidebar components must be used within a Sidebar.Root");return t}const Bi={Root:function({children:e,isCollapsed:n,isCollapsing:o=!1,onToggleCollapse:r,onTransitionEnd:a,className:i}){const s=n?"smaller:w-20 w-20":"smaller:w-[232px] w-[232px]";return t.jsx(Li.Provider,{value:{isCollapsed:n,isCollapsing:o,onToggleCollapse:r},children:t.jsx("nav",{className:Ie(s,"smaller:p-3 px-2 py-6 flex flex-col items-stretch bg-primary mb-2 rounded-lg transition-all duration-300 ease-in-out h-full min-h-0",i),onTransitionEnd:a,children:e})})},Header:function({children:e,className:n}){return t.jsx("div",{className:Ie("w-full flex justify-between items-center mb-8 gap-4",n),children:e})},Content:function({children:e,className:n}){return t.jsx(Ve,{className:Ie("w-full flex-1 min-h-0 items-stretch gap-1 overflow-y-auto",n),children:e})},Footer:function({children:e,className:n}){return t.jsx("div",{className:Ie("mt-auto w-full",n),children:e})},Toggle:function({className:e}){const{isCollapsed:n,isCollapsing:o,onToggleCollapse:r}=Wi(),a=n&&!o;return t.jsx("div",{className:Ie("w-full flex transition-all duration-300 ease-in-out",a?"justify-center":"justify-end",e),children:t.jsx(Le,{title:a?"Expandir Barra Lateral":"Recolher Barra Lateral",height:48,className:Ie("min-w-[48px] bg-transparent rounded-full hover:bg-white/5 transition-all duration-300 ease-in-out",a?"justify-center":"justify-end"),onClick:r,children:a?t.jsx(fi,{className:"size-[28px] text-white"}):t.jsx(mi,{className:"size-[28px] text-white"})})})},Logo:function({src:e,alt:n,width:o=200,height:r=40,collapsedWidth:a=48,collapsedHeight:i,className:s,ImageComponent:l=({src:e,alt:n,...o})=>t.jsx("img",{src:e,alt:n,...o})}){const{isCollapsed:c,isCollapsing:d}=Wi(),u=c&&!d,p=u?a:o,f=u?i??Math.max(16,Math.round(r/o*a)):r;return t.jsx(Ve,{className:Ie("w-full items-center justify-center py-2",s),children:t.jsx(l,{className:"object-contain transition-all duration-300 ease-in-out",src:e,width:p,height:f,alt:n})})},Link:function({icon:e,children:n,href:o,active:r,className:a,LinkComponent:i=({children:e,...n})=>t.jsx("a",{...n,children:e})}){const{isCollapsed:s,isCollapsing:l}=Wi();return t.jsx(i,{href:o,title:"string"==typeof n?n:void 0,className:Ie("flex w-full h-12 smaller:p-3 p-4 font-bold text-white rounded-md overflow-hidden transition-all duration-300 ease-in-out hover:bg-white/5",r?"bg-white/5":"",a),children:t.jsxs(Ve,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{className:"size-6 shrink-0"}),!s&&!l&&t.jsx("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:n})]})})},NavGroup:function({icon:e,title:n,isExpanded:o,isActive:r=!1,onToggle:a,children:i,className:s}){const{isCollapsed:l,isCollapsing:c}=Wi();return t.jsxs(Ve,{className:Ie("w-full gap-0",s),children:[t.jsx(Le,{type:"button",title:n,onClick:a,variant:"ghost",height:48,className:Ie("w-full smaller:p-3 p-4 font-bold text-white hover:bg-white/5 hover:text-white justify-start rounded-md transition-all duration-300 ease-in-out",r?"bg-white/5":""),children:t.jsxs(Ve,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{className:"size-6 shrink-0"}),!l&&!c&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex-1 text-left transition-opacity duration-300 ease-in-out opacity-100 text-base",children:n}),t.jsx(ti,{width:20,height:20,className:Ie("shrink-0 transition-transform duration-300 ease-in-out",o?"rotate-180":"")})]})]})}),!l&&!c&&t.jsx("div",{className:Ie("overflow-hidden transition-all duration-300 ease-in-out",o?"max-h-96 opacity-100 mt-1":"max-h-0 opacity-0"),children:t.jsx(Ve,{className:"w-full gap-1 pl-9 pr-1",children:i})})]})},NavSubLink:function({title:e,href:n,active:o=!1,className:r,LinkComponent:a=({children:e,...n})=>t.jsx("a",{...n,children:e})}){return t.jsx(a,{href:n,title:e,className:Ie("flex w-full h-10 items-center px-3 text-sm text-white rounded-md transition-all duration-200 ease-in-out hover:bg-white/5",o?"bg-white/10 font-semibold":"",r),children:e})},Action:function({icon:e,label:n,onClick:o,className:r}){const{isCollapsed:a,isCollapsing:i}=Wi();return t.jsx(Le,{title:n,onClick:o,variant:"ghost",height:48,className:Ie("w-full smaller:p-3 p-4 font-bold text-white hover:bg-transparent hover:text-white/80 transition-all duration-300 ease-in-out justify-start",r),children:t.jsxs(Ve,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{width:24,height:24,className:"shrink-0"}),!a&&!i&&t.jsx("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:n})]})})}};var $i=r.createContext(void 0);function qi(e){const t=r.useContext($i);return e||t||"ltr"}var Yi="rovingFocusGroup.onEntryFocus",Hi={bubbles:!1,cancelable:!0},Ki="RovingFocusGroup",[Ui,Vi,Gi]=function(n){const o=n+"CollectionProvider",[r,a]=En(o),[i,s]=r(o,{collectionRef:{current:null},itemMap:new Map}),c=n=>{const{scope:o,children:r}=n,a=e.useRef(null),s=e.useRef(new Map).current;return t.jsx(i,{scope:o,itemMap:s,collectionRef:a,children:r})};c.displayName=o;const d=n+"CollectionSlot",u=zn(d),p=e.forwardRef((e,n)=>{const{scope:o,children:r}=e,a=l(n,s(d,o).collectionRef);return t.jsx(u,{ref:a,children:r})});p.displayName=d;const f=n+"CollectionItemSlot",m="data-radix-collection-item",h=zn(f),v=e.forwardRef((n,o)=>{const{scope:r,children:a,...i}=n,c=e.useRef(null),d=l(o,c),u=s(f,r);return e.useEffect(()=>(u.itemMap.set(c,{ref:c,...i}),()=>{u.itemMap.delete(c)})),t.jsx(h,{[m]:"",ref:d,children:a})});return v.displayName=f,[{Provider:c,Slot:p,ItemSlot:v},function(t){const o=s(n+"CollectionConsumer",t);return e.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},a]}(Ki),[Zi,Xi]=En(Ki,[Gi]),[Qi,Ji]=Zi(Ki),es=r.forwardRef((e,n)=>t.jsx(Ui.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Ui.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(ts,{...e,ref:n})})}));es.displayName=Ki;var ts=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,orientation:a,loop:i=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:u,onEntryFocus:p,preventScrollOnEntryFocus:f=!1,...m}=e,h=r.useRef(null),v=l(n,h),g=qi(s),[x,y]=Fn({prop:c,defaultProp:d??null,onChange:u,caller:Ki}),[b,w]=r.useState(!1),k=qn(p),j=Vi(o),N=r.useRef(!1),[C,_]=r.useState(0);return r.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(Yi,k),()=>e.removeEventListener(Yi,k)},[k]),t.jsx(Qi,{scope:o,orientation:a,dir:g,loop:i,currentTabStopId:x,onItemFocus:r.useCallback(e=>y(e),[y]),onItemShiftTab:r.useCallback(()=>w(!0),[]),onFocusableItemAdd:r.useCallback(()=>_(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>_(e=>e-1),[]),children:t.jsx($n.div,{tabIndex:b||0===C?-1:0,"data-orientation":a,...m,ref:v,style:{outline:"none",...e.style},onMouseDown:On(e.onMouseDown,()=>{N.current=!0}),onFocus:On(e.onFocus,e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(Yi,Hi);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=j().filter(e=>e.focusable);as([e.find(e=>e.active),e.find(e=>e.id===x),...e].filter(Boolean).map(e=>e.ref.current),f)}}N.current=!1}),onBlur:On(e.onBlur,()=>w(!1))})})}),ns="RovingFocusGroupItem",os=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,focusable:a=!0,active:i=!1,tabStopId:s,children:l,...c}=e,d=An(),u=s||d,p=Ji(ns,o),f=p.currentTabStopId===u,m=Vi(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=p;return r.useEffect(()=>{if(a)return h(),()=>v()},[a,h,v]),t.jsx(Ui.ItemSlot,{scope:o,id:u,focusable:a,active:i,children:t.jsx($n.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:n,onMouseDown:On(e.onMouseDown,e=>{a?p.onItemFocus(u):e.preventDefault()}),onFocus:On(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:On(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const o=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(o)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)?void 0:rs[o]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const a=r.indexOf(e.currentTarget);r=p.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>as(r))}var n,o}),children:"function"==typeof l?l({isCurrentTabStop:f,hasTabStop:null!=g}):l})})});os.displayName=ns;var rs={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function as(e,t=!1){const n=document.activeElement;for(const o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}var is=es,ss=os,ls="Tabs",[cs]=En(ls,[Xi]),ds=Xi(),[us,ps]=cs(ls),fs=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=qi(l),[p,f]=Fn({prop:r,onChange:a,defaultProp:i??"",caller:ls});return t.jsx(us,{scope:o,baseId:An(),value:p,onValueChange:f,orientation:s,dir:u,activationMode:c,children:t.jsx($n.div,{dir:u,"data-orientation":s,...d,ref:n})})});fs.displayName=ls;var ms="TabsList",hs=r.forwardRef((e,n)=>{const{__scopeTabs:o,loop:r=!0,...a}=e,i=ps(ms,o),s=ds(o);return t.jsx(is,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:t.jsx($n.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:n})})});hs.displayName=ms;var vs="TabsTrigger",gs=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:r,disabled:a=!1,...i}=e,s=ps(vs,o),l=ds(o),c=bs(s.baseId,r),d=ws(s.baseId,r),u=r===s.value;return t.jsx(ss,{asChild:!0,...l,focusable:!a,active:u,children:t.jsx($n.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:n,onMouseDown:On(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(r)}),onKeyDown:On(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(r)}),onFocus:On(e.onFocus,()=>{const e="manual"!==s.activationMode;u||a||!e||s.onValueChange(r)})})})});gs.displayName=vs;var xs="TabsContent",ys=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:a,forceMount:i,children:s,...l}=e,c=ps(xs,o),d=bs(c.baseId,a),u=ws(c.baseId,a),p=a===c.value,f=r.useRef(p);return r.useEffect(()=>{const e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),t.jsx(co,{present:i||p,children:({present:o})=>t.jsx($n.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!o,id:u,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:o&&s})})});function bs(e,t){return`${e}-trigger-${t}`}function ws(e,t){return`${e}-content-${t}`}ys.displayName=xs;var ks=hs,js=gs,Ns=ys;const Cs=fs,_s=r.forwardRef(({className:e,...n},o)=>t.jsx(ks,{ref:o,className:Ie("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...n}));_s.displayName=ks.displayName;const Ds=r.forwardRef(({className:e,...n},o)=>t.jsx(js,{ref:o,className:Ie("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-[#0E2B63] data-[state=active]:text-[#FFFFFF] data-[state=active]:shadow",e),...n}));Ds.displayName=js.displayName;const Ss=r.forwardRef(({className:e,...n},o)=>t.jsx(Ns,{ref:o,className:Ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n}));function Es(e,n=[]){let o=[];const a=()=>{const t=o.map(e=>r.createContext(e));return function(n){const o=n?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return a.scopeName=e,[function(n,a){const i=r.createContext(a);i.displayName=n+"Context";const s=o.length;o=[...o,a];const l=n=>{const{scope:o,children:a,...l}=n,c=o?.[e]?.[s]||i,d=r.useMemo(()=>l,Object.values(l));return t.jsx(c.Provider,{value:d,children:a})};return l.displayName=n+"Provider",[l,function(t,o){const l=o?.[e]?.[s]||i,c=r.useContext(l);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},Ms(a,...n)]}function Ms(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Os(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Ts(...e){return t=>{let n=!1;const o=e.map(e=>{const o=Os(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():Os(e[t],null)}}}}function Rs(...e){return r.useCallback(Ts(...e),e)}function Ps(e){const t=r.forwardRef((t,n)=>{let{children:o,...a}=t,i=null,s=!1;const l=[];zs(o)&&"function"==typeof Bs&&(o=Bs(o._payload)),r.Children.forEach(o,e=>{if(t=e,r.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===As){s=!0;const t=e;let n="child"in t.props?t.props.child:t.props.children;zs(n)&&"function"==typeof Bs&&(n=Bs(n._payload)),i=Is(t,n),l.push(i?.props?.children)}else l.push(e);var t}),i?i=r.cloneElement(i,void 0,l):!s&&1===r.Children.count(o)&&r.isValidElement(o)&&(i=o);const c=i?function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i):void 0,d=Rs(n,c);if(!i){if(o||0===o)throw new Error(s?Ws(e):Ls(e));return o}const u=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(a,i.props??{});return i.type!==r.Fragment&&(u.ref=n?d:c),r.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}Ss.displayName=Ns.displayName;var As=Symbol.for("radix.slottable");var Is=(e,t)=>{if("child"in e.props){const t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null};var Fs=Symbol.for("react.lazy");function zs(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===Fs&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}var Ls=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Ws=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Bs=r[" use ".trim().toString()];function $s(e){const n=e+"CollectionProvider",[o,a]=Es(n),[i,s]=o(n,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:n,children:o}=e,a=r.useRef(null),s=r.useRef(new Map).current;return t.jsx(i,{scope:n,itemMap:s,collectionRef:a,children:o})};l.displayName=n;const c=e+"CollectionSlot",d=Ps(c),u=r.forwardRef((e,n)=>{const{scope:o,children:r}=e,a=Rs(n,s(c,o).collectionRef);return t.jsx(d,{ref:a,children:r})});u.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",m=Ps(p),h=r.forwardRef((e,n)=>{const{scope:o,children:a,...i}=e,l=r.useRef(null),c=Rs(n,l),d=s(p,o);return r.useEffect(()=>(d.itemMap.set(l,{ref:l,...i}),()=>{d.itemMap.delete(l)})),t.jsx(m,{[f]:"",ref:c,children:a})});return h.displayName=p,[{Provider:l,Slot:u,ItemSlot:h},function(t){const n=s(e+"CollectionConsumer",t);return r.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},a]}function qs(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}var Ys=globalThis?.document?r.useLayoutEffect:()=>{},Hs=r[" useInsertionEffect ".trim().toString()]||Ys;function Ks({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[a,i,s]=function({defaultProp:e,onChange:t}){const[n,o]=r.useState(e),a=r.useRef(n),i=r.useRef(t);return Hs(()=>{i.current=t},[t]),r.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:a;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,o])}const d=r.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[l,e,i,s]);return[c,d]}var Us=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{const o=Ps(`Primitive.${n}`),a=r.forwardRef((e,r)=>{const{asChild:a,...i}=e,s=a?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function Vs(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}var Gs=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=r.useState(),o=r.useRef(null),a=r.useRef(e),i=r.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=Xs(o.current);i.current="mounted"===l?e:"none"},[l]),Ys(()=>{const t=o.current,n=a.current;if(n!==e){const o=i.current,r=Xs(t);if(e)c("MOUNT");else if("none"===r||"none"===t?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),Ys(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=Xs(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&i&&(c("ANIMATION_END"),!a.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)})}},s=e=>{e.target===t&&(i.current=Xs(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),i=function(...e){const t=r.useRef(e);return t.current=e,r.useCallback(e=>{const n=t.current;let o=!1;const r=n.map(t=>{const n=Zs(t,e);return o||"function"!=typeof n||(o=!0),n});if(o)return()=>{for(let e=0;e<r.length;e++){const t=r[e];"function"==typeof t?t():Zs(n[e],null)}}},[])}(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||o.isPresent?r.cloneElement(a,{ref:i}):null};function Zs(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Xs(e){return e?.animationName||"none"}Gs.displayName="Presence";var Qs=r[" useId ".trim().toString()]||(()=>{}),Js=0;function el(e){const[t,n]=r.useState(Qs());return Ys(()=>{n(e=>e??String(Js++))},[e]),t?`radix-${t}`:""}var tl="Collapsible",[nl,ol]=Es(tl),[rl,al]=nl(tl),il=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,open:a,defaultOpen:i,disabled:s,onOpenChange:l,...c}=e,[d,u]=Ks({prop:a,defaultProp:i??!1,onChange:l,caller:tl});return t.jsx(rl,{scope:o,disabled:s,contentId:el(),open:d,onOpenToggle:r.useCallback(()=>u(e=>!e),[u]),children:t.jsx(Us.div,{"data-state":pl(d),"data-disabled":s?"":void 0,...c,ref:n})})});il.displayName=tl;var sl="CollapsibleTrigger",ll=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,...r}=e,a=al(sl,o);return t.jsx(Us.button,{type:"button","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":pl(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:n,onClick:qs(e.onClick,a.onOpenToggle)})});ll.displayName=sl;var cl="CollapsibleContent",dl=r.forwardRef((e,n)=>{const{forceMount:o,...r}=e,a=al(cl,e.__scopeCollapsible);return t.jsx(Gs,{present:o||a.open,children:({present:e})=>t.jsx(ul,{...r,ref:n,present:e})})});dl.displayName=cl;var ul=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,present:a,children:i,...s}=e,l=al(cl,o),[c,d]=r.useState(a),u=r.useRef(null),p=Rs(n,u),f=r.useRef(0),m=f.current,h=r.useRef(0),v=h.current,g=l.open||c,x=r.useRef(g),y=r.useRef(void 0);return r.useEffect(()=>{const e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),Ys(()=>{const e=u.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();f.current=t.height,h.current=t.width,x.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),d(a)}},[l.open,a]),t.jsx(Us.div,{"data-state":pl(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!g,...s,ref:p,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&i})});function pl(e){return e?"open":"closed"}var fl=il,ml=ll,hl=dl,vl=r.createContext(void 0);function gl(e){const t=r.useContext(vl);return e||t||"ltr"}var xl="Accordion",yl=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[bl,wl,kl]=$s(xl),[jl]=Es(xl,[kl,ol]),Nl=ol(),Cl=r.forwardRef((e,n)=>{const{type:o,...r}=e,a=r,i=r;return t.jsx(bl.Provider,{scope:e.__scopeAccordion,children:"multiple"===o?t.jsx(Ol,{...i,ref:n}):t.jsx(Ml,{...a,ref:n})})});Cl.displayName=xl;var[_l,Dl]=jl(xl),[Sl,El]=jl(xl,{collapsible:!1}),Ml=r.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:i=()=>{},collapsible:s=!1,...l}=e,[c,d]=Ks({prop:o,defaultProp:a??"",onChange:i,caller:xl});return t.jsx(_l,{scope:e.__scopeAccordion,value:r.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:r.useCallback(()=>s&&d(""),[s,d]),children:t.jsx(Sl,{scope:e.__scopeAccordion,collapsible:s,children:t.jsx(Pl,{...l,ref:n})})})}),Ol=r.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:i=()=>{},...s}=e,[l,c]=Ks({prop:o,defaultProp:a??[],onChange:i,caller:xl}),d=r.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=r.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return t.jsx(_l,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:u,children:t.jsx(Sl,{scope:e.__scopeAccordion,collapsible:!0,children:t.jsx(Pl,{...s,ref:n})})})}),[Tl,Rl]=jl(xl),Pl=r.forwardRef((e,n)=>{const{__scopeAccordion:o,disabled:a,dir:i,orientation:s="vertical",...l}=e,c=Rs(r.useRef(null),n),d=wl(o),u="ltr"===gl(i),p=qs(e.onKeyDown,e=>{if(!yl.includes(e.key))return;const t=e.target,n=d().filter(e=>!e.ref.current?.disabled),o=n.findIndex(e=>e.ref.current===t),r=n.length;if(-1===o)return;e.preventDefault();let a=o;const i=r-1,l=()=>{a=o+1,a>i&&(a=0)},c=()=>{a=o-1,a<0&&(a=i)};switch(e.key){case"Home":a=0;break;case"End":a=i;break;case"ArrowRight":"horizontal"===s&&(u?l():c());break;case"ArrowDown":"vertical"===s&&l();break;case"ArrowLeft":"horizontal"===s&&(u?c():l());break;case"ArrowUp":"vertical"===s&&c()}const p=a%r;n[p].ref.current?.focus()});return t.jsx(Tl,{scope:o,disabled:a,direction:i,orientation:s,children:t.jsx(bl.Slot,{scope:o,children:t.jsx(Us.div,{...l,"data-orientation":s,ref:c,onKeyDown:a?void 0:p})})})}),Al="AccordionItem",[Il,Fl]=jl(Al),zl=r.forwardRef((e,n)=>{const{__scopeAccordion:o,value:r,...a}=e,i=Rl(Al,o),s=Dl(Al,o),l=Nl(o),c=el(),d=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return t.jsx(Il,{scope:o,open:d,disabled:u,triggerId:c,children:t.jsx(fl,{"data-orientation":i.orientation,"data-state":Hl(d),...l,...a,ref:n,disabled:u,open:d,onOpenChange:e=>{e?s.onItemOpen(r):s.onItemClose(r)}})})});zl.displayName=Al;var Ll="AccordionHeader",Wl=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=Rl(xl,o),i=Fl(Ll,o);return t.jsx(Us.h3,{"data-orientation":a.orientation,"data-state":Hl(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:n})});Wl.displayName=Ll;var Bl="AccordionTrigger",$l=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=Rl(xl,o),i=Fl(Bl,o),s=El(Bl,o),l=Nl(o);return t.jsx(bl.ItemSlot,{scope:o,children:t.jsx(ml,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...r,ref:n})})});$l.displayName=Bl;var ql="AccordionContent",Yl=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=Rl(xl,o),i=Fl(ql,o),s=Nl(o);return t.jsx(hl,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...s,...r,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function Hl(e){return e?"open":"closed"}Yl.displayName=ql;var Kl=zl,Ul=Wl,Vl=$l,Gl=Yl;const Zl=Cl,Xl=r.forwardRef(({className:e,...n},o)=>t.jsx(Kl,{ref:o,className:Ie("border-b",e),...n}));Xl.displayName="AccordionItem";const Ql=r.forwardRef(({className:e,children:n,...o},r)=>t.jsx(Ul,{className:"flex",children:t.jsxs(Vl,{ref:r,className:Ie("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",e),...o,children:[n,t.jsx(ti,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));Ql.displayName=Vl.displayName;const Jl=r.forwardRef(({className:e,children:n,...o},r)=>t.jsx(Gl,{ref:r,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o,children:t.jsx("div",{className:Ie("pb-4 pt-0",e),children:n})}));function ec({className:e,...n}){return t.jsx("div",{"data-slot":"empty",className:Ie("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",e),...n})}function tc({className:e,...n}){return t.jsx("div",{"data-slot":"empty-header",className:Ie("flex max-w-sm flex-col items-center gap-2 text-center",e),...n})}Jl.displayName=Gl.displayName;const nc=w("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function oc({className:e,variant:n="default",...o}){return t.jsx("div",{"data-slot":"empty-icon","data-variant":n,className:Ie(nc({variant:n,className:e})),...o})}function rc({className:e,...n}){return t.jsx("div",{"data-slot":"empty-title",className:Ie("text-lg font-medium tracking-tight",e),...n})}function ac({className:e,...n}){return t.jsx("div",{"data-slot":"empty-description",className:Ie("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...n})}function ic({title:e,description:n}){return t.jsx(ec,{children:t.jsxs(tc,{className:"w-[250px]",children:[t.jsx(oc,{children:t.jsx(Qa,{})}),t.jsx(rc,{children:e}),t.jsx(ac,{children:n})]})})}var sc=.999,lc=/[\\\/_+.#"@\[\(\{&]/,cc=/[\\\/_+.#"@\[\(\{&]/g,dc=/[\s-]/,uc=/[\s-]/g;function pc(e,t,n,o,r,a,i){if(a===t.length)return r===e.length?1:.99;var s=`${r},${a}`;if(void 0!==i[s])return i[s];for(var l,c,d,u,p=o.charAt(a),f=n.indexOf(p,r),m=0;f>=0;)(l=pc(e,t,n,o,f+1,a+1,i))>m&&(f===r?l*=1:lc.test(e.charAt(f-1))?(l*=.8,(d=e.slice(r,f-1).match(cc))&&r>0&&(l*=Math.pow(sc,d.length))):dc.test(e.charAt(f-1))?(l*=.9,(u=e.slice(r,f-1).match(uc))&&r>0&&(l*=Math.pow(sc,u.length))):(l*=.17,r>0&&(l*=Math.pow(sc,f-r))),e.charAt(f)!==t.charAt(a)&&(l*=.9999)),(l<.1&&n.charAt(f-1)===o.charAt(a+1)||o.charAt(a+1)===o.charAt(a)&&n.charAt(f-1)!==o.charAt(a))&&(.1*(c=pc(e,t,n,o,f+1,a+2,i))>l&&(l=.1*c)),l>m&&(m=l),f=n.indexOf(p,f+1);return i[s]=m,m}function fc(e){return e.toLowerCase().replace(uc," ")}function mc(e,t,n){return pc(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,fc(e),fc(t),0,0,{})}var hc='[cmdk-group=""]',vc='[cmdk-group-items=""]',gc='[cmdk-item=""]',xc=`${gc}:not([aria-disabled="true"])`,yc="cmdk-item-select",bc="data-value",wc=(e,t,n)=>mc(e,t,n),kc=r.createContext(void 0),jc=()=>r.useContext(kc),Nc=r.createContext(void 0),Cc=()=>r.useContext(Nc),_c=r.createContext(void 0),Dc=r.forwardRef((e,t)=>{let n=Bc(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Bc(()=>new Set),a=Bc(()=>new Map),i=Bc(()=>new Map),s=Bc(()=>new Set),l=Lc(e),{label:c,children:d,value:u,onValueChange:p,filter:f,shouldFilter:m,loop:h,disablePointerSelection:v=!1,vimBindings:g=!0,...x}=e,y=An(),b=An(),w=An(),k=r.useRef(null),j=Yc();Wc(()=>{if(void 0!==u){let e=u.trim();n.current.value=e,N.emit()}},[u]),Wc(()=>{j(6,M)},[]);let N=r.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,o)=>{var r,a,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)E(),D(),j(1,S);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(r=document.getElementById(y))||r.focus()}if(j(7,()=>{var e;n.current.selectedItemId=null==(e=O())?void 0:e.id,N.emit()}),o||j(5,M),void 0!==(null==(a=l.current)?void 0:a.value)){let e=null!=t?t:"";return void(null==(s=(i=l.current).onValueChange)||s.call(i,e))}}N.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),C=r.useMemo(()=>({value:(e,t,o)=>{var r;t!==(null==(r=i.current.get(e))?void 0:r.value)&&(i.current.set(e,{value:t,keywords:o}),n.current.filtered.items.set(e,_(t,o)),j(2,()=>{D(),N.emit()}))},item:(e,t)=>(o.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),j(3,()=>{E(),D(),n.current.value||S(),N.emit()}),()=>{i.current.delete(e),o.current.delete(e),n.current.filtered.items.delete(e);let t=O();j(4,()=>{E(),(null==t?void 0:t.getAttribute("id"))===e&&S(),N.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{i.current.delete(e),a.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:w,labelId:b,listInnerRef:k}),[]);function _(e,t){var o,r;let a=null!=(r=null==(o=l.current)?void 0:o.filter)?r:wc;return e?a(e,n.current.search,t):0}function D(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let o=a.current.get(n),r=0;o.forEach(t=>{let n=e.get(t);r=Math.max(n,r)}),t.push([n,r])});let o=k.current;T().sort((t,n)=>{var o,r;let a=t.getAttribute("id"),i=n.getAttribute("id");return(null!=(o=e.get(i))?o:0)-(null!=(r=e.get(a))?r:0)}).forEach(e=>{let t=e.closest(vc);t?t.appendChild(e.parentElement===t?e:e.closest(`${vc} > *`)):o.appendChild(e.parentElement===o?e:e.closest(`${vc} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${hc}[${bc}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function S(){let e=T().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(bc);N.setState("value",t||void 0)}function E(){var e,t,r,s;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=o.current.size);n.current.filtered.groups=new Set;let c=0;for(let a of o.current){let o=_(null!=(t=null==(e=i.current.get(a))?void 0:e.value)?t:"",null!=(s=null==(r=i.current.get(a))?void 0:r.keywords)?s:[]);n.current.filtered.items.set(a,o),o>0&&c++}for(let[e,t]of a.current)for(let o of t)if(n.current.filtered.items.get(o)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=c}function M(){var e,t,n;let o=O();o&&((null==(e=o.parentElement)?void 0:e.firstChild)===o&&(null==(n=null==(t=o.closest(hc))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),o.scrollIntoView({block:"nearest"}))}function O(){var e;return null==(e=k.current)?void 0:e.querySelector(`${gc}[aria-selected="true"]`)}function T(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(xc))||[])}function R(e){let t=T()[e];t&&N.setState("value",t.getAttribute(bc))}function P(e){var t;let n=O(),o=T(),r=o.findIndex(e=>e===n),a=o[r+e];null!=(t=l.current)&&t.loop&&(a=r+e<0?o[o.length-1]:r+e===o.length?o[0]:o[r+e]),a&&N.setState("value",a.getAttribute(bc))}function A(e){let t,n=O(),o=null==n?void 0:n.closest(hc);for(;o&&!t;)o=e>0?Fc(o,hc):zc(o,hc),t=null==o?void 0:o.querySelector(xc);t?N.setState("value",t.getAttribute(bc)):P(e)}let I=()=>R(T().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?A(1):P(1)},z=e=>{e.preventDefault(),e.metaKey?R(0):e.altKey?A(-1):P(-1)};return r.createElement($n.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=x.onKeyDown)||t.call(x,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!n)switch(e.key){case"n":case"j":g&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":g&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),R(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let t=O();if(t){let e=new Event(yc);t.dispatchEvent(e)}}}}},r.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:Kc},c),Hc(e,e=>r.createElement(Nc.Provider,{value:N},r.createElement(kc.Provider,{value:C},e))))}),Sc=r.forwardRef((e,t)=>{var n,o;let a=An(),i=r.useRef(null),l=r.useContext(_c),c=jc(),d=Lc(e),u=null!=(o=null==(n=d.current)?void 0:n.forceMount)?o:null==l?void 0:l.forceMount;Wc(()=>{if(!u)return c.item(a,null==l?void 0:l.id)},[u]);let p=qc(a,i,[e.value,e.children,i],e.keywords),f=Cc(),m=$c(e=>e.value&&e.value===p.current),h=$c(e=>!(!u&&!1!==c.filter())||(!e.search||e.filtered.items.get(a)>0));function v(){var e,t;g(),null==(t=(e=d.current).onSelect)||t.call(e,p.current)}function g(){f.setState("value",p.current,!0)}if(r.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(yc,v),()=>t.removeEventListener(yc,v)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:x,value:y,onSelect:b,forceMount:w,keywords:k,...j}=e;return r.createElement($n.div,{ref:s(i,t),...j,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!m,"data-disabled":!!x,"data-selected":!!m,onPointerMove:x||c.getDisablePointerSelection()?void 0:g,onClick:x?void 0:v},e.children)}),Ec=r.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:a,...i}=e,l=An(),c=r.useRef(null),d=r.useRef(null),u=An(),p=jc(),f=$c(e=>!(!a&&!1!==p.filter())||(!e.search||e.filtered.groups.has(l)));Wc(()=>p.group(l),[]),qc(l,c,[e.value,e.heading,d]);let m=r.useMemo(()=>({id:l,forceMount:a}),[a]);return r.createElement($n.div,{ref:s(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!f||void 0},n&&r.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Hc(e,e=>r.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},r.createElement(_c.Provider,{value:m},e))))}),Mc=r.forwardRef((e,t)=>{let{alwaysRender:n,...o}=e,a=r.useRef(null),i=$c(e=>!e.search);return n||i?r.createElement($n.div,{ref:s(a,t),...o,"cmdk-separator":"",role:"separator"}):null}),Oc=r.forwardRef((e,t)=>{let{onValueChange:n,...o}=e,a=null!=e.value,i=Cc(),s=$c(e=>e.search),l=$c(e=>e.selectedItemId),c=jc();return r.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),r.createElement($n.input,{ref:t,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:a?e.value:s,onChange:e=>{a||i.setState("search",e.target.value),null==n||n(e.target.value)}})}),Tc=r.forwardRef((e,t)=>{let{children:n,label:o="Suggestions",...a}=e,i=r.useRef(null),l=r.useRef(null),c=$c(e=>e.selectedItemId),d=jc();return r.useEffect(()=>{if(l.current&&i.current){let e,t=l.current,n=i.current,o=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;n.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return o.observe(t),()=>{cancelAnimationFrame(e),o.unobserve(t)}}},[]),r.createElement($n.div,{ref:s(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":o,id:d.listId},Hc(e,e=>r.createElement("div",{ref:s(l,d.listInnerRef),"cmdk-list-sizer":""},e)))}),Rc=r.forwardRef((e,t)=>{let{open:n,onOpenChange:o,overlayClassName:a,contentClassName:i,container:s,...l}=e;return r.createElement(Wr,{open:n,onOpenChange:o},r.createElement($r,{container:s},r.createElement(qr,{"cmdk-overlay":"",className:a}),r.createElement(Yr,{"aria-label":e.label,"cmdk-dialog":"",className:i},r.createElement(Dc,{ref:t,...l}))))}),Pc=r.forwardRef((e,t)=>$c(e=>0===e.filtered.count)?r.createElement($n.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Ac=r.forwardRef((e,t)=>{let{progress:n,children:o,label:a="Loading...",...i}=e;return r.createElement($n.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Hc(e,e=>r.createElement("div",{"aria-hidden":!0},e)))}),Ic=Object.assign(Dc,{List:Tc,Item:Sc,Input:Oc,Group:Ec,Separator:Mc,Dialog:Rc,Empty:Pc,Loading:Ac});function Fc(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function zc(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Lc(e){let t=r.useRef(e);return Wc(()=>{t.current=e}),t}var Wc="undefined"==typeof window?r.useEffect:r.useLayoutEffect;function Bc(e){let t=r.useRef();return void 0===t.current&&(t.current=e()),t}function $c(e){let t=Cc(),n=()=>e(t.snapshot());return r.useSyncExternalStore(t.subscribe,n,n)}function qc(e,t,n,o=[]){let a=r.useRef(),i=jc();return Wc(()=>{var r;let s=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),l=o.map(e=>e.trim());i.value(e,s,l),null==(r=t.current)||r.setAttribute(bc,s),a.current=s}),a}var Yc=()=>{let[e,t]=r.useState(),n=Bc(()=>new Map);return Wc(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,o)=>{n.current.set(e,o),t({})}};function Hc({asChild:e,children:t},n){return e&&r.isValidElement(t)?r.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var Kc={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Uc=Wr,Vc=Br,Gc=({className:e,...n})=>t.jsx($r,{...n});Gc.displayName=$r.displayName;const Zc=r.forwardRef(({className:e,...n},o)=>t.jsx(qr,{ref:o,className:Ie("fixed inset-0 z-50 overlay-dialog data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));Zc.displayName=qr.displayName;const Xc=r.forwardRef(({className:e,children:n,showCloseButton:o=!0,...r},a)=>t.jsxs(Gc,{children:[t.jsx(Zc,{}),t.jsxs(Yr,{ref:a,className:Ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-2xl md:w-full",e),...r,children:[n,o&&t.jsxs(Ur,{type:"button",className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(xi,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xc.displayName=Yr.displayName;const Qc=({className:e,...n})=>t.jsx("div",{className:Ie("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});Qc.displayName="DialogHeader";const Jc=({className:e,...n})=>t.jsx("div",{className:Ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});Jc.displayName="DialogFooter";const ed=r.forwardRef(({className:e,...n},o)=>t.jsx(Hr,{ref:o,className:Ie("text-lg font-semibold leading-none tracking-tight",e),...n}));ed.displayName=Hr.displayName;const td=r.forwardRef(({className:e,...n},o)=>t.jsx(Kr,{ref:o,className:Ie("text-sm text-muted-foreground",e),...n}));function nd({className:e,...n}){return t.jsx(Ic,{"data-slot":"command",className:Ie("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...n})}function od({className:e,...n}){return t.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[t.jsx(vi,{className:"size-4 shrink-0 opacity-50"}),t.jsx(Ic.Input,{"data-slot":"command-input",className:Ie("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function rd({className:e,...n}){return t.jsx(Ic.List,{"data-slot":"command-list",className:Ie("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function ad({...e}){return t.jsx(Ic.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function id({className:e,...n}){return t.jsx(Ic.Group,{"data-slot":"command-group",className:Ie("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...n})}function sd({className:e,...n}){return t.jsx(Ic.Item,{"data-slot":"command-item",className:Ie("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}td.displayName=Kr.displayName;const ld=["top","right","bottom","left"],cd=Math.min,dd=Math.max,ud=Math.round,pd=Math.floor,fd=e=>({x:e,y:e}),md={left:"right",right:"left",bottom:"top",top:"bottom"},hd={start:"end",end:"start"};function vd(e,t,n){return dd(e,cd(t,n))}function gd(e,t){return"function"==typeof e?e(t):e}function xd(e){return e.split("-")[0]}function yd(e){return e.split("-")[1]}function bd(e){return"x"===e?"y":"x"}function wd(e){return"y"===e?"height":"width"}const kd=new Set(["top","bottom"]);function jd(e){return kd.has(xd(e))?"y":"x"}function Nd(e){return bd(jd(e))}function Cd(e){return e.replace(/start|end/g,e=>hd[e])}const _d=["left","right"],Dd=["right","left"],Sd=["top","bottom"],Ed=["bottom","top"];function Md(e,t,n,o){const r=yd(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Dd:_d:t?_d:Dd;case"left":case"right":return t?Sd:Ed;default:return[]}}(xd(e),"start"===n,o);return r&&(a=a.map(e=>e+"-"+r),t&&(a=a.concat(a.map(Cd)))),a}function Od(e){return e.replace(/left|right|bottom|top/g,e=>md[e])}function Td(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Rd(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Pd(e,t,n){let{reference:o,floating:r}=e;const a=jd(t),i=Nd(t),s=wd(i),l=xd(t),c="y"===a,d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,p=o[s]/2-r[s]/2;let f;switch(l){case"top":f={x:d,y:o.y-r.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-r.width,y:u};break;default:f={x:o.x,y:o.y}}switch(yd(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1)}return f}async function Ad(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=gd(t,e),m=Td(f),h=s[p?"floating"===u?"reference":"floating":u],v=Rd(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(h)))||n?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),g="floating"===u?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),y=await(null==a.isElement?void 0:a.isElement(x))&&await(null==a.getScale?void 0:a.getScale(x))||{x:1,y:1},b=Rd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:x,strategy:l}):g);return{top:(v.top-b.top+m.top)/y.y,bottom:(b.bottom-v.bottom+m.bottom)/y.y,left:(v.left-b.left+m.left)/y.x,right:(b.right-v.right+m.right)/y.x}}function Id(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fd(e){return ld.some(t=>e[t]>=0)}const zd=new Set(["left","top"]);function Ld(){return"undefined"!=typeof window}function Wd(e){return qd(e)?(e.nodeName||"").toLowerCase():"#document"}function Bd(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $d(e){var t;return null==(t=(qd(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function qd(e){return!!Ld()&&(e instanceof Node||e instanceof Bd(e).Node)}function Yd(e){return!!Ld()&&(e instanceof Element||e instanceof Bd(e).Element)}function Hd(e){return!!Ld()&&(e instanceof HTMLElement||e instanceof Bd(e).HTMLElement)}function Kd(e){return!(!Ld()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Bd(e).ShadowRoot)}const Ud=new Set(["inline","contents"]);function Vd(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=iu(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Ud.has(r)}const Gd=new Set(["table","td","th"]);function Zd(e){return Gd.has(Wd(e))}const Xd=[":popover-open",":modal"];function Qd(e){return Xd.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Jd=["transform","translate","scale","rotate","perspective"],eu=["transform","translate","scale","rotate","perspective","filter"],tu=["paint","layout","strict","content"];function nu(e){const t=ou(),n=Yd(e)?iu(e):e;return Jd.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||eu.some(e=>(n.willChange||"").includes(e))||tu.some(e=>(n.contain||"").includes(e))}function ou(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ru=new Set(["html","body","#document"]);function au(e){return ru.has(Wd(e))}function iu(e){return Bd(e).getComputedStyle(e)}function su(e){return Yd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lu(e){if("html"===Wd(e))return e;const t=e.assignedSlot||e.parentNode||Kd(e)&&e.host||$d(e);return Kd(t)?t.host:t}function cu(e){const t=lu(e);return au(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hd(t)&&Vd(t)?t:cu(t)}function du(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=cu(e),a=r===(null==(o=e.ownerDocument)?void 0:o.body),i=Bd(r);if(a){const e=uu(i);return t.concat(i,i.visualViewport||[],Vd(r)?r:[],e&&n?du(e):[])}return t.concat(r,du(r,[],n))}function uu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pu(e){const t=iu(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Hd(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=ud(n)!==a||ud(o)!==i;return s&&(n=a,o=i),{width:n,height:o,$:s}}function fu(e){return Yd(e)?e:e.contextElement}function mu(e){const t=fu(e);if(!Hd(t))return fd(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=pu(t);let i=(a?ud(n.width):n.width)/o,s=(a?ud(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const hu=fd(0);function vu(e){const t=Bd(e);return ou()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:hu}function gu(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=fu(e);let i=fd(1);t&&(o?Yd(o)&&(i=mu(o)):i=mu(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Bd(e))&&t}(a,n,o)?vu(a):fd(0);let l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,d=r.width/i.x,u=r.height/i.y;if(a){const e=Bd(a),t=o&&Yd(o)?Bd(o):o;let n=e,r=uu(n);for(;r&&o&&t!==n;){const e=mu(r),t=r.getBoundingClientRect(),o=iu(r),a=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=a,c+=i,n=Bd(r),r=uu(n)}}return Rd({width:d,height:u,x:l,y:c})}function xu(e,t){const n=su(e).scrollLeft;return t?t.left+n:gu($d(e)).left+n}function yu(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xu(e,n),y:n.top+t.scrollTop}}const bu=new Set(["absolute","fixed"]);function wu(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=Bd(e),o=$d(e),r=n.visualViewport;let a=o.clientWidth,i=o.clientHeight,s=0,l=0;if(r){a=r.width,i=r.height;const e=ou();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=xu(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=$d(e),n=su(e),o=e.ownerDocument.body,r=dd(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=dd(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+xu(e);const s=-n.scrollTop;return"rtl"===iu(o).direction&&(i+=dd(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:s}}($d(e));else if(Yd(t))o=function(e,t){const n=gu(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=Hd(e)?mu(e):fd(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:r*a.x,y:o*a.y}}(t,n);else{const n=vu(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Rd(o)}function ku(e,t){const n=lu(e);return!(n===t||!Yd(n)||au(n))&&("fixed"===iu(n).position||ku(n,t))}function ju(e,t,n){const o=Hd(t),r=$d(t),a="fixed"===n,i=gu(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=fd(0);function c(){l.x=xu(r)}if(o||!o&&!a)if(("body"!==Wd(t)||Vd(r))&&(s=su(t)),o){const e=gu(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&c();a&&!o&&r&&c();const d=!r||o||a?fd(0):yu(r,s);return{x:i.left+s.scrollLeft-l.x-d.x,y:i.top+s.scrollTop-l.y-d.y,width:i.width,height:i.height}}function Nu(e){return"static"===iu(e).position}function Cu(e,t){if(!Hd(e)||"fixed"===iu(e).position)return null;if(t)return t(e);let n=e.offsetParent;return $d(e)===n&&(n=n.ownerDocument.body),n}function _u(e,t){const n=Bd(e);if(Qd(e))return n;if(!Hd(e)){let t=lu(e);for(;t&&!au(t);){if(Yd(t)&&!Nu(t))return t;t=lu(t)}return n}let o=Cu(e,t);for(;o&&Zd(o)&&Nu(o);)o=Cu(o,t);return o&&au(o)&&Nu(o)&&!nu(o)?n:o||function(e){let t=lu(e);for(;Hd(t)&&!au(t);){if(nu(t))return t;if(Qd(t))return null;t=lu(t)}return null}(e)||n}const Du={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a="fixed"===r,i=$d(o),s=!!t&&Qd(t.floating);if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=fd(1);const d=fd(0),u=Hd(o);if((u||!u&&!a)&&(("body"!==Wd(o)||Vd(i))&&(l=su(o)),Hd(o))){const e=gu(o);c=mu(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const p=!i||u||a?fd(0):yu(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}},getDocumentElement:$d,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[..."clippingAncestors"===n?Qd(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=du(e,[],!1).filter(e=>Yd(e)&&"body"!==Wd(e)),r=null;const a="fixed"===iu(e).position;let i=a?lu(e):e;for(;Yd(i)&&!au(i);){const t=iu(i),n=nu(i);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&r&&bu.has(r.position)||Vd(i)&&!n&&ku(e,i))?o=o.filter(e=>e!==i):r=t,i=lu(i)}return t.set(e,o),o}(t,this._c):[].concat(n),o],i=a[0],s=a.reduce((e,n)=>{const o=wu(t,n,r);return e.top=dd(o.top,e.top),e.right=cd(o.right,e.right),e.bottom=cd(o.bottom,e.bottom),e.left=dd(o.left,e.left),e},wu(t,i,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:_u,getElementRects:async function(e){const t=this.getOffsetParent||_u,n=this.getDimensions,o=await n(e.floating);return{reference:ju(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=pu(e);return{width:t,height:n}},getScale:mu,isElement:Yd,isRTL:function(e){return"rtl"===iu(e).direction}};function Su(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Eu(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=fu(e),d=r||a?[...c?du(c):[],...du(t)]:[];d.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const u=c&&s?function(e,t){let n,o=null;const r=$d(e);function a(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:d,top:u,width:p,height:f}=c;if(s||t(),!p||!f)return;const m={rootMargin:-pd(u)+"px "+-pd(r.clientWidth-(d+p))+"px "+-pd(r.clientHeight-(u+f))+"px "+-pd(d)+"px",threshold:dd(0,cd(1,l))||1};let h=!0;function v(t){const o=t[0].intersectionRatio;if(o!==l){if(!h)return i();o?i(!1,o):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||Su(c,e.getBoundingClientRect())||i(),h=!1}try{o=new IntersectionObserver(v,{...m,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(v,m)}o.observe(e)}(!0),a}(c,n):null;let p,f=-1,m=null;i&&(m=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let h=l?gu(e):null;return l&&function t(){const o=gu(e);h&&!Su(h,o)&&n();h=o,p=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{r&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const Mu=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,a=await(null==o.isRTL?void 0:o.isRTL(r.floating)),i=xd(n),s=yd(n),l="y"===jd(n),c=zd.has(i)?-1:1,d=a&&l?-1:1,u=gd(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof m&&(f="end"===s?-1*m:m),l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:i}}}}},Ou=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=gd(e,t),c={x:n,y:o},d=await Ad(t,l),u=jd(xd(r)),p=bd(u);let f=c[p],m=c[u];if(a){const e="y"===p?"bottom":"right";f=vd(f+d["y"===p?"top":"left"],f,f-d[e])}if(i){const e="y"===u?"bottom":"right";m=vd(m+d["y"===u?"top":"left"],m,m-d[e])}const h=s.fn({...t,[p]:f,[u]:m});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:a,[u]:i}}}}}},Tu=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=gd(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const g=xd(r),x=jd(s),y=xd(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(y||!h?[Od(s)]:function(e){const t=Od(e);return[Cd(e),t,Cd(t)]}(s)),k="none"!==m;!p&&k&&w.push(...Md(s,h,m,b));const j=[s,...w],N=await Ad(t,v),C=[];let _=(null==(o=a.flip)?void 0:o.overflows)||[];if(d&&C.push(N[g]),u){const e=function(e,t,n){void 0===n&&(n=!1);const o=yd(e),r=Nd(e),a=wd(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Od(i)),[i,Od(i)]}(r,i,b);C.push(N[e[0]],N[e[1]])}if(_=[..._,{placement:r,overflows:C}],!C.every(e=>e<=0)){var D,S;const e=((null==(D=a.flip)?void 0:D.index)||0)+1,t=j[e];if(t){if(!("alignment"===u&&x!==jd(t))||_.every(e=>jd(e.placement)!==x||e.overflows[0]>0))return{data:{index:e,overflows:_},reset:{placement:t}}}let n=null==(S=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:S.placement;if(!n)switch(f){case"bestFit":{var E;const e=null==(E=_.filter(e=>{if(k){const t=jd(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:E[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},Ru=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=gd(e,t),d=await Ad(t,c),u=xd(r),p=yd(r),f="y"===jd(r),{width:m,height:h}=a.floating;let v,g;"top"===u||"bottom"===u?(v=u,g=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(g=u,v="end"===p?"top":"bottom");const x=h-d.top-d.bottom,y=m-d.left-d.right,b=cd(h-d[v],x),w=cd(m-d[g],y),k=!t.middlewareData.shift;let j=b,N=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(N=y),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(j=x),k&&!p){const e=dd(d.left,0),t=dd(d.right,0),n=dd(d.top,0),o=dd(d.bottom,0);f?N=m-2*(0!==e||0!==t?e+t:dd(d.left,d.right)):j=h-2*(0!==n||0!==o?n+o:dd(d.top,d.bottom))}await l({...t,availableWidth:N,availableHeight:j});const C=await i.getDimensions(s.floating);return m!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}},Pu=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=gd(e,t);switch(o){case"referenceHidden":{const e=Id(await Ad(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Fd(e)}}}case"escaped":{const e=Id(await Ad(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Fd(e)}}}default:return{}}}}},Au=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=gd(e,t)||{};if(null==c)return{};const u=Td(d),p={x:n,y:o},f=Nd(r),m=wd(f),h=await i.getDimensions(c),v="y"===f,g=v?"top":"left",x=v?"bottom":"right",y=v?"clientHeight":"clientWidth",b=a.reference[m]+a.reference[f]-p[f]-a.floating[m],w=p[f]-a.reference[f],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let j=k?k[y]:0;j&&await(null==i.isElement?void 0:i.isElement(k))||(j=s.floating[y]||a.floating[m]);const N=b/2-w/2,C=j/2-h[m]/2-1,_=cd(u[g],C),D=cd(u[x],C),S=_,E=j-h[m]-D,M=j/2-h[m]/2+N,O=vd(S,M,E),T=!l.arrow&&null!=yd(r)&&M!==O&&a.reference[m]/2-(M<S?_:D)-h[m]/2<0,R=T?M<S?M-S:M-E:0;return{[f]:p[f]+R,data:{[f]:O,centerOffset:M-O-R,...T&&{alignmentOffset:R}},reset:T}}}),Iu=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=gd(e,t),d={x:n,y:o},u=jd(r),p=bd(u);let f=d[p],m=d[u];const h=gd(s,t),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const e="y"===p?"height":"width",t=a.reference[p]-a.floating[e]+v.mainAxis,n=a.reference[p]+a.reference[e]-v.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var g,x;const e="y"===p?"width":"height",t=zd.has(xd(r)),n=a.reference[u]-a.floating[e]+(t&&(null==(g=i.offset)?void 0:g[u])||0)+(t?0:v.crossAxis),o=a.reference[u]+a.reference[e]+(t?0:(null==(x=i.offset)?void 0:x[u])||0)-(t?v.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[p]:f,[u]:m}}}},Fu=(e,t,n)=>{const o=new Map,r={platform:Du,...n},a={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=Pd(c,o,l),p=o,f={},m=0;for(let n=0;n<s.length;n++){const{name:a,fn:h}=s[n],{x:v,y:g,data:x,reset:y}=await h({x:d,y:u,initialPlacement:o,placement:p,strategy:r,middlewareData:f,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=g?g:u,f={...f,[a]:{...f[a],...x}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await i.getElementRects({reference:e,floating:t,strategy:r}):y.rects),({x:d,y:u}=Pd(c,p,l))),n=-1)}return{x:d,y:u,placement:p,strategy:r,middlewareData:f}})(e,t,{...r,platform:a})};var zu="undefined"!=typeof document?e.useLayoutEffect:function(){};function Lu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!Lu(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!Lu(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Wu(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bu(e,t){const n=Wu(e);return Math.round(t*n)/n}function $u(e){const t=r.useRef(e);return zu(()=>{t.current=e}),t}function qu(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[p,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=r.useState(o);Lu(m,o)||h(o);const[v,g]=r.useState(null),[x,y]=r.useState(null),b=r.useCallback(e=>{e!==N.current&&(N.current=e,g(e))},[]),w=r.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),k=s||v,j=l||x,N=r.useRef(null),C=r.useRef(null),_=r.useRef(p),D=null!=d,S=$u(d),E=$u(i),M=$u(u),O=r.useCallback(()=>{if(!N.current||!C.current)return;const e={placement:t,strategy:n,middleware:m};E.current&&(e.platform=E.current),Fu(N.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==M.current};T.current&&!Lu(_.current,t)&&(_.current=t,a.flushSync(()=>{f(t)}))})},[m,t,n,E,M]);zu(()=>{!1===u&&_.current.isPositioned&&(_.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const T=r.useRef(!1);zu(()=>(T.current=!0,()=>{T.current=!1}),[]),zu(()=>{if(k&&(N.current=k),j&&(C.current=j),k&&j){if(S.current)return S.current(k,j,O);O()}},[k,j,O,S,D]);const R=r.useMemo(()=>({reference:N,floating:C,setReference:b,setFloating:w}),[b,w]),P=r.useMemo(()=>({reference:k,floating:j}),[k,j]),A=r.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=Bu(P.floating,p.x),o=Bu(P.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...Wu(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}},[n,c,P.floating,p.x,p.y]);return r.useMemo(()=>({...p,update:O,refs:R,elements:P,floatingStyles:A}),[p,O,R,P,A])}const Yu=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:o}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?Au({element:n.current,padding:o}).fn(t):{}:n?Au({element:n,padding:o}).fn(t):{};var r}}),Hu=(e,t)=>({...Mu(e),options:[e,t]}),Ku=(e,t)=>({...Ou(e),options:[e,t]}),Uu=(e,t)=>({...Iu(e),options:[e,t]}),Vu=(e,t)=>({...Tu(e),options:[e,t]}),Gu=(e,t)=>({...Ru(e),options:[e,t]}),Zu=(e,t)=>({...Pu(e),options:[e,t]}),Xu=(e,t)=>({...Yu(e),options:[e,t]});var Qu=r.forwardRef((e,n)=>{const{children:o,width:r=10,height:a=5,...i}=e;return t.jsx($n.svg,{...i,ref:n,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});Qu.displayName="Arrow";var Ju=Qu;var ep="Popper",[tp,np]=En(ep),[op,rp]=tp(ep),ap=e=>{const{__scopePopper:n,children:o}=e,[a,i]=r.useState(null);return t.jsx(op,{scope:n,anchor:a,onAnchorChange:i,children:o})};ap.displayName=ep;var ip="PopperAnchor",sp=r.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:a,...i}=e,s=rp(ip,o),c=r.useRef(null),d=l(n,c),u=r.useRef(null);return r.useEffect(()=>{const e=u.current;u.current=a?.current||c.current,e!==u.current&&s.onAnchorChange(u.current)}),a?null:t.jsx($n.div,{...i,ref:d})});sp.displayName=ip;var lp="PopperContent",[cp,dp]=tp(lp),up=r.forwardRef((e,n)=>{const{__scopePopper:o,side:a="bottom",sideOffset:i=0,align:s="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:u=!0,collisionBoundary:p=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:h=!1,updatePositionStrategy:v="optimized",onPlaced:g,...x}=e,y=rp(lp,o),[b,w]=r.useState(null),k=l(n,e=>w(e)),[j,N]=r.useState(null),C=function(e){const[t,n]=r.useState(void 0);return Tn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,a;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(j),_=C?.width??0,D=C?.height??0,S=a+("center"!==s?"-"+s:""),E="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},M=Array.isArray(p)?p:[p],O=M.length>0,T={padding:E,boundary:M.filter(hp),altBoundary:O},{refs:R,floatingStyles:P,placement:A,isPositioned:I,middlewareData:F}=qu({strategy:"fixed",placement:S,whileElementsMounted:(...e)=>Eu(...e,{animationFrame:"always"===v}),elements:{reference:y.anchor},middleware:[Hu({mainAxis:i+D,alignmentAxis:c}),u&&Ku({mainAxis:!0,crossAxis:!1,limiter:"partial"===m?Uu():void 0,...T}),u&&Vu({...T}),Gu({...T,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),j&&Xu({element:j,padding:d}),vp({arrowWidth:_,arrowHeight:D}),h&&Zu({strategy:"referenceHidden",...T})]}),[z,L]=gp(A),W=qn(g);Tn(()=>{I&&W?.()},[I,W]);const B=F.arrow?.x,$=F.arrow?.y,q=0!==F.arrow?.centerOffset,[Y,H]=r.useState();return Tn(()=>{b&&H(window.getComputedStyle(b).zIndex)},[b]),t.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:I?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(cp,{scope:o,placedSide:z,onArrowChange:N,arrowX:B,arrowY:$,shouldHideArrow:q,children:t.jsx($n.div,{"data-side":z,"data-align":L,...x,ref:k,style:{...x.style,animation:I?void 0:"none"}})})})});up.displayName=lp;var pp="PopperArrow",fp={top:"bottom",right:"left",bottom:"top",left:"right"},mp=r.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,a=dp(pp,o),i=fp[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(Ju,{...r,ref:n,style:{...r.style,display:"block"}})})});function hp(e){return null!==e}mp.displayName=pp;var vp=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=gp(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(r.arrow?.x??0)+i/2,p=(r.arrow?.y??0)+s/2;let f="",m="";return"bottom"===l?(f=a?d:`${u}px`,m=-s+"px"):"top"===l?(f=a?d:`${u}px`,m=`${o.floating.height+s}px`):"right"===l?(f=-s+"px",m=a?d:`${p}px`):"left"===l&&(f=`${o.floating.width+s}px`,m=a?d:`${p}px`),{data:{x:f,y:m}}}});function gp(e){const[t,n="center"]=e.split("-");return[t,n]}var xp=ap,yp=sp,bp=up,wp=mp,kp="Popover",[jp]=En(kp,[np]),Np=np(),[Cp,_p]=jp(kp),Dp=e=>{const{__scopePopover:n,children:o,open:a,defaultOpen:i,onOpenChange:s,modal:l=!1}=e,c=Np(n),d=r.useRef(null),[u,p]=r.useState(!1),[f,m]=Fn({prop:a,defaultProp:i??!1,onChange:s,caller:kp});return t.jsx(xp,{...c,children:t.jsx(Cp,{scope:n,contentId:An(),triggerRef:d,open:f,onOpenChange:m,onOpenToggle:r.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:r.useCallback(()=>p(!0),[]),onCustomAnchorRemove:r.useCallback(()=>p(!1),[]),modal:l,children:o})})};Dp.displayName=kp;var Sp="PopoverAnchor";r.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,i=_p(Sp,o),s=Np(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=i;return r.useEffect(()=>(l(),()=>c()),[l,c]),t.jsx(yp,{...s,...a,ref:n})}).displayName=Sp;var Ep="PopoverTrigger",Mp=r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=_p(Ep,o),i=Np(o),s=l(n,a.triggerRef),c=t.jsx($n.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":$p(a.open),...r,ref:s,onClick:On(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:t.jsx(yp,{asChild:!0,...i,children:c})});Mp.displayName=Ep;var Op="PopoverPortal",[Tp,Rp]=jp(Op,{forceMount:void 0}),Pp=e=>{const{__scopePopover:n,forceMount:o,children:r,container:a}=e,i=_p(Op,n);return t.jsx(Tp,{scope:n,forceMount:o,children:t.jsx(co,{present:o||i.open,children:t.jsx(lo,{asChild:!0,container:a,children:r})})})};Pp.displayName=Op;var Ap="PopoverContent",Ip=r.forwardRef((e,n)=>{const o=Rp(Ap,e.__scopePopover),{forceMount:r=o.forceMount,...a}=e,i=_p(Ap,e.__scopePopover);return t.jsx(co,{present:r||i.open,children:i.modal?t.jsx(zp,{...a,ref:n}):t.jsx(Lp,{...a,ref:n})})});Ip.displayName=Ap;var Fp=zn("PopoverContent.RemoveScroll"),zp=r.forwardRef((e,n)=>{const o=_p(Ap,e.__scopePopover),a=r.useRef(null),i=l(n,a),s=r.useRef(!1);return r.useEffect(()=>{const e=a.current;if(e)return ir(e)},[]),t.jsx(Jo,{as:Fp,allowPinchZoom:!0,children:t.jsx(Wp,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:On(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:On(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;s.current=o},{checkForDefaultPrevented:!1}),onFocusOutside:On(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Lp=r.forwardRef((e,n)=>{const o=_p(Ap,e.__scopePopover),a=r.useRef(!1),i=r.useRef(!1);return t.jsx(Wp,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||o.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const n=t.target,r=o.triggerRef.current?.contains(n);r&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),Wp=r.forwardRef((e,n)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,f=_p(Ap,o),m=Np(o);return fo(),t.jsx(to,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(bp,{"data-state":$p(f.open),role:"dialog",id:f.contentId,...m,...p,ref:n,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Bp="PopoverClose";r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=_p(Bp,o);return t.jsx($n.button,{type:"button",...r,ref:n,onClick:On(e.onClick,()=>a.onOpenChange(!1))})}).displayName=Bp;function $p(e){return e?"open":"closed"}r.forwardRef((e,n)=>{const{__scopePopover:o,...r}=e,a=Np(o);return t.jsx(wp,{...a,...r,ref:n})}).displayName="PopoverArrow";var qp=Pp,Yp=Ip;const Hp=Dp,Kp=Mp,Up=r.forwardRef(({className:e,align:n="center",sideOffset:o=4,...r},a)=>t.jsx(qp,{children:t.jsx(Yp,{ref:a,align:n,sideOffset:o,"data-slot":"popover-content",className:Ie("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 origin-[--radix-popover-content-transform-origin]",e),...r})}));function Vp({items:e,value:n,onChange:o,placeholder:a="Select an option...",emptyMessage:i="No items found.",className:s,searchPlaceholder:l="Search...",onSearchChange:c,filterLocally:d=!0,loading:u=!1,displayLabel:p,disabled:f=!1}){const[m,h]=r.useState(!1),[v,g]=r.useState(""),[x,y]=r.useState(null);r.useEffect(()=>{if(!n||""===n)return void y(null);const t=e?.find(e=>String(e.value)===String(n));t&&y(t)},[n,e]);const b=d&&v?e?.filter(e=>e.label.toLowerCase().includes(v.toLowerCase())):e,w=p??x?.label??a,k=!p&&!x;return t.jsxs(Hp,{open:m,onOpenChange:h,children:[t.jsx(Kp,{asChild:!0,children:t.jsxs("button",{type:"button","data-cy":"combobox-trigger",disabled:f,"aria-expanded":m,className:Ie(We,"justify-between truncate",k&&Be,s),children:[t.jsx("span",{className:"truncate",children:w}),t.jsx(ai,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}),t.jsx(Up,{className:"max-w-[700px] p-0 w-full min-w-(--radix-popover-trigger-width)",children:t.jsxs(nd,{shouldFilter:!1,children:[t.jsx(od,{"data-cy":"combobox-input",placeholder:l,value:v,onValueChange:e=>{g(e),c?.(e)},className:"h-9 focus:ring-0 focus:outline-none focus-visible:ring-0 focus-visible:ring-offset-0"}),t.jsxs(rd,{"data-cy":"combobox-list",children:[t.jsx(ad,{children:u?"Loading...":i}),t.jsx(id,{children:b?.map(e=>t.jsxs(sd,{value:String(e?.value??""),onSelect:t=>((e,t)=>{const r=e===n?null:t;o(r?.value??"",r),h(!1),g(""),y(r)})(t,e),className:Ie("cursor-pointer",$e),children:[e.label,t.jsx(ei,{className:Ie("ml-auto size-4",String(n)===String(e.value)?"opacity-100":"opacity-0")})]},e?.value))})]})]})})]})}Up.displayName=Yp.displayName;const Gp={},Zp=({id:n,fetcher:o,resolveValue:r,modelClass:a,labelName:i,valueField:s="pk",placeholder:l="Select item...",emptyMessage:c="No items found",value:d,onChange:u,additionalFilters:p=Gp,fields:f,className:m,debounceWait:h=300})=>{const v=e.useMemo(()=>p??Gp,[p]),[g,x]=e.useState([]),[y,b]=e.useState(""),[w,k]=e.useState(""),[j,N]=e.useState(!1),[C,_]=e.useState();e.useEffect(()=>{const e=setTimeout(()=>{k(y)},h);return()=>clearTimeout(e)},[y,h]);const D=e.useCallback(async()=>{N(!0);try{const e=await o({search:w,modelClass:a,labelName:i,additionalFilters:v,fields:f});x(((e,t,n)=>Array.isArray(e)?e.map(e=>({value:e[n]??e.id??e.pk,label:String(e[t]??e.name??e.pk??""),...e})):[])(e,i,s))}catch(e){console.error("FKSelect fetch error:",e),x([])}finally{N(!1)}},[o,w,a,i,v,f,s]);e.useEffect(()=>{D()},[D]);const S=g.find(e=>String(e.value)===String(d))?.label;e.useEffect(()=>{if(!d)return void _(void 0);if(S)return void _(S);if(!r)return void _(void 0);let e=!0;return r({modelClass:a,value:d}).then(t=>{if(!e||!t)return;const n=String(t[i]??t.name??d);_(n)}).catch(e=>{console.error("FKSelect resolve error:",e)}),()=>{e=!1}},[d,S,r,a,i]);return t.jsx("div",{"data-testid":n,className:Ie("flex w-full min-w-0",m),children:t.jsx(Vp,{items:g,placeholder:l,emptyMessage:c,value:d?String(d):null,onChange:(e,t)=>{t&&u(e,t)},onSearchChange:b,filterLocally:!1,loading:j,displayLabel:C,className:"w-full"})})};function Xp(e,[t,n]){return Math.min(n,Math.max(t,e))}function Qp(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var Jp,ef="dismissableLayer.update",tf="dismissableLayer.pointerDownOutside",nf="dismissableLayer.focusOutside",of=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),rf=r.forwardRef((e,n)=>{const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...u}=e,p=r.useContext(of),[f,m]=r.useState(null),h=f?.ownerDocument??globalThis?.document,[,v]=r.useState({}),g=Rs(n,e=>m(e)),x=Array.from(p.layers),[y]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),b=x.indexOf(y),w=f?x.indexOf(f):-1,k=p.layersWithOutsidePointerEventsDisabled.size>0,j=w>=b,N=r.useRef(!1),C=function(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i}=t,s=Qp(e),l=r.useRef(!1),c=r.useRef(!1),d=r.useRef(new Map),u=r.useRef(()=>{});return r.useEffect(()=>{function e(){c.current=!1,a.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function r(e){if(!c.current)return;const t=e.target;t instanceof Node&&[...i].some(e=>e.contains(t))||d.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&u.current()},0)}function p(e){c.current&&d.current.set(e.type,!1)}const f=r=>{if(r.target&&!l.current){let i=function(){n.removeEventListener("click",u.current);const o=t();e(),o||sf(tf,s,l,{discrete:!0})};const l={originalEvent:r};c.current=!0,a.current=o&&0===r.button,d.current.clear(),o&&0===r.button?(n.removeEventListener("click",u.current),u.current=i,n.addEventListener("click",u.current,{once:!0})):i()}else n.removeEventListener("click",u.current),e();l.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const e of m)n.addEventListener(e,r,!0),n.addEventListener(e,p);const h=window.setTimeout(()=>{n.addEventListener("pointerdown",f)},0);return()=>{window.clearTimeout(h),n.removeEventListener("pointerdown",f),n.removeEventListener("click",u.current);for(const e of m)n.removeEventListener(e,r,!0),n.removeEventListener(e,p)}},[n,s,o,a,i]),{onPointerDownCapture:()=>l.current=!0}}(e=>{const t=e.target;if(!(t instanceof Node))return;const n=[...p.branches].some(e=>e.contains(t));j&&!n&&(s?.(e),c?.(e),e.defaultPrevented||d?.())},{ownerDocument:h,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:p.dismissableSurfaces}),_=function(e,t=globalThis?.document){const n=Qp(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){sf(nf,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{if(a&&N.current)return;const t=e.target;[...p.branches].some(e=>e.contains(t))||(l?.(e),c?.(e),e.defaultPrevented||d?.())},h);return function(e,t=globalThis?.document){const n=Qp(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===p.layers.size-1&&(i?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))},h),r.useEffect(()=>{if(f)return o&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(Jp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(f)),p.layers.add(f),af(),()=>{o&&(p.layersWithOutsidePointerEventsDisabled.delete(f),0===p.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Jp))}},[f,h,o,p]),r.useEffect(()=>()=>{f&&(p.layers.delete(f),p.layersWithOutsidePointerEventsDisabled.delete(f),af())},[f,p]),r.useEffect(()=>{const e=()=>v({});return document.addEventListener(ef,e),()=>document.removeEventListener(ef,e)},[]),t.jsx(Us.div,{...u,ref:g,style:{pointerEvents:k?j?"auto":"none":void 0,...e.style},onFocusCapture:qs(e.onFocusCapture,_.onFocusCapture),onBlurCapture:qs(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:qs(e.onPointerDownCapture,C.onPointerDownCapture)})});rf.displayName="DismissableLayer";function af(){const e=new CustomEvent(ef);document.dispatchEvent(e)}function sf(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Vs(r,a):r.dispatchEvent(a)}r.forwardRef((e,n)=>{const o=r.useContext(of),a=r.useRef(null),i=Rs(n,a);return r.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),t.jsx(Us.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var lf=0,cf=null;function df(){r.useEffect(()=>{cf||(cf={start:uf(),end:uf()});const{start:e,end:t}=cf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),lf++,()=>{1===lf&&(cf?.start.remove(),cf?.end.remove(),cf=null),lf=Math.max(0,lf-1)}},[])}function uf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var pf="focusScope.autoFocusOnMount",ff="focusScope.autoFocusOnUnmount",mf={bubbles:!1,cancelable:!0},hf=r.forwardRef((e,n)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,d]=r.useState(null),u=Qp(i),p=Qp(s),f=r.useRef(null),m=Rs(n,e=>d(e)),h=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(a){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:yf(f.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||yf(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&yf(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return c&&o.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[a,c,h.paused]),r.useEffect(()=>{if(c){bf.add(h);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(pf,mf);c.addEventListener(pf,u),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(yf(o,{select:t}),document.activeElement!==n)return}((e=vf(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&yf(c))}return()=>{c.removeEventListener(pf,u),setTimeout(()=>{const e=new CustomEvent(ff,mf);c.addEventListener(ff,p),c.dispatchEvent(e),e.defaultPrevented||yf(t??document.body,{select:!0}),c.removeEventListener(ff,p),bf.remove(h)},0)}}var e},[c,u,p,h]);const v=r.useCallback(e=>{if(!o&&!a)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=vf(e),n=gf(t,e),o=gf(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&yf(a,{select:!0})):(e.preventDefault(),o&&yf(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return t.jsx(Us.div,{tabIndex:-1,...l,ref:m,onKeyDown:v})});function vf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gf(e,t){for(const n of e)if(!xf(n,{upTo:t}))return n}function xf(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function yf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}hf.displayName="FocusScope";var bf=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=wf(e,t),e.unshift(t)},remove(t){e=wf(e,t),e[0]?.resume()}}}();function wf(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var kf=r.forwardRef((e,n)=>{const{children:o,width:r=10,height:a=5,...i}=e;return t.jsx(Us.svg,{...i,ref:n,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});kf.displayName="Arrow";var jf=kf;function Nf(e){const[t,n]=r.useState(void 0);return Ys(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,a;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var Cf="Popper",[_f,Df]=Es(Cf),[Sf,Ef]=_f(Cf),Mf=e=>{const{__scopePopper:n,children:o}=e,[a,i]=r.useState(null),[s,l]=r.useState(void 0);return t.jsx(Sf,{scope:n,anchor:a,onAnchorChange:i,placementState:s,setPlacementState:l,children:o})};Mf.displayName=Cf;var Of="PopperAnchor",Tf=r.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:a,...i}=e,s=Ef(Of,o),l=r.useRef(null),c=s.onAnchorChange,d=Rs(n,r.useCallback(e=>{l.current=e,e&&c(e)},[c])),u=r.useRef(null);r.useEffect(()=>{if(!a)return;const e=u.current;u.current=a.current,e!==u.current&&c(u.current)});const p=s.placementState&&$f(s.placementState),f=p?.[0],m=p?.[1];return a?null:t.jsx(Us.div,{"data-radix-popper-side":f,"data-radix-popper-align":m,...i,ref:d})});Tf.displayName=Of;var Rf="PopperContent",[Pf,Af]=_f(Rf),If=r.forwardRef((e,n)=>{const{__scopePopper:o,side:a="bottom",sideOffset:i=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=e,x=Ef(Rf,o),[y,b]=r.useState(null),w=Rs(n,e=>b(e)),[k,j]=r.useState(null),N=Nf(k),C=N?.width??0,_=N?.height??0,D=a+("center"!==s?"-"+s:""),S="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},E=Array.isArray(u)?u:[u],M=E.length>0,O={padding:S,boundary:E.filter(Wf),altBoundary:M},{refs:T,floatingStyles:R,placement:P,isPositioned:A,middlewareData:I}=qu({strategy:"fixed",placement:D,whileElementsMounted:(...e)=>Eu(...e,{animationFrame:"always"===h}),elements:{reference:x.anchor},middleware:[Hu({mainAxis:i+_,alignmentAxis:l}),d&&Ku({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Uu():void 0,...O}),d&&Vu({...O}),Gu({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),k&&Xu({element:k,padding:c}),Bf({arrowWidth:C,arrowHeight:_}),m&&Zu({strategy:"referenceHidden",...O,boundary:M?O.boundary:void 0})]}),F=x.setPlacementState;Ys(()=>(F(P),()=>{F(void 0)}),[P,F]);const[z,L]=$f(P),W=Qp(v);Ys(()=>{A&&W?.()},[A,W]);const B=I.arrow?.x,$=I.arrow?.y,q=0!==I.arrow?.centerOffset,[Y,H]=r.useState();return Ys(()=>{y&&H(window.getComputedStyle(y).zIndex)},[y]),t.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:A?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Pf,{scope:o,placedSide:z,placedAlign:L,onArrowChange:j,arrowX:B,arrowY:$,shouldHideArrow:q,children:t.jsx(Us.div,{"data-side":z,"data-align":L,...g,ref:w,style:{...g.style,animation:A?void 0:"none"}})})})});If.displayName=Rf;var Ff="PopperArrow",zf={top:"bottom",right:"left",bottom:"top",left:"right"},Lf=r.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,a=Af(Ff,o),i=zf[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(jf,{...r,ref:n,style:{...r.style,display:"block"}})})});function Wf(e){return null!==e}Lf.displayName=Ff;var Bf=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=$f(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(r.arrow?.x??0)+i/2,p=(r.arrow?.y??0)+s/2;let f="",m="";return"bottom"===l?(f=a?d:`${u}px`,m=-s+"px"):"top"===l?(f=a?d:`${u}px`,m=`${o.floating.height+s}px`):"right"===l?(f=-s+"px",m=a?d:`${p}px`):"left"===l&&(f=`${o.floating.width+s}px`,m=a?d:`${p}px`),{data:{x:f,y:m}}}});function $f(e){const[t,n="center"]=e.split("-");return[t,n]}var qf=Mf,Yf=Tf,Hf=If,Kf=Lf,Uf=r.forwardRef((e,n)=>{const{container:o,...i}=e,[s,l]=r.useState(!1);Ys(()=>l(!0),[]);const c=o||s&&globalThis?.document?.body;return c?a.createPortal(t.jsx(Us.div,{...i,ref:n}),c):null});function Vf(e){const t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Uf.displayName="Portal";var Gf=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"}),Zf=r.forwardRef((e,n)=>t.jsx(Us.span,{...e,ref:n,style:{...Gf,...e.style}}));Zf.displayName="VisuallyHidden";var Xf=Zf,Qf=[" ","Enter","ArrowUp","ArrowDown"],Jf=[" ","Enter"],em="Select",[tm,nm,om]=$s(em),[rm]=Es(em,[om,Df]),am=Df(),[im,sm]=rm(em),[lm,cm]=rm(em);function dm(e){const{__scopeSelect:n,children:o,open:a,defaultOpen:i,onOpenChange:s,value:l,defaultValue:c,onValueChange:d,dir:u,name:p,autoComplete:f,disabled:m,required:h,form:v,internal_do_not_use_render:g}=e,x=am(n),[y,b]=r.useState(null),[w,k]=r.useState(null),[j,N]=r.useState(!1),C=gl(u),[_,D]=Ks({prop:a,defaultProp:i??!1,onChange:s,caller:em}),[S,E]=Ks({prop:l,defaultProp:c,onChange:d,caller:em}),M=r.useRef(null),O=!y||(!!v||!!y.closest("form")),[T,R]=r.useState(new Set),P=el(),A=Array.from(T).map(e=>e.props.value).join(";"),I=r.useCallback(e=>{R(t=>new Set(t).add(e))},[]),F=r.useCallback(e=>{R(t=>{const n=new Set(t);return n.delete(e),n})},[]),z={required:h,trigger:y,onTriggerChange:b,valueNode:w,onValueNodeChange:k,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:P,value:S,onValueChange:E,open:_,onOpenChange:D,dir:C,triggerPointerDownPosRef:M,disabled:m,name:p,autoComplete:f,form:v,nativeOptions:T,nativeSelectKey:A,isFormControl:O};return t.jsx(qf,{...x,children:t.jsx(im,{scope:n,...z,children:t.jsx(tm.Provider,{scope:n,children:t.jsx(lm,{scope:n,onNativeOptionAdd:I,onNativeOptionRemove:F,children:rh(g)?g(z):o})})})})}dm.displayName="SelectProvider";var um=e=>{const{__scopeSelect:n,children:o,...r}=e;return t.jsx(dm,{__scopeSelect:n,...r,internal_do_not_use_render:({isFormControl:e})=>t.jsxs(t.Fragment,{children:[o,e?t.jsx(oh,{__scopeSelect:n}):null]})})};um.displayName=em;var pm="SelectTrigger",fm=r.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:a=!1,...i}=e,s=am(o),l=sm(pm,o),c=l.disabled||a,d=Rs(n,l.onTriggerChange),u=nm(o),p=r.useRef("touch"),[f,m,h]=ih(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),o=sh(t,e,n);void 0!==o&&l.onValueChange(o.value)}),v=e=>{c||(l.onOpenChange(!0),h()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(Yf,{asChild:!0,...s,children:t.jsx(Us.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ah(l.value)?"":void 0,...i,ref:d,onClick:qs(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:qs(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:qs(i.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),t&&" "===e.key||Qf.includes(e.key)&&(v(),e.preventDefault())})})})});fm.displayName=pm;var mm="SelectValue",hm=r.forwardRef((e,n)=>{const{__scopeSelect:o,className:a,style:i,children:s,placeholder:l="",...c}=e,d=sm(mm,o),{onValueNodeHasChildrenChange:u}=d,p=void 0!==s,f=Rs(n,d.onValueNodeChange);Ys(()=>{u(p)},[u,p]);const m=ah(d.value);return t.jsx(Us.span,{...c,asChild:!m&&c.asChild,ref:f,style:{pointerEvents:"none"},children:t.jsx(r.Fragment,{children:m?l:s},m?"placeholder":"value")})});hm.displayName=mm;var vm=r.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,...a}=e;return t.jsx(Us.span,{"aria-hidden":!0,...a,ref:n,children:r||"▼"})});vm.displayName="SelectIcon";var gm="SelectPortal",[xm,ym]=rm(gm,{forceMount:void 0}),bm=e=>{const{__scopeSelect:n,forceMount:o,...r}=e;return t.jsx(xm,{scope:e.__scopeSelect,forceMount:o,children:t.jsx(Uf,{asChild:!0,...r})})};bm.displayName=gm;var wm="SelectContent",km=r.forwardRef((e,n)=>{const o=ym(wm,e.__scopeSelect),{forceMount:a=o.forceMount,...i}=e,s=sm(wm,e.__scopeSelect),[l,c]=r.useState();return Ys(()=>{c(new DocumentFragment)},[]),t.jsx(Gs,{present:a||s.open,children:({present:e})=>e?t.jsx(Sm,{...i,ref:n}):t.jsx(jm,{...i,fragment:l})})});km.displayName=wm;var jm=r.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,fragment:i}=e;return i?a.createPortal(t.jsx(Cm,{scope:o,children:t.jsx(tm.Slot,{scope:o,children:t.jsx("div",{ref:n,children:r})})}),i):null});jm.displayName="SelectContentFragment";var Nm=10,[Cm,_m]=rm(wm),Dm=Ps("SelectContent.RemoveScroll"),Sm=r.forwardRef((e,n)=>{const{__scopeSelect:o}=e,{position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:x,...y}=e,b=sm(wm,o),[w,k]=r.useState(null),[j,N]=r.useState(null),C=Rs(n,e=>k(e)),[_,D]=r.useState(null),[S,E]=r.useState(null),M=nm(o),[O,T]=r.useState(!1),R=r.useRef(!1);r.useEffect(()=>{if(w)return ir(w)},[w]),df();const P=r.useCallback(e=>{const[t,...n]=M().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&j&&(j.scrollTop=0),n===o&&j&&(j.scrollTop=j.scrollHeight),n?.focus(),document.activeElement!==r)return}},[M,j]),A=r.useCallback(()=>P([_,w]),[P,_,w]);r.useEffect(()=>{O&&A()},[O,A]);const{onOpenChange:I,triggerPointerDownPosRef:F}=b;r.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(w)||I(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,I,F]),r.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[z,L]=ih(e=>{const t=M().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=sh(t,e,n);o&&setTimeout(()=>o.ref.current?.focus())}),W=r.useCallback((e,t,n)=>{const o=!R.current&&!n;(void 0!==b.value&&b.value===t||o)&&(D(e),o&&(R.current=!0))},[b.value]),B=r.useCallback(()=>w?.focus(),[w]),$=r.useCallback((e,t,n)=>{const o=!R.current&&!n;(void 0!==b.value&&b.value===t||o)&&E(e)},[b.value]),q="popper"===a?Mm:Em,Y=q===Mm?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:x}:{};return t.jsx(Cm,{scope:o,content:w,viewport:j,onViewportChange:N,itemRefCallback:W,selectedItem:_,onItemLeave:B,itemTextRefCallback:$,focusSelectedItem:A,selectedItemText:S,position:a,isPositioned:O,searchRef:z,children:t.jsx(Jo,{as:Dm,allowPinchZoom:!0,children:t.jsx(hf,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:qs(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(rf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:t.jsx(q,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...Y,onPlaced:()=>T(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:qs(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})});Sm.displayName="SelectContentImpl";var Em=r.forwardRef((e,n)=>{const{__scopeSelect:o,onPlaced:a,...i}=e,s=sm(wm,o),l=_m(wm,o),[c,d]=r.useState(null),[u,p]=r.useState(null),f=Rs(n,e=>p(e)),m=nm(o),h=r.useRef(!1),v=r.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:y,focusSelectedItem:b}=l,w=r.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&g&&x&&y){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),o=y.getBoundingClientRect();if("rtl"!==s.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-Nm,u=Xp(a,[Nm,Math.max(Nm,d-l)]);c.style.minWidth=s+"px",c.style.left=u+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-Nm,u=Xp(a,[Nm,Math.max(Nm,d-l)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const r=m(),i=window.innerHeight-2*Nm,l=g.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),f=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),b=p+f+l+parseInt(d.paddingBottom,10)+v,w=Math.min(5*x.offsetHeight,b),k=window.getComputedStyle(g),j=parseInt(k.paddingTop,10),N=parseInt(k.paddingBottom,10),C=e.top+e.height/2-Nm,_=i-C,D=x.offsetHeight/2,S=p+f+(x.offsetTop+D),E=b-S;if(S<=C){const e=r.length>0&&x===r[r.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=S+Math.max(_,D+(e?N:0)+t+v);c.style.height=n+"px"}else{const e=r.length>0&&x===r[0].ref.current;c.style.top="0px";const t=Math.max(C,p+g.offsetTop+(e?j:0)+D)+E;c.style.height=t+"px",g.scrollTop=S-C+g.offsetTop}c.style.margin=`${Nm}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,c,u,g,x,y,s.dir,a]);Ys(()=>w(),[w]);const[k,j]=r.useState();Ys(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const N=r.useCallback(e=>{e&&!0===v.current&&(w(),b?.(),v.current=!1)},[w,b]);return t.jsx(Om,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:t.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:t.jsx(Us.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Em.displayName="SelectItemAlignedPosition";var Mm=r.forwardRef((e,n)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=Nm,...i}=e,s=am(o);return t.jsx(Hf,{...s,...i,ref:n,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Mm.displayName="SelectPopperPosition";var[Om,Tm]=rm(wm,{}),Rm="SelectViewport",Pm=r.forwardRef((e,n)=>{const{__scopeSelect:o,nonce:a,...i}=e,s=_m(Rm,o),l=Tm(Rm,o),c=Rs(n,s.onViewportChange),d=r.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),t.jsx(tm.Slot,{scope:o,children:t.jsx(Us.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qs(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=l;if(o?.current&&n){const e=Math.abs(d.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*Nm,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(r,a);if(i<o){const r=i+e,a=Math.min(o,r),s=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});Pm.displayName=Rm;var Am="SelectGroup",[Im,Fm]=rm(Am),zm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=el();return t.jsx(Im,{scope:o,id:a,children:t.jsx(Us.div,{role:"group","aria-labelledby":a,...r,ref:n})})});zm.displayName=Am;var Lm="SelectLabel",Wm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=Fm(Lm,o);return t.jsx(Us.div,{id:a.id,...r,ref:n})});Wm.displayName=Lm;var Bm="SelectItem",[$m,qm]=rm(Bm),Ym=r.forwardRef((e,n)=>{const{__scopeSelect:o,value:a,disabled:i=!1,textValue:s,...l}=e,c=sm(Bm,o),d=_m(Bm,o),u=c.value===a,[p,f]=r.useState(s??""),[m,h]=r.useState(!1),v=Rs(n,e=>d.itemRefCallback?.(e,a,i)),g=el(),x=r.useRef("touch"),y=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};return t.jsx($m,{scope:o,value:a,disabled:i,textId:g,isSelected:u,onItemTextChange:r.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:t.jsx(tm.ItemSlot,{scope:o,value:a,disabled:i,textValue:p,children:t.jsx(Us.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:v,onFocus:qs(l.onFocus,()=>h(!0)),onBlur:qs(l.onBlur,()=>h(!1)),onClick:qs(l.onClick,()=>{"mouse"!==x.current&&y()}),onPointerUp:qs(l.onPointerUp,()=>{"mouse"===x.current&&y()}),onPointerDown:qs(l.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:qs(l.onPointerMove,e=>{x.current=e.pointerType,i?d.onItemLeave?.():"mouse"===x.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qs(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:qs(l.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(Jf.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});Ym.displayName=Bm;var Hm="SelectItemText",Km=r.forwardRef((e,n)=>{const{__scopeSelect:o,className:i,style:s,...l}=e,c=sm(Hm,o),d=_m(Hm,o),u=qm(Hm,o),p=cm(Hm,o),[f,m]=r.useState(null),h=Rs(n,e=>m(e),u.onItemTextChange,e=>d.itemTextRefCallback?.(e,u.value,u.disabled)),v=f?.textContent,g=r.useMemo(()=>t.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:x,onNativeOptionRemove:y}=p;return Ys(()=>(x(g),()=>y(g)),[x,y,g]),t.jsxs(t.Fragment,{children:[t.jsx(Us.span,{id:u.textId,...l,ref:h}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!ah(c.value)?a.createPortal(l.children,c.valueNode):null]})});Km.displayName=Hm;var Um="SelectItemIndicator",Vm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return qm(Um,o).isSelected?t.jsx(Us.span,{"aria-hidden":!0,...r,ref:n}):null});Vm.displayName=Um;var Gm="SelectScrollUpButton",Zm=r.forwardRef((e,n)=>{const o=_m(Gm,e.__scopeSelect),a=Tm(Gm,e.__scopeSelect),[i,s]=r.useState(!1),l=Rs(n,a.onScrollButtonChange);return Ys(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t.jsx(Jm,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Zm.displayName=Gm;var Xm="SelectScrollDownButton",Qm=r.forwardRef((e,n)=>{const o=_m(Xm,e.__scopeSelect),a=Tm(Xm,e.__scopeSelect),[i,s]=r.useState(!1),l=Rs(n,a.onScrollButtonChange);return Ys(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t.jsx(Jm,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Qm.displayName=Xm;var Jm=r.forwardRef((e,n)=>{const{__scopeSelect:o,onAutoScroll:a,...i}=e,s=_m("SelectScrollButton",o),l=r.useRef(null),c=nm(o),d=r.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>d(),[d]),Ys(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),t.jsx(Us.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:qs(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:qs(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:qs(i.onPointerLeave,()=>{d()})})}),eh=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return t.jsx(Us.div,{"aria-hidden":!0,...r,ref:n})});eh.displayName="SelectSeparator";var th="SelectArrow";r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=am(o);return"popper"===_m(th,o).position?t.jsx(Kf,{...a,...r,ref:n}):null}).displayName=th;var nh="SelectBubbleInput",oh=r.forwardRef(({__scopeSelect:e,...n},o)=>{const a=sm(nh,e),{value:i,onValueChange:s,required:l,disabled:c,name:d,autoComplete:u,form:p}=a,{nativeOptions:f,nativeSelectKey:m}=a,h=r.useRef(null),v=Rs(o,h),g=i??"",x=Vf(g),y=Array.from(f).some(e=>""===(e.props.value??""));return r.useEffect(()=>{const e=h.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(x!==g&&n){const t=new Event("change",{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[x,g]),t.jsxs(Us.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:d,autoComplete:u,disabled:c,form:p,onChange:e=>s(e.target.value),...n,style:{...Gf,...n.style},ref:v,defaultValue:g,children:[ah(i)&&!y?t.jsx("option",{value:""}):null,Array.from(f)]},m)});function rh(e){return"function"==typeof e}function ah(e){return""===e||void 0===e}function ih(e){const t=Qp(e),n=r.useRef(""),o=r.useRef(0),a=r.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),i=r.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,a,i]}function sh(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let a=(i=e,s=Math.max(r,0),i.map((e,t)=>i[(s+t)%i.length]));var i,s;1===o.length&&(a=a.filter(e=>e!==n));const l=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}oh.displayName=nh;const lh=um,ch=zm,dh=hm,uh=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(fm,{ref:r,"data-slot":"select-trigger",className:Ie(We,"justify-between whitespace-nowrap data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1",e),...o,children:[n,t.jsx(vm,{asChild:!0,children:t.jsx(ti,{className:"h-4 w-4 opacity-50"})})]}));uh.displayName=fm.displayName;const ph=r.forwardRef(({className:e,...n},o)=>t.jsx(Zm,{ref:o,"data-slot":"select-scroll-up-button",className:Ie("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(ri,{className:"h-4 w-4"})}));ph.displayName=Zm.displayName;const fh=r.forwardRef(({className:e,...n},o)=>t.jsx(Qm,{ref:o,"data-slot":"select-scroll-down-button",className:Ie("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(ti,{className:"h-4 w-4"})}));fh.displayName=Qm.displayName;const mh=r.forwardRef(({className:e,children:n,position:o="popper",...r},a)=>t.jsx(bm,{children:t.jsxs(km,{ref:a,"data-slot":"select-content",className:Ie("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 origin-[--radix-select-content-transform-origin]","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...r,children:[t.jsx(ph,{}),t.jsx(Pm,{className:Ie("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(fh,{})]})}));mh.displayName=km.displayName;const hh=r.forwardRef(({className:e,...n},o)=>t.jsx(Wm,{ref:o,"data-slot":"select-label",className:Ie("px-2 py-1.5 text-sm font-semibold",e),...n}));hh.displayName=Wm.displayName;const vh=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(Ym,{ref:r,"data-slot":"select-item",className:Ie("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Vm,{children:t.jsx(ei,{className:"h-4 w-4"})})}),t.jsx(Km,{children:n})]}));vh.displayName=Ym.displayName;const gh=r.forwardRef(({className:e,...n},o)=>t.jsx(eh,{ref:o,"data-slot":"select-separator",className:Ie("-mx-1 my-1 h-px bg-muted",e),...n}));gh.displayName=eh.displayName;const xh=({id:n,placeholder:o,options:r,className:a,value:i,onValueChange:s,required:l,name:c})=>{const[d,u]=e.useState(i||"");e.useEffect(()=>{u(i||"")},[i]);const p=i??d;return t.jsxs(t.Fragment,{children:[c?t.jsx("input",{type:"hidden",name:c,value:p,required:l}):null,t.jsx("div",{className:Ie("flex w-full min-w-0",a),children:t.jsxs(lh,{value:p||void 0,onValueChange:e=>{u(e),s?.(e)},children:[t.jsx(uh,{"data-testid":n,className:"w-full",children:t.jsx(dh,{placeholder:o})}),t.jsx(mh,{children:(r??[]).map(e=>t.jsx(vh,{"data-testid":e.value,value:e.value,className:Ie("cursor-pointer",$e,d===e.value?"bg-accent text-accent-foreground":""),children:e.label},e.value))})]})})]})},yh=6048e5,bh=Symbol.for("constructDateFrom");function wh(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&bh in e?e[bh](t):e instanceof Date?new e.constructor(t):new Date(t)}function kh(e,t){return wh(t||e,e)}function jh(e,t,n){const o=kh(e,n?.in);return isNaN(t)?wh(e,NaN):t?(o.setDate(o.getDate()+t),o):o}function Nh(e,t,n){const o=kh(e,n?.in);if(isNaN(t))return wh(e,NaN);if(!t)return o;const r=o.getDate(),a=wh(e,o.getTime());a.setMonth(o.getMonth()+t+1,0);return r>=a.getDate()?a:(o.setFullYear(a.getFullYear(),a.getMonth(),r),o)}let Ch={};function _h(){return Ch}function Dh(e,t){const n=_h(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=kh(e,t?.in),a=r.getDay(),i=(a<o?7:0)+a-o;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Sh(e,t){return Dh(e,{...t,weekStartsOn:1})}function Eh(e,t){const n=kh(e,t?.in),o=n.getFullYear(),r=wh(n,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const a=Sh(r),i=wh(n,0);i.setFullYear(o,0,4),i.setHours(0,0,0,0);const s=Sh(i);return n.getTime()>=a.getTime()?o+1:n.getTime()>=s.getTime()?o:o-1}function Mh(e){const t=kh(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Oh(e,...t){const n=wh.bind(null,t.find(e=>"object"==typeof e));return t.map(n)}function Th(e,t){const n=kh(e,t?.in);return n.setHours(0,0,0,0),n}function Rh(e,t,n){const[o,r]=Oh(0,e,t),a=Th(o),i=Th(r),s=+a-Mh(a),l=+i-Mh(i);return Math.round((s-l)/864e5)}function Ph(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Ah(e,t,n){const[o,r]=Oh(0,e,t);return 12*(o.getFullYear()-r.getFullYear())+(o.getMonth()-r.getMonth())}function Ih(e,t){const[n,o]=Oh(0,t.start,t.end);return{start:n,end:o}}function Fh(e,t){const n=kh(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function zh(e,t){const n=_h(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=kh(e,t?.in),a=r.getDay(),i=6+(a<o?-7:0)-(a-o);return r.setDate(r.getDate()+i),r.setHours(23,59,59,999),r}const Lh={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Wh(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Bh={date:Wh({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Wh({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Wh({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$h={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function qh(e){return(t,n)=>{let o;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;o=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;o=e.values[r]||e.values[t]}return o[e.argumentCallback?e.argumentCallback(t):t]}}const Yh={ordinalNumber:(e,t)=>{const n=Number(e),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:qh({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:qh({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:qh({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:qh({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:qh({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function Hh(e){return(t,n={})=>{const o=n.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],a=t.match(r);if(!a)return null;const i=a[0],s=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,e=>e.test(i)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,e=>e.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}const Kh={ordinalNumber:(Uh={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(Uh.matchPattern);if(!n)return null;const o=n[0],r=e.match(Uh.parsePattern);if(!r)return null;let a=Uh.valueCallback?Uh.valueCallback(r[0]):r[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(o.length)}}),era:Hh({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Hh({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Hh({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Hh({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Hh({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var Uh;const Vh={code:"en-US",formatDistance:(e,t,n)=>{let o;const r=Lh[e];return o="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o},formatLong:Bh,formatRelative:(e,t,n,o)=>$h[e],localize:Yh,match:Kh,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Gh(e,t){const n=kh(e,t?.in),o=+Sh(n)-+function(e,t){const n=Eh(e,t),o=wh(e,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),Sh(o)}(n);return Math.round(o/yh)+1}function Zh(e,t){const n=kh(e,t?.in),o=n.getFullYear(),r=_h(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=wh(t?.in||e,0);i.setFullYear(o+1,0,a),i.setHours(0,0,0,0);const s=Dh(i,t),l=wh(t?.in||e,0);l.setFullYear(o,0,a),l.setHours(0,0,0,0);const c=Dh(l,t);return+n>=+s?o+1:+n>=+c?o:o-1}function Xh(e,t){const n=kh(e,t?.in),o=+Dh(n,t)-+function(e,t){const n=_h(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Zh(e,t),a=wh(t?.in||e,0);return a.setFullYear(r,0,o),a.setHours(0,0,0,0),Dh(a,t)}(n,t);return Math.round(o/yh)+1}function Qh(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Jh={y(e,t){const n=e.getFullYear(),o=n>0?n:1-n;return Qh("yy"===t?o%100:o,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):Qh(n+1,2)},d:(e,t)=>Qh(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>Qh(e.getHours()%12||12,t.length),H:(e,t)=>Qh(e.getHours(),t.length),m:(e,t)=>Qh(e.getMinutes(),t.length),s:(e,t)=>Qh(e.getSeconds(),t.length),S(e,t){const n=t.length,o=e.getMilliseconds();return Qh(Math.trunc(o*Math.pow(10,n-3)),t.length)}},ev="midnight",tv="noon",nv="morning",ov="afternoon",rv="evening",av="night",iv={G:function(e,t,n){const o=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});default:return n.era(o,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),o=t>0?t:1-t;return n.ordinalNumber(o,{unit:"year"})}return Jh.y(e,t)},Y:function(e,t,n,o){const r=Zh(e,o),a=r>0?r:1-r;if("YY"===t){return Qh(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):Qh(a,t.length)},R:function(e,t){return Qh(Eh(e),t.length)},u:function(e,t){return Qh(e.getFullYear(),t.length)},Q:function(e,t,n){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return Qh(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,t,n){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return Qh(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,t,n){const o=e.getMonth();switch(t){case"M":case"MM":return Jh.M(e,t);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(e,t,n){const o=e.getMonth();switch(t){case"L":return String(o+1);case"LL":return Qh(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(e,t,n,o){const r=Xh(e,o);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):Qh(r,t.length)},I:function(e,t,n){const o=Gh(e);return"Io"===t?n.ordinalNumber(o,{unit:"week"}):Qh(o,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Jh.d(e,t)},D:function(e,t,n){const o=function(e,t){const n=kh(e,t?.in);return Rh(n,Fh(n))+1}(e);return"Do"===t?n.ordinalNumber(o,{unit:"dayOfYear"}):Qh(o,t.length)},E:function(e,t,n){const o=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(e,t,n,o){const r=e.getDay(),a=(r-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Qh(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,o){const r=e.getDay(),a=(r-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Qh(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const o=e.getDay(),r=0===o?7:o;switch(t){case"i":return String(r);case"ii":return Qh(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const o=e.getHours();let r;switch(r=12===o?tv:0===o?ev:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const o=e.getHours();let r;switch(r=o>=17?rv:o>=12?ov:o>=4?nv:av,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return Jh.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Jh.H(e,t)},K:function(e,t,n){const o=e.getHours()%12;return"Ko"===t?n.ordinalNumber(o,{unit:"hour"}):Qh(o,t.length)},k:function(e,t,n){let o=e.getHours();return 0===o&&(o=24),"ko"===t?n.ordinalNumber(o,{unit:"hour"}):Qh(o,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Jh.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Jh.s(e,t)},S:function(e,t){return Jh.S(e,t)},X:function(e,t,n){const o=e.getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return lv(o);case"XXXX":case"XX":return cv(o);default:return cv(o,":")}},x:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"x":return lv(o);case"xxxx":case"xx":return cv(o);default:return cv(o,":")}},O:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+sv(o,":");default:return"GMT"+cv(o,":")}},z:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+sv(o,":");default:return"GMT"+cv(o,":")}},t:function(e,t,n){return Qh(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return Qh(+e,t.length)}};function sv(e,t=""){const n=e>0?"-":"+",o=Math.abs(e),r=Math.trunc(o/60),a=o%60;return 0===a?n+String(r):n+String(r)+t+Qh(a,2)}function lv(e,t){if(e%60==0){return(e>0?"-":"+")+Qh(Math.abs(e)/60,2)}return cv(e,t)}function cv(e,t=""){const n=e>0?"-":"+",o=Math.abs(e);return n+Qh(Math.trunc(o/60),2)+t+Qh(o%60,2)}const dv=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},uv=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},pv={p:uv,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],o=n[1],r=n[2];if(!r)return dv(e,t);let a;switch(o){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",dv(o,t)).replace("{{time}}",uv(r,t))}},fv=/^D+$/,mv=/^Y+$/,hv=["D","DD","YY","YYYY"];const vv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xv=/^'([^]*?)'?$/,yv=/''/g,bv=/[a-zA-Z]/;function wv(e,t,n){const o=_h(),r=n?.locale??o.locale??Vh,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,s=kh(e,n?.in);if(!function(e){return!(!Ph(e)&&"number"!=typeof e||isNaN(+kh(e)))}(s))throw new RangeError("Invalid time value");let l=t.match(gv).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,pv[t])(e,r.formatLong)}return e}).join("").match(vv).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:kv(e)};if(iv[t])return{isToken:!0,value:e};if(t.match(bv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(l=r.localize.preprocessor(s,l));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:r};return l.map(o=>{if(!o.isToken)return o.value;const a=o.value;(!n?.useAdditionalWeekYearTokens&&function(e){return mv.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return fv.test(e)}(a))&&function(e,t,n){const o=function(e,t,n){const o="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(o),hv.includes(e))throw new RangeError(o)}(a,t,String(e));return(0,iv[a[0]])(s,a,r.localize,c)}).join("")}function kv(e){const t=e.match(xv);return t?t[1].replace(yv,"'"):e}function jv(e,t,n){const o=kh(e,n?.in),r=o.getFullYear(),a=o.getDate(),i=wh(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=function(e,t){const n=kh(e,t?.in),o=n.getFullYear(),r=n.getMonth(),a=wh(n,0);return a.setFullYear(o,r+1,0),a.setHours(0,0,0,0),a.getDate()}(i);return o.setMonth(t,Math.min(a,s)),o}const Nv={},Cv={};function _v(e,t){try{const n=(Nv[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in Cv?Cv[n]:Sv(n,n.split(":"))}catch{if(e in Cv)return Cv[e];const t=e?.match(Dv);return t?Sv(e,t.slice(1)):NaN}}const Dv=/([+-]\d\d):?(\d\d)?/;function Sv(e,t){const n=+(t[0]||0),o=+(t[1]||0),r=+(t[2]||0)/60;return Cv[e]=60*n+o>0?60*n+o+r:60*n-o-r}class Ev extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(_v(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Tv(this),Ov(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Ev(...t,e):new Ev(Date.now(),e)}withTimeZone(e){return new Ev(+this,e)}getTimezoneOffset(){const e=-_v(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Ov(this),+this}[Symbol.for("constructDateFrom")](e){return new Ev(+new Date(e),this.timeZone)}}const Mv=/^(get|set)(?!UTC)/;function Ov(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(60*-_v(e.timeZone,e)))}function Tv(e){const t=_v(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),o=new Date(+e);o.setUTCHours(o.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),a=r- -new Date(+o).getTimezoneOffset(),i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const s=r-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const l=new Date(+e);l.setUTCSeconds(0);const c=r>0?l.getSeconds():(l.getSeconds()-60)%60,d=Math.round(-60*_v(e.timeZone,e))%60;(d||c)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+c));const u=_v(e.timeZone,e),p=u>0?Math.floor(u):Math.ceil(u),f=-new Date(+e).getTimezoneOffset()-p-s;if(p!==n&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);const t=_v(e.timeZone,e),n=p-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Mv.test(e))return;const t=e.replace(Mv,"$1UTC");Ev.prototype[t]&&(e.startsWith("get")?Ev.prototype[e]=function(){return this.internal[t]()}:(Ev.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Tv(e),+this},Ev.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ov(this),+this}))});class Rv extends Ev{static tz(e,...t){return t.length?new Rv(...t,e):new Rv(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),o=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,o]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${o}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,o]=this.tzComponents();return`${e} GMT${t}${n}${o} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new Rv(+this,e)}[Symbol.for("constructDateFrom")](e){return new Rv(+new Date(e),this.timeZone)}}function Pv(e,t){const n=t.startOfMonth(e),o=n.getDay();return 1===o?n:0===o?t.addDays(n,-6):t.addDays(n,-1*(o-1))}const Av={...Vh,labels:{labelDayButton:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>wv(e,t,{locale:Vh,...n});let a=r(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let o;return o=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>wv(e,n,{locale:Vh,...t}),o(e,"LLLL yyyy")},labelGridcell:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>wv(e,t,{locale:Vh,...n});let a=r(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let o;return o=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>wv(e,n,{locale:Vh,...t}),o(e,"cccc")}}};class Iv{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Rv.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new Rv(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):jh(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):Nh(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return jh(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return Nh(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):Rh(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):Ah(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):function(e){const{start:t,end:n}=Ih(0,e);let o=+t>+n;const r=o?+t:+n,a=o?n:t;a.setHours(0,0,0,0),a.setDate(1);const i=[];for(;+a<=r;)i.push(wh(t,a)),a.setMonth(a.getMonth()+1);return o?i.reverse():i}(e),this.eachYearOfInterval=e=>{const t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):function(e){const{start:t,end:n}=Ih(0,e);let o=+t>+n;const r=o?+t:+n,a=o?n:t;a.setHours(0,0,0,0),a.setMonth(0,1);const i=[];for(;+a<=r;)i.push(wh(t,a)),a.setFullYear(a.getFullYear()+1);return o?i.reverse():i}(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;const o=[];return n.forEach(e=>{o.push(new Date(e,0,1))}),o},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):function(e,t){const n=Pv(e,t),o=function(e,t){const n=t.startOfMonth(e),o=n.getDay()>0?n.getDay():7,r=t.addDays(e,1-o),a=t.addDays(r,34);return t.getMonth(e)===t.getMonth(a)?5:4}(e,t);return t.addDays(n,7*o-1)}(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):function(e,t){return zh(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):function(e,t){const n=kh(e,t?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):zh(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=kh(e,t?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}(e),this.format=(e,t,n)=>{const o=this.overrides?.format?this.overrides.format(e,t,this.options):wv(e,t,this.options);return this.options.numerals&&"latn"!==this.options.numerals?this.replaceDigits(o):o},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):Gh(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):function(e,t){return kh(e,t?.in).getMonth()}(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):function(e,t){return kh(e,t?.in).getFullYear()}(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):Xh(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):function(e,t){return+kh(e)>+kh(t)}(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):function(e,t){return+kh(e)<+kh(t)}(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):Ph(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):function(e,t){const[n,o]=Oh(0,e,t);return+Th(n)===+Th(o)}(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t){const[n,o]=Oh(0,e,t);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()}(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):function(e,t){const[n,o]=Oh(0,e,t);return n.getFullYear()===o.getFullYear()}(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):function(e,t){let n,o=t?.in;return e.forEach(e=>{o||"object"!=typeof e||(o=wh.bind(null,e));const t=kh(e,o);(!n||n<t||isNaN(+t))&&(n=t)}),wh(o,n||NaN)}(e),this.min=e=>this.overrides?.min?this.overrides.min(e):function(e,t){let n,o=t?.in;return e.forEach(e=>{o||"object"!=typeof e||(o=wh.bind(null,e));const t=kh(e,o);(!n||n>t||isNaN(+t))&&(n=t)}),wh(o,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):jv(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const o=kh(e,n?.in);return isNaN(+o)?wh(e,NaN):(o.setFullYear(t),o)}(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):Pv(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):Th(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):Sh(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):function(e,t){const n=kh(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):Dh(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):Fh(e),this.options={locale:Av,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&Iv.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:n,numerals:o}=this.options,r=t?.code;if(r&&Iv.yearFirstLocales.has(r))try{const t=new Intl.DateTimeFormat(r,{month:"long",year:"numeric",timeZone:n,numberingSystem:o});return t.format(e)}catch{}const a="year-first"===this.getMonthYearOrder()?"y LLLL":"LLLL y";return this.format(e,a)}}Iv.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Fv=new Iv;class zv{constructor(e,t,n=Fv){this.date=e,this.displayMonth=t,this.outside=Boolean(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,"yyyy-MM-dd"),this.displayMonthId=n.format(t,"yyyy-MM"),this.dateMonthId=n.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class Lv{constructor(e,t){this.date=e,this.weeks=t}}class Wv{constructor(e,t){this.days=t,this.weekNumber=e}}var Bv,$v,qv,Yv;!function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"}(Bv||(Bv={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}($v||($v={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(qv||(qv={})),function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"}(Yv||(Yv={}));const Hv=e.createContext(void 0);function Kv(){const t=e.useContext(Hv);if(void 0===t)throw new Error("useDayPicker() must be used within a custom component.");return t}var Uv=Object.freeze({__proto__:null,Button:function(t){return e.createElement("button",{...t})},CaptionLabel:function(t){return e.createElement("span",{...t})},Chevron:function(t){const{size:n=24,orientation:o="left",className:r}=t;return e.createElement("svg",{className:r,width:n,height:n,viewBox:"0 0 24 24"},"up"===o&&e.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===o&&e.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===o&&e.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===o&&e.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))},Day:function(t){const{day:n,modifiers:o,...r}=t;return e.createElement("td",{...r})},DayButton:function(t){const{day:n,modifiers:o,...r}=t,a=e.useRef(null);return e.useEffect(()=>{o.focused&&a.current?.focus()},[o.focused]),e.createElement("button",{ref:a,...r})},Dropdown:function(t){const{options:n,className:o,components:r,classNames:a,...i}=t,s=[a[Bv.Dropdown],o].join(" "),l=n?.find(({value:e})=>e===i.value);return e.createElement("span",{"data-disabled":i.disabled,className:a[Bv.DropdownRoot]},e.createElement(r.Select,{className:s,...i},n?.map(({value:t,label:n,disabled:o})=>e.createElement(r.Option,{key:t,value:t,disabled:o},n))),e.createElement("span",{className:a[Bv.CaptionLabel],"aria-hidden":!0},l?.label,e.createElement(r.Chevron,{orientation:"down",size:18,className:a[Bv.Chevron]})))},DropdownNav:function(t){return e.createElement("div",{...t})},Footer:function(t){return e.createElement("div",{...t})},Month:function(t){const{calendarMonth:n,displayIndex:o,...r}=t;return e.createElement("div",{...r},t.children)},MonthCaption:function(t){const{calendarMonth:n,displayIndex:o,...r}=t;return e.createElement("div",{...r})},MonthGrid:function(t){return e.createElement("table",{...t})},Months:function(t){return e.createElement("div",{...t})},MonthsDropdown:function(t){const{components:n}=Kv();return e.createElement(n.Dropdown,{...t})},Nav:function(t){const{onPreviousClick:n,onNextClick:o,previousMonth:r,nextMonth:a,...i}=t,{components:s,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Kv(),u=e.useCallback(e=>{a&&o?.(e)},[a,o]),p=e.useCallback(e=>{r&&n?.(e)},[r,n]);return e.createElement("nav",{...i},e.createElement(s.PreviousMonthButton,{type:"button",className:l[Bv.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":c(r),onClick:p},e.createElement(s.Chevron,{disabled:!r||void 0,className:l[Bv.Chevron],orientation:"left"})),e.createElement(s.NextMonthButton,{type:"button",className:l[Bv.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":!a||void 0,"aria-label":d(a),onClick:u},e.createElement(s.Chevron,{disabled:!a||void 0,orientation:"right",className:l[Bv.Chevron]})))},NextMonthButton:function(t){const{components:n}=Kv();return e.createElement(n.Button,{...t})},Option:function(t){return e.createElement("option",{...t})},PreviousMonthButton:function(t){const{components:n}=Kv();return e.createElement(n.Button,{...t})},Root:function(t){const{rootRef:n,...o}=t;return e.createElement("div",{...o,ref:n})},Select:function(t){return e.createElement("select",{...t})},Week:function(t){const{week:n,...o}=t;return e.createElement("tr",{...o})},WeekNumber:function(t){const{week:n,...o}=t;return e.createElement("th",{...o})},WeekNumberHeader:function(t){return e.createElement("th",{...t})},Weekday:function(t){return e.createElement("th",{...t})},Weekdays:function(t){return e.createElement("thead",{"aria-hidden":!0},e.createElement("tr",{...t}))},Weeks:function(t){return e.createElement("tbody",{...t})},YearsDropdown:function(t){const{components:n}=Kv();return e.createElement(n.Dropdown,{...t})}});function Vv(e,t,n=!1,o=Fv){let{from:r,to:a}=e;const{differenceInCalendarDays:i,isSameDay:s}=o;if(r&&a){i(a,r)<0&&([r,a]=[a,r]);return i(t,r)>=(n?1:0)&&i(a,t)>=(n?1:0)}return!n&&a?s(a,t):!(n||!r)&&s(r,t)}function Gv(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function Zv(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function Xv(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function Qv(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function Jv(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function eg(e,t){return Array.isArray(e)&&e.every(t.isDate)}function tg(e,t,n=Fv){const o=Array.isArray(t)?t:[t],{isSameDay:r,differenceInCalendarDays:a,isAfter:i}=n;return o.some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return r(e,t);if(eg(t,n))return t.some(t=>r(e,t));if(Zv(t))return Vv(t,e,!1,n);if(Jv(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(Gv(t)){const n=a(t.before,e)>0,o=a(t.after,e)<0;return i(t.before,t.after)?o&&n:n||o}return Xv(t)?a(e,t.after)>0:Qv(t)?a(t.before,e)>0:"function"==typeof t&&t(e)})}function ng(e){return{...Uv,...e}}function og(){const e={};for(const t in Bv)e[Bv[t]]=`rdp-${Bv[t]}`;for(const t in $v)e[$v[t]]=`rdp-${$v[t]}`;for(const t in qv)e[qv[t]]=`rdp-${qv[t]}`;for(const t in Yv)e[Yv[t]]=`rdp-${Yv[t]}`;return e}function rg(e,t,n){return(n??new Iv(t)).formatMonthYear(e)}const ag=rg;function ig(e,t=Fv){return t.format(e,"yyyy")}const sg=ig;var lg=Object.freeze({__proto__:null,formatCaption:rg,formatDay:function(e,t,n){return(n??new Iv(t)).format(e,"d")},formatMonthCaption:ag,formatMonthDropdown:function(e,t=Fv){return t.format(e,"LLLL")},formatWeekNumber:function(e,t=Fv){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)},formatWeekNumberHeader:function(){return""},formatWeekdayName:function(e,t,n){return(n??new Iv(t)).format(e,"cccccc")},formatYearCaption:sg,formatYearDropdown:ig});function cg(e,t,n,o){let r=(o??new Iv(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const dg=cg;function ug(e,t,n){return(n??new Iv(t)).formatMonthYear(e)}const pg=ug;function fg(e,t,n,o){let r=(o??new Iv(n)).format(e,"PPPP");return t?.today&&(r=`Today, ${r}`),r}function mg(e){return"Choose the Month"}function hg(){return""}function vg(e,t){return"Go to the Next Month"}function gg(e){return"Go to the Previous Month"}function xg(e,t,n){return(n??new Iv(t)).format(e,"cccc")}function yg(e,t){return`Week ${e}`}function bg(e){return"Week Number"}function wg(e){return"Choose the Year"}var kg=Object.freeze({__proto__:null,labelCaption:pg,labelDay:dg,labelDayButton:cg,labelGrid:ug,labelGridcell:fg,labelMonthDropdown:mg,labelNav:hg,labelNext:vg,labelPrevious:gg,labelWeekNumber:yg,labelWeekNumberHeader:bg,labelWeekday:xg,labelYearDropdown:wg});const jg=(e,t,n)=>t||(n?"function"==typeof n?n:(...e)=>n:e);function Ng(e,t){const n=t.locale?.labels??{};return{...kg,...e??{},labelDayButton:jg(cg,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:jg(mg,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:jg(vg,e?.labelNext,n.labelNext),labelPrevious:jg(gg,e?.labelPrevious,n.labelPrevious),labelWeekNumber:jg(yg,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:jg(wg,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:jg(ug,e?.labelGrid,n.labelGrid),labelGridcell:jg(fg,e?.labelGridcell,n.labelGridcell),labelNav:jg(hg,e?.labelNav,n.labelNav),labelWeekNumberHeader:jg(bg,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:jg(xg,e?.labelWeekday,n.labelWeekday)}}function Cg(e,t,n,o,r){const{startOfMonth:a,startOfYear:i,endOfYear:s,eachMonthOfInterval:l,getMonth:c}=r;return l({start:i(e),end:s(e)}).map(e=>{const i=o.formatMonthDropdown(e,r);return{value:c(e),label:i,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function _g(e,t,n,o,r=!1){if(!e)return;if(!t)return;const{startOfYear:a,endOfYear:i,eachYearOfInterval:s,getYear:l}=o,c=s({start:a(e),end:i(t)});return r&&c.reverse(),c.map(e=>{const t=n.formatYearDropdown(e,o);return{value:l(e),label:t,disabled:!1}})}const Dg=e=>e instanceof HTMLElement?e:null,Sg=e=>[...e.querySelectorAll("[data-animated-month]")??[]],Eg=e=>Dg(e.querySelector("[data-animated-caption]")),Mg=e=>Dg(e.querySelector("[data-animated-weeks]"));function Og(t,n,{classNames:o,months:r,focused:a,dateLib:i}){const s=e.useRef(null),l=e.useRef(r),c=e.useRef(!1);e.useLayoutEffect(()=>{const e=l.current;if(l.current=r,!(n&&t.current&&t.current instanceof HTMLElement&&0!==r.length&&0!==e.length&&r.length===e.length))return;const d=i.isSameMonth(r[0].date,e[0].date),u=i.isAfter(r[0].date,e[0].date),p=u?o[Yv.caption_after_enter]:o[Yv.caption_before_enter],f=u?o[Yv.weeks_after_enter]:o[Yv.weeks_before_enter],m=s.current,h=t.current.cloneNode(!0);if(h instanceof HTMLElement){Sg(h).forEach(e=>{if(!(e instanceof HTMLElement))return;const t=Dg(e.querySelector("[data-animated-month]"));t&&e.contains(t)&&e.removeChild(t);const n=Eg(e);n&&n.classList.remove(p);const o=Mg(e);o&&o.classList.remove(f)}),s.current=h}else s.current=null;if(c.current||d||a)return;const v=m instanceof HTMLElement?Sg(m):[],g=Sg(t.current);if(g?.every(e=>e instanceof HTMLElement)&&v&&v.every(e=>e instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const e=(x=t.current,Dg(x.querySelector("[data-animated-nav]")));e&&(e.style.zIndex="1"),g.forEach((n,r)=>{const a=v[r];if(!a)return;n.style.position="relative",n.style.overflow="hidden";const i=Eg(n);i&&i.classList.add(p);const s=Mg(n);s&&s.classList.add(f);const l=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),e&&(e.style.zIndex=""),i&&i.classList.remove(p),s&&s.classList.remove(f),n.style.position="",n.style.overflow="",n.contains(a)&&n.removeChild(a)};a.style.pointerEvents="none",a.style.position="absolute",a.style.overflow="hidden",a.setAttribute("aria-hidden","true");const d=(e=>Dg(e.querySelector("[data-animated-weekdays]")))(a);d&&(d.style.opacity="0");const m=Eg(a);m&&(m.classList.add(u?o[Yv.caption_before_exit]:o[Yv.caption_after_exit]),m.addEventListener("animationend",l));const h=Mg(a);h&&h.classList.add(u?o[Yv.weeks_before_exit]:o[Yv.weeks_after_exit]),n.insertBefore(a,n.firstChild)})}var x})}function Tg(e,t,n,o){const{month:r,defaultMonth:a,today:i=o.today(),numberOfMonths:s=1}=e;let l=r||a||i;const{differenceInCalendarMonths:c,addMonths:d,startOfMonth:u}=o;if(n&&c(n,l)<s-1){l=d(n,-1*(s-1))}return t&&c(l,t)<0&&(l=t),u(l)}function Rg(t,n){const[o,r]=e.useState(t);return[void 0===n?o:n,r]}function Pg(t,n){const[o,r]=function(e,t){let{startMonth:n,endMonth:o}=e;const{startOfYear:r,startOfDay:a,startOfMonth:i,endOfMonth:s,addYears:l,endOfYear:c,newDate:d,today:u}=t,{fromYear:p,toYear:f,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&p&&(n=t.newDate(p,0,1)),!o&&h&&(o=h),!o&&f&&(o=d(f,11,31));const v="dropdown"===e.captionLayout||"dropdown-years"===e.captionLayout;return n?n=i(n):p?n=d(p,0,1):!n&&v&&(n=r(l(e.today??u(),-100))),o?o=s(o):f?o=d(f,11,31):!o&&v&&(o=c(e.today??u())),[n?a(n):n,o?a(o):o]}(t,n),{startOfMonth:a,endOfMonth:i}=n,s=Tg(t,o,r,n),[l,c]=Rg(s,t.month?s:void 0);e.useEffect(()=>{const e=Tg(t,o,r,n);c(e)},[t.timeZone]);const{months:d,weeks:u,days:p,previousMonth:f,nextMonth:m}=e.useMemo(()=>{const e=function(e,t,n,o){const{numberOfMonths:r=1}=n,a=[];for(let n=0;n<r;n++){const r=o.addMonths(e,n);if(t&&r>t)break;a.push(r)}return a}(l,r,{numberOfMonths:t.numberOfMonths},n),a=function(e,t,n,o){const r=e[0],a=e[e.length-1],{ISOWeek:i,fixedWeeks:s,broadcastCalendar:l}=n??{},{addDays:c,differenceInCalendarDays:d,differenceInCalendarMonths:u,endOfBroadcastWeek:p,endOfISOWeek:f,endOfMonth:m,endOfWeek:h,isAfter:v,startOfBroadcastWeek:g,startOfISOWeek:x,startOfWeek:y}=o,b=l?g(r,o):i?x(r):y(r),w=l?p(a):i?f(m(a)):h(m(a)),k=t&&(l?p(t):i?f(t):h(t)),j=d(k&&v(w,k)?k:w,b),N=u(a,r)+1,C=[];for(let e=0;e<=j;e++){const t=c(b,e);C.push(t)}const _=(l?35:42)*N;if(s&&C.length<_){const e=_-C.length;for(let t=0;t<e;t++){const e=c(C[C.length-1],1);C.push(e)}}return C}(e,t.endMonth?i(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},n),s=function(e,t,n,o){const{addDays:r,endOfBroadcastWeek:a,endOfISOWeek:i,endOfMonth:s,endOfWeek:l,getISOWeek:c,getWeek:d,startOfBroadcastWeek:u,startOfISOWeek:p,startOfWeek:f}=o,m=e.reduce((e,m)=>{const h=n.broadcastCalendar?u(m,o):n.ISOWeek?p(m):f(m),v=n.broadcastCalendar?a(m):n.ISOWeek?i(s(m)):l(s(m)),g=t.filter(e=>e>=h&&e<=v),x=n.broadcastCalendar?35:42;if(n.fixedWeeks&&g.length<x){const e=t.filter(e=>{const t=x-g.length;return e>v&&e<=r(v,t)});g.push(...e)}const y=g.reduce((e,t)=>{const r=n.ISOWeek?c(t):d(t),a=e.find(e=>e.weekNumber===r),i=new zv(t,m,o);return a?a.days.push(i):e.push(new Wv(r,[i])),e},[]),b=new Lv(m,y);return e.push(b),e},[]);return n.reverseMonths?m.reverse():m}(e,a,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},n),c=function(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}(s),d=function(e){const t=[];return e.reduce((e,n)=>{const o=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(o.slice())},t.slice())}(s),u=function(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:a}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=o,c=r?a??1:1,d=i(e);return t&&l(d,t)<=0?void 0:s(d,-c)}(l,o,t,n),p=function(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:a=1}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=o,c=r?a:1,d=i(e);return t&&l(t,e)<a?void 0:s(d,c)}(l,r,t,n);return{months:s,weeks:c,days:d,previousMonth:u,nextMonth:p}},[n,l.getTime(),r?.getTime(),o?.getTime(),t.disableNavigation,t.broadcastCalendar,t.endMonth?.getTime(),t.fixedWeeks,t.ISOWeek,t.numberOfMonths,t.pagedNavigation,t.reverseMonths]),{disableNavigation:h,onMonthChange:v}=t,g=e=>{if(h)return;let t=a(e);o&&t<a(o)&&(t=a(o)),r&&t>a(r)&&(t=a(r)),c(t),v?.(t)};return{months:d,weeks:u,days:p,navStart:o,navEnd:r,previousMonth:f,nextMonth:m,goToMonth:g,goToDay:e=>{(e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))))(e)||g(e.date)}}}var Ag;function Ig(e){return!e[$v.disabled]&&!e[$v.hidden]&&!e[$v.outside]}function Fg(e,t,n,o,r,a,i,s=0){if(s>365)return;const l=function(e,t,n,o,r,a,i){const{ISOWeek:s,broadcastCalendar:l}=a,{addDays:c,addMonths:d,addWeeks:u,addYears:p,endOfBroadcastWeek:f,endOfISOWeek:m,endOfWeek:h,max:v,min:g,startOfBroadcastWeek:x,startOfISOWeek:y,startOfWeek:b}=i;let w={day:c,week:u,month:d,year:p,startOfWeek:e=>l?x(e,i):s?y(e):b(e),endOfWeek:e=>l?f(e):s?m(e):h(e)}[e](n,"after"===t?1:-1);return"before"===t&&o?w=v([o,w]):"after"===t&&r&&(w=g([r,w])),w}(e,t,n.date,o,r,a,i),c=Boolean(a.disabled&&tg(l,a.disabled,i)),d=Boolean(a.hidden&&tg(l,a.hidden,i)),u=new zv(l,l,i);return c||d?Fg(e,t,u,o,r,a,i,s+1):u}function zg(t,n,o,r,a){const{autoFocus:i}=t,[s,l]=e.useState(),c=function(e,t,n,o){let r,a=-1;for(const i of e){const e=t(i);Ig(e)&&(e[$v.focused]&&a<Ag.FocusedModifier?(r=i,a=Ag.FocusedModifier):o?.isEqualTo(i)&&a<Ag.LastFocused?(r=i,a=Ag.LastFocused):n(i.date)&&a<Ag.Selected?(r=i,a=Ag.Selected):e[$v.today]&&a<Ag.Today&&(r=i,a=Ag.Today))}return r||(r=e.find(e=>Ig(t(e)))),r}(n.days,o,r||(()=>!1),s),[d,u]=e.useState(i?c:void 0);return{isFocusTarget:e=>Boolean(c?.isEqualTo(e)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(e,o)=>{if(!d)return;const r=Fg(e,o,d,n.navStart,n.navEnd,t,a);if(r){if(t.disableNavigation){if(!n.days.some(e=>e.isEqualTo(r)))return}n.goToDay(r),u(r)}}}}function Lg(e,t,n=Fv){return Vv(e,t.from,!1,n)||Vv(e,t.to,!1,n)||Vv(t,e.from,!1,n)||Vv(t,e.to,!1,n)}function Wg(e,t,n=Fv){const o=Array.isArray(t)?t:[t];if(o.filter(e=>"function"!=typeof e).some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return Vv(e,t,!1,n);if(eg(t,n))return t.some(t=>Vv(e,t,!1,n));if(Zv(t))return!(!t.from||!t.to)&&Lg(e,{from:t.from,to:t.to},n);if(Jv(t))return function(e,t,n=Fv){const o=Array.isArray(t)?t:[t];let r=e.from;const a=n.differenceInCalendarDays(e.to,e.from),i=Math.min(a,6);for(let e=0;e<=i;e++){if(o.includes(r.getDay()))return!0;r=n.addDays(r,1)}return!1}(e,t.dayOfWeek,n);if(Gv(t)){return n.isAfter(t.before,t.after)?Lg(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):tg(e.from,t,n)||tg(e.to,t,n)}return!(!Xv(t)&&!Qv(t))&&(tg(e.from,t,n)||tg(e.to,t,n))}))return!0;const r=o.filter(e=>"function"==typeof e);if(r.length){let t=e.from;const o=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=o;e++){if(r.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function Bg(e,t){const{disabled:n,excludeDisabled:o,selected:r,required:a,onSelect:i}=e,[s,l]=Rg(r,i?r:void 0),c=i?r:s;return{selected:c,select:(r,s,d)=>{const{min:u,max:p}=e,f=r?function(e,t,n=0,o=0,r=!1,a=Fv){const{from:i,to:s}=t||{},{isSameDay:l,isAfter:c,isBefore:d}=a;let u;if(i||s){if(i&&!s)u=l(i,e)?0===n?{from:i,to:e}:r?{from:i,to:void 0}:void 0:d(e,i)?{from:e,to:i}:{from:i,to:e};else if(i&&s)if(l(i,e)&&l(s,e))u=r?{from:i,to:s}:void 0;else if(l(i,e))u={from:i,to:n>0?void 0:e};else if(l(s,e))u={from:e,to:n>0?void 0:e};else if(d(e,i))u={from:e,to:s};else if(c(e,i))u={from:i,to:e};else{if(!c(e,s))throw new Error("Invalid range");u={from:i,to:e}}}else u={from:e,to:n>0?void 0:e};if(u?.from&&u?.to){const t=a.differenceInCalendarDays(u.to,u.from);(o>0&&t>o||n>1&&t<n)&&(u={from:e,to:void 0})}return u}(r,c,u,p,a,t):void 0;return o&&n&&f?.from&&f.to&&Wg({from:f.from,to:f.to},n,t)&&(f.from=r,f.to=void 0),i||l(f),i?.(f,r,s,d),f},isSelected:e=>c&&Vv(c,e,!1,t)}}function $g(e,t){const n=function(e,t){const{selected:n,required:o,onSelect:r}=e,[a,i]=Rg(n,r?n:void 0),s=r?n:a,{isSameDay:l}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!o&&s&&s&&l(e,s)&&(a=void 0),r||i(a),r?.(a,e,t,n),a},isSelected:e=>!!s&&l(s,e)}}(e,t),o=function(e,t){const{selected:n,required:o,onSelect:r}=e,[a,i]=Rg(n,r?n:void 0),s=r?n:a,{isSameDay:l}=t,c=e=>s?.some(t=>l(t,e))??!1,{min:d,max:u}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(c(e)){if(s?.length===d)return;if(o&&1===s?.length)return;a=s?.filter(t=>!l(t,e))}else a=s?.length===u?[e]:[...a,e];return r||i(a),r?.(a,e,t,n),a},isSelected:c}}(e,t),r=Bg(e,t);switch(e.mode){case"single":return n;case"multiple":return o;case"range":return r;default:return}}function qg(e,t){return e instanceof Rv&&e.timeZone===t?e:new Rv(e,t)}function Yg(e,t,n){return qg(e,t)}function Hg(e,t,n){return"boolean"==typeof e||"function"==typeof e?e:e instanceof Date?Yg(e,t):Array.isArray(e)?e.map(e=>e instanceof Date?Yg(e,t):e):Zv(e)?{...e,from:e.from?qg(e.from,t):e.from,to:e.to?qg(e.to,t):e.to}:Gv(e)?{before:Yg(e.before,t),after:Yg(e.after,t)}:Xv(e)?{after:Yg(e.after,t)}:Qv(e)?{before:Yg(e.before,t)}:e}function Kg(e,t,n){return e?Array.isArray(e)?e.map(e=>Hg(e,t)):Hg(e,t):e}function Ug(t){let n=t;const o=n.timeZone;if(o&&(n={...t,timeZone:o},n.today&&(n.today=qg(n.today,o)),n.month&&(n.month=qg(n.month,o)),n.defaultMonth&&(n.defaultMonth=qg(n.defaultMonth,o)),n.startMonth&&(n.startMonth=qg(n.startMonth,o)),n.endMonth&&(n.endMonth=qg(n.endMonth,o)),"single"===n.mode&&n.selected?n.selected=qg(n.selected,o):"multiple"===n.mode&&n.selected?n.selected=n.selected?.map(e=>qg(e,o)):"range"===n.mode&&n.selected&&(n.selected={from:n.selected.from?qg(n.selected.from,o):n.selected.from,to:n.selected.to?qg(n.selected.to,o):n.selected.to}),void 0!==n.disabled&&(n.disabled=Kg(n.disabled,o)),void 0!==n.hidden&&(n.hidden=Kg(n.hidden,o)),n.modifiers)){const e={};Object.keys(n.modifiers).forEach(t=>{e[t]=Kg(n.modifiers?.[t],o)}),n.modifiers=e}const{components:r,formatters:a,labels:i,dateLib:s,locale:l,classNames:c}=e.useMemo(()=>{const e={...Av,...n.locale},t=n.broadcastCalendar?1:n.weekStartsOn,o=n.noonSafe&&n.timeZone?function(e,t={}){const{weekStartsOn:n,locale:o}=t,r=n??o?.options?.weekStartsOn??0,a=t=>{const n="number"==typeof t||"string"==typeof t?new Date(t):t;return new Rv(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},i=e=>{const t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(Rv.tz(e)),newDate:(t,n,o)=>new Rv(t,n,o,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{const n=a(e),o=t?.weekStartsOn??r,i=(n.getDay()-o+7)%7;return n.setDate(n.getDate()-i),n},startOfISOWeek:e=>{const t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{const t=a(e);return t.setDate(1),t},startOfYear:e=>{const t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{const n=a(e),o=(((t?.weekStartsOn??r)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+o),n},endOfISOWeek:e=>{const t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{const t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{const t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{const n=a(t.start),o=a(t.end),r=[],i=new Rv(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=12*o.getFullYear()+o.getMonth();for(;12*i.getFullYear()+i.getMonth()<=s;)r.push(new Rv(i,e)),i.setMonth(i.getMonth()+1,1);return r},addDays:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+7*t),n},addMonths:(e,t)=>{const n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{const n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{const n=a(t.start),o=a(t.end),r=[],i=new Rv(n.getFullYear(),0,1,12,0,0,e);for(;i.getFullYear()<=o.getFullYear();)r.push(new Rv(i,e)),i.setFullYear(i.getFullYear()+1,0,1);return r},getWeek:(e,t)=>Xh(i(e),{weekStartsOn:t?.weekStartsOn??r,firstWeekContainsDate:t?.firstWeekContainsDate??o?.options?.firstWeekContainsDate??1}),getISOWeek:e=>Gh(i(e)),differenceInCalendarDays:(e,t)=>Rh(i(e),i(t)),differenceInCalendarMonths:(e,t)=>Ah(i(e),i(t))}}(n.timeZone,{weekStartsOn:t,locale:e}):void 0,r=n.dateLib&&o?{...o,...n.dateLib}:n.dateLib??o,a=new Iv({locale:e,weekStartsOn:t,firstWeekContainsDate:n.firstWeekContainsDate,useAdditionalWeekYearTokens:n.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:n.useAdditionalDayOfYearTokens,timeZone:n.timeZone,numerals:n.numerals},r);return{dateLib:a,components:ng(n.components),formatters:(i=n.formatters,i?.formatMonthCaption&&!i.formatCaption&&(i.formatCaption=i.formatMonthCaption),i?.formatYearCaption&&!i.formatYearDropdown&&(i.formatYearDropdown=i.formatYearCaption),{...lg,...i}),labels:Ng(n.labels,a.options),locale:e,classNames:{...og(),...n.classNames}};var i},[n.locale,n.broadcastCalendar,n.weekStartsOn,n.firstWeekContainsDate,n.useAdditionalWeekYearTokens,n.useAdditionalDayOfYearTokens,n.timeZone,n.numerals,n.dateLib,n.noonSafe,n.components,n.formatters,n.labels,n.classNames]);n.today||(n={...n,today:s.today()});const{captionLayout:d,mode:u,navLayout:p,numberOfMonths:f=1,onDayBlur:m,onDayClick:h,onDayFocus:v,onDayKeyDown:g,onDayMouseEnter:x,onDayMouseLeave:y,onNextClick:b,onPrevClick:w,showWeekNumber:k,styles:j}=n,{formatCaption:N,formatDay:C,formatMonthDropdown:_,formatWeekNumber:D,formatWeekNumberHeader:S,formatWeekdayName:E,formatYearDropdown:M}=a,O=Pg(n,s),{days:T,months:R,navStart:P,navEnd:A,previousMonth:I,nextMonth:F,goToMonth:z}=O,L=function(e,t,n,o,r){const{disabled:a,hidden:i,modifiers:s,showOutsideDays:l,broadcastCalendar:c,today:d=r.today()}=t,{isSameDay:u,isSameMonth:p,startOfMonth:f,isBefore:m,endOfMonth:h,isAfter:v}=r,g=n&&f(n),x=o&&h(o),y={[$v.focused]:[],[$v.outside]:[],[$v.disabled]:[],[$v.hidden]:[],[$v.today]:[]},b={};for(const t of e){const{date:e,displayMonth:n}=t,o=Boolean(n&&!p(e,n)),f=Boolean(g&&m(e,g)),h=Boolean(x&&v(e,x)),w=Boolean(a&&tg(e,a,r)),k=Boolean(i&&tg(e,i,r))||f||h||!c&&!l&&o||c&&!1===l&&o,j=u(e,d);o&&y.outside.push(t),w&&y.disabled.push(t),k&&y.hidden.push(t),j&&y.today.push(t),s&&Object.keys(s).forEach(n=>{const o=s?.[n];o&&tg(e,o,r)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{const t={[$v.focused]:!1,[$v.disabled]:!1,[$v.hidden]:!1,[$v.outside]:!1,[$v.today]:!1},n={};for(const n in y){const o=y[n];t[n]=o.some(t=>t===e)}for(const t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}(T,n,P,A,s),{isSelected:W,select:B,selected:$}=$g(n,s)??{},{blur:q,focused:Y,isFocusTarget:H,moveFocus:K,setFocused:U}=zg(n,O,L,W??(()=>!1),s),{labelDayButton:V,labelGridcell:G,labelGrid:Z,labelMonthDropdown:X,labelNav:Q,labelPrevious:J,labelNext:ee,labelWeekday:te,labelWeekNumber:ne,labelWeekNumberHeader:oe,labelYearDropdown:re}=i,ae=e.useMemo(()=>function(e,t,n,o){const r=o??e.today(),a=n?e.startOfBroadcastWeek(r,e):t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let t=0;t<7;t++){const n=e.addDays(a,t);i.push(n)}return i}(s,n.ISOWeek,n.broadcastCalendar,n.today),[s,n.ISOWeek,n.broadcastCalendar,n.today]),ie=void 0!==u||void 0!==h,se=e.useCallback(()=>{I&&(z(I),w?.(I))},[I,z,w]),le=e.useCallback(()=>{F&&(z(F),b?.(F))},[z,F,b]),ce=e.useCallback((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),U(e),t.disabled||(B?.(e.date,t,n),h?.(e.date,t,n))},[B,h,U]),de=e.useCallback((e,t)=>n=>{U(e),v?.(e.date,t,n)},[v,U]),ue=e.useCallback((e,t)=>n=>{q(),m?.(e.date,t,n)},[q,m]),pe=e.useCallback((e,t)=>o=>{const r={ArrowLeft:[o.shiftKey?"month":"day","rtl"===n.dir?"after":"before"],ArrowRight:[o.shiftKey?"month":"day","rtl"===n.dir?"before":"after"],ArrowDown:[o.shiftKey?"year":"week","after"],ArrowUp:[o.shiftKey?"year":"week","before"],PageUp:[o.shiftKey?"year":"month","before"],PageDown:[o.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(r[o.key]){o.preventDefault(),o.stopPropagation();const[e,t]=r[o.key];K(e,t)}g?.(e.date,t,o)},[K,g,n.dir]),fe=e.useCallback((e,t)=>n=>{x?.(e.date,t,n)},[x]),me=e.useCallback((e,t)=>n=>{y?.(e.date,t,n)},[y]),he=e.useCallback(e=>t=>{const n=Number(t.target.value),o=s.setMonth(s.startOfMonth(e),n);z(o)},[s,z]),ve=e.useCallback(e=>t=>{const n=Number(t.target.value),o=s.setYear(s.startOfMonth(e),n);z(o)},[s,z]),{className:ge,style:xe}=e.useMemo(()=>({className:[c[Bv.Root],n.className].filter(Boolean).join(" "),style:{...j?.[Bv.Root],...n.style}}),[c,n.className,n.style,j]),ye=function(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith("data-")&&(t[e]=n)}),t}(n),be=e.useRef(null);Og(be,Boolean(n.animate),{classNames:c,months:R,focused:Y,dateLib:s});const we={dayPickerProps:n,selected:$,select:B,isSelected:W,months:R,nextMonth:F,previousMonth:I,goToMonth:z,getModifiers:L,components:r,classNames:c,styles:j,labels:i,formatters:a};return e.createElement(Hv.Provider,{value:we},e.createElement(r.Root,{rootRef:n.animate?be:void 0,className:ge,style:xe,dir:n.dir,id:n.id,lang:n.lang,nonce:n.nonce,title:n.title,role:n.role,"aria-label":n["aria-label"],"aria-labelledby":n["aria-labelledby"],...ye},e.createElement(r.Months,{className:c[Bv.Months],style:j?.[Bv.Months]},!n.hideNavigation&&!p&&e.createElement(r.Nav,{"data-animated-nav":n.animate?"true":void 0,className:c[Bv.Nav],style:j?.[Bv.Nav],"aria-label":Q(),onPreviousClick:se,onNextClick:le,previousMonth:I,nextMonth:F}),R.map((t,o)=>e.createElement(r.Month,{"data-animated-month":n.animate?"true":void 0,className:c[Bv.Month],style:j?.[Bv.Month],key:o,displayIndex:o,calendarMonth:t},"around"===p&&!n.hideNavigation&&0===o&&e.createElement(r.PreviousMonthButton,{type:"button",className:c[Bv.PreviousMonthButton],tabIndex:I?void 0:-1,"aria-disabled":!I||void 0,"aria-label":J(I),onClick:se,"data-animated-button":n.animate?"true":void 0},e.createElement(r.Chevron,{disabled:!I||void 0,className:c[Bv.Chevron],orientation:"rtl"===n.dir?"right":"left"})),e.createElement(r.MonthCaption,{"data-animated-caption":n.animate?"true":void 0,className:c[Bv.MonthCaption],style:j?.[Bv.MonthCaption],calendarMonth:t,displayIndex:o},d?.startsWith("dropdown")?e.createElement(r.DropdownNav,{className:c[Bv.Dropdowns],style:j?.[Bv.Dropdowns]},(()=>{const o="dropdown"===d||"dropdown-months"===d?e.createElement(r.MonthsDropdown,{key:"month",className:c[Bv.MonthsDropdown],"aria-label":X(),classNames:c,components:r,disabled:Boolean(n.disableNavigation),onChange:he(t.date),options:Cg(t.date,P,A,a,s),style:j?.[Bv.Dropdown],value:s.getMonth(t.date)}):e.createElement("span",{key:"month"},_(t.date,s)),i="dropdown"===d||"dropdown-years"===d?e.createElement(r.YearsDropdown,{key:"year",className:c[Bv.YearsDropdown],"aria-label":re(s.options),classNames:c,components:r,disabled:Boolean(n.disableNavigation),onChange:ve(t.date),options:_g(P,A,a,s,Boolean(n.reverseYears)),style:j?.[Bv.Dropdown],value:s.getYear(t.date)}):e.createElement("span",{key:"year"},M(t.date,s));return"year-first"===s.getMonthYearOrder()?[i,o]:[o,i]})(),e.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},N(t.date,s.options,s))):e.createElement(r.CaptionLabel,{className:c[Bv.CaptionLabel],role:"status","aria-live":"polite"},N(t.date,s.options,s))),"around"===p&&!n.hideNavigation&&o===f-1&&e.createElement(r.NextMonthButton,{type:"button",className:c[Bv.NextMonthButton],tabIndex:F?void 0:-1,"aria-disabled":!F||void 0,"aria-label":ee(F),onClick:le,"data-animated-button":n.animate?"true":void 0},e.createElement(r.Chevron,{disabled:!F||void 0,className:c[Bv.Chevron],orientation:"rtl"===n.dir?"left":"right"})),o===f-1&&"after"===p&&!n.hideNavigation&&e.createElement(r.Nav,{"data-animated-nav":n.animate?"true":void 0,className:c[Bv.Nav],style:j?.[Bv.Nav],"aria-label":Q(),onPreviousClick:se,onNextClick:le,previousMonth:I,nextMonth:F}),e.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===u||"range"===u,"aria-label":Z(t.date,s.options,s)||void 0,className:c[Bv.MonthGrid],style:j?.[Bv.MonthGrid]},!n.hideWeekdays&&e.createElement(r.Weekdays,{"data-animated-weekdays":n.animate?"true":void 0,className:c[Bv.Weekdays],style:j?.[Bv.Weekdays]},k&&e.createElement(r.WeekNumberHeader,{"aria-label":oe(s.options),className:c[Bv.WeekNumberHeader],style:j?.[Bv.WeekNumberHeader],scope:"col"},S()),ae.map(t=>e.createElement(r.Weekday,{"aria-label":te(t,s.options,s),className:c[Bv.Weekday],key:String(t),style:j?.[Bv.Weekday],scope:"col"},E(t,s.options,s)))),e.createElement(r.Weeks,{"data-animated-weeks":n.animate?"true":void 0,className:c[Bv.Weeks],style:j?.[Bv.Weeks]},t.weeks.map(t=>e.createElement(r.Week,{className:c[Bv.Week],key:t.weekNumber,style:j?.[Bv.Week],week:t},k&&e.createElement(r.WeekNumber,{week:t,style:j?.[Bv.WeekNumber],"aria-label":ne(t.weekNumber,{locale:l}),className:c[Bv.WeekNumber],scope:"row",role:"rowheader"},D(t.weekNumber,s)),t.days.map(t=>{const{date:o}=t,a=L(t);if(a[$v.focused]=!a.hidden&&Boolean(Y?.isEqualTo(t)),a[qv.selected]=W?.(o)||a.selected,Zv($)){const{from:e,to:t}=$;a[qv.range_start]=Boolean(e&&t&&s.isSameDay(o,e)),a[qv.range_end]=Boolean(e&&t&&s.isSameDay(o,t)),a[qv.range_middle]=Vv($,o,!0,s)}const i=function(e,t={},n={}){let o={...t?.[Bv.Day]};return Object.entries(e).filter(([,e])=>!0===e).forEach(([e])=>{o={...o,...n?.[e]}}),o}(a,j,n.modifiersStyles),l=function(e,t,n={}){return Object.entries(e).filter(([,e])=>!0===e).reduce((e,[o])=>(n[o]?e.push(n[o]):t[$v[o]]?e.push(t[$v[o]]):t[qv[o]]&&e.push(t[qv[o]]),e),[t[Bv.Day]])}(a,c,n.modifiersClassNames),d=ie||a.hidden?void 0:G(o,a,s.options,s);return e.createElement(r.Day,{key:`${t.isoDate}_${t.displayMonthId}`,day:t,modifiers:a,className:l.join(" "),style:i,role:"gridcell","aria-selected":a.selected||void 0,"aria-label":d,"data-day":t.isoDate,"data-month":t.outside?t.dateMonthId:void 0,"data-selected":a.selected||void 0,"data-disabled":a.disabled||void 0,"data-hidden":a.hidden||void 0,"data-outside":t.outside||void 0,"data-focused":a.focused||void 0,"data-today":a.today||void 0},!a.hidden&&ie?e.createElement(r.DayButton,{className:c[Bv.DayButton],style:j?.[Bv.DayButton],type:"button",day:t,modifiers:a,disabled:!a.focused&&a.disabled||void 0,"aria-disabled":a.focused&&a.disabled||void 0,tabIndex:H(t)?0:-1,"aria-label":V(o,a,s.options,s),onClick:ce(t,a),onBlur:ue(t,a),onFocus:de(t,a),onKeyDown:pe(t,a),onMouseEnter:fe(t,a),onMouseLeave:me(t,a)},C(o,s.options,s)):!a.hidden&&C(t.date,s.options,s))})))))))),n.footer&&e.createElement(r.Footer,{className:c[Bv.Footer],style:j?.[Bv.Footer],role:"status","aria-live":"polite"},n.footer)))}function Vg({className:e,classNames:n,showOutsideDays:o=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:s,...l}){const c=og();return t.jsx(Ug,{showOutsideDays:o,className:Ie("bg-background group/calendar p-3 [--cell-size:2rem]",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:e=>e.toLocaleString("default",{month:"short"}),...i},classNames:{root:Ie("w-fit",c.root),months:Ie("relative flex flex-col gap-4 md:flex-row",c.months),month:Ie("flex w-full flex-col gap-4",c.month),nav:Ie("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:Ie(Fe({variant:a}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:Ie(Fe({variant:a}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:Ie("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:Ie("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:Ie("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:Ie("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:Ie("select-none font-medium","label"===r?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:Ie("flex",c.weekdays),weekday:Ie("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:Ie("mt-2 flex w-full",c.week),week_number_header:Ie("w-[--cell-size] select-none",c.week_number_header),week_number:Ie("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:Ie("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:Ie("bg-accent rounded-l-md",c.range_start),range_middle:Ie("rounded-none",c.range_middle),range_end:Ie("bg-accent rounded-r-md",c.range_end),today:Ie("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:Ie("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:Ie("text-muted-foreground opacity-50",c.disabled),hidden:Ie("invisible",c.hidden),...n},components:{Root:({className:e,rootRef:n,...o})=>t.jsx("div",{"data-slot":"calendar",ref:n,className:Ie(e),...o}),Chevron:({className:e,orientation:n,...o})=>"left"===n?t.jsx(ni,{className:Ie("size-4",e),...o}):"right"===n?t.jsx(oi,{className:Ie("size-4",e),...o}):t.jsx(ti,{className:Ie("size-4",e),...o}),DayButton:Gg,WeekNumber:({children:e,...n})=>t.jsx("td",{...n,children:t.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:e})}),...s},...l})}function Gg({className:e,day:n,modifiers:o,...a}){const i=og(),s=r.useRef(null);return r.useEffect(()=>{o.focused&&s.current?.focus()},[o.focused]),t.jsx(Le,{ref:s,variant:"ghost",size:"icon","data-day":n.date.toLocaleDateString(),"data-selected-single":o.selected&&!o.range_start&&!o.range_end&&!o.range_middle,"data-range-start":o.range_start,"data-range-end":o.range_end,"data-range-middle":o.range_middle,className:Ie("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",i.day,e),...a})}!function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"}(Ag||(Ag={}));const Zg=e=>{if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t};function Xg({title:e="Nenhum resultado",description:n="Nenhum dado encontrado."}){return t.jsx(ic,{title:e,description:n})}const Qg=r.forwardRef(({className:e,...n},o)=>t.jsx("div",{className:"w-full overflow-auto",children:t.jsx("table",{ref:o,className:Ie("w-full caption-bottom text-sm",e),...n})}));Qg.displayName="Table";const Jg=r.forwardRef(({className:e,...n},o)=>t.jsx("thead",{ref:o,className:Ie("rounded-md bg-[#0E2B63] h-[36px]",e),...n}));Jg.displayName="TableHeader";const ex=r.forwardRef(({className:e,...n},o)=>t.jsx("tbody",{ref:o,className:Ie("[&_tr:last-child]:border-0",e),...n}));ex.displayName="TableBody";const tx=r.forwardRef(({className:e,...n},o)=>t.jsx("tfoot",{ref:o,className:Ie("bg-primary font-medium text-primary-foreground",e),...n}));tx.displayName="TableFooter";const nx=r.forwardRef(({className:e,...n},o)=>t.jsx("tr",{ref:o,className:Ie("text-sm text-fontcolor-secondary transition-colors data-[state=selected]:bg-muted",e),...n}));nx.displayName="TableRow";const ox=r.forwardRef(({className:e,...n},o)=>t.jsx("th",{ref:o,className:Ie("text-left px-4 align-middle text-[12px] text-[#FFFFFF] font-medium [&:has([role=checkbox])]:pr-0 first:rounded-l-lg last:rounded-r-lg",e),...n}));ox.displayName="TableHead";const rx=r.forwardRef(({className:e,...n},o)=>t.jsx("td",{ref:o,className:Ie("px-4 py-2 align-middle text-[12px] text-[#333333] [&:has([role=checkbox])]:pr-0",e),...n}));rx.displayName="TableCell";const ax=r.forwardRef(({className:e,...n},o)=>t.jsx("caption",{ref:o,className:Ie("mt-4 text-sm text-muted-foreground",e),...n}));function ix({className:e,...n}){return t.jsx("div",{className:Ie("animate-pulse rounded-md bg-muted",e),...n})}function sx({columns:e,rows:n=5}){const o=function(e){return"number"==typeof e?Array.from({length:e},()=>({})):e}(e),r=Array.from({length:n},(e,t)=>"row-".concat(String(t)));return t.jsx(t.Fragment,{children:r.map(e=>t.jsx(nx,{children:o.map((n,o)=>t.jsx(rx,{className:Ie(n.width,n.cellClassName,"px-2 py-2"),children:t.jsx(ix,{className:"block h-4 w-full"})},e.concat("-col-",String(o))))},e))})}ax.displayName="TableCaption";const lx={Root:Qg,Body:ex,Cell:rx,Head:ox,Header:Jg,Row:nx};function cx({columns:e,ordering:n,onSort:o}){const r=e??[];return t.jsx(nx,{children:r.map(e=>{const r=Boolean(e.sortable),a=n===e.key,i=n==="-".concat(e.key),s=a||i;return t.jsx(ox,{className:Ie(e.width,e.className,r?"cursor-pointer":""),onClick:r&&o?()=>o(e.key):void 0,children:t.jsxs(Ve,{direction:"row",gap:1,children:[e.label,r&&s&&(a?t.jsx(Xa,{size:16}):t.jsx(Za,{size:16}))]})},e.key)})})}function dx({item:e,columns:n,onClick:o}){const r=n??[];return t.jsx(nx,{className:Ie(o?"hover:bg-secondary cursor-pointer":""),onClick:o,children:r.map(n=>{const o=e[n.key];return t.jsx(rx,{className:Ie(n.width,n.cellClassName),children:n.render?n.render(o,e):String(o??"N/D")},n.key)})})}var ux="Checkbox",[px]=Es(ux),[fx,mx]=px(ux);function hx(e){const{__scopeCheckbox:n,checked:o,children:a,defaultChecked:i,disabled:s,form:l,name:c,onCheckedChange:d,required:u,value:p="on",internal_do_not_use_render:f}=e,[m,h]=Ks({prop:o,defaultProp:i??!1,onChange:d,caller:ux}),[v,g]=r.useState(null),[x,y]=r.useState(null),b=r.useRef(!1),w=!v||(!!l||!!v.closest("form")),k={checked:m,disabled:s,setChecked:h,control:v,setControl:g,name:c,form:l,value:p,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:!Nx(i)&&i,isFormControl:w,bubbleInput:x,setBubbleInput:y};return t.jsx(fx,{scope:n,...k,children:jx(f)?f(k):a})}var vx="CheckboxTrigger",gx=r.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:o,...a},i)=>{const{control:s,value:l,disabled:c,checked:d,required:u,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:v}=mx(vx,e),g=Rs(i,p),x=r.useRef(d);return r.useEffect(()=>{const e=s?.form;if(e){const t=()=>f(x.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[s,f]),t.jsx(Us.button,{type:"button",role:"checkbox","aria-checked":Nx(d)?"mixed":d,"aria-required":u,"data-state":Cx(d),"data-disabled":c?"":void 0,disabled:c,value:l,...a,ref:g,onKeyDown:qs(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:qs(o,e=>{f(e=>!!Nx(e)||!e),v&&h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})});gx.displayName=vx;var xx=r.forwardRef((e,n)=>{const{__scopeCheckbox:o,name:r,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:d,form:u,...p}=e;return t.jsx(hx,{__scopeCheckbox:o,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>t.jsxs(t.Fragment,{children:[t.jsx(gx,{...p,ref:n,__scopeCheckbox:o}),e&&t.jsx(kx,{__scopeCheckbox:o})]})})});xx.displayName=ux;var yx="CheckboxIndicator",bx=r.forwardRef((e,n)=>{const{__scopeCheckbox:o,forceMount:r,...a}=e,i=mx(yx,o);return t.jsx(Gs,{present:r||Nx(i.checked)||!0===i.checked,children:t.jsx(Us.span,{"data-state":Cx(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:n,style:{pointerEvents:"none",...e.style}})})});bx.displayName=yx;var wx="CheckboxBubbleInput",kx=r.forwardRef(({__scopeCheckbox:e,...n},o)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:l,required:c,disabled:d,name:u,value:p,form:f,bubbleInput:m,setBubbleInput:h}=mx(wx,e),v=Rs(o,h),g=Vf(s),x=Nf(a);r.useEffect(()=>{const e=m;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,o=!i.current;if(g!==s&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Nx(s),n.call(e,!Nx(s)&&s),e.dispatchEvent(t)}},[m,g,s,i]);const y=r.useRef(!Nx(s)&&s);return t.jsx(Us.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??y.current,required:c,disabled:d,name:u,value:p,form:f,...n,tabIndex:-1,ref:v,style:{...n.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function jx(e){return"function"==typeof e}function Nx(e){return"indeterminate"===e}function Cx(e){return Nx(e)?"indeterminate":e?"checked":"unchecked"}kx.displayName=wx;const _x=r.forwardRef(({className:e,...n},o)=>t.jsx(xx,{ref:o,className:Ie("bg-white peer w-[18px] h-[18px] shrink-0 rounded-md border-gray-300 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:input-data-checked data-[state=checked]:border-none data-[state=checked]:text-primary-foreground",e),...n,children:t.jsx(bx,{className:Ie("flex items-center justify-center text-current"),children:t.jsx(ei,{className:"h-4 w-4"})})}));_x.displayName=xx.displayName;var Dx=r.forwardRef((e,n)=>t.jsx(Us.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Dx.displayName="Label";var Sx=Dx;const Ex=w("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Mx=r.forwardRef(({className:e,...n},o)=>t.jsx(Sx,{ref:o,className:Ie(Ex(),e),...n}));Mx.displayName=Sx.displayName;var[Ox]=Es("Tooltip",[Df]),Tx=Df(),Rx="TooltipProvider",Px=700,Ax="tooltip.open",[Ix,Fx]=Ox(Rx),zx=e=>{const{__scopeTooltip:n,delayDuration:o=Px,skipDelayDuration:a=300,disableHoverableContent:i=!1,children:s}=e,l=r.useRef(!0),c=r.useRef(!1),d=r.useRef(0);return r.useEffect(()=>{const e=d.current;return()=>window.clearTimeout(e)},[]),t.jsx(Ix,{scope:n,isOpenDelayedRef:l,delayDuration:o,onOpen:r.useCallback(()=>{a<=0||(window.clearTimeout(d.current),l.current=!1)},[a]),onClose:r.useCallback(()=>{a<=0||(window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,a))},[a]),isPointerInTransitRef:c,onPointerInTransitChange:r.useCallback(e=>{c.current=e},[]),disableHoverableContent:i,children:s})};zx.displayName=Rx;var Lx="Tooltip",[Wx,Bx]=Ox(Lx),$x=e=>{const{__scopeTooltip:n,children:o,open:a,defaultOpen:i,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=e,d=Fx(Lx,e.__scopeTooltip),u=Tx(n),[p,f]=r.useState(null),m=el(),h=r.useRef(0),v=l??d.disableHoverableContent,g=c??d.delayDuration,x=r.useRef(!1),[y,b]=Ks({prop:a,defaultProp:i??!1,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(Ax))):d.onClose(),s?.(e)},caller:Lx}),w=r.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),k=r.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x.current=!1,b(!0)},[b]),j=r.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),N=r.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{x.current=!0,b(!0),h.current=0},g)},[g,b]);return r.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),t.jsx(qf,{...u,children:t.jsx(Wx,{scope:n,contentId:m,open:y,stateAttribute:w,trigger:p,onTriggerChange:f,onTriggerEnter:r.useCallback(()=>{d.isOpenDelayedRef.current?N():k()},[d.isOpenDelayedRef,N,k]),onTriggerLeave:r.useCallback(()=>{v?j():(window.clearTimeout(h.current),h.current=0)},[j,v]),onOpen:k,onClose:j,disableHoverableContent:v,children:o})})};$x.displayName=Lx;var qx="TooltipTrigger",Yx=r.forwardRef((e,n)=>{const{__scopeTooltip:o,...a}=e,i=Bx(qx,o),s=Fx(qx,o),l=Tx(o),c=Rs(n,r.useRef(null),i.onTriggerChange),d=r.useRef(!1),u=r.useRef(!1),p=r.useCallback(()=>d.current=!1,[]);return r.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),t.jsx(Yf,{asChild:!0,...l,children:t.jsx(Us.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:c,onPointerMove:qs(e.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||s.isPointerInTransitRef.current||(i.onTriggerEnter(),u.current=!0))}),onPointerLeave:qs(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:qs(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:qs(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:qs(e.onBlur,i.onClose),onClick:qs(e.onClick,i.onClose)})})});Yx.displayName=qx;var[Hx,Kx]=Ox("TooltipPortal",{forceMount:void 0}),Ux="TooltipContent",Vx=r.forwardRef((e,n)=>{const o=Kx(Ux,e.__scopeTooltip),{forceMount:r=o.forceMount,side:a="top",...i}=e,s=Bx(Ux,e.__scopeTooltip);return t.jsx(Gs,{present:r||s.open,children:s.disableHoverableContent?t.jsx(Jx,{side:a,...i,ref:n}):t.jsx(Gx,{side:a,...i,ref:n})})}),Gx=r.forwardRef((e,n)=>{const o=Bx(Ux,e.__scopeTooltip),a=Fx(Ux,e.__scopeTooltip),i=r.useRef(null),s=Rs(n,i),[l,c]=r.useState(null),{trigger:d,onClose:u}=o,p=i.current,{onPointerInTransitChange:f}=a,m=r.useCallback(()=>{c(null),f(!1)},[f]),h=r.useCallback((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}(o,function(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,o,r,a)){case a:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,n.getBoundingClientRect())),a=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}(t.getBoundingClientRect())]);c(a),f(!0)},[f]);return r.useEffect(()=>()=>m(),[m]),r.useEffect(()=>{if(d&&p){const e=e=>h(e,p),t=e=>h(e,d);return d.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[d,p,h,m]),r.useEffect(()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=d?.contains(t)||p?.contains(t),r=!function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>o!=u>o&&n<(d-l)*(o-c)/(u-c)+l&&(r=!r)}return r}(n,l);o?m():r&&(m(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,p,l,u,m]),t.jsx(Jx,{...e,ref:s})}),[Zx,Xx]=Ox(Lx,{isInside:!1}),Qx=function(e){const t=e=>"child"in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=As,t}("TooltipContent"),Jx=r.forwardRef((e,n)=>{const{__scopeTooltip:o,children:a,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=e,d=Bx(Ux,o),u=Tx(o),{onClose:p}=d;return r.useEffect(()=>(document.addEventListener(Ax,p),()=>document.removeEventListener(Ax,p)),[p]),r.useEffect(()=>{if(d.trigger){const e=e=>{e.target instanceof Node&&e.target.contains(d.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[d.trigger,p]),t.jsx(rf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(Hf,{"data-state":d.stateAttribute,...u,...c,ref:n,style:{...c.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:[t.jsx(Qx,{children:a}),t.jsx(Zx,{scope:o,isInside:!0,children:t.jsx(Xf,{id:d.contentId,role:"tooltip",children:i||a})})]})})});Vx.displayName=Ux;var ey="TooltipArrow";r.forwardRef((e,n)=>{const{__scopeTooltip:o,...r}=e,a=Tx(o);return Xx(ey,o).isInside?null:t.jsx(Kf,{...a,...r,ref:n})}).displayName=ey;var ty=Vx;const ny=zx,oy=$x,ry=Yx,ay=r.forwardRef(({className:e,sideOffset:n=4,...o},r)=>t.jsx(ty,{ref:r,sideOffset:n,className:Ie("border border-body rounded-md z-50 overflow-hidden bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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",e),...o}));ay.displayName=ty.displayName;const iy=w("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),sy=r.forwardRef(({className:e,variant:n,...o},r)=>t.jsx("div",{ref:r,role:"alert",className:Ie(iy({variant:n}),e),...o}));sy.displayName="Alert";const ly=r.forwardRef(({className:e,...n},o)=>t.jsx("h5",{ref:o,className:Ie("mb-1 font-medium leading-none tracking-tight",e),...n}));ly.displayName="AlertTitle";const cy=r.forwardRef(({className:e,...n},o)=>t.jsx("div",{ref:o,className:Ie("text-sm [&_p]:leading-relaxed",e),...n}));cy.displayName="AlertDescription";var dy="rovingFocusGroup.onEntryFocus",uy={bubbles:!1,cancelable:!0},py="RovingFocusGroup",[fy,my,hy]=$s(py),[vy,gy]=Es(py,[hy]),[xy,yy]=vy(py),by=r.forwardRef((e,n)=>t.jsx(fy.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(fy.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(wy,{...e,ref:n})})}));by.displayName=py;var wy=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,orientation:a,loop:i=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...f}=e,m=r.useRef(null),h=Rs(n,m),v=gl(s),[g,x]=Ks({prop:l,defaultProp:c??null,onChange:d,caller:py}),[y,b]=r.useState(!1),w=Qp(u),k=my(o),j=r.useRef(!1),[N,C]=r.useState(0);return r.useEffect(()=>{const e=m.current;if(e)return e.addEventListener(dy,w),()=>e.removeEventListener(dy,w)},[w]),t.jsx(xy,{scope:o,orientation:a,dir:v,loop:i,currentTabStopId:g,onItemFocus:r.useCallback(e=>x(e),[x]),onItemShiftTab:r.useCallback(()=>b(!0),[]),onFocusableItemAdd:r.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>C(e=>e-1),[]),children:t.jsx(Us.div,{tabIndex:y||0===N?-1:0,"data-orientation":a,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:qs(e.onMouseDown,()=>{j.current=!0}),onFocus:qs(e.onFocus,e=>{const t=!j.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(dy,uy);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);Cy([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),p)}}j.current=!1}),onBlur:qs(e.onBlur,()=>b(!1))})})}),ky="RovingFocusGroupItem",jy=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,focusable:a=!0,active:i=!1,tabStopId:s,children:l,...c}=e,d=el(),u=s||d,p=yy(ky,o),f=p.currentTabStopId===u,m=my(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=p;return r.useEffect(()=>{if(a)return h(),()=>v()},[a,h,v]),t.jsx(fy.ItemSlot,{scope:o,id:u,focusable:a,active:i,children:t.jsx(Us.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:n,onMouseDown:qs(e.onMouseDown,e=>{a?p.onItemFocus(u):e.preventDefault()}),onFocus:qs(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:qs(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const o=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(o)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)?void 0:Ny[o]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const a=r.indexOf(e.currentTarget);r=p.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>Cy(r))}var n,o}),children:"function"==typeof l?l({isCurrentTabStop:f,hasTabStop:null!=g}):l})})});jy.displayName=ky;var Ny={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cy(e,t=!1){const n=document.activeElement;for(const o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}var _y=by,Dy=jy,Sy=["Enter"," "],Ey=["ArrowUp","PageDown","End"],My=["ArrowDown","PageUp","Home",...Ey],Oy={ltr:[...Sy,"ArrowRight"],rtl:[...Sy,"ArrowLeft"]},Ty={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ry="Menu",[Py,Ay,Iy]=$s(Ry),[Fy,zy]=Es(Ry,[Iy,Df,gy]),Ly=Df(),Wy=gy(),[By,$y]=Fy(Ry),[qy,Yy]=Fy(Ry),Hy=e=>{const{__scopeMenu:n,open:o=!1,children:a,dir:i,onOpenChange:s,modal:l=!0}=e,c=Ly(n),[d,u]=r.useState(null),p=r.useRef(!1),f=Qp(s),m=gl(i);return r.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),r.useEffect(()=>{if(!o)return;const e=()=>f(!1);return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[o,f]),t.jsx(qf,{...c,children:t.jsx(By,{scope:n,open:o,onOpenChange:f,content:d,onContentChange:u,children:t.jsx(qy,{scope:n,onClose:r.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:m,modal:l,children:a})})})};Hy.displayName=Ry;var Ky=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e,a=Ly(o);return t.jsx(Yf,{...a,...r,ref:n})});Ky.displayName="MenuAnchor";var Uy="MenuPortal",[Vy,Gy]=Fy(Uy,{forceMount:void 0}),Zy=e=>{const{__scopeMenu:n,forceMount:o,children:r,container:a}=e,i=$y(Uy,n);return t.jsx(Vy,{scope:n,forceMount:o,children:t.jsx(Gs,{present:o||i.open,children:t.jsx(Uf,{asChild:!0,container:a,children:r})})})};Zy.displayName=Uy;var Xy="MenuContent",[Qy,Jy]=Fy(Xy),eb=r.forwardRef((e,n)=>{const o=Gy(Xy,e.__scopeMenu),{forceMount:r=o.forceMount,...a}=e,i=$y(Xy,e.__scopeMenu),s=Yy(Xy,e.__scopeMenu);return t.jsx(Py.Provider,{scope:e.__scopeMenu,children:t.jsx(Gs,{present:r||i.open,children:t.jsx(Py.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(tb,{...a,ref:n}):t.jsx(nb,{...a,ref:n})})})})}),tb=r.forwardRef((e,n)=>{const o=$y(Xy,e.__scopeMenu),a=r.useRef(null),i=Rs(n,a);return r.useEffect(()=>{const e=a.current;if(e)return ir(e)},[]),t.jsx(rb,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:qs(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),nb=r.forwardRef((e,n)=>{const o=$y(Xy,e.__scopeMenu);return t.jsx(rb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})}),ob=Ps("MenuContent.ScrollLock"),rb=r.forwardRef((e,n)=>{const{__scopeMenu:o,loop:a=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:h,disableOutsideScroll:v,...g}=e,x=$y(Xy,o),y=Yy(Xy,o),b=Ly(o),w=Wy(o),k=Ay(o),[j,N]=r.useState(null),C=r.useRef(null),_=Rs(n,C,x.onContentChange),D=r.useRef(0),S=r.useRef(""),E=r.useRef(0),M=r.useRef(null),O=r.useRef("right"),T=r.useRef(0),R=v?Jo:r.Fragment,P=v?{as:ob,allowPinchZoom:!0}:void 0,A=e=>{const t=S.current+e,n=k().filter(e=>!e.disabled),o=document.activeElement,r=n.find(e=>e.ref.current===o)?.textValue,a=function(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0]),r=o?t[0]:t,a=n?e.indexOf(n):-1;let i=(s=e,l=Math.max(a,0),s.map((e,t)=>s[(l+t)%s.length]));var s,l;1===r.length&&(i=i.filter(e=>e!==n));const c=i.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}(n.map(e=>e.textValue),t,r),i=n.find(e=>e.textValue===a)?.ref.current;!function e(t){S.current=t,window.clearTimeout(D.current),""!==t&&(D.current=window.setTimeout(()=>e(""),1e3))}(t),i&&setTimeout(()=>i.focus())};r.useEffect(()=>()=>window.clearTimeout(D.current),[]),df();const I=r.useCallback(e=>O.current===M.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>o!=u>o&&n<(d-l)*(o-c)/(u-c)+l&&(r=!r)}return r}(n,t)}(e,M.current?.area),[]);return t.jsx(Qy,{scope:o,searchRef:S,onItemEnter:r.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:r.useCallback(e=>{I(e)||(C.current?.focus(),N(null))},[I]),onTriggerLeave:r.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:E,onPointerGraceIntentChange:r.useCallback(e=>{M.current=e},[]),children:t.jsx(R,{...P,children:t.jsx(hf,{asChild:!0,trapped:i,onMountAutoFocus:qs(s,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:t.jsx(rf,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:h,children:t.jsx(_y,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:a,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:qs(d,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(Hf,{role:"menu","aria-orientation":"vertical","data-state":Tb(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...g,ref:_,style:{outline:"none",...g.style},onKeyDown:qs(g.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,o=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&o&&A(e.key));const r=C.current;if(e.target!==r)return;if(!My.includes(e.key))return;e.preventDefault();const a=k().filter(e=>!e.disabled).map(e=>e.ref.current);Ey.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(a)}),onBlur:qs(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),S.current="")}),onPointerMove:qs(e.onPointerMove,Ab(e=>{const t=e.target,n=T.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>T.current?"right":"left";O.current=t,T.current=e.clientX}}))})})})})})})});eb.displayName=Xy;var ab=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Us.div,{role:"group",...r,ref:n})});ab.displayName="MenuGroup";var ib=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Us.div,{...r,ref:n})});ib.displayName="MenuLabel";var sb="MenuItem",lb="menu.itemSelect",cb=r.forwardRef((e,n)=>{const{disabled:o=!1,onSelect:a,...i}=e,s=r.useRef(null),l=Yy(sb,e.__scopeMenu),c=Jy(sb,e.__scopeMenu),d=Rs(n,s),u=r.useRef(!1);return t.jsx(db,{...i,ref:d,disabled:o,onClick:qs(e.onClick,()=>{const e=s.current;if(!o&&e){const t=new CustomEvent(lb,{bubbles:!0,cancelable:!0});e.addEventListener(lb,e=>a?.(e),{once:!0}),Vs(e,t),t.defaultPrevented?u.current=!1:l.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:qs(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:qs(e.onKeyDown,e=>{const t=""!==c.searchRef.current;o||t&&" "===e.key||Sy.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});cb.displayName=sb;var db=r.forwardRef((e,n)=>{const{__scopeMenu:o,disabled:a=!1,textValue:i,...s}=e,l=Jy(sb,o),c=Wy(o),d=r.useRef(null),u=Rs(n,d),[p,f]=r.useState(!1),[m,h]=r.useState("");return r.useEffect(()=>{const e=d.current;e&&h((e.textContent??"").trim())},[s.children]),t.jsx(Py.ItemSlot,{scope:o,disabled:a,textValue:i??m,children:t.jsx(Dy,{asChild:!0,...c,focusable:!a,children:t.jsx(Us.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...s,ref:u,onPointerMove:qs(e.onPointerMove,Ab(e=>{if(a)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:qs(e.onPointerLeave,Ab(e=>l.onItemLeave(e))),onFocus:qs(e.onFocus,()=>f(!0)),onBlur:qs(e.onBlur,()=>f(!1))})})})}),ub=r.forwardRef((e,n)=>{const{checked:o=!1,onCheckedChange:r,...a}=e;return t.jsx(yb,{scope:e.__scopeMenu,checked:o,children:t.jsx(cb,{role:"menuitemcheckbox","aria-checked":Rb(o)?"mixed":o,...a,ref:n,"data-state":Pb(o),onSelect:qs(a.onSelect,()=>r?.(!!Rb(o)||!o),{checkForDefaultPrevented:!1})})})});ub.displayName="MenuCheckboxItem";var pb="MenuRadioGroup",[fb,mb]=Fy(pb,{value:void 0,onValueChange:()=>{}}),hb=r.forwardRef((e,n)=>{const{value:o,onValueChange:r,...a}=e,i=Qp(r);return t.jsx(fb,{scope:e.__scopeMenu,value:o,onValueChange:i,children:t.jsx(ab,{...a,ref:n})})});hb.displayName=pb;var vb="MenuRadioItem",gb=r.forwardRef((e,n)=>{const{value:o,...r}=e,a=mb(vb,e.__scopeMenu),i=o===a.value;return t.jsx(yb,{scope:e.__scopeMenu,checked:i,children:t.jsx(cb,{role:"menuitemradio","aria-checked":i,...r,ref:n,"data-state":Pb(i),onSelect:qs(r.onSelect,()=>a.onValueChange?.(o),{checkForDefaultPrevented:!1})})})});gb.displayName=vb;var xb="MenuItemIndicator",[yb,bb]=Fy(xb,{checked:!1}),wb=r.forwardRef((e,n)=>{const{__scopeMenu:o,forceMount:r,...a}=e,i=bb(xb,o);return t.jsx(Gs,{present:r||Rb(i.checked)||!0===i.checked,children:t.jsx(Us.span,{...a,ref:n,"data-state":Pb(i.checked)})})});wb.displayName=xb;var kb=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Us.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})});kb.displayName="MenuSeparator";var jb=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e,a=Ly(o);return t.jsx(Kf,{...a,...r,ref:n})});jb.displayName="MenuArrow";var Nb="MenuSub",[Cb,_b]=Fy(Nb),Db=e=>{const{__scopeMenu:n,children:o,open:a=!1,onOpenChange:i}=e,s=$y(Nb,n),l=Ly(n),[c,d]=r.useState(null),[u,p]=r.useState(null),f=Qp(i);return r.useEffect(()=>(!1===s.open&&f(!1),()=>f(!1)),[s.open,f]),t.jsx(qf,{...l,children:t.jsx(By,{scope:n,open:a,onOpenChange:f,content:u,onContentChange:p,children:t.jsx(Cb,{scope:n,contentId:el(),triggerId:el(),trigger:c,onTriggerChange:d,children:o})})})};Db.displayName=Nb;var Sb="MenuSubTrigger",Eb=r.forwardRef((e,n)=>{const o=$y(Sb,e.__scopeMenu),a=Yy(Sb,e.__scopeMenu),i=_b(Sb,e.__scopeMenu),s=Jy(Sb,e.__scopeMenu),l=r.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,u={__scopeMenu:e.__scopeMenu},p=r.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return r.useEffect(()=>p,[p]),r.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),d(null)}},[c,d]),t.jsx(Ky,{asChild:!0,...u,children:t.jsx(db,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?i.contentId:void 0,"data-state":Tb(o.open),...e,ref:Ts(n,i.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:qs(e.onPointerMove,Ab(t=>{s.onItemEnter(t),t.defaultPrevented||e.disabled||o.open||l.current||(s.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{o.onOpenChange(!0),p()},100))})),onPointerLeave:qs(e.onPointerLeave,Ab(e=>{p();const t=o.content?.getBoundingClientRect();if(t){const n=o.content?.dataset.side,r="right"===n,a=r?-5:5,i=t[r?"left":"right"],l=t[r?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:i,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:qs(e.onKeyDown,t=>{const n=""!==s.searchRef.current;e.disabled||n&&" "===t.key||Oy[a.dir].includes(t.key)&&(o.onOpenChange(!0),o.content?.focus(),t.preventDefault())})})})});Eb.displayName=Sb;var Mb="MenuSubContent",Ob=r.forwardRef((e,n)=>{const o=Gy(Xy,e.__scopeMenu),{forceMount:a=o.forceMount,align:i="start",...s}=e,l=$y(Xy,e.__scopeMenu),c=Yy(Xy,e.__scopeMenu),d=_b(Mb,e.__scopeMenu),u=r.useRef(null),p=Rs(n,u);return t.jsx(Py.Provider,{scope:e.__scopeMenu,children:t.jsx(Gs,{present:a||l.open,children:t.jsx(Py.Slot,{scope:e.__scopeMenu,children:t.jsx(rb,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:p,align:i,side:"rtl"===c.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:qs(e.onFocusOutside,e=>{e.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:qs(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:qs(e.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=Ty[c.dir].includes(e.key);t&&n&&(l.onOpenChange(!1),d.trigger?.focus(),e.preventDefault())})})})})})});function Tb(e){return e?"open":"closed"}function Rb(e){return"indeterminate"===e}function Pb(e){return Rb(e)?"indeterminate":e?"checked":"unchecked"}function Ab(e){return t=>"mouse"===t.pointerType?e(t):void 0}Ob.displayName=Mb;var Ib=Hy,Fb=Ky,zb=Zy,Lb=eb,Wb=ab,Bb=ib,$b=cb,qb=ub,Yb=hb,Hb=gb,Kb=wb,Ub=kb,Vb=jb,Gb=Db,Zb=Eb,Xb=Ob,Qb="DropdownMenu",[Jb]=Es(Qb,[zy]),ew=zy(),[tw,nw]=Jb(Qb),ow=e=>{const{__scopeDropdownMenu:n,children:o,dir:a,open:i,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=ew(n),u=r.useRef(null),[p,f]=Ks({prop:i,defaultProp:s??!1,onChange:l,caller:Qb});return t.jsx(tw,{scope:n,triggerId:el(),triggerRef:u,contentId:el(),open:p,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),modal:c,children:t.jsx(Ib,{...d,open:p,onOpenChange:f,dir:a,modal:c,children:o})})};ow.displayName=Qb;var rw="DropdownMenuTrigger",aw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,disabled:r=!1,...a}=e,i=nw(rw,o),s=ew(o);return t.jsx(Fb,{asChild:!0,...s,children:t.jsx(Us.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Ts(n,i.triggerRef),onPointerDown:qs(e.onPointerDown,e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:qs(e.onKeyDown,e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});aw.displayName=rw;var iw=e=>{const{__scopeDropdownMenu:n,...o}=e,r=ew(n);return t.jsx(zb,{...r,...o})};iw.displayName="DropdownMenuPortal";var sw="DropdownMenuContent",lw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...a}=e,i=nw(sw,o),s=ew(o),l=r.useRef(!1);return t.jsx(Lb,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...a,ref:n,onCloseAutoFocus:qs(e.onCloseAutoFocus,e=>{l.current||i.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:qs(e.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;i.modal&&!o||(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});lw.displayName=sw;var cw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Wb,{...a,...r,ref:n})});cw.displayName="DropdownMenuGroup";var dw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Bb,{...a,...r,ref:n})});dw.displayName="DropdownMenuLabel";var uw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx($b,{...a,...r,ref:n})});uw.displayName="DropdownMenuItem";var pw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(qb,{...a,...r,ref:n})});pw.displayName="DropdownMenuCheckboxItem";var fw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Yb,{...a,...r,ref:n})});fw.displayName="DropdownMenuRadioGroup";var mw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Hb,{...a,...r,ref:n})});mw.displayName="DropdownMenuRadioItem";var hw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Kb,{...a,...r,ref:n})});hw.displayName="DropdownMenuItemIndicator";var vw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Ub,{...a,...r,ref:n})});vw.displayName="DropdownMenuSeparator";r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Vb,{...a,...r,ref:n})}).displayName="DropdownMenuArrow";var gw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Zb,{...a,...r,ref:n})});gw.displayName="DropdownMenuSubTrigger";var xw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=ew(o);return t.jsx(Xb,{...a,...r,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xw.displayName="DropdownMenuSubContent";var yw=iw,bw=lw,ww=dw,kw=uw,jw=pw,Nw=mw,Cw=hw,_w=vw,Dw=gw,Sw=xw;const Ew=ow,Mw=aw,Ow=cw,Tw=yw,Rw=e=>{const{__scopeDropdownMenu:n,children:o,open:r,onOpenChange:a,defaultOpen:i}=e,s=ew(n),[l,c]=Ks({prop:r,defaultProp:i??!1,onChange:a,caller:"DropdownMenuSub"});return t.jsx(Gb,{...s,open:l,onOpenChange:c,children:o})},Pw=fw,Aw=r.forwardRef(({className:e,inset:n,children:o,...r},a)=>t.jsxs(Dw,{ref:a,className:Ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",e),...r,children:[o,t.jsx(oi,{className:"ml-auto h-4 w-4"})]}));Aw.displayName=Dw.displayName;const Iw=r.forwardRef(({className:e,...n},o)=>t.jsx(Sw,{ref:o,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",e),...n}));Iw.displayName=Sw.displayName;const Fw=r.forwardRef(({className:e,sideOffset:n=4,...o},r)=>t.jsx(yw,{children:t.jsx(bw,{ref:r,sideOffset:n,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",e),...o})}));Fw.displayName=bw.displayName;const zw=r.forwardRef(({className:e,inset:n,...o},r)=>t.jsx(kw,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",e),...o}));zw.displayName=kw.displayName;const Lw=r.forwardRef(({className:e,children:n,checked:o,...r},a)=>t.jsxs(jw,{ref:a,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Cw,{children:t.jsx(ei,{className:"h-4 w-4"})})}),n]}));Lw.displayName=jw.displayName;const Ww=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(Nw,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Cw,{children:t.jsx(ii,{className:"h-2 w-2 fill-current"})})}),n]}));Ww.displayName=Nw.displayName;const Bw=r.forwardRef(({className:e,inset:n,...o},r)=>t.jsx(ww,{ref:r,className:Ie("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...o}));Bw.displayName=ww.displayName;const $w=r.forwardRef(({className:e,...n},o)=>t.jsx(_w,{ref:o,className:Ie("-mx-1 my-1 h-px bg-muted",e),...n}));$w.displayName=_w.displayName;const qw=({className:e,...n})=>t.jsx("span",{className:Ie("ml-auto text-xs tracking-widest opacity-60",e),...n});qw.displayName="DropdownMenuShortcut";const Yw=r.forwardRef(({className:e,...n},o)=>t.jsx("input",{type:"radio",className:Ie("h-4 w-4 cursor-pointer accent-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...n}));Yw.displayName="Radio";const Hw=({size:e=8})=>t.jsxs("output",{children:[t.jsxs("svg",{width:4*e,height:4*e,viewBox:"0 0 78 78",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin",role:"img","aria-labelledby":"spinnerTitle",children:[t.jsx("title",{id:"spinnerTitle",children:"Loading..."}),t.jsx("path",{d:"M13.2131 9.74186C7.6162 14.6748 3.55158 21.1095 1.50144 28.2828L9.89497 30.6817C11.4862 25.114 14.641 20.1196 18.9852 16.2909L13.2131 9.74186Z",fill:"#0d406e"}),t.jsx("path",{d:"M55.2865 74.4365C62.0653 71.321 67.8083 66.3265 71.8342 60.0455L64.4847 55.3347C61.36 60.2099 56.9025 64.0864 51.641 66.5046L55.2865 74.4365Z",fill:"#0d406e"}),t.jsx("path",{d:"M71.8342 60.0455C75.8601 53.7645 78 46.4605 78 39H69.2704C69.2704 44.7906 67.6095 50.4596 64.4847 55.3347L71.8342 60.0455Z",fill:"#0d406e"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.2131 9.74186C20.1094 4.11892 24.5245 2.24347 33.0785 0.452148C25.7044 1.58491 18.8101 4.80896 13.2131 9.74186Z",fill:"#0d406e"}),t.jsx("path",{d:"M33.5891 77.6228C40.9774 78.6579 48.5077 77.5521 55.2865 74.4365L51.641 66.5046C46.3795 68.9227 40.5348 69.781 34.8002 68.9776L33.5891 77.6228Z",fill:"#0d406e"}),t.jsx("path",{d:"M13.6026 68.5968C19.2643 73.4552 26.2007 76.5877 33.5891 77.6228L34.8002 68.9776C29.0657 68.1742 23.6818 65.7429 19.2874 61.9719L13.6026 68.5968Z",fill:"#0d406e"}),t.jsx("path",{d:"M1.50144 28.2828C-0.548705 35.4561 -0.498346 43.0669 1.64654 50.2124L10.0076 47.7027C8.34281 42.1566 8.30373 36.2493 9.89497 30.6817L1.50144 28.2828Z",fill:"#0d406e"}),t.jsx("path",{d:"M1.64654 50.2124C3.79143 57.358 7.94084 63.7384 13.6026 68.5968L19.2874 61.9719C14.893 58.201 11.6724 53.2488 10.0076 47.7027L1.64654 50.2124Z",fill:"#0d406e"}),t.jsx("path",{d:"M34.4039 9.08055L33.0785 0.452148C24.5245 2.24347 20.1094 4.11892 13.2131 9.74186L18.9852 16.2909C23.3293 12.4621 28.6805 9.95976 34.4039 9.08055Z",fill:"#0d406e"})]}),t.jsx("span",{className:"sr-only",children:"Loading..."})]});const Kw=async(e,{search:t,modelClass:n,labelName:o,additionalFilters:r={},fields:a})=>{const i={...t?{[`${o}__icontains`]:t}:{},...r},s=a?.length?[o,...a]:[],[l,c]=await e(n,i,s);if(c)throw new Error(c.message);return l??[]};const Uw=({triggerClassName:n,className:o,trigger:r,children:a})=>{const i=e.useId();return t.jsx(ny,{children:t.jsxs(oy,{children:[t.jsx(ry,{asChild:!0,children:t.jsx("div",{className:n,children:r})}),t.jsx(ay,{className:o,children:a})]})},i)};exports.Accordion=Zl,exports.AccordionContent=Jl,exports.AccordionItem=Xl,exports.AccordionTrigger=Ql,exports.Alert=sy,exports.AlertDescription=cy,exports.AlertDialog=ja,exports.AlertDialogAction=Oa,exports.AlertDialogCancel=Ta,exports.AlertDialogContent=_a,exports.AlertDialogDescription=Ma,exports.AlertDialogFooter=Sa,exports.AlertDialogHeader=Da,exports.AlertDialogOverlay=Ca,exports.AlertDialogPortal=Na,exports.AlertDialogTitle=Ea,exports.AlertDialogTrigger=function({...e}){return t.jsx(ha,{"data-slot":"alert-dialog-trigger",...e})},exports.AlertTitle=ly,exports.AlertWithIcon=function({icon:e,title:n,description:o,variant:r="default",className:a}){return t.jsxs(sy,{variant:r,className:a??"w-auto h-auto m-4",children:[e,t.jsx(ly,{children:n}),t.jsx(cy,{children:o})]})},exports.Badge=function({className:e,variant:n,...o}){return t.jsx("div",{"data-slot":"badge",className:Ie($a({variant:n}),e),...o})},exports.Breadcrumb=function({...e}){return t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})},exports.BreadcrumbEllipsis=function({className:e,...n}){return t.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:Ie("flex size-9 items-center justify-center",e),...n,children:[t.jsx(di,{className:"size-4"}),t.jsx("span",{className:"sr-only",children:"More"})]})},exports.BreadcrumbItem=function({className:e,...n}){return t.jsx("li",{"data-slot":"breadcrumb-item",className:Ie("inline-flex items-center gap-1.5",e),...n})},exports.BreadcrumbLink=function({asChild:e,className:n,...o}){const r=e?f:"a";return t.jsx(r,{"data-slot":"breadcrumb-link",className:Ie("hover:text-foreground transition-colors",n),...o})},exports.BreadcrumbList=function({className:e,...n}){return t.jsx("ol",{"data-slot":"breadcrumb-list",className:Ie("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...n})},exports.BreadcrumbPage=function({className:e,...n}){return t.jsx("span",{"data-slot":"breadcrumb-page","aria-disabled":"true","aria-current":"page",className:Ie("text-foreground font-normal",e),...n})},exports.BreadcrumbSeparator=function({children:e,className:n,...o}){return t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Ie("[&>svg]:size-3.5",n),...o,children:e??t.jsx(oi,{})})},exports.Button=Le,exports.Calendar=Vg,exports.Card=Aa,exports.CardContent=La,exports.CardDescription=za,exports.CardFooter=Wa,exports.CardHeader=Ia,exports.CardTitle=Fa,exports.Checkbox=_x,exports.ClearButton=({handleClear:e})=>t.jsx("button",{type:"button",className:"h-10 p-2 mt-1 text-xs bg-white",onClick:e,children:t.jsxs(Ve,{direction:"row",gap:2,className:"items-center",children:["Limpar filtros ",t.jsx(xi,{size:16})]})}),exports.Combobox=Vp,exports.Command=nd,exports.CommandDialog=function({title:e="Command Palette",description:n="Search for a command to run...",children:o,className:r,showCloseButton:a=!0,...i}){return t.jsxs(Uc,{...i,children:[t.jsxs(Qc,{className:"sr-only",children:[t.jsx(ed,{children:e}),t.jsx(td,{children:n})]}),t.jsx(Xc,{className:Ie("overflow-hidden p-0",r),children:t.jsx(nd,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:o})})]})},exports.CommandEmpty=ad,exports.CommandGroup=id,exports.CommandInput=od,exports.CommandItem=sd,exports.CommandList=rd,exports.CommandSeparator=function({className:e,...n}){return t.jsx(Ic.Separator,{"data-slot":"command-separator",className:Ie("bg-border -mx-1 h-px",e),...n})},exports.CommandShortcut=function({className:e,...n}){return t.jsx("span",{"data-slot":"command-shortcut",className:Ie("text-muted-foreground ml-auto text-xs tracking-widest",e),...n})},exports.ConfirmationDialog=Ra,exports.DatePicker=({id:e,placeholder:n,value:o,onValueChange:r,className:a,boundary:i="start",dateFormat:s="dd/MM/yyyy"})=>{const l=Zg(o),c=((e,t)=>{const n=Zg(e);return n?wv(n,t):null})(o,s);return t.jsx("div",{className:Ie("flex w-full min-w-0",a),children:t.jsxs(Hp,{children:[t.jsx(Kp,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":e,className:Ie(We,"justify-start text-left",!c&&Be),children:[t.jsx(Ja,{className:Ie("mr-2","size-4 shrink-0 text-muted-foreground opacity-50")}),c??n]})}),t.jsx(Up,{className:"w-fit p-0",align:"start",children:t.jsx(Vg,{mode:"single",selected:l,onSelect:e=>{if(!e)return void r?.("");const t="end"===i?function(e,t){const n=kh(e,t?.in);return n.setHours(23,59,59,999),n}(e):Th(e);r?.(t.toISOString())},initialFocus:!0})})]})})},exports.DeleteDialog=({openDialog:e,setOpenDialog:n,handleDelete:o,count:r})=>{const a=void 0!==r&&r>1;return t.jsx(Ve,{direction:"row",children:t.jsx(Uc,{open:e,onOpenChange:n,children:t.jsxs(Xc,{className:"max-w-[513px] rounded-xl px-8 py-6 gap-4",children:[t.jsxs(Qc,{children:[t.jsx(ed,{className:"pb-0 border-none",children:a?`Deseja apagar ${r} registros selecionados?`:"Deseja apagar registro atual?"}),t.jsx(td,{})]}),t.jsx("form",{onSubmit:e=>{e.preventDefault(),o()},children:t.jsxs(Ve,{gap:2,children:[t.jsx("p",{className:"text-fontcolor-secondary font-medium text-sm",children:a?`Essa ação não poderá ser desfeita e os ${r} registros serão removidos permanentemente. Tem certeza de que deseja continuar?`:"Essa ação não poderá ser desfeita e o registro será removido permanentemente. Tem certeza de que deseja continuar?"}),t.jsxs(Jc,{className:"mt-4",children:[t.jsx(Rr,{asChild:!0,children:t.jsx(Le,{variant:"ghost",type:"button",children:"Cancelar"})}),t.jsx(Le,{type:"submit",variant:"default",children:a?`Deletar ${r}`:"Deletar"})]})]})})]})})})},exports.Dialog=Uc,exports.DialogContent=Xc,exports.DialogDescription=td,exports.DialogFooter=Jc,exports.DialogHeader=Qc,exports.DialogTitle=ed,exports.DialogTrigger=Vc,exports.DownloadButton=({item:n,modelClass:o,propertyName:r,retrieveFile:a})=>{const[i,s]=e.useState(!1);return t.jsx(Le,{variant:"outline",size:"icon",disabled:i||!a,onClick:async()=>{if(a){s(!0);try{const[e,t]=await a(o,Number(n[r]));if(t)return void Ai.error(`Houve algum problema: ${t.message}`);if(!e)return void Ai.error("Nenhum arquivo encontrado");const i=new Blob([new Uint8Array(e.data)],{type:e.contentType}),s=URL.createObjectURL(i),l=document.createElement("a");l.href=s,l.download=n.file.split(/[\\/]/).pop()??n.file,document.body.appendChild(l);try{l.click()}finally{document.body.removeChild(l),URL.revokeObjectURL(s)}Ai.success("Arquivo baixado com sucesso!")}finally{s(!1)}}else Ai.error("Função de download não configurada")},children:i?t.jsx(pi,{className:"animate-spin"}):t.jsx(ci,{})})},exports.DropdownMenu=Ew,exports.DropdownMenuCheckboxItem=Lw,exports.DropdownMenuContent=Fw,exports.DropdownMenuGroup=Ow,exports.DropdownMenuItem=zw,exports.DropdownMenuLabel=Bw,exports.DropdownMenuPortal=Tw,exports.DropdownMenuRadioGroup=Pw,exports.DropdownMenuRadioItem=Ww,exports.DropdownMenuSeparator=$w,exports.DropdownMenuShortcut=qw,exports.DropdownMenuSub=Rw,exports.DropdownMenuSubContent=Iw,exports.DropdownMenuSubTrigger=Aw,exports.DropdownMenuTrigger=Mw,exports.Dropzone=function({children:n,maxFiles:o=1,maxSize:r=5242880,accept:a={"text/csv":[".csv"]},onFilesAccepted:i}){const[s,l]=e.useState([]),[c,d]=e.useState([]),u=e.useCallback((e,t)=>{const n=t.map(({file:e})=>e);l(n),e.length>0&&(d(e),i(e))},[i]),{getRootProps:p,getInputProps:f,isDragActive:m}=_n({onDrop:u,maxFiles:o,maxSize:r,accept:a,multiple:o>1});return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{...p(),className:"border-2 border-dashed rounded-lg text-center cursor-pointer transition-colors "+(m?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-gray-400"),children:[t.jsx("input",{...f()}),t.jsxs("div",{className:Ie(c.length>0?"p-6 bg-green-100":"p-6","flex flex-col items-center justify-center gap-2"),children:[m&&t.jsx("p",{className:"font-medium text-blue-500",children:"Clique para selecionar os arquivos ou arraste-os aqui"}),!m&&c.length>0&&c.map(e=>t.jsx(Ve,{children:t.jsxs("p",{className:"font-medium",children:[t.jsx("b",{children:"Nome do arquivo:"})," ",e.name]})},e.name)),!m&&0===c.length&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"font-medium",children:"Clique para selecionar os arquivos ou arraste-os aqui"}),t.jsxs("p",{className:"text-sm text-gray-500",children:[r/1024/1024,"MB"]})]})]})]}),c.length>0&&t.jsx("div",{className:"w-full",children:n}),s.length>0&&t.jsxs("div",{className:"text-sm text-red-600",children:[t.jsx("h4",{className:"font-medium mb-2",children:"Rejected files:"}),t.jsx("ul",{className:"space-y-1",children:s.map(e=>t.jsxs("li",{className:"flex items-center justify-between",children:[t.jsxs("span",{children:[e.name," (",(e.size/1024).toFixed(2)," KB)"]}),t.jsx("button",{type:"button",onClick:()=>{return t=e.name,void l(e=>e.filter(e=>e.name!==t));var t},className:"text-red-800 hover:text-red-900",children:"×"})]},e.name))}),t.jsxs("p",{className:"mt-1",children:["File must be ",r/1024/1024,"MB or smaller."]})]})]})},exports.Empty=ec,exports.EmptyContainer=ic,exports.EmptyContent=function({className:e,...n}){return t.jsx("div",{"data-slot":"empty-content",className:Ie("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",e),...n})},exports.EmptyDescription=ac,exports.EmptyHeader=tc,exports.EmptyMedia=oc,exports.EmptyTitle=rc,exports.ErrorBoundary=({children:e,hasError:n,message:o="Um erro inesperado ocorreu."})=>n?t.jsx(sy,{variant:"destructive",className:"my-2",children:o}):t.jsx(t.Fragment,{children:e}),exports.ErrorMessage=({error:e})=>t.jsx(t.Fragment,{children:e&&t.jsx("span",{className:"text-red-500 text-xs",children:e?.message})}),exports.ErrorToastContent=({message:n,error:o})=>{const[r,a]=e.useState(!1),i=JSON.stringify(o,null,2);return t.jsxs(Ve,{children:[t.jsx("p",{children:n}),t.jsx(Zl,{type:"single",collapsible:!0,className:"max-w-60",children:t.jsxs(Xl,{value:"error-details",className:"border-none",children:[t.jsx(Ql,{className:"text-sm py-2 hover:no-underline text-red-100",children:"View Error Details"}),t.jsx(Jl,{children:t.jsx("pre",{className:"text-xs bg-red-950 p-3 rounded overflow-x-auto max-h-40 overflow-y-auto",children:t.jsx("code",{className:"text-red-100",children:i})})})]})}),t.jsx("button",{type:"button",onClick:()=>{const e=JSON.stringify(o,null,2);navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)},className:"flex items-center justify-center gap-2 px-3 py-2 bg-red-600 hover:bg-red-700 text-white text-xs font-medium rounded transition-colors",children:r?t.jsxs(t.Fragment,{children:[t.jsx(ei,{size:14}),t.jsx("span",{children:"Copied!"})]}):t.jsxs(t.Fragment,{children:[t.jsx(li,{size:14}),t.jsx("span",{children:"Copy Error JSON"})]})})]})},exports.FKSelect=Zp,exports.FileDropzone=function({onFileSelected:n,onFileDeleted:o,acceptExtensions:r,accept:a,maxSizeMB:i=25}){const[s,l]=e.useState(null),c=1024*i*1024,d=e.useMemo(()=>a||(r?.length?zi(r):Ii),[a,r]),u=e.useMemo(()=>Object.values(d).reduce((e,t)=>e.concat(t),[]).join(","),[d]),p=e.useCallback((e,t)=>{if(t.length>0){const{errors:e}=t[0],n=e[0];return void("file-too-large"===n.code?Ai.error(`File size must be under ${i} MB`):"file-invalid-type"===n.code?Ai.error(`Invalid file type. Allowed: ${r}`):Ai.error(n.message))}const o=e[0];o&&(l(o),n(new File([o],o.name,{type:o.type,lastModified:o.lastModified})),Ai.success(`File "${o.name}" selected successfully!`))},[n,i,r]),{getRootProps:f,getInputProps:m,isDragActive:h}=_n({onDrop:p,maxFiles:1,maxSize:c,accept:d,multiple:!1});return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("p",{className:"font-bold",children:["Envie um arquivo com até ",i," MB."]}),s?t.jsxs("div",{className:"flex items-center justify-between border rounded-md px-3 py-2 bg-white",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ui,{className:"h-4 w-4 text-gray-600"}),t.jsx("span",{className:"text-sm",children:s.name})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("button",{onClick:()=>{const e=document.createElement("input");e.type="file",e.accept=u,e.onchange=e=>{const t=e.target.files?.[0];if(!t)return;const o=Object.values(d).reduce((e,t)=>e.concat(t),[]);o.some(e=>t.name.toLowerCase().endsWith(e.toLowerCase()))?t.size>c?Ai.error(`File size must be under ${i} MB`):(l(t),n(t),Ai.success(`File "${t.name}" selected successfully!`)):Ai.error(`Invalid file type. Allowed: ${o.join(", ")}`)},e.click()},className:"p-1 hover:bg-gray-100 rounded",children:t.jsx(hi,{className:"h-4 w-4"})}),t.jsx("button",{onClick:()=>{l(null),o?.(),Ai.success("File removed")},className:"p-1 hover:bg-red-50 rounded",children:t.jsx(gi,{className:"h-4 w-4 text-red-600"})})]})]}):t.jsxs("div",{...f(),className:"border rounded-lg text-center cursor-pointer transition-colors h-[300px] "+(h?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-gray-400"),children:[t.jsx("input",{...m()}),t.jsxs("div",{className:"py-16 px-6 flex flex-col items-center",children:[t.jsx(si,{strokeWidth:1,className:"size-[80px] text-[#026CB6]"}),t.jsx("p",{className:"text-muted",children:"Arraste e solte ou selecione um arquivo."}),t.jsxs("p",{className:"text-muted",children:["Arquivos aceitos:",r]})]})]})]})},exports.Input=He,exports.Label=Mx,exports.Loading=function(){return t.jsxs("div",{className:"flex flex-col items-center justify-center mx-auto",children:[t.jsx(Hw,{size:12}),t.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Loading..."})]})},exports.MarkdownEditor=function({value:n,onChange:o,placeholder:r,error:a,disabled:i,className:s}){const l=e.useRef(null),[c,d]=e.useState(null);return e.useEffect(()=>{let e=!0;return Promise.all([import("@toast-ui/react-editor"),import("@toast-ui/editor/dist/toastui-editor.css")]).then(([t])=>{e&&d(()=>t.Editor)}),()=>{e=!1}},[]),c?t.jsxs(Ve,{direction:"col",gap:2,className:s??"w-full",children:[t.jsx(c,{initialValue:n,placeholder:r,usageStatistics:!1,autofocus:!1,initialEditType:"wysiwyg",previewStyle:"disabled",useCommandShortcut:!0,hideModeSwitch:i,onChange:()=>{const e=l.current?.getInstance()?.getMarkdown()??"";o(e)},ref:l}),a&&t.jsx("p",{className:"text-sm text-destructive",children:a})]}):t.jsx(Ve,{direction:"col",gap:2,className:s??"w-full min-h-[200px]",children:t.jsx("span",{})})},exports.MultiSelectDropdown=function({options:e,selected:n,onChange:o,placeholder:a="Select items...",className:i,maxDisplay:s=3}){const[l,c]=r.useState(!1),d=n.length===e.length&&e.length>0;return t.jsxs(lh,{open:l,onOpenChange:c,children:[t.jsx(uh,{className:Ie("w-full",i),children:t.jsx("span",{className:Ie("truncate flex-1 text-left",0===n.length&&"text-muted-foreground"),children:(()=>{if(0===n.length)return a;if(n.length>s)return`${n.length} items selected`;const t=n.map(t=>e.find(e=>e.value===t)?.label).join(", ");return t.length>80?`${n.length} item${1!==n.length?"s":""} selected`:t})()})}),t.jsxs(mh,{children:[e.length>0&&t.jsx("div",{className:"border-b border-border",children:t.jsxs("div",{className:"flex items-center space-x-2 cursor-pointer p-2 hover:bg-accent hover:text-accent-foreground rounded-sm w-full text-left font-medium",children:[t.jsx(_x,{checked:d,onCheckedChange:()=>{o(d?[]:e.map(e=>e.value))}}),t.jsx("span",{className:"text-sm",children:d?"Unselect All":"Select All"})]})}),t.jsx("div",{className:"p-1 space-y-1",children:e.map(e=>t.jsxs("div",{className:"flex items-center space-x-2 cursor-pointer p-2 hover:bg-accent hover:text-accent-foreground rounded-sm w-full text-left",children:[t.jsx(_x,{checked:n.includes(e.value),onCheckedChange:()=>(e=>{const t=n.includes(e)?n.filter(t=>t!==e):[...n,e];o(t)})(e.value)}),t.jsx("span",{className:"text-sm",children:e.label})]},e.value))}),n.length>0&&t.jsx("div",{className:"border-t border-border p-2 bg-muted",children:t.jsxs("div",{className:"text-xs text-muted-foreground",children:[n.length," item",1!==n.length?"s":""," selected"]})})]})]})},exports.NoResult=Xg,exports.Pagination=({startRecord:e,endRecord:n,hasValidSearchValues:o,tabCount:r,disabledLoadBackButton:a,disabledLoadMoreButton:i,loadBack:s,loadMore:l})=>t.jsxs("div",{className:"flex items-center gap-2 text-fontcolor-secondary",children:[t.jsx("div",{className:"text-sm",children:t.jsxs("p",{children:[e," - ",n," de"," ",o?n:r]})}),t.jsxs("div",{className:"h-[32px] flex items-center",children:[t.jsx(Uw,{className:"bg-zinc-900 text-white",trigger:t.jsx(Le,{variant:"ghost",disabled:a,onClick:()=>s(),type:"button",className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:t.jsx("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:t.jsx(ni,{size:16})})}),children:"Anteriores"}),t.jsx(Uw,{className:"bg-zinc-900 text-white",trigger:t.jsx(Le,{variant:"ghost",disabled:i,onClick:()=>l(),className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:t.jsx("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:t.jsx(oi,{size:16})})}),children:"Próximos"})]})]}),exports.Popover=Hp,exports.PopoverContent=Up,exports.PopoverTrigger=Kp,exports.PumpwoodBadge=function({className:e,variant:n,size:o,...r}){const a=Ie(qa({variant:n,size:o}),e);return t.jsx("div",{className:a,...r})},exports.PumpwoodCard=Ba,exports.PumpwoodTable=lx,exports.Radio=Yw,exports.Select=e=>{if("fk"===e.variant){const{variant:n,...o}=e;return t.jsx(Zp,{...o})}return t.jsx(xh,{...e})},exports.SelectContent=mh,exports.SelectGroup=ch,exports.SelectItem=vh,exports.SelectLabel=hh,exports.SelectPrimitive=lh,exports.SelectScrollDownButton=fh,exports.SelectScrollUpButton=ph,exports.SelectSeparator=gh,exports.SelectTrigger=uh,exports.SelectValue=dh,exports.Sidebar=Bi,exports.Skeleton=ix,exports.Spinner=Hw,exports.Stack=Ve,exports.Table=function({data:e,columns:n,getRowKey:o,ordering:r,onSort:a,onRowClick:i,isLoading:s,hasMore:l,onLoadMore:c,className:d}){const u=Boolean(s&&0===e.length),p=n??[];return t.jsx("div",{className:Ie("flex-1 overflow-auto mt-4",d),children:s||0!==e.length?t.jsxs(Qg,{className:"table-auto w-full",children:[t.jsx(Jg,{className:"sticky top-0 bg-primary text-white z-10",children:t.jsx(cx,{columns:p,ordering:r,onSort:a})}),t.jsxs(ex,{children:[u?t.jsx(sx,{columns:p.map(e=>({width:e.width,cellClassName:e.cellClassName}))}):e.map(e=>t.jsx(dx,{item:e,columns:p,onClick:i?()=>i(e):void 0},o(e))),l&&c&&!u&&t.jsx(nx,{children:t.jsx(rx,{colSpan:p.length,className:"text-center py-6",children:t.jsx(Le,{onClick:c,disabled:s,variant:"outline",children:s?"Carregando...":"Carregar Mais"})})})]})]}):t.jsx("div",{className:"py-20",children:t.jsx(Xg,{})})})},exports.TableBody=ex,exports.TableCaption=ax,exports.TableCell=rx,exports.TableFooter=tx,exports.TableHead=ox,exports.TableHeader=Jg,exports.TablePrimitive=Qg,exports.TableRow=nx,exports.TableSkeleton=sx,exports.Tabs=Cs,exports.TabsContent=Ss,exports.TabsList=_s,exports.TabsTrigger=Ds,exports.TagInput=function({value:n=[],onChange:o,keyPlaceholder:r="Chave",valuePlaceholder:a="Valor",disabled:i=!1}){const[s,l]=e.useState(""),[c,d]=e.useState(""),u=()=>{const e=s.trim(),t=c.trim();if(e&&t){n.some(t=>t.key===e)||(o([...n,{key:e,value:t}]),l(""),d(""))}},p=e=>{"Enter"===e.key&&(e.preventDefault(),u())};return t.jsxs(Ve,{direction:"col",gap:3,children:[t.jsxs(Ve,{direction:"row",gap:2,children:[t.jsx(He,{value:s,onChange:e=>l(e.target.value),onKeyDown:p,placeholder:r,disabled:i,className:"flex-1"}),t.jsx(He,{value:c,onChange:e=>d(e.target.value),onKeyDown:p,placeholder:a,disabled:i,className:"flex-1"}),t.jsx(Le,{type:"button",onClick:u,disabled:!s.trim()||!c.trim()||i,variant:"outline",children:"Adicionar"})]}),n.length>0&&t.jsx(Ve,{direction:"row",gap:2,className:"flex-wrap",children:n.map(e=>t.jsxs(Ve,{direction:"row",gap:1,className:"items-center px-3 py-1 bg-secondary text-secondary-foreground rounded-md text-sm",children:[t.jsxs("span",{className:"font-medium",children:[e.key,":"]}),t.jsx("span",{children:e.value}),t.jsx(Le,{type:"button",onClick:()=>{return t=e.key,void o(n.filter(e=>e.key!==t));var t},disabled:i,variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-secondary-foreground/10 rounded-full","aria-label":`Remover tag ${e.key}`,children:t.jsx(xi,{className:"h-3 w-3"})})]},e.key))})]})},exports.Textarea=Ue,exports.Tooltip=oy,exports.TooltipComponent=Uw,exports.TooltipContent=ay,exports.TooltipProvider=ny,exports.TooltipTrigger=ry,exports.Typography=Pa,exports.badgeVariants=$a,exports.createFKSelectFetcher=(e,t,n={})=>o=>Kw(e,{...o,labelName:t,additionalFilters:n.additionalFilters,fields:n.fields}),exports.fkSelectFetcher=Kw,exports.pumpwoodBadgeVariants=qa,exports.useSidebarCollapse=function({initialCollapsed:t=!1,onPersist:n}={}){const[o,r]=e.useState(t),[a,i]=e.useState(!1),s=e.useCallback(()=>{i(!0),r(e=>{const t=!e;return n?.(t),t})},[n]),l=e.useCallback(()=>{i(!0),r(!1),n?.(!1)},[n]),c=e.useCallback(()=>{i(!1)},[]),[d,u]=e.useState({}),p=e.useCallback(e=>{if(o)return l(),void u({[e]:!0});u(t=>({...t,[e]:!t[e]}))},[o,l]),f=e.useCallback(()=>{u({})},[]);return{isCollapsed:o,isCollapsing:a,expandedItems:d,setExpandedItems:u,toggleCollapse:s,expand:l,handleTransitionEnd:c,toggleExpanded:p,setExpandedOnCollapse:f}};