@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.
- package/README.md +2 -2
- package/dist/components.d.ts +1 -1
- package/dist/components.esm.js +1 -1
- package/dist/components.js +1 -1
- package/dist/design-system.d.ts +3 -37
- package/dist/design-system.esm.js +5 -5
- package/dist/design-system.js +5 -5
- package/dist/index.css +1 -1
- package/dist/types/components/DownloadButton/index.d.ts +1 -1
- package/dist/types/design-system/index.d.ts +0 -1
- package/dist/types/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/index.d.ts +0 -1599
- package/dist/index.esm.js +0 -39
- package/dist/index.js +0 -40
- package/dist/types/components/M2MTable/index.d.ts +0 -35
- package/dist/types/design-system/M2MTable/index.d.ts +0 -35
package/dist/components.esm.js
CHANGED
|
@@ -36,4 +36,4 @@ var fi={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
36
36
|
*
|
|
37
37
|
* This source code is licensed under the ISC license.
|
|
38
38
|
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/!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 Li=e=>"number"==typeof e&&!isNaN(e),Wi=e=>"string"==typeof e,Bi=e=>"function"==typeof e,$i=1,Yi=()=>""+$i++,qi=new Map,Hi=[],Ui=new Set,Ki=()=>qi.size>0;function Vi(e){if(Ki()){if(null==e||(e=>Wi(e)||Li(e))(e))qi.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=qi.get(e.containerId);t?t.removeToast(e.id):qi.forEach(t=>{t.removeToast(e.id)})}}else Hi=Hi.filter(t=>null!=e&&t.options.toastId!==e)}function Gi(e,t){(e=>p(e)||Wi(e)||Bi(e)||Li(e))(e)&&(Ki()||Hi.push({content:e,options:t}),qi.forEach(n=>{n.buildToast(e,t)}))}function Zi(e,t){qi.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 Xi(e){return e&&(Wi(e.toastId)||Li(e.toastId))?e.toastId:Yi()}function Qi(e,t){return Gi(e,t),t.toastId}function Ji(e,t){return{...t,type:t&&t.type||e,toastId:Xi(t)}}function es(e){return(t,n)=>Qi(t,Ji(e,n))}function ts(e,t){return Qi(e,Ji("default",t))}ts.loading=(e,t)=>Qi(e,Ji("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ts.promise=function(e,{pending:t,error:n,success:o},r){let a;t&&(a=Wi(t)?ts.loading(t,r):ts.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 ts.dismiss(a);let o={type:e,...i,...r,data:n},s=Wi(t)?{render:t}:t;return a?ts.update(a,{...o,...s}):ts(s.render,{...o,...s}),n},l=Bi(e)?e():e;return l.then(e=>s("success",o,e)).catch(e=>s("error",n,e)),l},ts.success=es("success"),ts.info=es("info"),ts.error=es("error"),ts.warning=es("warning"),ts.warn=ts.warning,ts.dark=(e,t)=>Qi(e,Ji("default",{theme:"dark",...t})),ts.dismiss=function(e){Vi(e)},ts.clearWaitingQueue=(e={})=>{qi.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},ts.isActive=function(e,t){var n;if(t)return!(null==(n=qi.get(t))||!n.isToastActive(e));let o=!1;return qi.forEach(t=>{t.isToastActive(e)&&(o=!0)}),o},ts.update=(e,t={})=>{let n=((e,{containerId:t})=>{var n;return null==(n=qi.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:Yi()};a.toastId!==e&&(a.staleId=e);let i=a.render||r;delete a.render,Qi(i,a)}},ts.done=e=>{ts.update(e,{progress:1})},ts.onChange=function(e){return Ui.add(e),()=>{Ui.delete(e)}},ts.play=e=>Zi(!0,e),ts.pause=e=>Zi(!1,e);const ns={"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"]};function os({onFileSelected:e,onFileDeleted:t,acceptExtensions:n,accept:r,maxSizeMB:a=25}){const[i,l]=d(null),c=1024*a*1024,u=o(()=>r||(n?.length?as(n):ns),[r,n]),p=o(()=>Object.values(u).reduce((e,t)=>e.concat(t),[]).join(","),[u]),f=s((t,o)=>{if(o.length>0){const{errors:e}=o[0],t=e[0];return void("file-too-large"===t.code?ts.error(`File size must be under ${a} MB`):"file-invalid-type"===t.code?ts.error(`Invalid file type. Allowed: ${n}`):ts.error(t.message))}const r=t[0];r&&(l(r),e(new File([r],r.name,{type:r.type,lastModified:r.lastModified})),ts.success(`File "${r.name}" selected successfully!`))},[e,a,n]),{getRootProps:m,getInputProps:h,isDragActive:v}=$n({onDrop:f,maxFiles:1,maxSize:c,accept:u,multiple:!1});return y("div",{className:"space-y-2",children:[y("p",{className:"font-bold",children:["Envie um arquivo com até ",a," MB."]}),y("div",i?{className:"flex items-center justify-between border rounded-md px-3 py-2 bg-white",children:[y("div",{className:"flex items-center gap-2",children:[g(Ti,{className:"h-4 w-4 text-gray-600"}),g("span",{className:"text-sm",children:i.name})]}),y("div",{className:"flex items-center gap-1",children:[g("button",{onClick:()=>{const t=document.createElement("input");t.type="file",t.accept=p,t.onchange=t=>{const n=t.target.files?.[0];if(!n)return;const o=Object.values(u).reduce((e,t)=>e.concat(t),[]);o.some(e=>n.name.toLowerCase().endsWith(e.toLowerCase()))?n.size>c?ts.error(`File size must be under ${a} MB`):(l(n),e(n),ts.success(`File "${n.name}" selected successfully!`)):ts.error(`Invalid file type. Allowed: ${o.join(", ")}`)},t.click()},className:"p-1 hover:bg-gray-100 rounded",children:g(Ii,{className:"h-4 w-4"})}),g("button",{onClick:()=>{l(null),t?.(),ts.success("File removed")},className:"p-1 hover:bg-red-50 rounded",children:g(ji,{className:"h-4 w-4 text-red-600"})})]})]}:{...m(),className:"border rounded-lg text-center cursor-pointer transition-colors h-[300px] "+(v?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-gray-400"),children:[g("input",{...h()}),y("div",{className:"py-16 px-6 flex flex-col items-center",children:[g(Ei,{strokeWidth:1,className:"size-[80px] text-[#026CB6]"}),g("p",{className:"text-muted",children:"Arraste e solte ou selecione um arquivo."}),y("p",{className:"text-muted",children:["Arquivos aceitos:",n]})]})]})]})}const rs=e=>e.map(e=>e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`),as=e=>({"application/octet-stream":rs(e)});function is({initialCollapsed:e=!1,onPersist:t}={}){const[n,o]=d(e),[r,a]=d(!1),i=s(()=>{a(!0),o(e=>{const n=!e;return t?.(n),n})},[t]),l=s(()=>{a(!0),o(!1),t?.(!1)},[t]),c=s(()=>{a(!1)},[]),[u,p]=d({}),f=s(e=>{if(n)return l(),void p({[e]:!0});p(t=>({...t,[e]:!t[e]}))},[n,l]),m=s(()=>{p({})},[]);return{isCollapsed:n,isCollapsing:r,expandedItems:u,setExpandedItems:p,toggleCollapse:i,expand:l,handleTransitionEnd:c,toggleExpanded:f,setExpandedOnCollapse:m}}const ss=f(void 0);function ls(){const e=m(ss);if(!e)throw new Error("Sidebar components must be used within a Sidebar.Root");return e}const cs={Root:function({children:e,isCollapsed:t,isCollapsing:n=!1,onToggleCollapse:o,onTransitionEnd:r,className:a}){const i=t?"smaller:w-20 w-20":"smaller:w-[232px] w-[232px]";return g(ss.Provider,{value:{isCollapsed:t,isCollapsing:n,onToggleCollapse:o},children:g("nav",{className:Qe(i,"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",a),onTransitionEnd:r,children:e})})},Header:function({children:e,className:t}){return g("div",{className:Qe("w-full flex justify-between items-center mb-8 gap-4",t),children:e})},Content:function({children:e,className:t}){return g(dt,{className:Qe("w-full flex-1 min-h-0 items-stretch gap-1 overflow-y-auto",t),children:e})},Footer:function({children:e,className:t}){return g("div",{className:Qe("mt-auto w-full",t),children:e})},Toggle:function({className:e}){const{isCollapsed:t,isCollapsing:n,onToggleCollapse:o}=ls(),r=t&&!n;return g("div",{className:Qe("w-full flex transition-all duration-300 ease-in-out",r?"justify-center":"justify-end",e),children:g(tt,{title:r?"Expandir Barra Lateral":"Recolher Barra Lateral",height:48,className:Qe("min-w-[48px] bg-transparent rounded-full hover:bg-white/5 transition-all duration-300 ease-in-out",r?"justify-center":"justify-end"),onClick:o,children:g(r?Pi:Ai,{className:"size-[28px] text-white"})})})},Logo:function({src:e,alt:t,width:n=200,height:o=40,collapsedWidth:r=48,collapsedHeight:a,className:i,ImageComponent:s=({src:e,alt:t,...n})=>g("img",{src:e,alt:t,...n})}){const{isCollapsed:l,isCollapsing:c}=ls(),d=l&&!c,u=d?r:n,p=d?a??Math.max(16,Math.round(o/n*r)):o;return g(dt,{className:Qe("w-full items-center justify-center py-2",i),children:g(s,{className:"object-contain transition-all duration-300 ease-in-out",src:e,width:u,height:p,alt:t})})},Link:function({icon:e,children:t,href:n,active:o,className:r,LinkComponent:a=({children:e,...t})=>g("a",{...t,children:e})}){const{isCollapsed:i,isCollapsing:s}=ls();return g(a,{href:n,title:"string"==typeof t?t:void 0,className:Qe("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",o?"bg-white/5":"",r),children:y(dt,{direction:"row",gap:2,className:"w-full items-center",children:[g(e,{className:"size-6 shrink-0"}),!i&&!s&&g("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:t})]})})},NavGroup:function({icon:e,title:t,isExpanded:n,isActive:o=!1,onToggle:r,children:a,className:i}){const{isCollapsed:s,isCollapsing:l}=ls();return y(dt,{className:Qe("w-full gap-0",i),children:[g(tt,{type:"button",title:t,onClick:r,variant:"ghost",height:48,className:Qe("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",o?"bg-white/5":""),children:y(dt,{direction:"row",gap:2,className:"w-full items-center",children:[g(e,{className:"size-6 shrink-0"}),!s&&!l&&y(b,{children:[g("span",{className:"flex-1 text-left transition-opacity duration-300 ease-in-out opacity-100 text-base",children:t}),g(wi,{width:20,height:20,className:Qe("shrink-0 transition-transform duration-300 ease-in-out",n?"rotate-180":"")})]})]})}),!s&&!l&&g("div",{className:Qe("overflow-hidden transition-all duration-300 ease-in-out",n?"max-h-96 opacity-100 mt-1":"max-h-0 opacity-0"),children:g(dt,{className:"w-full gap-1 pl-9 pr-1",children:a})})]})},NavSubLink:function({title:e,href:t,active:n=!1,className:o,LinkComponent:r=({children:e,...t})=>g("a",{...t,children:e})}){return g(r,{href:t,title:e,className:Qe("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",n?"bg-white/10 font-semibold":"",o),children:e})},Action:function({icon:e,label:t,onClick:n,className:o}){const{isCollapsed:r,isCollapsing:a}=ls();return g(tt,{title:t,onClick:n,variant:"ghost",height:48,className:Qe("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",o),children:y(dt,{direction:"row",gap:2,className:"w-full items-center",children:[g(e,{width:24,height:24,className:"shrink-0"}),!r&&!a&&g("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:t})]})})}};var ds=e.createContext(void 0);function us(t){const n=e.useContext(ds);return t||n||"ltr"}var ps="rovingFocusGroup.onEntryFocus",fs={bubbles:!1,cancelable:!0},ms="RovingFocusGroup",[hs,vs,gs]=function(e){const n=e+"CollectionProvider",[o,r]=Un(n),[a,i]=o(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:o}=e,r=t.useRef(null),i=t.useRef(new Map).current;return g(a,{scope:n,itemMap:i,collectionRef:r,children:o})};s.displayName=n;const l=e+"CollectionSlot",c=to(l),d=t.forwardRef((e,t)=>{const{scope:n,children:o}=e,r=C(t,i(l,n).collectionRef);return g(c,{ref:r,children:o})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",f=to(u),m=t.forwardRef((e,n)=>{const{scope:o,children:r,...a}=e,s=t.useRef(null),l=C(n,s),c=i(u,o);return t.useEffect(()=>(c.itemMap.set(s,{ref:s,...a}),()=>{c.itemMap.delete(s)})),g(f,{[p]:"",ref:l,children:r})});return m.displayName=u,[{Provider:s,Slot:d,ItemSlot:m},function(n){const o=i(e+"CollectionConsumer",n);return t.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},r]}(ms),[ys,bs]=Un(ms,[gs]),[xs,ws]=ys(ms),ks=e.forwardRef((e,t)=>g(hs.Provider,{scope:e.__scopeRovingFocusGroup,children:g(hs.Slot,{scope:e.__scopeRovingFocusGroup,children:g(Ns,{...e,ref:t})})}));ks.displayName=ms;var Ns=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,orientation:r,loop:a=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=t,f=e.useRef(null),m=C(n,f),h=us(i),[v,y]=eo({prop:s,defaultProp:l??null,onChange:c,caller:ms}),[b,x]=e.useState(!1),w=io(d),k=vs(o),N=e.useRef(!1),[_,D]=e.useState(0);return e.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(ps,w),()=>e.removeEventListener(ps,w)},[w]),g(xs,{scope:o,orientation:r,dir:h,loop:a,currentTabStopId:v,onItemFocus:e.useCallback(e=>y(e),[y]),onItemShiftTab:e.useCallback(()=>x(!0),[]),onFocusableItemAdd:e.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>D(e=>e-1),[]),children:g(ao.div,{tabIndex:b||0===_?-1:0,"data-orientation":r,...p,ref:m,style:{outline:"none",...t.style},onMouseDown:Vn(t.onMouseDown,()=>{N.current=!0}),onFocus:Vn(t.onFocus,e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(ps,fs);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);Es([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),u)}}N.current=!1}),onBlur:Vn(t.onBlur,()=>x(!1))})})}),Cs="RovingFocusGroupItem",_s=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,focusable:r=!0,active:a=!1,tabStopId:i,children:s,...l}=t,c=Qn(),d=i||c,u=ws(Cs,o),p=u.currentTabStopId===d,f=vs(o),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:v}=u;return e.useEffect(()=>{if(r)return m(),()=>h()},[r,m,h]),g(hs.ItemSlot,{scope:o,id:d,focusable:r,active:a,children:g(ao.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:n,onMouseDown:Vn(t.onMouseDown,e=>{r?u.onItemFocus(d):e.preventDefault()}),onFocus:Vn(t.onFocus,()=>u.onItemFocus(d)),onKeyDown:Vn(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void u.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:Ds[o]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=f().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=u.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>Es(r))}var n,o}),children:"function"==typeof s?s({isCurrentTabStop:p,hasTabStop:null!=v}):s})})});_s.displayName=Cs;var Ds={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Es(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 Ss=ks,Ms=_s,Os="Tabs",[Ts]=Un(Os,[bs]),Rs=bs(),[Ps,As]=Ts(Os),Is=e.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:a,orientation:i="horizontal",dir:s,activationMode:l="automatic",...c}=e,d=us(s),[u,p]=eo({prop:o,onChange:r,defaultProp:a??"",caller:Os});return g(Ps,{scope:n,baseId:Qn(),value:u,onValueChange:p,orientation:i,dir:d,activationMode:l,children:g(ao.div,{dir:d,"data-orientation":i,...c,ref:t})})});Is.displayName=Os;var Fs="TabsList",js=e.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,a=As(Fs,n),i=Rs(n);return g(Ss,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:o,children:g(ao.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});js.displayName=Fs;var zs="TabsTrigger",Ls=e.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...a}=e,i=As(zs,n),s=Rs(n),l=$s(i.baseId,o),c=Ys(i.baseId,o),d=o===i.value;return g(Ms,{asChild:!0,...s,focusable:!r,active:d,children:g(ao.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...a,ref:t,onMouseDown:Vn(e.onMouseDown,e=>{r||0!==e.button||!1!==e.ctrlKey?e.preventDefault():i.onValueChange(o)}),onKeyDown:Vn(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&i.onValueChange(o)}),onFocus:Vn(e.onFocus,()=>{const e="manual"!==i.activationMode;d||r||!e||i.onValueChange(o)})})})});Ls.displayName=zs;var Ws="TabsContent",Bs=e.forwardRef((t,n)=>{const{__scopeTabs:o,value:r,forceMount:a,children:i,...s}=t,l=As(Ws,o),c=$s(l.baseId,r),d=Ys(l.baseId,r),u=r===l.value,p=e.useRef(u);return e.useEffect(()=>{const e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),g(Eo,{present:a||u,children:({present:e})=>g(ao.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!e,id:d,tabIndex:0,...s,ref:n,style:{...t.style,animationDuration:p.current?"0s":void 0},children:e&&i})})});function $s(e,t){return`${e}-trigger-${t}`}function Ys(e,t){return`${e}-content-${t}`}Bs.displayName=Ws;var qs=js,Hs=Ls,Us=Bs;const Ks=Is,Vs=e.forwardRef(({className:e,...t},n)=>g(qs,{ref:n,className:Qe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Vs.displayName=qs.displayName;const Gs=e.forwardRef(({className:e,...t},n)=>g(Hs,{ref:n,className:Qe("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),...t}));Gs.displayName=Hs.displayName;const Zs=e.forwardRef(({className:e,...t},n)=>g(Us,{ref:n,className:Qe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));function Xs(t,n=[]){let o=[];const r=()=>{const n=o.map(t=>e.createContext(t));return function(o){const r=o?.[t]||n;return e.useMemo(()=>({[`__scope${t}`]:{...o,[t]:r}}),[o,r])}};return r.scopeName=t,[function(n,r){const a=e.createContext(r);a.displayName=n+"Context";const i=o.length;o=[...o,r];const s=n=>{const{scope:o,children:r,...s}=n,l=o?.[t]?.[i]||a,c=e.useMemo(()=>s,Object.values(s));return g(l.Provider,{value:c,children:r})};return s.displayName=n+"Provider",[s,function(o,s){const l=s?.[t]?.[i]||a,c=e.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${o}\` must be used within \`${n}\``)}]},Qs(r,...n)]}function Qs(...t){const n=t[0];if(1===t.length)return n;const o=()=>{const o=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const r=o.reduce((e,{useScope:n,scopeName:o})=>({...e,...n(t)[`__scope${o}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:r}),[r])}};return o.scopeName=n.scopeName,o}function Js(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function el(...e){return t=>{let n=!1;const o=e.map(e=>{const o=Js(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():Js(e[t],null)}}}}function tl(...t){return e.useCallback(el(...t),t)}function nl(t){const n=e.forwardRef((n,o)=>{let{children:r,...a}=n,i=null,s=!1;const l=[];il(r)&&"function"==typeof cl&&(r=cl(r._payload)),e.Children.forEach(r,t=>{if(n=t,e.isValidElement(n)&&"function"==typeof n.type&&"__radixId"in n.type&&n.type.__radixId===ol){s=!0;const e=t;let n="child"in e.props?e.props.child:e.props.children;il(n)&&"function"==typeof cl&&(n=cl(n._payload)),i=rl(e,n),l.push(i?.props?.children)}else l.push(t);var n}),i?i=e.cloneElement(i,void 0,l):!s&&1===e.Children.count(r)&&e.isValidElement(r)&&(i=r);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=tl(o,c);if(!i){if(r||0===r)throw new Error(s?ll(t):sl(t));return r}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!==e.Fragment&&(u.ref=o?d:c),e.cloneElement(i,u)});return n.displayName=`${t}.Slot`,n}Zs.displayName=Us.displayName;var ol=Symbol.for("radix.slottable");var rl=(t,n)=>{if("child"in t.props){const n=t.props.child;return e.isValidElement(n)?e.cloneElement(n,void 0,t.props.children(n.props.children)):null}return e.isValidElement(n)?n:null};var al=Symbol.for("react.lazy");function il(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===al&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}var sl=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,ll=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,cl=e[" use ".trim().toString()];function dl(t){const n=t+"CollectionProvider",[o,r]=Xs(n),[a,i]=o(n,{collectionRef:{current:null},itemMap:new Map}),s=t=>{const{scope:n,children:o}=t,r=e.useRef(null),i=e.useRef(new Map).current;return g(a,{scope:n,itemMap:i,collectionRef:r,children:o})};s.displayName=n;const l=t+"CollectionSlot",c=nl(l),d=e.forwardRef((e,t)=>{const{scope:n,children:o}=e,r=tl(t,i(l,n).collectionRef);return g(c,{ref:r,children:o})});d.displayName=l;const u=t+"CollectionItemSlot",p="data-radix-collection-item",f=nl(u),m=e.forwardRef((t,n)=>{const{scope:o,children:r,...a}=t,s=e.useRef(null),l=tl(n,s),c=i(u,o);return e.useEffect(()=>(c.itemMap.set(s,{ref:s,...a}),()=>{c.itemMap.delete(s)})),g(f,{[p]:"",ref:l,children:r})});return m.displayName=u,[{Provider:s,Slot:d,ItemSlot:m},function(n){const o=i(t+"CollectionConsumer",n);return e.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},r]}function ul(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}var pl=globalThis?.document?e.useLayoutEffect:()=>{},fl=e[" useInsertionEffect ".trim().toString()]||pl;function ml({prop:t,defaultProp:n,onChange:o=()=>{},caller:r}){const[a,i,s]=function({defaultProp:t,onChange:n}){const[o,r]=e.useState(t),a=e.useRef(o),i=e.useRef(n);return fl(()=>{i.current=n},[n]),e.useEffect(()=>{a.current!==o&&(i.current?.(o),a.current=o)},[o,a]),[o,r,i]}({defaultProp:n,onChange:o}),l=void 0!==t,c=l?t:a;{const n=e.useRef(void 0!==t);e.useEffect(()=>{const e=n.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${r} 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.`)}n.current=l},[l,r])}const d=e.useCallback(e=>{if(l){const n=function(e){return"function"==typeof e}(e)?e(t):e;n!==t&&s.current?.(n)}else i(e)},[l,t,i,s]);return[c,d]}var hl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const o=nl(`Primitive.${n}`),r=e.forwardRef((e,t)=>{const{asChild:r,...a}=e,i=r?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),g(i,{...a,ref:t})});return r.displayName=`Primitive.${n}`,{...t,[n]:r}},{});function vl(e,t){e&&x.flushSync(()=>e.dispatchEvent(t))}var gl=t=>{const{present:n,children:o}=t,r=function(t){const[n,o]=e.useState(),r=e.useRef(null),a=e.useRef(t),i=e.useRef("none"),s=t?"mounted":"unmounted",[l,c]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=bl(r.current);i.current="mounted"===l?e:"none"},[l]),pl(()=>{const e=r.current,n=a.current;if(n!==t){const o=i.current,r=bl(e);if(t)c("MOUNT");else if("none"===r||"none"===e?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=t}},[t,c]),pl(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,o=o=>{const i=bl(r.current).includes(CSS.escape(o.animationName));if(o.target===n&&i&&(c("ANIMATION_END"),!a.current)){const o=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=o)})}},s=e=>{e.target===n&&(i.current=bl(r.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",o),n.addEventListener("animationend",o),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",o),n.removeEventListener("animationend",o)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:e.useCallback(e=>{r.current=e?getComputedStyle(e):null,o(e)},[])}}(n),a="function"==typeof o?o({present:r.isPresent}):e.Children.only(o),i=function(...t){const n=e.useRef(t);return n.current=t,e.useCallback(e=>{const t=n.current;let o=!1;const r=t.map(t=>{const n=yl(t,e);return o||"function"!=typeof n||(o=!0),n});if(o)return()=>{for(let e=0;e<r.length;e++){const n=r[e];"function"==typeof n?n():yl(t[e],null)}}},[])}(r.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 o||r.isPresent?e.cloneElement(a,{ref:i}):null};function yl(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function bl(e){return e?.animationName||"none"}gl.displayName="Presence";var xl=e[" useId ".trim().toString()]||(()=>{}),wl=0;function kl(t){const[n,o]=e.useState(xl());return pl(()=>{o(e=>e??String(wl++))},[t]),n?`radix-${n}`:""}var Nl="Collapsible",[Cl,_l]=Xs(Nl),[Dl,El]=Cl(Nl),Sl=e.forwardRef((t,n)=>{const{__scopeCollapsible:o,open:r,defaultOpen:a,disabled:i,onOpenChange:s,...l}=t,[c,d]=ml({prop:r,defaultProp:a??!1,onChange:s,caller:Nl});return g(Dl,{scope:o,disabled:i,contentId:kl(),open:c,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),children:g(hl.div,{"data-state":Al(c),"data-disabled":i?"":void 0,...l,ref:n})})});Sl.displayName=Nl;var Ml="CollapsibleTrigger",Ol=e.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=El(Ml,n);return g(hl.button,{type:"button","aria-controls":r.open?r.contentId:void 0,"aria-expanded":r.open||!1,"data-state":Al(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:ul(e.onClick,r.onOpenToggle)})});Ol.displayName=Ml;var Tl="CollapsibleContent",Rl=e.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=El(Tl,e.__scopeCollapsible);return g(gl,{present:n||r.open,children:({present:e})=>g(Pl,{...o,ref:t,present:e})})});Rl.displayName=Tl;var Pl=e.forwardRef((t,n)=>{const{__scopeCollapsible:o,present:r,children:a,...i}=t,s=El(Tl,o),[l,c]=e.useState(r),d=e.useRef(null),u=tl(n,d),p=e.useRef(0),f=p.current,m=e.useRef(0),h=m.current,v=s.open||l,y=e.useRef(v),b=e.useRef(void 0);return e.useEffect(()=>{const e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),pl(()=>{const e=d.current;if(e){b.current=b.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();p.current=t.height,m.current=t.width,y.current||(e.style.transitionDuration=b.current.transitionDuration,e.style.animationName=b.current.animationName),c(r)}},[s.open,r]),g(hl.div,{"data-state":Al(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!v,...i,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...t.style},children:v&&a})});function Al(e){return e?"open":"closed"}var Il=Sl,Fl=Ol,jl=Rl,zl=e.createContext(void 0);function Ll(t){const n=e.useContext(zl);return t||n||"ltr"}var Wl="Accordion",Bl=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[$l,Yl,ql]=dl(Wl),[Hl]=Xs(Wl,[ql,_l]),Ul=_l(),Kl=e.forwardRef((e,t)=>{const{type:n,...o}=e,r=o,a=o;return g($l.Provider,{scope:e.__scopeAccordion,children:"multiple"===n?g(Jl,{...a,ref:t}):g(Ql,{...r,ref:t})})});Kl.displayName=Wl;var[Vl,Gl]=Hl(Wl),[Zl,Xl]=Hl(Wl,{collapsible:!1}),Ql=e.forwardRef((t,n)=>{const{value:o,defaultValue:r,onValueChange:a=()=>{},collapsible:i=!1,...s}=t,[l,c]=ml({prop:o,defaultProp:r??"",onChange:a,caller:Wl});return g(Vl,{scope:t.__scopeAccordion,value:e.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:e.useCallback(()=>i&&c(""),[i,c]),children:g(Zl,{scope:t.__scopeAccordion,collapsible:i,children:g(nc,{...s,ref:n})})})}),Jl=e.forwardRef((t,n)=>{const{value:o,defaultValue:r,onValueChange:a=()=>{},...i}=t,[s,l]=ml({prop:o,defaultProp:r??[],onChange:a,caller:Wl}),c=e.useCallback(e=>l((t=[])=>[...t,e]),[l]),d=e.useCallback(e=>l((t=[])=>t.filter(t=>t!==e)),[l]);return g(Vl,{scope:t.__scopeAccordion,value:s,onItemOpen:c,onItemClose:d,children:g(Zl,{scope:t.__scopeAccordion,collapsible:!0,children:g(nc,{...i,ref:n})})})}),[ec,tc]=Hl(Wl),nc=e.forwardRef((t,n)=>{const{__scopeAccordion:o,disabled:r,dir:a,orientation:i="vertical",...s}=t,l=tl(e.useRef(null),n),c=Yl(o),d="ltr"===Ll(a),u=ul(t.onKeyDown,e=>{if(!Bl.includes(e.key))return;const t=e.target,n=c().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 s=r-1,l=()=>{a=o+1,a>s&&(a=0)},u=()=>{a=o-1,a<0&&(a=s)};switch(e.key){case"Home":a=0;break;case"End":a=s;break;case"ArrowRight":"horizontal"===i&&(d?l():u());break;case"ArrowDown":"vertical"===i&&l();break;case"ArrowLeft":"horizontal"===i&&(d?u():l());break;case"ArrowUp":"vertical"===i&&u()}const p=a%r;n[p].ref.current?.focus()});return g(ec,{scope:o,disabled:r,direction:a,orientation:i,children:g($l.Slot,{scope:o,children:g(hl.div,{...s,"data-orientation":i,ref:l,onKeyDown:r?void 0:u})})})}),oc="AccordionItem",[rc,ac]=Hl(oc),ic=e.forwardRef((e,t)=>{const{__scopeAccordion:n,value:o,...r}=e,a=tc(oc,n),i=Gl(oc,n),s=Ul(n),l=kl(),c=o&&i.value.includes(o)||!1,d=a.disabled||e.disabled;return g(rc,{scope:n,open:c,disabled:d,triggerId:l,children:g(Il,{"data-orientation":a.orientation,"data-state":fc(c),...s,...r,ref:t,disabled:d,open:c,onOpenChange:e=>{e?i.onItemOpen(o):i.onItemClose(o)}})})});ic.displayName=oc;var sc="AccordionHeader",lc=e.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=tc(Wl,n),a=ac(sc,n);return g(hl.h3,{"data-orientation":r.orientation,"data-state":fc(a.open),"data-disabled":a.disabled?"":void 0,...o,ref:t})});lc.displayName=sc;var cc="AccordionTrigger",dc=e.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=tc(Wl,n),a=ac(cc,n),i=Xl(cc,n),s=Ul(n);return g($l.ItemSlot,{scope:n,children:g(Fl,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":r.orientation,id:a.triggerId,...s,...o,ref:t})})});dc.displayName=cc;var uc="AccordionContent",pc=e.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=tc(Wl,n),a=ac(uc,n),i=Ul(n);return g(jl,{role:"region","aria-labelledby":a.triggerId,"data-orientation":r.orientation,...i,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function fc(e){return e?"open":"closed"}pc.displayName=uc;var mc=ic,hc=lc,vc=dc,gc=pc;const yc=Kl,bc=e.forwardRef(({className:e,...t},n)=>g(mc,{ref:n,className:Qe("border-b",e),...t}));bc.displayName="AccordionItem";const xc=e.forwardRef(({className:e,children:t,...n},o)=>g(hc,{className:"flex",children:y(vc,{ref:o,className:Qe("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),...n,children:[t,g(wi,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));xc.displayName=vc.displayName;const wc=e.forwardRef(({className:e,children:t,...n},o)=>g(gc,{ref:o,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:g("div",{className:Qe("pb-4 pt-0",e),children:t})}));function kc({className:e,...t}){return g("div",{"data-slot":"empty",className:Qe("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),...t})}function Nc({className:e,...t}){return g("div",{"data-slot":"empty-header",className:Qe("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}wc.displayName=gc.displayName;const Cc=j("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 _c({className:e,variant:t="default",...n}){return g("div",{"data-slot":"empty-icon","data-variant":t,className:Qe(Cc({variant:t,className:e})),...n})}function Dc({className:e,...t}){return g("div",{"data-slot":"empty-title",className:Qe("text-lg font-medium tracking-tight",e),...t})}function Ec({className:e,...t}){return g("div",{"data-slot":"empty-description",className:Qe("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...t})}function Sc({className:e,...t}){return g("div",{"data-slot":"empty-content",className:Qe("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",e),...t})}function Mc({title:e,description:t}){return g(kc,{children:y(Nc,{className:"w-[250px]",children:[g(_c,{children:g(yi,{})}),g(Dc,{children:e}),g(Ec,{children:t})]})})}var Oc=.999,Tc=/[\\\/_+.#"@\[\(\{&]/,Rc=/[\\\/_+.#"@\[\(\{&]/g,Pc=/[\s-]/,Ac=/[\s-]/g;function Ic(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=Ic(e,t,n,o,f+1,a+1,i))>m&&(f===r?l*=1:Tc.test(e.charAt(f-1))?(l*=.8,(d=e.slice(r,f-1).match(Rc))&&r>0&&(l*=Math.pow(Oc,d.length))):Pc.test(e.charAt(f-1))?(l*=.9,(u=e.slice(r,f-1).match(Ac))&&r>0&&(l*=Math.pow(Oc,u.length))):(l*=.17,r>0&&(l*=Math.pow(Oc,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=Ic(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(Ac," ")}function jc(e,t,n){return Ic(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,Fc(e),Fc(t),0,0,{})}var zc='[cmdk-group=""]',Lc='[cmdk-group-items=""]',Wc='[cmdk-item=""]',Bc=`${Wc}:not([aria-disabled="true"])`,$c="cmdk-item-select",Yc="data-value",qc=(e,t,n)=>jc(e,t,n),Hc=e.createContext(void 0),Uc=()=>e.useContext(Hc),Kc=e.createContext(void 0),Vc=()=>e.useContext(Kc),Gc=e.createContext(void 0),Zc=e.forwardRef((t,n)=>{let o=dd(()=>{var e,n;return{search:"",value:null!=(n=null!=(e=t.value)?e:t.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=dd(()=>new Set),a=dd(()=>new Map),i=dd(()=>new Map),s=dd(()=>new Set),l=ld(t),{label:c,children:d,value:u,onValueChange:p,filter:f,shouldFilter:m,loop:h,disablePointerSelection:v=!1,vimBindings:g=!0,...y}=t,b=Qn(),x=Qn(),w=Qn(),k=e.useRef(null),N=fd();cd(()=>{if(void 0!==u){let e=u.trim();o.current.value=e,C.emit()}},[u]),cd(()=>{N(6,O)},[]);let C=e.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>o.current,setState:(e,t,n)=>{var r,a,i,s;if(!Object.is(o.current[e],t)){if(o.current[e]=t,"search"===e)M(),E(),N(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(b))||r.focus()}if(N(7,()=>{var e;o.current.selectedItemId=null==(e=T())?void 0:e.id,C.emit()}),n||N(5,O),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))}}C.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),_=e.useMemo(()=>({value:(e,t,n)=>{var r;t!==(null==(r=i.current.get(e))?void 0:r.value)&&(i.current.set(e,{value:t,keywords:n}),o.current.filtered.items.set(e,D(t,n)),N(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),N(3,()=>{M(),E(),o.current.value||S(),C.emit()}),()=>{i.current.delete(e),r.current.delete(e),o.current.filtered.items.delete(e);let t=T();N(4,()=>{M(),(null==t?void 0:t.getAttribute("id"))===e&&S(),C.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||t["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:x,listInnerRef:k}),[]);function D(e,t){var n,r;let a=null!=(r=null==(n=l.current)?void 0:n.filter)?r:qc;return e?a(e,o.current.search,t):0}function E(){if(!o.current.search||!1===l.current.shouldFilter)return;let e=o.current.filtered.items,t=[];o.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 n=k.current;R().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(Lc);t?t.appendChild(e.parentElement===t?e:e.closest(`${Lc} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Lc} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${zc}[${Yc}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function S(){let e=R().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Yc);C.setState("value",t||void 0)}function M(){var e,t,n,s;if(!o.current.search||!1===l.current.shouldFilter)return void(o.current.filtered.count=r.current.size);o.current.filtered.groups=new Set;let c=0;for(let a of r.current){let r=D(null!=(t=null==(e=i.current.get(a))?void 0:e.value)?t:"",null!=(s=null==(n=i.current.get(a))?void 0:n.keywords)?s:[]);o.current.filtered.items.set(a,r),r>0&&c++}for(let[e,t]of a.current)for(let n of t)if(o.current.filtered.items.get(n)>0){o.current.filtered.groups.add(e);break}o.current.filtered.count=c}function O(){var e,t,n;let o=T();o&&((null==(e=o.parentElement)?void 0:e.firstChild)===o&&(null==(n=null==(t=o.closest(zc))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),o.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=k.current)?void 0:e.querySelector(`${Wc}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(Bc))||[])}function P(e){let t=R()[e];t&&C.setState("value",t.getAttribute(Yc))}function A(e){var t;let n=T(),o=R(),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&&C.setState("value",a.getAttribute(Yc))}function I(e){let t,n=T(),o=null==n?void 0:n.closest(zc);for(;o&&!t;)o=e>0?id(o,zc):sd(o,zc),t=null==o?void 0:o.querySelector(Bc);t?C.setState("value",t.getAttribute(Yc)):A(e)}let F=()=>P(R().length-1),j=e=>{e.preventDefault(),e.metaKey?F():e.altKey?I(1):A(1)},z=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):A(-1)};return e.createElement(ao.div,{ref:n,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=y.onKeyDown)||t.call(y,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!n)switch(e.key){case"n":case"j":g&&e.ctrlKey&&j(e);break;case"ArrowDown":j(e);break;case"p":case"k":g&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),P(0);break;case"End":e.preventDefault(),F();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event($c);t.dispatchEvent(e)}}}}},e.createElement("label",{"cmdk-label":"",htmlFor:_.inputId,id:_.labelId,style:hd},c),md(t,t=>e.createElement(Kc.Provider,{value:C},e.createElement(Hc.Provider,{value:_},t))))}),Xc=e.forwardRef((t,n)=>{var o,r;let a=Qn(),i=e.useRef(null),s=e.useContext(Gc),l=Uc(),c=ld(t),d=null!=(r=null==(o=c.current)?void 0:o.forceMount)?r:null==s?void 0:s.forceMount;cd(()=>{if(!d)return l.item(a,null==s?void 0:s.id)},[d]);let u=pd(a,i,[t.value,t.children,i],t.keywords),p=Vc(),f=ud(e=>e.value&&e.value===u.current),m=ud(e=>!(!d&&!1!==l.filter())||(!e.search||e.filtered.items.get(a)>0));function h(){var e,t;v(),null==(t=(e=c.current).onSelect)||t.call(e,u.current)}function v(){p.setState("value",u.current,!0)}if(e.useEffect(()=>{let e=i.current;if(e&&!t.disabled)return e.addEventListener($c,h),()=>e.removeEventListener($c,h)},[m,t.onSelect,t.disabled]),!m)return null;let{disabled:g,value:y,onSelect:b,forceMount:x,keywords:w,...k}=t;return e.createElement(ao.div,{ref:N(i,n),...k,id:a,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||l.getDisablePointerSelection()?void 0:v,onClick:g?void 0:h},t.children)}),Qc=e.forwardRef((t,n)=>{let{heading:o,children:r,forceMount:a,...i}=t,s=Qn(),l=e.useRef(null),c=e.useRef(null),d=Qn(),u=Uc(),p=ud(e=>!(!a&&!1!==u.filter())||(!e.search||e.filtered.groups.has(s)));cd(()=>u.group(s),[]),pd(s,l,[t.value,t.heading,c]);let f=e.useMemo(()=>({id:s,forceMount:a}),[a]);return e.createElement(ao.div,{ref:N(l,n),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},o&&e.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},o),md(t,t=>e.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":o?d:void 0},e.createElement(Gc.Provider,{value:f},t))))}),Jc=e.forwardRef((t,n)=>{let{alwaysRender:o,...r}=t,a=e.useRef(null),i=ud(e=>!e.search);return o||i?e.createElement(ao.div,{ref:N(a,n),...r,"cmdk-separator":"",role:"separator"}):null}),ed=e.forwardRef((t,n)=>{let{onValueChange:o,...r}=t,a=null!=t.value,i=Vc(),s=ud(e=>e.search),l=ud(e=>e.selectedItemId),c=Uc();return e.useEffect(()=>{null!=t.value&&i.setState("search",t.value)},[t.value]),e.createElement(ao.input,{ref:n,...r,"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?t.value:s,onChange:e=>{a||i.setState("search",e.target.value),null==o||o(e.target.value)}})}),td=e.forwardRef((t,n)=>{let{children:o,label:r="Suggestions",...a}=t,i=e.useRef(null),s=e.useRef(null),l=ud(e=>e.selectedItemId),c=Uc();return e.useEffect(()=>{if(s.current&&i.current){let e,t=s.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)}}},[]),e.createElement(ao.div,{ref:N(i,n),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},md(t,t=>e.createElement("div",{ref:N(s,c.listInnerRef),"cmdk-list-sizer":""},t)))}),nd=e.forwardRef((t,n)=>{let{open:o,onOpenChange:r,overlayClassName:a,contentClassName:i,container:s,...l}=t;return e.createElement(oa,{open:o,onOpenChange:r},e.createElement(aa,{container:s},e.createElement(ia,{"cmdk-overlay":"",className:a}),e.createElement(sa,{"aria-label":t.label,"cmdk-dialog":"",className:i},e.createElement(Zc,{ref:n,...l}))))}),od=e.forwardRef((t,n)=>ud(e=>0===e.filtered.count)?e.createElement(ao.div,{ref:n,...t,"cmdk-empty":"",role:"presentation"}):null),rd=e.forwardRef((t,n)=>{let{progress:o,children:r,label:a="Loading...",...i}=t;return e.createElement(ao.div,{ref:n,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},md(t,t=>e.createElement("div",{"aria-hidden":!0},t)))}),ad=Object.assign(Zc,{List:td,Item:Xc,Input:ed,Group:Qc,Separator:Jc,Dialog:nd,Empty:od,Loading:rd});function id(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function sd(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ld(t){let n=e.useRef(t);return cd(()=>{n.current=t}),n}var cd="undefined"==typeof window?e.useEffect:e.useLayoutEffect;function dd(t){let n=e.useRef();return void 0===n.current&&(n.current=t()),n}function ud(t){let n=Vc(),o=()=>t(n.snapshot());return e.useSyncExternalStore(n.subscribe,o,o)}function pd(t,n,o,r=[]){let a=e.useRef(),i=Uc();return cd(()=>{var e;let s=(()=>{var e;for(let t of o){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=r.map(e=>e.trim());i.value(t,s,l),null==(e=n.current)||e.setAttribute(Yc,s),a.current=s}),a}var fd=()=>{let[t,n]=e.useState(),o=dd(()=>new Map);return cd(()=>{o.current.forEach(e=>e()),o.current=new Map},[t]),(e,t)=>{o.current.set(e,t),n({})}};function md({asChild:t,children:n},o){return t&&e.isValidElement(n)?e.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(n),{ref:n.ref},o(n.props.children)):o(n)}var hd={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const vd=oa,gd=ra,yd=({className:e,...t})=>g(aa,{...t});yd.displayName=aa.displayName;const bd=e.forwardRef(({className:e,...t},n)=>g(ia,{ref:n,className:Qe("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),...t}));bd.displayName=ia.displayName;const xd=e.forwardRef(({className:e,children:t,showCloseButton:n=!0,...o},r)=>y(yd,{children:[g(bd,{}),y(sa,{ref:r,className:Qe("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),...o,children:[t,n&&y(da,{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:[g(zi,{className:"h-4 w-4"}),g("span",{className:"sr-only",children:"Close"})]})]})]}));xd.displayName=sa.displayName;const wd=({className:e,...t})=>g("div",{className:Qe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});wd.displayName="DialogHeader";const kd=({className:e,...t})=>g("div",{className:Qe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});kd.displayName="DialogFooter";const Nd=e.forwardRef(({className:e,...t},n)=>g(la,{ref:n,className:Qe("text-lg font-semibold leading-none tracking-tight",e),...t}));Nd.displayName=la.displayName;const Cd=e.forwardRef(({className:e,...t},n)=>g(ca,{ref:n,className:Qe("text-sm text-muted-foreground",e),...t}));function _d({className:e,...t}){return g(ad,{"data-slot":"command",className:Qe("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Dd({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:o,showCloseButton:r=!0,...a}){return y(vd,{...a,children:[y(wd,{className:"sr-only",children:[g(Nd,{children:e}),g(Cd,{children:t})]}),g(xd,{className:Qe("overflow-hidden p-0",o),children:g(_d,{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:n})})]})}function Ed({className:e,...t}){return y("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[g(Fi,{className:"size-4 shrink-0 opacity-50"}),g(ad.Input,{"data-slot":"command-input",className:Qe("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),...t})]})}function Sd({className:e,...t}){return g(ad.List,{"data-slot":"command-list",className:Qe("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Md({...e}){return g(ad.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Od({className:e,...t}){return g(ad.Group,{"data-slot":"command-group",className:Qe("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),...t})}function Td({className:e,...t}){return g(ad.Separator,{"data-slot":"command-separator",className:Qe("bg-border -mx-1 h-px",e),...t})}function Rd({className:e,...t}){return g(ad.Item,{"data-slot":"command-item",className:Qe("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),...t})}function Pd({className:e,...t}){return g("span",{"data-slot":"command-shortcut",className:Qe("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}Cd.displayName=ca.displayName;const Ad=["top","right","bottom","left"],Id=Math.min,Fd=Math.max,jd=Math.round,zd=Math.floor,Ld=e=>({x:e,y:e}),Wd={left:"right",right:"left",bottom:"top",top:"bottom"},Bd={start:"end",end:"start"};function $d(e,t,n){return Fd(e,Id(t,n))}function Yd(e,t){return"function"==typeof e?e(t):e}function qd(e){return e.split("-")[0]}function Hd(e){return e.split("-")[1]}function Ud(e){return"x"===e?"y":"x"}function Kd(e){return"y"===e?"height":"width"}const Vd=new Set(["top","bottom"]);function Gd(e){return Vd.has(qd(e))?"y":"x"}function Zd(e){return Ud(Gd(e))}function Xd(e){return e.replace(/start|end/g,e=>Bd[e])}const Qd=["left","right"],Jd=["right","left"],eu=["top","bottom"],tu=["bottom","top"];function nu(e,t,n,o){const r=Hd(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Jd:Qd:t?Qd:Jd;case"left":case"right":return t?eu:tu;default:return[]}}(qd(e),"start"===n,o);return r&&(a=a.map(e=>e+"-"+r),t&&(a=a.concat(a.map(Xd)))),a}function ou(e){return e.replace(/left|right|bottom|top/g,e=>Wd[e])}function ru(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 au(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 iu(e,t,n){let{reference:o,floating:r}=e;const a=Gd(t),i=Zd(t),s=Kd(i),l=qd(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(Hd(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1)}return f}async function su(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}=Yd(t,e),m=ru(f),h=s[p?"floating"===u?"reference":"floating":u],v=au(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,y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(y))&&await(null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},x=au(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:y,strategy:l}):g);return{top:(v.top-x.top+m.top)/b.y,bottom:(x.bottom-v.bottom+m.bottom)/b.y,left:(v.left-x.left+m.left)/b.x,right:(x.right-v.right+m.right)/b.x}}function lu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cu(e){return Ad.some(t=>e[t]>=0)}const du=new Set(["left","top"]);function uu(){return"undefined"!=typeof window}function pu(e){return hu(e)?(e.nodeName||"").toLowerCase():"#document"}function fu(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function mu(e){var t;return null==(t=(hu(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function hu(e){return!!uu()&&(e instanceof Node||e instanceof fu(e).Node)}function vu(e){return!!uu()&&(e instanceof Element||e instanceof fu(e).Element)}function gu(e){return!!uu()&&(e instanceof HTMLElement||e instanceof fu(e).HTMLElement)}function yu(e){return!(!uu()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof fu(e).ShadowRoot)}const bu=new Set(["inline","contents"]);function xu(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ru(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!bu.has(r)}const wu=new Set(["table","td","th"]);function ku(e){return wu.has(pu(e))}const Nu=[":popover-open",":modal"];function Cu(e){return Nu.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const _u=["transform","translate","scale","rotate","perspective"],Du=["transform","translate","scale","rotate","perspective","filter"],Eu=["paint","layout","strict","content"];function Su(e){const t=Mu(),n=vu(e)?Ru(e):e;return _u.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Du.some(e=>(n.willChange||"").includes(e))||Eu.some(e=>(n.contain||"").includes(e))}function Mu(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ou=new Set(["html","body","#document"]);function Tu(e){return Ou.has(pu(e))}function Ru(e){return fu(e).getComputedStyle(e)}function Pu(e){return vu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Au(e){if("html"===pu(e))return e;const t=e.assignedSlot||e.parentNode||yu(e)&&e.host||mu(e);return yu(t)?t.host:t}function Iu(e){const t=Au(e);return Tu(t)?e.ownerDocument?e.ownerDocument.body:e.body:gu(t)&&xu(t)?t:Iu(t)}function Fu(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Iu(e),a=r===(null==(o=e.ownerDocument)?void 0:o.body),i=fu(r);if(a){const e=ju(i);return t.concat(i,i.visualViewport||[],xu(r)?r:[],e&&n?Fu(e):[])}return t.concat(r,Fu(r,[],n))}function ju(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function zu(e){const t=Ru(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=gu(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=jd(n)!==a||jd(o)!==i;return s&&(n=a,o=i),{width:n,height:o,$:s}}function Lu(e){return vu(e)?e:e.contextElement}function Wu(e){const t=Lu(e);if(!gu(t))return Ld(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=zu(t);let i=(a?jd(n.width):n.width)/o,s=(a?jd(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const Bu=Ld(0);function $u(e){const t=fu(e);return Mu()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Bu}function Yu(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=Lu(e);let i=Ld(1);t&&(o?vu(o)&&(i=Wu(o)):i=Wu(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==fu(e))&&t}(a,n,o)?$u(a):Ld(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=fu(a),t=o&&vu(o)?fu(o):o;let n=e,r=ju(n);for(;r&&o&&t!==n;){const e=Wu(r),t=r.getBoundingClientRect(),o=Ru(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=fu(r),r=ju(n)}}return au({width:d,height:u,x:l,y:c})}function qu(e,t){const n=Pu(e).scrollLeft;return t?t.left+n:Yu(mu(e)).left+n}function Hu(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qu(e,n),y:n.top+t.scrollTop}}const Uu=new Set(["absolute","fixed"]);function Ku(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=fu(e),o=mu(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=Mu();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=qu(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=mu(e),n=Pu(e),o=e.ownerDocument.body,r=Fd(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Fd(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+qu(e);const s=-n.scrollTop;return"rtl"===Ru(o).direction&&(i+=Fd(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:s}}(mu(e));else if(vu(t))o=function(e,t){const n=Yu(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=gu(e)?Wu(e):Ld(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=$u(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return au(o)}function Vu(e,t){const n=Au(e);return!(n===t||!vu(n)||Tu(n))&&("fixed"===Ru(n).position||Vu(n,t))}function Gu(e,t,n){const o=gu(t),r=mu(t),a="fixed"===n,i=Yu(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Ld(0);function c(){l.x=qu(r)}if(o||!o&&!a)if(("body"!==pu(t)||xu(r))&&(s=Pu(t)),o){const e=Yu(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?Ld(0):Hu(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 Zu(e){return"static"===Ru(e).position}function Xu(e,t){if(!gu(e)||"fixed"===Ru(e).position)return null;if(t)return t(e);let n=e.offsetParent;return mu(e)===n&&(n=n.ownerDocument.body),n}function Qu(e,t){const n=fu(e);if(Cu(e))return n;if(!gu(e)){let t=Au(e);for(;t&&!Tu(t);){if(vu(t)&&!Zu(t))return t;t=Au(t)}return n}let o=Xu(e,t);for(;o&&ku(o)&&Zu(o);)o=Xu(o,t);return o&&Tu(o)&&Zu(o)&&!Su(o)?n:o||function(e){let t=Au(e);for(;gu(t)&&!Tu(t);){if(Su(t))return t;if(Cu(t))return null;t=Au(t)}return null}(e)||n}const Ju={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a="fixed"===r,i=mu(o),s=!!t&&Cu(t.floating);if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Ld(1);const d=Ld(0),u=gu(o);if((u||!u&&!a)&&(("body"!==pu(o)||xu(i))&&(l=Pu(o)),gu(o))){const e=Yu(o);c=Wu(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const p=!i||u||a?Ld(0):Hu(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:mu,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[..."clippingAncestors"===n?Cu(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Fu(e,[],!1).filter(e=>vu(e)&&"body"!==pu(e)),r=null;const a="fixed"===Ru(e).position;let i=a?Au(e):e;for(;vu(i)&&!Tu(i);){const t=Ru(i),n=Su(i);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&r&&Uu.has(r.position)||xu(i)&&!n&&Vu(e,i))?o=o.filter(e=>e!==i):r=t,i=Au(i)}return t.set(e,o),o}(t,this._c):[].concat(n),o],i=a[0],s=a.reduce((e,n)=>{const o=Ku(t,n,r);return e.top=Fd(o.top,e.top),e.right=Id(o.right,e.right),e.bottom=Id(o.bottom,e.bottom),e.left=Fd(o.left,e.left),e},Ku(t,i,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Qu,getElementRects:async function(e){const t=this.getOffsetParent||Qu,n=this.getDimensions,o=await n(e.floating);return{reference:Gu(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}=zu(e);return{width:t,height:n}},getScale:Wu,isElement:vu,isRTL:function(e){return"rtl"===Ru(e).direction}};function ep(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tp(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=Lu(e),d=r||a?[...c?Fu(c):[],...Fu(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=mu(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:-zd(u)+"px "+-zd(r.clientWidth-(d+p))+"px "+-zd(r.clientHeight-(u+f))+"px "+-zd(d)+"px",threshold:Fd(0,Id(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||ep(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?Yu(e):null;return l&&function t(){const o=Yu(e);h&&!ep(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 np=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=qd(n),s=Hd(n),l="y"===Gd(n),c=du.has(i)?-1:1,d=a&&l?-1:1,u=Yd(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}}}}},op=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}=Yd(e,t),c={x:n,y:o},d=await su(t,l),u=Gd(qd(r)),p=Ud(u);let f=c[p],m=c[u];if(a){const e="y"===p?"bottom":"right";f=$d(f+d["y"===p?"top":"left"],f,f-d[e])}if(i){const e="y"===u?"bottom":"right";m=$d(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}}}}}},rp=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}=Yd(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const g=qd(r),y=Gd(s),b=qd(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!h?[ou(s)]:function(e){const t=ou(e);return[Xd(e),t,Xd(t)]}(s)),k="none"!==m;!p&&k&&w.push(...nu(s,h,m,x));const N=[s,...w],C=await su(t,v),_=[];let D=(null==(o=a.flip)?void 0:o.overflows)||[];if(d&&_.push(C[g]),u){const e=function(e,t,n){void 0===n&&(n=!1);const o=Hd(e),r=Zd(e),a=Kd(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=ou(i)),[i,ou(i)]}(r,i,x);_.push(C[e[0]],C[e[1]])}if(D=[...D,{placement:r,overflows:_}],!_.every(e=>e<=0)){var E,S;const e=((null==(E=a.flip)?void 0:E.index)||0)+1,t=N[e];if(t){if(!("alignment"===u&&y!==Gd(t))||D.every(e=>Gd(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:D},reset:{placement:t}}}let n=null==(S=D.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 M;const e=null==(M=D.filter(e=>{if(k){const t=Gd(e.placement);return t===y||"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:M[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},ap=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}=Yd(e,t),d=await su(t,c),u=qd(r),p=Hd(r),f="y"===Gd(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 y=h-d.top-d.bottom,b=m-d.left-d.right,x=Id(h-d[v],y),w=Id(m-d[g],b),k=!t.middlewareData.shift;let N=x,C=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=b),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(N=y),k&&!p){const e=Fd(d.left,0),t=Fd(d.right,0),n=Fd(d.top,0),o=Fd(d.bottom,0);f?C=m-2*(0!==e||0!==t?e+t:Fd(d.left,d.right)):N=h-2*(0!==n||0!==o?n+o:Fd(d.top,d.bottom))}await l({...t,availableWidth:C,availableHeight:N});const _=await i.getDimensions(s.floating);return m!==_.width||h!==_.height?{reset:{rects:!0}}:{}}}},ip=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Yd(e,t);switch(o){case"referenceHidden":{const e=lu(await su(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cu(e)}}}case"escaped":{const e=lu(await su(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:cu(e)}}}default:return{}}}}},sp=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}=Yd(e,t)||{};if(null==c)return{};const u=ru(d),p={x:n,y:o},f=Zd(r),m=Kd(f),h=await i.getDimensions(c),v="y"===f,g=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",x=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 N=k?k[b]:0;N&&await(null==i.isElement?void 0:i.isElement(k))||(N=s.floating[b]||a.floating[m]);const C=x/2-w/2,_=N/2-h[m]/2-1,D=Id(u[g],_),E=Id(u[y],_),S=D,M=N-h[m]-E,O=N/2-h[m]/2+C,T=$d(S,O,M),R=!l.arrow&&null!=Hd(r)&&O!==T&&a.reference[m]/2-(O<S?D:E)-h[m]/2<0,P=R?O<S?O-S:O-M:0;return{[f]:p[f]+P,data:{[f]:T,centerOffset:O-T-P,...R&&{alignmentOffset:P}},reset:R}}}),lp=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}=Yd(e,t),d={x:n,y:o},u=Gd(r),p=Ud(u);let f=d[p],m=d[u];const h=Yd(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,y;const e="y"===p?"width":"height",t=du.has(qd(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==(y=i.offset)?void 0:y[u])||0)-(t?v.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[p]:f,[u]:m}}}},cp=(e,t,n)=>{const o=new Map,r={platform:Ju,...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}=iu(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:y,reset:b}=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],...y}},b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:d,y:u}=iu(c,p,l))),n=-1)}return{x:d,y:u,placement:p,strategy:r,middlewareData:f}})(e,t,{...r,platform:a})};var dp="undefined"!=typeof document?h:function(){};function up(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(!up(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)&&!up(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function pp(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fp(e,t){const n=pp(e);return Math.round(t*n)/n}function mp(t){const n=e.useRef(t);return dp(()=>{n.current=t}),n}function hp(t){void 0===t&&(t={});const{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=t,[u,p]=e.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[f,m]=e.useState(r);up(f,r)||m(r);const[h,v]=e.useState(null),[g,y]=e.useState(null),b=e.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),w=e.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),k=i||h,N=s||g,C=e.useRef(null),_=e.useRef(null),D=e.useRef(u),E=null!=c,S=mp(c),M=mp(a),O=mp(d),T=e.useCallback(()=>{if(!C.current||!_.current)return;const e={placement:n,strategy:o,middleware:f};M.current&&(e.platform=M.current),cp(C.current,_.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};R.current&&!up(D.current,t)&&(D.current=t,x.flushSync(()=>{p(t)}))})},[f,n,o,M,O]);dp(()=>{!1===d&&D.current.isPositioned&&(D.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const R=e.useRef(!1);dp(()=>(R.current=!0,()=>{R.current=!1}),[]),dp(()=>{if(k&&(C.current=k),N&&(_.current=N),k&&N){if(S.current)return S.current(k,N,T);T()}},[k,N,T,S,E]);const P=e.useMemo(()=>({reference:C,floating:_,setReference:b,setFloating:w}),[b,w]),A=e.useMemo(()=>({reference:k,floating:N}),[k,N]),I=e.useMemo(()=>{const e={position:o,left:0,top:0};if(!A.floating)return e;const t=fp(A.floating,u.x),n=fp(A.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...pp(A.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,l,A.floating,u.x,u.y]);return e.useMemo(()=>({...u,update:T,refs:P,elements:A,floatingStyles:I}),[u,T,P,A,I])}const vp=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?sp({element:n.current,padding:o}).fn(t):{}:n?sp({element:n,padding:o}).fn(t):{};var r}}),gp=(e,t)=>({...np(e),options:[e,t]}),yp=(e,t)=>({...op(e),options:[e,t]}),bp=(e,t)=>({...lp(e),options:[e,t]}),xp=(e,t)=>({...rp(e),options:[e,t]}),wp=(e,t)=>({...ap(e),options:[e,t]}),kp=(e,t)=>({...ip(e),options:[e,t]}),Np=(e,t)=>({...vp(e),options:[e,t]});var Cp=e.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...a}=e;return g(ao.svg,{...a,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g("polygon",{points:"0,0 30,0 15,10"})})});Cp.displayName="Arrow";var _p=Cp;var Dp="Popper",[Ep,Sp]=Un(Dp),[Mp,Op]=Ep(Dp),Tp=t=>{const{__scopePopper:n,children:o}=t,[r,a]=e.useState(null);return g(Mp,{scope:n,anchor:r,onAnchorChange:a,children:o})};Tp.displayName=Dp;var Rp="PopperAnchor",Pp=e.forwardRef((t,n)=>{const{__scopePopper:o,virtualRef:r,...a}=t,i=Op(Rp,o),s=e.useRef(null),l=C(n,s),c=e.useRef(null);return e.useEffect(()=>{const e=c.current;c.current=r?.current||s.current,e!==c.current&&i.onAnchorChange(c.current)}),r?null:g(ao.div,{...a,ref:l})});Pp.displayName=Rp;var Ap="PopperContent",[Ip,Fp]=Ep(Ap),jp=e.forwardRef((t,n)=>{const{__scopePopper:o,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:h,...v}=t,y=Op(Ap,o),[b,x]=e.useState(null),w=C(n,e=>x(e)),[k,N]=e.useState(null),_=function(t){const[n,o]=e.useState(void 0);return Gn(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let r,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=t.offsetWidth,a=t.offsetHeight;o({width:r,height:a})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}o(void 0)},[t]),n}(k),D=_?.width??0,E=_?.height??0,S=r+("center"!==i?"-"+i:""),M="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(d)?d:[d],T=O.length>0,R={padding:M,boundary:O.filter(Bp),altBoundary:T},{refs:P,floatingStyles:A,placement:I,isPositioned:F,middlewareData:j}=hp({strategy:"fixed",placement:S,whileElementsMounted:(...e)=>tp(...e,{animationFrame:"always"===m}),elements:{reference:y.anchor},middleware:[gp({mainAxis:a+E,alignmentAxis:s}),c&&yp({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?bp():void 0,...R}),c&&xp({...R}),wp({...R,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&&Np({element:k,padding:l}),$p({arrowWidth:D,arrowHeight:E}),f&&kp({strategy:"referenceHidden",...R})]}),[z,L]=Yp(I),W=io(h);Gn(()=>{F&&W?.()},[F,W]);const B=j.arrow?.x,$=j.arrow?.y,Y=0!==j.arrow?.centerOffset,[q,H]=e.useState();return Gn(()=>{b&&H(window.getComputedStyle(b).zIndex)},[b]),g("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:F?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g(Ip,{scope:o,placedSide:z,onArrowChange:N,arrowX:B,arrowY:$,shouldHideArrow:Y,children:g(ao.div,{"data-side":z,"data-align":L,...v,ref:w,style:{...v.style,animation:F?void 0:"none"}})})})});jp.displayName=Ap;var zp="PopperArrow",Lp={top:"bottom",right:"left",bottom:"top",left:"right"},Wp=e.forwardRef(function(e,t){const{__scopePopper:n,...o}=e,r=Fp(zp,n),a=Lp[r.placedSide];return g("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:g(_p,{...o,ref:t,style:{...o.style,display:"block"}})})});function Bp(e){return null!==e}Wp.displayName=zp;var $p=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]=Yp(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 Yp(e){const[t,n="center"]=e.split("-");return[t,n]}var qp=Tp,Hp=Pp,Up=jp,Kp=Wp,Vp="Popover",[Gp]=Un(Vp,[Sp]),Zp=Sp(),[Xp,Qp]=Gp(Vp),Jp=t=>{const{__scopePopover:n,children:o,open:r,defaultOpen:a,onOpenChange:i,modal:s=!1}=t,l=Zp(n),c=e.useRef(null),[d,u]=e.useState(!1),[p,f]=eo({prop:r,defaultProp:a??!1,onChange:i,caller:Vp});return g(qp,{...l,children:g(Xp,{scope:n,contentId:Qn(),triggerRef:c,open:p,onOpenChange:f,onOpenToggle:e.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:d,onCustomAnchorAdd:e.useCallback(()=>u(!0),[]),onCustomAnchorRemove:e.useCallback(()=>u(!1),[]),modal:s,children:o})})};Jp.displayName=Vp;var ef="PopoverAnchor";e.forwardRef((t,n)=>{const{__scopePopover:o,...r}=t,a=Qp(ef,o),i=Zp(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=a;return e.useEffect(()=>(s(),()=>l()),[s,l]),g(Hp,{...i,...r,ref:n})}).displayName=ef;var tf="PopoverTrigger",nf=e.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Qp(tf,n),a=Zp(n),i=C(t,r.triggerRef),s=g(ao.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":hf(r.open),...o,ref:i,onClick:Vn(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?s:g(Hp,{asChild:!0,...a,children:s})});nf.displayName=tf;var of="PopoverPortal",[rf,af]=Gp(of,{forceMount:void 0}),sf=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,a=Qp(of,t);return g(rf,{scope:t,forceMount:n,children:g(Eo,{present:n||a.open,children:g(Do,{asChild:!0,container:r,children:o})})})};sf.displayName=of;var lf="PopoverContent",cf=e.forwardRef((e,t)=>{const n=af(lf,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,a=Qp(lf,e.__scopePopover);return g(Eo,{present:o||a.open,children:a.modal?g(uf,{...r,ref:t}):g(pf,{...r,ref:t})})});cf.displayName=lf;var df=to("PopoverContent.RemoveScroll"),uf=e.forwardRef((t,n)=>{const o=Qp(lf,t.__scopePopover),r=e.useRef(null),a=C(n,r),i=e.useRef(!1);return e.useEffect(()=>{const e=r.current;if(e)return Nr(e)},[]),g(vr,{as:df,allowPinchZoom:!0,children:g(ff,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Vn(t.onCloseAutoFocus,e=>{e.preventDefault(),i.current||o.triggerRef.current?.focus()}),onPointerDownOutside:Vn(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;i.current=o},{checkForDefaultPrevented:!1}),onFocusOutside:Vn(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),pf=e.forwardRef((t,n)=>{const o=Qp(lf,t.__scopePopover),r=e.useRef(!1),a=e.useRef(!1);return g(ff,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(r.current||o.triggerRef.current?.focus(),e.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(r.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,i=o.triggerRef.current?.contains(n);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),ff=e.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...u}=e,p=Qp(lf,n),f=Zp(n);return Oo(),g(bo,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:g(fo,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:g(Up,{"data-state":hf(p.open),role:"dialog",id:p.contentId,...f,...u,ref:t,style:{...u.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)"}})})})}),mf="PopoverClose";e.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Qp(mf,n);return g(ao.button,{type:"button",...o,ref:t,onClick:Vn(e.onClick,()=>r.onOpenChange(!1))})}).displayName=mf;function hf(e){return e?"open":"closed"}e.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Zp(n);return g(Kp,{...r,...o,ref:t})}).displayName="PopoverArrow";var vf=sf,gf=cf;const yf=Jp,bf=nf,xf=e.forwardRef(({className:e,align:t="center",sideOffset:n=4,...o},r)=>g(vf,{children:g(gf,{ref:r,align:t,sideOffset:n,"data-slot":"popover-content",className:Qe("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),...o})}));function wf({items:t,value:n,onChange:o,placeholder:r="Select an option...",emptyMessage:a="No items found.",className:i,searchPlaceholder:s="Search...",onSearchChange:l,filterLocally:c=!0,loading:d=!1,displayLabel:u,disabled:p=!1}){const[f,m]=e.useState(!1),[h,v]=e.useState(""),[b,x]=e.useState(null);e.useEffect(()=>{if(!n||""===n)return void x(null);const e=t?.find(e=>String(e.value)===String(n));e&&x(e)},[n,t]);const w=c&&h?t?.filter(e=>e.label.toLowerCase().includes(h.toLowerCase())):t,k=u??b?.label??r;return y(yf,{open:f,onOpenChange:m,children:[g(bf,{asChild:!0,children:y("button",{type:"button","data-cy":"combobox-trigger",disabled:p,"aria-expanded":f,className:Qe(nt,"justify-between truncate",!u&&!b&&ot,i),children:[g("span",{className:"truncate",children:k}),g(_i,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}),g(xf,{className:"max-w-[700px] p-0 w-full min-w-(--radix-popover-trigger-width)",children:y(_d,{shouldFilter:!1,children:[g(Ed,{"data-cy":"combobox-input",placeholder:s,value:h,onValueChange:e=>{v(e),l?.(e)},className:"h-9 focus:ring-0 focus:outline-none focus-visible:ring-0 focus-visible:ring-offset-0"}),y(Sd,{"data-cy":"combobox-list",children:[g(Md,{children:d?"Loading...":a}),g(Od,{children:w?.map(e=>y(Rd,{value:String(e?.value??""),onSelect:t=>((e,t)=>{const r=e===n?null:t;o(r?.value??"",r),m(!1),v(""),x(r)})(t,e),className:Qe("cursor-pointer",rt),children:[e.label,g(xi,{className:Qe("ml-auto size-4",String(n)===String(e.value)?"opacity-100":"opacity-0")})]},e?.value))})]})]})})]})}xf.displayName=gf.displayName;const kf={},Nf=({id:e,fetcher:t,resolveValue:n,modelClass:r,labelName:a,valueField:l="pk",placeholder:c="Select item...",emptyMessage:u="No items found",value:p,onChange:f,additionalFilters:m=kf,fields:h,className:v,debounceWait:y=300})=>{const b=o(()=>m??kf,[m]),[x,w]=d([]),[k,N]=d(""),[C,_]=d(""),[D,E]=d(!1),[S,M]=d();i(()=>{const e=setTimeout(()=>{_(k)},y);return()=>clearTimeout(e)},[k,y]);const O=s(async()=>{E(!0);try{const e=await t({search:C,modelClass:r,labelName:a,additionalFilters:b,fields:h});w(((e,t,n)=>e.map(e=>({value:e[n]??e.id??e.pk,label:String(e[t]??e.name??e.pk??""),...e})))(e,a,l))}catch(e){console.error("FKSelect fetch error:",e),w([])}finally{E(!1)}},[t,C,r,a,b,h,l]);i(()=>{O()},[O]);const T=x.find(e=>String(e.value)===String(p))?.label;i(()=>{if(!p)return void M(void 0);if(T)return void M(T);if(!n)return void M(void 0);let e=!0;return n({modelClass:r,value:p}).then(t=>{if(!e||!t)return;const n=String(t[a]??t.name??p);M(n)}).catch(e=>{console.error("FKSelect resolve error:",e)}),()=>{e=!1}},[p,T,n,r,a]);return g("div",{"data-testid":e,className:Qe("flex w-full min-w-0",v),children:g(wf,{items:x,placeholder:c,emptyMessage:u,value:p?String(p):null,onChange:(e,t)=>{t&&f(e,t)},onSearchChange:N,filterLocally:!1,loading:D,displayLabel:S,className:"w-full"})})};function Cf(e,[t,n]){return Math.min(n,Math.max(t,e))}function _f(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>n.current?.(...e),[])}var Df,Ef="dismissableLayer.update",Sf="dismissableLayer.pointerDownOutside",Mf="dismissableLayer.focusOutside",Of=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Tf=e.forwardRef((t,n)=>{const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=t,u=e.useContext(Of),[p,f]=e.useState(null),m=p?.ownerDocument??globalThis?.document,[,h]=e.useState({}),v=tl(n,e=>f(e)),y=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(b),w=p?y.indexOf(p):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,N=w>=x,C=e.useRef(!1),_=function(t,n){const{ownerDocument:o=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i}=n,s=_f(t),l=e.useRef(!1),c=e.useRef(!1),d=e.useRef(new Map),u=e.useRef(()=>{});return e.useEffect(()=>{function e(){c.current=!1,a.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function n(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=n=>{if(n.target&&!l.current){let i=function(){o.removeEventListener("click",u.current);const n=t();e(),n||Pf(Sf,s,l,{discrete:!0})};const l={originalEvent:n};c.current=!0,a.current=r&&0===n.button,d.current.clear(),r&&0===n.button?(o.removeEventListener("click",u.current),u.current=i,o.addEventListener("click",u.current,{once:!0})):i()}else o.removeEventListener("click",u.current),e();l.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const e of m)o.addEventListener(e,n,!0),o.addEventListener(e,p);const h=window.setTimeout(()=>{o.addEventListener("pointerdown",f)},0);return()=>{window.clearTimeout(h),o.removeEventListener("pointerdown",f),o.removeEventListener("click",u.current);for(const e of m)o.removeEventListener(e,n,!0),o.removeEventListener(e,p)}},[o,s,r,a,i]),{onPointerDownCapture:()=>l.current=!0}}(e=>{const t=e.target;if(!(t instanceof Node))return;const n=[...u.branches].some(e=>e.contains(t));N&&!n&&(i?.(e),l?.(e),e.defaultPrevented||c?.())},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces}),D=function(t,n=globalThis?.document){const o=_f(t),r=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!r.current){Pf(Mf,o,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,o]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(r&&C.current)return;const t=e.target;[...u.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},m);return function(t,n=globalThis?.document){const o=_f(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&o(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[o,n])}(e=>{w===u.layers.size-1&&(a?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},m),e.useEffect(()=>{if(p)return o&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Df=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Rf(),()=>{o&&(u.layersWithOutsidePointerEventsDisabled.delete(p),0===u.layersWithOutsidePointerEventsDisabled.size&&(m.body.style.pointerEvents=Df))}},[p,m,o,u]),e.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Rf())},[p,u]),e.useEffect(()=>{const e=()=>h({});return document.addEventListener(Ef,e),()=>document.removeEventListener(Ef,e)},[]),g(hl.div,{...d,ref:v,style:{pointerEvents:k?N?"auto":"none":void 0,...t.style},onFocusCapture:ul(t.onFocusCapture,D.onFocusCapture),onBlurCapture:ul(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:ul(t.onPointerDownCapture,_.onPointerDownCapture)})});Tf.displayName="DismissableLayer";function Rf(){const e=new CustomEvent(Ef);document.dispatchEvent(e)}function Pf(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?vl(r,a):r.dispatchEvent(a)}e.forwardRef((t,n)=>{const o=e.useContext(Of),r=e.useRef(null),a=tl(n,r);return e.useEffect(()=>{const e=r.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),g(hl.div,{...t,ref:a})}).displayName="DismissableLayerBranch";var Af=0,If=null;function Ff(){e.useEffect(()=>{If||(If={start:jf(),end:jf()});const{start:e,end:t}=If;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Af++,()=>{1===Af&&(If?.start.remove(),If?.end.remove(),If=null),Af=Math.max(0,Af-1)}},[])}function jf(){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 zf="focusScope.autoFocusOnMount",Lf="focusScope.autoFocusOnUnmount",Wf={bubbles:!1,cancelable:!0},Bf=e.forwardRef((t,n)=>{const{loop:o=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=t,[l,c]=e.useState(null),d=_f(a),u=_f(i),p=e.useRef(null),f=tl(n,e=>c(e)),m=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(r){let e=function(e){if(m.paused||!l)return;const t=e.target;l.contains(t)?p.current=t:Hf(p.current,{select:!0})},t=function(e){if(m.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Hf(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Hf(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return l&&o.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[r,l,m.paused]),e.useEffect(()=>{if(l){Uf.add(m);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(zf,Wf);l.addEventListener(zf,d),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Hf(o,{select:t}),document.activeElement!==n)return}((e=$f(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Hf(l))}return()=>{l.removeEventListener(zf,d),setTimeout(()=>{const e=new CustomEvent(Lf,Wf);l.addEventListener(Lf,u),l.dispatchEvent(e),e.defaultPrevented||Hf(t??document.body,{select:!0}),l.removeEventListener(Lf,u),Uf.remove(m)},0)}}var e},[l,d,u,m]);const h=e.useCallback(e=>{if(!o&&!r)return;if(m.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=$f(e),n=Yf(t,e),o=Yf(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&Hf(a,{select:!0})):(e.preventDefault(),o&&Hf(r,{select:!0})):n===t&&e.preventDefault()}},[o,r,m.paused]);return g(hl.div,{tabIndex:-1,...s,ref:f,onKeyDown:h})});function $f(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 Yf(e,t){for(const n of e)if(!qf(n,{upTo:t}))return n}function qf(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 Hf(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()}}Bf.displayName="FocusScope";var Uf=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Kf(e,t),e.unshift(t)},remove(t){e=Kf(e,t),e[0]?.resume()}}}();function Kf(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var Vf=e.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...a}=e;return g(hl.svg,{...a,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g("polygon",{points:"0,0 30,0 15,10"})})});Vf.displayName="Arrow";var Gf=Vf;function Zf(t){const[n,o]=e.useState(void 0);return pl(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let r,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=t.offsetWidth,a=t.offsetHeight;o({width:r,height:a})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}o(void 0)},[t]),n}var Xf="Popper",[Qf,Jf]=Xs(Xf),[em,tm]=Qf(Xf),nm=t=>{const{__scopePopper:n,children:o}=t,[r,a]=e.useState(null),[i,s]=e.useState(void 0);return g(em,{scope:n,anchor:r,onAnchorChange:a,placementState:i,setPlacementState:s,children:o})};nm.displayName=Xf;var om="PopperAnchor",rm=e.forwardRef((t,n)=>{const{__scopePopper:o,virtualRef:r,...a}=t,i=tm(om,o),s=e.useRef(null),l=i.onAnchorChange,c=tl(n,e.useCallback(e=>{s.current=e,e&&l(e)},[l])),d=e.useRef(null);e.useEffect(()=>{if(!r)return;const e=d.current;d.current=r.current,e!==d.current&&l(d.current)});const u=i.placementState&&mm(i.placementState),p=u?.[0],f=u?.[1];return r?null:g(hl.div,{"data-radix-popper-side":p,"data-radix-popper-align":f,...a,ref:c})});rm.displayName=om;var am="PopperContent",[im,sm]=Qf(am),lm=e.forwardRef((t,n)=>{const{__scopePopper:o,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:h,...v}=t,y=tm(am,o),[b,x]=e.useState(null),w=tl(n,e=>x(e)),[k,N]=e.useState(null),C=Zf(k),_=C?.width??0,D=C?.height??0,E=r+("center"!==i?"-"+i:""),S="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},M=Array.isArray(d)?d:[d],O=M.length>0,T={padding:S,boundary:M.filter(pm),altBoundary:O},{refs:R,floatingStyles:P,placement:A,isPositioned:I,middlewareData:F}=hp({strategy:"fixed",placement:E,whileElementsMounted:(...e)=>tp(...e,{animationFrame:"always"===m}),elements:{reference:y.anchor},middleware:[gp({mainAxis:a+D,alignmentAxis:s}),c&&yp({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?bp():void 0,...T}),c&&xp({...T}),wp({...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`)}}),k&&Np({element:k,padding:l}),fm({arrowWidth:_,arrowHeight:D}),f&&kp({strategy:"referenceHidden",...T,boundary:O?T.boundary:void 0})]}),j=y.setPlacementState;pl(()=>(j(A),()=>{j(void 0)}),[A,j]);const[z,L]=mm(A),W=_f(h);pl(()=>{I&&W?.()},[I,W]);const B=F.arrow?.x,$=F.arrow?.y,Y=0!==F.arrow?.centerOffset,[q,H]=e.useState();return pl(()=>{b&&H(window.getComputedStyle(b).zIndex)},[b]),g("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:I?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g(im,{scope:o,placedSide:z,placedAlign:L,onArrowChange:N,arrowX:B,arrowY:$,shouldHideArrow:Y,children:g(hl.div,{"data-side":z,"data-align":L,...v,ref:w,style:{...v.style,animation:I?void 0:"none"}})})})});lm.displayName=am;var cm="PopperArrow",dm={top:"bottom",right:"left",bottom:"top",left:"right"},um=e.forwardRef(function(e,t){const{__scopePopper:n,...o}=e,r=sm(cm,n),a=dm[r.placedSide];return g("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:g(Gf,{...o,ref:t,style:{...o.style,display:"block"}})})});function pm(e){return null!==e}um.displayName=cm;var fm=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]=mm(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 mm(e){const[t,n="center"]=e.split("-");return[t,n]}var hm=nm,vm=rm,gm=lm,ym=um,bm=e.forwardRef((t,n)=>{const{container:o,...r}=t,[a,i]=e.useState(!1);pl(()=>i(!0),[]);const s=o||a&&globalThis?.document?.body;return s?x.createPortal(g(hl.div,{...r,ref:n}),s):null});function xm(t){const n=e.useRef({value:t,previous:t});return e.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}bm.displayName="Portal";var wm=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"}),km=e.forwardRef((e,t)=>g(hl.span,{...e,ref:t,style:{...wm,...e.style}}));km.displayName="VisuallyHidden";var Nm=km,Cm=[" ","Enter","ArrowUp","ArrowDown"],_m=[" ","Enter"],Dm="Select",[Em,Sm,Mm]=dl(Dm),[Om]=Xs(Dm,[Mm,Jf]),Tm=Jf(),[Rm,Pm]=Om(Dm),[Am,Im]=Om(Dm);function Fm(t){const{__scopeSelect:n,children:o,open:r,defaultOpen:a,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:f,required:m,form:h,internal_do_not_use_render:v}=t,y=Tm(n),[b,x]=e.useState(null),[w,k]=e.useState(null),[N,C]=e.useState(!1),_=Ll(d),[D,E]=ml({prop:r,defaultProp:a??!1,onChange:i,caller:Dm}),[S,M]=ml({prop:s,defaultProp:l,onChange:c,caller:Dm}),O=e.useRef(null),T=!b||(!!h||!!b.closest("form")),[R,P]=e.useState(new Set),A=kl(),I=Array.from(R).map(e=>e.props.value).join(";"),F=e.useCallback(e=>{P(t=>new Set(t).add(e))},[]),j=e.useCallback(e=>{P(t=>{const n=new Set(t);return n.delete(e),n})},[]),z={required:m,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:k,valueNodeHasChildren:N,onValueNodeHasChildrenChange:C,contentId:A,value:S,onValueChange:M,open:D,onOpenChange:E,dir:_,triggerPointerDownPosRef:O,disabled:f,name:u,autoComplete:p,form:h,nativeOptions:R,nativeSelectKey:I,isFormControl:T};return g(hm,{...y,children:g(Rm,{scope:n,...z,children:g(Em.Provider,{scope:n,children:g(Am,{scope:n,onNativeOptionAdd:F,onNativeOptionRemove:j,children:Oh(v)?v(z):o})})})})}Fm.displayName="SelectProvider";var jm=e=>{const{__scopeSelect:t,children:n,...o}=e;return g(Fm,{__scopeSelect:t,...o,internal_do_not_use_render:({isFormControl:e})=>y(b,{children:[n,e?g(Mh,{__scopeSelect:t}):null]})})};jm.displayName=Dm;var zm="SelectTrigger",Lm=e.forwardRef((t,n)=>{const{__scopeSelect:o,disabled:r=!1,...a}=t,i=Tm(o),s=Pm(zm,o),l=s.disabled||r,c=tl(n,s.onTriggerChange),d=Sm(o),u=e.useRef("touch"),[p,f,m]=Rh(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),o=Ph(t,e,n);void 0!==o&&s.onValueChange(o.value)}),h=e=>{l||(s.onOpenChange(!0),m()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return g(vm,{asChild:!0,...i,children:g(hl.button,{type:"button",role:"combobox","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Th(s.value)?"":void 0,...a,ref:c,onClick:ul(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==u.current&&h(e)}),onPointerDown:ul(a.onPointerDown,e=>{u.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(h(e),e.preventDefault())}),onKeyDown:ul(a.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),t&&" "===e.key||Cm.includes(e.key)&&(h(),e.preventDefault())})})})});Lm.displayName=zm;var Wm="SelectValue",Bm=e.forwardRef((t,n)=>{const{__scopeSelect:o,className:r,style:a,children:i,placeholder:s="",...l}=t,c=Pm(Wm,o),{onValueNodeHasChildrenChange:d}=c,u=void 0!==i,p=tl(n,c.onValueNodeChange);pl(()=>{d(u)},[d,u]);const f=Th(c.value);return g(hl.span,{...l,asChild:!f&&l.asChild,ref:p,style:{pointerEvents:"none"},children:g(e.Fragment,{children:f?s:i},f?"placeholder":"value")})});Bm.displayName=Wm;var $m=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return g(hl.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});$m.displayName="SelectIcon";var Ym="SelectPortal",[qm,Hm]=Om(Ym,{forceMount:void 0}),Um=e=>{const{__scopeSelect:t,forceMount:n,...o}=e;return g(qm,{scope:e.__scopeSelect,forceMount:n,children:g(bm,{asChild:!0,...o})})};Um.displayName=Ym;var Km="SelectContent",Vm=e.forwardRef((t,n)=>{const o=Hm(Km,t.__scopeSelect),{forceMount:r=o.forceMount,...a}=t,i=Pm(Km,t.__scopeSelect),[s,l]=e.useState();return pl(()=>{l(new DocumentFragment)},[]),g(gl,{present:r||i.open,children:({present:e})=>e?g(eh,{...a,ref:n}):g(Gm,{...a,fragment:s})})});Vm.displayName=Km;var Gm=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,fragment:r}=e;return r?x.createPortal(g(Xm,{scope:n,children:g(Em.Slot,{scope:n,children:g("div",{ref:t,children:o})})}),r):null});Gm.displayName="SelectContentFragment";var Zm=10,[Xm,Qm]=Om(Km),Jm=nl("SelectContent.RemoveScroll"),eh=e.forwardRef((t,n)=>{const{__scopeSelect:o}=t,{position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:f,collisionPadding:m,sticky:h,hideWhenDetached:v,avoidCollisions:y,...b}=t,x=Pm(Km,o),[w,k]=e.useState(null),[N,C]=e.useState(null),_=tl(n,e=>k(e)),[D,E]=e.useState(null),[S,M]=e.useState(null),O=Sm(o),[T,R]=e.useState(!1),P=e.useRef(!1);e.useEffect(()=>{if(w)return Nr(w)},[w]),Ff();const A=e.useCallback(e=>{const[t,...n]=O().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&&N&&(N.scrollTop=0),n===o&&N&&(N.scrollTop=N.scrollHeight),n?.focus(),document.activeElement!==r)return}},[O,N]),I=e.useCallback(()=>A([D,w]),[A,D,w]);e.useEffect(()=>{T&&I()},[T,I]);const{onOpenChange:F,triggerPointerDownPosRef:j}=x;e.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(j.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(j.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(w)||F(!1),document.removeEventListener("pointermove",t),j.current=null};return null!==j.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,F,j]),e.useEffect(()=>{const e=()=>F(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[F]);const[z,L]=Rh(e=>{const t=O().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=Ph(t,e,n);o&&setTimeout(()=>o.ref.current?.focus())}),W=e.useCallback((e,t,n)=>{const o=!P.current&&!n;(void 0!==x.value&&x.value===t||o)&&(E(e),o&&(P.current=!0))},[x.value]),B=e.useCallback(()=>w?.focus(),[w]),$=e.useCallback((e,t,n)=>{const o=!P.current&&!n;(void 0!==x.value&&x.value===t||o)&&M(e)},[x.value]),Y="popper"===r?nh:th,q=Y===nh?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:f,collisionPadding:m,sticky:h,hideWhenDetached:v,avoidCollisions:y}:{};return g(Xm,{scope:o,content:w,viewport:N,onViewportChange:C,itemRefCallback:W,selectedItem:D,onItemLeave:B,itemTextRefCallback:$,focusSelectedItem:I,selectedItemText:S,position:r,isPositioned:T,searchRef:z,children:g(vr,{as:Jm,allowPinchZoom:!0,children:g(Bf,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ul(a,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:g(Tf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:g(Y,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...q,onPlaced:()=>R(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ul(b.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=O().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(()=>A(t)),e.preventDefault()}})})})})})})});eh.displayName="SelectContentImpl";var th=e.forwardRef((t,n)=>{const{__scopeSelect:o,onPlaced:r,...a}=t,i=Pm(Km,o),s=Qm(Km,o),[l,c]=e.useState(null),[d,u]=e.useState(null),p=tl(n,e=>u(e)),f=Sm(o),m=e.useRef(!1),h=e.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,w=e.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&v&&y&&b){const e=i.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==i.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,c=Math.max(s,t.width),d=window.innerWidth-Zm,u=Cf(a,[Zm,Math.max(Zm,d-c)]);l.style.minWidth=s+"px",l.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,c=Math.max(s,t.width),d=window.innerWidth-Zm,u=Cf(a,[Zm,Math.max(Zm,d-c)]);l.style.minWidth=s+"px",l.style.right=u+"px"}const a=f(),s=window.innerHeight-2*Zm,c=v.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),h=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=p+h+c+parseInt(u.paddingBottom,10)+g,w=Math.min(5*y.offsetHeight,x),k=window.getComputedStyle(v),N=parseInt(k.paddingTop,10),C=parseInt(k.paddingBottom,10),_=e.top+e.height/2-Zm,D=s-_,E=y.offsetHeight/2,S=p+h+(y.offsetTop+E),M=x-S;if(S<=_){const e=a.length>0&&y===a[a.length-1].ref.current;l.style.bottom="0px";const t=d.clientHeight-v.offsetTop-v.offsetHeight,n=S+Math.max(D,E+(e?C:0)+t+g);l.style.height=n+"px"}else{const e=a.length>0&&y===a[0].ref.current;l.style.top="0px";const t=Math.max(_,p+v.offsetTop+(e?N:0)+E)+M;l.style.height=t+"px",v.scrollTop=S-_+v.offsetTop}l.style.margin=`${Zm}px 0`,l.style.minHeight=w+"px",l.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[f,i.trigger,i.valueNode,l,d,v,y,b,i.dir,r]);pl(()=>w(),[w]);const[k,N]=e.useState();pl(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const C=e.useCallback(e=>{e&&!0===h.current&&(w(),x?.(),h.current=!1)},[w,x]);return g(oh,{scope:o,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:g("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:g(hl.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});th.displayName="SelectItemAlignedPosition";var nh=e.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Zm,...a}=e,i=Tm(n);return g(gm,{...i,...a,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...a.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)"}})});nh.displayName="SelectPopperPosition";var[oh,rh]=Om(Km,{}),ah="SelectViewport",ih=e.forwardRef((t,n)=>{const{__scopeSelect:o,nonce:r,...a}=t,i=Qm(ah,o),s=rh(ah,o),l=tl(n,i.onViewportChange),c=e.useRef(0);return y(b,{children:[g("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:r}),g(Em.Slot,{scope:o,children:g(hl.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ul(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=s;if(o?.current&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*Zm,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")}}}c.current=t.scrollTop})})})]})});ih.displayName=ah;var sh="SelectGroup",[lh,ch]=Om(sh),dh=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=kl();return g(lh,{scope:n,id:r,children:g(hl.div,{role:"group","aria-labelledby":r,...o,ref:t})})});dh.displayName=sh;var uh="SelectLabel",ph=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ch(uh,n);return g(hl.div,{id:r.id,...o,ref:t})});ph.displayName=uh;var fh="SelectItem",[mh,hh]=Om(fh),vh=e.forwardRef((t,n)=>{const{__scopeSelect:o,value:r,disabled:a=!1,textValue:i,...s}=t,l=Pm(fh,o),c=Qm(fh,o),d=l.value===r,[u,p]=e.useState(i??""),[f,m]=e.useState(!1),h=tl(n,e=>c.itemRefCallback?.(e,r,a)),v=kl(),y=e.useRef("touch"),b=()=>{a||(l.onValueChange(r),l.onOpenChange(!1))};return g(mh,{scope:o,value:r,disabled:a,textId:v,isSelected:d,onItemTextChange:e.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:g(Em.ItemSlot,{scope:o,value:r,disabled:a,textValue:u,children:g(hl.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:h,onFocus:ul(s.onFocus,()=>m(!0)),onBlur:ul(s.onBlur,()=>m(!1)),onClick:ul(s.onClick,()=>{"mouse"!==y.current&&b()}),onPointerUp:ul(s.onPointerUp,()=>{"mouse"===y.current&&b()}),onPointerDown:ul(s.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:ul(s.onPointerMove,e=>{y.current=e.pointerType,a?c.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ul(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:ul(s.onKeyDown,e=>{""!==c.searchRef?.current&&" "===e.key||(_m.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});vh.displayName=fh;var gh="SelectItemText",yh=e.forwardRef((t,n)=>{const{__scopeSelect:o,className:r,style:a,...i}=t,s=Pm(gh,o),l=Qm(gh,o),c=hh(gh,o),d=Im(gh,o),[u,p]=e.useState(null),f=tl(n,e=>p(e),c.onItemTextChange,e=>l.itemTextRefCallback?.(e,c.value,c.disabled)),m=u?.textContent,h=e.useMemo(()=>g("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=d;return pl(()=>(v(h),()=>w(h)),[v,w,h]),y(b,{children:[g(hl.span,{id:c.textId,...i,ref:f}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!Th(s.value)?x.createPortal(i.children,s.valueNode):null]})});yh.displayName=gh;var bh="SelectItemIndicator",xh=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return hh(bh,n).isSelected?g(hl.span,{"aria-hidden":!0,...o,ref:t}):null});xh.displayName=bh;var wh="SelectScrollUpButton",kh=e.forwardRef((t,n)=>{const o=Qm(wh,t.__scopeSelect),r=rh(wh,t.__scopeSelect),[a,i]=e.useState(!1),s=tl(n,r.onScrollButtonChange);return pl(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?g(_h,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});kh.displayName=wh;var Nh="SelectScrollDownButton",Ch=e.forwardRef((t,n)=>{const o=Qm(Nh,t.__scopeSelect),r=rh(Nh,t.__scopeSelect),[a,i]=e.useState(!1),s=tl(n,r.onScrollButtonChange);return pl(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;i(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?g(_h,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Ch.displayName=Nh;var _h=e.forwardRef((t,n)=>{const{__scopeSelect:o,onAutoScroll:r,...a}=t,i=Qm("SelectScrollButton",o),s=e.useRef(null),l=Sm(o),c=e.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return e.useEffect(()=>()=>c(),[c]),pl(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),g(hl.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:ul(a.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(r,50))}),onPointerMove:ul(a.onPointerMove,()=>{i.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(r,50))}),onPointerLeave:ul(a.onPointerLeave,()=>{c()})})}),Dh=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return g(hl.div,{"aria-hidden":!0,...o,ref:t})});Dh.displayName="SelectSeparator";var Eh="SelectArrow";e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Tm(n);return"popper"===Qm(Eh,n).position?g(ym,{...r,...o,ref:t}):null}).displayName=Eh;var Sh="SelectBubbleInput",Mh=e.forwardRef(({__scopeSelect:t,...n},o)=>{const r=Pm(Sh,t),{value:a,onValueChange:i,required:s,disabled:l,name:c,autoComplete:d,form:u}=r,{nativeOptions:p,nativeSelectKey:f}=r,m=e.useRef(null),h=tl(o,m),v=a??"",b=xm(v),x=Array.from(p).some(e=>""===(e.props.value??""));return e.useEffect(()=>{const e=m.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(b!==v&&n){const t=new Event("change",{bubbles:!0});n.call(e,v),e.dispatchEvent(t)}},[b,v]),y(hl.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:c,autoComplete:d,disabled:l,form:u,onChange:e=>i(e.target.value),...n,style:{...wm,...n.style},ref:h,defaultValue:v,children:[Th(a)&&!x?g("option",{value:""}):null,Array.from(p)]},f)});function Oh(e){return"function"==typeof e}function Th(e){return""===e||void 0===e}function Rh(t){const n=_f(t),o=e.useRef(""),r=e.useRef(0),a=e.useCallback(e=>{const t=o.current+e;n(t),function e(t){o.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),i=e.useCallback(()=>{o.current="",window.clearTimeout(r.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(r.current),[]),[o,a,i]}function Ph(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}Mh.displayName=Sh;const Ah=jm,Ih=dh,Fh=Bm,jh=e.forwardRef(({className:e,children:t,...n},o)=>y(Lm,{ref:o,"data-slot":"select-trigger",className:Qe(nt,"justify-between whitespace-nowrap data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1",e),...n,children:[t,g($m,{asChild:!0,children:g(wi,{className:"h-4 w-4 opacity-50"})})]}));jh.displayName=Lm.displayName;const zh=e.forwardRef(({className:e,...t},n)=>g(kh,{ref:n,"data-slot":"select-scroll-up-button",className:Qe("flex cursor-default items-center justify-center py-1",e),...t,children:g(Ci,{className:"h-4 w-4"})}));zh.displayName=kh.displayName;const Lh=e.forwardRef(({className:e,...t},n)=>g(Ch,{ref:n,"data-slot":"select-scroll-down-button",className:Qe("flex cursor-default items-center justify-center py-1",e),...t,children:g(wi,{className:"h-4 w-4"})}));Lh.displayName=Ch.displayName;const Wh=e.forwardRef(({className:e,children:t,position:n="popper",...o},r)=>g(Um,{children:y(Vm,{ref:r,"data-slot":"select-content",className:Qe("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"===n&&"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:n,...o,children:[g(zh,{}),g(ih,{className:Qe("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g(Lh,{})]})}));Wh.displayName=Vm.displayName;const Bh=e.forwardRef(({className:e,...t},n)=>g(ph,{ref:n,"data-slot":"select-label",className:Qe("px-2 py-1.5 text-sm font-semibold",e),...t}));Bh.displayName=ph.displayName;const $h=e.forwardRef(({className:e,children:t,...n},o)=>y(vh,{ref:o,"data-slot":"select-item",className:Qe("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),...n,children:[g("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:g(xh,{children:g(xi,{className:"h-4 w-4"})})}),g(yh,{children:t})]}));$h.displayName=vh.displayName;const Yh=e.forwardRef(({className:e,...t},n)=>g(Dh,{ref:n,"data-slot":"select-separator",className:Qe("-mx-1 my-1 h-px bg-muted",e),...t}));Yh.displayName=Dh.displayName;const qh=({id:e,placeholder:t,options:n,className:o,value:r,onValueChange:a,required:s,name:l})=>{const[c,u]=d(r||"");i(()=>{u(r||"")},[r]);const p=r??c;return y(b,{children:[l?g("input",{type:"hidden",name:l,value:p,required:s}):null,g("div",{className:Qe("flex w-full min-w-0",o),children:y(Ah,{value:p||void 0,onValueChange:e=>{u(e),a?.(e)},children:[g(jh,{"data-testid":e,className:"w-full",children:g(Fh,{placeholder:t})}),g(Wh,{children:n.map(e=>g($h,{"data-testid":e.value,value:e.value,className:Qe("cursor-pointer",rt,c===e.value?"bg-accent text-accent-foreground":""),children:e.label},e.value))})]})})]})},Hh=e=>{if("fk"===e.variant){const{variant:t,...n}=e;return g(Nf,{...n})}return g(qh,{...e})},Uh=6048e5,Kh=Symbol.for("constructDateFrom");function Vh(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&Kh in e?e[Kh](t):e instanceof Date?new e.constructor(t):new Date(t)}function Gh(e,t){return Vh(t||e,e)}function Zh(e,t,n){const o=Gh(e,n?.in);return isNaN(t)?Vh(e,NaN):t?(o.setDate(o.getDate()+t),o):o}function Xh(e,t,n){const o=Gh(e,n?.in);if(isNaN(t))return Vh(e,NaN);if(!t)return o;const r=o.getDate(),a=Vh(e,o.getTime());a.setMonth(o.getMonth()+t+1,0);return r>=a.getDate()?a:(o.setFullYear(a.getFullYear(),a.getMonth(),r),o)}let Qh={};function Jh(){return Qh}function ev(e,t){const n=Jh(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Gh(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 tv(e,t){return ev(e,{...t,weekStartsOn:1})}function nv(e,t){const n=Gh(e,t?.in),o=n.getFullYear(),r=Vh(n,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const a=tv(r),i=Vh(n,0);i.setFullYear(o,0,4),i.setHours(0,0,0,0);const s=tv(i);return n.getTime()>=a.getTime()?o+1:n.getTime()>=s.getTime()?o:o-1}function ov(e){const t=Gh(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 rv(e,...t){const n=Vh.bind(null,t.find(e=>"object"==typeof e));return t.map(n)}function av(e,t){const n=Gh(e,t?.in);return n.setHours(0,0,0,0),n}function iv(e,t,n){const[o,r]=rv(0,e,t),a=av(o),i=av(r),s=+a-ov(a),l=+i-ov(i);return Math.round((s-l)/864e5)}function sv(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function lv(e,t,n){const[o,r]=rv(0,e,t);return 12*(o.getFullYear()-r.getFullYear())+(o.getMonth()-r.getMonth())}function cv(e,t){const[n,o]=rv(0,t.start,t.end);return{start:n,end:o}}function dv(e,t){const n=Gh(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function uv(e,t){const n=Jh(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Gh(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 pv={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 fv(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const mv={date:fv({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:fv({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:fv({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},hv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function vv(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 gv={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:vv({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:vv({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:vv({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:vv({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:vv({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 yv(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 bv={ordinalNumber:(xv={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(xv.matchPattern);if(!n)return null;const o=n[0],r=e.match(xv.parsePattern);if(!r)return null;let a=xv.valueCallback?xv.valueCallback(r[0]):r[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(o.length)}}),era:yv({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:yv({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:yv({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:yv({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:yv({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 xv;const wv={code:"en-US",formatDistance:(e,t,n)=>{let o;const r=pv[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:mv,formatRelative:(e,t,n,o)=>hv[e],localize:gv,match:bv,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kv(e,t){const n=Gh(e,t?.in),o=+tv(n)-+function(e,t){const n=nv(e,t),o=Vh(e,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),tv(o)}(n);return Math.round(o/Uh)+1}function Nv(e,t){const n=Gh(e,t?.in),o=n.getFullYear(),r=Jh(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=Vh(t?.in||e,0);i.setFullYear(o+1,0,a),i.setHours(0,0,0,0);const s=ev(i,t),l=Vh(t?.in||e,0);l.setFullYear(o,0,a),l.setHours(0,0,0,0);const c=ev(l,t);return+n>=+s?o+1:+n>=+c?o:o-1}function Cv(e,t){const n=Gh(e,t?.in),o=+ev(n,t)-+function(e,t){const n=Jh(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Nv(e,t),a=Vh(t?.in||e,0);return a.setFullYear(r,0,o),a.setHours(0,0,0,0),ev(a,t)}(n,t);return Math.round(o/Uh)+1}function _v(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Dv={y(e,t){const n=e.getFullYear(),o=n>0?n:1-n;return _v("yy"===t?o%100:o,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):_v(n+1,2)},d:(e,t)=>_v(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)=>_v(e.getHours()%12||12,t.length),H:(e,t)=>_v(e.getHours(),t.length),m:(e,t)=>_v(e.getMinutes(),t.length),s:(e,t)=>_v(e.getSeconds(),t.length),S(e,t){const n=t.length,o=e.getMilliseconds();return _v(Math.trunc(o*Math.pow(10,n-3)),t.length)}},Ev="midnight",Sv="noon",Mv="morning",Ov="afternoon",Tv="evening",Rv="night",Pv={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 Dv.y(e,t)},Y:function(e,t,n,o){const r=Nv(e,o),a=r>0?r:1-r;if("YY"===t){return _v(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):_v(a,t.length)},R:function(e,t){return _v(nv(e),t.length)},u:function(e,t){return _v(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 _v(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 _v(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 Dv.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 _v(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=Cv(e,o);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):_v(r,t.length)},I:function(e,t,n){const o=kv(e);return"Io"===t?n.ordinalNumber(o,{unit:"week"}):_v(o,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Dv.d(e,t)},D:function(e,t,n){const o=function(e,t){const n=Gh(e,t?.in);return iv(n,dv(n))+1}(e);return"Do"===t?n.ordinalNumber(o,{unit:"dayOfYear"}):_v(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 _v(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 _v(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 _v(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?Sv: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?Tv:o>=12?Ov:o>=4?Mv:Rv,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 Dv.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Dv.H(e,t)},K:function(e,t,n){const o=e.getHours()%12;return"Ko"===t?n.ordinalNumber(o,{unit:"hour"}):_v(o,t.length)},k:function(e,t,n){let o=e.getHours();return 0===o&&(o=24),"ko"===t?n.ordinalNumber(o,{unit:"hour"}):_v(o,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Dv.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Dv.s(e,t)},S:function(e,t){return Dv.S(e,t)},X:function(e,t,n){const o=e.getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Iv(o);case"XXXX":case"XX":return Fv(o);default:return Fv(o,":")}},x:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"x":return Iv(o);case"xxxx":case"xx":return Fv(o);default:return Fv(o,":")}},O:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Av(o,":");default:return"GMT"+Fv(o,":")}},z:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Av(o,":");default:return"GMT"+Fv(o,":")}},t:function(e,t,n){return _v(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return _v(+e,t.length)}};function Av(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+_v(a,2)}function Iv(e,t){if(e%60==0){return(e>0?"-":"+")+_v(Math.abs(e)/60,2)}return Fv(e,t)}function Fv(e,t=""){const n=e>0?"-":"+",o=Math.abs(e);return n+_v(Math.trunc(o/60),2)+t+_v(o%60,2)}const jv=(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"})}},zv=(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"})}},Lv={p:zv,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],o=n[1],r=n[2];if(!r)return jv(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}}",jv(o,t)).replace("{{time}}",zv(r,t))}},Wv=/^D+$/,Bv=/^Y+$/,$v=["D","DD","YY","YYYY"];const Yv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hv=/^'([^]*?)'?$/,Uv=/''/g,Kv=/[a-zA-Z]/;function Vv(e,t,n){const o=Jh(),r=n?.locale??o.locale??wv,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=Gh(e,n?.in);if(!function(e){return!(!sv(e)&&"number"!=typeof e||isNaN(+Gh(e)))}(s))throw new RangeError("Invalid time value");let l=t.match(qv).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,Lv[t])(e,r.formatLong)}return e}).join("").match(Yv).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Gv(e)};if(Pv[t])return{isToken:!0,value:e};if(t.match(Kv))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 Bv.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return Wv.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),$v.includes(e))throw new RangeError(o)}(a,t,String(e));return(0,Pv[a[0]])(s,a,r.localize,c)}).join("")}function Gv(e){const t=e.match(Hv);return t?t[1].replace(Uv,"'"):e}function Zv(e,t,n){const o=Gh(e,n?.in),r=o.getFullYear(),a=o.getDate(),i=Vh(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=function(e,t){const n=Gh(e,t?.in),o=n.getFullYear(),r=n.getMonth(),a=Vh(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 Xv={},Qv={};function Jv(e,t){try{const n=(Xv[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in Qv?Qv[n]:tg(n,n.split(":"))}catch{if(e in Qv)return Qv[e];const t=e?.match(eg);return t?tg(e,t.slice(1)):NaN}}const eg=/([+-]\d\d):?(\d\d)?/;function tg(e,t){const n=+(t[0]||0),o=+(t[1]||0),r=+(t[2]||0)/60;return Qv[e]=60*n+o>0?60*n+o+r:60*n-o-r}class ng extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Jv(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)),ag(this),rg(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new ng(...t,e):new ng(Date.now(),e)}withTimeZone(e){return new ng(+this,e)}getTimezoneOffset(){const e=-Jv(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),rg(this),+this}[Symbol.for("constructDateFrom")](e){return new ng(+new Date(e),this.timeZone)}}const og=/^(get|set)(?!UTC)/;function rg(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(60*-Jv(e.timeZone,e)))}function ag(e){const t=Jv(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*Jv(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=Jv(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=Jv(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(!og.test(e))return;const t=e.replace(og,"$1UTC");ng.prototype[t]&&(e.startsWith("get")?ng.prototype[e]=function(){return this.internal[t]()}:(ng.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()),ag(e),+this},ng.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),rg(this),+this}))});class ig extends ng{static tz(e,...t){return t.length?new ig(...t,e):new ig(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 ig(+this,e)}[Symbol.for("constructDateFrom")](e){return new ig(+new Date(e),this.timeZone)}}function sg(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 lg={...wv,labels:{labelDayButton:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>Vv(e,t,{locale:wv,...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)=>Vv(e,n,{locale:wv,...t}),o(e,"LLLL yyyy")},labelGridcell:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>Vv(e,t,{locale:wv,...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)=>Vv(e,n,{locale:wv,...t}),o(e,"cccc")}}};class cg{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?ig.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 ig(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):Zh(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):Xh(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return Zh(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return Xh(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):iv(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):lv(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):function(e){const{start:t,end:n}=cv(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(Vh(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}=cv(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(Vh(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=sg(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 uv(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):function(e,t){const n=Gh(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):uv(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=Gh(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):Vv(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):kv(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):function(e,t){return Gh(e,t?.in).getMonth()}(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):function(e,t){return Gh(e,t?.in).getFullYear()}(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):Cv(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):function(e,t){return+Gh(e)>+Gh(t)}(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):function(e,t){return+Gh(e)<+Gh(t)}(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):sv(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):function(e,t){const[n,o]=rv(0,e,t);return+av(n)===+av(o)}(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t){const[n,o]=rv(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]=rv(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=Vh.bind(null,e));const t=Gh(e,o);(!n||n<t||isNaN(+t))&&(n=t)}),Vh(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=Vh.bind(null,e));const t=Gh(e,o);(!n||n>t||isNaN(+t))&&(n=t)}),Vh(o,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):Zv(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const o=Gh(e,n?.in);return isNaN(+o)?Vh(e,NaN):(o.setFullYear(t),o)}(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):sg(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):av(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):tv(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):function(e,t){const n=Gh(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):ev(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):dv(e),this.options={locale:lg,...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&&cg.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:n,numerals:o}=this.options,r=t?.code;if(r&&cg.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)}}cg.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 dg=new cg;class ug{constructor(e,t,n=dg){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 pg{constructor(e,t){this.date=e,this.weeks=t}}class fg{constructor(e,t){this.days=t,this.weekNumber=e}}var mg,hg,vg,gg;!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"}(mg||(mg={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}(hg||(hg={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(vg||(vg={})),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"}(gg||(gg={}));const yg=f(void 0);function bg(){const e=m(yg);if(void 0===e)throw new Error("useDayPicker() must be used within a custom component.");return e}var xg=Object.freeze({__proto__:null,Button:function(e){return t.createElement("button",{...e})},CaptionLabel:function(e){return t.createElement("span",{...e})},Chevron:function(e){const{size:n=24,orientation:o="left",className:r}=e;return t.createElement("svg",{className:r,width:n,height:n,viewBox:"0 0 24 24"},"up"===o&&t.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===o&&t.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===o&&t.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===o&&t.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))},Day:function(e){const{day:n,modifiers:o,...r}=e;return t.createElement("td",{...r})},DayButton:function(e){const{day:n,modifiers:o,...r}=e,a=t.useRef(null);return t.useEffect(()=>{o.focused&&a.current?.focus()},[o.focused]),t.createElement("button",{ref:a,...r})},Dropdown:function(e){const{options:n,className:o,components:r,classNames:a,...i}=e,s=[a[mg.Dropdown],o].join(" "),l=n?.find(({value:e})=>e===i.value);return t.createElement("span",{"data-disabled":i.disabled,className:a[mg.DropdownRoot]},t.createElement(r.Select,{className:s,...i},n?.map(({value:e,label:n,disabled:o})=>t.createElement(r.Option,{key:e,value:e,disabled:o},n))),t.createElement("span",{className:a[mg.CaptionLabel],"aria-hidden":!0},l?.label,t.createElement(r.Chevron,{orientation:"down",size:18,className:a[mg.Chevron]})))},DropdownNav:function(e){return t.createElement("div",{...e})},Footer:function(e){return t.createElement("div",{...e})},Month:function(e){const{calendarMonth:n,displayIndex:o,...r}=e;return t.createElement("div",{...r},e.children)},MonthCaption:function(e){const{calendarMonth:n,displayIndex:o,...r}=e;return t.createElement("div",{...r})},MonthGrid:function(e){return t.createElement("table",{...e})},Months:function(e){return t.createElement("div",{...e})},MonthsDropdown:function(e){const{components:n}=bg();return t.createElement(n.Dropdown,{...e})},Nav:function(e){const{onPreviousClick:n,onNextClick:o,previousMonth:r,nextMonth:a,...i}=e,{components:l,classNames:c,labels:{labelPrevious:d,labelNext:u}}=bg(),p=s(e=>{a&&o?.(e)},[a,o]),f=s(e=>{r&&n?.(e)},[r,n]);return t.createElement("nav",{...i},t.createElement(l.PreviousMonthButton,{type:"button",className:c[mg.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":d(r),onClick:f},t.createElement(l.Chevron,{disabled:!r||void 0,className:c[mg.Chevron],orientation:"left"})),t.createElement(l.NextMonthButton,{type:"button",className:c[mg.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":!a||void 0,"aria-label":u(a),onClick:p},t.createElement(l.Chevron,{disabled:!a||void 0,orientation:"right",className:c[mg.Chevron]})))},NextMonthButton:function(e){const{components:n}=bg();return t.createElement(n.Button,{...e})},Option:function(e){return t.createElement("option",{...e})},PreviousMonthButton:function(e){const{components:n}=bg();return t.createElement(n.Button,{...e})},Root:function(e){const{rootRef:n,...o}=e;return t.createElement("div",{...o,ref:n})},Select:function(e){return t.createElement("select",{...e})},Week:function(e){const{week:n,...o}=e;return t.createElement("tr",{...o})},WeekNumber:function(e){const{week:n,...o}=e;return t.createElement("th",{...o})},WeekNumberHeader:function(e){return t.createElement("th",{...e})},Weekday:function(e){return t.createElement("th",{...e})},Weekdays:function(e){return t.createElement("thead",{"aria-hidden":!0},t.createElement("tr",{...e}))},Weeks:function(e){return t.createElement("tbody",{...e})},YearsDropdown:function(e){const{components:n}=bg();return t.createElement(n.Dropdown,{...e})}});function wg(e,t,n=!1,o=dg){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 kg(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function Ng(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function Cg(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function _g(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function Dg(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function Eg(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Sg(e,t,n=dg){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(Ng(t))return wg(t,e,!1,n);if(Dg(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(kg(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 Cg(t)?a(e,t.after)>0:_g(t)?a(t.before,e)>0:"function"==typeof t&&t(e)})}function Mg(e){return{...xg,...e}}function Og(){const e={};for(const t in mg)e[mg[t]]=`rdp-${mg[t]}`;for(const t in hg)e[hg[t]]=`rdp-${hg[t]}`;for(const t in vg)e[vg[t]]=`rdp-${vg[t]}`;for(const t in gg)e[gg[t]]=`rdp-${gg[t]}`;return e}function Tg(e,t,n){return(n??new cg(t)).formatMonthYear(e)}const Rg=Tg;function Pg(e,t=dg){return t.format(e,"yyyy")}const Ag=Pg;var Ig=Object.freeze({__proto__:null,formatCaption:Tg,formatDay:function(e,t,n){return(n??new cg(t)).format(e,"d")},formatMonthCaption:Rg,formatMonthDropdown:function(e,t=dg){return t.format(e,"LLLL")},formatWeekNumber:function(e,t=dg){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)},formatWeekNumberHeader:function(){return""},formatWeekdayName:function(e,t,n){return(n??new cg(t)).format(e,"cccccc")},formatYearCaption:Ag,formatYearDropdown:Pg});function Fg(e,t,n,o){let r=(o??new cg(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const jg=Fg;function zg(e,t,n){return(n??new cg(t)).formatMonthYear(e)}const Lg=zg;function Wg(e,t,n,o){let r=(o??new cg(n)).format(e,"PPPP");return t?.today&&(r=`Today, ${r}`),r}function Bg(e){return"Choose the Month"}function $g(){return""}function Yg(e,t){return"Go to the Next Month"}function qg(e){return"Go to the Previous Month"}function Hg(e,t,n){return(n??new cg(t)).format(e,"cccc")}function Ug(e,t){return`Week ${e}`}function Kg(e){return"Week Number"}function Vg(e){return"Choose the Year"}var Gg=Object.freeze({__proto__:null,labelCaption:Lg,labelDay:jg,labelDayButton:Fg,labelGrid:zg,labelGridcell:Wg,labelMonthDropdown:Bg,labelNav:$g,labelNext:Yg,labelPrevious:qg,labelWeekNumber:Ug,labelWeekNumberHeader:Kg,labelWeekday:Hg,labelYearDropdown:Vg});const Zg=(e,t,n)=>t||(n?"function"==typeof n?n:(...e)=>n:e);function Xg(e,t){const n=t.locale?.labels??{};return{...Gg,...e??{},labelDayButton:Zg(Fg,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:Zg(Bg,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:Zg(Yg,e?.labelNext,n.labelNext),labelPrevious:Zg(qg,e?.labelPrevious,n.labelPrevious),labelWeekNumber:Zg(Ug,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Zg(Vg,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:Zg(zg,e?.labelGrid,n.labelGrid),labelGridcell:Zg(Wg,e?.labelGridcell,n.labelGridcell),labelNav:Zg($g,e?.labelNav,n.labelNav),labelWeekNumberHeader:Zg(Kg,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Zg(Hg,e?.labelWeekday,n.labelWeekday)}}function Qg(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 Jg(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 ey=e=>e instanceof HTMLElement?e:null,ty=e=>[...e.querySelectorAll("[data-animated-month]")??[]],ny=e=>ey(e.querySelector("[data-animated-caption]")),oy=e=>ey(e.querySelector("[data-animated-weeks]"));function ry(e,t,{classNames:n,months:o,focused:a,dateLib:i}){const s=r(null),l=r(o),c=r(!1);h(()=>{const r=l.current;if(l.current=o,!(t&&e.current&&e.current instanceof HTMLElement&&0!==o.length&&0!==r.length&&o.length===r.length))return;const d=i.isSameMonth(o[0].date,r[0].date),u=i.isAfter(o[0].date,r[0].date),p=u?n[gg.caption_after_enter]:n[gg.caption_before_enter],f=u?n[gg.weeks_after_enter]:n[gg.weeks_before_enter],m=s.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement){ty(h).forEach(e=>{if(!(e instanceof HTMLElement))return;const t=ey(e.querySelector("[data-animated-month]"));t&&e.contains(t)&&e.removeChild(t);const n=ny(e);n&&n.classList.remove(p);const o=oy(e);o&&o.classList.remove(f)}),s.current=h}else s.current=null;if(c.current||d||a)return;const v=m instanceof HTMLElement?ty(m):[],g=ty(e.current);if(g?.every(e=>e instanceof HTMLElement)&&v&&v.every(e=>e instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const t=(y=e.current,ey(y.querySelector("[data-animated-nav]")));t&&(t.style.zIndex="1"),g.forEach((o,r)=>{const a=v[r];if(!a)return;o.style.position="relative",o.style.overflow="hidden";const i=ny(o);i&&i.classList.add(p);const s=oy(o);s&&s.classList.add(f);const l=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),t&&(t.style.zIndex=""),i&&i.classList.remove(p),s&&s.classList.remove(f),o.style.position="",o.style.overflow="",o.contains(a)&&o.removeChild(a)};a.style.pointerEvents="none",a.style.position="absolute",a.style.overflow="hidden",a.setAttribute("aria-hidden","true");const d=(e=>ey(e.querySelector("[data-animated-weekdays]")))(a);d&&(d.style.opacity="0");const m=ny(a);m&&(m.classList.add(u?n[gg.caption_before_exit]:n[gg.caption_after_exit]),m.addEventListener("animationend",l));const h=oy(a);h&&h.classList.add(u?n[gg.weeks_before_exit]:n[gg.weeks_after_exit]),o.insertBefore(a,o.firstChild)})}var y})}function ay(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 iy(e,t){const[n,o]=d(e);return[void 0===t?n:t,o]}function sy(e,t){const[n,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]}(e,t),{startOfMonth:a,endOfMonth:s}=t,l=ay(e,n,r,t),[c,d]=iy(l,e.month?l:void 0);i(()=>{const o=ay(e,n,r,t);d(o)},[e.timeZone]);const{months:u,weeks:p,days:f,previousMonth:m,nextMonth:h}=o(()=>{const o=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}(c,r,{numberOfMonths:e.numberOfMonths},t),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:y,startOfWeek:b}=o,x=l?g(r,o):i?y(r):b(r),w=l?p(a):i?f(m(a)):h(m(a)),k=t&&(l?p(t):i?f(t):h(t)),N=d(k&&v(w,k)?k:w,x),C=u(a,r)+1,_=[];for(let e=0;e<=N;e++){const t=c(x,e);_.push(t)}const D=(l?35:42)*C;if(s&&_.length<D){const e=D-_.length;for(let t=0;t<e;t++){const e=c(_[_.length-1],1);_.push(e)}}return _}(o,e.endMonth?s(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),i=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),y=n.broadcastCalendar?35:42;if(n.fixedWeeks&&g.length<y){const e=t.filter(e=>{const t=y-g.length;return e>v&&e<=r(v,t)});g.push(...e)}const b=g.reduce((e,t)=>{const r=n.ISOWeek?c(t):d(t),a=e.find(e=>e.weekNumber===r),i=new ug(t,m,o);return a?a.days.push(i):e.push(new fg(r,[i])),e},[]),x=new pg(m,b);return e.push(x),e},[]);return n.reverseMonths?m.reverse():m}(o,a,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),l=function(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}(i),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())}(i),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)}(c,n,e,t),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)}(c,r,e,t);return{months:i,weeks:l,days:d,previousMonth:u,nextMonth:p}},[t,c.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:v,onMonthChange:g}=e,y=e=>{if(v)return;let t=a(e);n&&t<a(n)&&(t=a(n)),r&&t>a(r)&&(t=a(r)),d(t),g?.(t)};return{months:u,weeks:p,days:f,navStart:n,navEnd:r,previousMonth:m,nextMonth:h,goToMonth:y,goToDay:e=>{(e=>p.some(t=>t.days.some(t=>t.isEqualTo(e))))(e)||y(e.date)}}}var ly;function cy(e){return!e[hg.disabled]&&!e[hg.hidden]&&!e[hg.outside]}function dy(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:y,startOfISOWeek:b,startOfWeek:x}=i;let w={day:c,week:u,month:d,year:p,startOfWeek:e=>l?y(e,i):s?b(e):x(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&&Sg(l,a.disabled,i)),d=Boolean(a.hidden&&Sg(l,a.hidden,i)),u=new ug(l,l,i);return c||d?dy(e,t,u,o,r,a,i,s+1):u}function uy(e,t,n,o,r){const{autoFocus:a}=e,[i,s]=d(),l=function(e,t,n,o){let r,a=-1;for(const i of e){const e=t(i);cy(e)&&(e[hg.focused]&&a<ly.FocusedModifier?(r=i,a=ly.FocusedModifier):o?.isEqualTo(i)&&a<ly.LastFocused?(r=i,a=ly.LastFocused):n(i.date)&&a<ly.Selected?(r=i,a=ly.Selected):e[hg.today]&&a<ly.Today&&(r=i,a=ly.Today))}return r||(r=e.find(e=>cy(t(e)))),r}(t.days,n,o||(()=>!1),i),[c,u]=d(a?l:void 0);return{isFocusTarget:e=>Boolean(l?.isEqualTo(e)),setFocused:u,focused:c,blur:()=>{s(c),u(void 0)},moveFocus:(n,o)=>{if(!c)return;const a=dy(n,o,c,t.navStart,t.navEnd,e,r);if(a){if(e.disableNavigation){if(!t.days.some(e=>e.isEqualTo(a)))return}t.goToDay(a),u(a)}}}}function py(e,t,n=dg){return wg(e,t.from,!1,n)||wg(e,t.to,!1,n)||wg(t,e.from,!1,n)||wg(t,e.to,!1,n)}function fy(e,t,n=dg){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 wg(e,t,!1,n);if(Eg(t,n))return t.some(t=>wg(e,t,!1,n));if(Ng(t))return!(!t.from||!t.to)&&py(e,{from:t.from,to:t.to},n);if(Dg(t))return function(e,t,n=dg){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(kg(t)){return n.isAfter(t.before,t.after)?py(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):Sg(e.from,t,n)||Sg(e.to,t,n)}return!(!Cg(t)&&!_g(t))&&(Sg(e.from,t,n)||Sg(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 my(e,t){const{disabled:n,excludeDisabled:o,selected:r,required:a,onSelect:i}=e,[s,l]=iy(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=dg){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&&fy({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&&wg(c,e,!1,t)}}function hy(e,t){const n=function(e,t){const{selected:n,required:o,onSelect:r}=e,[a,i]=iy(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]=iy(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=my(e,t);switch(e.mode){case"single":return n;case"multiple":return o;case"range":return r;default:return}}function vy(e,t){return e instanceof ig&&e.timeZone===t?e:new ig(e,t)}function gy(e,t,n){return vy(e,t)}function yy(e,t,n){return"boolean"==typeof e||"function"==typeof e?e:e instanceof Date?gy(e,t):Array.isArray(e)?e.map(e=>e instanceof Date?gy(e,t):e):Ng(e)?{...e,from:e.from?vy(e.from,t):e.from,to:e.to?vy(e.to,t):e.to}:kg(e)?{before:gy(e.before,t),after:gy(e.after,t)}:Cg(e)?{after:gy(e.after,t)}:_g(e)?{before:gy(e.before,t)}:e}function by(e,t,n){return e?Array.isArray(e)?e.map(e=>yy(e,t)):yy(e,t):e}function xy(e){let n=e;const a=n.timeZone;if(a&&(n={...e,timeZone:a},n.today&&(n.today=vy(n.today,a)),n.month&&(n.month=vy(n.month,a)),n.defaultMonth&&(n.defaultMonth=vy(n.defaultMonth,a)),n.startMonth&&(n.startMonth=vy(n.startMonth,a)),n.endMonth&&(n.endMonth=vy(n.endMonth,a)),"single"===n.mode&&n.selected?n.selected=vy(n.selected,a):"multiple"===n.mode&&n.selected?n.selected=n.selected?.map(e=>vy(e,a)):"range"===n.mode&&n.selected&&(n.selected={from:n.selected.from?vy(n.selected.from,a):n.selected.from,to:n.selected.to?vy(n.selected.to,a):n.selected.to}),void 0!==n.disabled&&(n.disabled=by(n.disabled,a)),void 0!==n.hidden&&(n.hidden=by(n.hidden,a)),n.modifiers)){const e={};Object.keys(n.modifiers).forEach(t=>{e[t]=by(n.modifiers?.[t],a)}),n.modifiers=e}const{components:i,formatters:l,labels:c,dateLib:d,locale:u,classNames:p}=o(()=>{const e={...lg,...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 ig(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(ig.tz(e)),newDate:(t,n,o)=>new ig(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 ig(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 ig(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 ig(n.getFullYear(),0,1,12,0,0,e);for(;i.getFullYear()<=o.getFullYear();)r.push(new ig(i,e)),i.setFullYear(i.getFullYear()+1,0,1);return r},getWeek:(e,t)=>Cv(i(e),{weekStartsOn:t?.weekStartsOn??r,firstWeekContainsDate:t?.firstWeekContainsDate??o?.options?.firstWeekContainsDate??1}),getISOWeek:e=>kv(i(e)),differenceInCalendarDays:(e,t)=>iv(i(e),i(t)),differenceInCalendarMonths:(e,t)=>lv(i(e),i(t))}}(n.timeZone,{weekStartsOn:t,locale:e}):void 0,r=n.dateLib&&o?{...o,...n.dateLib}:n.dateLib??o,a=new cg({locale:e,weekStartsOn:t,firstWeekContainsDate:n.firstWeekContainsDate,useAdditionalWeekYearTokens:n.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:n.useAdditionalDayOfYearTokens,timeZone:n.timeZone,numerals:n.numerals},r);return{dateLib:a,components:Mg(n.components),formatters:(i=n.formatters,i?.formatMonthCaption&&!i.formatCaption&&(i.formatCaption=i.formatMonthCaption),i?.formatYearCaption&&!i.formatYearDropdown&&(i.formatYearDropdown=i.formatYearCaption),{...Ig,...i}),labels:Xg(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:d.today()});const{captionLayout:f,mode:m,navLayout:h,numberOfMonths:v=1,onDayBlur:g,onDayClick:y,onDayFocus:b,onDayKeyDown:x,onDayMouseEnter:w,onDayMouseLeave:k,onNextClick:N,onPrevClick:C,showWeekNumber:_,styles:D}=n,{formatCaption:E,formatDay:S,formatMonthDropdown:M,formatWeekNumber:O,formatWeekNumberHeader:T,formatWeekdayName:R,formatYearDropdown:P}=l,A=sy(n,d),{days:I,months:F,navStart:j,navEnd:z,previousMonth:L,nextMonth:W,goToMonth:B}=A,$=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),y=o&&h(o),b={[hg.focused]:[],[hg.outside]:[],[hg.disabled]:[],[hg.hidden]:[],[hg.today]:[]},x={};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(y&&v(e,y)),w=Boolean(a&&Sg(e,a,r)),k=Boolean(i&&Sg(e,i,r))||f||h||!c&&!l&&o||c&&!1===l&&o,N=u(e,d);o&&b.outside.push(t),w&&b.disabled.push(t),k&&b.hidden.push(t),N&&b.today.push(t),s&&Object.keys(s).forEach(n=>{const o=s?.[n];o&&Sg(e,o,r)&&(x[n]?x[n].push(t):x[n]=[t])})}return e=>{const t={[hg.focused]:!1,[hg.disabled]:!1,[hg.hidden]:!1,[hg.outside]:!1,[hg.today]:!1},n={};for(const n in b){const o=b[n];t[n]=o.some(t=>t===e)}for(const t in x)n[t]=x[t].some(t=>t===e);return{...t,...n}}}(I,n,j,z,d),{isSelected:Y,select:q,selected:H}=hy(n,d)??{},{blur:U,focused:K,isFocusTarget:V,moveFocus:G,setFocused:Z}=uy(n,A,$,Y??(()=>!1),d),{labelDayButton:X,labelGridcell:Q,labelGrid:J,labelMonthDropdown:ee,labelNav:te,labelPrevious:ne,labelNext:oe,labelWeekday:re,labelWeekNumber:ae,labelWeekNumberHeader:ie,labelYearDropdown:se}=c,le=o(()=>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}(d,n.ISOWeek,n.broadcastCalendar,n.today),[d,n.ISOWeek,n.broadcastCalendar,n.today]),ce=void 0!==m||void 0!==y,de=s(()=>{L&&(B(L),C?.(L))},[L,B,C]),ue=s(()=>{W&&(B(W),N?.(W))},[B,W,N]),pe=s((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),Z(e),t.disabled||(q?.(e.date,t,n),y?.(e.date,t,n))},[q,y,Z]),fe=s((e,t)=>n=>{Z(e),b?.(e.date,t,n)},[b,Z]),me=s((e,t)=>n=>{U(),g?.(e.date,t,n)},[U,g]),he=s((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];G(e,t)}x?.(e.date,t,o)},[G,x,n.dir]),ve=s((e,t)=>n=>{w?.(e.date,t,n)},[w]),ge=s((e,t)=>n=>{k?.(e.date,t,n)},[k]),ye=s(e=>t=>{const n=Number(t.target.value),o=d.setMonth(d.startOfMonth(e),n);B(o)},[d,B]),be=s(e=>t=>{const n=Number(t.target.value),o=d.setYear(d.startOfMonth(e),n);B(o)},[d,B]),{className:xe,style:we}=o(()=>({className:[p[mg.Root],n.className].filter(Boolean).join(" "),style:{...D?.[mg.Root],...n.style}}),[p,n.className,n.style,D]),ke=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),Ne=r(null);ry(Ne,Boolean(n.animate),{classNames:p,months:F,focused:K,dateLib:d});const Ce={dayPickerProps:n,selected:H,select:q,isSelected:Y,months:F,nextMonth:W,previousMonth:L,goToMonth:B,getModifiers:$,components:i,classNames:p,styles:D,labels:c,formatters:l};return t.createElement(yg.Provider,{value:Ce},t.createElement(i.Root,{rootRef:n.animate?Ne:void 0,className:xe,style:we,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"],...ke},t.createElement(i.Months,{className:p[mg.Months],style:D?.[mg.Months]},!n.hideNavigation&&!h&&t.createElement(i.Nav,{"data-animated-nav":n.animate?"true":void 0,className:p[mg.Nav],style:D?.[mg.Nav],"aria-label":te(),onPreviousClick:de,onNextClick:ue,previousMonth:L,nextMonth:W}),F.map((e,o)=>t.createElement(i.Month,{"data-animated-month":n.animate?"true":void 0,className:p[mg.Month],style:D?.[mg.Month],key:o,displayIndex:o,calendarMonth:e},"around"===h&&!n.hideNavigation&&0===o&&t.createElement(i.PreviousMonthButton,{type:"button",className:p[mg.PreviousMonthButton],tabIndex:L?void 0:-1,"aria-disabled":!L||void 0,"aria-label":ne(L),onClick:de,"data-animated-button":n.animate?"true":void 0},t.createElement(i.Chevron,{disabled:!L||void 0,className:p[mg.Chevron],orientation:"rtl"===n.dir?"right":"left"})),t.createElement(i.MonthCaption,{"data-animated-caption":n.animate?"true":void 0,className:p[mg.MonthCaption],style:D?.[mg.MonthCaption],calendarMonth:e,displayIndex:o},f?.startsWith("dropdown")?t.createElement(i.DropdownNav,{className:p[mg.Dropdowns],style:D?.[mg.Dropdowns]},(()=>{const o="dropdown"===f||"dropdown-months"===f?t.createElement(i.MonthsDropdown,{key:"month",className:p[mg.MonthsDropdown],"aria-label":ee(),classNames:p,components:i,disabled:Boolean(n.disableNavigation),onChange:ye(e.date),options:Qg(e.date,j,z,l,d),style:D?.[mg.Dropdown],value:d.getMonth(e.date)}):t.createElement("span",{key:"month"},M(e.date,d)),r="dropdown"===f||"dropdown-years"===f?t.createElement(i.YearsDropdown,{key:"year",className:p[mg.YearsDropdown],"aria-label":se(d.options),classNames:p,components:i,disabled:Boolean(n.disableNavigation),onChange:be(e.date),options:Jg(j,z,l,d,Boolean(n.reverseYears)),style:D?.[mg.Dropdown],value:d.getYear(e.date)}):t.createElement("span",{key:"year"},P(e.date,d));return"year-first"===d.getMonthYearOrder()?[r,o]:[o,r]})(),t.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"}},E(e.date,d.options,d))):t.createElement(i.CaptionLabel,{className:p[mg.CaptionLabel],role:"status","aria-live":"polite"},E(e.date,d.options,d))),"around"===h&&!n.hideNavigation&&o===v-1&&t.createElement(i.NextMonthButton,{type:"button",className:p[mg.NextMonthButton],tabIndex:W?void 0:-1,"aria-disabled":!W||void 0,"aria-label":oe(W),onClick:ue,"data-animated-button":n.animate?"true":void 0},t.createElement(i.Chevron,{disabled:!W||void 0,className:p[mg.Chevron],orientation:"rtl"===n.dir?"left":"right"})),o===v-1&&"after"===h&&!n.hideNavigation&&t.createElement(i.Nav,{"data-animated-nav":n.animate?"true":void 0,className:p[mg.Nav],style:D?.[mg.Nav],"aria-label":te(),onPreviousClick:de,onNextClick:ue,previousMonth:L,nextMonth:W}),t.createElement(i.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===m||"range"===m,"aria-label":J(e.date,d.options,d)||void 0,className:p[mg.MonthGrid],style:D?.[mg.MonthGrid]},!n.hideWeekdays&&t.createElement(i.Weekdays,{"data-animated-weekdays":n.animate?"true":void 0,className:p[mg.Weekdays],style:D?.[mg.Weekdays]},_&&t.createElement(i.WeekNumberHeader,{"aria-label":ie(d.options),className:p[mg.WeekNumberHeader],style:D?.[mg.WeekNumberHeader],scope:"col"},T()),le.map(e=>t.createElement(i.Weekday,{"aria-label":re(e,d.options,d),className:p[mg.Weekday],key:String(e),style:D?.[mg.Weekday],scope:"col"},R(e,d.options,d)))),t.createElement(i.Weeks,{"data-animated-weeks":n.animate?"true":void 0,className:p[mg.Weeks],style:D?.[mg.Weeks]},e.weeks.map(e=>t.createElement(i.Week,{className:p[mg.Week],key:e.weekNumber,style:D?.[mg.Week],week:e},_&&t.createElement(i.WeekNumber,{week:e,style:D?.[mg.WeekNumber],"aria-label":ae(e.weekNumber,{locale:u}),className:p[mg.WeekNumber],scope:"row",role:"rowheader"},O(e.weekNumber,d)),e.days.map(e=>{const{date:o}=e,r=$(e);if(r[hg.focused]=!r.hidden&&Boolean(K?.isEqualTo(e)),r[vg.selected]=Y?.(o)||r.selected,Ng(H)){const{from:e,to:t}=H;r[vg.range_start]=Boolean(e&&t&&d.isSameDay(o,e)),r[vg.range_end]=Boolean(e&&t&&d.isSameDay(o,t)),r[vg.range_middle]=wg(H,o,!0,d)}const a=function(e,t={},n={}){let o={...t?.[mg.Day]};return Object.entries(e).filter(([,e])=>!0===e).forEach(([e])=>{o={...o,...n?.[e]}}),o}(r,D,n.modifiersStyles),s=function(e,t,n={}){return Object.entries(e).filter(([,e])=>!0===e).reduce((e,[o])=>(n[o]?e.push(n[o]):t[hg[o]]?e.push(t[hg[o]]):t[vg[o]]&&e.push(t[vg[o]]),e),[t[mg.Day]])}(r,p,n.modifiersClassNames),l=ce||r.hidden?void 0:Q(o,r,d.options,d);return t.createElement(i.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:r,className:s.join(" "),style:a,role:"gridcell","aria-selected":r.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":r.selected||void 0,"data-disabled":r.disabled||void 0,"data-hidden":r.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":r.focused||void 0,"data-today":r.today||void 0},!r.hidden&&ce?t.createElement(i.DayButton,{className:p[mg.DayButton],style:D?.[mg.DayButton],type:"button",day:e,modifiers:r,disabled:!r.focused&&r.disabled||void 0,"aria-disabled":r.focused&&r.disabled||void 0,tabIndex:V(e)?0:-1,"aria-label":X(o,r,d.options,d),onClick:pe(e,r),onBlur:me(e,r),onFocus:fe(e,r),onKeyDown:he(e,r),onMouseEnter:ve(e,r),onMouseLeave:ge(e,r)},S(o,d.options,d)):!r.hidden&&S(e.date,d.options,d))})))))))),n.footer&&t.createElement(i.Footer,{className:p[mg.Footer],style:D?.[mg.Footer],role:"status","aria-live":"polite"},n.footer)))}function wy({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:o="label",buttonVariant:r="ghost",formatters:a,components:i,...s}){const l=Og();return g(xy,{showOutsideDays:n,className:Qe("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:o,formatters:{formatMonthDropdown:e=>e.toLocaleString("default",{month:"short"}),...a},classNames:{root:Qe("w-fit",l.root),months:Qe("relative flex flex-col gap-4 md:flex-row",l.months),month:Qe("flex w-full flex-col gap-4",l.month),nav:Qe("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",l.nav),button_previous:Qe(Je({variant:r}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",l.button_previous),button_next:Qe(Je({variant:r}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",l.button_next),month_caption:Qe("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",l.month_caption),dropdowns:Qe("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",l.dropdowns),dropdown_root:Qe("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",l.dropdown_root),dropdown:Qe("bg-popover absolute inset-0 opacity-0",l.dropdown),caption_label:Qe("select-none font-medium","label"===o?"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",l.caption_label),table:"w-full border-collapse",weekdays:Qe("flex",l.weekdays),weekday:Qe("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",l.weekday),week:Qe("mt-2 flex w-full",l.week),week_number_header:Qe("w-[--cell-size] select-none",l.week_number_header),week_number:Qe("text-muted-foreground select-none text-[0.8rem]",l.week_number),day:Qe("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",l.day),range_start:Qe("bg-accent rounded-l-md",l.range_start),range_middle:Qe("rounded-none",l.range_middle),range_end:Qe("bg-accent rounded-r-md",l.range_end),today:Qe("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",l.today),outside:Qe("text-muted-foreground aria-selected:text-muted-foreground",l.outside),disabled:Qe("text-muted-foreground opacity-50",l.disabled),hidden:Qe("invisible",l.hidden),...t},components:{Root:({className:e,rootRef:t,...n})=>g("div",{"data-slot":"calendar",ref:t,className:Qe(e),...n}),Chevron:({className:e,orientation:t,...n})=>g("left"===t?ki:"right"===t?Ni:wi,{className:Qe("size-4",e),...n}),DayButton:ky,WeekNumber:({children:e,...t})=>g("td",{...t,children:g("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:e})}),...i},...s})}function ky({className:t,day:n,modifiers:o,...r}){const a=Og(),i=e.useRef(null);return e.useEffect(()=>{o.focused&&i.current?.focus()},[o.focused]),g(tt,{ref:i,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:Qe("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",a.day,t),...r})}!function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"}(ly||(ly={}));const Ny=e=>{if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t},Cy=({id:e,placeholder:t,value:n,onValueChange:o,className:r,boundary:a="start",dateFormat:i="dd/MM/yyyy"})=>{const s=Ny(n),l=((e,t)=>{const n=Ny(e);return n?Vv(n,t):null})(n,i);return g("div",{className:Qe("flex w-full min-w-0",r),children:y(yf,{children:[g(bf,{asChild:!0,children:y("button",{type:"button","data-testid":e,className:Qe(nt,"justify-start text-left",!l&&ot),children:[g(bi,{className:Qe("mr-2","size-4 shrink-0 text-muted-foreground opacity-50")}),l??t]})}),g(xf,{className:"w-fit p-0",align:"start",children:g(wy,{mode:"single",selected:s,onSelect:e=>{if(!e)return void o?.("");const t="end"===a?function(e,t){const n=Gh(e,t?.in);return n.setHours(23,59,59,999),n}(e):av(e);o?.(t.toISOString())},initialFocus:!0})})]})})};function _y({title:e="Nenhum resultado",description:t="Nenhum dado encontrado."}){return g(Mc,{title:e,description:t})}const Dy=e.forwardRef(({className:e,...t},n)=>g("div",{className:"w-full overflow-auto",children:g("table",{ref:n,className:Qe("w-full caption-bottom text-sm",e),...t})}));Dy.displayName="Table";const Ey=e.forwardRef(({className:e,...t},n)=>g("thead",{ref:n,className:Qe("rounded-md bg-[#0E2B63] h-[36px]",e),...t}));Ey.displayName="TableHeader";const Sy=e.forwardRef(({className:e,...t},n)=>g("tbody",{ref:n,className:Qe("[&_tr:last-child]:border-0",e),...t}));Sy.displayName="TableBody";const My=e.forwardRef(({className:e,...t},n)=>g("tfoot",{ref:n,className:Qe("bg-primary font-medium text-primary-foreground",e),...t}));My.displayName="TableFooter";const Oy=e.forwardRef(({className:e,...t},n)=>g("tr",{ref:n,className:Qe("text-sm text-fontcolor-secondary transition-colors data-[state=selected]:bg-muted",e),...t}));Oy.displayName="TableRow";const Ty=e.forwardRef(({className:e,...t},n)=>g("th",{ref:n,className:Qe("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),...t}));Ty.displayName="TableHead";const Ry=e.forwardRef(({className:e,...t},n)=>g("td",{ref:n,className:Qe("px-4 py-2 align-middle text-[12px] text-[#333333] [&:has([role=checkbox])]:pr-0",e),...t}));Ry.displayName="TableCell";const Py=e.forwardRef(({className:e,...t},n)=>g("caption",{ref:n,className:Qe("mt-4 text-sm text-muted-foreground",e),...t}));function Ay({className:e,...t}){return g("div",{className:Qe("animate-pulse rounded-md bg-muted",e),...t})}function Iy({columns:e,rows:t=5}){const n=function(e){return"number"==typeof e?Array.from({length:e},()=>({})):e}(e),o=Array.from({length:t},(e,t)=>"row-".concat(String(t)));return g(b,{children:o.map(e=>g(Oy,{children:n.map((t,n)=>g(Ry,{className:Qe(t.width,t.cellClassName,"px-2 py-2"),children:g(Ay,{className:"block h-4 w-full"})},e.concat("-col-",String(n))))},e))})}Py.displayName="TableCaption";const Fy={Root:Dy,Body:Sy,Cell:Ry,Head:Ty,Header:Ey,Row:Oy};function jy({data:e,columns:t,getRowKey:n,ordering:o,onSort:r,onRowClick:a,isLoading:i,hasMore:s,onLoadMore:l,className:c}){const d=Boolean(i&&0===e.length);return g("div",{className:Qe("flex-1 overflow-auto mt-4",c),children:i||0!==e.length?y(Dy,{className:"table-auto w-full",children:[g(Ey,{className:"sticky top-0 bg-primary text-white z-10",children:g(zy,{columns:t,ordering:o,onSort:r})}),y(Sy,{children:[d?g(Iy,{columns:t.map(e=>({width:e.width,cellClassName:e.cellClassName}))}):e.map(e=>g(Ly,{item:e,columns:t,onClick:a?()=>a(e):void 0},n(e))),s&&l&&!d&&g(Oy,{children:g(Ry,{colSpan:t.length,className:"text-center py-6",children:g(tt,{onClick:l,disabled:i,variant:"outline",children:i?"Carregando...":"Carregar Mais"})})})]})]}):g("div",{className:"py-20",children:g(_y,{})})})}function zy({columns:e,ordering:t,onSort:n}){return g(Oy,{children:e.map(e=>{const o=Boolean(e.sortable),r=t===e.key,a=t==="-".concat(e.key),i=r||a;return g(Ty,{className:Qe(e.width,e.className,o?"cursor-pointer":""),onClick:o&&n?()=>n(e.key):void 0,children:y(dt,{direction:"row",gap:1,children:[e.label,o&&i&&g(r?gi:vi,{size:16})]})},e.key)})})}function Ly({item:e,columns:t,onClick:n}){return g(Oy,{className:Qe(n?"hover:bg-secondary cursor-pointer":""),onClick:n,children:t.map(t=>{const n=e[t.key];return g(Ry,{className:Qe(t.width,t.cellClassName),children:t.render?t.render(n,e):String(n??"N/D")},t.key)})})}var Wy="Checkbox",[By]=Xs(Wy),[$y,Yy]=By(Wy);function qy(t){const{__scopeCheckbox:n,checked:o,children:r,defaultChecked:a,disabled:i,form:s,name:l,onCheckedChange:c,required:d,value:u="on",internal_do_not_use_render:p}=t,[f,m]=ml({prop:o,defaultProp:a??!1,onChange:c,caller:Wy}),[h,v]=e.useState(null),[y,b]=e.useState(null),x=e.useRef(!1),w=!h||(!!s||!!h.closest("form")),k={checked:f,disabled:i,setChecked:m,control:h,setControl:v,name:l,form:s,value:u,hasConsumerStoppedPropagationRef:x,required:d,defaultChecked:!Jy(a)&&a,isFormControl:w,bubbleInput:y,setBubbleInput:b};return g($y,{scope:n,...k,children:Qy(p)?p(k):r})}var Hy="CheckboxTrigger",Uy=e.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:o,...r},a)=>{const{control:i,value:s,disabled:l,checked:c,required:d,setControl:u,setChecked:p,hasConsumerStoppedPropagationRef:f,isFormControl:m,bubbleInput:h}=Yy(Hy,t),v=tl(a,u),y=e.useRef(c);return e.useEffect(()=>{const e=i?.form;if(e){const t=()=>p(y.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,p]),g(hl.button,{type:"button",role:"checkbox","aria-checked":Jy(c)?"mixed":c,"aria-required":d,"data-state":eb(c),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:v,onKeyDown:ul(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:ul(o,e=>{p(e=>!!Jy(e)||!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});Uy.displayName=Hy;var Ky=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:a,required:i,disabled:s,value:l,onCheckedChange:c,form:d,...u}=e;return g(qy,{__scopeCheckbox:n,checked:r,defaultChecked:a,disabled:s,required:i,onCheckedChange:c,name:o,form:d,value:l,internal_do_not_use_render:({isFormControl:e})=>y(b,{children:[g(Uy,{...u,ref:t,__scopeCheckbox:n}),e&&g(Xy,{__scopeCheckbox:n})]})})});Ky.displayName=Wy;var Vy="CheckboxIndicator",Gy=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,a=Yy(Vy,n);return g(gl,{present:o||Jy(a.checked)||!0===a.checked,children:g(hl.span,{"data-state":eb(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});Gy.displayName=Vy;var Zy="CheckboxBubbleInput",Xy=e.forwardRef(({__scopeCheckbox:t,...n},o)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:s,required:l,disabled:c,name:d,value:u,form:p,bubbleInput:f,setBubbleInput:m}=Yy(Zy,t),h=tl(o,m),v=xm(i),y=Zf(r);e.useEffect(()=>{const e=f;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,o=!a.current;if(v!==i&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Jy(i),n.call(e,!Jy(i)&&i),e.dispatchEvent(t)}},[f,v,i,a]);const b=e.useRef(!Jy(i)&&i);return g(hl.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??b.current,required:l,disabled:c,name:d,value:u,form:p,...n,tabIndex:-1,ref:h,style:{...n.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function Qy(e){return"function"==typeof e}function Jy(e){return"indeterminate"===e}function eb(e){return Jy(e)?"indeterminate":e?"checked":"unchecked"}Xy.displayName=Zy;const tb=e.forwardRef(({className:e,...t},n)=>g(Ky,{ref:n,className:Qe("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),...t,children:g(Gy,{className:Qe("flex items-center justify-center text-current"),children:g(xi,{className:"h-4 w-4"})})}));tb.displayName=Ky.displayName;var nb=e.forwardRef((e,t)=>g(hl.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));nb.displayName="Label";var ob=nb;const rb=j("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ab=e.forwardRef(({className:e,...t},n)=>g(ob,{ref:n,className:Qe(rb(),e),...t}));ab.displayName=ob.displayName;var[ib]=Xs("Tooltip",[Jf]),sb=Jf(),lb="TooltipProvider",cb=700,db="tooltip.open",[ub,pb]=ib(lb),fb=t=>{const{__scopeTooltip:n,delayDuration:o=cb,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=t,s=e.useRef(!0),l=e.useRef(!1),c=e.useRef(0);return e.useEffect(()=>{const e=c.current;return()=>window.clearTimeout(e)},[]),g(ub,{scope:n,isOpenDelayedRef:s,delayDuration:o,onOpen:e.useCallback(()=>{r<=0||(window.clearTimeout(c.current),s.current=!1)},[r]),onClose:e.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:e.useCallback(e=>{l.current=e},[]),disableHoverableContent:a,children:i})};fb.displayName=lb;var mb="Tooltip",[hb,vb]=ib(mb),gb=t=>{const{__scopeTooltip:n,children:o,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:s,delayDuration:l}=t,c=pb(mb,t.__scopeTooltip),d=sb(n),[u,p]=e.useState(null),f=kl(),m=e.useRef(0),h=s??c.disableHoverableContent,v=l??c.delayDuration,y=e.useRef(!1),[b,x]=ml({prop:r,defaultProp:a??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(db))):c.onClose(),i?.(e)},caller:mb}),w=e.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),k=e.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)},[x]),N=e.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),C=e.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,x(!0),m.current=0},v)},[v,x]);return e.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),g(hm,{...d,children:g(hb,{scope:n,contentId:f,open:b,stateAttribute:w,trigger:u,onTriggerChange:p,onTriggerEnter:e.useCallback(()=>{c.isOpenDelayedRef.current?C():k()},[c.isOpenDelayedRef,C,k]),onTriggerLeave:e.useCallback(()=>{h?N():(window.clearTimeout(m.current),m.current=0)},[N,h]),onOpen:k,onClose:N,disableHoverableContent:h,children:o})})};gb.displayName=mb;var yb="TooltipTrigger",bb=e.forwardRef((t,n)=>{const{__scopeTooltip:o,...r}=t,a=vb(yb,o),i=pb(yb,o),s=sb(o),l=tl(n,e.useRef(null),a.onTriggerChange),c=e.useRef(!1),d=e.useRef(!1),u=e.useCallback(()=>c.current=!1,[]);return e.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),g(vm,{asChild:!0,...s,children:g(hl.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:l,onPointerMove:ul(t.onPointerMove,e=>{"touch"!==e.pointerType&&(d.current||i.isPointerInTransitRef.current||(a.onTriggerEnter(),d.current=!0))}),onPointerLeave:ul(t.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:ul(t.onPointerDown,()=>{a.open&&a.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:ul(t.onFocus,()=>{c.current||a.onOpen()}),onBlur:ul(t.onBlur,a.onClose),onClick:ul(t.onClick,a.onClose)})})});bb.displayName=yb;var[xb,wb]=ib("TooltipPortal",{forceMount:void 0}),kb="TooltipContent",Nb=e.forwardRef((e,t)=>{const n=wb(kb,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...a}=e,i=vb(kb,e.__scopeTooltip);return g(gl,{present:o||i.open,children:i.disableHoverableContent?g(Sb,{side:r,...a,ref:t}):g(Cb,{side:r,...a,ref:t})})}),Cb=e.forwardRef((t,n)=>{const o=vb(kb,t.__scopeTooltip),r=pb(kb,t.__scopeTooltip),a=e.useRef(null),i=tl(n,a),[s,l]=e.useState(null),{trigger:c,onClose:d}=o,u=a.current,{onPointerInTransitChange:p}=r,f=e.useCallback(()=>{l(null),p(!1)},[p]),m=e.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())]);l(a),p(!0)},[p]);return e.useEffect(()=>()=>f(),[f]),e.useEffect(()=>{if(c&&u){const e=e=>m(e,u),t=e=>m(e,c);return c.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}},[c,u,m,f]),e.useEffect(()=>{if(s){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=c?.contains(t)||u?.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,s);o?f():r&&(f(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,u,s,d,f]),g(Sb,{...t,ref:i})}),[_b,Db]=ib(mb,{isInside:!1}),Eb=function(e){const t=e=>"child"in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=ol,t}("TooltipContent"),Sb=e.forwardRef((t,n)=>{const{__scopeTooltip:o,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=t,c=vb(kb,o),d=sb(o),{onClose:u}=c;return e.useEffect(()=>(document.addEventListener(db,u),()=>document.removeEventListener(db,u)),[u]),e.useEffect(()=>{if(c.trigger){const e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,u]),g(Tf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:y(gm,{"data-state":c.stateAttribute,...d,...l,ref:n,style:{...l.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:[g(Eb,{children:r}),g(_b,{scope:o,isInside:!0,children:g(Nm,{id:c.contentId,role:"tooltip",children:a||r})})]})})});Nb.displayName=kb;var Mb="TooltipArrow";e.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=sb(n);return Db(Mb,n).isInside?null:g(ym,{...r,...o,ref:t})}).displayName=Mb;var Ob=Nb;const Tb=fb,Rb=gb,Pb=bb,Ab=e.forwardRef(({className:e,sideOffset:t=4,...n},o)=>g(Ob,{ref:o,sideOffset:t,className:Qe("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),...n}));Ab.displayName=Ob.displayName;const Ib=j("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"}}),Fb=e.forwardRef(({className:e,variant:t,...n},o)=>g("div",{ref:o,role:"alert",className:Qe(Ib({variant:t}),e),...n}));Fb.displayName="Alert";const jb=e.forwardRef(({className:e,...t},n)=>g("h5",{ref:n,className:Qe("mb-1 font-medium leading-none tracking-tight",e),...t}));jb.displayName="AlertTitle";const zb=e.forwardRef(({className:e,...t},n)=>g("div",{ref:n,className:Qe("text-sm [&_p]:leading-relaxed",e),...t}));function Lb({...e}){return g("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Wb({className:e,...t}){return g("ol",{"data-slot":"breadcrumb-list",className:Qe("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function Bb({className:e,...t}){return g("li",{"data-slot":"breadcrumb-item",className:Qe("inline-flex items-center gap-1.5",e),...t})}function $b({asChild:e,className:t,...n}){return g(e?M:"a",{"data-slot":"breadcrumb-link",className:Qe("hover:text-foreground transition-colors",t),...n})}function Yb({className:e,...t}){return g("span",{"data-slot":"breadcrumb-page","aria-disabled":"true","aria-current":"page",className:Qe("text-foreground font-normal",e),...t})}function qb({children:e,className:t,...n}){return g("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Qe("[&>svg]:size-3.5",t),...n,children:e??g(Ni,{})})}function Hb({className:e,...t}){return y("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:Qe("flex size-9 items-center justify-center",e),...t,children:[g(Oi,{className:"size-4"}),g("span",{className:"sr-only",children:"More"})]})}zb.displayName="AlertDescription";var Ub="rovingFocusGroup.onEntryFocus",Kb={bubbles:!1,cancelable:!0},Vb="RovingFocusGroup",[Gb,Zb,Xb]=dl(Vb),[Qb,Jb]=Xs(Vb,[Xb]),[ex,tx]=Qb(Vb),nx=e.forwardRef((e,t)=>g(Gb.Provider,{scope:e.__scopeRovingFocusGroup,children:g(Gb.Slot,{scope:e.__scopeRovingFocusGroup,children:g(ox,{...e,ref:t})})}));nx.displayName=Vb;var ox=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,orientation:r,loop:a=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=t,f=e.useRef(null),m=tl(n,f),h=Ll(i),[v,y]=ml({prop:s,defaultProp:l??null,onChange:c,caller:Vb}),[b,x]=e.useState(!1),w=_f(d),k=Zb(o),N=e.useRef(!1),[C,_]=e.useState(0);return e.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(Ub,w),()=>e.removeEventListener(Ub,w)},[w]),g(ex,{scope:o,orientation:r,dir:h,loop:a,currentTabStopId:v,onItemFocus:e.useCallback(e=>y(e),[y]),onItemShiftTab:e.useCallback(()=>x(!0),[]),onFocusableItemAdd:e.useCallback(()=>_(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>_(e=>e-1),[]),children:g(hl.div,{tabIndex:b||0===C?-1:0,"data-orientation":r,...p,ref:m,style:{outline:"none",...t.style},onMouseDown:ul(t.onMouseDown,()=>{N.current=!0}),onFocus:ul(t.onFocus,e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(Ub,Kb);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);sx([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),u)}}N.current=!1}),onBlur:ul(t.onBlur,()=>x(!1))})})}),rx="RovingFocusGroupItem",ax=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,focusable:r=!0,active:a=!1,tabStopId:i,children:s,...l}=t,c=kl(),d=i||c,u=tx(rx,o),p=u.currentTabStopId===d,f=Zb(o),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:v}=u;return e.useEffect(()=>{if(r)return m(),()=>h()},[r,m,h]),g(Gb.ItemSlot,{scope:o,id:d,focusable:r,active:a,children:g(hl.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:n,onMouseDown:ul(t.onMouseDown,e=>{r?u.onItemFocus(d):e.preventDefault()}),onFocus:ul(t.onFocus,()=>u.onItemFocus(d)),onKeyDown:ul(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void u.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:ix[o]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=f().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=u.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>sx(r))}var n,o}),children:"function"==typeof s?s({isCurrentTabStop:p,hasTabStop:null!=v}):s})})});ax.displayName=rx;var ix={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sx(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 lx=nx,cx=ax,dx=["Enter"," "],ux=["ArrowUp","PageDown","End"],px=["ArrowDown","PageUp","Home",...ux],fx={ltr:[...dx,"ArrowRight"],rtl:[...dx,"ArrowLeft"]},mx={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hx="Menu",[vx,gx,yx]=dl(hx),[bx,xx]=Xs(hx,[yx,Jf,Jb]),wx=Jf(),kx=Jb(),[Nx,Cx]=bx(hx),[_x,Dx]=bx(hx),Ex=t=>{const{__scopeMenu:n,open:o=!1,children:r,dir:a,onOpenChange:i,modal:s=!0}=t,l=wx(n),[c,d]=e.useState(null),u=e.useRef(!1),p=_f(i),f=Ll(a);return e.useEffect(()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.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})}},[]),e.useEffect(()=>{if(!o)return;const e=()=>p(!1);return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[o,p]),g(hm,{...l,children:g(Nx,{scope:n,open:o,onOpenChange:p,content:c,onContentChange:d,children:g(_x,{scope:n,onClose:e.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:u,dir:f,modal:s,children:r})})})};Ex.displayName=hx;var Sx=e.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=wx(n);return g(vm,{...r,...o,ref:t})});Sx.displayName="MenuAnchor";var Mx="MenuPortal",[Ox,Tx]=bx(Mx,{forceMount:void 0}),Rx=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,a=Cx(Mx,t);return g(Ox,{scope:t,forceMount:n,children:g(gl,{present:n||a.open,children:g(bm,{asChild:!0,container:r,children:o})})})};Rx.displayName=Mx;var Px="MenuContent",[Ax,Ix]=bx(Px),Fx=e.forwardRef((e,t)=>{const n=Tx(Px,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,a=Cx(Px,e.__scopeMenu),i=Dx(Px,e.__scopeMenu);return g(vx.Provider,{scope:e.__scopeMenu,children:g(gl,{present:o||a.open,children:g(vx.Slot,{scope:e.__scopeMenu,children:i.modal?g(jx,{...r,ref:t}):g(zx,{...r,ref:t})})})})}),jx=e.forwardRef((t,n)=>{const o=Cx(Px,t.__scopeMenu),r=e.useRef(null),a=tl(n,r);return e.useEffect(()=>{const e=r.current;if(e)return Nr(e)},[]),g(Wx,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:ul(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),zx=e.forwardRef((e,t)=>{const n=Cx(Px,e.__scopeMenu);return g(Wx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Lx=nl("MenuContent.ScrollLock"),Wx=e.forwardRef((t,n)=>{const{__scopeMenu:o,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,onDismiss:m,disableOutsideScroll:h,...v}=t,y=Cx(Px,o),b=Dx(Px,o),x=wx(o),w=kx(o),k=gx(o),[N,C]=e.useState(null),_=e.useRef(null),D=tl(n,_,y.onContentChange),E=e.useRef(0),S=e.useRef(""),M=e.useRef(0),O=e.useRef(null),T=e.useRef("right"),R=e.useRef(0),P=h?vr:e.Fragment,A=h?{as:Lx,allowPinchZoom:!0}:void 0,I=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(E.current),""!==t&&(E.current=window.setTimeout(()=>e(""),1e3))}(t),i&&setTimeout(()=>i.focus())};e.useEffect(()=>()=>window.clearTimeout(E.current),[]),Ff();const F=e.useCallback(e=>T.current===O.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,O.current?.area),[]);return g(Ax,{scope:o,searchRef:S,onItemEnter:e.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:e.useCallback(e=>{F(e)||(_.current?.focus(),C(null))},[F]),onTriggerLeave:e.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:M,onPointerGraceIntentChange:e.useCallback(e=>{O.current=e},[]),children:g(P,{...A,children:g(Bf,{asChild:!0,trapped:a,onMountAutoFocus:ul(i,e=>{e.preventDefault(),_.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:g(Tf,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,onDismiss:m,children:g(lx,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:C,onEntryFocus:ul(c,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:g(gm,{role:"menu","aria-orientation":"vertical","data-state":mw(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:D,style:{outline:"none",...v.style},onKeyDown:ul(v.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&&I(e.key));const r=_.current;if(e.target!==r)return;if(!px.includes(e.key))return;e.preventDefault();const a=k().filter(e=>!e.disabled).map(e=>e.ref.current);ux.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:ul(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),S.current="")}),onPointerMove:ul(t.onPointerMove,gw(e=>{const t=e.target,n=R.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>R.current?"right":"left";T.current=t,R.current=e.clientX}}))})})})})})})});Fx.displayName=Px;var Bx=e.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return g(hl.div,{role:"group",...o,ref:t})});Bx.displayName="MenuGroup";var $x=e.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return g(hl.div,{...o,ref:t})});$x.displayName="MenuLabel";var Yx="MenuItem",qx="menu.itemSelect",Hx=e.forwardRef((t,n)=>{const{disabled:o=!1,onSelect:r,...a}=t,i=e.useRef(null),s=Dx(Yx,t.__scopeMenu),l=Ix(Yx,t.__scopeMenu),c=tl(n,i),d=e.useRef(!1);return g(Ux,{...a,ref:c,disabled:o,onClick:ul(t.onClick,()=>{const e=i.current;if(!o&&e){const t=new CustomEvent(qx,{bubbles:!0,cancelable:!0});e.addEventListener(qx,e=>r?.(e),{once:!0}),vl(e,t),t.defaultPrevented?d.current=!1:s.onClose()}}),onPointerDown:e=>{t.onPointerDown?.(e),d.current=!0},onPointerUp:ul(t.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:ul(t.onKeyDown,e=>{const t=""!==l.searchRef.current;o||t&&" "===e.key||dx.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Hx.displayName=Yx;var Ux=e.forwardRef((t,n)=>{const{__scopeMenu:o,disabled:r=!1,textValue:a,...i}=t,s=Ix(Yx,o),l=kx(o),c=e.useRef(null),d=tl(n,c),[u,p]=e.useState(!1),[f,m]=e.useState("");return e.useEffect(()=>{const e=c.current;e&&m((e.textContent??"").trim())},[i.children]),g(vx.ItemSlot,{scope:o,disabled:r,textValue:a??f,children:g(cx,{asChild:!0,...l,focusable:!r,children:g(hl.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:ul(t.onPointerMove,gw(e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:ul(t.onPointerLeave,gw(e=>s.onItemLeave(e))),onFocus:ul(t.onFocus,()=>p(!0)),onBlur:ul(t.onBlur,()=>p(!1))})})})}),Kx=e.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return g(tw,{scope:e.__scopeMenu,checked:n,children:g(Hx,{role:"menuitemcheckbox","aria-checked":hw(n)?"mixed":n,...r,ref:t,"data-state":vw(n),onSelect:ul(r.onSelect,()=>o?.(!!hw(n)||!n),{checkForDefaultPrevented:!1})})})});Kx.displayName="MenuCheckboxItem";var Vx="MenuRadioGroup",[Gx,Zx]=bx(Vx,{value:void 0,onValueChange:()=>{}}),Xx=e.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,a=_f(o);return g(Gx,{scope:e.__scopeMenu,value:n,onValueChange:a,children:g(Bx,{...r,ref:t})})});Xx.displayName=Vx;var Qx="MenuRadioItem",Jx=e.forwardRef((e,t)=>{const{value:n,...o}=e,r=Zx(Qx,e.__scopeMenu),a=n===r.value;return g(tw,{scope:e.__scopeMenu,checked:a,children:g(Hx,{role:"menuitemradio","aria-checked":a,...o,ref:t,"data-state":vw(a),onSelect:ul(o.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Jx.displayName=Qx;var ew="MenuItemIndicator",[tw,nw]=bx(ew,{checked:!1}),ow=e.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,a=nw(ew,n);return g(gl,{present:o||hw(a.checked)||!0===a.checked,children:g(hl.span,{...r,ref:t,"data-state":vw(a.checked)})})});ow.displayName=ew;var rw=e.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return g(hl.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});rw.displayName="MenuSeparator";var aw=e.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=wx(n);return g(ym,{...r,...o,ref:t})});aw.displayName="MenuArrow";var iw="MenuSub",[sw,lw]=bx(iw),cw=t=>{const{__scopeMenu:n,children:o,open:r=!1,onOpenChange:a}=t,i=Cx(iw,n),s=wx(n),[l,c]=e.useState(null),[d,u]=e.useState(null),p=_f(a);return e.useEffect(()=>(!1===i.open&&p(!1),()=>p(!1)),[i.open,p]),g(hm,{...s,children:g(Nx,{scope:n,open:r,onOpenChange:p,content:d,onContentChange:u,children:g(sw,{scope:n,contentId:kl(),triggerId:kl(),trigger:l,onTriggerChange:c,children:o})})})};cw.displayName=iw;var dw="MenuSubTrigger",uw=e.forwardRef((t,n)=>{const o=Cx(dw,t.__scopeMenu),r=Dx(dw,t.__scopeMenu),a=lw(dw,t.__scopeMenu),i=Ix(dw,t.__scopeMenu),s=e.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:t.__scopeMenu},u=e.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return e.useEffect(()=>u,[u]),e.useEffect(()=>{const e=l.current;return()=>{window.clearTimeout(e),c(null)}},[l,c]),g(Sx,{asChild:!0,...d,children:g(Ux,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?a.contentId:void 0,"data-state":mw(o.open),...t,ref:el(n,a.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:ul(t.onPointerMove,gw(e=>{i.onItemEnter(e),e.defaultPrevented||t.disabled||o.open||s.current||(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{o.onOpenChange(!0),u()},100))})),onPointerLeave:ul(t.onPointerLeave,gw(e=>{u();const t=o.content?.getBoundingClientRect();if(t){const n=o.content?.dataset.side,r="right"===n,a=r?-5:5,s=t[r?"left":"right"],c=t[r?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:s,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ul(t.onKeyDown,e=>{const n=""!==i.searchRef.current;t.disabled||n&&" "===e.key||fx[r.dir].includes(e.key)&&(o.onOpenChange(!0),o.content?.focus(),e.preventDefault())})})})});uw.displayName=dw;var pw="MenuSubContent",fw=e.forwardRef((t,n)=>{const o=Tx(Px,t.__scopeMenu),{forceMount:r=o.forceMount,align:a="start",...i}=t,s=Cx(Px,t.__scopeMenu),l=Dx(Px,t.__scopeMenu),c=lw(pw,t.__scopeMenu),d=e.useRef(null),u=tl(n,d);return g(vx.Provider,{scope:t.__scopeMenu,children:g(gl,{present:r||s.open,children:g(vx.Slot,{scope:t.__scopeMenu,children:g(Wx,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:u,align:a,side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:ul(t.onFocusOutside,e=>{e.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ul(t.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:ul(t.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=mx[l.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});function mw(e){return e?"open":"closed"}function hw(e){return"indeterminate"===e}function vw(e){return hw(e)?"indeterminate":e?"checked":"unchecked"}function gw(e){return t=>"mouse"===t.pointerType?e(t):void 0}fw.displayName=pw;var yw=Ex,bw=Sx,xw=Rx,ww=Fx,kw=Bx,Nw=$x,Cw=Hx,_w=Kx,Dw=Xx,Ew=Jx,Sw=ow,Mw=rw,Ow=aw,Tw=cw,Rw=uw,Pw=fw,Aw="DropdownMenu",[Iw]=Xs(Aw,[xx]),Fw=xx(),[jw,zw]=Iw(Aw),Lw=t=>{const{__scopeDropdownMenu:n,children:o,dir:r,open:a,defaultOpen:i,onOpenChange:s,modal:l=!0}=t,c=Fw(n),d=e.useRef(null),[u,p]=ml({prop:a,defaultProp:i??!1,onChange:s,caller:Aw});return g(jw,{scope:n,triggerId:kl(),triggerRef:d,contentId:kl(),open:u,onOpenChange:p,onOpenToggle:e.useCallback(()=>p(e=>!e),[p]),modal:l,children:g(yw,{...c,open:u,onOpenChange:p,dir:r,modal:l,children:o})})};Lw.displayName=Aw;var Ww="DropdownMenuTrigger",Bw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,a=zw(Ww,n),i=Fw(n);return g(bw,{asChild:!0,...i,children:g(hl.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:el(t,a.triggerRef),onPointerDown:ul(e.onPointerDown,e=>{o||0!==e.button||!1!==e.ctrlKey||(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:ul(e.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});Bw.displayName=Ww;var $w=e=>{const{__scopeDropdownMenu:t,...n}=e,o=Fw(t);return g(xw,{...o,...n})};$w.displayName="DropdownMenuPortal";var Yw="DropdownMenuContent",qw=e.forwardRef((t,n)=>{const{__scopeDropdownMenu:o,...r}=t,a=zw(Yw,o),i=Fw(o),s=e.useRef(!1);return g(ww,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:n,onCloseAutoFocus:ul(t.onCloseAutoFocus,e=>{s.current||a.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:ul(t.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;a.modal&&!o||(s.current=!0)}),style:{...t.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)"}})});qw.displayName=Yw;var Hw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(kw,{...r,...o,ref:t})});Hw.displayName="DropdownMenuGroup";var Uw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Nw,{...r,...o,ref:t})});Uw.displayName="DropdownMenuLabel";var Kw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Cw,{...r,...o,ref:t})});Kw.displayName="DropdownMenuItem";var Vw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(_w,{...r,...o,ref:t})});Vw.displayName="DropdownMenuCheckboxItem";var Gw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Dw,{...r,...o,ref:t})});Gw.displayName="DropdownMenuRadioGroup";var Zw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Ew,{...r,...o,ref:t})});Zw.displayName="DropdownMenuRadioItem";var Xw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Sw,{...r,...o,ref:t})});Xw.displayName="DropdownMenuItemIndicator";var Qw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Mw,{...r,...o,ref:t})});Qw.displayName="DropdownMenuSeparator";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Ow,{...r,...o,ref:t})}).displayName="DropdownMenuArrow";var Jw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Rw,{...r,...o,ref:t})});Jw.displayName="DropdownMenuSubTrigger";var ek=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Pw,{...r,...o,ref:t,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)"}})});ek.displayName="DropdownMenuSubContent";var tk=$w,nk=qw,ok=Uw,rk=Kw,ak=Vw,ik=Zw,sk=Xw,lk=Qw,ck=Jw,dk=ek;const uk=Lw,pk=Bw,fk=Hw,mk=tk,hk=e=>{const{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:r,defaultOpen:a}=e,i=Fw(t),[s,l]=ml({prop:o,defaultProp:a??!1,onChange:r,caller:"DropdownMenuSub"});return g(Tw,{...i,open:s,onOpenChange:l,children:n})},vk=Gw,gk=e.forwardRef(({className:e,inset:t,children:n,...o},r)=>y(ck,{ref:r,className:Qe("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",t&&"pl-8",e),...o,children:[n,g(Ni,{className:"ml-auto h-4 w-4"})]}));gk.displayName=ck.displayName;const yk=e.forwardRef(({className:e,...t},n)=>g(dk,{ref:n,className:Qe("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),...t}));yk.displayName=dk.displayName;const bk=e.forwardRef(({className:e,sideOffset:t=4,...n},o)=>g(tk,{children:g(nk,{ref:o,sideOffset:t,className:Qe("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),...n})}));bk.displayName=nk.displayName;const xk=e.forwardRef(({className:e,inset:t,...n},o)=>g(rk,{ref:o,className:Qe("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",t&&"pl-8",e),...n}));xk.displayName=rk.displayName;const wk=e.forwardRef(({className:e,children:t,checked:n,...o},r)=>y(ak,{ref:r,className:Qe("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:n,...o,children:[g("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g(sk,{children:g(xi,{className:"h-4 w-4"})})}),t]}));wk.displayName=ak.displayName;const kk=e.forwardRef(({className:e,children:t,...n},o)=>y(ik,{ref:o,className:Qe("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),...n,children:[g("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g(sk,{children:g(Di,{className:"h-2 w-2 fill-current"})})}),t]}));kk.displayName=ik.displayName;const Nk=e.forwardRef(({className:e,inset:t,...n},o)=>g(ok,{ref:o,className:Qe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Nk.displayName=ok.displayName;const Ck=e.forwardRef(({className:e,...t},n)=>g(lk,{ref:n,className:Qe("-mx-1 my-1 h-px bg-muted",e),...t}));Ck.displayName=lk.displayName;const _k=({className:e,...t})=>g("span",{className:Qe("ml-auto text-xs tracking-widest opacity-60",e),...t});_k.displayName="DropdownMenuShortcut";const Dk=e.forwardRef(({className:e,...t},n)=>g("input",{type:"radio",className:Qe("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:n,...t}));Dk.displayName="Radio";const Ek=({size:e=8})=>y("output",{children:[y("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:[g("title",{id:"spinnerTitle",children:"Loading..."}),g("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"}),g("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"}),g("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"}),g("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"}),g("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"}),g("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"}),g("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"}),g("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"}),g("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"})]}),g("span",{className:"sr-only",children:"Loading..."})]}),Sk=({error:e})=>g(b,{children:e&&g("span",{className:"text-red-500 text-xs",children:e?.message})}),Mk=({message:e,error:t})=>{const[n,o]=d(!1),r=JSON.stringify(t,null,2);return y(dt,{children:[g("p",{children:e}),g(yc,{type:"single",collapsible:!0,className:"max-w-60",children:y(bc,{value:"error-details",className:"border-none",children:[g(xc,{className:"text-sm py-2 hover:no-underline text-red-100",children:"View Error Details"}),g(wc,{children:g("pre",{className:"text-xs bg-red-950 p-3 rounded overflow-x-auto max-h-40 overflow-y-auto",children:g("code",{className:"text-red-100",children:r})})})]})}),g("button",{type:"button",onClick:()=>{const e=JSON.stringify(t,null,2);navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!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:y(b,n?{children:[g(xi,{size:14}),g("span",{children:"Copied!"})]}:{children:[g(Si,{size:14}),g("span",{children:"Copy Error JSON"})]})})]})};function Ok({icon:e,title:t,description:n,variant:o="default",className:r}){return y(Fb,{variant:o,className:r??"w-auto h-auto m-4",children:[e,g(jb,{children:t}),g(zb,{children:n})]})}const Tk=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??[]},Rk=(e,t,n={})=>o=>Tk(e,{...o,labelName:t,additionalFilters:n.additionalFilters,fields:n.fields});function Pk({value:e,onChange:t,placeholder:n,error:o,disabled:a,className:s}){const l=r(null),[c,u]=d(null);return i(()=>{let e=!0;return Promise.all([import("@toast-ui/react-editor"),import("@toast-ui/editor/dist/toastui-editor.css")]).then(([t])=>{e&&u(()=>t.Editor)}),()=>{e=!1}},[]),c?y(dt,{direction:"col",gap:2,className:s??"w-full",children:[g(c,{initialValue:e,placeholder:n,usageStatistics:!1,autofocus:!1,initialEditType:"wysiwyg",previewStyle:"disabled",useCommandShortcut:!0,hideModeSwitch:a,onChange:()=>t(l.current?.getMarkdown()||""),ref:l}),o&&g("p",{className:"text-sm text-destructive",children:o})]}):g(dt,{direction:"col",gap:2,className:s??"w-full min-h-[200px]",children:g("span",{})})}function Ak(){return y("div",{className:"flex flex-col items-center justify-center mx-auto",children:[g(Ek,{size:12}),g("p",{className:"mt-2 text-sm text-gray-500",children:"Loading..."})]})}const Ik=({children:e,hasError:t,message:n="Um erro inesperado ocorreu."})=>t?g(Fb,{variant:"destructive",className:"my-2",children:n}):g(b,{children:e}),Fk=({openDialog:e,setOpenDialog:t,handleDelete:n,count:o})=>{const r=void 0!==o&&o>1;return g(dt,{direction:"row",children:g(vd,{open:e,onOpenChange:t,children:y(xd,{className:"max-w-[513px] rounded-xl px-8 py-6 gap-4",children:[y(wd,{children:[g(Nd,{className:"pb-0 border-none",children:r?`Deseja apagar ${o} registros selecionados?`:"Deseja apagar registro atual?"}),g(Cd,{})]}),g("form",{onSubmit:e=>{e.preventDefault(),n()},children:y(dt,{gap:2,children:[g("p",{className:"text-fontcolor-secondary font-medium text-sm",children:r?`Essa ação não poderá ser desfeita e os ${o} 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?"}),y(kd,{className:"mt-4",children:[g(Zr,{asChild:!0,children:g(tt,{variant:"ghost",type:"button",children:"Cancelar"})}),g(tt,{type:"submit",variant:"default",children:r?`Deletar ${o}`:"Deletar"})]})]})})]})})})},jk=({handleClear:e})=>g("button",{type:"button",className:"h-10 p-2 mt-1 text-xs bg-white",onClick:e,children:y(dt,{direction:"row",gap:2,className:"items-center",children:["Limpar filtros ",g(zi,{size:16})]})}),zk=({triggerClassName:e,className:t,trigger:n,children:o})=>{const r=v();return g(Tb,{children:y(Rb,{children:[g(Pb,{asChild:!0,children:g("div",{className:e,children:n})}),g(Ab,{className:t,children:o})]})},r)},Lk=({startRecord:e,endRecord:t,hasValidSearchValues:n,tabCount:o,disabledLoadBackButton:r,disabledLoadMoreButton:a,loadBack:i,loadMore:s})=>y("div",{className:"flex items-center gap-2 text-fontcolor-secondary",children:[g("div",{className:"text-sm",children:y("p",{children:[e," - ",t," de"," ",n?t:o]})}),y("div",{className:"h-[32px] flex items-center",children:[g(zk,{className:"bg-zinc-900 text-white",trigger:g(tt,{variant:"ghost",disabled:r,onClick:()=>i(),type:"button",className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:g("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:g(ki,{size:16})})}),children:"Anteriores"}),g(zk,{className:"bg-zinc-900 text-white",trigger:g(tt,{variant:"ghost",disabled:a,onClick:()=>s(),className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:g("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:g(Ni,{size:16})})}),children:"Próximos"})]})]});function Wk({value:e=[],onChange:t,keyPlaceholder:n="Chave",valuePlaceholder:o="Valor",disabled:r=!1}){const[a,i]=d(""),[s,l]=d(""),c=()=>{const n=a.trim(),o=s.trim();if(n&&o){e.some(e=>e.key===n)||(t([...e,{key:n,value:o}]),i(""),l(""))}},u=e=>{"Enter"===e.key&&(e.preventDefault(),c())};return y(dt,{direction:"col",gap:3,children:[y(dt,{direction:"row",gap:2,children:[g(st,{value:a,onChange:e=>i(e.target.value),onKeyDown:u,placeholder:n,disabled:r,className:"flex-1"}),g(st,{value:s,onChange:e=>l(e.target.value),onKeyDown:u,placeholder:o,disabled:r,className:"flex-1"}),g(tt,{type:"button",onClick:c,disabled:!a.trim()||!s.trim()||r,variant:"outline",children:"Adicionar"})]}),e.length>0&&g(dt,{direction:"row",gap:2,className:"flex-wrap",children:e.map(n=>y(dt,{direction:"row",gap:1,className:"items-center px-3 py-1 bg-secondary text-secondary-foreground rounded-md text-sm",children:[y("span",{className:"font-medium",children:[n.key,":"]}),g("span",{children:n.value}),g(tt,{type:"button",onClick:()=>{return o=n.key,void t(e.filter(e=>e.key!==o));var o},disabled:r,variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-secondary-foreground/10 rounded-full","aria-label":`Remover tag ${n.key}`,children:g(zi,{className:"h-3 w-3"})})]},n.key))})]})}const Bk=({item:e,modelClass:t,propertyName:n,retrieveFile:o})=>{const[r,a]=d(!1);return g(tt,{variant:"outline",size:"icon",disabled:r,onClick:async()=>{a(!0);try{const[r,a]=await o(t,Number(e[n]));if(a)return void ts.error(`Houve algum problema: ${a.message}`);if(!r)return void ts.error("Nenhum arquivo encontrado");const i=new Blob([new Uint8Array(r.data)],{type:r.contentType}),s=URL.createObjectURL(i),l=document.createElement("a");l.href=s,l.download=e.file.split(/[\\/]/).pop()??e.file,document.body.appendChild(l);try{l.click()}finally{document.body.removeChild(l),URL.revokeObjectURL(s)}ts.success("Arquivo baixado com sucesso!")}finally{a(!1)}},children:r?g(Ri,{className:"animate-spin"}):g(Mi,{})})};function $k({options:t,selected:n,onChange:o,placeholder:r="Select items...",className:a,maxDisplay:i=3}){const[s,l]=e.useState(!1),c=n.length===t.length&&t.length>0;return y(Ah,{open:s,onOpenChange:l,children:[g(jh,{className:Qe("w-full",a),children:g("span",{className:Qe("truncate flex-1 text-left",0===n.length&&"text-muted-foreground"),children:(()=>{if(0===n.length)return r;if(n.length>i)return`${n.length} items selected`;const e=n.map(e=>t.find(t=>t.value===e)?.label).join(", ");return e.length>80?`${n.length} item${1!==n.length?"s":""} selected`:e})()})}),y(Wh,{children:[t.length>0&&g("div",{className:"border-b border-border",children:y("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:[g(tb,{checked:c,onCheckedChange:()=>{o(c?[]:t.map(e=>e.value))}}),g("span",{className:"text-sm",children:c?"Unselect All":"Select All"})]})}),g("div",{className:"p-1 space-y-1",children:t.map(e=>y("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:[g(tb,{checked:n.includes(e.value),onCheckedChange:()=>(e=>{const t=n.includes(e)?n.filter(t=>t!==e):[...n,e];o(t)})(e.value)}),g("span",{className:"text-sm",children:e.label})]},e.value))}),n.length>0&&g("div",{className:"border-t border-border p-2 bg-muted",children:y("div",{className:"text-xs text-muted-foreground",children:[n.length," item",1!==n.length?"s":""," selected"]})})]})]})}export{yc as Accordion,wc as AccordionContent,bc as AccordionItem,xc as AccordionTrigger,Fb as Alert,zb as AlertDescription,Wa as AlertDialog,Ga as AlertDialogAction,Za as AlertDialogCancel,qa as AlertDialogContent,Va as AlertDialogDescription,Ua as AlertDialogFooter,Ha as AlertDialogHeader,Ya as AlertDialogOverlay,$a as AlertDialogPortal,Ka as AlertDialogTitle,Ba as AlertDialogTrigger,jb as AlertTitle,Ok as AlertWithIcon,si as Badge,Lb as Breadcrumb,Hb as BreadcrumbEllipsis,Bb as BreadcrumbItem,$b as BreadcrumbLink,Wb as BreadcrumbList,Yb as BreadcrumbPage,qb as BreadcrumbSeparator,tt as Button,wy as Calendar,Ja as Card,oi as CardContent,ni as CardDescription,ri as CardFooter,ei as CardHeader,ti as CardTitle,tb as Checkbox,jk as ClearButton,wf as Combobox,_d as Command,Dd as CommandDialog,Md as CommandEmpty,Od as CommandGroup,Ed as CommandInput,Rd as CommandItem,Sd as CommandList,Td as CommandSeparator,Pd as CommandShortcut,Xa as ConfirmationDialog,Cy as DatePicker,Fk as DeleteDialog,vd as Dialog,xd as DialogContent,Cd as DialogDescription,kd as DialogFooter,wd as DialogHeader,Nd as DialogTitle,gd as DialogTrigger,Bk as DownloadButton,uk as DropdownMenu,wk as DropdownMenuCheckboxItem,bk as DropdownMenuContent,fk as DropdownMenuGroup,xk as DropdownMenuItem,Nk as DropdownMenuLabel,mk as DropdownMenuPortal,vk as DropdownMenuRadioGroup,kk as DropdownMenuRadioItem,Ck as DropdownMenuSeparator,_k as DropdownMenuShortcut,hk as DropdownMenuSub,yk as DropdownMenuSubContent,gk as DropdownMenuSubTrigger,pk as DropdownMenuTrigger,Hn as Dropzone,kc as Empty,Mc as EmptyContainer,Sc as EmptyContent,Ec as EmptyDescription,Nc as EmptyHeader,_c as EmptyMedia,Dc as EmptyTitle,Ik as ErrorBoundary,Sk as ErrorMessage,Mk as ErrorToastContent,Nf as FKSelect,os as FileDropzone,st as Input,ab as Label,Ak as Loading,Pk as MarkdownEditor,$k as MultiSelectDropdown,_y as NoResult,Lk as Pagination,yf as Popover,xf as PopoverContent,bf as PopoverTrigger,ci as PumpwoodBadge,ai as PumpwoodCard,Fy as PumpwoodTable,Dk as Radio,Hh as Select,Wh as SelectContent,Ih as SelectGroup,$h as SelectItem,Bh as SelectLabel,Ah as SelectPrimitive,Lh as SelectScrollDownButton,zh as SelectScrollUpButton,Yh as SelectSeparator,jh as SelectTrigger,Fh as SelectValue,cs as Sidebar,Ay as Skeleton,Ek as Spinner,dt as Stack,jy as Table,Sy as TableBody,Py as TableCaption,Ry as TableCell,My as TableFooter,Ty as TableHead,Ey as TableHeader,Dy as TablePrimitive,Oy as TableRow,Iy as TableSkeleton,Ks as Tabs,Zs as TabsContent,Vs as TabsList,Gs as TabsTrigger,Wk as TagInput,ct as Textarea,Rb as Tooltip,zk as TooltipComponent,Ab as TooltipContent,Tb as TooltipProvider,Pb as TooltipTrigger,Qa as Typography,ii as badgeVariants,Rk as createFKSelectFetcher,Tk as fkSelectFetcher,li as pumpwoodBadgeVariants,is as useSidebarCollapse};
|
|
39
|
+
*/!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 Li=e=>"number"==typeof e&&!isNaN(e),Wi=e=>"string"==typeof e,Bi=e=>"function"==typeof e,$i=1,Yi=()=>""+$i++,qi=new Map,Hi=[],Ui=new Set,Ki=()=>qi.size>0;function Vi(e){if(Ki()){if(null==e||(e=>Wi(e)||Li(e))(e))qi.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=qi.get(e.containerId);t?t.removeToast(e.id):qi.forEach(t=>{t.removeToast(e.id)})}}else Hi=Hi.filter(t=>null!=e&&t.options.toastId!==e)}function Gi(e,t){(e=>p(e)||Wi(e)||Bi(e)||Li(e))(e)&&(Ki()||Hi.push({content:e,options:t}),qi.forEach(n=>{n.buildToast(e,t)}))}function Zi(e,t){qi.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 Xi(e){return e&&(Wi(e.toastId)||Li(e.toastId))?e.toastId:Yi()}function Qi(e,t){return Gi(e,t),t.toastId}function Ji(e,t){return{...t,type:t&&t.type||e,toastId:Xi(t)}}function es(e){return(t,n)=>Qi(t,Ji(e,n))}function ts(e,t){return Qi(e,Ji("default",t))}ts.loading=(e,t)=>Qi(e,Ji("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ts.promise=function(e,{pending:t,error:n,success:o},r){let a;t&&(a=Wi(t)?ts.loading(t,r):ts.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 ts.dismiss(a);let o={type:e,...i,...r,data:n},s=Wi(t)?{render:t}:t;return a?ts.update(a,{...o,...s}):ts(s.render,{...o,...s}),n},l=Bi(e)?e():e;return l.then(e=>s("success",o,e)).catch(e=>s("error",n,e)),l},ts.success=es("success"),ts.info=es("info"),ts.error=es("error"),ts.warning=es("warning"),ts.warn=ts.warning,ts.dark=(e,t)=>Qi(e,Ji("default",{theme:"dark",...t})),ts.dismiss=function(e){Vi(e)},ts.clearWaitingQueue=(e={})=>{qi.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},ts.isActive=function(e,t){var n;if(t)return!(null==(n=qi.get(t))||!n.isToastActive(e));let o=!1;return qi.forEach(t=>{t.isToastActive(e)&&(o=!0)}),o},ts.update=(e,t={})=>{let n=((e,{containerId:t})=>{var n;return null==(n=qi.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:Yi()};a.toastId!==e&&(a.staleId=e);let i=a.render||r;delete a.render,Qi(i,a)}},ts.done=e=>{ts.update(e,{progress:1})},ts.onChange=function(e){return Ui.add(e),()=>{Ui.delete(e)}},ts.play=e=>Zi(!0,e),ts.pause=e=>Zi(!1,e);const ns={"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"]};function os({onFileSelected:e,onFileDeleted:t,acceptExtensions:n,accept:r,maxSizeMB:a=25}){const[i,l]=d(null),c=1024*a*1024,u=o(()=>r||(n?.length?as(n):ns),[r,n]),p=o(()=>Object.values(u).reduce((e,t)=>e.concat(t),[]).join(","),[u]),f=s((t,o)=>{if(o.length>0){const{errors:e}=o[0],t=e[0];return void("file-too-large"===t.code?ts.error(`File size must be under ${a} MB`):"file-invalid-type"===t.code?ts.error(`Invalid file type. Allowed: ${n}`):ts.error(t.message))}const r=t[0];r&&(l(r),e(new File([r],r.name,{type:r.type,lastModified:r.lastModified})),ts.success(`File "${r.name}" selected successfully!`))},[e,a,n]),{getRootProps:m,getInputProps:h,isDragActive:v}=$n({onDrop:f,maxFiles:1,maxSize:c,accept:u,multiple:!1});return y("div",{className:"space-y-2",children:[y("p",{className:"font-bold",children:["Envie um arquivo com até ",a," MB."]}),y("div",i?{className:"flex items-center justify-between border rounded-md px-3 py-2 bg-white",children:[y("div",{className:"flex items-center gap-2",children:[g(Ti,{className:"h-4 w-4 text-gray-600"}),g("span",{className:"text-sm",children:i.name})]}),y("div",{className:"flex items-center gap-1",children:[g("button",{onClick:()=>{const t=document.createElement("input");t.type="file",t.accept=p,t.onchange=t=>{const n=t.target.files?.[0];if(!n)return;const o=Object.values(u).reduce((e,t)=>e.concat(t),[]);o.some(e=>n.name.toLowerCase().endsWith(e.toLowerCase()))?n.size>c?ts.error(`File size must be under ${a} MB`):(l(n),e(n),ts.success(`File "${n.name}" selected successfully!`)):ts.error(`Invalid file type. Allowed: ${o.join(", ")}`)},t.click()},className:"p-1 hover:bg-gray-100 rounded",children:g(Ii,{className:"h-4 w-4"})}),g("button",{onClick:()=>{l(null),t?.(),ts.success("File removed")},className:"p-1 hover:bg-red-50 rounded",children:g(ji,{className:"h-4 w-4 text-red-600"})})]})]}:{...m(),className:"border rounded-lg text-center cursor-pointer transition-colors h-[300px] "+(v?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-gray-400"),children:[g("input",{...h()}),y("div",{className:"py-16 px-6 flex flex-col items-center",children:[g(Ei,{strokeWidth:1,className:"size-[80px] text-[#026CB6]"}),g("p",{className:"text-muted",children:"Arraste e solte ou selecione um arquivo."}),y("p",{className:"text-muted",children:["Arquivos aceitos:",n]})]})]})]})}const rs=e=>e.map(e=>e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`),as=e=>({"application/octet-stream":rs(e)});function is({initialCollapsed:e=!1,onPersist:t}={}){const[n,o]=d(e),[r,a]=d(!1),i=s(()=>{a(!0),o(e=>{const n=!e;return t?.(n),n})},[t]),l=s(()=>{a(!0),o(!1),t?.(!1)},[t]),c=s(()=>{a(!1)},[]),[u,p]=d({}),f=s(e=>{if(n)return l(),void p({[e]:!0});p(t=>({...t,[e]:!t[e]}))},[n,l]),m=s(()=>{p({})},[]);return{isCollapsed:n,isCollapsing:r,expandedItems:u,setExpandedItems:p,toggleCollapse:i,expand:l,handleTransitionEnd:c,toggleExpanded:f,setExpandedOnCollapse:m}}const ss=f(void 0);function ls(){const e=m(ss);if(!e)throw new Error("Sidebar components must be used within a Sidebar.Root");return e}const cs={Root:function({children:e,isCollapsed:t,isCollapsing:n=!1,onToggleCollapse:o,onTransitionEnd:r,className:a}){const i=t?"smaller:w-20 w-20":"smaller:w-[232px] w-[232px]";return g(ss.Provider,{value:{isCollapsed:t,isCollapsing:n,onToggleCollapse:o},children:g("nav",{className:Qe(i,"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",a),onTransitionEnd:r,children:e})})},Header:function({children:e,className:t}){return g("div",{className:Qe("w-full flex justify-between items-center mb-8 gap-4",t),children:e})},Content:function({children:e,className:t}){return g(dt,{className:Qe("w-full flex-1 min-h-0 items-stretch gap-1 overflow-y-auto",t),children:e})},Footer:function({children:e,className:t}){return g("div",{className:Qe("mt-auto w-full",t),children:e})},Toggle:function({className:e}){const{isCollapsed:t,isCollapsing:n,onToggleCollapse:o}=ls(),r=t&&!n;return g("div",{className:Qe("w-full flex transition-all duration-300 ease-in-out",r?"justify-center":"justify-end",e),children:g(tt,{title:r?"Expandir Barra Lateral":"Recolher Barra Lateral",height:48,className:Qe("min-w-[48px] bg-transparent rounded-full hover:bg-white/5 transition-all duration-300 ease-in-out",r?"justify-center":"justify-end"),onClick:o,children:g(r?Pi:Ai,{className:"size-[28px] text-white"})})})},Logo:function({src:e,alt:t,width:n=200,height:o=40,collapsedWidth:r=48,collapsedHeight:a,className:i,ImageComponent:s=({src:e,alt:t,...n})=>g("img",{src:e,alt:t,...n})}){const{isCollapsed:l,isCollapsing:c}=ls(),d=l&&!c,u=d?r:n,p=d?a??Math.max(16,Math.round(o/n*r)):o;return g(dt,{className:Qe("w-full items-center justify-center py-2",i),children:g(s,{className:"object-contain transition-all duration-300 ease-in-out",src:e,width:u,height:p,alt:t})})},Link:function({icon:e,children:t,href:n,active:o,className:r,LinkComponent:a=({children:e,...t})=>g("a",{...t,children:e})}){const{isCollapsed:i,isCollapsing:s}=ls();return g(a,{href:n,title:"string"==typeof t?t:void 0,className:Qe("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",o?"bg-white/5":"",r),children:y(dt,{direction:"row",gap:2,className:"w-full items-center",children:[g(e,{className:"size-6 shrink-0"}),!i&&!s&&g("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:t})]})})},NavGroup:function({icon:e,title:t,isExpanded:n,isActive:o=!1,onToggle:r,children:a,className:i}){const{isCollapsed:s,isCollapsing:l}=ls();return y(dt,{className:Qe("w-full gap-0",i),children:[g(tt,{type:"button",title:t,onClick:r,variant:"ghost",height:48,className:Qe("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",o?"bg-white/5":""),children:y(dt,{direction:"row",gap:2,className:"w-full items-center",children:[g(e,{className:"size-6 shrink-0"}),!s&&!l&&y(b,{children:[g("span",{className:"flex-1 text-left transition-opacity duration-300 ease-in-out opacity-100 text-base",children:t}),g(wi,{width:20,height:20,className:Qe("shrink-0 transition-transform duration-300 ease-in-out",n?"rotate-180":"")})]})]})}),!s&&!l&&g("div",{className:Qe("overflow-hidden transition-all duration-300 ease-in-out",n?"max-h-96 opacity-100 mt-1":"max-h-0 opacity-0"),children:g(dt,{className:"w-full gap-1 pl-9 pr-1",children:a})})]})},NavSubLink:function({title:e,href:t,active:n=!1,className:o,LinkComponent:r=({children:e,...t})=>g("a",{...t,children:e})}){return g(r,{href:t,title:e,className:Qe("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",n?"bg-white/10 font-semibold":"",o),children:e})},Action:function({icon:e,label:t,onClick:n,className:o}){const{isCollapsed:r,isCollapsing:a}=ls();return g(tt,{title:t,onClick:n,variant:"ghost",height:48,className:Qe("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",o),children:y(dt,{direction:"row",gap:2,className:"w-full items-center",children:[g(e,{width:24,height:24,className:"shrink-0"}),!r&&!a&&g("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:t})]})})}};var ds=e.createContext(void 0);function us(t){const n=e.useContext(ds);return t||n||"ltr"}var ps="rovingFocusGroup.onEntryFocus",fs={bubbles:!1,cancelable:!0},ms="RovingFocusGroup",[hs,vs,gs]=function(e){const n=e+"CollectionProvider",[o,r]=Un(n),[a,i]=o(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:o}=e,r=t.useRef(null),i=t.useRef(new Map).current;return g(a,{scope:n,itemMap:i,collectionRef:r,children:o})};s.displayName=n;const l=e+"CollectionSlot",c=to(l),d=t.forwardRef((e,t)=>{const{scope:n,children:o}=e,r=C(t,i(l,n).collectionRef);return g(c,{ref:r,children:o})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",f=to(u),m=t.forwardRef((e,n)=>{const{scope:o,children:r,...a}=e,s=t.useRef(null),l=C(n,s),c=i(u,o);return t.useEffect(()=>(c.itemMap.set(s,{ref:s,...a}),()=>{c.itemMap.delete(s)})),g(f,{[p]:"",ref:l,children:r})});return m.displayName=u,[{Provider:s,Slot:d,ItemSlot:m},function(n){const o=i(e+"CollectionConsumer",n);return t.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},r]}(ms),[ys,bs]=Un(ms,[gs]),[xs,ws]=ys(ms),ks=e.forwardRef((e,t)=>g(hs.Provider,{scope:e.__scopeRovingFocusGroup,children:g(hs.Slot,{scope:e.__scopeRovingFocusGroup,children:g(Ns,{...e,ref:t})})}));ks.displayName=ms;var Ns=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,orientation:r,loop:a=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=t,f=e.useRef(null),m=C(n,f),h=us(i),[v,y]=eo({prop:s,defaultProp:l??null,onChange:c,caller:ms}),[b,x]=e.useState(!1),w=io(d),k=vs(o),N=e.useRef(!1),[_,D]=e.useState(0);return e.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(ps,w),()=>e.removeEventListener(ps,w)},[w]),g(xs,{scope:o,orientation:r,dir:h,loop:a,currentTabStopId:v,onItemFocus:e.useCallback(e=>y(e),[y]),onItemShiftTab:e.useCallback(()=>x(!0),[]),onFocusableItemAdd:e.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>D(e=>e-1),[]),children:g(ao.div,{tabIndex:b||0===_?-1:0,"data-orientation":r,...p,ref:m,style:{outline:"none",...t.style},onMouseDown:Vn(t.onMouseDown,()=>{N.current=!0}),onFocus:Vn(t.onFocus,e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(ps,fs);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);Es([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),u)}}N.current=!1}),onBlur:Vn(t.onBlur,()=>x(!1))})})}),Cs="RovingFocusGroupItem",_s=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,focusable:r=!0,active:a=!1,tabStopId:i,children:s,...l}=t,c=Qn(),d=i||c,u=ws(Cs,o),p=u.currentTabStopId===d,f=vs(o),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:v}=u;return e.useEffect(()=>{if(r)return m(),()=>h()},[r,m,h]),g(hs.ItemSlot,{scope:o,id:d,focusable:r,active:a,children:g(ao.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:n,onMouseDown:Vn(t.onMouseDown,e=>{r?u.onItemFocus(d):e.preventDefault()}),onFocus:Vn(t.onFocus,()=>u.onItemFocus(d)),onKeyDown:Vn(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void u.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:Ds[o]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=f().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=u.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>Es(r))}var n,o}),children:"function"==typeof s?s({isCurrentTabStop:p,hasTabStop:null!=v}):s})})});_s.displayName=Cs;var Ds={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Es(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 Ss=ks,Ms=_s,Os="Tabs",[Ts]=Un(Os,[bs]),Rs=bs(),[Ps,As]=Ts(Os),Is=e.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:a,orientation:i="horizontal",dir:s,activationMode:l="automatic",...c}=e,d=us(s),[u,p]=eo({prop:o,onChange:r,defaultProp:a??"",caller:Os});return g(Ps,{scope:n,baseId:Qn(),value:u,onValueChange:p,orientation:i,dir:d,activationMode:l,children:g(ao.div,{dir:d,"data-orientation":i,...c,ref:t})})});Is.displayName=Os;var Fs="TabsList",js=e.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,a=As(Fs,n),i=Rs(n);return g(Ss,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:o,children:g(ao.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});js.displayName=Fs;var zs="TabsTrigger",Ls=e.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...a}=e,i=As(zs,n),s=Rs(n),l=$s(i.baseId,o),c=Ys(i.baseId,o),d=o===i.value;return g(Ms,{asChild:!0,...s,focusable:!r,active:d,children:g(ao.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...a,ref:t,onMouseDown:Vn(e.onMouseDown,e=>{r||0!==e.button||!1!==e.ctrlKey?e.preventDefault():i.onValueChange(o)}),onKeyDown:Vn(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&i.onValueChange(o)}),onFocus:Vn(e.onFocus,()=>{const e="manual"!==i.activationMode;d||r||!e||i.onValueChange(o)})})})});Ls.displayName=zs;var Ws="TabsContent",Bs=e.forwardRef((t,n)=>{const{__scopeTabs:o,value:r,forceMount:a,children:i,...s}=t,l=As(Ws,o),c=$s(l.baseId,r),d=Ys(l.baseId,r),u=r===l.value,p=e.useRef(u);return e.useEffect(()=>{const e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),g(Eo,{present:a||u,children:({present:e})=>g(ao.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!e,id:d,tabIndex:0,...s,ref:n,style:{...t.style,animationDuration:p.current?"0s":void 0},children:e&&i})})});function $s(e,t){return`${e}-trigger-${t}`}function Ys(e,t){return`${e}-content-${t}`}Bs.displayName=Ws;var qs=js,Hs=Ls,Us=Bs;const Ks=Is,Vs=e.forwardRef(({className:e,...t},n)=>g(qs,{ref:n,className:Qe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Vs.displayName=qs.displayName;const Gs=e.forwardRef(({className:e,...t},n)=>g(Hs,{ref:n,className:Qe("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),...t}));Gs.displayName=Hs.displayName;const Zs=e.forwardRef(({className:e,...t},n)=>g(Us,{ref:n,className:Qe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));function Xs(t,n=[]){let o=[];const r=()=>{const n=o.map(t=>e.createContext(t));return function(o){const r=o?.[t]||n;return e.useMemo(()=>({[`__scope${t}`]:{...o,[t]:r}}),[o,r])}};return r.scopeName=t,[function(n,r){const a=e.createContext(r);a.displayName=n+"Context";const i=o.length;o=[...o,r];const s=n=>{const{scope:o,children:r,...s}=n,l=o?.[t]?.[i]||a,c=e.useMemo(()=>s,Object.values(s));return g(l.Provider,{value:c,children:r})};return s.displayName=n+"Provider",[s,function(o,s){const l=s?.[t]?.[i]||a,c=e.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${o}\` must be used within \`${n}\``)}]},Qs(r,...n)]}function Qs(...t){const n=t[0];if(1===t.length)return n;const o=()=>{const o=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const r=o.reduce((e,{useScope:n,scopeName:o})=>({...e,...n(t)[`__scope${o}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:r}),[r])}};return o.scopeName=n.scopeName,o}function Js(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function el(...e){return t=>{let n=!1;const o=e.map(e=>{const o=Js(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():Js(e[t],null)}}}}function tl(...t){return e.useCallback(el(...t),t)}function nl(t){const n=e.forwardRef((n,o)=>{let{children:r,...a}=n,i=null,s=!1;const l=[];il(r)&&"function"==typeof cl&&(r=cl(r._payload)),e.Children.forEach(r,t=>{if(n=t,e.isValidElement(n)&&"function"==typeof n.type&&"__radixId"in n.type&&n.type.__radixId===ol){s=!0;const e=t;let n="child"in e.props?e.props.child:e.props.children;il(n)&&"function"==typeof cl&&(n=cl(n._payload)),i=rl(e,n),l.push(i?.props?.children)}else l.push(t);var n}),i?i=e.cloneElement(i,void 0,l):!s&&1===e.Children.count(r)&&e.isValidElement(r)&&(i=r);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=tl(o,c);if(!i){if(r||0===r)throw new Error(s?ll(t):sl(t));return r}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!==e.Fragment&&(u.ref=o?d:c),e.cloneElement(i,u)});return n.displayName=`${t}.Slot`,n}Zs.displayName=Us.displayName;var ol=Symbol.for("radix.slottable");var rl=(t,n)=>{if("child"in t.props){const n=t.props.child;return e.isValidElement(n)?e.cloneElement(n,void 0,t.props.children(n.props.children)):null}return e.isValidElement(n)?n:null};var al=Symbol.for("react.lazy");function il(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===al&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}var sl=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,ll=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,cl=e[" use ".trim().toString()];function dl(t){const n=t+"CollectionProvider",[o,r]=Xs(n),[a,i]=o(n,{collectionRef:{current:null},itemMap:new Map}),s=t=>{const{scope:n,children:o}=t,r=e.useRef(null),i=e.useRef(new Map).current;return g(a,{scope:n,itemMap:i,collectionRef:r,children:o})};s.displayName=n;const l=t+"CollectionSlot",c=nl(l),d=e.forwardRef((e,t)=>{const{scope:n,children:o}=e,r=tl(t,i(l,n).collectionRef);return g(c,{ref:r,children:o})});d.displayName=l;const u=t+"CollectionItemSlot",p="data-radix-collection-item",f=nl(u),m=e.forwardRef((t,n)=>{const{scope:o,children:r,...a}=t,s=e.useRef(null),l=tl(n,s),c=i(u,o);return e.useEffect(()=>(c.itemMap.set(s,{ref:s,...a}),()=>{c.itemMap.delete(s)})),g(f,{[p]:"",ref:l,children:r})});return m.displayName=u,[{Provider:s,Slot:d,ItemSlot:m},function(n){const o=i(t+"CollectionConsumer",n);return e.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},r]}function ul(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}var pl=globalThis?.document?e.useLayoutEffect:()=>{},fl=e[" useInsertionEffect ".trim().toString()]||pl;function ml({prop:t,defaultProp:n,onChange:o=()=>{},caller:r}){const[a,i,s]=function({defaultProp:t,onChange:n}){const[o,r]=e.useState(t),a=e.useRef(o),i=e.useRef(n);return fl(()=>{i.current=n},[n]),e.useEffect(()=>{a.current!==o&&(i.current?.(o),a.current=o)},[o,a]),[o,r,i]}({defaultProp:n,onChange:o}),l=void 0!==t,c=l?t:a;{const n=e.useRef(void 0!==t);e.useEffect(()=>{const e=n.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${r} 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.`)}n.current=l},[l,r])}const d=e.useCallback(e=>{if(l){const n=function(e){return"function"==typeof e}(e)?e(t):e;n!==t&&s.current?.(n)}else i(e)},[l,t,i,s]);return[c,d]}var hl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const o=nl(`Primitive.${n}`),r=e.forwardRef((e,t)=>{const{asChild:r,...a}=e,i=r?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),g(i,{...a,ref:t})});return r.displayName=`Primitive.${n}`,{...t,[n]:r}},{});function vl(e,t){e&&x.flushSync(()=>e.dispatchEvent(t))}var gl=t=>{const{present:n,children:o}=t,r=function(t){const[n,o]=e.useState(),r=e.useRef(null),a=e.useRef(t),i=e.useRef("none"),s=t?"mounted":"unmounted",[l,c]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=bl(r.current);i.current="mounted"===l?e:"none"},[l]),pl(()=>{const e=r.current,n=a.current;if(n!==t){const o=i.current,r=bl(e);if(t)c("MOUNT");else if("none"===r||"none"===e?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=t}},[t,c]),pl(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,o=o=>{const i=bl(r.current).includes(CSS.escape(o.animationName));if(o.target===n&&i&&(c("ANIMATION_END"),!a.current)){const o=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=o)})}},s=e=>{e.target===n&&(i.current=bl(r.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",o),n.addEventListener("animationend",o),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",o),n.removeEventListener("animationend",o)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:e.useCallback(e=>{r.current=e?getComputedStyle(e):null,o(e)},[])}}(n),a="function"==typeof o?o({present:r.isPresent}):e.Children.only(o),i=function(...t){const n=e.useRef(t);return n.current=t,e.useCallback(e=>{const t=n.current;let o=!1;const r=t.map(t=>{const n=yl(t,e);return o||"function"!=typeof n||(o=!0),n});if(o)return()=>{for(let e=0;e<r.length;e++){const n=r[e];"function"==typeof n?n():yl(t[e],null)}}},[])}(r.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 o||r.isPresent?e.cloneElement(a,{ref:i}):null};function yl(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function bl(e){return e?.animationName||"none"}gl.displayName="Presence";var xl=e[" useId ".trim().toString()]||(()=>{}),wl=0;function kl(t){const[n,o]=e.useState(xl());return pl(()=>{o(e=>e??String(wl++))},[t]),n?`radix-${n}`:""}var Nl="Collapsible",[Cl,_l]=Xs(Nl),[Dl,El]=Cl(Nl),Sl=e.forwardRef((t,n)=>{const{__scopeCollapsible:o,open:r,defaultOpen:a,disabled:i,onOpenChange:s,...l}=t,[c,d]=ml({prop:r,defaultProp:a??!1,onChange:s,caller:Nl});return g(Dl,{scope:o,disabled:i,contentId:kl(),open:c,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),children:g(hl.div,{"data-state":Al(c),"data-disabled":i?"":void 0,...l,ref:n})})});Sl.displayName=Nl;var Ml="CollapsibleTrigger",Ol=e.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=El(Ml,n);return g(hl.button,{type:"button","aria-controls":r.open?r.contentId:void 0,"aria-expanded":r.open||!1,"data-state":Al(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:ul(e.onClick,r.onOpenToggle)})});Ol.displayName=Ml;var Tl="CollapsibleContent",Rl=e.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=El(Tl,e.__scopeCollapsible);return g(gl,{present:n||r.open,children:({present:e})=>g(Pl,{...o,ref:t,present:e})})});Rl.displayName=Tl;var Pl=e.forwardRef((t,n)=>{const{__scopeCollapsible:o,present:r,children:a,...i}=t,s=El(Tl,o),[l,c]=e.useState(r),d=e.useRef(null),u=tl(n,d),p=e.useRef(0),f=p.current,m=e.useRef(0),h=m.current,v=s.open||l,y=e.useRef(v),b=e.useRef(void 0);return e.useEffect(()=>{const e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),pl(()=>{const e=d.current;if(e){b.current=b.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();p.current=t.height,m.current=t.width,y.current||(e.style.transitionDuration=b.current.transitionDuration,e.style.animationName=b.current.animationName),c(r)}},[s.open,r]),g(hl.div,{"data-state":Al(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!v,...i,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...t.style},children:v&&a})});function Al(e){return e?"open":"closed"}var Il=Sl,Fl=Ol,jl=Rl,zl=e.createContext(void 0);function Ll(t){const n=e.useContext(zl);return t||n||"ltr"}var Wl="Accordion",Bl=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[$l,Yl,ql]=dl(Wl),[Hl]=Xs(Wl,[ql,_l]),Ul=_l(),Kl=e.forwardRef((e,t)=>{const{type:n,...o}=e,r=o,a=o;return g($l.Provider,{scope:e.__scopeAccordion,children:"multiple"===n?g(Jl,{...a,ref:t}):g(Ql,{...r,ref:t})})});Kl.displayName=Wl;var[Vl,Gl]=Hl(Wl),[Zl,Xl]=Hl(Wl,{collapsible:!1}),Ql=e.forwardRef((t,n)=>{const{value:o,defaultValue:r,onValueChange:a=()=>{},collapsible:i=!1,...s}=t,[l,c]=ml({prop:o,defaultProp:r??"",onChange:a,caller:Wl});return g(Vl,{scope:t.__scopeAccordion,value:e.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:e.useCallback(()=>i&&c(""),[i,c]),children:g(Zl,{scope:t.__scopeAccordion,collapsible:i,children:g(nc,{...s,ref:n})})})}),Jl=e.forwardRef((t,n)=>{const{value:o,defaultValue:r,onValueChange:a=()=>{},...i}=t,[s,l]=ml({prop:o,defaultProp:r??[],onChange:a,caller:Wl}),c=e.useCallback(e=>l((t=[])=>[...t,e]),[l]),d=e.useCallback(e=>l((t=[])=>t.filter(t=>t!==e)),[l]);return g(Vl,{scope:t.__scopeAccordion,value:s,onItemOpen:c,onItemClose:d,children:g(Zl,{scope:t.__scopeAccordion,collapsible:!0,children:g(nc,{...i,ref:n})})})}),[ec,tc]=Hl(Wl),nc=e.forwardRef((t,n)=>{const{__scopeAccordion:o,disabled:r,dir:a,orientation:i="vertical",...s}=t,l=tl(e.useRef(null),n),c=Yl(o),d="ltr"===Ll(a),u=ul(t.onKeyDown,e=>{if(!Bl.includes(e.key))return;const t=e.target,n=c().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 s=r-1,l=()=>{a=o+1,a>s&&(a=0)},u=()=>{a=o-1,a<0&&(a=s)};switch(e.key){case"Home":a=0;break;case"End":a=s;break;case"ArrowRight":"horizontal"===i&&(d?l():u());break;case"ArrowDown":"vertical"===i&&l();break;case"ArrowLeft":"horizontal"===i&&(d?u():l());break;case"ArrowUp":"vertical"===i&&u()}const p=a%r;n[p].ref.current?.focus()});return g(ec,{scope:o,disabled:r,direction:a,orientation:i,children:g($l.Slot,{scope:o,children:g(hl.div,{...s,"data-orientation":i,ref:l,onKeyDown:r?void 0:u})})})}),oc="AccordionItem",[rc,ac]=Hl(oc),ic=e.forwardRef((e,t)=>{const{__scopeAccordion:n,value:o,...r}=e,a=tc(oc,n),i=Gl(oc,n),s=Ul(n),l=kl(),c=o&&i.value.includes(o)||!1,d=a.disabled||e.disabled;return g(rc,{scope:n,open:c,disabled:d,triggerId:l,children:g(Il,{"data-orientation":a.orientation,"data-state":fc(c),...s,...r,ref:t,disabled:d,open:c,onOpenChange:e=>{e?i.onItemOpen(o):i.onItemClose(o)}})})});ic.displayName=oc;var sc="AccordionHeader",lc=e.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=tc(Wl,n),a=ac(sc,n);return g(hl.h3,{"data-orientation":r.orientation,"data-state":fc(a.open),"data-disabled":a.disabled?"":void 0,...o,ref:t})});lc.displayName=sc;var cc="AccordionTrigger",dc=e.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=tc(Wl,n),a=ac(cc,n),i=Xl(cc,n),s=Ul(n);return g($l.ItemSlot,{scope:n,children:g(Fl,{"aria-disabled":a.open&&!i.collapsible||void 0,"data-orientation":r.orientation,id:a.triggerId,...s,...o,ref:t})})});dc.displayName=cc;var uc="AccordionContent",pc=e.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=tc(Wl,n),a=ac(uc,n),i=Ul(n);return g(jl,{role:"region","aria-labelledby":a.triggerId,"data-orientation":r.orientation,...i,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function fc(e){return e?"open":"closed"}pc.displayName=uc;var mc=ic,hc=lc,vc=dc,gc=pc;const yc=Kl,bc=e.forwardRef(({className:e,...t},n)=>g(mc,{ref:n,className:Qe("border-b",e),...t}));bc.displayName="AccordionItem";const xc=e.forwardRef(({className:e,children:t,...n},o)=>g(hc,{className:"flex",children:y(vc,{ref:o,className:Qe("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),...n,children:[t,g(wi,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));xc.displayName=vc.displayName;const wc=e.forwardRef(({className:e,children:t,...n},o)=>g(gc,{ref:o,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:g("div",{className:Qe("pb-4 pt-0",e),children:t})}));function kc({className:e,...t}){return g("div",{"data-slot":"empty",className:Qe("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),...t})}function Nc({className:e,...t}){return g("div",{"data-slot":"empty-header",className:Qe("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}wc.displayName=gc.displayName;const Cc=j("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 _c({className:e,variant:t="default",...n}){return g("div",{"data-slot":"empty-icon","data-variant":t,className:Qe(Cc({variant:t,className:e})),...n})}function Dc({className:e,...t}){return g("div",{"data-slot":"empty-title",className:Qe("text-lg font-medium tracking-tight",e),...t})}function Ec({className:e,...t}){return g("div",{"data-slot":"empty-description",className:Qe("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...t})}function Sc({className:e,...t}){return g("div",{"data-slot":"empty-content",className:Qe("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",e),...t})}function Mc({title:e,description:t}){return g(kc,{children:y(Nc,{className:"w-[250px]",children:[g(_c,{children:g(yi,{})}),g(Dc,{children:e}),g(Ec,{children:t})]})})}var Oc=.999,Tc=/[\\\/_+.#"@\[\(\{&]/,Rc=/[\\\/_+.#"@\[\(\{&]/g,Pc=/[\s-]/,Ac=/[\s-]/g;function Ic(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=Ic(e,t,n,o,f+1,a+1,i))>m&&(f===r?l*=1:Tc.test(e.charAt(f-1))?(l*=.8,(d=e.slice(r,f-1).match(Rc))&&r>0&&(l*=Math.pow(Oc,d.length))):Pc.test(e.charAt(f-1))?(l*=.9,(u=e.slice(r,f-1).match(Ac))&&r>0&&(l*=Math.pow(Oc,u.length))):(l*=.17,r>0&&(l*=Math.pow(Oc,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=Ic(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(Ac," ")}function jc(e,t,n){return Ic(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,Fc(e),Fc(t),0,0,{})}var zc='[cmdk-group=""]',Lc='[cmdk-group-items=""]',Wc='[cmdk-item=""]',Bc=`${Wc}:not([aria-disabled="true"])`,$c="cmdk-item-select",Yc="data-value",qc=(e,t,n)=>jc(e,t,n),Hc=e.createContext(void 0),Uc=()=>e.useContext(Hc),Kc=e.createContext(void 0),Vc=()=>e.useContext(Kc),Gc=e.createContext(void 0),Zc=e.forwardRef((t,n)=>{let o=dd(()=>{var e,n;return{search:"",value:null!=(n=null!=(e=t.value)?e:t.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=dd(()=>new Set),a=dd(()=>new Map),i=dd(()=>new Map),s=dd(()=>new Set),l=ld(t),{label:c,children:d,value:u,onValueChange:p,filter:f,shouldFilter:m,loop:h,disablePointerSelection:v=!1,vimBindings:g=!0,...y}=t,b=Qn(),x=Qn(),w=Qn(),k=e.useRef(null),N=fd();cd(()=>{if(void 0!==u){let e=u.trim();o.current.value=e,C.emit()}},[u]),cd(()=>{N(6,O)},[]);let C=e.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>o.current,setState:(e,t,n)=>{var r,a,i,s;if(!Object.is(o.current[e],t)){if(o.current[e]=t,"search"===e)M(),E(),N(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(b))||r.focus()}if(N(7,()=>{var e;o.current.selectedItemId=null==(e=T())?void 0:e.id,C.emit()}),n||N(5,O),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))}}C.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),_=e.useMemo(()=>({value:(e,t,n)=>{var r;t!==(null==(r=i.current.get(e))?void 0:r.value)&&(i.current.set(e,{value:t,keywords:n}),o.current.filtered.items.set(e,D(t,n)),N(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),N(3,()=>{M(),E(),o.current.value||S(),C.emit()}),()=>{i.current.delete(e),r.current.delete(e),o.current.filtered.items.delete(e);let t=T();N(4,()=>{M(),(null==t?void 0:t.getAttribute("id"))===e&&S(),C.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||t["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:x,listInnerRef:k}),[]);function D(e,t){var n,r;let a=null!=(r=null==(n=l.current)?void 0:n.filter)?r:qc;return e?a(e,o.current.search,t):0}function E(){if(!o.current.search||!1===l.current.shouldFilter)return;let e=o.current.filtered.items,t=[];o.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 n=k.current;R().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(Lc);t?t.appendChild(e.parentElement===t?e:e.closest(`${Lc} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Lc} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${zc}[${Yc}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function S(){let e=R().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Yc);C.setState("value",t||void 0)}function M(){var e,t,n,s;if(!o.current.search||!1===l.current.shouldFilter)return void(o.current.filtered.count=r.current.size);o.current.filtered.groups=new Set;let c=0;for(let a of r.current){let r=D(null!=(t=null==(e=i.current.get(a))?void 0:e.value)?t:"",null!=(s=null==(n=i.current.get(a))?void 0:n.keywords)?s:[]);o.current.filtered.items.set(a,r),r>0&&c++}for(let[e,t]of a.current)for(let n of t)if(o.current.filtered.items.get(n)>0){o.current.filtered.groups.add(e);break}o.current.filtered.count=c}function O(){var e,t,n;let o=T();o&&((null==(e=o.parentElement)?void 0:e.firstChild)===o&&(null==(n=null==(t=o.closest(zc))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),o.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=k.current)?void 0:e.querySelector(`${Wc}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(Bc))||[])}function P(e){let t=R()[e];t&&C.setState("value",t.getAttribute(Yc))}function A(e){var t;let n=T(),o=R(),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&&C.setState("value",a.getAttribute(Yc))}function I(e){let t,n=T(),o=null==n?void 0:n.closest(zc);for(;o&&!t;)o=e>0?id(o,zc):sd(o,zc),t=null==o?void 0:o.querySelector(Bc);t?C.setState("value",t.getAttribute(Yc)):A(e)}let F=()=>P(R().length-1),j=e=>{e.preventDefault(),e.metaKey?F():e.altKey?I(1):A(1)},z=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):A(-1)};return e.createElement(ao.div,{ref:n,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=y.onKeyDown)||t.call(y,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!n)switch(e.key){case"n":case"j":g&&e.ctrlKey&&j(e);break;case"ArrowDown":j(e);break;case"p":case"k":g&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),P(0);break;case"End":e.preventDefault(),F();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event($c);t.dispatchEvent(e)}}}}},e.createElement("label",{"cmdk-label":"",htmlFor:_.inputId,id:_.labelId,style:hd},c),md(t,t=>e.createElement(Kc.Provider,{value:C},e.createElement(Hc.Provider,{value:_},t))))}),Xc=e.forwardRef((t,n)=>{var o,r;let a=Qn(),i=e.useRef(null),s=e.useContext(Gc),l=Uc(),c=ld(t),d=null!=(r=null==(o=c.current)?void 0:o.forceMount)?r:null==s?void 0:s.forceMount;cd(()=>{if(!d)return l.item(a,null==s?void 0:s.id)},[d]);let u=pd(a,i,[t.value,t.children,i],t.keywords),p=Vc(),f=ud(e=>e.value&&e.value===u.current),m=ud(e=>!(!d&&!1!==l.filter())||(!e.search||e.filtered.items.get(a)>0));function h(){var e,t;v(),null==(t=(e=c.current).onSelect)||t.call(e,u.current)}function v(){p.setState("value",u.current,!0)}if(e.useEffect(()=>{let e=i.current;if(e&&!t.disabled)return e.addEventListener($c,h),()=>e.removeEventListener($c,h)},[m,t.onSelect,t.disabled]),!m)return null;let{disabled:g,value:y,onSelect:b,forceMount:x,keywords:w,...k}=t;return e.createElement(ao.div,{ref:N(i,n),...k,id:a,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||l.getDisablePointerSelection()?void 0:v,onClick:g?void 0:h},t.children)}),Qc=e.forwardRef((t,n)=>{let{heading:o,children:r,forceMount:a,...i}=t,s=Qn(),l=e.useRef(null),c=e.useRef(null),d=Qn(),u=Uc(),p=ud(e=>!(!a&&!1!==u.filter())||(!e.search||e.filtered.groups.has(s)));cd(()=>u.group(s),[]),pd(s,l,[t.value,t.heading,c]);let f=e.useMemo(()=>({id:s,forceMount:a}),[a]);return e.createElement(ao.div,{ref:N(l,n),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},o&&e.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},o),md(t,t=>e.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":o?d:void 0},e.createElement(Gc.Provider,{value:f},t))))}),Jc=e.forwardRef((t,n)=>{let{alwaysRender:o,...r}=t,a=e.useRef(null),i=ud(e=>!e.search);return o||i?e.createElement(ao.div,{ref:N(a,n),...r,"cmdk-separator":"",role:"separator"}):null}),ed=e.forwardRef((t,n)=>{let{onValueChange:o,...r}=t,a=null!=t.value,i=Vc(),s=ud(e=>e.search),l=ud(e=>e.selectedItemId),c=Uc();return e.useEffect(()=>{null!=t.value&&i.setState("search",t.value)},[t.value]),e.createElement(ao.input,{ref:n,...r,"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?t.value:s,onChange:e=>{a||i.setState("search",e.target.value),null==o||o(e.target.value)}})}),td=e.forwardRef((t,n)=>{let{children:o,label:r="Suggestions",...a}=t,i=e.useRef(null),s=e.useRef(null),l=ud(e=>e.selectedItemId),c=Uc();return e.useEffect(()=>{if(s.current&&i.current){let e,t=s.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)}}},[]),e.createElement(ao.div,{ref:N(i,n),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},md(t,t=>e.createElement("div",{ref:N(s,c.listInnerRef),"cmdk-list-sizer":""},t)))}),nd=e.forwardRef((t,n)=>{let{open:o,onOpenChange:r,overlayClassName:a,contentClassName:i,container:s,...l}=t;return e.createElement(oa,{open:o,onOpenChange:r},e.createElement(aa,{container:s},e.createElement(ia,{"cmdk-overlay":"",className:a}),e.createElement(sa,{"aria-label":t.label,"cmdk-dialog":"",className:i},e.createElement(Zc,{ref:n,...l}))))}),od=e.forwardRef((t,n)=>ud(e=>0===e.filtered.count)?e.createElement(ao.div,{ref:n,...t,"cmdk-empty":"",role:"presentation"}):null),rd=e.forwardRef((t,n)=>{let{progress:o,children:r,label:a="Loading...",...i}=t;return e.createElement(ao.div,{ref:n,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},md(t,t=>e.createElement("div",{"aria-hidden":!0},t)))}),ad=Object.assign(Zc,{List:td,Item:Xc,Input:ed,Group:Qc,Separator:Jc,Dialog:nd,Empty:od,Loading:rd});function id(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function sd(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ld(t){let n=e.useRef(t);return cd(()=>{n.current=t}),n}var cd="undefined"==typeof window?e.useEffect:e.useLayoutEffect;function dd(t){let n=e.useRef();return void 0===n.current&&(n.current=t()),n}function ud(t){let n=Vc(),o=()=>t(n.snapshot());return e.useSyncExternalStore(n.subscribe,o,o)}function pd(t,n,o,r=[]){let a=e.useRef(),i=Uc();return cd(()=>{var e;let s=(()=>{var e;for(let t of o){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=r.map(e=>e.trim());i.value(t,s,l),null==(e=n.current)||e.setAttribute(Yc,s),a.current=s}),a}var fd=()=>{let[t,n]=e.useState(),o=dd(()=>new Map);return cd(()=>{o.current.forEach(e=>e()),o.current=new Map},[t]),(e,t)=>{o.current.set(e,t),n({})}};function md({asChild:t,children:n},o){return t&&e.isValidElement(n)?e.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(n),{ref:n.ref},o(n.props.children)):o(n)}var hd={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const vd=oa,gd=ra,yd=({className:e,...t})=>g(aa,{...t});yd.displayName=aa.displayName;const bd=e.forwardRef(({className:e,...t},n)=>g(ia,{ref:n,className:Qe("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),...t}));bd.displayName=ia.displayName;const xd=e.forwardRef(({className:e,children:t,showCloseButton:n=!0,...o},r)=>y(yd,{children:[g(bd,{}),y(sa,{ref:r,className:Qe("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),...o,children:[t,n&&y(da,{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:[g(zi,{className:"h-4 w-4"}),g("span",{className:"sr-only",children:"Close"})]})]})]}));xd.displayName=sa.displayName;const wd=({className:e,...t})=>g("div",{className:Qe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});wd.displayName="DialogHeader";const kd=({className:e,...t})=>g("div",{className:Qe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});kd.displayName="DialogFooter";const Nd=e.forwardRef(({className:e,...t},n)=>g(la,{ref:n,className:Qe("text-lg font-semibold leading-none tracking-tight",e),...t}));Nd.displayName=la.displayName;const Cd=e.forwardRef(({className:e,...t},n)=>g(ca,{ref:n,className:Qe("text-sm text-muted-foreground",e),...t}));function _d({className:e,...t}){return g(ad,{"data-slot":"command",className:Qe("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Dd({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:o,showCloseButton:r=!0,...a}){return y(vd,{...a,children:[y(wd,{className:"sr-only",children:[g(Nd,{children:e}),g(Cd,{children:t})]}),g(xd,{className:Qe("overflow-hidden p-0",o),children:g(_d,{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:n})})]})}function Ed({className:e,...t}){return y("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[g(Fi,{className:"size-4 shrink-0 opacity-50"}),g(ad.Input,{"data-slot":"command-input",className:Qe("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),...t})]})}function Sd({className:e,...t}){return g(ad.List,{"data-slot":"command-list",className:Qe("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Md({...e}){return g(ad.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Od({className:e,...t}){return g(ad.Group,{"data-slot":"command-group",className:Qe("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),...t})}function Td({className:e,...t}){return g(ad.Separator,{"data-slot":"command-separator",className:Qe("bg-border -mx-1 h-px",e),...t})}function Rd({className:e,...t}){return g(ad.Item,{"data-slot":"command-item",className:Qe("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),...t})}function Pd({className:e,...t}){return g("span",{"data-slot":"command-shortcut",className:Qe("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}Cd.displayName=ca.displayName;const Ad=["top","right","bottom","left"],Id=Math.min,Fd=Math.max,jd=Math.round,zd=Math.floor,Ld=e=>({x:e,y:e}),Wd={left:"right",right:"left",bottom:"top",top:"bottom"},Bd={start:"end",end:"start"};function $d(e,t,n){return Fd(e,Id(t,n))}function Yd(e,t){return"function"==typeof e?e(t):e}function qd(e){return e.split("-")[0]}function Hd(e){return e.split("-")[1]}function Ud(e){return"x"===e?"y":"x"}function Kd(e){return"y"===e?"height":"width"}const Vd=new Set(["top","bottom"]);function Gd(e){return Vd.has(qd(e))?"y":"x"}function Zd(e){return Ud(Gd(e))}function Xd(e){return e.replace(/start|end/g,e=>Bd[e])}const Qd=["left","right"],Jd=["right","left"],eu=["top","bottom"],tu=["bottom","top"];function nu(e,t,n,o){const r=Hd(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Jd:Qd:t?Qd:Jd;case"left":case"right":return t?eu:tu;default:return[]}}(qd(e),"start"===n,o);return r&&(a=a.map(e=>e+"-"+r),t&&(a=a.concat(a.map(Xd)))),a}function ou(e){return e.replace(/left|right|bottom|top/g,e=>Wd[e])}function ru(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 au(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 iu(e,t,n){let{reference:o,floating:r}=e;const a=Gd(t),i=Zd(t),s=Kd(i),l=qd(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(Hd(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1)}return f}async function su(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}=Yd(t,e),m=ru(f),h=s[p?"floating"===u?"reference":"floating":u],v=au(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,y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(y))&&await(null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},x=au(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:y,strategy:l}):g);return{top:(v.top-x.top+m.top)/b.y,bottom:(x.bottom-v.bottom+m.bottom)/b.y,left:(v.left-x.left+m.left)/b.x,right:(x.right-v.right+m.right)/b.x}}function lu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cu(e){return Ad.some(t=>e[t]>=0)}const du=new Set(["left","top"]);function uu(){return"undefined"!=typeof window}function pu(e){return hu(e)?(e.nodeName||"").toLowerCase():"#document"}function fu(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function mu(e){var t;return null==(t=(hu(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function hu(e){return!!uu()&&(e instanceof Node||e instanceof fu(e).Node)}function vu(e){return!!uu()&&(e instanceof Element||e instanceof fu(e).Element)}function gu(e){return!!uu()&&(e instanceof HTMLElement||e instanceof fu(e).HTMLElement)}function yu(e){return!(!uu()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof fu(e).ShadowRoot)}const bu=new Set(["inline","contents"]);function xu(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ru(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!bu.has(r)}const wu=new Set(["table","td","th"]);function ku(e){return wu.has(pu(e))}const Nu=[":popover-open",":modal"];function Cu(e){return Nu.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const _u=["transform","translate","scale","rotate","perspective"],Du=["transform","translate","scale","rotate","perspective","filter"],Eu=["paint","layout","strict","content"];function Su(e){const t=Mu(),n=vu(e)?Ru(e):e;return _u.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Du.some(e=>(n.willChange||"").includes(e))||Eu.some(e=>(n.contain||"").includes(e))}function Mu(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ou=new Set(["html","body","#document"]);function Tu(e){return Ou.has(pu(e))}function Ru(e){return fu(e).getComputedStyle(e)}function Pu(e){return vu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Au(e){if("html"===pu(e))return e;const t=e.assignedSlot||e.parentNode||yu(e)&&e.host||mu(e);return yu(t)?t.host:t}function Iu(e){const t=Au(e);return Tu(t)?e.ownerDocument?e.ownerDocument.body:e.body:gu(t)&&xu(t)?t:Iu(t)}function Fu(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Iu(e),a=r===(null==(o=e.ownerDocument)?void 0:o.body),i=fu(r);if(a){const e=ju(i);return t.concat(i,i.visualViewport||[],xu(r)?r:[],e&&n?Fu(e):[])}return t.concat(r,Fu(r,[],n))}function ju(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function zu(e){const t=Ru(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=gu(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=jd(n)!==a||jd(o)!==i;return s&&(n=a,o=i),{width:n,height:o,$:s}}function Lu(e){return vu(e)?e:e.contextElement}function Wu(e){const t=Lu(e);if(!gu(t))return Ld(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=zu(t);let i=(a?jd(n.width):n.width)/o,s=(a?jd(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const Bu=Ld(0);function $u(e){const t=fu(e);return Mu()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Bu}function Yu(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=Lu(e);let i=Ld(1);t&&(o?vu(o)&&(i=Wu(o)):i=Wu(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==fu(e))&&t}(a,n,o)?$u(a):Ld(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=fu(a),t=o&&vu(o)?fu(o):o;let n=e,r=ju(n);for(;r&&o&&t!==n;){const e=Wu(r),t=r.getBoundingClientRect(),o=Ru(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=fu(r),r=ju(n)}}return au({width:d,height:u,x:l,y:c})}function qu(e,t){const n=Pu(e).scrollLeft;return t?t.left+n:Yu(mu(e)).left+n}function Hu(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qu(e,n),y:n.top+t.scrollTop}}const Uu=new Set(["absolute","fixed"]);function Ku(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=fu(e),o=mu(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=Mu();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=qu(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=mu(e),n=Pu(e),o=e.ownerDocument.body,r=Fd(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Fd(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+qu(e);const s=-n.scrollTop;return"rtl"===Ru(o).direction&&(i+=Fd(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:s}}(mu(e));else if(vu(t))o=function(e,t){const n=Yu(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=gu(e)?Wu(e):Ld(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=$u(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return au(o)}function Vu(e,t){const n=Au(e);return!(n===t||!vu(n)||Tu(n))&&("fixed"===Ru(n).position||Vu(n,t))}function Gu(e,t,n){const o=gu(t),r=mu(t),a="fixed"===n,i=Yu(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Ld(0);function c(){l.x=qu(r)}if(o||!o&&!a)if(("body"!==pu(t)||xu(r))&&(s=Pu(t)),o){const e=Yu(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?Ld(0):Hu(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 Zu(e){return"static"===Ru(e).position}function Xu(e,t){if(!gu(e)||"fixed"===Ru(e).position)return null;if(t)return t(e);let n=e.offsetParent;return mu(e)===n&&(n=n.ownerDocument.body),n}function Qu(e,t){const n=fu(e);if(Cu(e))return n;if(!gu(e)){let t=Au(e);for(;t&&!Tu(t);){if(vu(t)&&!Zu(t))return t;t=Au(t)}return n}let o=Xu(e,t);for(;o&&ku(o)&&Zu(o);)o=Xu(o,t);return o&&Tu(o)&&Zu(o)&&!Su(o)?n:o||function(e){let t=Au(e);for(;gu(t)&&!Tu(t);){if(Su(t))return t;if(Cu(t))return null;t=Au(t)}return null}(e)||n}const Ju={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a="fixed"===r,i=mu(o),s=!!t&&Cu(t.floating);if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Ld(1);const d=Ld(0),u=gu(o);if((u||!u&&!a)&&(("body"!==pu(o)||xu(i))&&(l=Pu(o)),gu(o))){const e=Yu(o);c=Wu(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const p=!i||u||a?Ld(0):Hu(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:mu,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[..."clippingAncestors"===n?Cu(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Fu(e,[],!1).filter(e=>vu(e)&&"body"!==pu(e)),r=null;const a="fixed"===Ru(e).position;let i=a?Au(e):e;for(;vu(i)&&!Tu(i);){const t=Ru(i),n=Su(i);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&r&&Uu.has(r.position)||xu(i)&&!n&&Vu(e,i))?o=o.filter(e=>e!==i):r=t,i=Au(i)}return t.set(e,o),o}(t,this._c):[].concat(n),o],i=a[0],s=a.reduce((e,n)=>{const o=Ku(t,n,r);return e.top=Fd(o.top,e.top),e.right=Id(o.right,e.right),e.bottom=Id(o.bottom,e.bottom),e.left=Fd(o.left,e.left),e},Ku(t,i,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Qu,getElementRects:async function(e){const t=this.getOffsetParent||Qu,n=this.getDimensions,o=await n(e.floating);return{reference:Gu(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}=zu(e);return{width:t,height:n}},getScale:Wu,isElement:vu,isRTL:function(e){return"rtl"===Ru(e).direction}};function ep(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tp(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=Lu(e),d=r||a?[...c?Fu(c):[],...Fu(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=mu(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:-zd(u)+"px "+-zd(r.clientWidth-(d+p))+"px "+-zd(r.clientHeight-(u+f))+"px "+-zd(d)+"px",threshold:Fd(0,Id(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||ep(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?Yu(e):null;return l&&function t(){const o=Yu(e);h&&!ep(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 np=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=qd(n),s=Hd(n),l="y"===Gd(n),c=du.has(i)?-1:1,d=a&&l?-1:1,u=Yd(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}}}}},op=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}=Yd(e,t),c={x:n,y:o},d=await su(t,l),u=Gd(qd(r)),p=Ud(u);let f=c[p],m=c[u];if(a){const e="y"===p?"bottom":"right";f=$d(f+d["y"===p?"top":"left"],f,f-d[e])}if(i){const e="y"===u?"bottom":"right";m=$d(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}}}}}},rp=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}=Yd(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const g=qd(r),y=Gd(s),b=qd(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!h?[ou(s)]:function(e){const t=ou(e);return[Xd(e),t,Xd(t)]}(s)),k="none"!==m;!p&&k&&w.push(...nu(s,h,m,x));const N=[s,...w],C=await su(t,v),_=[];let D=(null==(o=a.flip)?void 0:o.overflows)||[];if(d&&_.push(C[g]),u){const e=function(e,t,n){void 0===n&&(n=!1);const o=Hd(e),r=Zd(e),a=Kd(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=ou(i)),[i,ou(i)]}(r,i,x);_.push(C[e[0]],C[e[1]])}if(D=[...D,{placement:r,overflows:_}],!_.every(e=>e<=0)){var E,S;const e=((null==(E=a.flip)?void 0:E.index)||0)+1,t=N[e];if(t){if(!("alignment"===u&&y!==Gd(t))||D.every(e=>Gd(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:D},reset:{placement:t}}}let n=null==(S=D.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 M;const e=null==(M=D.filter(e=>{if(k){const t=Gd(e.placement);return t===y||"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:M[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},ap=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}=Yd(e,t),d=await su(t,c),u=qd(r),p=Hd(r),f="y"===Gd(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 y=h-d.top-d.bottom,b=m-d.left-d.right,x=Id(h-d[v],y),w=Id(m-d[g],b),k=!t.middlewareData.shift;let N=x,C=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=b),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(N=y),k&&!p){const e=Fd(d.left,0),t=Fd(d.right,0),n=Fd(d.top,0),o=Fd(d.bottom,0);f?C=m-2*(0!==e||0!==t?e+t:Fd(d.left,d.right)):N=h-2*(0!==n||0!==o?n+o:Fd(d.top,d.bottom))}await l({...t,availableWidth:C,availableHeight:N});const _=await i.getDimensions(s.floating);return m!==_.width||h!==_.height?{reset:{rects:!0}}:{}}}},ip=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Yd(e,t);switch(o){case"referenceHidden":{const e=lu(await su(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cu(e)}}}case"escaped":{const e=lu(await su(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:cu(e)}}}default:return{}}}}},sp=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}=Yd(e,t)||{};if(null==c)return{};const u=ru(d),p={x:n,y:o},f=Zd(r),m=Kd(f),h=await i.getDimensions(c),v="y"===f,g=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",x=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 N=k?k[b]:0;N&&await(null==i.isElement?void 0:i.isElement(k))||(N=s.floating[b]||a.floating[m]);const C=x/2-w/2,_=N/2-h[m]/2-1,D=Id(u[g],_),E=Id(u[y],_),S=D,M=N-h[m]-E,O=N/2-h[m]/2+C,T=$d(S,O,M),R=!l.arrow&&null!=Hd(r)&&O!==T&&a.reference[m]/2-(O<S?D:E)-h[m]/2<0,P=R?O<S?O-S:O-M:0;return{[f]:p[f]+P,data:{[f]:T,centerOffset:O-T-P,...R&&{alignmentOffset:P}},reset:R}}}),lp=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}=Yd(e,t),d={x:n,y:o},u=Gd(r),p=Ud(u);let f=d[p],m=d[u];const h=Yd(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,y;const e="y"===p?"width":"height",t=du.has(qd(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==(y=i.offset)?void 0:y[u])||0)-(t?v.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[p]:f,[u]:m}}}},cp=(e,t,n)=>{const o=new Map,r={platform:Ju,...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}=iu(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:y,reset:b}=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],...y}},b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:d,y:u}=iu(c,p,l))),n=-1)}return{x:d,y:u,placement:p,strategy:r,middlewareData:f}})(e,t,{...r,platform:a})};var dp="undefined"!=typeof document?h:function(){};function up(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(!up(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)&&!up(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function pp(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fp(e,t){const n=pp(e);return Math.round(t*n)/n}function mp(t){const n=e.useRef(t);return dp(()=>{n.current=t}),n}function hp(t){void 0===t&&(t={});const{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=t,[u,p]=e.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[f,m]=e.useState(r);up(f,r)||m(r);const[h,v]=e.useState(null),[g,y]=e.useState(null),b=e.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),w=e.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),k=i||h,N=s||g,C=e.useRef(null),_=e.useRef(null),D=e.useRef(u),E=null!=c,S=mp(c),M=mp(a),O=mp(d),T=e.useCallback(()=>{if(!C.current||!_.current)return;const e={placement:n,strategy:o,middleware:f};M.current&&(e.platform=M.current),cp(C.current,_.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};R.current&&!up(D.current,t)&&(D.current=t,x.flushSync(()=>{p(t)}))})},[f,n,o,M,O]);dp(()=>{!1===d&&D.current.isPositioned&&(D.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const R=e.useRef(!1);dp(()=>(R.current=!0,()=>{R.current=!1}),[]),dp(()=>{if(k&&(C.current=k),N&&(_.current=N),k&&N){if(S.current)return S.current(k,N,T);T()}},[k,N,T,S,E]);const P=e.useMemo(()=>({reference:C,floating:_,setReference:b,setFloating:w}),[b,w]),A=e.useMemo(()=>({reference:k,floating:N}),[k,N]),I=e.useMemo(()=>{const e={position:o,left:0,top:0};if(!A.floating)return e;const t=fp(A.floating,u.x),n=fp(A.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...pp(A.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,l,A.floating,u.x,u.y]);return e.useMemo(()=>({...u,update:T,refs:P,elements:A,floatingStyles:I}),[u,T,P,A,I])}const vp=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?sp({element:n.current,padding:o}).fn(t):{}:n?sp({element:n,padding:o}).fn(t):{};var r}}),gp=(e,t)=>({...np(e),options:[e,t]}),yp=(e,t)=>({...op(e),options:[e,t]}),bp=(e,t)=>({...lp(e),options:[e,t]}),xp=(e,t)=>({...rp(e),options:[e,t]}),wp=(e,t)=>({...ap(e),options:[e,t]}),kp=(e,t)=>({...ip(e),options:[e,t]}),Np=(e,t)=>({...vp(e),options:[e,t]});var Cp=e.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...a}=e;return g(ao.svg,{...a,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g("polygon",{points:"0,0 30,0 15,10"})})});Cp.displayName="Arrow";var _p=Cp;var Dp="Popper",[Ep,Sp]=Un(Dp),[Mp,Op]=Ep(Dp),Tp=t=>{const{__scopePopper:n,children:o}=t,[r,a]=e.useState(null);return g(Mp,{scope:n,anchor:r,onAnchorChange:a,children:o})};Tp.displayName=Dp;var Rp="PopperAnchor",Pp=e.forwardRef((t,n)=>{const{__scopePopper:o,virtualRef:r,...a}=t,i=Op(Rp,o),s=e.useRef(null),l=C(n,s),c=e.useRef(null);return e.useEffect(()=>{const e=c.current;c.current=r?.current||s.current,e!==c.current&&i.onAnchorChange(c.current)}),r?null:g(ao.div,{...a,ref:l})});Pp.displayName=Rp;var Ap="PopperContent",[Ip,Fp]=Ep(Ap),jp=e.forwardRef((t,n)=>{const{__scopePopper:o,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:h,...v}=t,y=Op(Ap,o),[b,x]=e.useState(null),w=C(n,e=>x(e)),[k,N]=e.useState(null),_=function(t){const[n,o]=e.useState(void 0);return Gn(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let r,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=t.offsetWidth,a=t.offsetHeight;o({width:r,height:a})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}o(void 0)},[t]),n}(k),D=_?.width??0,E=_?.height??0,S=r+("center"!==i?"-"+i:""),M="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(d)?d:[d],T=O.length>0,R={padding:M,boundary:O.filter(Bp),altBoundary:T},{refs:P,floatingStyles:A,placement:I,isPositioned:F,middlewareData:j}=hp({strategy:"fixed",placement:S,whileElementsMounted:(...e)=>tp(...e,{animationFrame:"always"===m}),elements:{reference:y.anchor},middleware:[gp({mainAxis:a+E,alignmentAxis:s}),c&&yp({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?bp():void 0,...R}),c&&xp({...R}),wp({...R,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&&Np({element:k,padding:l}),$p({arrowWidth:D,arrowHeight:E}),f&&kp({strategy:"referenceHidden",...R})]}),[z,L]=Yp(I),W=io(h);Gn(()=>{F&&W?.()},[F,W]);const B=j.arrow?.x,$=j.arrow?.y,Y=0!==j.arrow?.centerOffset,[q,H]=e.useState();return Gn(()=>{b&&H(window.getComputedStyle(b).zIndex)},[b]),g("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:F?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g(Ip,{scope:o,placedSide:z,onArrowChange:N,arrowX:B,arrowY:$,shouldHideArrow:Y,children:g(ao.div,{"data-side":z,"data-align":L,...v,ref:w,style:{...v.style,animation:F?void 0:"none"}})})})});jp.displayName=Ap;var zp="PopperArrow",Lp={top:"bottom",right:"left",bottom:"top",left:"right"},Wp=e.forwardRef(function(e,t){const{__scopePopper:n,...o}=e,r=Fp(zp,n),a=Lp[r.placedSide];return g("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:g(_p,{...o,ref:t,style:{...o.style,display:"block"}})})});function Bp(e){return null!==e}Wp.displayName=zp;var $p=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]=Yp(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 Yp(e){const[t,n="center"]=e.split("-");return[t,n]}var qp=Tp,Hp=Pp,Up=jp,Kp=Wp,Vp="Popover",[Gp]=Un(Vp,[Sp]),Zp=Sp(),[Xp,Qp]=Gp(Vp),Jp=t=>{const{__scopePopover:n,children:o,open:r,defaultOpen:a,onOpenChange:i,modal:s=!1}=t,l=Zp(n),c=e.useRef(null),[d,u]=e.useState(!1),[p,f]=eo({prop:r,defaultProp:a??!1,onChange:i,caller:Vp});return g(qp,{...l,children:g(Xp,{scope:n,contentId:Qn(),triggerRef:c,open:p,onOpenChange:f,onOpenToggle:e.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:d,onCustomAnchorAdd:e.useCallback(()=>u(!0),[]),onCustomAnchorRemove:e.useCallback(()=>u(!1),[]),modal:s,children:o})})};Jp.displayName=Vp;var ef="PopoverAnchor";e.forwardRef((t,n)=>{const{__scopePopover:o,...r}=t,a=Qp(ef,o),i=Zp(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=a;return e.useEffect(()=>(s(),()=>l()),[s,l]),g(Hp,{...i,...r,ref:n})}).displayName=ef;var tf="PopoverTrigger",nf=e.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Qp(tf,n),a=Zp(n),i=C(t,r.triggerRef),s=g(ao.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":hf(r.open),...o,ref:i,onClick:Vn(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?s:g(Hp,{asChild:!0,...a,children:s})});nf.displayName=tf;var of="PopoverPortal",[rf,af]=Gp(of,{forceMount:void 0}),sf=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,a=Qp(of,t);return g(rf,{scope:t,forceMount:n,children:g(Eo,{present:n||a.open,children:g(Do,{asChild:!0,container:r,children:o})})})};sf.displayName=of;var lf="PopoverContent",cf=e.forwardRef((e,t)=>{const n=af(lf,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,a=Qp(lf,e.__scopePopover);return g(Eo,{present:o||a.open,children:a.modal?g(uf,{...r,ref:t}):g(pf,{...r,ref:t})})});cf.displayName=lf;var df=to("PopoverContent.RemoveScroll"),uf=e.forwardRef((t,n)=>{const o=Qp(lf,t.__scopePopover),r=e.useRef(null),a=C(n,r),i=e.useRef(!1);return e.useEffect(()=>{const e=r.current;if(e)return Nr(e)},[]),g(vr,{as:df,allowPinchZoom:!0,children:g(ff,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Vn(t.onCloseAutoFocus,e=>{e.preventDefault(),i.current||o.triggerRef.current?.focus()}),onPointerDownOutside:Vn(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;i.current=o},{checkForDefaultPrevented:!1}),onFocusOutside:Vn(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),pf=e.forwardRef((t,n)=>{const o=Qp(lf,t.__scopePopover),r=e.useRef(!1),a=e.useRef(!1);return g(ff,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(r.current||o.triggerRef.current?.focus(),e.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(r.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,i=o.triggerRef.current?.contains(n);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),ff=e.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...u}=e,p=Qp(lf,n),f=Zp(n);return Oo(),g(bo,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:g(fo,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:g(Up,{"data-state":hf(p.open),role:"dialog",id:p.contentId,...f,...u,ref:t,style:{...u.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)"}})})})}),mf="PopoverClose";e.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Qp(mf,n);return g(ao.button,{type:"button",...o,ref:t,onClick:Vn(e.onClick,()=>r.onOpenChange(!1))})}).displayName=mf;function hf(e){return e?"open":"closed"}e.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Zp(n);return g(Kp,{...r,...o,ref:t})}).displayName="PopoverArrow";var vf=sf,gf=cf;const yf=Jp,bf=nf,xf=e.forwardRef(({className:e,align:t="center",sideOffset:n=4,...o},r)=>g(vf,{children:g(gf,{ref:r,align:t,sideOffset:n,"data-slot":"popover-content",className:Qe("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),...o})}));function wf({items:t,value:n,onChange:o,placeholder:r="Select an option...",emptyMessage:a="No items found.",className:i,searchPlaceholder:s="Search...",onSearchChange:l,filterLocally:c=!0,loading:d=!1,displayLabel:u,disabled:p=!1}){const[f,m]=e.useState(!1),[h,v]=e.useState(""),[b,x]=e.useState(null);e.useEffect(()=>{if(!n||""===n)return void x(null);const e=t?.find(e=>String(e.value)===String(n));e&&x(e)},[n,t]);const w=c&&h?t?.filter(e=>e.label.toLowerCase().includes(h.toLowerCase())):t,k=u??b?.label??r;return y(yf,{open:f,onOpenChange:m,children:[g(bf,{asChild:!0,children:y("button",{type:"button","data-cy":"combobox-trigger",disabled:p,"aria-expanded":f,className:Qe(nt,"justify-between truncate",!u&&!b&&ot,i),children:[g("span",{className:"truncate",children:k}),g(_i,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}),g(xf,{className:"max-w-[700px] p-0 w-full min-w-(--radix-popover-trigger-width)",children:y(_d,{shouldFilter:!1,children:[g(Ed,{"data-cy":"combobox-input",placeholder:s,value:h,onValueChange:e=>{v(e),l?.(e)},className:"h-9 focus:ring-0 focus:outline-none focus-visible:ring-0 focus-visible:ring-offset-0"}),y(Sd,{"data-cy":"combobox-list",children:[g(Md,{children:d?"Loading...":a}),g(Od,{children:w?.map(e=>y(Rd,{value:String(e?.value??""),onSelect:t=>((e,t)=>{const r=e===n?null:t;o(r?.value??"",r),m(!1),v(""),x(r)})(t,e),className:Qe("cursor-pointer",rt),children:[e.label,g(xi,{className:Qe("ml-auto size-4",String(n)===String(e.value)?"opacity-100":"opacity-0")})]},e?.value))})]})]})})]})}xf.displayName=gf.displayName;const kf={},Nf=({id:e,fetcher:t,resolveValue:n,modelClass:r,labelName:a,valueField:l="pk",placeholder:c="Select item...",emptyMessage:u="No items found",value:p,onChange:f,additionalFilters:m=kf,fields:h,className:v,debounceWait:y=300})=>{const b=o(()=>m??kf,[m]),[x,w]=d([]),[k,N]=d(""),[C,_]=d(""),[D,E]=d(!1),[S,M]=d();i(()=>{const e=setTimeout(()=>{_(k)},y);return()=>clearTimeout(e)},[k,y]);const O=s(async()=>{E(!0);try{const e=await t({search:C,modelClass:r,labelName:a,additionalFilters:b,fields:h});w(((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,a,l))}catch(e){console.error("FKSelect fetch error:",e),w([])}finally{E(!1)}},[t,C,r,a,b,h,l]);i(()=>{O()},[O]);const T=x.find(e=>String(e.value)===String(p))?.label;i(()=>{if(!p)return void M(void 0);if(T)return void M(T);if(!n)return void M(void 0);let e=!0;return n({modelClass:r,value:p}).then(t=>{if(!e||!t)return;const n=String(t[a]??t.name??p);M(n)}).catch(e=>{console.error("FKSelect resolve error:",e)}),()=>{e=!1}},[p,T,n,r,a]);return g("div",{"data-testid":e,className:Qe("flex w-full min-w-0",v),children:g(wf,{items:x,placeholder:c,emptyMessage:u,value:p?String(p):null,onChange:(e,t)=>{t&&f(e,t)},onSearchChange:N,filterLocally:!1,loading:D,displayLabel:S,className:"w-full"})})};function Cf(e,[t,n]){return Math.min(n,Math.max(t,e))}function _f(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>n.current?.(...e),[])}var Df,Ef="dismissableLayer.update",Sf="dismissableLayer.pointerDownOutside",Mf="dismissableLayer.focusOutside",Of=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Tf=e.forwardRef((t,n)=>{const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=t,u=e.useContext(Of),[p,f]=e.useState(null),m=p?.ownerDocument??globalThis?.document,[,h]=e.useState({}),v=tl(n,e=>f(e)),y=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(b),w=p?y.indexOf(p):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,N=w>=x,C=e.useRef(!1),_=function(t,n){const{ownerDocument:o=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i}=n,s=_f(t),l=e.useRef(!1),c=e.useRef(!1),d=e.useRef(new Map),u=e.useRef(()=>{});return e.useEffect(()=>{function e(){c.current=!1,a.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function n(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=n=>{if(n.target&&!l.current){let i=function(){o.removeEventListener("click",u.current);const n=t();e(),n||Pf(Sf,s,l,{discrete:!0})};const l={originalEvent:n};c.current=!0,a.current=r&&0===n.button,d.current.clear(),r&&0===n.button?(o.removeEventListener("click",u.current),u.current=i,o.addEventListener("click",u.current,{once:!0})):i()}else o.removeEventListener("click",u.current),e();l.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const e of m)o.addEventListener(e,n,!0),o.addEventListener(e,p);const h=window.setTimeout(()=>{o.addEventListener("pointerdown",f)},0);return()=>{window.clearTimeout(h),o.removeEventListener("pointerdown",f),o.removeEventListener("click",u.current);for(const e of m)o.removeEventListener(e,n,!0),o.removeEventListener(e,p)}},[o,s,r,a,i]),{onPointerDownCapture:()=>l.current=!0}}(e=>{const t=e.target;if(!(t instanceof Node))return;const n=[...u.branches].some(e=>e.contains(t));N&&!n&&(i?.(e),l?.(e),e.defaultPrevented||c?.())},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces}),D=function(t,n=globalThis?.document){const o=_f(t),r=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!r.current){Pf(Mf,o,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,o]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(r&&C.current)return;const t=e.target;[...u.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},m);return function(t,n=globalThis?.document){const o=_f(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&o(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[o,n])}(e=>{w===u.layers.size-1&&(a?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},m),e.useEffect(()=>{if(p)return o&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Df=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Rf(),()=>{o&&(u.layersWithOutsidePointerEventsDisabled.delete(p),0===u.layersWithOutsidePointerEventsDisabled.size&&(m.body.style.pointerEvents=Df))}},[p,m,o,u]),e.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Rf())},[p,u]),e.useEffect(()=>{const e=()=>h({});return document.addEventListener(Ef,e),()=>document.removeEventListener(Ef,e)},[]),g(hl.div,{...d,ref:v,style:{pointerEvents:k?N?"auto":"none":void 0,...t.style},onFocusCapture:ul(t.onFocusCapture,D.onFocusCapture),onBlurCapture:ul(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:ul(t.onPointerDownCapture,_.onPointerDownCapture)})});Tf.displayName="DismissableLayer";function Rf(){const e=new CustomEvent(Ef);document.dispatchEvent(e)}function Pf(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?vl(r,a):r.dispatchEvent(a)}e.forwardRef((t,n)=>{const o=e.useContext(Of),r=e.useRef(null),a=tl(n,r);return e.useEffect(()=>{const e=r.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),g(hl.div,{...t,ref:a})}).displayName="DismissableLayerBranch";var Af=0,If=null;function Ff(){e.useEffect(()=>{If||(If={start:jf(),end:jf()});const{start:e,end:t}=If;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Af++,()=>{1===Af&&(If?.start.remove(),If?.end.remove(),If=null),Af=Math.max(0,Af-1)}},[])}function jf(){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 zf="focusScope.autoFocusOnMount",Lf="focusScope.autoFocusOnUnmount",Wf={bubbles:!1,cancelable:!0},Bf=e.forwardRef((t,n)=>{const{loop:o=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=t,[l,c]=e.useState(null),d=_f(a),u=_f(i),p=e.useRef(null),f=tl(n,e=>c(e)),m=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(r){let e=function(e){if(m.paused||!l)return;const t=e.target;l.contains(t)?p.current=t:Hf(p.current,{select:!0})},t=function(e){if(m.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Hf(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Hf(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return l&&o.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[r,l,m.paused]),e.useEffect(()=>{if(l){Uf.add(m);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(zf,Wf);l.addEventListener(zf,d),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Hf(o,{select:t}),document.activeElement!==n)return}((e=$f(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Hf(l))}return()=>{l.removeEventListener(zf,d),setTimeout(()=>{const e=new CustomEvent(Lf,Wf);l.addEventListener(Lf,u),l.dispatchEvent(e),e.defaultPrevented||Hf(t??document.body,{select:!0}),l.removeEventListener(Lf,u),Uf.remove(m)},0)}}var e},[l,d,u,m]);const h=e.useCallback(e=>{if(!o&&!r)return;if(m.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=$f(e),n=Yf(t,e),o=Yf(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&Hf(a,{select:!0})):(e.preventDefault(),o&&Hf(r,{select:!0})):n===t&&e.preventDefault()}},[o,r,m.paused]);return g(hl.div,{tabIndex:-1,...s,ref:f,onKeyDown:h})});function $f(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 Yf(e,t){for(const n of e)if(!qf(n,{upTo:t}))return n}function qf(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 Hf(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()}}Bf.displayName="FocusScope";var Uf=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Kf(e,t),e.unshift(t)},remove(t){e=Kf(e,t),e[0]?.resume()}}}();function Kf(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var Vf=e.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...a}=e;return g(hl.svg,{...a,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g("polygon",{points:"0,0 30,0 15,10"})})});Vf.displayName="Arrow";var Gf=Vf;function Zf(t){const[n,o]=e.useState(void 0);return pl(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let r,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=t.offsetWidth,a=t.offsetHeight;o({width:r,height:a})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}o(void 0)},[t]),n}var Xf="Popper",[Qf,Jf]=Xs(Xf),[em,tm]=Qf(Xf),nm=t=>{const{__scopePopper:n,children:o}=t,[r,a]=e.useState(null),[i,s]=e.useState(void 0);return g(em,{scope:n,anchor:r,onAnchorChange:a,placementState:i,setPlacementState:s,children:o})};nm.displayName=Xf;var om="PopperAnchor",rm=e.forwardRef((t,n)=>{const{__scopePopper:o,virtualRef:r,...a}=t,i=tm(om,o),s=e.useRef(null),l=i.onAnchorChange,c=tl(n,e.useCallback(e=>{s.current=e,e&&l(e)},[l])),d=e.useRef(null);e.useEffect(()=>{if(!r)return;const e=d.current;d.current=r.current,e!==d.current&&l(d.current)});const u=i.placementState&&mm(i.placementState),p=u?.[0],f=u?.[1];return r?null:g(hl.div,{"data-radix-popper-side":p,"data-radix-popper-align":f,...a,ref:c})});rm.displayName=om;var am="PopperContent",[im,sm]=Qf(am),lm=e.forwardRef((t,n)=>{const{__scopePopper:o,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:h,...v}=t,y=tm(am,o),[b,x]=e.useState(null),w=tl(n,e=>x(e)),[k,N]=e.useState(null),C=Zf(k),_=C?.width??0,D=C?.height??0,E=r+("center"!==i?"-"+i:""),S="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},M=Array.isArray(d)?d:[d],O=M.length>0,T={padding:S,boundary:M.filter(pm),altBoundary:O},{refs:R,floatingStyles:P,placement:A,isPositioned:I,middlewareData:F}=hp({strategy:"fixed",placement:E,whileElementsMounted:(...e)=>tp(...e,{animationFrame:"always"===m}),elements:{reference:y.anchor},middleware:[gp({mainAxis:a+D,alignmentAxis:s}),c&&yp({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?bp():void 0,...T}),c&&xp({...T}),wp({...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`)}}),k&&Np({element:k,padding:l}),fm({arrowWidth:_,arrowHeight:D}),f&&kp({strategy:"referenceHidden",...T,boundary:O?T.boundary:void 0})]}),j=y.setPlacementState;pl(()=>(j(A),()=>{j(void 0)}),[A,j]);const[z,L]=mm(A),W=_f(h);pl(()=>{I&&W?.()},[I,W]);const B=F.arrow?.x,$=F.arrow?.y,Y=0!==F.arrow?.centerOffset,[q,H]=e.useState();return pl(()=>{b&&H(window.getComputedStyle(b).zIndex)},[b]),g("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:I?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g(im,{scope:o,placedSide:z,placedAlign:L,onArrowChange:N,arrowX:B,arrowY:$,shouldHideArrow:Y,children:g(hl.div,{"data-side":z,"data-align":L,...v,ref:w,style:{...v.style,animation:I?void 0:"none"}})})})});lm.displayName=am;var cm="PopperArrow",dm={top:"bottom",right:"left",bottom:"top",left:"right"},um=e.forwardRef(function(e,t){const{__scopePopper:n,...o}=e,r=sm(cm,n),a=dm[r.placedSide];return g("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:g(Gf,{...o,ref:t,style:{...o.style,display:"block"}})})});function pm(e){return null!==e}um.displayName=cm;var fm=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]=mm(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 mm(e){const[t,n="center"]=e.split("-");return[t,n]}var hm=nm,vm=rm,gm=lm,ym=um,bm=e.forwardRef((t,n)=>{const{container:o,...r}=t,[a,i]=e.useState(!1);pl(()=>i(!0),[]);const s=o||a&&globalThis?.document?.body;return s?x.createPortal(g(hl.div,{...r,ref:n}),s):null});function xm(t){const n=e.useRef({value:t,previous:t});return e.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}bm.displayName="Portal";var wm=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"}),km=e.forwardRef((e,t)=>g(hl.span,{...e,ref:t,style:{...wm,...e.style}}));km.displayName="VisuallyHidden";var Nm=km,Cm=[" ","Enter","ArrowUp","ArrowDown"],_m=[" ","Enter"],Dm="Select",[Em,Sm,Mm]=dl(Dm),[Om]=Xs(Dm,[Mm,Jf]),Tm=Jf(),[Rm,Pm]=Om(Dm),[Am,Im]=Om(Dm);function Fm(t){const{__scopeSelect:n,children:o,open:r,defaultOpen:a,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:f,required:m,form:h,internal_do_not_use_render:v}=t,y=Tm(n),[b,x]=e.useState(null),[w,k]=e.useState(null),[N,C]=e.useState(!1),_=Ll(d),[D,E]=ml({prop:r,defaultProp:a??!1,onChange:i,caller:Dm}),[S,M]=ml({prop:s,defaultProp:l,onChange:c,caller:Dm}),O=e.useRef(null),T=!b||(!!h||!!b.closest("form")),[R,P]=e.useState(new Set),A=kl(),I=Array.from(R).map(e=>e.props.value).join(";"),F=e.useCallback(e=>{P(t=>new Set(t).add(e))},[]),j=e.useCallback(e=>{P(t=>{const n=new Set(t);return n.delete(e),n})},[]),z={required:m,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:k,valueNodeHasChildren:N,onValueNodeHasChildrenChange:C,contentId:A,value:S,onValueChange:M,open:D,onOpenChange:E,dir:_,triggerPointerDownPosRef:O,disabled:f,name:u,autoComplete:p,form:h,nativeOptions:R,nativeSelectKey:I,isFormControl:T};return g(hm,{...y,children:g(Rm,{scope:n,...z,children:g(Em.Provider,{scope:n,children:g(Am,{scope:n,onNativeOptionAdd:F,onNativeOptionRemove:j,children:Oh(v)?v(z):o})})})})}Fm.displayName="SelectProvider";var jm=e=>{const{__scopeSelect:t,children:n,...o}=e;return g(Fm,{__scopeSelect:t,...o,internal_do_not_use_render:({isFormControl:e})=>y(b,{children:[n,e?g(Mh,{__scopeSelect:t}):null]})})};jm.displayName=Dm;var zm="SelectTrigger",Lm=e.forwardRef((t,n)=>{const{__scopeSelect:o,disabled:r=!1,...a}=t,i=Tm(o),s=Pm(zm,o),l=s.disabled||r,c=tl(n,s.onTriggerChange),d=Sm(o),u=e.useRef("touch"),[p,f,m]=Rh(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),o=Ph(t,e,n);void 0!==o&&s.onValueChange(o.value)}),h=e=>{l||(s.onOpenChange(!0),m()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return g(vm,{asChild:!0,...i,children:g(hl.button,{type:"button",role:"combobox","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Th(s.value)?"":void 0,...a,ref:c,onClick:ul(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==u.current&&h(e)}),onPointerDown:ul(a.onPointerDown,e=>{u.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(h(e),e.preventDefault())}),onKeyDown:ul(a.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),t&&" "===e.key||Cm.includes(e.key)&&(h(),e.preventDefault())})})})});Lm.displayName=zm;var Wm="SelectValue",Bm=e.forwardRef((t,n)=>{const{__scopeSelect:o,className:r,style:a,children:i,placeholder:s="",...l}=t,c=Pm(Wm,o),{onValueNodeHasChildrenChange:d}=c,u=void 0!==i,p=tl(n,c.onValueNodeChange);pl(()=>{d(u)},[d,u]);const f=Th(c.value);return g(hl.span,{...l,asChild:!f&&l.asChild,ref:p,style:{pointerEvents:"none"},children:g(e.Fragment,{children:f?s:i},f?"placeholder":"value")})});Bm.displayName=Wm;var $m=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return g(hl.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});$m.displayName="SelectIcon";var Ym="SelectPortal",[qm,Hm]=Om(Ym,{forceMount:void 0}),Um=e=>{const{__scopeSelect:t,forceMount:n,...o}=e;return g(qm,{scope:e.__scopeSelect,forceMount:n,children:g(bm,{asChild:!0,...o})})};Um.displayName=Ym;var Km="SelectContent",Vm=e.forwardRef((t,n)=>{const o=Hm(Km,t.__scopeSelect),{forceMount:r=o.forceMount,...a}=t,i=Pm(Km,t.__scopeSelect),[s,l]=e.useState();return pl(()=>{l(new DocumentFragment)},[]),g(gl,{present:r||i.open,children:({present:e})=>e?g(eh,{...a,ref:n}):g(Gm,{...a,fragment:s})})});Vm.displayName=Km;var Gm=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,fragment:r}=e;return r?x.createPortal(g(Xm,{scope:n,children:g(Em.Slot,{scope:n,children:g("div",{ref:t,children:o})})}),r):null});Gm.displayName="SelectContentFragment";var Zm=10,[Xm,Qm]=Om(Km),Jm=nl("SelectContent.RemoveScroll"),eh=e.forwardRef((t,n)=>{const{__scopeSelect:o}=t,{position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:f,collisionPadding:m,sticky:h,hideWhenDetached:v,avoidCollisions:y,...b}=t,x=Pm(Km,o),[w,k]=e.useState(null),[N,C]=e.useState(null),_=tl(n,e=>k(e)),[D,E]=e.useState(null),[S,M]=e.useState(null),O=Sm(o),[T,R]=e.useState(!1),P=e.useRef(!1);e.useEffect(()=>{if(w)return Nr(w)},[w]),Ff();const A=e.useCallback(e=>{const[t,...n]=O().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&&N&&(N.scrollTop=0),n===o&&N&&(N.scrollTop=N.scrollHeight),n?.focus(),document.activeElement!==r)return}},[O,N]),I=e.useCallback(()=>A([D,w]),[A,D,w]);e.useEffect(()=>{T&&I()},[T,I]);const{onOpenChange:F,triggerPointerDownPosRef:j}=x;e.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(j.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(j.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(w)||F(!1),document.removeEventListener("pointermove",t),j.current=null};return null!==j.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,F,j]),e.useEffect(()=>{const e=()=>F(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[F]);const[z,L]=Rh(e=>{const t=O().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=Ph(t,e,n);o&&setTimeout(()=>o.ref.current?.focus())}),W=e.useCallback((e,t,n)=>{const o=!P.current&&!n;(void 0!==x.value&&x.value===t||o)&&(E(e),o&&(P.current=!0))},[x.value]),B=e.useCallback(()=>w?.focus(),[w]),$=e.useCallback((e,t,n)=>{const o=!P.current&&!n;(void 0!==x.value&&x.value===t||o)&&M(e)},[x.value]),Y="popper"===r?nh:th,q=Y===nh?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:f,collisionPadding:m,sticky:h,hideWhenDetached:v,avoidCollisions:y}:{};return g(Xm,{scope:o,content:w,viewport:N,onViewportChange:C,itemRefCallback:W,selectedItem:D,onItemLeave:B,itemTextRefCallback:$,focusSelectedItem:I,selectedItemText:S,position:r,isPositioned:T,searchRef:z,children:g(vr,{as:Jm,allowPinchZoom:!0,children:g(Bf,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ul(a,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:g(Tf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:g(Y,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...q,onPlaced:()=>R(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ul(b.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=O().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(()=>A(t)),e.preventDefault()}})})})})})})});eh.displayName="SelectContentImpl";var th=e.forwardRef((t,n)=>{const{__scopeSelect:o,onPlaced:r,...a}=t,i=Pm(Km,o),s=Qm(Km,o),[l,c]=e.useState(null),[d,u]=e.useState(null),p=tl(n,e=>u(e)),f=Sm(o),m=e.useRef(!1),h=e.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,w=e.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&v&&y&&b){const e=i.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==i.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,c=Math.max(s,t.width),d=window.innerWidth-Zm,u=Cf(a,[Zm,Math.max(Zm,d-c)]);l.style.minWidth=s+"px",l.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,c=Math.max(s,t.width),d=window.innerWidth-Zm,u=Cf(a,[Zm,Math.max(Zm,d-c)]);l.style.minWidth=s+"px",l.style.right=u+"px"}const a=f(),s=window.innerHeight-2*Zm,c=v.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),h=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=p+h+c+parseInt(u.paddingBottom,10)+g,w=Math.min(5*y.offsetHeight,x),k=window.getComputedStyle(v),N=parseInt(k.paddingTop,10),C=parseInt(k.paddingBottom,10),_=e.top+e.height/2-Zm,D=s-_,E=y.offsetHeight/2,S=p+h+(y.offsetTop+E),M=x-S;if(S<=_){const e=a.length>0&&y===a[a.length-1].ref.current;l.style.bottom="0px";const t=d.clientHeight-v.offsetTop-v.offsetHeight,n=S+Math.max(D,E+(e?C:0)+t+g);l.style.height=n+"px"}else{const e=a.length>0&&y===a[0].ref.current;l.style.top="0px";const t=Math.max(_,p+v.offsetTop+(e?N:0)+E)+M;l.style.height=t+"px",v.scrollTop=S-_+v.offsetTop}l.style.margin=`${Zm}px 0`,l.style.minHeight=w+"px",l.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[f,i.trigger,i.valueNode,l,d,v,y,b,i.dir,r]);pl(()=>w(),[w]);const[k,N]=e.useState();pl(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const C=e.useCallback(e=>{e&&!0===h.current&&(w(),x?.(),h.current=!1)},[w,x]);return g(oh,{scope:o,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:g("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:g(hl.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});th.displayName="SelectItemAlignedPosition";var nh=e.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Zm,...a}=e,i=Tm(n);return g(gm,{...i,...a,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...a.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)"}})});nh.displayName="SelectPopperPosition";var[oh,rh]=Om(Km,{}),ah="SelectViewport",ih=e.forwardRef((t,n)=>{const{__scopeSelect:o,nonce:r,...a}=t,i=Qm(ah,o),s=rh(ah,o),l=tl(n,i.onViewportChange),c=e.useRef(0);return y(b,{children:[g("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:r}),g(Em.Slot,{scope:o,children:g(hl.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ul(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=s;if(o?.current&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*Zm,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")}}}c.current=t.scrollTop})})})]})});ih.displayName=ah;var sh="SelectGroup",[lh,ch]=Om(sh),dh=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=kl();return g(lh,{scope:n,id:r,children:g(hl.div,{role:"group","aria-labelledby":r,...o,ref:t})})});dh.displayName=sh;var uh="SelectLabel",ph=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ch(uh,n);return g(hl.div,{id:r.id,...o,ref:t})});ph.displayName=uh;var fh="SelectItem",[mh,hh]=Om(fh),vh=e.forwardRef((t,n)=>{const{__scopeSelect:o,value:r,disabled:a=!1,textValue:i,...s}=t,l=Pm(fh,o),c=Qm(fh,o),d=l.value===r,[u,p]=e.useState(i??""),[f,m]=e.useState(!1),h=tl(n,e=>c.itemRefCallback?.(e,r,a)),v=kl(),y=e.useRef("touch"),b=()=>{a||(l.onValueChange(r),l.onOpenChange(!1))};return g(mh,{scope:o,value:r,disabled:a,textId:v,isSelected:d,onItemTextChange:e.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:g(Em.ItemSlot,{scope:o,value:r,disabled:a,textValue:u,children:g(hl.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:h,onFocus:ul(s.onFocus,()=>m(!0)),onBlur:ul(s.onBlur,()=>m(!1)),onClick:ul(s.onClick,()=>{"mouse"!==y.current&&b()}),onPointerUp:ul(s.onPointerUp,()=>{"mouse"===y.current&&b()}),onPointerDown:ul(s.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:ul(s.onPointerMove,e=>{y.current=e.pointerType,a?c.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ul(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:ul(s.onKeyDown,e=>{""!==c.searchRef?.current&&" "===e.key||(_m.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});vh.displayName=fh;var gh="SelectItemText",yh=e.forwardRef((t,n)=>{const{__scopeSelect:o,className:r,style:a,...i}=t,s=Pm(gh,o),l=Qm(gh,o),c=hh(gh,o),d=Im(gh,o),[u,p]=e.useState(null),f=tl(n,e=>p(e),c.onItemTextChange,e=>l.itemTextRefCallback?.(e,c.value,c.disabled)),m=u?.textContent,h=e.useMemo(()=>g("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=d;return pl(()=>(v(h),()=>w(h)),[v,w,h]),y(b,{children:[g(hl.span,{id:c.textId,...i,ref:f}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!Th(s.value)?x.createPortal(i.children,s.valueNode):null]})});yh.displayName=gh;var bh="SelectItemIndicator",xh=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return hh(bh,n).isSelected?g(hl.span,{"aria-hidden":!0,...o,ref:t}):null});xh.displayName=bh;var wh="SelectScrollUpButton",kh=e.forwardRef((t,n)=>{const o=Qm(wh,t.__scopeSelect),r=rh(wh,t.__scopeSelect),[a,i]=e.useState(!1),s=tl(n,r.onScrollButtonChange);return pl(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?g(_h,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});kh.displayName=wh;var Nh="SelectScrollDownButton",Ch=e.forwardRef((t,n)=>{const o=Qm(Nh,t.__scopeSelect),r=rh(Nh,t.__scopeSelect),[a,i]=e.useState(!1),s=tl(n,r.onScrollButtonChange);return pl(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;i(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?g(_h,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Ch.displayName=Nh;var _h=e.forwardRef((t,n)=>{const{__scopeSelect:o,onAutoScroll:r,...a}=t,i=Qm("SelectScrollButton",o),s=e.useRef(null),l=Sm(o),c=e.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return e.useEffect(()=>()=>c(),[c]),pl(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),g(hl.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:ul(a.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(r,50))}),onPointerMove:ul(a.onPointerMove,()=>{i.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(r,50))}),onPointerLeave:ul(a.onPointerLeave,()=>{c()})})}),Dh=e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return g(hl.div,{"aria-hidden":!0,...o,ref:t})});Dh.displayName="SelectSeparator";var Eh="SelectArrow";e.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Tm(n);return"popper"===Qm(Eh,n).position?g(ym,{...r,...o,ref:t}):null}).displayName=Eh;var Sh="SelectBubbleInput",Mh=e.forwardRef(({__scopeSelect:t,...n},o)=>{const r=Pm(Sh,t),{value:a,onValueChange:i,required:s,disabled:l,name:c,autoComplete:d,form:u}=r,{nativeOptions:p,nativeSelectKey:f}=r,m=e.useRef(null),h=tl(o,m),v=a??"",b=xm(v),x=Array.from(p).some(e=>""===(e.props.value??""));return e.useEffect(()=>{const e=m.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(b!==v&&n){const t=new Event("change",{bubbles:!0});n.call(e,v),e.dispatchEvent(t)}},[b,v]),y(hl.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:c,autoComplete:d,disabled:l,form:u,onChange:e=>i(e.target.value),...n,style:{...wm,...n.style},ref:h,defaultValue:v,children:[Th(a)&&!x?g("option",{value:""}):null,Array.from(p)]},f)});function Oh(e){return"function"==typeof e}function Th(e){return""===e||void 0===e}function Rh(t){const n=_f(t),o=e.useRef(""),r=e.useRef(0),a=e.useCallback(e=>{const t=o.current+e;n(t),function e(t){o.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),i=e.useCallback(()=>{o.current="",window.clearTimeout(r.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(r.current),[]),[o,a,i]}function Ph(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}Mh.displayName=Sh;const Ah=jm,Ih=dh,Fh=Bm,jh=e.forwardRef(({className:e,children:t,...n},o)=>y(Lm,{ref:o,"data-slot":"select-trigger",className:Qe(nt,"justify-between whitespace-nowrap data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1",e),...n,children:[t,g($m,{asChild:!0,children:g(wi,{className:"h-4 w-4 opacity-50"})})]}));jh.displayName=Lm.displayName;const zh=e.forwardRef(({className:e,...t},n)=>g(kh,{ref:n,"data-slot":"select-scroll-up-button",className:Qe("flex cursor-default items-center justify-center py-1",e),...t,children:g(Ci,{className:"h-4 w-4"})}));zh.displayName=kh.displayName;const Lh=e.forwardRef(({className:e,...t},n)=>g(Ch,{ref:n,"data-slot":"select-scroll-down-button",className:Qe("flex cursor-default items-center justify-center py-1",e),...t,children:g(wi,{className:"h-4 w-4"})}));Lh.displayName=Ch.displayName;const Wh=e.forwardRef(({className:e,children:t,position:n="popper",...o},r)=>g(Um,{children:y(Vm,{ref:r,"data-slot":"select-content",className:Qe("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"===n&&"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:n,...o,children:[g(zh,{}),g(ih,{className:Qe("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g(Lh,{})]})}));Wh.displayName=Vm.displayName;const Bh=e.forwardRef(({className:e,...t},n)=>g(ph,{ref:n,"data-slot":"select-label",className:Qe("px-2 py-1.5 text-sm font-semibold",e),...t}));Bh.displayName=ph.displayName;const $h=e.forwardRef(({className:e,children:t,...n},o)=>y(vh,{ref:o,"data-slot":"select-item",className:Qe("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),...n,children:[g("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:g(xh,{children:g(xi,{className:"h-4 w-4"})})}),g(yh,{children:t})]}));$h.displayName=vh.displayName;const Yh=e.forwardRef(({className:e,...t},n)=>g(Dh,{ref:n,"data-slot":"select-separator",className:Qe("-mx-1 my-1 h-px bg-muted",e),...t}));Yh.displayName=Dh.displayName;const qh=({id:e,placeholder:t,options:n,className:o,value:r,onValueChange:a,required:s,name:l})=>{const[c,u]=d(r||"");i(()=>{u(r||"")},[r]);const p=r??c;return y(b,{children:[l?g("input",{type:"hidden",name:l,value:p,required:s}):null,g("div",{className:Qe("flex w-full min-w-0",o),children:y(Ah,{value:p||void 0,onValueChange:e=>{u(e),a?.(e)},children:[g(jh,{"data-testid":e,className:"w-full",children:g(Fh,{placeholder:t})}),g(Wh,{children:(n??[]).map(e=>g($h,{"data-testid":e.value,value:e.value,className:Qe("cursor-pointer",rt,c===e.value?"bg-accent text-accent-foreground":""),children:e.label},e.value))})]})})]})},Hh=e=>{if("fk"===e.variant){const{variant:t,...n}=e;return g(Nf,{...n})}return g(qh,{...e})},Uh=6048e5,Kh=Symbol.for("constructDateFrom");function Vh(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&Kh in e?e[Kh](t):e instanceof Date?new e.constructor(t):new Date(t)}function Gh(e,t){return Vh(t||e,e)}function Zh(e,t,n){const o=Gh(e,n?.in);return isNaN(t)?Vh(e,NaN):t?(o.setDate(o.getDate()+t),o):o}function Xh(e,t,n){const o=Gh(e,n?.in);if(isNaN(t))return Vh(e,NaN);if(!t)return o;const r=o.getDate(),a=Vh(e,o.getTime());a.setMonth(o.getMonth()+t+1,0);return r>=a.getDate()?a:(o.setFullYear(a.getFullYear(),a.getMonth(),r),o)}let Qh={};function Jh(){return Qh}function ev(e,t){const n=Jh(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Gh(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 tv(e,t){return ev(e,{...t,weekStartsOn:1})}function nv(e,t){const n=Gh(e,t?.in),o=n.getFullYear(),r=Vh(n,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const a=tv(r),i=Vh(n,0);i.setFullYear(o,0,4),i.setHours(0,0,0,0);const s=tv(i);return n.getTime()>=a.getTime()?o+1:n.getTime()>=s.getTime()?o:o-1}function ov(e){const t=Gh(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 rv(e,...t){const n=Vh.bind(null,t.find(e=>"object"==typeof e));return t.map(n)}function av(e,t){const n=Gh(e,t?.in);return n.setHours(0,0,0,0),n}function iv(e,t,n){const[o,r]=rv(0,e,t),a=av(o),i=av(r),s=+a-ov(a),l=+i-ov(i);return Math.round((s-l)/864e5)}function sv(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function lv(e,t,n){const[o,r]=rv(0,e,t);return 12*(o.getFullYear()-r.getFullYear())+(o.getMonth()-r.getMonth())}function cv(e,t){const[n,o]=rv(0,t.start,t.end);return{start:n,end:o}}function dv(e,t){const n=Gh(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function uv(e,t){const n=Jh(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Gh(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 pv={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 fv(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const mv={date:fv({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:fv({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:fv({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},hv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function vv(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 gv={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:vv({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:vv({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:vv({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:vv({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:vv({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 yv(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 bv={ordinalNumber:(xv={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(xv.matchPattern);if(!n)return null;const o=n[0],r=e.match(xv.parsePattern);if(!r)return null;let a=xv.valueCallback?xv.valueCallback(r[0]):r[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(o.length)}}),era:yv({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:yv({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:yv({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:yv({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:yv({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 xv;const wv={code:"en-US",formatDistance:(e,t,n)=>{let o;const r=pv[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:mv,formatRelative:(e,t,n,o)=>hv[e],localize:gv,match:bv,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kv(e,t){const n=Gh(e,t?.in),o=+tv(n)-+function(e,t){const n=nv(e,t),o=Vh(e,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),tv(o)}(n);return Math.round(o/Uh)+1}function Nv(e,t){const n=Gh(e,t?.in),o=n.getFullYear(),r=Jh(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=Vh(t?.in||e,0);i.setFullYear(o+1,0,a),i.setHours(0,0,0,0);const s=ev(i,t),l=Vh(t?.in||e,0);l.setFullYear(o,0,a),l.setHours(0,0,0,0);const c=ev(l,t);return+n>=+s?o+1:+n>=+c?o:o-1}function Cv(e,t){const n=Gh(e,t?.in),o=+ev(n,t)-+function(e,t){const n=Jh(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Nv(e,t),a=Vh(t?.in||e,0);return a.setFullYear(r,0,o),a.setHours(0,0,0,0),ev(a,t)}(n,t);return Math.round(o/Uh)+1}function _v(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Dv={y(e,t){const n=e.getFullYear(),o=n>0?n:1-n;return _v("yy"===t?o%100:o,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):_v(n+1,2)},d:(e,t)=>_v(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)=>_v(e.getHours()%12||12,t.length),H:(e,t)=>_v(e.getHours(),t.length),m:(e,t)=>_v(e.getMinutes(),t.length),s:(e,t)=>_v(e.getSeconds(),t.length),S(e,t){const n=t.length,o=e.getMilliseconds();return _v(Math.trunc(o*Math.pow(10,n-3)),t.length)}},Ev="midnight",Sv="noon",Mv="morning",Ov="afternoon",Tv="evening",Rv="night",Pv={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 Dv.y(e,t)},Y:function(e,t,n,o){const r=Nv(e,o),a=r>0?r:1-r;if("YY"===t){return _v(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):_v(a,t.length)},R:function(e,t){return _v(nv(e),t.length)},u:function(e,t){return _v(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 _v(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 _v(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 Dv.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 _v(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=Cv(e,o);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):_v(r,t.length)},I:function(e,t,n){const o=kv(e);return"Io"===t?n.ordinalNumber(o,{unit:"week"}):_v(o,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Dv.d(e,t)},D:function(e,t,n){const o=function(e,t){const n=Gh(e,t?.in);return iv(n,dv(n))+1}(e);return"Do"===t?n.ordinalNumber(o,{unit:"dayOfYear"}):_v(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 _v(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 _v(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 _v(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?Sv: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?Tv:o>=12?Ov:o>=4?Mv:Rv,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 Dv.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Dv.H(e,t)},K:function(e,t,n){const o=e.getHours()%12;return"Ko"===t?n.ordinalNumber(o,{unit:"hour"}):_v(o,t.length)},k:function(e,t,n){let o=e.getHours();return 0===o&&(o=24),"ko"===t?n.ordinalNumber(o,{unit:"hour"}):_v(o,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Dv.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Dv.s(e,t)},S:function(e,t){return Dv.S(e,t)},X:function(e,t,n){const o=e.getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Iv(o);case"XXXX":case"XX":return Fv(o);default:return Fv(o,":")}},x:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"x":return Iv(o);case"xxxx":case"xx":return Fv(o);default:return Fv(o,":")}},O:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Av(o,":");default:return"GMT"+Fv(o,":")}},z:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Av(o,":");default:return"GMT"+Fv(o,":")}},t:function(e,t,n){return _v(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return _v(+e,t.length)}};function Av(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+_v(a,2)}function Iv(e,t){if(e%60==0){return(e>0?"-":"+")+_v(Math.abs(e)/60,2)}return Fv(e,t)}function Fv(e,t=""){const n=e>0?"-":"+",o=Math.abs(e);return n+_v(Math.trunc(o/60),2)+t+_v(o%60,2)}const jv=(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"})}},zv=(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"})}},Lv={p:zv,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],o=n[1],r=n[2];if(!r)return jv(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}}",jv(o,t)).replace("{{time}}",zv(r,t))}},Wv=/^D+$/,Bv=/^Y+$/,$v=["D","DD","YY","YYYY"];const Yv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hv=/^'([^]*?)'?$/,Uv=/''/g,Kv=/[a-zA-Z]/;function Vv(e,t,n){const o=Jh(),r=n?.locale??o.locale??wv,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=Gh(e,n?.in);if(!function(e){return!(!sv(e)&&"number"!=typeof e||isNaN(+Gh(e)))}(s))throw new RangeError("Invalid time value");let l=t.match(qv).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,Lv[t])(e,r.formatLong)}return e}).join("").match(Yv).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Gv(e)};if(Pv[t])return{isToken:!0,value:e};if(t.match(Kv))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 Bv.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return Wv.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),$v.includes(e))throw new RangeError(o)}(a,t,String(e));return(0,Pv[a[0]])(s,a,r.localize,c)}).join("")}function Gv(e){const t=e.match(Hv);return t?t[1].replace(Uv,"'"):e}function Zv(e,t,n){const o=Gh(e,n?.in),r=o.getFullYear(),a=o.getDate(),i=Vh(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=function(e,t){const n=Gh(e,t?.in),o=n.getFullYear(),r=n.getMonth(),a=Vh(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 Xv={},Qv={};function Jv(e,t){try{const n=(Xv[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in Qv?Qv[n]:tg(n,n.split(":"))}catch{if(e in Qv)return Qv[e];const t=e?.match(eg);return t?tg(e,t.slice(1)):NaN}}const eg=/([+-]\d\d):?(\d\d)?/;function tg(e,t){const n=+(t[0]||0),o=+(t[1]||0),r=+(t[2]||0)/60;return Qv[e]=60*n+o>0?60*n+o+r:60*n-o-r}class ng extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Jv(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)),ag(this),rg(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new ng(...t,e):new ng(Date.now(),e)}withTimeZone(e){return new ng(+this,e)}getTimezoneOffset(){const e=-Jv(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),rg(this),+this}[Symbol.for("constructDateFrom")](e){return new ng(+new Date(e),this.timeZone)}}const og=/^(get|set)(?!UTC)/;function rg(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(60*-Jv(e.timeZone,e)))}function ag(e){const t=Jv(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*Jv(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=Jv(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=Jv(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(!og.test(e))return;const t=e.replace(og,"$1UTC");ng.prototype[t]&&(e.startsWith("get")?ng.prototype[e]=function(){return this.internal[t]()}:(ng.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()),ag(e),+this},ng.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),rg(this),+this}))});class ig extends ng{static tz(e,...t){return t.length?new ig(...t,e):new ig(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 ig(+this,e)}[Symbol.for("constructDateFrom")](e){return new ig(+new Date(e),this.timeZone)}}function sg(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 lg={...wv,labels:{labelDayButton:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>Vv(e,t,{locale:wv,...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)=>Vv(e,n,{locale:wv,...t}),o(e,"LLLL yyyy")},labelGridcell:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>Vv(e,t,{locale:wv,...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)=>Vv(e,n,{locale:wv,...t}),o(e,"cccc")}}};class cg{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?ig.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 ig(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):Zh(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):Xh(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return Zh(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return Xh(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):iv(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):lv(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):function(e){const{start:t,end:n}=cv(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(Vh(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}=cv(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(Vh(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=sg(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 uv(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):function(e,t){const n=Gh(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):uv(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=Gh(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):Vv(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):kv(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):function(e,t){return Gh(e,t?.in).getMonth()}(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):function(e,t){return Gh(e,t?.in).getFullYear()}(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):Cv(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):function(e,t){return+Gh(e)>+Gh(t)}(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):function(e,t){return+Gh(e)<+Gh(t)}(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):sv(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):function(e,t){const[n,o]=rv(0,e,t);return+av(n)===+av(o)}(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t){const[n,o]=rv(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]=rv(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=Vh.bind(null,e));const t=Gh(e,o);(!n||n<t||isNaN(+t))&&(n=t)}),Vh(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=Vh.bind(null,e));const t=Gh(e,o);(!n||n>t||isNaN(+t))&&(n=t)}),Vh(o,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):Zv(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const o=Gh(e,n?.in);return isNaN(+o)?Vh(e,NaN):(o.setFullYear(t),o)}(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):sg(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):av(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):tv(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):function(e,t){const n=Gh(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):ev(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):dv(e),this.options={locale:lg,...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&&cg.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:n,numerals:o}=this.options,r=t?.code;if(r&&cg.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)}}cg.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 dg=new cg;class ug{constructor(e,t,n=dg){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 pg{constructor(e,t){this.date=e,this.weeks=t}}class fg{constructor(e,t){this.days=t,this.weekNumber=e}}var mg,hg,vg,gg;!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"}(mg||(mg={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}(hg||(hg={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(vg||(vg={})),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"}(gg||(gg={}));const yg=f(void 0);function bg(){const e=m(yg);if(void 0===e)throw new Error("useDayPicker() must be used within a custom component.");return e}var xg=Object.freeze({__proto__:null,Button:function(e){return t.createElement("button",{...e})},CaptionLabel:function(e){return t.createElement("span",{...e})},Chevron:function(e){const{size:n=24,orientation:o="left",className:r}=e;return t.createElement("svg",{className:r,width:n,height:n,viewBox:"0 0 24 24"},"up"===o&&t.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===o&&t.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===o&&t.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===o&&t.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))},Day:function(e){const{day:n,modifiers:o,...r}=e;return t.createElement("td",{...r})},DayButton:function(e){const{day:n,modifiers:o,...r}=e,a=t.useRef(null);return t.useEffect(()=>{o.focused&&a.current?.focus()},[o.focused]),t.createElement("button",{ref:a,...r})},Dropdown:function(e){const{options:n,className:o,components:r,classNames:a,...i}=e,s=[a[mg.Dropdown],o].join(" "),l=n?.find(({value:e})=>e===i.value);return t.createElement("span",{"data-disabled":i.disabled,className:a[mg.DropdownRoot]},t.createElement(r.Select,{className:s,...i},n?.map(({value:e,label:n,disabled:o})=>t.createElement(r.Option,{key:e,value:e,disabled:o},n))),t.createElement("span",{className:a[mg.CaptionLabel],"aria-hidden":!0},l?.label,t.createElement(r.Chevron,{orientation:"down",size:18,className:a[mg.Chevron]})))},DropdownNav:function(e){return t.createElement("div",{...e})},Footer:function(e){return t.createElement("div",{...e})},Month:function(e){const{calendarMonth:n,displayIndex:o,...r}=e;return t.createElement("div",{...r},e.children)},MonthCaption:function(e){const{calendarMonth:n,displayIndex:o,...r}=e;return t.createElement("div",{...r})},MonthGrid:function(e){return t.createElement("table",{...e})},Months:function(e){return t.createElement("div",{...e})},MonthsDropdown:function(e){const{components:n}=bg();return t.createElement(n.Dropdown,{...e})},Nav:function(e){const{onPreviousClick:n,onNextClick:o,previousMonth:r,nextMonth:a,...i}=e,{components:l,classNames:c,labels:{labelPrevious:d,labelNext:u}}=bg(),p=s(e=>{a&&o?.(e)},[a,o]),f=s(e=>{r&&n?.(e)},[r,n]);return t.createElement("nav",{...i},t.createElement(l.PreviousMonthButton,{type:"button",className:c[mg.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":d(r),onClick:f},t.createElement(l.Chevron,{disabled:!r||void 0,className:c[mg.Chevron],orientation:"left"})),t.createElement(l.NextMonthButton,{type:"button",className:c[mg.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":!a||void 0,"aria-label":u(a),onClick:p},t.createElement(l.Chevron,{disabled:!a||void 0,orientation:"right",className:c[mg.Chevron]})))},NextMonthButton:function(e){const{components:n}=bg();return t.createElement(n.Button,{...e})},Option:function(e){return t.createElement("option",{...e})},PreviousMonthButton:function(e){const{components:n}=bg();return t.createElement(n.Button,{...e})},Root:function(e){const{rootRef:n,...o}=e;return t.createElement("div",{...o,ref:n})},Select:function(e){return t.createElement("select",{...e})},Week:function(e){const{week:n,...o}=e;return t.createElement("tr",{...o})},WeekNumber:function(e){const{week:n,...o}=e;return t.createElement("th",{...o})},WeekNumberHeader:function(e){return t.createElement("th",{...e})},Weekday:function(e){return t.createElement("th",{...e})},Weekdays:function(e){return t.createElement("thead",{"aria-hidden":!0},t.createElement("tr",{...e}))},Weeks:function(e){return t.createElement("tbody",{...e})},YearsDropdown:function(e){const{components:n}=bg();return t.createElement(n.Dropdown,{...e})}});function wg(e,t,n=!1,o=dg){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 kg(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function Ng(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function Cg(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function _g(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function Dg(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function Eg(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Sg(e,t,n=dg){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(Ng(t))return wg(t,e,!1,n);if(Dg(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(kg(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 Cg(t)?a(e,t.after)>0:_g(t)?a(t.before,e)>0:"function"==typeof t&&t(e)})}function Mg(e){return{...xg,...e}}function Og(){const e={};for(const t in mg)e[mg[t]]=`rdp-${mg[t]}`;for(const t in hg)e[hg[t]]=`rdp-${hg[t]}`;for(const t in vg)e[vg[t]]=`rdp-${vg[t]}`;for(const t in gg)e[gg[t]]=`rdp-${gg[t]}`;return e}function Tg(e,t,n){return(n??new cg(t)).formatMonthYear(e)}const Rg=Tg;function Pg(e,t=dg){return t.format(e,"yyyy")}const Ag=Pg;var Ig=Object.freeze({__proto__:null,formatCaption:Tg,formatDay:function(e,t,n){return(n??new cg(t)).format(e,"d")},formatMonthCaption:Rg,formatMonthDropdown:function(e,t=dg){return t.format(e,"LLLL")},formatWeekNumber:function(e,t=dg){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)},formatWeekNumberHeader:function(){return""},formatWeekdayName:function(e,t,n){return(n??new cg(t)).format(e,"cccccc")},formatYearCaption:Ag,formatYearDropdown:Pg});function Fg(e,t,n,o){let r=(o??new cg(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const jg=Fg;function zg(e,t,n){return(n??new cg(t)).formatMonthYear(e)}const Lg=zg;function Wg(e,t,n,o){let r=(o??new cg(n)).format(e,"PPPP");return t?.today&&(r=`Today, ${r}`),r}function Bg(e){return"Choose the Month"}function $g(){return""}function Yg(e,t){return"Go to the Next Month"}function qg(e){return"Go to the Previous Month"}function Hg(e,t,n){return(n??new cg(t)).format(e,"cccc")}function Ug(e,t){return`Week ${e}`}function Kg(e){return"Week Number"}function Vg(e){return"Choose the Year"}var Gg=Object.freeze({__proto__:null,labelCaption:Lg,labelDay:jg,labelDayButton:Fg,labelGrid:zg,labelGridcell:Wg,labelMonthDropdown:Bg,labelNav:$g,labelNext:Yg,labelPrevious:qg,labelWeekNumber:Ug,labelWeekNumberHeader:Kg,labelWeekday:Hg,labelYearDropdown:Vg});const Zg=(e,t,n)=>t||(n?"function"==typeof n?n:(...e)=>n:e);function Xg(e,t){const n=t.locale?.labels??{};return{...Gg,...e??{},labelDayButton:Zg(Fg,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:Zg(Bg,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:Zg(Yg,e?.labelNext,n.labelNext),labelPrevious:Zg(qg,e?.labelPrevious,n.labelPrevious),labelWeekNumber:Zg(Ug,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Zg(Vg,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:Zg(zg,e?.labelGrid,n.labelGrid),labelGridcell:Zg(Wg,e?.labelGridcell,n.labelGridcell),labelNav:Zg($g,e?.labelNav,n.labelNav),labelWeekNumberHeader:Zg(Kg,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Zg(Hg,e?.labelWeekday,n.labelWeekday)}}function Qg(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 Jg(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 ey=e=>e instanceof HTMLElement?e:null,ty=e=>[...e.querySelectorAll("[data-animated-month]")??[]],ny=e=>ey(e.querySelector("[data-animated-caption]")),oy=e=>ey(e.querySelector("[data-animated-weeks]"));function ry(e,t,{classNames:n,months:o,focused:a,dateLib:i}){const s=r(null),l=r(o),c=r(!1);h(()=>{const r=l.current;if(l.current=o,!(t&&e.current&&e.current instanceof HTMLElement&&0!==o.length&&0!==r.length&&o.length===r.length))return;const d=i.isSameMonth(o[0].date,r[0].date),u=i.isAfter(o[0].date,r[0].date),p=u?n[gg.caption_after_enter]:n[gg.caption_before_enter],f=u?n[gg.weeks_after_enter]:n[gg.weeks_before_enter],m=s.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement){ty(h).forEach(e=>{if(!(e instanceof HTMLElement))return;const t=ey(e.querySelector("[data-animated-month]"));t&&e.contains(t)&&e.removeChild(t);const n=ny(e);n&&n.classList.remove(p);const o=oy(e);o&&o.classList.remove(f)}),s.current=h}else s.current=null;if(c.current||d||a)return;const v=m instanceof HTMLElement?ty(m):[],g=ty(e.current);if(g?.every(e=>e instanceof HTMLElement)&&v&&v.every(e=>e instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const t=(y=e.current,ey(y.querySelector("[data-animated-nav]")));t&&(t.style.zIndex="1"),g.forEach((o,r)=>{const a=v[r];if(!a)return;o.style.position="relative",o.style.overflow="hidden";const i=ny(o);i&&i.classList.add(p);const s=oy(o);s&&s.classList.add(f);const l=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),t&&(t.style.zIndex=""),i&&i.classList.remove(p),s&&s.classList.remove(f),o.style.position="",o.style.overflow="",o.contains(a)&&o.removeChild(a)};a.style.pointerEvents="none",a.style.position="absolute",a.style.overflow="hidden",a.setAttribute("aria-hidden","true");const d=(e=>ey(e.querySelector("[data-animated-weekdays]")))(a);d&&(d.style.opacity="0");const m=ny(a);m&&(m.classList.add(u?n[gg.caption_before_exit]:n[gg.caption_after_exit]),m.addEventListener("animationend",l));const h=oy(a);h&&h.classList.add(u?n[gg.weeks_before_exit]:n[gg.weeks_after_exit]),o.insertBefore(a,o.firstChild)})}var y})}function ay(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 iy(e,t){const[n,o]=d(e);return[void 0===t?n:t,o]}function sy(e,t){const[n,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]}(e,t),{startOfMonth:a,endOfMonth:s}=t,l=ay(e,n,r,t),[c,d]=iy(l,e.month?l:void 0);i(()=>{const o=ay(e,n,r,t);d(o)},[e.timeZone]);const{months:u,weeks:p,days:f,previousMonth:m,nextMonth:h}=o(()=>{const o=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}(c,r,{numberOfMonths:e.numberOfMonths},t),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:y,startOfWeek:b}=o,x=l?g(r,o):i?y(r):b(r),w=l?p(a):i?f(m(a)):h(m(a)),k=t&&(l?p(t):i?f(t):h(t)),N=d(k&&v(w,k)?k:w,x),C=u(a,r)+1,_=[];for(let e=0;e<=N;e++){const t=c(x,e);_.push(t)}const D=(l?35:42)*C;if(s&&_.length<D){const e=D-_.length;for(let t=0;t<e;t++){const e=c(_[_.length-1],1);_.push(e)}}return _}(o,e.endMonth?s(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),i=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),y=n.broadcastCalendar?35:42;if(n.fixedWeeks&&g.length<y){const e=t.filter(e=>{const t=y-g.length;return e>v&&e<=r(v,t)});g.push(...e)}const b=g.reduce((e,t)=>{const r=n.ISOWeek?c(t):d(t),a=e.find(e=>e.weekNumber===r),i=new ug(t,m,o);return a?a.days.push(i):e.push(new fg(r,[i])),e},[]),x=new pg(m,b);return e.push(x),e},[]);return n.reverseMonths?m.reverse():m}(o,a,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),l=function(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}(i),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())}(i),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)}(c,n,e,t),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)}(c,r,e,t);return{months:i,weeks:l,days:d,previousMonth:u,nextMonth:p}},[t,c.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:v,onMonthChange:g}=e,y=e=>{if(v)return;let t=a(e);n&&t<a(n)&&(t=a(n)),r&&t>a(r)&&(t=a(r)),d(t),g?.(t)};return{months:u,weeks:p,days:f,navStart:n,navEnd:r,previousMonth:m,nextMonth:h,goToMonth:y,goToDay:e=>{(e=>p.some(t=>t.days.some(t=>t.isEqualTo(e))))(e)||y(e.date)}}}var ly;function cy(e){return!e[hg.disabled]&&!e[hg.hidden]&&!e[hg.outside]}function dy(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:y,startOfISOWeek:b,startOfWeek:x}=i;let w={day:c,week:u,month:d,year:p,startOfWeek:e=>l?y(e,i):s?b(e):x(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&&Sg(l,a.disabled,i)),d=Boolean(a.hidden&&Sg(l,a.hidden,i)),u=new ug(l,l,i);return c||d?dy(e,t,u,o,r,a,i,s+1):u}function uy(e,t,n,o,r){const{autoFocus:a}=e,[i,s]=d(),l=function(e,t,n,o){let r,a=-1;for(const i of e){const e=t(i);cy(e)&&(e[hg.focused]&&a<ly.FocusedModifier?(r=i,a=ly.FocusedModifier):o?.isEqualTo(i)&&a<ly.LastFocused?(r=i,a=ly.LastFocused):n(i.date)&&a<ly.Selected?(r=i,a=ly.Selected):e[hg.today]&&a<ly.Today&&(r=i,a=ly.Today))}return r||(r=e.find(e=>cy(t(e)))),r}(t.days,n,o||(()=>!1),i),[c,u]=d(a?l:void 0);return{isFocusTarget:e=>Boolean(l?.isEqualTo(e)),setFocused:u,focused:c,blur:()=>{s(c),u(void 0)},moveFocus:(n,o)=>{if(!c)return;const a=dy(n,o,c,t.navStart,t.navEnd,e,r);if(a){if(e.disableNavigation){if(!t.days.some(e=>e.isEqualTo(a)))return}t.goToDay(a),u(a)}}}}function py(e,t,n=dg){return wg(e,t.from,!1,n)||wg(e,t.to,!1,n)||wg(t,e.from,!1,n)||wg(t,e.to,!1,n)}function fy(e,t,n=dg){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 wg(e,t,!1,n);if(Eg(t,n))return t.some(t=>wg(e,t,!1,n));if(Ng(t))return!(!t.from||!t.to)&&py(e,{from:t.from,to:t.to},n);if(Dg(t))return function(e,t,n=dg){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(kg(t)){return n.isAfter(t.before,t.after)?py(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):Sg(e.from,t,n)||Sg(e.to,t,n)}return!(!Cg(t)&&!_g(t))&&(Sg(e.from,t,n)||Sg(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 my(e,t){const{disabled:n,excludeDisabled:o,selected:r,required:a,onSelect:i}=e,[s,l]=iy(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=dg){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&&fy({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&&wg(c,e,!1,t)}}function hy(e,t){const n=function(e,t){const{selected:n,required:o,onSelect:r}=e,[a,i]=iy(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]=iy(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=my(e,t);switch(e.mode){case"single":return n;case"multiple":return o;case"range":return r;default:return}}function vy(e,t){return e instanceof ig&&e.timeZone===t?e:new ig(e,t)}function gy(e,t,n){return vy(e,t)}function yy(e,t,n){return"boolean"==typeof e||"function"==typeof e?e:e instanceof Date?gy(e,t):Array.isArray(e)?e.map(e=>e instanceof Date?gy(e,t):e):Ng(e)?{...e,from:e.from?vy(e.from,t):e.from,to:e.to?vy(e.to,t):e.to}:kg(e)?{before:gy(e.before,t),after:gy(e.after,t)}:Cg(e)?{after:gy(e.after,t)}:_g(e)?{before:gy(e.before,t)}:e}function by(e,t,n){return e?Array.isArray(e)?e.map(e=>yy(e,t)):yy(e,t):e}function xy(e){let n=e;const a=n.timeZone;if(a&&(n={...e,timeZone:a},n.today&&(n.today=vy(n.today,a)),n.month&&(n.month=vy(n.month,a)),n.defaultMonth&&(n.defaultMonth=vy(n.defaultMonth,a)),n.startMonth&&(n.startMonth=vy(n.startMonth,a)),n.endMonth&&(n.endMonth=vy(n.endMonth,a)),"single"===n.mode&&n.selected?n.selected=vy(n.selected,a):"multiple"===n.mode&&n.selected?n.selected=n.selected?.map(e=>vy(e,a)):"range"===n.mode&&n.selected&&(n.selected={from:n.selected.from?vy(n.selected.from,a):n.selected.from,to:n.selected.to?vy(n.selected.to,a):n.selected.to}),void 0!==n.disabled&&(n.disabled=by(n.disabled,a)),void 0!==n.hidden&&(n.hidden=by(n.hidden,a)),n.modifiers)){const e={};Object.keys(n.modifiers).forEach(t=>{e[t]=by(n.modifiers?.[t],a)}),n.modifiers=e}const{components:i,formatters:l,labels:c,dateLib:d,locale:u,classNames:p}=o(()=>{const e={...lg,...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 ig(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(ig.tz(e)),newDate:(t,n,o)=>new ig(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 ig(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 ig(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 ig(n.getFullYear(),0,1,12,0,0,e);for(;i.getFullYear()<=o.getFullYear();)r.push(new ig(i,e)),i.setFullYear(i.getFullYear()+1,0,1);return r},getWeek:(e,t)=>Cv(i(e),{weekStartsOn:t?.weekStartsOn??r,firstWeekContainsDate:t?.firstWeekContainsDate??o?.options?.firstWeekContainsDate??1}),getISOWeek:e=>kv(i(e)),differenceInCalendarDays:(e,t)=>iv(i(e),i(t)),differenceInCalendarMonths:(e,t)=>lv(i(e),i(t))}}(n.timeZone,{weekStartsOn:t,locale:e}):void 0,r=n.dateLib&&o?{...o,...n.dateLib}:n.dateLib??o,a=new cg({locale:e,weekStartsOn:t,firstWeekContainsDate:n.firstWeekContainsDate,useAdditionalWeekYearTokens:n.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:n.useAdditionalDayOfYearTokens,timeZone:n.timeZone,numerals:n.numerals},r);return{dateLib:a,components:Mg(n.components),formatters:(i=n.formatters,i?.formatMonthCaption&&!i.formatCaption&&(i.formatCaption=i.formatMonthCaption),i?.formatYearCaption&&!i.formatYearDropdown&&(i.formatYearDropdown=i.formatYearCaption),{...Ig,...i}),labels:Xg(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:d.today()});const{captionLayout:f,mode:m,navLayout:h,numberOfMonths:v=1,onDayBlur:g,onDayClick:y,onDayFocus:b,onDayKeyDown:x,onDayMouseEnter:w,onDayMouseLeave:k,onNextClick:N,onPrevClick:C,showWeekNumber:_,styles:D}=n,{formatCaption:E,formatDay:S,formatMonthDropdown:M,formatWeekNumber:O,formatWeekNumberHeader:T,formatWeekdayName:R,formatYearDropdown:P}=l,A=sy(n,d),{days:I,months:F,navStart:j,navEnd:z,previousMonth:L,nextMonth:W,goToMonth:B}=A,$=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),y=o&&h(o),b={[hg.focused]:[],[hg.outside]:[],[hg.disabled]:[],[hg.hidden]:[],[hg.today]:[]},x={};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(y&&v(e,y)),w=Boolean(a&&Sg(e,a,r)),k=Boolean(i&&Sg(e,i,r))||f||h||!c&&!l&&o||c&&!1===l&&o,N=u(e,d);o&&b.outside.push(t),w&&b.disabled.push(t),k&&b.hidden.push(t),N&&b.today.push(t),s&&Object.keys(s).forEach(n=>{const o=s?.[n];o&&Sg(e,o,r)&&(x[n]?x[n].push(t):x[n]=[t])})}return e=>{const t={[hg.focused]:!1,[hg.disabled]:!1,[hg.hidden]:!1,[hg.outside]:!1,[hg.today]:!1},n={};for(const n in b){const o=b[n];t[n]=o.some(t=>t===e)}for(const t in x)n[t]=x[t].some(t=>t===e);return{...t,...n}}}(I,n,j,z,d),{isSelected:Y,select:q,selected:H}=hy(n,d)??{},{blur:U,focused:K,isFocusTarget:V,moveFocus:G,setFocused:Z}=uy(n,A,$,Y??(()=>!1),d),{labelDayButton:X,labelGridcell:Q,labelGrid:J,labelMonthDropdown:ee,labelNav:te,labelPrevious:ne,labelNext:oe,labelWeekday:re,labelWeekNumber:ae,labelWeekNumberHeader:ie,labelYearDropdown:se}=c,le=o(()=>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}(d,n.ISOWeek,n.broadcastCalendar,n.today),[d,n.ISOWeek,n.broadcastCalendar,n.today]),ce=void 0!==m||void 0!==y,de=s(()=>{L&&(B(L),C?.(L))},[L,B,C]),ue=s(()=>{W&&(B(W),N?.(W))},[B,W,N]),pe=s((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),Z(e),t.disabled||(q?.(e.date,t,n),y?.(e.date,t,n))},[q,y,Z]),fe=s((e,t)=>n=>{Z(e),b?.(e.date,t,n)},[b,Z]),me=s((e,t)=>n=>{U(),g?.(e.date,t,n)},[U,g]),he=s((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];G(e,t)}x?.(e.date,t,o)},[G,x,n.dir]),ve=s((e,t)=>n=>{w?.(e.date,t,n)},[w]),ge=s((e,t)=>n=>{k?.(e.date,t,n)},[k]),ye=s(e=>t=>{const n=Number(t.target.value),o=d.setMonth(d.startOfMonth(e),n);B(o)},[d,B]),be=s(e=>t=>{const n=Number(t.target.value),o=d.setYear(d.startOfMonth(e),n);B(o)},[d,B]),{className:xe,style:we}=o(()=>({className:[p[mg.Root],n.className].filter(Boolean).join(" "),style:{...D?.[mg.Root],...n.style}}),[p,n.className,n.style,D]),ke=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),Ne=r(null);ry(Ne,Boolean(n.animate),{classNames:p,months:F,focused:K,dateLib:d});const Ce={dayPickerProps:n,selected:H,select:q,isSelected:Y,months:F,nextMonth:W,previousMonth:L,goToMonth:B,getModifiers:$,components:i,classNames:p,styles:D,labels:c,formatters:l};return t.createElement(yg.Provider,{value:Ce},t.createElement(i.Root,{rootRef:n.animate?Ne:void 0,className:xe,style:we,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"],...ke},t.createElement(i.Months,{className:p[mg.Months],style:D?.[mg.Months]},!n.hideNavigation&&!h&&t.createElement(i.Nav,{"data-animated-nav":n.animate?"true":void 0,className:p[mg.Nav],style:D?.[mg.Nav],"aria-label":te(),onPreviousClick:de,onNextClick:ue,previousMonth:L,nextMonth:W}),F.map((e,o)=>t.createElement(i.Month,{"data-animated-month":n.animate?"true":void 0,className:p[mg.Month],style:D?.[mg.Month],key:o,displayIndex:o,calendarMonth:e},"around"===h&&!n.hideNavigation&&0===o&&t.createElement(i.PreviousMonthButton,{type:"button",className:p[mg.PreviousMonthButton],tabIndex:L?void 0:-1,"aria-disabled":!L||void 0,"aria-label":ne(L),onClick:de,"data-animated-button":n.animate?"true":void 0},t.createElement(i.Chevron,{disabled:!L||void 0,className:p[mg.Chevron],orientation:"rtl"===n.dir?"right":"left"})),t.createElement(i.MonthCaption,{"data-animated-caption":n.animate?"true":void 0,className:p[mg.MonthCaption],style:D?.[mg.MonthCaption],calendarMonth:e,displayIndex:o},f?.startsWith("dropdown")?t.createElement(i.DropdownNav,{className:p[mg.Dropdowns],style:D?.[mg.Dropdowns]},(()=>{const o="dropdown"===f||"dropdown-months"===f?t.createElement(i.MonthsDropdown,{key:"month",className:p[mg.MonthsDropdown],"aria-label":ee(),classNames:p,components:i,disabled:Boolean(n.disableNavigation),onChange:ye(e.date),options:Qg(e.date,j,z,l,d),style:D?.[mg.Dropdown],value:d.getMonth(e.date)}):t.createElement("span",{key:"month"},M(e.date,d)),r="dropdown"===f||"dropdown-years"===f?t.createElement(i.YearsDropdown,{key:"year",className:p[mg.YearsDropdown],"aria-label":se(d.options),classNames:p,components:i,disabled:Boolean(n.disableNavigation),onChange:be(e.date),options:Jg(j,z,l,d,Boolean(n.reverseYears)),style:D?.[mg.Dropdown],value:d.getYear(e.date)}):t.createElement("span",{key:"year"},P(e.date,d));return"year-first"===d.getMonthYearOrder()?[r,o]:[o,r]})(),t.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"}},E(e.date,d.options,d))):t.createElement(i.CaptionLabel,{className:p[mg.CaptionLabel],role:"status","aria-live":"polite"},E(e.date,d.options,d))),"around"===h&&!n.hideNavigation&&o===v-1&&t.createElement(i.NextMonthButton,{type:"button",className:p[mg.NextMonthButton],tabIndex:W?void 0:-1,"aria-disabled":!W||void 0,"aria-label":oe(W),onClick:ue,"data-animated-button":n.animate?"true":void 0},t.createElement(i.Chevron,{disabled:!W||void 0,className:p[mg.Chevron],orientation:"rtl"===n.dir?"left":"right"})),o===v-1&&"after"===h&&!n.hideNavigation&&t.createElement(i.Nav,{"data-animated-nav":n.animate?"true":void 0,className:p[mg.Nav],style:D?.[mg.Nav],"aria-label":te(),onPreviousClick:de,onNextClick:ue,previousMonth:L,nextMonth:W}),t.createElement(i.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===m||"range"===m,"aria-label":J(e.date,d.options,d)||void 0,className:p[mg.MonthGrid],style:D?.[mg.MonthGrid]},!n.hideWeekdays&&t.createElement(i.Weekdays,{"data-animated-weekdays":n.animate?"true":void 0,className:p[mg.Weekdays],style:D?.[mg.Weekdays]},_&&t.createElement(i.WeekNumberHeader,{"aria-label":ie(d.options),className:p[mg.WeekNumberHeader],style:D?.[mg.WeekNumberHeader],scope:"col"},T()),le.map(e=>t.createElement(i.Weekday,{"aria-label":re(e,d.options,d),className:p[mg.Weekday],key:String(e),style:D?.[mg.Weekday],scope:"col"},R(e,d.options,d)))),t.createElement(i.Weeks,{"data-animated-weeks":n.animate?"true":void 0,className:p[mg.Weeks],style:D?.[mg.Weeks]},e.weeks.map(e=>t.createElement(i.Week,{className:p[mg.Week],key:e.weekNumber,style:D?.[mg.Week],week:e},_&&t.createElement(i.WeekNumber,{week:e,style:D?.[mg.WeekNumber],"aria-label":ae(e.weekNumber,{locale:u}),className:p[mg.WeekNumber],scope:"row",role:"rowheader"},O(e.weekNumber,d)),e.days.map(e=>{const{date:o}=e,r=$(e);if(r[hg.focused]=!r.hidden&&Boolean(K?.isEqualTo(e)),r[vg.selected]=Y?.(o)||r.selected,Ng(H)){const{from:e,to:t}=H;r[vg.range_start]=Boolean(e&&t&&d.isSameDay(o,e)),r[vg.range_end]=Boolean(e&&t&&d.isSameDay(o,t)),r[vg.range_middle]=wg(H,o,!0,d)}const a=function(e,t={},n={}){let o={...t?.[mg.Day]};return Object.entries(e).filter(([,e])=>!0===e).forEach(([e])=>{o={...o,...n?.[e]}}),o}(r,D,n.modifiersStyles),s=function(e,t,n={}){return Object.entries(e).filter(([,e])=>!0===e).reduce((e,[o])=>(n[o]?e.push(n[o]):t[hg[o]]?e.push(t[hg[o]]):t[vg[o]]&&e.push(t[vg[o]]),e),[t[mg.Day]])}(r,p,n.modifiersClassNames),l=ce||r.hidden?void 0:Q(o,r,d.options,d);return t.createElement(i.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:r,className:s.join(" "),style:a,role:"gridcell","aria-selected":r.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":r.selected||void 0,"data-disabled":r.disabled||void 0,"data-hidden":r.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":r.focused||void 0,"data-today":r.today||void 0},!r.hidden&&ce?t.createElement(i.DayButton,{className:p[mg.DayButton],style:D?.[mg.DayButton],type:"button",day:e,modifiers:r,disabled:!r.focused&&r.disabled||void 0,"aria-disabled":r.focused&&r.disabled||void 0,tabIndex:V(e)?0:-1,"aria-label":X(o,r,d.options,d),onClick:pe(e,r),onBlur:me(e,r),onFocus:fe(e,r),onKeyDown:he(e,r),onMouseEnter:ve(e,r),onMouseLeave:ge(e,r)},S(o,d.options,d)):!r.hidden&&S(e.date,d.options,d))})))))))),n.footer&&t.createElement(i.Footer,{className:p[mg.Footer],style:D?.[mg.Footer],role:"status","aria-live":"polite"},n.footer)))}function wy({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:o="label",buttonVariant:r="ghost",formatters:a,components:i,...s}){const l=Og();return g(xy,{showOutsideDays:n,className:Qe("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:o,formatters:{formatMonthDropdown:e=>e.toLocaleString("default",{month:"short"}),...a},classNames:{root:Qe("w-fit",l.root),months:Qe("relative flex flex-col gap-4 md:flex-row",l.months),month:Qe("flex w-full flex-col gap-4",l.month),nav:Qe("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",l.nav),button_previous:Qe(Je({variant:r}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",l.button_previous),button_next:Qe(Je({variant:r}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",l.button_next),month_caption:Qe("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",l.month_caption),dropdowns:Qe("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",l.dropdowns),dropdown_root:Qe("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",l.dropdown_root),dropdown:Qe("bg-popover absolute inset-0 opacity-0",l.dropdown),caption_label:Qe("select-none font-medium","label"===o?"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",l.caption_label),table:"w-full border-collapse",weekdays:Qe("flex",l.weekdays),weekday:Qe("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",l.weekday),week:Qe("mt-2 flex w-full",l.week),week_number_header:Qe("w-[--cell-size] select-none",l.week_number_header),week_number:Qe("text-muted-foreground select-none text-[0.8rem]",l.week_number),day:Qe("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",l.day),range_start:Qe("bg-accent rounded-l-md",l.range_start),range_middle:Qe("rounded-none",l.range_middle),range_end:Qe("bg-accent rounded-r-md",l.range_end),today:Qe("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",l.today),outside:Qe("text-muted-foreground aria-selected:text-muted-foreground",l.outside),disabled:Qe("text-muted-foreground opacity-50",l.disabled),hidden:Qe("invisible",l.hidden),...t},components:{Root:({className:e,rootRef:t,...n})=>g("div",{"data-slot":"calendar",ref:t,className:Qe(e),...n}),Chevron:({className:e,orientation:t,...n})=>g("left"===t?ki:"right"===t?Ni:wi,{className:Qe("size-4",e),...n}),DayButton:ky,WeekNumber:({children:e,...t})=>g("td",{...t,children:g("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:e})}),...i},...s})}function ky({className:t,day:n,modifiers:o,...r}){const a=Og(),i=e.useRef(null);return e.useEffect(()=>{o.focused&&i.current?.focus()},[o.focused]),g(tt,{ref:i,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:Qe("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",a.day,t),...r})}!function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"}(ly||(ly={}));const Ny=e=>{if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t},Cy=({id:e,placeholder:t,value:n,onValueChange:o,className:r,boundary:a="start",dateFormat:i="dd/MM/yyyy"})=>{const s=Ny(n),l=((e,t)=>{const n=Ny(e);return n?Vv(n,t):null})(n,i);return g("div",{className:Qe("flex w-full min-w-0",r),children:y(yf,{children:[g(bf,{asChild:!0,children:y("button",{type:"button","data-testid":e,className:Qe(nt,"justify-start text-left",!l&&ot),children:[g(bi,{className:Qe("mr-2","size-4 shrink-0 text-muted-foreground opacity-50")}),l??t]})}),g(xf,{className:"w-fit p-0",align:"start",children:g(wy,{mode:"single",selected:s,onSelect:e=>{if(!e)return void o?.("");const t="end"===a?function(e,t){const n=Gh(e,t?.in);return n.setHours(23,59,59,999),n}(e):av(e);o?.(t.toISOString())},initialFocus:!0})})]})})};function _y({title:e="Nenhum resultado",description:t="Nenhum dado encontrado."}){return g(Mc,{title:e,description:t})}const Dy=e.forwardRef(({className:e,...t},n)=>g("div",{className:"w-full overflow-auto",children:g("table",{ref:n,className:Qe("w-full caption-bottom text-sm",e),...t})}));Dy.displayName="Table";const Ey=e.forwardRef(({className:e,...t},n)=>g("thead",{ref:n,className:Qe("rounded-md bg-[#0E2B63] h-[36px]",e),...t}));Ey.displayName="TableHeader";const Sy=e.forwardRef(({className:e,...t},n)=>g("tbody",{ref:n,className:Qe("[&_tr:last-child]:border-0",e),...t}));Sy.displayName="TableBody";const My=e.forwardRef(({className:e,...t},n)=>g("tfoot",{ref:n,className:Qe("bg-primary font-medium text-primary-foreground",e),...t}));My.displayName="TableFooter";const Oy=e.forwardRef(({className:e,...t},n)=>g("tr",{ref:n,className:Qe("text-sm text-fontcolor-secondary transition-colors data-[state=selected]:bg-muted",e),...t}));Oy.displayName="TableRow";const Ty=e.forwardRef(({className:e,...t},n)=>g("th",{ref:n,className:Qe("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),...t}));Ty.displayName="TableHead";const Ry=e.forwardRef(({className:e,...t},n)=>g("td",{ref:n,className:Qe("px-4 py-2 align-middle text-[12px] text-[#333333] [&:has([role=checkbox])]:pr-0",e),...t}));Ry.displayName="TableCell";const Py=e.forwardRef(({className:e,...t},n)=>g("caption",{ref:n,className:Qe("mt-4 text-sm text-muted-foreground",e),...t}));function Ay({className:e,...t}){return g("div",{className:Qe("animate-pulse rounded-md bg-muted",e),...t})}function Iy({columns:e,rows:t=5}){const n=function(e){return"number"==typeof e?Array.from({length:e},()=>({})):e}(e),o=Array.from({length:t},(e,t)=>"row-".concat(String(t)));return g(b,{children:o.map(e=>g(Oy,{children:n.map((t,n)=>g(Ry,{className:Qe(t.width,t.cellClassName,"px-2 py-2"),children:g(Ay,{className:"block h-4 w-full"})},e.concat("-col-",String(n))))},e))})}Py.displayName="TableCaption";const Fy={Root:Dy,Body:Sy,Cell:Ry,Head:Ty,Header:Ey,Row:Oy};function jy({data:e,columns:t,getRowKey:n,ordering:o,onSort:r,onRowClick:a,isLoading:i,hasMore:s,onLoadMore:l,className:c}){const d=Boolean(i&&0===e.length),u=t??[];return g("div",{className:Qe("flex-1 overflow-auto mt-4",c),children:i||0!==e.length?y(Dy,{className:"table-auto w-full",children:[g(Ey,{className:"sticky top-0 bg-primary text-white z-10",children:g(zy,{columns:u,ordering:o,onSort:r})}),y(Sy,{children:[d?g(Iy,{columns:u.map(e=>({width:e.width,cellClassName:e.cellClassName}))}):e.map(e=>g(Ly,{item:e,columns:u,onClick:a?()=>a(e):void 0},n(e))),s&&l&&!d&&g(Oy,{children:g(Ry,{colSpan:u.length,className:"text-center py-6",children:g(tt,{onClick:l,disabled:i,variant:"outline",children:i?"Carregando...":"Carregar Mais"})})})]})]}):g("div",{className:"py-20",children:g(_y,{})})})}function zy({columns:e,ordering:t,onSort:n}){return g(Oy,{children:(e??[]).map(e=>{const o=Boolean(e.sortable),r=t===e.key,a=t==="-".concat(e.key),i=r||a;return g(Ty,{className:Qe(e.width,e.className,o?"cursor-pointer":""),onClick:o&&n?()=>n(e.key):void 0,children:y(dt,{direction:"row",gap:1,children:[e.label,o&&i&&g(r?gi:vi,{size:16})]})},e.key)})})}function Ly({item:e,columns:t,onClick:n}){const o=t??[];return g(Oy,{className:Qe(n?"hover:bg-secondary cursor-pointer":""),onClick:n,children:o.map(t=>{const n=e[t.key];return g(Ry,{className:Qe(t.width,t.cellClassName),children:t.render?t.render(n,e):String(n??"N/D")},t.key)})})}var Wy="Checkbox",[By]=Xs(Wy),[$y,Yy]=By(Wy);function qy(t){const{__scopeCheckbox:n,checked:o,children:r,defaultChecked:a,disabled:i,form:s,name:l,onCheckedChange:c,required:d,value:u="on",internal_do_not_use_render:p}=t,[f,m]=ml({prop:o,defaultProp:a??!1,onChange:c,caller:Wy}),[h,v]=e.useState(null),[y,b]=e.useState(null),x=e.useRef(!1),w=!h||(!!s||!!h.closest("form")),k={checked:f,disabled:i,setChecked:m,control:h,setControl:v,name:l,form:s,value:u,hasConsumerStoppedPropagationRef:x,required:d,defaultChecked:!Jy(a)&&a,isFormControl:w,bubbleInput:y,setBubbleInput:b};return g($y,{scope:n,...k,children:Qy(p)?p(k):r})}var Hy="CheckboxTrigger",Uy=e.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:o,...r},a)=>{const{control:i,value:s,disabled:l,checked:c,required:d,setControl:u,setChecked:p,hasConsumerStoppedPropagationRef:f,isFormControl:m,bubbleInput:h}=Yy(Hy,t),v=tl(a,u),y=e.useRef(c);return e.useEffect(()=>{const e=i?.form;if(e){const t=()=>p(y.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,p]),g(hl.button,{type:"button",role:"checkbox","aria-checked":Jy(c)?"mixed":c,"aria-required":d,"data-state":eb(c),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:v,onKeyDown:ul(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:ul(o,e=>{p(e=>!!Jy(e)||!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});Uy.displayName=Hy;var Ky=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:a,required:i,disabled:s,value:l,onCheckedChange:c,form:d,...u}=e;return g(qy,{__scopeCheckbox:n,checked:r,defaultChecked:a,disabled:s,required:i,onCheckedChange:c,name:o,form:d,value:l,internal_do_not_use_render:({isFormControl:e})=>y(b,{children:[g(Uy,{...u,ref:t,__scopeCheckbox:n}),e&&g(Xy,{__scopeCheckbox:n})]})})});Ky.displayName=Wy;var Vy="CheckboxIndicator",Gy=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,a=Yy(Vy,n);return g(gl,{present:o||Jy(a.checked)||!0===a.checked,children:g(hl.span,{"data-state":eb(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});Gy.displayName=Vy;var Zy="CheckboxBubbleInput",Xy=e.forwardRef(({__scopeCheckbox:t,...n},o)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:s,required:l,disabled:c,name:d,value:u,form:p,bubbleInput:f,setBubbleInput:m}=Yy(Zy,t),h=tl(o,m),v=xm(i),y=Zf(r);e.useEffect(()=>{const e=f;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,o=!a.current;if(v!==i&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Jy(i),n.call(e,!Jy(i)&&i),e.dispatchEvent(t)}},[f,v,i,a]);const b=e.useRef(!Jy(i)&&i);return g(hl.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??b.current,required:l,disabled:c,name:d,value:u,form:p,...n,tabIndex:-1,ref:h,style:{...n.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function Qy(e){return"function"==typeof e}function Jy(e){return"indeterminate"===e}function eb(e){return Jy(e)?"indeterminate":e?"checked":"unchecked"}Xy.displayName=Zy;const tb=e.forwardRef(({className:e,...t},n)=>g(Ky,{ref:n,className:Qe("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),...t,children:g(Gy,{className:Qe("flex items-center justify-center text-current"),children:g(xi,{className:"h-4 w-4"})})}));tb.displayName=Ky.displayName;var nb=e.forwardRef((e,t)=>g(hl.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));nb.displayName="Label";var ob=nb;const rb=j("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ab=e.forwardRef(({className:e,...t},n)=>g(ob,{ref:n,className:Qe(rb(),e),...t}));ab.displayName=ob.displayName;var[ib]=Xs("Tooltip",[Jf]),sb=Jf(),lb="TooltipProvider",cb=700,db="tooltip.open",[ub,pb]=ib(lb),fb=t=>{const{__scopeTooltip:n,delayDuration:o=cb,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=t,s=e.useRef(!0),l=e.useRef(!1),c=e.useRef(0);return e.useEffect(()=>{const e=c.current;return()=>window.clearTimeout(e)},[]),g(ub,{scope:n,isOpenDelayedRef:s,delayDuration:o,onOpen:e.useCallback(()=>{r<=0||(window.clearTimeout(c.current),s.current=!1)},[r]),onClose:e.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:e.useCallback(e=>{l.current=e},[]),disableHoverableContent:a,children:i})};fb.displayName=lb;var mb="Tooltip",[hb,vb]=ib(mb),gb=t=>{const{__scopeTooltip:n,children:o,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:s,delayDuration:l}=t,c=pb(mb,t.__scopeTooltip),d=sb(n),[u,p]=e.useState(null),f=kl(),m=e.useRef(0),h=s??c.disableHoverableContent,v=l??c.delayDuration,y=e.useRef(!1),[b,x]=ml({prop:r,defaultProp:a??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(db))):c.onClose(),i?.(e)},caller:mb}),w=e.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),k=e.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)},[x]),N=e.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),C=e.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,x(!0),m.current=0},v)},[v,x]);return e.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),g(hm,{...d,children:g(hb,{scope:n,contentId:f,open:b,stateAttribute:w,trigger:u,onTriggerChange:p,onTriggerEnter:e.useCallback(()=>{c.isOpenDelayedRef.current?C():k()},[c.isOpenDelayedRef,C,k]),onTriggerLeave:e.useCallback(()=>{h?N():(window.clearTimeout(m.current),m.current=0)},[N,h]),onOpen:k,onClose:N,disableHoverableContent:h,children:o})})};gb.displayName=mb;var yb="TooltipTrigger",bb=e.forwardRef((t,n)=>{const{__scopeTooltip:o,...r}=t,a=vb(yb,o),i=pb(yb,o),s=sb(o),l=tl(n,e.useRef(null),a.onTriggerChange),c=e.useRef(!1),d=e.useRef(!1),u=e.useCallback(()=>c.current=!1,[]);return e.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),g(vm,{asChild:!0,...s,children:g(hl.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:l,onPointerMove:ul(t.onPointerMove,e=>{"touch"!==e.pointerType&&(d.current||i.isPointerInTransitRef.current||(a.onTriggerEnter(),d.current=!0))}),onPointerLeave:ul(t.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:ul(t.onPointerDown,()=>{a.open&&a.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:ul(t.onFocus,()=>{c.current||a.onOpen()}),onBlur:ul(t.onBlur,a.onClose),onClick:ul(t.onClick,a.onClose)})})});bb.displayName=yb;var[xb,wb]=ib("TooltipPortal",{forceMount:void 0}),kb="TooltipContent",Nb=e.forwardRef((e,t)=>{const n=wb(kb,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...a}=e,i=vb(kb,e.__scopeTooltip);return g(gl,{present:o||i.open,children:i.disableHoverableContent?g(Sb,{side:r,...a,ref:t}):g(Cb,{side:r,...a,ref:t})})}),Cb=e.forwardRef((t,n)=>{const o=vb(kb,t.__scopeTooltip),r=pb(kb,t.__scopeTooltip),a=e.useRef(null),i=tl(n,a),[s,l]=e.useState(null),{trigger:c,onClose:d}=o,u=a.current,{onPointerInTransitChange:p}=r,f=e.useCallback(()=>{l(null),p(!1)},[p]),m=e.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())]);l(a),p(!0)},[p]);return e.useEffect(()=>()=>f(),[f]),e.useEffect(()=>{if(c&&u){const e=e=>m(e,u),t=e=>m(e,c);return c.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}},[c,u,m,f]),e.useEffect(()=>{if(s){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=c?.contains(t)||u?.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,s);o?f():r&&(f(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,u,s,d,f]),g(Sb,{...t,ref:i})}),[_b,Db]=ib(mb,{isInside:!1}),Eb=function(e){const t=e=>"child"in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=ol,t}("TooltipContent"),Sb=e.forwardRef((t,n)=>{const{__scopeTooltip:o,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=t,c=vb(kb,o),d=sb(o),{onClose:u}=c;return e.useEffect(()=>(document.addEventListener(db,u),()=>document.removeEventListener(db,u)),[u]),e.useEffect(()=>{if(c.trigger){const e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,u]),g(Tf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:y(gm,{"data-state":c.stateAttribute,...d,...l,ref:n,style:{...l.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:[g(Eb,{children:r}),g(_b,{scope:o,isInside:!0,children:g(Nm,{id:c.contentId,role:"tooltip",children:a||r})})]})})});Nb.displayName=kb;var Mb="TooltipArrow";e.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=sb(n);return Db(Mb,n).isInside?null:g(ym,{...r,...o,ref:t})}).displayName=Mb;var Ob=Nb;const Tb=fb,Rb=gb,Pb=bb,Ab=e.forwardRef(({className:e,sideOffset:t=4,...n},o)=>g(Ob,{ref:o,sideOffset:t,className:Qe("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),...n}));Ab.displayName=Ob.displayName;const Ib=j("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"}}),Fb=e.forwardRef(({className:e,variant:t,...n},o)=>g("div",{ref:o,role:"alert",className:Qe(Ib({variant:t}),e),...n}));Fb.displayName="Alert";const jb=e.forwardRef(({className:e,...t},n)=>g("h5",{ref:n,className:Qe("mb-1 font-medium leading-none tracking-tight",e),...t}));jb.displayName="AlertTitle";const zb=e.forwardRef(({className:e,...t},n)=>g("div",{ref:n,className:Qe("text-sm [&_p]:leading-relaxed",e),...t}));function Lb({...e}){return g("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Wb({className:e,...t}){return g("ol",{"data-slot":"breadcrumb-list",className:Qe("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function Bb({className:e,...t}){return g("li",{"data-slot":"breadcrumb-item",className:Qe("inline-flex items-center gap-1.5",e),...t})}function $b({asChild:e,className:t,...n}){return g(e?M:"a",{"data-slot":"breadcrumb-link",className:Qe("hover:text-foreground transition-colors",t),...n})}function Yb({className:e,...t}){return g("span",{"data-slot":"breadcrumb-page","aria-disabled":"true","aria-current":"page",className:Qe("text-foreground font-normal",e),...t})}function qb({children:e,className:t,...n}){return g("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Qe("[&>svg]:size-3.5",t),...n,children:e??g(Ni,{})})}function Hb({className:e,...t}){return y("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:Qe("flex size-9 items-center justify-center",e),...t,children:[g(Oi,{className:"size-4"}),g("span",{className:"sr-only",children:"More"})]})}zb.displayName="AlertDescription";var Ub="rovingFocusGroup.onEntryFocus",Kb={bubbles:!1,cancelable:!0},Vb="RovingFocusGroup",[Gb,Zb,Xb]=dl(Vb),[Qb,Jb]=Xs(Vb,[Xb]),[ex,tx]=Qb(Vb),nx=e.forwardRef((e,t)=>g(Gb.Provider,{scope:e.__scopeRovingFocusGroup,children:g(Gb.Slot,{scope:e.__scopeRovingFocusGroup,children:g(ox,{...e,ref:t})})}));nx.displayName=Vb;var ox=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,orientation:r,loop:a=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=t,f=e.useRef(null),m=tl(n,f),h=Ll(i),[v,y]=ml({prop:s,defaultProp:l??null,onChange:c,caller:Vb}),[b,x]=e.useState(!1),w=_f(d),k=Zb(o),N=e.useRef(!1),[C,_]=e.useState(0);return e.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(Ub,w),()=>e.removeEventListener(Ub,w)},[w]),g(ex,{scope:o,orientation:r,dir:h,loop:a,currentTabStopId:v,onItemFocus:e.useCallback(e=>y(e),[y]),onItemShiftTab:e.useCallback(()=>x(!0),[]),onFocusableItemAdd:e.useCallback(()=>_(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>_(e=>e-1),[]),children:g(hl.div,{tabIndex:b||0===C?-1:0,"data-orientation":r,...p,ref:m,style:{outline:"none",...t.style},onMouseDown:ul(t.onMouseDown,()=>{N.current=!0}),onFocus:ul(t.onFocus,e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(Ub,Kb);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);sx([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),u)}}N.current=!1}),onBlur:ul(t.onBlur,()=>x(!1))})})}),rx="RovingFocusGroupItem",ax=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:o,focusable:r=!0,active:a=!1,tabStopId:i,children:s,...l}=t,c=kl(),d=i||c,u=tx(rx,o),p=u.currentTabStopId===d,f=Zb(o),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:v}=u;return e.useEffect(()=>{if(r)return m(),()=>h()},[r,m,h]),g(Gb.ItemSlot,{scope:o,id:d,focusable:r,active:a,children:g(hl.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:n,onMouseDown:ul(t.onMouseDown,e=>{r?u.onItemFocus(d):e.preventDefault()}),onFocus:ul(t.onFocus,()=>u.onItemFocus(d)),onKeyDown:ul(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void u.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:ix[o]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=f().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=u.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>sx(r))}var n,o}),children:"function"==typeof s?s({isCurrentTabStop:p,hasTabStop:null!=v}):s})})});ax.displayName=rx;var ix={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sx(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 lx=nx,cx=ax,dx=["Enter"," "],ux=["ArrowUp","PageDown","End"],px=["ArrowDown","PageUp","Home",...ux],fx={ltr:[...dx,"ArrowRight"],rtl:[...dx,"ArrowLeft"]},mx={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hx="Menu",[vx,gx,yx]=dl(hx),[bx,xx]=Xs(hx,[yx,Jf,Jb]),wx=Jf(),kx=Jb(),[Nx,Cx]=bx(hx),[_x,Dx]=bx(hx),Ex=t=>{const{__scopeMenu:n,open:o=!1,children:r,dir:a,onOpenChange:i,modal:s=!0}=t,l=wx(n),[c,d]=e.useState(null),u=e.useRef(!1),p=_f(i),f=Ll(a);return e.useEffect(()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.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})}},[]),e.useEffect(()=>{if(!o)return;const e=()=>p(!1);return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[o,p]),g(hm,{...l,children:g(Nx,{scope:n,open:o,onOpenChange:p,content:c,onContentChange:d,children:g(_x,{scope:n,onClose:e.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:u,dir:f,modal:s,children:r})})})};Ex.displayName=hx;var Sx=e.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=wx(n);return g(vm,{...r,...o,ref:t})});Sx.displayName="MenuAnchor";var Mx="MenuPortal",[Ox,Tx]=bx(Mx,{forceMount:void 0}),Rx=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,a=Cx(Mx,t);return g(Ox,{scope:t,forceMount:n,children:g(gl,{present:n||a.open,children:g(bm,{asChild:!0,container:r,children:o})})})};Rx.displayName=Mx;var Px="MenuContent",[Ax,Ix]=bx(Px),Fx=e.forwardRef((e,t)=>{const n=Tx(Px,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,a=Cx(Px,e.__scopeMenu),i=Dx(Px,e.__scopeMenu);return g(vx.Provider,{scope:e.__scopeMenu,children:g(gl,{present:o||a.open,children:g(vx.Slot,{scope:e.__scopeMenu,children:i.modal?g(jx,{...r,ref:t}):g(zx,{...r,ref:t})})})})}),jx=e.forwardRef((t,n)=>{const o=Cx(Px,t.__scopeMenu),r=e.useRef(null),a=tl(n,r);return e.useEffect(()=>{const e=r.current;if(e)return Nr(e)},[]),g(Wx,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:ul(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),zx=e.forwardRef((e,t)=>{const n=Cx(Px,e.__scopeMenu);return g(Wx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Lx=nl("MenuContent.ScrollLock"),Wx=e.forwardRef((t,n)=>{const{__scopeMenu:o,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,onDismiss:m,disableOutsideScroll:h,...v}=t,y=Cx(Px,o),b=Dx(Px,o),x=wx(o),w=kx(o),k=gx(o),[N,C]=e.useState(null),_=e.useRef(null),D=tl(n,_,y.onContentChange),E=e.useRef(0),S=e.useRef(""),M=e.useRef(0),O=e.useRef(null),T=e.useRef("right"),R=e.useRef(0),P=h?vr:e.Fragment,A=h?{as:Lx,allowPinchZoom:!0}:void 0,I=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(E.current),""!==t&&(E.current=window.setTimeout(()=>e(""),1e3))}(t),i&&setTimeout(()=>i.focus())};e.useEffect(()=>()=>window.clearTimeout(E.current),[]),Ff();const F=e.useCallback(e=>T.current===O.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,O.current?.area),[]);return g(Ax,{scope:o,searchRef:S,onItemEnter:e.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:e.useCallback(e=>{F(e)||(_.current?.focus(),C(null))},[F]),onTriggerLeave:e.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:M,onPointerGraceIntentChange:e.useCallback(e=>{O.current=e},[]),children:g(P,{...A,children:g(Bf,{asChild:!0,trapped:a,onMountAutoFocus:ul(i,e=>{e.preventDefault(),_.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:g(Tf,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,onDismiss:m,children:g(lx,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:C,onEntryFocus:ul(c,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:g(gm,{role:"menu","aria-orientation":"vertical","data-state":mw(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:D,style:{outline:"none",...v.style},onKeyDown:ul(v.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&&I(e.key));const r=_.current;if(e.target!==r)return;if(!px.includes(e.key))return;e.preventDefault();const a=k().filter(e=>!e.disabled).map(e=>e.ref.current);ux.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:ul(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),S.current="")}),onPointerMove:ul(t.onPointerMove,gw(e=>{const t=e.target,n=R.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>R.current?"right":"left";T.current=t,R.current=e.clientX}}))})})})})})})});Fx.displayName=Px;var Bx=e.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return g(hl.div,{role:"group",...o,ref:t})});Bx.displayName="MenuGroup";var $x=e.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return g(hl.div,{...o,ref:t})});$x.displayName="MenuLabel";var Yx="MenuItem",qx="menu.itemSelect",Hx=e.forwardRef((t,n)=>{const{disabled:o=!1,onSelect:r,...a}=t,i=e.useRef(null),s=Dx(Yx,t.__scopeMenu),l=Ix(Yx,t.__scopeMenu),c=tl(n,i),d=e.useRef(!1);return g(Ux,{...a,ref:c,disabled:o,onClick:ul(t.onClick,()=>{const e=i.current;if(!o&&e){const t=new CustomEvent(qx,{bubbles:!0,cancelable:!0});e.addEventListener(qx,e=>r?.(e),{once:!0}),vl(e,t),t.defaultPrevented?d.current=!1:s.onClose()}}),onPointerDown:e=>{t.onPointerDown?.(e),d.current=!0},onPointerUp:ul(t.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:ul(t.onKeyDown,e=>{const t=""!==l.searchRef.current;o||t&&" "===e.key||dx.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Hx.displayName=Yx;var Ux=e.forwardRef((t,n)=>{const{__scopeMenu:o,disabled:r=!1,textValue:a,...i}=t,s=Ix(Yx,o),l=kx(o),c=e.useRef(null),d=tl(n,c),[u,p]=e.useState(!1),[f,m]=e.useState("");return e.useEffect(()=>{const e=c.current;e&&m((e.textContent??"").trim())},[i.children]),g(vx.ItemSlot,{scope:o,disabled:r,textValue:a??f,children:g(cx,{asChild:!0,...l,focusable:!r,children:g(hl.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:ul(t.onPointerMove,gw(e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:ul(t.onPointerLeave,gw(e=>s.onItemLeave(e))),onFocus:ul(t.onFocus,()=>p(!0)),onBlur:ul(t.onBlur,()=>p(!1))})})})}),Kx=e.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return g(tw,{scope:e.__scopeMenu,checked:n,children:g(Hx,{role:"menuitemcheckbox","aria-checked":hw(n)?"mixed":n,...r,ref:t,"data-state":vw(n),onSelect:ul(r.onSelect,()=>o?.(!!hw(n)||!n),{checkForDefaultPrevented:!1})})})});Kx.displayName="MenuCheckboxItem";var Vx="MenuRadioGroup",[Gx,Zx]=bx(Vx,{value:void 0,onValueChange:()=>{}}),Xx=e.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,a=_f(o);return g(Gx,{scope:e.__scopeMenu,value:n,onValueChange:a,children:g(Bx,{...r,ref:t})})});Xx.displayName=Vx;var Qx="MenuRadioItem",Jx=e.forwardRef((e,t)=>{const{value:n,...o}=e,r=Zx(Qx,e.__scopeMenu),a=n===r.value;return g(tw,{scope:e.__scopeMenu,checked:a,children:g(Hx,{role:"menuitemradio","aria-checked":a,...o,ref:t,"data-state":vw(a),onSelect:ul(o.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Jx.displayName=Qx;var ew="MenuItemIndicator",[tw,nw]=bx(ew,{checked:!1}),ow=e.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,a=nw(ew,n);return g(gl,{present:o||hw(a.checked)||!0===a.checked,children:g(hl.span,{...r,ref:t,"data-state":vw(a.checked)})})});ow.displayName=ew;var rw=e.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return g(hl.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});rw.displayName="MenuSeparator";var aw=e.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=wx(n);return g(ym,{...r,...o,ref:t})});aw.displayName="MenuArrow";var iw="MenuSub",[sw,lw]=bx(iw),cw=t=>{const{__scopeMenu:n,children:o,open:r=!1,onOpenChange:a}=t,i=Cx(iw,n),s=wx(n),[l,c]=e.useState(null),[d,u]=e.useState(null),p=_f(a);return e.useEffect(()=>(!1===i.open&&p(!1),()=>p(!1)),[i.open,p]),g(hm,{...s,children:g(Nx,{scope:n,open:r,onOpenChange:p,content:d,onContentChange:u,children:g(sw,{scope:n,contentId:kl(),triggerId:kl(),trigger:l,onTriggerChange:c,children:o})})})};cw.displayName=iw;var dw="MenuSubTrigger",uw=e.forwardRef((t,n)=>{const o=Cx(dw,t.__scopeMenu),r=Dx(dw,t.__scopeMenu),a=lw(dw,t.__scopeMenu),i=Ix(dw,t.__scopeMenu),s=e.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:t.__scopeMenu},u=e.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return e.useEffect(()=>u,[u]),e.useEffect(()=>{const e=l.current;return()=>{window.clearTimeout(e),c(null)}},[l,c]),g(Sx,{asChild:!0,...d,children:g(Ux,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?a.contentId:void 0,"data-state":mw(o.open),...t,ref:el(n,a.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:ul(t.onPointerMove,gw(e=>{i.onItemEnter(e),e.defaultPrevented||t.disabled||o.open||s.current||(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{o.onOpenChange(!0),u()},100))})),onPointerLeave:ul(t.onPointerLeave,gw(e=>{u();const t=o.content?.getBoundingClientRect();if(t){const n=o.content?.dataset.side,r="right"===n,a=r?-5:5,s=t[r?"left":"right"],c=t[r?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:s,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ul(t.onKeyDown,e=>{const n=""!==i.searchRef.current;t.disabled||n&&" "===e.key||fx[r.dir].includes(e.key)&&(o.onOpenChange(!0),o.content?.focus(),e.preventDefault())})})})});uw.displayName=dw;var pw="MenuSubContent",fw=e.forwardRef((t,n)=>{const o=Tx(Px,t.__scopeMenu),{forceMount:r=o.forceMount,align:a="start",...i}=t,s=Cx(Px,t.__scopeMenu),l=Dx(Px,t.__scopeMenu),c=lw(pw,t.__scopeMenu),d=e.useRef(null),u=tl(n,d);return g(vx.Provider,{scope:t.__scopeMenu,children:g(gl,{present:r||s.open,children:g(vx.Slot,{scope:t.__scopeMenu,children:g(Wx,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:u,align:a,side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:ul(t.onFocusOutside,e=>{e.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ul(t.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:ul(t.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=mx[l.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});function mw(e){return e?"open":"closed"}function hw(e){return"indeterminate"===e}function vw(e){return hw(e)?"indeterminate":e?"checked":"unchecked"}function gw(e){return t=>"mouse"===t.pointerType?e(t):void 0}fw.displayName=pw;var yw=Ex,bw=Sx,xw=Rx,ww=Fx,kw=Bx,Nw=$x,Cw=Hx,_w=Kx,Dw=Xx,Ew=Jx,Sw=ow,Mw=rw,Ow=aw,Tw=cw,Rw=uw,Pw=fw,Aw="DropdownMenu",[Iw]=Xs(Aw,[xx]),Fw=xx(),[jw,zw]=Iw(Aw),Lw=t=>{const{__scopeDropdownMenu:n,children:o,dir:r,open:a,defaultOpen:i,onOpenChange:s,modal:l=!0}=t,c=Fw(n),d=e.useRef(null),[u,p]=ml({prop:a,defaultProp:i??!1,onChange:s,caller:Aw});return g(jw,{scope:n,triggerId:kl(),triggerRef:d,contentId:kl(),open:u,onOpenChange:p,onOpenToggle:e.useCallback(()=>p(e=>!e),[p]),modal:l,children:g(yw,{...c,open:u,onOpenChange:p,dir:r,modal:l,children:o})})};Lw.displayName=Aw;var Ww="DropdownMenuTrigger",Bw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,a=zw(Ww,n),i=Fw(n);return g(bw,{asChild:!0,...i,children:g(hl.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:el(t,a.triggerRef),onPointerDown:ul(e.onPointerDown,e=>{o||0!==e.button||!1!==e.ctrlKey||(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:ul(e.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});Bw.displayName=Ww;var $w=e=>{const{__scopeDropdownMenu:t,...n}=e,o=Fw(t);return g(xw,{...o,...n})};$w.displayName="DropdownMenuPortal";var Yw="DropdownMenuContent",qw=e.forwardRef((t,n)=>{const{__scopeDropdownMenu:o,...r}=t,a=zw(Yw,o),i=Fw(o),s=e.useRef(!1);return g(ww,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:n,onCloseAutoFocus:ul(t.onCloseAutoFocus,e=>{s.current||a.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:ul(t.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;a.modal&&!o||(s.current=!0)}),style:{...t.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)"}})});qw.displayName=Yw;var Hw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(kw,{...r,...o,ref:t})});Hw.displayName="DropdownMenuGroup";var Uw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Nw,{...r,...o,ref:t})});Uw.displayName="DropdownMenuLabel";var Kw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Cw,{...r,...o,ref:t})});Kw.displayName="DropdownMenuItem";var Vw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(_w,{...r,...o,ref:t})});Vw.displayName="DropdownMenuCheckboxItem";var Gw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Dw,{...r,...o,ref:t})});Gw.displayName="DropdownMenuRadioGroup";var Zw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Ew,{...r,...o,ref:t})});Zw.displayName="DropdownMenuRadioItem";var Xw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Sw,{...r,...o,ref:t})});Xw.displayName="DropdownMenuItemIndicator";var Qw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Mw,{...r,...o,ref:t})});Qw.displayName="DropdownMenuSeparator";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Ow,{...r,...o,ref:t})}).displayName="DropdownMenuArrow";var Jw=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Rw,{...r,...o,ref:t})});Jw.displayName="DropdownMenuSubTrigger";var ek=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fw(n);return g(Pw,{...r,...o,ref:t,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)"}})});ek.displayName="DropdownMenuSubContent";var tk=$w,nk=qw,ok=Uw,rk=Kw,ak=Vw,ik=Zw,sk=Xw,lk=Qw,ck=Jw,dk=ek;const uk=Lw,pk=Bw,fk=Hw,mk=tk,hk=e=>{const{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:r,defaultOpen:a}=e,i=Fw(t),[s,l]=ml({prop:o,defaultProp:a??!1,onChange:r,caller:"DropdownMenuSub"});return g(Tw,{...i,open:s,onOpenChange:l,children:n})},vk=Gw,gk=e.forwardRef(({className:e,inset:t,children:n,...o},r)=>y(ck,{ref:r,className:Qe("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",t&&"pl-8",e),...o,children:[n,g(Ni,{className:"ml-auto h-4 w-4"})]}));gk.displayName=ck.displayName;const yk=e.forwardRef(({className:e,...t},n)=>g(dk,{ref:n,className:Qe("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),...t}));yk.displayName=dk.displayName;const bk=e.forwardRef(({className:e,sideOffset:t=4,...n},o)=>g(tk,{children:g(nk,{ref:o,sideOffset:t,className:Qe("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),...n})}));bk.displayName=nk.displayName;const xk=e.forwardRef(({className:e,inset:t,...n},o)=>g(rk,{ref:o,className:Qe("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",t&&"pl-8",e),...n}));xk.displayName=rk.displayName;const wk=e.forwardRef(({className:e,children:t,checked:n,...o},r)=>y(ak,{ref:r,className:Qe("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:n,...o,children:[g("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g(sk,{children:g(xi,{className:"h-4 w-4"})})}),t]}));wk.displayName=ak.displayName;const kk=e.forwardRef(({className:e,children:t,...n},o)=>y(ik,{ref:o,className:Qe("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),...n,children:[g("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g(sk,{children:g(Di,{className:"h-2 w-2 fill-current"})})}),t]}));kk.displayName=ik.displayName;const Nk=e.forwardRef(({className:e,inset:t,...n},o)=>g(ok,{ref:o,className:Qe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Nk.displayName=ok.displayName;const Ck=e.forwardRef(({className:e,...t},n)=>g(lk,{ref:n,className:Qe("-mx-1 my-1 h-px bg-muted",e),...t}));Ck.displayName=lk.displayName;const _k=({className:e,...t})=>g("span",{className:Qe("ml-auto text-xs tracking-widest opacity-60",e),...t});_k.displayName="DropdownMenuShortcut";const Dk=e.forwardRef(({className:e,...t},n)=>g("input",{type:"radio",className:Qe("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:n,...t}));Dk.displayName="Radio";const Ek=({size:e=8})=>y("output",{children:[y("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:[g("title",{id:"spinnerTitle",children:"Loading..."}),g("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"}),g("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"}),g("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"}),g("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"}),g("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"}),g("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"}),g("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"}),g("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"}),g("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"})]}),g("span",{className:"sr-only",children:"Loading..."})]}),Sk=({error:e})=>g(b,{children:e&&g("span",{className:"text-red-500 text-xs",children:e?.message})}),Mk=({message:e,error:t})=>{const[n,o]=d(!1),r=JSON.stringify(t,null,2);return y(dt,{children:[g("p",{children:e}),g(yc,{type:"single",collapsible:!0,className:"max-w-60",children:y(bc,{value:"error-details",className:"border-none",children:[g(xc,{className:"text-sm py-2 hover:no-underline text-red-100",children:"View Error Details"}),g(wc,{children:g("pre",{className:"text-xs bg-red-950 p-3 rounded overflow-x-auto max-h-40 overflow-y-auto",children:g("code",{className:"text-red-100",children:r})})})]})}),g("button",{type:"button",onClick:()=>{const e=JSON.stringify(t,null,2);navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!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:y(b,n?{children:[g(xi,{size:14}),g("span",{children:"Copied!"})]}:{children:[g(Si,{size:14}),g("span",{children:"Copy Error JSON"})]})})]})};function Ok({icon:e,title:t,description:n,variant:o="default",className:r}){return y(Fb,{variant:o,className:r??"w-auto h-auto m-4",children:[e,g(jb,{children:t}),g(zb,{children:n})]})}const Tk=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??[]},Rk=(e,t,n={})=>o=>Tk(e,{...o,labelName:t,additionalFilters:n.additionalFilters,fields:n.fields});function Pk({value:e,onChange:t,placeholder:n,error:o,disabled:a,className:s}){const l=r(null),[c,u]=d(null);return i(()=>{let e=!0;return Promise.all([import("@toast-ui/react-editor"),import("@toast-ui/editor/dist/toastui-editor.css")]).then(([t])=>{e&&u(()=>t.Editor)}),()=>{e=!1}},[]),c?y(dt,{direction:"col",gap:2,className:s??"w-full",children:[g(c,{initialValue:e,placeholder:n,usageStatistics:!1,autofocus:!1,initialEditType:"wysiwyg",previewStyle:"disabled",useCommandShortcut:!0,hideModeSwitch:a,onChange:()=>{const e=l.current?.getInstance()?.getMarkdown()??"";t(e)},ref:l}),o&&g("p",{className:"text-sm text-destructive",children:o})]}):g(dt,{direction:"col",gap:2,className:s??"w-full min-h-[200px]",children:g("span",{})})}function Ak(){return y("div",{className:"flex flex-col items-center justify-center mx-auto",children:[g(Ek,{size:12}),g("p",{className:"mt-2 text-sm text-gray-500",children:"Loading..."})]})}const Ik=({children:e,hasError:t,message:n="Um erro inesperado ocorreu."})=>t?g(Fb,{variant:"destructive",className:"my-2",children:n}):g(b,{children:e}),Fk=({openDialog:e,setOpenDialog:t,handleDelete:n,count:o})=>{const r=void 0!==o&&o>1;return g(dt,{direction:"row",children:g(vd,{open:e,onOpenChange:t,children:y(xd,{className:"max-w-[513px] rounded-xl px-8 py-6 gap-4",children:[y(wd,{children:[g(Nd,{className:"pb-0 border-none",children:r?`Deseja apagar ${o} registros selecionados?`:"Deseja apagar registro atual?"}),g(Cd,{})]}),g("form",{onSubmit:e=>{e.preventDefault(),n()},children:y(dt,{gap:2,children:[g("p",{className:"text-fontcolor-secondary font-medium text-sm",children:r?`Essa ação não poderá ser desfeita e os ${o} 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?"}),y(kd,{className:"mt-4",children:[g(Zr,{asChild:!0,children:g(tt,{variant:"ghost",type:"button",children:"Cancelar"})}),g(tt,{type:"submit",variant:"default",children:r?`Deletar ${o}`:"Deletar"})]})]})})]})})})},jk=({handleClear:e})=>g("button",{type:"button",className:"h-10 p-2 mt-1 text-xs bg-white",onClick:e,children:y(dt,{direction:"row",gap:2,className:"items-center",children:["Limpar filtros ",g(zi,{size:16})]})}),zk=({triggerClassName:e,className:t,trigger:n,children:o})=>{const r=v();return g(Tb,{children:y(Rb,{children:[g(Pb,{asChild:!0,children:g("div",{className:e,children:n})}),g(Ab,{className:t,children:o})]})},r)},Lk=({startRecord:e,endRecord:t,hasValidSearchValues:n,tabCount:o,disabledLoadBackButton:r,disabledLoadMoreButton:a,loadBack:i,loadMore:s})=>y("div",{className:"flex items-center gap-2 text-fontcolor-secondary",children:[g("div",{className:"text-sm",children:y("p",{children:[e," - ",t," de"," ",n?t:o]})}),y("div",{className:"h-[32px] flex items-center",children:[g(zk,{className:"bg-zinc-900 text-white",trigger:g(tt,{variant:"ghost",disabled:r,onClick:()=>i(),type:"button",className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:g("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:g(ki,{size:16})})}),children:"Anteriores"}),g(zk,{className:"bg-zinc-900 text-white",trigger:g(tt,{variant:"ghost",disabled:a,onClick:()=>s(),className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:g("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:g(Ni,{size:16})})}),children:"Próximos"})]})]});function Wk({value:e=[],onChange:t,keyPlaceholder:n="Chave",valuePlaceholder:o="Valor",disabled:r=!1}){const[a,i]=d(""),[s,l]=d(""),c=()=>{const n=a.trim(),o=s.trim();if(n&&o){e.some(e=>e.key===n)||(t([...e,{key:n,value:o}]),i(""),l(""))}},u=e=>{"Enter"===e.key&&(e.preventDefault(),c())};return y(dt,{direction:"col",gap:3,children:[y(dt,{direction:"row",gap:2,children:[g(st,{value:a,onChange:e=>i(e.target.value),onKeyDown:u,placeholder:n,disabled:r,className:"flex-1"}),g(st,{value:s,onChange:e=>l(e.target.value),onKeyDown:u,placeholder:o,disabled:r,className:"flex-1"}),g(tt,{type:"button",onClick:c,disabled:!a.trim()||!s.trim()||r,variant:"outline",children:"Adicionar"})]}),e.length>0&&g(dt,{direction:"row",gap:2,className:"flex-wrap",children:e.map(n=>y(dt,{direction:"row",gap:1,className:"items-center px-3 py-1 bg-secondary text-secondary-foreground rounded-md text-sm",children:[y("span",{className:"font-medium",children:[n.key,":"]}),g("span",{children:n.value}),g(tt,{type:"button",onClick:()=>{return o=n.key,void t(e.filter(e=>e.key!==o));var o},disabled:r,variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-secondary-foreground/10 rounded-full","aria-label":`Remover tag ${n.key}`,children:g(zi,{className:"h-3 w-3"})})]},n.key))})]})}const Bk=({item:e,modelClass:t,propertyName:n,retrieveFile:o})=>{const[r,a]=d(!1);return g(tt,{variant:"outline",size:"icon",disabled:r||!o,onClick:async()=>{if(o){a(!0);try{const[r,a]=await o(t,Number(e[n]));if(a)return void ts.error(`Houve algum problema: ${a.message}`);if(!r)return void ts.error("Nenhum arquivo encontrado");const i=new Blob([new Uint8Array(r.data)],{type:r.contentType}),s=URL.createObjectURL(i),l=document.createElement("a");l.href=s,l.download=e.file.split(/[\\/]/).pop()??e.file,document.body.appendChild(l);try{l.click()}finally{document.body.removeChild(l),URL.revokeObjectURL(s)}ts.success("Arquivo baixado com sucesso!")}finally{a(!1)}}else ts.error("Função de download não configurada")},children:r?g(Ri,{className:"animate-spin"}):g(Mi,{})})};function $k({options:t,selected:n,onChange:o,placeholder:r="Select items...",className:a,maxDisplay:i=3}){const[s,l]=e.useState(!1),c=n.length===t.length&&t.length>0;return y(Ah,{open:s,onOpenChange:l,children:[g(jh,{className:Qe("w-full",a),children:g("span",{className:Qe("truncate flex-1 text-left",0===n.length&&"text-muted-foreground"),children:(()=>{if(0===n.length)return r;if(n.length>i)return`${n.length} items selected`;const e=n.map(e=>t.find(t=>t.value===e)?.label).join(", ");return e.length>80?`${n.length} item${1!==n.length?"s":""} selected`:e})()})}),y(Wh,{children:[t.length>0&&g("div",{className:"border-b border-border",children:y("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:[g(tb,{checked:c,onCheckedChange:()=>{o(c?[]:t.map(e=>e.value))}}),g("span",{className:"text-sm",children:c?"Unselect All":"Select All"})]})}),g("div",{className:"p-1 space-y-1",children:t.map(e=>y("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:[g(tb,{checked:n.includes(e.value),onCheckedChange:()=>(e=>{const t=n.includes(e)?n.filter(t=>t!==e):[...n,e];o(t)})(e.value)}),g("span",{className:"text-sm",children:e.label})]},e.value))}),n.length>0&&g("div",{className:"border-t border-border p-2 bg-muted",children:y("div",{className:"text-xs text-muted-foreground",children:[n.length," item",1!==n.length?"s":""," selected"]})})]})]})}export{yc as Accordion,wc as AccordionContent,bc as AccordionItem,xc as AccordionTrigger,Fb as Alert,zb as AlertDescription,Wa as AlertDialog,Ga as AlertDialogAction,Za as AlertDialogCancel,qa as AlertDialogContent,Va as AlertDialogDescription,Ua as AlertDialogFooter,Ha as AlertDialogHeader,Ya as AlertDialogOverlay,$a as AlertDialogPortal,Ka as AlertDialogTitle,Ba as AlertDialogTrigger,jb as AlertTitle,Ok as AlertWithIcon,si as Badge,Lb as Breadcrumb,Hb as BreadcrumbEllipsis,Bb as BreadcrumbItem,$b as BreadcrumbLink,Wb as BreadcrumbList,Yb as BreadcrumbPage,qb as BreadcrumbSeparator,tt as Button,wy as Calendar,Ja as Card,oi as CardContent,ni as CardDescription,ri as CardFooter,ei as CardHeader,ti as CardTitle,tb as Checkbox,jk as ClearButton,wf as Combobox,_d as Command,Dd as CommandDialog,Md as CommandEmpty,Od as CommandGroup,Ed as CommandInput,Rd as CommandItem,Sd as CommandList,Td as CommandSeparator,Pd as CommandShortcut,Xa as ConfirmationDialog,Cy as DatePicker,Fk as DeleteDialog,vd as Dialog,xd as DialogContent,Cd as DialogDescription,kd as DialogFooter,wd as DialogHeader,Nd as DialogTitle,gd as DialogTrigger,Bk as DownloadButton,uk as DropdownMenu,wk as DropdownMenuCheckboxItem,bk as DropdownMenuContent,fk as DropdownMenuGroup,xk as DropdownMenuItem,Nk as DropdownMenuLabel,mk as DropdownMenuPortal,vk as DropdownMenuRadioGroup,kk as DropdownMenuRadioItem,Ck as DropdownMenuSeparator,_k as DropdownMenuShortcut,hk as DropdownMenuSub,yk as DropdownMenuSubContent,gk as DropdownMenuSubTrigger,pk as DropdownMenuTrigger,Hn as Dropzone,kc as Empty,Mc as EmptyContainer,Sc as EmptyContent,Ec as EmptyDescription,Nc as EmptyHeader,_c as EmptyMedia,Dc as EmptyTitle,Ik as ErrorBoundary,Sk as ErrorMessage,Mk as ErrorToastContent,Nf as FKSelect,os as FileDropzone,st as Input,ab as Label,Ak as Loading,Pk as MarkdownEditor,$k as MultiSelectDropdown,_y as NoResult,Lk as Pagination,yf as Popover,xf as PopoverContent,bf as PopoverTrigger,ci as PumpwoodBadge,ai as PumpwoodCard,Fy as PumpwoodTable,Dk as Radio,Hh as Select,Wh as SelectContent,Ih as SelectGroup,$h as SelectItem,Bh as SelectLabel,Ah as SelectPrimitive,Lh as SelectScrollDownButton,zh as SelectScrollUpButton,Yh as SelectSeparator,jh as SelectTrigger,Fh as SelectValue,cs as Sidebar,Ay as Skeleton,Ek as Spinner,dt as Stack,jy as Table,Sy as TableBody,Py as TableCaption,Ry as TableCell,My as TableFooter,Ty as TableHead,Ey as TableHeader,Dy as TablePrimitive,Oy as TableRow,Iy as TableSkeleton,Ks as Tabs,Zs as TabsContent,Vs as TabsList,Gs as TabsTrigger,Wk as TagInput,ct as Textarea,Rb as Tooltip,zk as TooltipComponent,Ab as TooltipContent,Tb as TooltipProvider,Pb as TooltipTrigger,Qa as Typography,ii as badgeVariants,Rk as createFKSelectFetcher,Tk as fkSelectFetcher,li as pumpwoodBadgeVariants,is as useSidebarCollapse};
|