@malloy-publisher/sdk 0.0.239 → 0.0.241

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.
Files changed (43) hide show
  1. package/bunfig.toml +4 -0
  2. package/dist/ServerProvider-D40U1tBk.cjs.js +1 -0
  3. package/dist/{ServerProvider-kzoOMXNx.es.js → ServerProvider-FQ4I4dKu.es.js} +250 -241
  4. package/dist/client/api.d.ts +181 -109
  5. package/dist/client/configuration.d.ts +1 -1
  6. package/dist/client/index.cjs.js +1 -1
  7. package/dist/client/index.d.ts +1 -1
  8. package/dist/client/index.es.js +70 -68
  9. package/dist/components/{PageViewer/PageViewer.d.ts → DataAppViewer/DataAppViewer.d.ts} +6 -6
  10. package/dist/components/DataAppViewer/index.d.ts +1 -0
  11. package/dist/components/Package/ContentTypeIcon.d.ts +1 -1
  12. package/dist/components/ServerProvider.d.ts +2 -2
  13. package/dist/components/index.d.ts +1 -1
  14. package/dist/{core-DtPGM_JB.cjs.js → core-2tUy-45C.cjs.js} +1 -1
  15. package/dist/{core-BGHaIj_q.es.js → core-KFsKleo0.es.js} +1 -1
  16. package/dist/hooks/useGivensForm.d.ts +8 -4
  17. package/dist/{index-B2gBd2gP.cjs.js → index-C0EfXZ-k.cjs.js} +31 -31
  18. package/dist/{index-CEteIhTc.es.js → index-D2sq6csh.es.js} +1825 -1829
  19. package/dist/index.cjs.js +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.es.js +34 -34
  22. package/dist/utils/{pageEmbed.d.ts → dataAppEmbed.d.ts} +7 -7
  23. package/package.json +7 -4
  24. package/src/components/{PageViewer/PageViewer.tsx → DataAppViewer/DataAppViewer.tsx} +41 -36
  25. package/src/components/DataAppViewer/index.ts +1 -0
  26. package/src/components/Package/ContentTypeIcon.tsx +2 -2
  27. package/src/components/Package/Package.tsx +28 -30
  28. package/src/components/ServerProvider.tsx +2 -2
  29. package/src/components/given/GivenInput.spec.tsx +206 -0
  30. package/src/components/given/GivenInput.tsx +6 -1
  31. package/src/components/index.ts +1 -1
  32. package/src/hooks/useGivensForm.spec.ts +99 -0
  33. package/src/hooks/useGivensForm.ts +14 -5
  34. package/src/index.ts +1 -1
  35. package/src/utils/{pageEmbed.spec.ts → dataAppEmbed.spec.ts} +1 -1
  36. package/src/utils/{pageEmbed.ts → dataAppEmbed.ts} +9 -9
  37. package/test/README.md +130 -0
  38. package/test/setup.ts +26 -0
  39. package/tsconfig.json +12 -1
  40. package/tsconfig.spec.json +22 -0
  41. package/dist/ServerProvider-nJNqhxy6.cjs.js +0 -1
  42. package/dist/components/PageViewer/index.d.ts +0 -1
  43. package/src/components/PageViewer/index.ts +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";var Qv=Object.create;var sm=Object.defineProperty;var Xv=Object.getOwnPropertyDescriptor;var Zv=Object.getOwnPropertyNames;var Jv=Object.getPrototypeOf,eT=Object.prototype.hasOwnProperty;var tT=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zv(t))!eT.call(e,o)&&o!==n&&sm(e,o,{get:()=>t[o],enumerable:!(r=Xv(t,o))||r.enumerable});return e};var qs=(e,t,n)=>(n=e!=null?Qv(Jv(e)):{},tT(t||!e||!e.__esModule?sm(n,"default",{value:e,enumerable:!0}):n,e));const c=require("react/jsx-runtime"),w=require("@mui/material"),W=require("react"),Lr=require("@tanstack/react-query"),De=require("./ServerProvider-nJNqhxy6.cjs.js"),wu=require("markdown-to-jsx"),On=require("@mui/icons-material"),Ot=require("@mui/system"),nT=require("@emotion/styled"),rT=require("@emotion/react"),Ta=require("react-dom"),eb=require("@react-spring/web"),oT=require("react-router-dom");function tb(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=tb(W),iT=tb(Ta),am=e=>e,sT=()=>{let e=am;return{configure(t){e=t},generate(t){return e(t)},reset(){e=am}}},nb=sT();function mo(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function Fe(e){if(typeof e!="string")throw new Error(mo(7));return e.charAt(0).toUpperCase()+e.slice(1)}function lm(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function Tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function aT(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Qc={exports:{}},Xc,um;function lT(){if(um)return Xc;um=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Xc=e,Xc}var Zc,cm;function uT(){if(cm)return Zc;cm=1;var e=lT();function t(){}function n(){}return n.resetWarningCache=t,Zc=function(){function r(s,a,l,u,d,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Zc}var dm;function cT(){return dm||(dm=1,Qc.exports=uT()()),Qc.exports}var dT=cT();const Ee=Tr(dT);function rb(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=rb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ue(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=rb(e))&&(r&&(r+=" "),r+=t);return r}function Ke(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let s="",a=!0;for(let l=0;l<i.length;l+=1){const u=i[l];u&&(s+=(a===!0?"":" ")+t(u),a=!1,n&&n[u]&&(s+=" "+n[u]))}r[o]=s}return r}var Jc={exports:{}},$t={};/**
1
+ "use strict";var Qv=Object.create;var sm=Object.defineProperty;var Xv=Object.getOwnPropertyDescriptor;var Zv=Object.getOwnPropertyNames;var Jv=Object.getPrototypeOf,eT=Object.prototype.hasOwnProperty;var tT=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zv(t))!eT.call(e,o)&&o!==n&&sm(e,o,{get:()=>t[o],enumerable:!(r=Xv(t,o))||r.enumerable});return e};var qs=(e,t,n)=>(n=e!=null?Qv(Jv(e)):{},tT(t||!e||!e.__esModule?sm(n,"default",{value:e,enumerable:!0}):n,e));const c=require("react/jsx-runtime"),w=require("@mui/material"),W=require("react"),Lr=require("@tanstack/react-query"),De=require("./ServerProvider-D40U1tBk.cjs.js"),Ot=require("@mui/system"),nT=require("@emotion/styled"),rT=require("@emotion/react"),wu=require("markdown-to-jsx"),On=require("@mui/icons-material"),Ta=require("react-dom"),eb=require("@react-spring/web"),oT=require("react-router-dom");function tb(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=tb(W),iT=tb(Ta),am=e=>e,sT=()=>{let e=am;return{configure(t){e=t},generate(t){return e(t)},reset(){e=am}}},nb=sT();function mo(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function Fe(e){if(typeof e!="string")throw new Error(mo(7));return e.charAt(0).toUpperCase()+e.slice(1)}function lm(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function Tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function aT(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Qc={exports:{}},Xc,um;function lT(){if(um)return Xc;um=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Xc=e,Xc}var Zc,cm;function uT(){if(cm)return Zc;cm=1;var e=lT();function t(){}function n(){}return n.resetWarningCache=t,Zc=function(){function r(s,a,l,u,d,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Zc}var dm;function cT(){return dm||(dm=1,Qc.exports=uT()()),Qc.exports}var dT=cT();const Ee=Tr(dT);function rb(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=rb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ue(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=rb(e))&&(r&&(r+=" "),r+=t);return r}function Ke(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let s="",a=!0;for(let l=0;l<i.length;l+=1){const u=i[l];u&&(s+=(a===!0?"":" ")+t(u),a=!1,n&&n[u]&&(s+=" "+n[u]))}r[o]=s}return r}var Jc={exports:{}},$t={};/**
2
2
  * @license React
3
3
  * react-is.production.js
4
4
  *
@@ -89,8 +89,8 @@ import {${t.sourceName}}" from '${t.modelPath}'"
89
89
  - [ ] `),/^\d+.\s/.test(s)&&(v=`
90
90
  `+(parseInt(s)+1)+". "),is(r,v)}else if(e.code&&e.code.toLowerCase()==="keyd"&&e.ctrlKey){du(e);var S={start:r.selectionStart,end:r.selectionEnd},I=S;S=$a({text:r.value,selection:S});var T=r.value.slice(S.start,S.end);a.setSelectionRange({start:S.end,end:S.end}),is(r,`
91
91
  `+T),a.setSelectionRange({start:I.start,end:I.end})}else e.code&&e.code.toLowerCase()==="arrowup"&&e.altKey?ag(e,-1):e.code&&e.code.toLowerCase()==="arrowdown"&&e.altKey&&ag(e,1)}var VR=["prefixCls","onChange"],WR=["markdown","commands","fullscreen","preview","highlightEnable","extraCommands","tabSize","defaultTabEnable","autoFocusEnd","textareaWarp","dispatch"];function qR(e){var{prefixCls:t,onChange:n}=e,r=Ze(e,VR),o=W.useContext(Is),{markdown:i,commands:s,fullscreen:a,preview:l,highlightEnable:u,extraCommands:d,tabSize:f,defaultTabEnable:h,autoFocusEnd:p,textareaWarp:m,dispatch:b}=o;Ze(o,WR);var y=W.useRef(null),x=W.useRef(),C=W.useRef({fullscreen:a,preview:l});W.useEffect(()=>{C.current={fullscreen:a,preview:l,highlightEnable:u}},[a,l,u]),W.useEffect(()=>{if(y.current&&b){var S=new Sp(y.current);x.current=S,b({textarea:y.current,commandOrchestrator:S})}},[]),W.useEffect(()=>{if(p&&y.current&&m){y.current.focus();var S=y.current.value.length;y.current.setSelectionRange(S,S),setTimeout(()=>{m&&(m.scrollTop=m.scrollHeight),y.current&&(y.current.scrollTop=y.current.scrollHeight)},0)}},[m]);var v=S=>{UR(S,f,h),jx(S,[...s||[],...d||[]],x.current,b,C.current)};return W.useEffect(()=>(y.current&&y.current.addEventListener("keydown",v),()=>{y.current&&y.current.removeEventListener("keydown",v)}),[]),c.jsx("textarea",Y({autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1},r,{ref:y,className:t+"-text-input "+(r.className?r.className:""),value:i,onChange:S=>{b&&b({markdown:S.target.value}),n&&n(S)}}))}var YR=["prefixCls","className","onScroll","renderTextarea"];function KR(e){var t=e||{},{prefixCls:n,className:r,onScroll:o,renderTextarea:i}=t,s=Ze(t,YR),{markdown:a,scrollTop:l,commands:u,extraCommands:d,dispatch:f}=W.useContext(Is),h=W.useRef(null),p=W.useRef(),m=W.createRef();W.useEffect(()=>{var y={};m.current&&(y.textareaWarp=m.current||void 0,m.current.scrollTop=l||0),f&&f(Y({},y))},[]),W.useEffect(()=>{if(h.current&&f){var y=new Sp(h.current);p.current=y,f({textarea:h.current,commandOrchestrator:y})}},[]);var b={WebkitTextFillColor:"initial",overflow:"auto"};return c.jsx("div",{ref:m,className:n+"-area "+(r||""),onScroll:o,children:c.jsx("div",{className:n+"-text",children:i?W.cloneElement(i(Y({},s,{value:a,autoComplete:"off",autoCorrect:"off",spellCheck:"false",autoCapitalize:"off",className:n+"-text-input",style:{WebkitTextFillColor:"inherit",overflow:"auto"}}),{dispatch:f,onChange:s.onChange,shortcuts:jx,useContext:{commands:u,extraCommands:d,commandOrchestrator:p.current}}),{ref:h}):c.jsx(W.Fragment,{children:c.jsx(qR,Y({prefixCls:n},s,{style:b}))})})})}function GR(e){var{prefixCls:t,groupName:n,commands:r,children:o}=e||{},{barPopup:i={}}=W.useContext(Is);return W.useMemo(()=>c.jsx("div",{className:t+"-toolbar-child "+(n&&i[n]?"active":""),onClick:s=>s.stopPropagation(),children:Array.isArray(r)?c.jsx(Vx,Y({commands:r},e,{isChild:!0})):o}),[r,i,n,t])}function lg(e){var{prefixCls:t,overflow:n}=e,{fullscreen:r,preview:o,barPopup:i={},components:s,commandOrchestrator:a,dispatch:l}=W.useContext(Is),u=W.useRef("");function d(f,h){if(l){var p={barPopup:Y({},i)};f.keyCommand==="preview"&&(p.preview=f.value),f.keyCommand==="fullscreen"&&(p.fullscreen=!r),e.commands&&f.keyCommand==="group"?e.commands.forEach(m=>{h===m.groupName?p.barPopup[h]=!0:m.keyCommand&&(p.barPopup[m.groupName]=!1)}):(h||f.parent)&&Object.keys(p.barPopup||{}).forEach(m=>{p.barPopup[m]=!1}),Object.keys(p).length&&l(Y({},p)),a&&a.executeCommand(f)}}return W.useEffect(()=>{document&&n&&(r?document.body.style.overflow="hidden":(u.current||(u.current=window.getComputedStyle(document.body,null).overflow),document.body.style.overflow=u.current))},[r,u,n]),c.jsx("ul",{children:(e.commands||[]).map((f,h)=>{if(f.keyCommand==="divider")return c.jsx("li",Y({},f.liProps,{className:t+"-toolbar-divider"}),h);if(!f.keyCommand)return c.jsx(W.Fragment,{},h);var p=r&&f.keyCommand==="fullscreen"||f.keyCommand==="preview"&&o===f.value,m=f.children&&typeof f.children=="function"?f.children({getState:()=>a.getState(),textApi:a?a.textApi:void 0,close:()=>d({},f.groupName),execute:()=>d({execute:f.execute}),dispatch:l}):void 0,b=i&&o&&o==="preview"&&!/(preview|fullscreen)/.test(f.keyCommand),y=s?.toolbar||f.render,x=y&&typeof y=="function"?y(f,!!b,d,h):null;return c.jsxs("li",Y({},f.liProps,{className:p?"active":"",children:[x&&W.isValidElement(x)&&x,!x&&!f.buttonProps&&f.icon,!x&&f.buttonProps&&W.createElement("button",Y({type:"button",key:h,disabled:b,"data-name":f.name},f.buttonProps,{onClick:C=>{C.stopPropagation(),d(f,f.groupName)}}),f.icon),f.children&&c.jsx(GR,{overflow:n,groupName:f.groupName,prefixCls:t,children:m,commands:Array.isArray(f.children)?f.children:void 0})]}),h)})})}function Vx(e){e===void 0&&(e={});var{prefixCls:t,isChild:n,className:r}=e,{commands:o,extraCommands:i}=W.useContext(Is);return c.jsxs("div",{className:t+"-toolbar "+r,children:[c.jsx(lg,Y({},e,{commands:e.commands||o||[]})),!n&&c.jsx(lg,Y({},e,{commands:i||[]}))]})}function ug(e){var{hideToolbar:t,toolbarBottom:n,placement:r,overflow:o,prefixCls:i}=e;if(t||r==="bottom"&&!n||r==="top"&&n)return null;var s=n?"bottom":"";return c.jsx(Vx,{prefixCls:i,overflow:o,className:s})}var QR=e=>{var{prefixCls:t,onChange:n}=e||{},r=W.useRef(null),o=W.useRef(),i=W.useRef(e.height);W.useEffect(()=>{i.current!==e.height&&(i.current=e.height)},[e.height]);function s(d){if(o.current){var f,h=d.clientY||((f=d.changedTouches[0])==null?void 0:f.clientY),p=o.current.height+h-o.current.dragY;p>=e.minHeight&&p<=e.maxHeight&&n&&n(o.current.height+(h-o.current.dragY))}}function a(){var d,f;o.current=void 0,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),(d=r.current)==null||d.removeEventListener("touchmove",s),(f=r.current)==null||f.removeEventListener("touchend",a)}function l(d){var f,h,p;d.preventDefault();var m=d.clientY||((f=d.changedTouches[0])==null?void 0:f.clientY);o.current={height:i.current,dragY:m},document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),(h=r.current)==null||h.addEventListener("touchmove",s,{passive:!1}),(p=r.current)==null||p.addEventListener("touchend",a,{passive:!1})}W.useEffect(()=>{if(document){var d,f;(d=r.current)==null||d.addEventListener("touchstart",l,{passive:!1}),(f=r.current)==null||f.addEventListener("mousedown",l)}return()=>{if(document){var h;(h=r.current)==null||h.removeEventListener("touchstart",l),document.removeEventListener("mousemove",s)}}},[]);var u=W.useMemo(()=>c.jsx("svg",{viewBox:"0 0 512 512",height:"100%",children:c.jsx("path",{fill:"currentColor",d:"M304 256c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48zm120-48c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48zm-336 0c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"})}),[]);return c.jsx("div",{className:t+"-bar",ref:r,children:u})},XR=["prefixCls","className","value","commands","commandsFilter","direction","extraCommands","height","enableScroll","visibleDragbar","highlightEnable","preview","fullscreen","overflow","previewOptions","textareaProps","maxHeight","minHeight","autoFocus","autoFocusEnd","tabSize","defaultTabEnable","onChange","onStatistics","onHeightChange","hideToolbar","toolbarBottom","components","renderTextarea"];function ZR(e){return e===void 0&&(e={}),Object.keys(e).forEach(t=>{e[t]=!1}),e}var JR=W.forwardRef((e,t)=>{var n=e||{},{prefixCls:r="w-md-editor",className:o,value:i,commands:s=HR(),commandsFilter:a,direction:l,extraCommands:u=zR(),height:d=200,enableScroll:f=!0,visibleDragbar:h=typeof e.visiableDragbar=="boolean"?e.visiableDragbar:!0,highlightEnable:p=!0,preview:m="live",fullscreen:b=!1,overflow:y=!0,previewOptions:x={},textareaProps:C,maxHeight:v=1200,minHeight:S=100,autoFocus:I,autoFocusEnd:T=!1,tabSize:N=2,defaultTabEnable:O=!1,onChange:F,onStatistics:B,onHeightChange:j,hideToolbar:D,toolbarBottom:H=!1,components:_,renderTextarea:L}=n,$=Ze(n,XR),K=s.map(we=>a?a(we,!1):we).filter(Boolean),G=u.map(we=>a?a(we,!0):we).filter(Boolean),[q,R]=W.useReducer(lR,{markdown:i,preview:m,components:_,height:d,minHeight:S,highlightEnable:p,tabSize:N,defaultTabEnable:O,scrollTop:0,scrollTopPreview:0,commands:K,extraCommands:G,fullscreen:b,barPopup:{}}),oe=W.useRef(null),se=W.useRef(null),z=W.useRef(f);W.useImperativeHandle(t,()=>Y({},q,{container:oe.current,dispatch:R})),W.useMemo(()=>z.current=f,[f]),W.useEffect(()=>{var we={};oe.current&&(we.container=oe.current||void 0),we.markdown=i||"",we.barPopup={},R&&R(Y({},q,we))},[]);var pe=[o,"wmde-markdown-var",l?r+"-"+l:null,r,q.preview?r+"-show-"+q.preview:null,q.fullscreen?r+"-fullscreen":null].filter(Boolean).join(" ").trim();W.useMemo(()=>i!==q.markdown&&R({markdown:i||""}),[i,q.markdown]),W.useMemo(()=>m!==q.preview&&R({preview:m}),[m]),W.useMemo(()=>N!==q.tabSize&&R({tabSize:N}),[N]),W.useMemo(()=>p!==q.highlightEnable&&R({highlightEnable:p}),[p]),W.useMemo(()=>I!==q.autoFocus&&R({autoFocus:I}),[I]),W.useMemo(()=>T!==q.autoFocusEnd&&R({autoFocusEnd:T}),[T]),W.useMemo(()=>b!==q.fullscreen&&R({fullscreen:b}),[b]),W.useMemo(()=>d!==q.height&&R({height:d}),[d]),W.useMemo(()=>d!==q.height&&j&&j(q.height,d,q),[d,j,q]),W.useMemo(()=>s!==q.commands&&R({commands:K}),[e.commands]),W.useMemo(()=>u!==q.extraCommands&&R({extraCommands:G}),[e.extraCommands]);var J=W.useRef(),Q=W.useRef("preview"),re=W.useRef(!1);W.useMemo(()=>{J.current=q.textareaWarp,q.textareaWarp&&(q.textareaWarp.addEventListener("mouseover",()=>{Q.current="text"}),q.textareaWarp.addEventListener("mouseleave",()=>{Q.current="preview"}))},[q.textareaWarp]);var ne=(we,ye)=>{if(z.current){var ze=J.current,Ne=se.current?se.current:void 0;if(re.current||(Q.current=ye,re.current=!0),ze&&Ne){var nt=(ze.scrollHeight-ze.offsetHeight)/(Ne.scrollHeight-Ne.offsetHeight);we.target===ze&&Q.current==="text"&&(Ne.scrollTop=ze.scrollTop/nt),we.target===Ne&&Q.current==="preview"&&(ze.scrollTop=Ne.scrollTop*nt);var _e=0;Q.current==="text"?_e=ze.scrollTop||0:Q.current==="preview"&&(_e=Ne.scrollTop||0),R({scrollTop:_e})}}},ae=r+"-preview "+(x.className||""),ie=we=>ne(we,"preview"),Z=W.useMemo(()=>c.jsx("div",{ref:se,className:ae,children:c.jsx(_x,Y({},x,{onScroll:ie,source:q.markdown||""}))}),[ae,x,q.markdown]),me=_?.preview&&_?.preview(q.markdown||"",q,R);me&&W.isValidElement(me)&&(Z=c.jsx("div",{className:ae,ref:se,onScroll:ie,children:me}));var le=Y({},$.style,{height:q.height||"100%"}),ue=()=>R({barPopup:Y({},ZR(q.barPopup))}),Ie=we=>R({height:we}),Ce=we=>{if(F&&F(we.target.value,we,q),C&&C.onChange&&C.onChange(we),q.textarea&&q.textarea instanceof HTMLTextAreaElement&&B){var ye=new Sp(q.textarea),ze=ye.getState()||{};B(Y({},ze,{lineCount:we.target.value.split(`
92
- `).length,length:we.target.value.length}))}};return c.jsx(Is.Provider,{value:Y({},q,{dispatch:R}),children:c.jsxs("div",Y({ref:oe,className:pe},$,{onClick:ue,style:le,children:[c.jsx(ug,{hideToolbar:D,toolbarBottom:H,prefixCls:r,overflow:y,placement:"top"}),c.jsxs("div",{className:r+"-content",children:[/(edit|live)/.test(q.preview||"")&&c.jsx(KR,Y({className:r+"-input",prefixCls:r,autoFocus:I},C,{onChange:Ce,renderTextarea:_?.textarea||L,onScroll:we=>ne(we,"text")})),/(live|preview)/.test(q.preview||"")&&Z]}),h&&!q.fullscreen&&c.jsx(QR,{prefixCls:r,height:q.height,maxHeight:v,minHeight:S,onChange:Ie}),c.jsx(ug,{hideToolbar:D,toolbarBottom:H,prefixCls:r,overflow:y,placement:"bottom"})]}))})}),Wx=JR;Wx.Markdown=_x;const Od={scopeName:"source.malloy",patterns:[{include:"#malloy-language"}],repository:{"malloy-language":{patterns:[{include:"#sql-string"},{include:"#comments"},{include:"#tags"},{include:"#strings"},{include:"#numbers"},{include:"#keywords"},{include:"#properties"},{include:"#functions"},{include:"#datetimes"},{include:"#identifiers-quoted"},{include:"#types"},{include:"#constants"},{include:"#timeframes"},{include:"#identifiers-unquoted"}]},"malloy-matched":{begin:"{",end:"}",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"malloy-in-sql":{begin:"%{",name:"source.malloy-in-sql",end:"}%?",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"sql-string":{patterns:[{begin:'(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(""")',end:'"""',beginCaptures:{1:{name:"variable.other"},3:{name:"keyword.control.sql"},5:{name:"punctuation.sql-block.open"}},endCaptures:{0:{name:"punctuation.sql-block.close"}},name:"source.sql",patterns:[{include:"#malloy-in-sql"},{include:"source.sql"}]}]},functions:{patterns:[{match:"(?i)\\b(count)(\\s*\\()(distinct)",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.function.modifier"}}},{match:"(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.type"}}}]},datetimes:{patterns:[{match:"(?i)@[0-9]{4}-[0-9]{2}-[0-9]{2}[ T][0-9]{2}:[0-9]{2}((:[0-9]{2})(([\\.,][0-9]+)(\\[[A-Za-z_/]+\\])?)?)?",name:"constant.numeric.timestamp"},{match:"(?i)@[0-9]{4}(-Q[1-4]|-[0-9]{2}(-[0-9]{2}(-WK)?)?)?",name:"constant.numeric.date"}]},"identifiers-quoted":{patterns:[{match:"`[^`]*`",name:"variable.other.quoted"}]},"identifiers-unquoted":{patterns:[{match:"(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",name:"variable.other"}]},timeframes:{patterns:[{match:"(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",name:"keyword.other.timeframe"},{match:"(?i)\\b(day_of_year|day_of_month)\\b",name:"keyword.other.timeframe"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]},tags:{patterns:[{match:"##\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:'#"',end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{match:"#\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:"#\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"##\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"#",end:"\\n",beginCaptures:{0:{name:"string.quoted"}},name:"string.quoted"}],repository:{"tag-values":{name:"support.type.property-name.json",match:'(-)?((?:[^\\s=#]+)|(?:"[^#]+"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:"[^#]+")))?',captures:{1:{name:"keyword.control.negate"},2:{name:"support.type.property-name.json"},3:{name:"keyword.operator.comparison.ts"},4:{name:"string.quoted"}}}}},strings:{patterns:[{begin:"'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.single",patterns:[{include:"#escapes"}]},{begin:'"',end:'"',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.double",patterns:[{include:"#escapes"}]},{begin:'"""',end:'"""',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.triple"},{begin:"(?i)[r|/]'",end:"'",name:"string.regexp",patterns:[{include:"#regex-escapes"}]}],repository:{escapes:{name:"constant.character.escape",match:"\\\\(u[A-Fa-f0-9]{4}|.)",captures:{0:{name:"constant.character.escape"}}},"regex-escapes":{name:"constant.character.escape",match:"\\\\.",captures:{0:{name:"constant.character.escape"}}}}},numbers:{match:"(?i)(\\b((0|[1-9][0-9]*)(E[+-]?[0-9]+|\\.[0-9]*)?)|\\.[0-9]+)",name:"constant.numeric"},constants:{patterns:[{match:"(?i)\\bnull\\b",name:"constant.language.null"},{match:"(?i)\\btrue\\b",name:"constant.language.true"},{match:"(?i)\\bfalse\\b",name:"constant.language.false"}]},types:{patterns:[{match:"(?i)\\bstring\\b",name:"entity.name.type.string"},{match:"(?i)\\bnumber\\b",name:"entity.name.type.number"},{match:"(?i)\\bdate\\b",name:"entity.name.type.date"},{match:"(?i)\\btimestamp\\b",name:"entity.name.type.timestamp"},{match:"(?i)\\bboolean\\b",name:"entity.name.type.boolean"}]},properties:{patterns:[{match:"(?i)\\baccept\\b",name:"keyword.control.accept"},{match:"(?i)\\bselect\\b",name:"keyword.control.select"},{match:"(?i)\\bconnection\\b",name:"keyword.control.connection"},{match:"(?i)\\brun\\b",name:"keyword.control.run"},{match:"(?i)\\bextend\\b",name:"keyword.control.extend"},{match:"(?i)\\brefine\\b",name:"keyword.control.refine"},{match:"(?i)\\baggregate\\b",name:"keyword.control.aggregate"},{match:"(?i)\\bsample\\b",name:"keyword.control.sample"},{match:"(?i)\\bcalculate\\b",name:"keyword.control.calculate"},{match:"(?i)\\btimezone\\b",name:"keyword.control.timezone"},{match:"(?i)\\bdimension\\b",name:"keyword.control.dimension"},{match:"(?i)\\bexcept\\b",name:"keyword.control.except"},{match:"(?i)\\bsource\\b",name:"keyword.control.source"},{match:"(?i)\\bgroup_by\\b",name:"keyword.control.group_by"},{match:"(?i)\\bhaving\\b",name:"keyword.control.having"},{match:"(?i)\\bindex\\b",name:"keyword.control.index"},{match:"(?i)\\bjoin_one\\b",name:"keyword.control.join_one"},{match:"(?i)\\bwith\\b",name:"keyword.control.with"},{match:"(?i)\\bjoin_many\\b",name:"keyword.control.join_many"},{match:"(?i)\\bjoin_cross\\b",name:"keyword.control.join_cross"},{match:"(?i)\\blimit\\b",name:"keyword.control.limit"},{match:"(?i)\\bmeasure\\b",name:"keyword.control.measure"},{match:"(?i)\\bnest\\b",name:"keyword.control.nest"},{match:"(?i)\\border_by\\b",name:"keyword.control.order_by"},{match:"(?i)\\bpartition_by\\b",name:"keyword.control.partition_by"},{match:"(?i)\\bprimary_key\\b",name:"keyword.control.primary_key"},{match:"(?i)\\bproject\\b",name:"keyword.control.project"},{match:"(?i)\\bquery\\b",name:"keyword.control.query"},{match:"(?i)\\brename\\b",name:"keyword.control.rename"},{match:"(?i)\\btop\\b",name:"keyword.control.top"},{match:"(?i)\\bview\\b",name:"keyword.control.view"},{match:"(?i)\\bwhere\\b",name:"keyword.control.where"},{match:"(?i)\\bdeclare\\b",name:"keyword.control.declare"}]},keywords:{patterns:[{match:"(?i)\\bis\\b",name:"keyword.control.is"},{match:"(?i)\\bon\\b",name:"keyword.control.on"},{match:"(?i)\\bnot\\b",name:"keyword.other.not"},{match:"(?i)\\bor\\b",name:"keyword.other.or"},{match:"(?i)\\bdesc\\b",name:"keyword.control.desc"},{match:"(?i)\\bby\\b",name:"keyword.control.by"},{match:"(?i)\\band\\b",name:"keyword.other.and"},{match:"(?i)\\basc\\b",name:"keyword.control.asc"},{match:"(?i)\\bfor\\b",name:"keyword.other.for"},{match:"(?i)\\belse\\b",name:"keyword.other.else"},{match:"(?i)\\bto\\b",name:"keyword.other.to"},{match:"(?i)\\bwhen\\b",name:"keyword.other.when"},{match:"(?i)\\bpick\\b",name:"keyword.other.pick"},{match:"(?i)\\bimport\\b",name:"keyword.control.import"}]}}},eN={...Od,patterns:[...Od.patterns,{include:"#docvar"}],repository:{...Od.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},tN={name:"Malloy SQL",scopeName:"source.malloy-sql",patterns:[{include:"#malloysql-sql"}],repository:{"malloysql-sql":{beginCaptures:{0:{name:"entity.other.attribute.malloy-sql"},1:{name:"entity.other.attribute.malloy-sql"},3:{name:"comment.line.double-slash"}},name:"meta.embedded.block.malloysql.sql",patterns:[{include:"#comments"},{begin:"%{",end:"}%",beginCaptures:{0:{name:"punctuation.definition.malloy-sql"}},endCaptures:{0:{name:"punctuation.definition.malloy-sql"}},name:"meta.embedded.block.malloy",patterns:[{include:"source.malloy"}]},{include:"source.sql"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]}}},nN="github-light",rN="github-dark";let Md;function oN(){return Md||(Md=(async()=>{const[{createHighlighterCore:e},{createOnigurumaEngine:t},{default:n},{default:r},{default:o},{default:i},{default:s}]=await Promise.all([Promise.resolve().then(()=>require("./core-DtPGM_JB.cjs.js")),Promise.resolve().then(()=>require("./engine-oniguruma-BkproSVE.cjs.js")),Promise.resolve().then(()=>require("./sql-BqWZrLHB.cjs.js")),Promise.resolve().then(()=>require("./json-y-J1j5EW.cjs.js")),Promise.resolve().then(()=>require("./typescript-BqvpT6pB.cjs.js")),Promise.resolve().then(()=>require("./github-light-BFTOhCbz.cjs.js")),Promise.resolve().then(()=>require("./github-dark-BKL9xNgN.cjs.js"))]);return e({engine:t(Promise.resolve().then(()=>require("./wasm-Dw4u1m6u.cjs.js"))),themes:[i,s],langs:[n,r,o,{name:"malloy",scopeName:"source.malloy",embeddedLangs:["sql"],...eN},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...tN}]})})()),Md}async function $u(e,t,n="light"){return(await oN()).codeToHtml(e,{lang:t,theme:n==="dark"?rN:nN})}function Xt(e){const{server:t}=De.useServer(),n={...e,queryKey:[...e.queryKey,t],queryFn:async()=>{try{return await e.queryFn()}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const i=new Error(o.response.data.message||o.message);throw i.status=o.response.status,i.data=o.response.data,i}}throw r}},retry:!1,throwOnError:!1};return Lr.useQuery(n,De.globalQueryClient)}function vn(e){const t={...e,mutationFn:async n=>{try{return await e.mutationFn(n)}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const i=new Error(o.response.data.message||o.message);throw i.status=o.response.status,i.data=o.response.data,i}}throw r}},retry:!1,throwOnError:!1};return Lr.useMutation(t,De.globalQueryClient)}const Ht=e=>{const t=new URL(e),n={};if(t.protocol!=="publisher:")throw new Error(`Failed to parse resource URI: ${e}`);const r=(t.hostname+t.pathname).split("/");for(let o=0;o<r.length;o+=2){const i=r[o];i==="environments"?n.environmentName=decodeURI(r[o+1])||void 0:i==="packages"?n.packageName=decodeURI(r[o+1])||void 0:i==="connections"?n.connectionName=decodeURI(r[o+1])||void 0:i==="models"&&(n.modelPath=decodeURI(r.slice(o+1).join("/"))||void 0)}if(n.versionId=t.searchParams.get("versionId")||void 0,!n.environmentName)throw new Error(`Failed to parse resource URI: ${e}`);return n},Cl=e=>{if(!e.environmentName)throw new Error(`Failed to encode resource URI, missing environment name: ${e}`);let t=`publisher://environments/${e.environmentName}`;return e.packageName&&(t+=`/packages/${e.packageName}`),e.connectionName&&(t+=`/connections/${e.connectionName}`),e.modelPath&&(t+=`/models/${e.modelPath}`),e.packageName&&e.versionId&&(t+=`?versionId=${e.versionId}`),t};function kp({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:i}){return W.useEffect(()=>{o&&o(t)},[t,o]),c.jsx(De.StyledCardMedia,{children:c.jsxs(Ot.Stack,{spacing:2,component:"section",children:[c.jsx(qx,{sourceAndPath:e[t],existingQuery:n,onChange:s=>{r&&r(s)},resourceUri:i}),c.jsx(Ot.Box,{height:"5px"})]})})}function fu(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function iN({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:i}){const[s,a]=W.useState(n||fu()),[l,u]=W.useState(void 0);W.useEffect(()=>{n&&a(n)},[n]);const[d,f]=W.useState([]),{MalloyExplorerProvider:h,QueryPanel:p,ResizableCollapsiblePanel:m,ResultPanel:b,SourcePanel:y}=r;W.useEffect(()=>{t&&t(s)},[t,s]);const{environmentName:x,packageName:C,versionId:v}=Ht(i),{apiClients:S}=De.useServer(),I=vn({mutationFn:()=>{const F=typeof s?.malloyQuery=="string"?s.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:s?.malloyQuery}).toMalloy();return u({executionState:"running",query:s?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:()=>{I.reset(),u(void 0)},response:{result:{}}}),a({...s,query:F}),S.models.executeQueryModel(x,C,e.modelPath,{query:F,sourceName:void 0,queryName:void 0,versionId:v})},onSuccess:F=>{if(F){const B=JSON.parse(F.data.result);a({...s,malloyResult:B}),u(j=>j?{...j,executionState:"finished",response:{result:B}}:void 0)}},onError:F=>{u(void 0),console.error("Query execution error:",F)}}),[T,N]=W.useState(e.sourceInfo.name);W.useEffect(()=>{T!==e.sourceInfo.name&&(N(e.sourceInfo.name),a(fu()),u(void 0))},[e,T]);const O=W.useCallback(F=>{a({...s,malloyQuery:F,malloyResult:void 0})},[s]);return T!==e.sourceInfo.name?c.jsx("div",{children:"Loading..."}):c.jsx(De.StyledExplorerContent,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:c.jsx(h,{source:e.sourceInfo,query:s?.malloyQuery,topValues:[],onFocusedNestViewPathChange:f,focusedNestViewPath:d,onQueryChange:O,children:c.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[c.jsx(m,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:c.jsx(y,{onRefresh:()=>a(fu())})}),c.jsx(m,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:c.jsx(p,{runQuery:()=>{console.log(`running query with: ${s?.malloyQuery}`);try{I.mutate()}catch(F){console.error("Error running query:",F)}}})}),c.jsx(b,{source:e.sourceInfo,draftQuery:s?.malloyQuery,setDraftQuery:F=>a({...s,malloyQuery:F}),submittedQuery:l,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function qx(e){const[t,n]=W.useState(null),[r,o]=W.useState(null),[i,s]=W.useState(!0);return W.useEffect(()=>{let a=!0;return Promise.all([import("@malloydata/malloy-explorer"),import("@malloydata/malloy-query-builder")]).then(([l,u])=>{a&&(n(l),o(u),s(!1))}).catch(l=>{console.error("Failed to load Malloy components:",l),a&&s(!1)}),()=>{a=!1}},[]),i||!t||!r?c.jsx(De.StyledExplorerPage,{children:c.jsx(De.StyledExplorerContent,{children:c.jsx(Ot.Box,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):c.jsx(iN,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}const Yx=mt(c.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}));function Sn({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:i=2,textVariant:s="body2"}){const a=c.jsxs(w.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:i},children:[c.jsx(w.CircularProgress,{size:t,color:n,thickness:r}),e&&c.jsx(w.Typography,{variant:s,color:"text.secondary",children:e})]});return o?c.jsx(w.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:a}):a}const sN=new Set(["warn","error"]);function aN(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!sN.has(r.severity??"")||(r.severity==="error"&&(n=!0),t.includes(r.message)||t.push(r.message));if(t.length)return{severity:n?"error":"warn",title:t.join(`
93
- `)}}const lN=W.lazy(()=>Promise.resolve().then(()=>BW));function Os({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r}){const o=W.useRef(null),[i,s]=W.useState(t),[a,l]=W.useState(!1),u=aN(r);if(!e)return null;if(n>0&&e.length>n&&!a)return c.jsxs(w.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[c.jsx(On.Warning,{sx:{fontSize:48,color:"#757575"}}),c.jsx(w.Typography,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),c.jsx(w.Button,{variant:"contained",color:"primary",onClick:()=>l(!0),children:"Proceed"})]});const f=c.jsx(Sn,{text:"Loading...",centered:!0,size:32}),h=Math.min(t,i);return c.jsxs(w.Box,{ref:o,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden"},children:[e&&c.jsx(W.Suspense,{fallback:f,children:c.jsx(lN,{result:e,height:h,onSizeChange:s})}),u&&c.jsx(w.Box,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:c.jsx(w.Tooltip,{title:u.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:c.jsx(w.IconButton,{size:"small","aria-label":"Render tag warnings",sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"}},children:c.jsx(Yx,{fontSize:"small",color:u.severity==="error"?"error":"warning"})})})})]})}function uN({cell:e,sourceAndPaths:t,resourceUri:n,onQueryChange:r,onSourceChange:o}){const i={query:e.value,malloyResult:e.result?JSON.parse(e.result):void 0,malloyQuery:e.queryInfo?JSON.parse(e.queryInfo):void 0},s=t.findIndex(a=>a.sourceInfo.name===e.sourceName);return c.jsx(kp,{resourceUri:n,sourceAndPaths:t,selectedSourceIndex:s>=0?s:0,existingQuery:i,onQueryChange:r,onSourceChange:o})}function cN({cell:e,editingMalloy:t,editingMarkdown:n,sourceAndPaths:r,resourceUri:o,onCellChange:i,onClose:s,onEdit:a,onDelete:l,addButtonCallback:u}){const[d,f]=W.useState(e.value),[h,p]=W.useState(!1),[m,b]=W.useState(!1),[y,x]=W.useState(),[C]=W.useState(),[v,S]=W.useState(fu()),[I,T]=W.useState(!1),[N,O]=W.useState(e.sourceName?r.findIndex(se=>se.sourceInfo.name===e.sourceName):0),{mode:F}=De.usePublisherTheme();W.useEffect(()=>{e.isMarkdown||$u(e.value,"malloy",F).then(se=>{x(se)})},[e,F]),W.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[B,j]=W.useState(!1),D=()=>{l(),j(!1)},H=r.length===0,_=W.useCallback(()=>{const se=r[N],z=se?.modelPath||e.modelPath||"",pe=se?.sourceInfo.name||e.sourceName||"";i({...e,value:e.isMarkdown?d:v.query,result:v.malloyResult?JSON.stringify(v.malloyResult):void 0,queryInfo:v.malloyQuery?JSON.stringify(v.malloyQuery):void 0,sourceName:pe,modelPath:z})},[e,d,v,i,N,r]),L=c.jsx(w.Tooltip,{title:"Delete Cell",children:c.jsx(w.IconButton,{size:"small",onClick:()=>j(!0),children:c.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),$=c.jsxs(w.Dialog,{open:B,onClose:()=>j(!1),children:[c.jsx(w.DialogTitle,{children:"Confirm Delete"}),c.jsx(w.DialogContent,{children:c.jsx(w.Typography,{children:"Are you sure you want to delete this cell?"})}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:()=>j(!1),children:"Cancel"}),c.jsx(w.Button,{onClick:D,color:"error",children:"Delete"})]})]}),K=()=>{_(),s()},G=e.isMarkdown?c.jsxs(c.Fragment,{children:[n?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}):c.jsx(w.Tooltip,{title:"Edit",children:c.jsx(w.IconButton,{size:"small",onClick:a,children:c.jsx(Pm,{})})}),!n&&L]}):c.jsxs(c.Fragment,{children:[!t&&c.jsx(w.Tooltip,{title:h?"Hide Code":"View Code",children:c.jsx(w.IconButton,{size:"small",onClick:()=>{p(!h)},children:c.jsx(vb,{})})}),!t&&e.result&&c.jsx(w.Tooltip,{title:m?"Hide Embedding":"View Embedding",children:c.jsx(w.IconButton,{size:"small",onClick:()=>{b(!m)},children:c.jsx(Kf,{})})}),t&&c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}),!t&&c.jsx(w.Tooltip,{title:"Edit",children:c.jsx(w.IconButton,{size:"small",onClick:a,children:c.jsx(Pm,{})})}),!t&&L]}),q=t||n,R=n?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}):t?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}):null,oe=I&&c.jsx(w.Box,{sx:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"8px",backgroundColor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:"8px",padding:"2px 4px",boxShadow:1,zIndex:10},children:!q&&c.jsxs(c.Fragment,{children:[u(!0),u(!1),G]})||R});return c.jsxs(De.StyledCard,{sx:se=>({position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:se.palette.background.paper,minHeight:"50px"}),onMouseEnter:()=>T(!0),onMouseLeave:()=>{T(!1)},children:[oe,e.isMarkdown?c.jsx(c.Fragment,{children:n?c.jsx(Wx,{value:d,preview:"edit",autoFocus:!0,onChange:se=>{f(se),i({...e,value:se})},onBlur:()=>{_(),I||K()}}):c.jsx(w.Box,{sx:{px:.5,pt:0,mt:0,"& h1, & h2, & h3, & h4, & h5, & h6":{mt:.5,mb:.5},"& p":{mt:.5,mb:.5},"& ul, & ol":{mt:.5,mb:.5},"& li":{mt:0,mb:0},"& pre, & code":{mt:.5,mb:.5},"& blockquote":{mt:.5,mb:.5}},children:e.value?c.jsx(w.Box,{onClick:a,sx:{cursor:"pointer"},children:c.jsx(wu,{children:e.value})}):c.jsxs(w.Box,{onClick:a,sx:{cursor:"pointer"},children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):c.jsxs(c.Fragment,{children:[c.jsx(w.Collapse,{in:m,timeout:"auto",unmountOnExit:!0,children:c.jsx(w.Stack,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:c.jsx(w.Typography,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:C}})})}),c.jsx(w.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,children:c.jsx(w.Stack,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:c.jsx(w.Typography,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:y}})})}),t&&(H?c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):c.jsx(uN,{sourceAndPaths:r,resourceUri:o,onQueryChange:se=>{S(se)},onSourceChange:se=>{O(se)},cell:e})),!t&&e.result&&c.jsx(De.StyledCard,{variant:"outlined",sx:{borderRadius:0},children:c.jsx(Os,{result:e.result,maxHeight:800})}),!t&&!e.result&&c.jsxs(w.Box,{onClick:a,sx:{cursor:"pointer"},children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),B&&$]})}const Kx=W.createContext(void 0);function dN({children:e,workbookStorage:t}){const n=W.useMemo(()=>({workbookStorage:t}),[t]);return c.jsx(Kx.Provider,{value:n,children:e})}function wp(){const e=W.useContext(Kx);if(!e)throw new Error("useWorkbookStorage must be used within a WorkbookStorageProvider");return e}const Fr=mt(c.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),fN=mt(c.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"}));function kn({error:e,context:t}){const n=e.data?.message||"Unknown Error";return c.jsxs(c.Fragment,{children:[t&&c.jsx(w.Typography,{variant:"body2",sx:{p:"10px",m:"auto"},children:t}),c.jsx("pre",{style:{whiteSpace:"pre-wrap",color:"red",padding:"10px",margin:"auto"},children:n})]})}function pN({initialSelectedModels:e,onModelChange:t,resourceUri:n}){const{environmentName:r,packageName:o,versionId:i}=Ht(n),{apiClients:s}=De.useServer(),{data:a,isLoading:l,isSuccess:u,isError:d,error:f}=Xt({queryKey:["models",r,o,i],queryFn:()=>s.models.listModels(r,o,i)}),[h,p]=W.useState(e||[]),[m,b]=W.useState(null);W.useEffect(()=>{p(e||[])},[e]);const y=v=>{const S=h.filter(I=>I!==v);p(S),t(S)},x=v=>{const S=[...h,v];p(S),t(S),b(null)};let C=[];return u&&a?.data&&(C=a.data.filter(v=>!h.includes(v.path)).map(v=>v.path)),d?c.jsx(kn,{error:f,context:`${r} > ${o} > Model Picker`}):c.jsxs(c.Fragment,{children:[c.jsxs(w.FormControl,{fullWidth:!0,children:[l&&c.jsx(w.Typography,{children:"Loading..."}),c.jsxs(w.Stack,{direction:"row",spacing:1,children:[h.map(v=>c.jsx(w.Chip,{label:v,onDelete:()=>y(v),deleteIcon:c.jsx(Fr,{}),sx:{marginBottom:"5px"}},v)),c.jsx(w.Button,{size:"small",startIcon:c.jsx(fN,{}),onClick:v=>b(v.currentTarget),disabled:l||d||C.length===0,children:"Add Model"})]})]}),c.jsxs(w.Menu,{anchorEl:m,open:!!m,onClose:()=>b(null),children:[c.jsx(w.Typography,{variant:"subtitle2",sx:{ml:1},children:"Models"}),c.jsx(w.Divider,{}),C.length===0?c.jsx(w.MenuItem,{disabled:!0,children:"No models available"}):C.map(v=>c.jsx(w.MenuItem,{onClick:()=>x(v),children:c.jsx(w.Typography,{variant:"body2",children:v})},v))]})]})}function Gx(){const e=oT.useNavigate();return(t,n)=>{if(!n||!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.button!==1){e(t);return}const r=new URL(t,window.location.href).href;(n.metaKey||n.ctrlKey||n.button===1||n.shiftKey)&&window.open(r,"_blank")}}function hN({workbookPath:e,resourceUri:t}){const n=Gx(),{server:r,getAccessToken:o}=De.useServer(),{apiClients:i}=De.useServer(),{workbookStorage:s}=wp(),{environmentName:a,packageName:l}=Ht(t),[u,d]=W.useState(void 0),[f,h]=W.useState(void 0);if(!s)throw new Error("Workbook storage be provided via WorkbookStorageProvider");const[p,m]=W.useState(),[b,y]=W.useState(),[x,C]=W.useState(),[v,S]=W.useState([]),[I,T]=W.useState(null),[N,O]=W.useState(null),F=!!I,B=()=>{T(null),O(null)},j=(oe,se)=>{p&&(m(p.insertCell(se,{isMarkdown:oe,value:""})),oe?C(se):y(se),B(),console.log("handleAddCell",oe,se))},[D,H]=W.useState(!1),_=()=>{H(!0)},L=async()=>{e&&s&&await s.deleteWorkbook(e).then(()=>{h(void 0),d(void 0)}).catch(oe=>{h(`Error deleting workbook: ${oe.message}`),d(void 0)}),H(!1),n(`/${a}/${l}`)},$=()=>{H(!1)},K=W.useCallback(async()=>{if(!p){console.log("No workbook data ref");return}try{m(await p.saveWorkbook()),h(void 0),d("Workbook saved")}catch(oe){h(`Error saving workbook: ${oe.message}`),d(void 0)}},[p]);if(W.useEffect(()=>{if(!p)return;(async()=>{const se=new Map(v.map(({modelPath:J,sourceInfos:Q})=>[J,Q])),z=[],pe=[];for(const J of p.getModels())se.has(J)?z.push({modelPath:J,sourceInfos:se.get(J)}):(console.log("Fetching model from Publisher",J),pe.push(i.models.getModel(a,l,J,void 0).then(Q=>({modelPath:J,sourceInfos:Q.data.sourceInfos.map(re=>JSON.parse(re))}))));if(pe.length>0){const J=await Promise.all(pe);S([...z,...J])}else S(z)})()},[o,p,l,a,r]),W.useEffect(()=>{e&&ns.loadWorkbook(s,e).then(oe=>{m(oe)})},[e,s]),!p)return c.jsx("div",{children:"Loading..."});const G=oe=>{const se=[];for(const z of oe)for(const pe of z.sourceInfos)se.push({modelPath:z.modelPath,sourceInfo:pe});return se},q=(oe,se)=>c.jsx(w.Button,{size:"small",startIcon:c.jsx(fl,{}),onClick:()=>j(oe,se),variant:"contained",sx:{backgroundColor:z=>z.palette.background.paper,color:z=>z.palette.mode==="dark"?z.palette.grey[100]:z.palette.grey[700],boxShadow:"none","&:hover":{backgroundColor:z=>z.palette.mode==="dark"?z.palette.grey[500]:z.palette.grey[300],boxShadow:"none"}},children:oe?"Markdown":"Explore"}),R=c.jsxs(w.Box,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[q(!1,p.getCells().length),q(!0,p.getCells().length)]});return c.jsxs(De.StyledCard,{variant:"outlined",children:[c.jsxs(De.StyledCardContent,{children:[c.jsx(w.Box,{sx:{mb:2},children:c.jsx(w.Box,{sx:{minHeight:"24px"},children:f?c.jsx(w.Typography,{color:"error",variant:"body2",children:f}):u?c.jsx(w.Typography,{color:"success",variant:"body2",children:u}):c.jsx("span",{children:" "})})}),c.jsxs(Ui,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[c.jsxs(Ui,{direction:"row",spacing:1,alignItems:"center",children:[c.jsx(w.Typography,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),c.jsx(w.Typography,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${e.workspace} > ${e.path}`})]}),c.jsxs(Ui,{sx:{display:"flex",flexDirection:"row",gap:1},children:[c.jsx(w.Box,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:c.jsx(mN,{workbookData:p})}),c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[c.jsx(w.Button,{color:"error",onClick:_,size:"small",children:"Delete"}),c.jsxs(w.Dialog,{open:D,onClose:$,children:[c.jsx(w.DialogTitle,{children:"Delete Workbook"}),c.jsx(w.DialogContent,{children:c.jsxs(w.DialogContentText,{children:['Are you sure you want to delete the workbook "',e.path,'"? This action cannot be undone.']})}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:$,color:"primary",size:"small",children:"Cancel"}),c.jsx(w.Button,{onClick:L,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),c.jsx(w.Divider,{}),c.jsxs(Ui,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[c.jsx(w.Box,{sx:{flex:1},children:c.jsx(pN,{initialSelectedModels:p.getModels(),onModelChange:oe=>{m(p.setModels(oe)),K()},resourceUri:t})}),c.jsx(w.Box,{sx:{flex:1}})]})]}),c.jsx(De.StyledCardMedia,{children:c.jsxs(Ui,{children:[p.getCells().length===0&&c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),c.jsx(w.Typography,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),p.getCells().map((oe,se)=>c.jsx(W.Fragment,{children:c.jsx(cN,{cell:oe,resourceUri:t,addButtonCallback:z=>q(z,se),sourceAndPaths:G(v),editingMarkdown:x===se,editingMalloy:b===se,onDelete:()=>{m(p.deleteCell(se)),K()},onCellChange:z=>{m(p.setCell(se,z))},onEdit:()=>{oe.isMarkdown?C(se):y(se)},onClose:()=>{oe.isMarkdown?C(void 0):y(void 0),K()}},`${se}-${oe.isMarkdown}-${e.workspace}-${e.path}`)},`${se}-${p.getCells().length}`)),R,c.jsxs(w.Menu,{anchorEl:I,open:F,onClose:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(w.MenuItem,{onClick:()=>j(!0,N??0),children:"Add Markdown"}),c.jsx(w.MenuItem,{onClick:()=>j(!1,N??0),children:"Add Malloy"})]}),c.jsx(Ui,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function mN({workbookData:e}){const[t,n]=W.useState(!1),r=async()=>{if(!e)return;const o=e.toMalloyWorkbook();try{await navigator.clipboard.writeText(o),n(!0),setTimeout(()=>n(!1),1500)}catch{n(!1),alert("Failed to copy to clipboard")}};return c.jsx(w.Button,{color:"primary",onClick:r,size:"small",children:t?"Copied!":"Export"})}function Qx({onWorkbookClick:e}){const{workbookStorage:t}=wp(),[n,r]=W.useState([]),[o,i]=W.useState(void 0);return W.useEffect(()=>{t&&t.listWorkspaces(!1).then(s=>{const a=[];Promise.all(s.map(async l=>{await t.listWorkbooks(l).then(u=>{a.push(...u)}).catch(u=>{i(`Error listing workbooks: ${u.message}`)})})).then(()=>{r(a),i(void 0)})})},[t]),c.jsxs(c.Fragment,{children:[o&&c.jsx(w.Box,{sx:{mb:2},children:c.jsx(w.Typography,{color:"error",variant:"body2",children:o})}),c.jsx(w.Divider,{}),c.jsx(w.Box,{sx:{maxHeight:"300px",overflow:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"rgba(0,0,0,0.2)",borderRadius:"4px"}},children:c.jsxs(w.List,{dense:!0,children:[n.length===0&&c.jsx(w.ListItem,{children:c.jsx(w.ListItemText,{primary:"No workbooks found.",sx:{textAlign:"center"}})}),n.map(s=>c.jsx(w.ListItem,{onClick:a=>e(s,a),sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}},children:c.jsx(w.ListItemText,{primary:s.path})},s.path))]})})]})}const cg="Local";class gN{async listWorkspaces(t){return Promise.resolve([{name:cg,description:"Stored locally- only accessible to this browser",writeable:!0}])}async listWorkbooks(t){const n=[];for(let r=0;r<localStorage.length;r++){const o=localStorage.key(r);n.push({path:o,workspace:cg})}return n}async getWorkbook(t){const n=localStorage.getItem(t.path);if(n===null)throw new Error(`Notebook not found at path: ${t}`);return n}async deleteWorkbook(t){if(localStorage.getItem(t.path)===null)throw new Error(`Notebook not found at path: ${t}`);localStorage.removeItem(t.path)}async saveWorkbook(t,n){localStorage.setItem(t.path,n)}async moveWorkbook(t,n){const r=localStorage.getItem(t.path);if(r===null)throw new Error(`Notebook not found at path: ${t.path}`);localStorage.setItem(n.path,r),localStorage.removeItem(t.path)}}function bN({onWorkbookSelect:e}){const{workbookStorage:t}=wp(),[n,r]=W.useState(""),[o,i]=W.useState(""),[s,a]=W.useState([]),[l,u]=W.useState(null),[d,f]=W.useState(!1),[h,p]=W.useState(!1),m=!!l,b=T=>{u(T.currentTarget)},y=()=>{u(null)},x=()=>{p(!1)},C=()=>{f(!1),r(""),i("")};W.useEffect(()=>{t&&(console.log("fetching workspaces"),t.listWorkspaces(!0).then(T=>{a(T),T.length===1&&i(T[0].name)}).catch(T=>{console.error("Error fetching workspaces:",T),a([])}))},[t]);const v=(T,N)=>{p(!1),e(T,N)},S=T=>{f(!1),e({path:n,workspace:o},T),r(""),i("")},I=s.length===0;return c.jsxs(c.Fragment,{children:[c.jsx(w.Button,{"aria-controls":m?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":m?"true":void 0,onClick:b,variant:"contained",sx:{height:"40px",px:2,backgroundColor:"#fbbb04","&:hover":{backgroundColor:"#eab308"}},children:"Analyze Package"}),c.jsxs(w.Menu,{id:"basic-menu",anchorEl:l,open:m,onClose:y,MenuListProps:{"aria-labelledby":"basic-button",sx:{py:.5}},children:[c.jsxs(w.MenuItem,{onClick:()=>{f(!0),y()},sx:{py:1,px:2},disabled:I,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Add,{fontSize:"small"})}),c.jsxs(w.ListItemText,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:"New Workbook"}),I?c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"No workspaces available"}):c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"Create a new analysis workbook"})]})]}),c.jsxs(w.MenuItem,{onClick:()=>{p(!0),y()},sx:{py:1,px:2},children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Launch,{fontSize:"small"})}),c.jsxs(w.ListItemText,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:"Open Workbook"}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"Open an existing workbook"})]})]})]}),c.jsxs(w.Dialog,{open:d,onClose:C,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pb:1,pt:2,px:2},children:[c.jsx(w.Typography,{fontWeight:600,sx:{fontSize:"1.5rem",mb:.5},children:"Create New Workbook"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Start a new analysis workbook to explore your data"})]}),c.jsx(w.DialogContent,{sx:{px:2,pb:2},children:c.jsxs(w.Stack,{spacing:2,sx:{mt:1},children:[s.length>1?c.jsxs(w.FormControl,{fullWidth:!0,size:"small",children:[c.jsx(w.InputLabel,{children:"Workspace"}),c.jsx(w.Select,{value:o,label:"Workspace",onChange:T=>i(T.target.value),children:s.map(T=>c.jsx(w.MenuItem,{value:T.name,children:c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:T.name}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:T.description})]})},T.name))})]}):s.length===1?c.jsxs(w.Box,{sx:T=>({p:2,border:1,borderColor:"divider",borderRadius:1,backgroundColor:T.palette.mode==="dark"?"rgba(255, 255, 255, 0.04)":"grey.50"}),children:[c.jsxs(w.Typography,{variant:"body2",fontWeight:500,gutterBottom:!0,children:["Workspace: ",s[0].name]}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:s[0].description})]}):null,c.jsx(w.FormControl,{fullWidth:!0,children:c.jsx(w.TextField,{label:"Workbook Name",value:n,onChange:T=>r(T.target.value),placeholder:"Enter workbook name...",fullWidth:!0,autoFocus:!0,size:"small"})}),c.jsxs(w.Stack,{direction:"row",spacing:1,justifyContent:"flex-end",children:[c.jsx(w.Button,{onClick:C,variant:"outlined",size:"small",children:"Cancel"}),c.jsx(w.Button,{onClick:T=>S(T),variant:"contained",disabled:!n.trim()||s.length>1&&!o,size:"small",children:"Create Workbook"})]})]})})]}),c.jsxs(w.Dialog,{open:h,onClose:x,maxWidth:"md",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pb:1,pt:2,px:2},children:[c.jsx(w.Typography,{fontWeight:600,sx:{mb:.5,fontSize:"1.5rem"},children:"Open Workbook"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Select an existing workbook to continue your analysis"})]}),c.jsx(w.DialogContent,{sx:{px:2,pb:2},children:c.jsx(Qx,{onWorkbookClick:v})})]})]})}const Xx=mt(c.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}));function yN({onSubmit:e,isSubmitting:t,disabled:n,disabledReason:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(!1),l=()=>i(!1),u=async()=>{try{await e({forceRefresh:s}),i(!1)}catch{}},d=c.jsx("span",{children:c.jsx(w.Button,{variant:"contained",startIcon:c.jsx(fl,{}),onClick:()=>i(!0),disabled:n,"aria-label":"New materialization",children:"New materialization"})});return c.jsxs(c.Fragment,{children:[n&&r?c.jsx(w.Tooltip,{title:r,children:d}):d,c.jsxs(w.Dialog,{open:o,onClose:l,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-materialization-title",children:[c.jsx(w.DialogTitle,{id:"create-materialization-title",children:"New materialization"}),c.jsxs(w.DialogContent,{children:[c.jsx(w.DialogContentText,{sx:{mb:2},children:"Materialize every persist source in this package: compile, build the tables, and load them so queries serve from the materialized tables."}),c.jsx(w.FormGroup,{children:c.jsx(w.FormControlLabel,{control:c.jsx(w.Switch,{checked:s,onChange:f=>a(f.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})})]}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:l,children:"Cancel"}),c.jsx(w.Button,{variant:"contained",loading:t,onClick:u,children:"Materialize"})]})]})]})}function Tf({children:e}){return c.jsx(w.Typography,{variant:"caption",component:"h6",sx:{display:"block",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,color:"text.secondary",mb:1},children:e})}function Ja(e){return e===De.MaterializationStatus.Pending||e===De.MaterializationStatus.ManifestRowsReady}function xN(e){return e===De.MaterializationStatus.ManifestFileReady||e===De.MaterializationStatus.Failed||e===De.MaterializationStatus.Cancelled}function Zx(e){switch(e){case De.MaterializationStatus.ManifestFileReady:return"Done";case De.MaterializationStatus.Failed:return"Failed";case De.MaterializationStatus.Cancelled:return"Cancelled";case De.MaterializationStatus.Pending:case De.MaterializationStatus.ManifestRowsReady:return"Pending";default:return"Unknown"}}function Jx(e){switch(e){case De.MaterializationStatus.ManifestRowsReady:return"info";case De.MaterializationStatus.ManifestFileReady:return"success";case De.MaterializationStatus.Failed:return"error";case De.MaterializationStatus.Cancelled:return"warning";case De.MaterializationStatus.Pending:default:return"default"}}function e2(e){return e.metadata??{}}function CN(e){return e.trigger==="SCHEDULER"?"Scheduled":"Manual"}function t2(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),o=Math.max(0,r-n);if(o<1e3)return`${o}ms`;const i=Math.round(o/1e3);if(i<60)return`${i}s`;const s=Math.floor(i/60),a=i%60;if(s<60)return`${s}m ${a}s`;const l=Math.floor(s/60),u=s%60;return`${l}h ${u}m`}function Sf(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function EN(e){if(!e)return"-";const t=new Date(e).getTime(),n=Math.round((Date.now()-t)/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function vN({entries:e,builtAt:t}){const n=Object.entries(e??{});return c.jsxs(w.Box,{children:[c.jsxs(w.Stack,{direction:"row",alignItems:"baseline",justifyContent:"space-between",children:[c.jsx(Tf,{children:"Build manifest"}),t&&c.jsxs(w.Typography,{variant:"caption",color:"text.secondary",children:["Built ",Sf(t)]})]}),n.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"No materialized tables yet."}):c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"Source"}),c.jsx(w.TableCell,{children:"Table name"}),c.jsx(w.TableCell,{children:"Connection"}),c.jsx(w.TableCell,{children:"Realization"}),c.jsx(w.TableCell,{align:"right",children:"Rows"})]})}),c.jsx(w.TableBody,{children:n.map(([r,o])=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:o.sourceName??r}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:o.physicalTableName??"-"}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:o.connectionName??"-"}),c.jsx(w.TableCell,{children:o.realization??"-"}),c.jsx(w.TableCell,{align:"right",children:o.rowCount??"-"})]},r))})]})]})}const Hu=mt([c.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),c.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")]),TN=mt(c.jsx("path",{d:"M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74m9.84 4.63-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74c-3.6-.76-3.54-.75-3.67-.75-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38"}));function n2({meta:e}){const t=e.trigger==="SCHEDULER";return c.jsx(w.Tooltip,{title:t?"Fired by the materialization schedule":"Triggered manually",children:c.jsx(w.Chip,{size:"small",variant:"outlined",color:t?"info":"default",icon:t?c.jsx(Hu,{fontSize:"small"}):c.jsx(TN,{fontSize:"small"}),label:CN(e)})})}function r2({materialization:e,buildPlan:t,showBuildPlan:n=!0,onClose:r}){const o=e?e2(e):{},i=Object.values(t?.sources??{});return c.jsx(w.Dialog,{open:e!==null,onClose:r,maxWidth:"md",fullWidth:!0,"aria-labelledby":"materialization-detail-title",children:e&&c.jsxs(c.Fragment,{children:[c.jsxs(w.DialogTitle,{sx:{pr:6,pb:1.5},id:"materialization-detail-title",children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.75},children:[c.jsx(w.Chip,{size:"small",label:Zx(e.status),color:Jx(e.status),variant:Ja(e.status)?"filled":"outlined"}),c.jsx(n2,{meta:o})]}),c.jsx(w.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:e.packageName??"Materialization"}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{fontFamily:De.MONO_FONT_FAMILY,wordBreak:"break-all"},children:e.id}),c.jsx(w.IconButton,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8},children:c.jsx(Fr,{fontSize:"small"})})]}),c.jsxs(w.DialogContent,{dividers:!0,children:[c.jsxs(w.Box,{sx:{bgcolor:"action.hover",borderRadius:2,p:2,mb:3,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:2},children:[c.jsx(na,{label:"Started",value:Sf(e.startedAt??e.createdAt)}),c.jsx(na,{label:"Completed",value:Sf(e.completedAt)}),c.jsx(na,{label:"Duration",value:t2(e.startedAt,e.completedAt)}),c.jsx(na,{label:"Sources",value:`${o.sourcesBuilt??0} built · ${o.sourcesReused??0} reused`}),c.jsx(na,{label:"Force refresh",value:o.forceRefresh?"Yes":"No"})]}),e.error&&c.jsxs(w.Box,{sx:{borderRadius:2,p:2,mb:3,border:"1px solid",borderColor:"error.main"},children:[c.jsx(Tf,{children:c.jsx(w.Box,{component:"span",sx:{color:"error.main"},children:"Error"})}),c.jsx(w.Typography,{variant:"body2",sx:{fontFamily:De.MONO_FONT_FAMILY,whiteSpace:"pre-wrap"},children:e.error})]}),n&&c.jsxs(w.Box,{sx:{mb:3},children:[c.jsx(Tf,{children:"Build plan"}),i.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"This package has no persist sources."}):c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"Source"}),c.jsx(w.TableCell,{children:"Connection"}),c.jsx(w.TableCell,{children:"Dialect"}),c.jsx(w.TableCell,{align:"right",children:"Columns"}),c.jsx(w.TableCell,{children:"Source Entity ID"})]})}),c.jsx(w.TableBody,{children:i.map(s=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:s.name}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:s.connectionName}),c.jsx(w.TableCell,{children:s.dialect??"-"}),c.jsx(w.TableCell,{align:"right",children:s.columns?.length??0}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY,fontSize:"0.75rem",wordBreak:"break-all",maxWidth:220},children:s.sourceEntityId})]},s.sourceID))})]})]}),c.jsx(vN,{entries:e.manifest?.entries,builtAt:e.manifest?.builtAt})]})]})})}function na({label:e,value:t}){return c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"caption",color:"text.secondary",display:"block",children:e}),c.jsx(w.Typography,{variant:"body2",children:t})]})}const SN=mt(c.jsx("path",{d:"M6 6h12v12H6z"})),o2=Ee.oneOfType([Ee.func,Ee.object]);function dg(e){try{return e.matches(":focus-visible")}catch{}return!1}const fg={};function i2(e,t){const n=M.useRef(fg);return n.current===fg&&(n.current=e(t)),n}class zu{static create(){return new zu}static use(){const t=i2(zu.create).current,[n,r]=M.useState(!1);return t.shouldMount=n,t.setShouldMount=r,M.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=wN(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function kN(){return zu.use()}function wN(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function kf(e,t){return kf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},kf(e,t)}function Dp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,kf(e,t)}function DN(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function IN(e,t){e.classList?e.classList.add(t):DN(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function pg(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function AN(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=pg(e.className,t):e.setAttribute("class",pg(e.className&&e.className.baseVal||"",t))}const hg={disabled:!1},Uu=W.createContext(null);var s2=function(t){return t.scrollTop},Da="unmounted",ei="exited",ti="entering",Qi="entered",wf="exiting",Dr=(function(e){Dp(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=o,a=s&&!s.isMounting?r.enter:r.appear,l;return i.appearStatus=null,r.in?a?(l=ei,i.appearStatus=ti):l=Qi:r.unmountOnExit||r.mountOnEnter?l=Da:l=ei,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===Da?{status:ei}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==ti&&s!==Qi&&(i=ti):(s===ti||s===Qi)&&(i=wf)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===ti){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Ta.findDOMNode(this);s&&s2(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ei&&this.setState({status:Da})},n.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[Ta.findDOMNode(this),a],u=l[0],d=l[1],f=this.getTimeouts(),h=a?f.appear:f.enter;if(!o&&!s||hg.disabled){this.safeSetState({status:Qi},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:ti},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Qi},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:Ta.findDOMNode(this);if(!i||hg.disabled){this.safeSetState({status:ei},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:wf},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:ei},function(){o.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:Ta.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Da)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=Ze(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return W.createElement(Uu.Provider,{value:null},typeof s=="function"?s(o,a):W.cloneElement(W.Children.only(s),a))},t})(W.Component);Dr.contextType=Uu;Dr.propTypes={};function Yi(){}Dr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yi,onEntering:Yi,onEntered:Yi,onExit:Yi,onExiting:Yi,onExited:Yi};Dr.UNMOUNTED=Da;Dr.EXITED=ei;Dr.ENTERING=ti;Dr.ENTERED=Qi;Dr.EXITING=wf;var ON=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return IN(t,r)})},Pd=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return AN(t,r)})},Ip=(function(e){Dp(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(a,l){var u=r.resolveArguments(a,l),d=u[0],f=u[1];r.removeClasses(d,"exit"),r.addClass(d,f?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(a,l)},r.onEntering=function(a,l){var u=r.resolveArguments(a,l),d=u[0],f=u[1],h=f?"appear":"enter";r.addClass(d,h,"active"),r.props.onEntering&&r.props.onEntering(a,l)},r.onEntered=function(a,l){var u=r.resolveArguments(a,l),d=u[0],f=u[1],h=f?"appear":"enter";r.removeClasses(d,h),r.addClass(d,h,"done"),r.props.onEntered&&r.props.onEntered(a,l)},r.onExit=function(a){var l=r.resolveArguments(a),u=l[0];r.removeClasses(u,"appear"),r.removeClasses(u,"enter"),r.addClass(u,"exit","base"),r.props.onExit&&r.props.onExit(a)},r.onExiting=function(a){var l=r.resolveArguments(a),u=l[0];r.addClass(u,"exit","active"),r.props.onExiting&&r.props.onExiting(a)},r.onExited=function(a){var l=r.resolveArguments(a),u=l[0];r.removeClasses(u,"exit"),r.addClass(u,"exit","done"),r.props.onExited&&r.props.onExited(a)},r.resolveArguments=function(a,l){return r.props.nodeRef?[r.props.nodeRef.current,a]:[a,l]},r.getClassNames=function(a){var l=r.props.classNames,u=typeof l=="string",d=u&&l?l+"-":"",f=u?""+d+a:l[a],h=u?f+"-active":l[a+"Active"],p=u?f+"-done":l[a+"Done"];return{baseClassName:f,activeClassName:h,doneClassName:p}},r}var n=t.prototype;return n.addClass=function(o,i,s){var a=this.getClassNames(i)[s+"ClassName"],l=this.getClassNames("enter"),u=l.doneClassName;i==="appear"&&s==="done"&&u&&(a+=" "+u),s==="active"&&o&&s2(o),a&&(this.appliedClasses[i][s]=a,ON(o,a))},n.removeClasses=function(o,i){var s=this.appliedClasses[i],a=s.base,l=s.active,u=s.done;this.appliedClasses[i]={},a&&Pd(o,a),l&&Pd(o,l),u&&Pd(o,u)},n.render=function(){var o=this.props;o.classNames;var i=Ze(o,["classNames"]);return W.createElement(Dr,Y({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(W.Component);Ip.defaultProps={classNames:""};Ip.propTypes={};function MN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ap(e,t){var n=function(i){return t&&W.isValidElement(i)?t(i):i},r=Object.create(null);return e&&W.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function PN(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var s,a={};for(var l in t){if(r[l])for(s=0;s<r[l].length;s++){var u=r[l][s];a[r[l][s]]=n(u)}a[l]=n(l)}for(s=0;s<o.length;s++)a[o[s]]=n(o[s]);return a}function oi(e,t,n){return n[t]!=null?n[t]:e.props[t]}function RN(e,t){return Ap(e.children,function(n){return W.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:oi(n,"appear",e),enter:oi(n,"enter",e),exit:oi(n,"exit",e)})})}function NN(e,t,n){var r=Ap(e.children),o=PN(t,r);return Object.keys(o).forEach(function(i){var s=o[i];if(W.isValidElement(s)){var a=i in t,l=i in r,u=t[i],d=W.isValidElement(u)&&!u.props.in;l&&(!a||d)?o[i]=W.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:oi(s,"exit",e),enter:oi(s,"enter",e)}):!l&&a&&!d?o[i]=W.cloneElement(s,{in:!1}):l&&a&&W.isValidElement(u)&&(o[i]=W.cloneElement(s,{onExited:n.bind(null,s),in:u.props.in,exit:oi(s,"exit",e),enter:oi(s,"enter",e)}))}}),o}var FN=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},LN={component:"div",childFactory:function(t){return t}},El=(function(e){Dp(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=i.handleExited.bind(MN(i));return i.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var s=i.children,a=i.handleExited,l=i.firstRender;return{children:l?RN(o,a):NN(o,s,a),firstRender:!1}},n.handleExited=function(o,i){var s=Ap(this.props.children);o.key in s||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(a){var l=Y({},a.children);return delete l[o.key],{children:l}}))},n.render=function(){var o=this.props,i=o.component,s=o.childFactory,a=Ze(o,["component","childFactory"]),l=this.state.contextValue,u=FN(this.state.children).map(s);return delete a.appear,delete a.enter,delete a.exit,i===null?W.createElement(Uu.Provider,{value:l},u):W.createElement(Uu.Provider,{value:l},W.createElement(i,a,u))},t})(W.Component);El.propTypes={};El.defaultProps=LN;const _N=[];function BN(e){M.useEffect(e,_N)}class Op{static create(){return new Op}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Sc(){const e=i2(Op.create).current;return BN(e.disposeEffect),e}function jN(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:u}=e,[d,f]=M.useState(!1),h=Ue(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},m=Ue(n.child,d&&n.childLeaving,r&&n.childPulsate);return!a&&!d&&f(!0),M.useEffect(()=>{if(!a&&l!=null){const b=setTimeout(l,u);return()=>{clearTimeout(b)}}},[l,a,u]),c.jsx("span",{className:h,style:p,children:c.jsx("span",{className:m})})}const pr=We("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Df=550,$N=80,HN=Ot.keyframes`
92
+ `).length,length:we.target.value.length}))}};return c.jsx(Is.Provider,{value:Y({},q,{dispatch:R}),children:c.jsxs("div",Y({ref:oe,className:pe},$,{onClick:ue,style:le,children:[c.jsx(ug,{hideToolbar:D,toolbarBottom:H,prefixCls:r,overflow:y,placement:"top"}),c.jsxs("div",{className:r+"-content",children:[/(edit|live)/.test(q.preview||"")&&c.jsx(KR,Y({className:r+"-input",prefixCls:r,autoFocus:I},C,{onChange:Ce,renderTextarea:_?.textarea||L,onScroll:we=>ne(we,"text")})),/(live|preview)/.test(q.preview||"")&&Z]}),h&&!q.fullscreen&&c.jsx(QR,{prefixCls:r,height:q.height,maxHeight:v,minHeight:S,onChange:Ie}),c.jsx(ug,{hideToolbar:D,toolbarBottom:H,prefixCls:r,overflow:y,placement:"bottom"})]}))})}),Wx=JR;Wx.Markdown=_x;const Od={scopeName:"source.malloy",patterns:[{include:"#malloy-language"}],repository:{"malloy-language":{patterns:[{include:"#sql-string"},{include:"#comments"},{include:"#tags"},{include:"#strings"},{include:"#numbers"},{include:"#keywords"},{include:"#properties"},{include:"#functions"},{include:"#datetimes"},{include:"#identifiers-quoted"},{include:"#types"},{include:"#constants"},{include:"#timeframes"},{include:"#identifiers-unquoted"}]},"malloy-matched":{begin:"{",end:"}",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"malloy-in-sql":{begin:"%{",name:"source.malloy-in-sql",end:"}%?",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"sql-string":{patterns:[{begin:'(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(""")',end:'"""',beginCaptures:{1:{name:"variable.other"},3:{name:"keyword.control.sql"},5:{name:"punctuation.sql-block.open"}},endCaptures:{0:{name:"punctuation.sql-block.close"}},name:"source.sql",patterns:[{include:"#malloy-in-sql"},{include:"source.sql"}]}]},functions:{patterns:[{match:"(?i)\\b(count)(\\s*\\()(distinct)",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.function.modifier"}}},{match:"(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.type"}}}]},datetimes:{patterns:[{match:"(?i)@[0-9]{4}-[0-9]{2}-[0-9]{2}[ T][0-9]{2}:[0-9]{2}((:[0-9]{2})(([\\.,][0-9]+)(\\[[A-Za-z_/]+\\])?)?)?",name:"constant.numeric.timestamp"},{match:"(?i)@[0-9]{4}(-Q[1-4]|-[0-9]{2}(-[0-9]{2}(-WK)?)?)?",name:"constant.numeric.date"}]},"identifiers-quoted":{patterns:[{match:"`[^`]*`",name:"variable.other.quoted"}]},"identifiers-unquoted":{patterns:[{match:"(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",name:"variable.other"}]},timeframes:{patterns:[{match:"(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",name:"keyword.other.timeframe"},{match:"(?i)\\b(day_of_year|day_of_month)\\b",name:"keyword.other.timeframe"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]},tags:{patterns:[{match:"##\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:'#"',end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{match:"#\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:"#\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"##\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"#",end:"\\n",beginCaptures:{0:{name:"string.quoted"}},name:"string.quoted"}],repository:{"tag-values":{name:"support.type.property-name.json",match:'(-)?((?:[^\\s=#]+)|(?:"[^#]+"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:"[^#]+")))?',captures:{1:{name:"keyword.control.negate"},2:{name:"support.type.property-name.json"},3:{name:"keyword.operator.comparison.ts"},4:{name:"string.quoted"}}}}},strings:{patterns:[{begin:"'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.single",patterns:[{include:"#escapes"}]},{begin:'"',end:'"',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.double",patterns:[{include:"#escapes"}]},{begin:'"""',end:'"""',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.triple"},{begin:"(?i)[r|/]'",end:"'",name:"string.regexp",patterns:[{include:"#regex-escapes"}]}],repository:{escapes:{name:"constant.character.escape",match:"\\\\(u[A-Fa-f0-9]{4}|.)",captures:{0:{name:"constant.character.escape"}}},"regex-escapes":{name:"constant.character.escape",match:"\\\\.",captures:{0:{name:"constant.character.escape"}}}}},numbers:{match:"(?i)(\\b((0|[1-9][0-9]*)(E[+-]?[0-9]+|\\.[0-9]*)?)|\\.[0-9]+)",name:"constant.numeric"},constants:{patterns:[{match:"(?i)\\bnull\\b",name:"constant.language.null"},{match:"(?i)\\btrue\\b",name:"constant.language.true"},{match:"(?i)\\bfalse\\b",name:"constant.language.false"}]},types:{patterns:[{match:"(?i)\\bstring\\b",name:"entity.name.type.string"},{match:"(?i)\\bnumber\\b",name:"entity.name.type.number"},{match:"(?i)\\bdate\\b",name:"entity.name.type.date"},{match:"(?i)\\btimestamp\\b",name:"entity.name.type.timestamp"},{match:"(?i)\\bboolean\\b",name:"entity.name.type.boolean"}]},properties:{patterns:[{match:"(?i)\\baccept\\b",name:"keyword.control.accept"},{match:"(?i)\\bselect\\b",name:"keyword.control.select"},{match:"(?i)\\bconnection\\b",name:"keyword.control.connection"},{match:"(?i)\\brun\\b",name:"keyword.control.run"},{match:"(?i)\\bextend\\b",name:"keyword.control.extend"},{match:"(?i)\\brefine\\b",name:"keyword.control.refine"},{match:"(?i)\\baggregate\\b",name:"keyword.control.aggregate"},{match:"(?i)\\bsample\\b",name:"keyword.control.sample"},{match:"(?i)\\bcalculate\\b",name:"keyword.control.calculate"},{match:"(?i)\\btimezone\\b",name:"keyword.control.timezone"},{match:"(?i)\\bdimension\\b",name:"keyword.control.dimension"},{match:"(?i)\\bexcept\\b",name:"keyword.control.except"},{match:"(?i)\\bsource\\b",name:"keyword.control.source"},{match:"(?i)\\bgroup_by\\b",name:"keyword.control.group_by"},{match:"(?i)\\bhaving\\b",name:"keyword.control.having"},{match:"(?i)\\bindex\\b",name:"keyword.control.index"},{match:"(?i)\\bjoin_one\\b",name:"keyword.control.join_one"},{match:"(?i)\\bwith\\b",name:"keyword.control.with"},{match:"(?i)\\bjoin_many\\b",name:"keyword.control.join_many"},{match:"(?i)\\bjoin_cross\\b",name:"keyword.control.join_cross"},{match:"(?i)\\blimit\\b",name:"keyword.control.limit"},{match:"(?i)\\bmeasure\\b",name:"keyword.control.measure"},{match:"(?i)\\bnest\\b",name:"keyword.control.nest"},{match:"(?i)\\border_by\\b",name:"keyword.control.order_by"},{match:"(?i)\\bpartition_by\\b",name:"keyword.control.partition_by"},{match:"(?i)\\bprimary_key\\b",name:"keyword.control.primary_key"},{match:"(?i)\\bproject\\b",name:"keyword.control.project"},{match:"(?i)\\bquery\\b",name:"keyword.control.query"},{match:"(?i)\\brename\\b",name:"keyword.control.rename"},{match:"(?i)\\btop\\b",name:"keyword.control.top"},{match:"(?i)\\bview\\b",name:"keyword.control.view"},{match:"(?i)\\bwhere\\b",name:"keyword.control.where"},{match:"(?i)\\bdeclare\\b",name:"keyword.control.declare"}]},keywords:{patterns:[{match:"(?i)\\bis\\b",name:"keyword.control.is"},{match:"(?i)\\bon\\b",name:"keyword.control.on"},{match:"(?i)\\bnot\\b",name:"keyword.other.not"},{match:"(?i)\\bor\\b",name:"keyword.other.or"},{match:"(?i)\\bdesc\\b",name:"keyword.control.desc"},{match:"(?i)\\bby\\b",name:"keyword.control.by"},{match:"(?i)\\band\\b",name:"keyword.other.and"},{match:"(?i)\\basc\\b",name:"keyword.control.asc"},{match:"(?i)\\bfor\\b",name:"keyword.other.for"},{match:"(?i)\\belse\\b",name:"keyword.other.else"},{match:"(?i)\\bto\\b",name:"keyword.other.to"},{match:"(?i)\\bwhen\\b",name:"keyword.other.when"},{match:"(?i)\\bpick\\b",name:"keyword.other.pick"},{match:"(?i)\\bimport\\b",name:"keyword.control.import"}]}}},eN={...Od,patterns:[...Od.patterns,{include:"#docvar"}],repository:{...Od.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},tN={name:"Malloy SQL",scopeName:"source.malloy-sql",patterns:[{include:"#malloysql-sql"}],repository:{"malloysql-sql":{beginCaptures:{0:{name:"entity.other.attribute.malloy-sql"},1:{name:"entity.other.attribute.malloy-sql"},3:{name:"comment.line.double-slash"}},name:"meta.embedded.block.malloysql.sql",patterns:[{include:"#comments"},{begin:"%{",end:"}%",beginCaptures:{0:{name:"punctuation.definition.malloy-sql"}},endCaptures:{0:{name:"punctuation.definition.malloy-sql"}},name:"meta.embedded.block.malloy",patterns:[{include:"source.malloy"}]},{include:"source.sql"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]}}},nN="github-light",rN="github-dark";let Md;function oN(){return Md||(Md=(async()=>{const[{createHighlighterCore:e},{createOnigurumaEngine:t},{default:n},{default:r},{default:o},{default:i},{default:s}]=await Promise.all([Promise.resolve().then(()=>require("./core-2tUy-45C.cjs.js")),Promise.resolve().then(()=>require("./engine-oniguruma-BkproSVE.cjs.js")),Promise.resolve().then(()=>require("./sql-BqWZrLHB.cjs.js")),Promise.resolve().then(()=>require("./json-y-J1j5EW.cjs.js")),Promise.resolve().then(()=>require("./typescript-BqvpT6pB.cjs.js")),Promise.resolve().then(()=>require("./github-light-BFTOhCbz.cjs.js")),Promise.resolve().then(()=>require("./github-dark-BKL9xNgN.cjs.js"))]);return e({engine:t(Promise.resolve().then(()=>require("./wasm-Dw4u1m6u.cjs.js"))),themes:[i,s],langs:[n,r,o,{name:"malloy",scopeName:"source.malloy",embeddedLangs:["sql"],...eN},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...tN}]})})()),Md}async function $u(e,t,n="light"){return(await oN()).codeToHtml(e,{lang:t,theme:n==="dark"?rN:nN})}function Xt(e){const{server:t}=De.useServer(),n={...e,queryKey:[...e.queryKey,t],queryFn:async()=>{try{return await e.queryFn()}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const i=new Error(o.response.data.message||o.message);throw i.status=o.response.status,i.data=o.response.data,i}}throw r}},retry:!1,throwOnError:!1};return Lr.useQuery(n,De.globalQueryClient)}function vn(e){const t={...e,mutationFn:async n=>{try{return await e.mutationFn(n)}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const i=new Error(o.response.data.message||o.message);throw i.status=o.response.status,i.data=o.response.data,i}}throw r}},retry:!1,throwOnError:!1};return Lr.useMutation(t,De.globalQueryClient)}const Ht=e=>{const t=new URL(e),n={};if(t.protocol!=="publisher:")throw new Error(`Failed to parse resource URI: ${e}`);const r=(t.hostname+t.pathname).split("/");for(let o=0;o<r.length;o+=2){const i=r[o];i==="environments"?n.environmentName=decodeURI(r[o+1])||void 0:i==="packages"?n.packageName=decodeURI(r[o+1])||void 0:i==="connections"?n.connectionName=decodeURI(r[o+1])||void 0:i==="models"&&(n.modelPath=decodeURI(r.slice(o+1).join("/"))||void 0)}if(n.versionId=t.searchParams.get("versionId")||void 0,!n.environmentName)throw new Error(`Failed to parse resource URI: ${e}`);return n},Cl=e=>{if(!e.environmentName)throw new Error(`Failed to encode resource URI, missing environment name: ${e}`);let t=`publisher://environments/${e.environmentName}`;return e.packageName&&(t+=`/packages/${e.packageName}`),e.connectionName&&(t+=`/connections/${e.connectionName}`),e.modelPath&&(t+=`/models/${e.modelPath}`),e.packageName&&e.versionId&&(t+=`?versionId=${e.versionId}`),t};function kp({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:i}){return W.useEffect(()=>{o&&o(t)},[t,o]),c.jsx(De.StyledCardMedia,{children:c.jsxs(Ot.Stack,{spacing:2,component:"section",children:[c.jsx(qx,{sourceAndPath:e[t],existingQuery:n,onChange:s=>{r&&r(s)},resourceUri:i}),c.jsx(Ot.Box,{height:"5px"})]})})}function fu(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function iN({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:i}){const[s,a]=W.useState(n||fu()),[l,u]=W.useState(void 0);W.useEffect(()=>{n&&a(n)},[n]);const[d,f]=W.useState([]),{MalloyExplorerProvider:h,QueryPanel:p,ResizableCollapsiblePanel:m,ResultPanel:b,SourcePanel:y}=r;W.useEffect(()=>{t&&t(s)},[t,s]);const{environmentName:x,packageName:C,versionId:v}=Ht(i),{apiClients:S}=De.useServer(),I=vn({mutationFn:()=>{const F=typeof s?.malloyQuery=="string"?s.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:s?.malloyQuery}).toMalloy();return u({executionState:"running",query:s?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:()=>{I.reset(),u(void 0)},response:{result:{}}}),a({...s,query:F}),S.models.executeQueryModel(x,C,e.modelPath,{query:F,sourceName:void 0,queryName:void 0,versionId:v})},onSuccess:F=>{if(F){const B=JSON.parse(F.data.result);a({...s,malloyResult:B}),u(j=>j?{...j,executionState:"finished",response:{result:B}}:void 0)}},onError:F=>{u(void 0),console.error("Query execution error:",F)}}),[T,N]=W.useState(e.sourceInfo.name);W.useEffect(()=>{T!==e.sourceInfo.name&&(N(e.sourceInfo.name),a(fu()),u(void 0))},[e,T]);const O=W.useCallback(F=>{a({...s,malloyQuery:F,malloyResult:void 0})},[s]);return T!==e.sourceInfo.name?c.jsx("div",{children:"Loading..."}):c.jsx(De.StyledExplorerContent,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:c.jsx(h,{source:e.sourceInfo,query:s?.malloyQuery,topValues:[],onFocusedNestViewPathChange:f,focusedNestViewPath:d,onQueryChange:O,children:c.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[c.jsx(m,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:c.jsx(y,{onRefresh:()=>a(fu())})}),c.jsx(m,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:c.jsx(p,{runQuery:()=>{console.log(`running query with: ${s?.malloyQuery}`);try{I.mutate()}catch(F){console.error("Error running query:",F)}}})}),c.jsx(b,{source:e.sourceInfo,draftQuery:s?.malloyQuery,setDraftQuery:F=>a({...s,malloyQuery:F}),submittedQuery:l,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function qx(e){const[t,n]=W.useState(null),[r,o]=W.useState(null),[i,s]=W.useState(!0);return W.useEffect(()=>{let a=!0;return Promise.all([import("@malloydata/malloy-explorer"),import("@malloydata/malloy-query-builder")]).then(([l,u])=>{a&&(n(l),o(u),s(!1))}).catch(l=>{console.error("Failed to load Malloy components:",l),a&&s(!1)}),()=>{a=!1}},[]),i||!t||!r?c.jsx(De.StyledExplorerPage,{children:c.jsx(De.StyledExplorerContent,{children:c.jsx(Ot.Box,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):c.jsx(iN,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}const Yx=mt(c.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}));function Sn({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:i=2,textVariant:s="body2"}){const a=c.jsxs(w.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:i},children:[c.jsx(w.CircularProgress,{size:t,color:n,thickness:r}),e&&c.jsx(w.Typography,{variant:s,color:"text.secondary",children:e})]});return o?c.jsx(w.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:a}):a}const sN=new Set(["warn","error"]);function aN(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!sN.has(r.severity??"")||(r.severity==="error"&&(n=!0),t.includes(r.message)||t.push(r.message));if(t.length)return{severity:n?"error":"warn",title:t.join(`
93
+ `)}}const lN=W.lazy(()=>Promise.resolve().then(()=>BW));function Os({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r}){const o=W.useRef(null),[i,s]=W.useState(t),[a,l]=W.useState(!1),u=aN(r);if(!e)return null;if(n>0&&e.length>n&&!a)return c.jsxs(w.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[c.jsx(On.Warning,{sx:{fontSize:48,color:"#757575"}}),c.jsx(w.Typography,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),c.jsx(w.Button,{variant:"contained",color:"primary",onClick:()=>l(!0),children:"Proceed"})]});const f=c.jsx(Sn,{text:"Loading...",centered:!0,size:32}),h=Math.min(t,i);return c.jsxs(w.Box,{ref:o,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden"},children:[e&&c.jsx(W.Suspense,{fallback:f,children:c.jsx(lN,{result:e,height:h,onSizeChange:s})}),u&&c.jsx(w.Box,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:c.jsx(w.Tooltip,{title:u.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:c.jsx(w.IconButton,{size:"small","aria-label":"Render tag warnings",sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"}},children:c.jsx(Yx,{fontSize:"small",color:u.severity==="error"?"error":"warning"})})})})]})}function uN({cell:e,sourceAndPaths:t,resourceUri:n,onQueryChange:r,onSourceChange:o}){const i={query:e.value,malloyResult:e.result?JSON.parse(e.result):void 0,malloyQuery:e.queryInfo?JSON.parse(e.queryInfo):void 0},s=t.findIndex(a=>a.sourceInfo.name===e.sourceName);return c.jsx(kp,{resourceUri:n,sourceAndPaths:t,selectedSourceIndex:s>=0?s:0,existingQuery:i,onQueryChange:r,onSourceChange:o})}function cN({cell:e,editingMalloy:t,editingMarkdown:n,sourceAndPaths:r,resourceUri:o,onCellChange:i,onClose:s,onEdit:a,onDelete:l,addButtonCallback:u}){const[d,f]=W.useState(e.value),[h,p]=W.useState(!1),[m,b]=W.useState(!1),[y,x]=W.useState(),[C]=W.useState(),[v,S]=W.useState(fu()),[I,T]=W.useState(!1),[N,O]=W.useState(e.sourceName?r.findIndex(se=>se.sourceInfo.name===e.sourceName):0),{mode:F}=De.usePublisherTheme();W.useEffect(()=>{e.isMarkdown||$u(e.value,"malloy",F).then(se=>{x(se)})},[e,F]),W.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[B,j]=W.useState(!1),D=()=>{l(),j(!1)},H=r.length===0,_=W.useCallback(()=>{const se=r[N],z=se?.modelPath||e.modelPath||"",pe=se?.sourceInfo.name||e.sourceName||"";i({...e,value:e.isMarkdown?d:v.query,result:v.malloyResult?JSON.stringify(v.malloyResult):void 0,queryInfo:v.malloyQuery?JSON.stringify(v.malloyQuery):void 0,sourceName:pe,modelPath:z})},[e,d,v,i,N,r]),L=c.jsx(w.Tooltip,{title:"Delete Cell",children:c.jsx(w.IconButton,{size:"small",onClick:()=>j(!0),children:c.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),$=c.jsxs(w.Dialog,{open:B,onClose:()=>j(!1),children:[c.jsx(w.DialogTitle,{children:"Confirm Delete"}),c.jsx(w.DialogContent,{children:c.jsx(w.Typography,{children:"Are you sure you want to delete this cell?"})}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:()=>j(!1),children:"Cancel"}),c.jsx(w.Button,{onClick:D,color:"error",children:"Delete"})]})]}),K=()=>{_(),s()},G=e.isMarkdown?c.jsxs(c.Fragment,{children:[n?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}):c.jsx(w.Tooltip,{title:"Edit",children:c.jsx(w.IconButton,{size:"small",onClick:a,children:c.jsx(Pm,{})})}),!n&&L]}):c.jsxs(c.Fragment,{children:[!t&&c.jsx(w.Tooltip,{title:h?"Hide Code":"View Code",children:c.jsx(w.IconButton,{size:"small",onClick:()=>{p(!h)},children:c.jsx(vb,{})})}),!t&&e.result&&c.jsx(w.Tooltip,{title:m?"Hide Embedding":"View Embedding",children:c.jsx(w.IconButton,{size:"small",onClick:()=>{b(!m)},children:c.jsx(Kf,{})})}),t&&c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}),!t&&c.jsx(w.Tooltip,{title:"Edit",children:c.jsx(w.IconButton,{size:"small",onClick:a,children:c.jsx(Pm,{})})}),!t&&L]}),q=t||n,R=n?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}):t?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:K,children:c.jsx(Hl,{})})}):null,oe=I&&c.jsx(w.Box,{sx:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"8px",backgroundColor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:"8px",padding:"2px 4px",boxShadow:1,zIndex:10},children:!q&&c.jsxs(c.Fragment,{children:[u(!0),u(!1),G]})||R});return c.jsxs(De.StyledCard,{sx:se=>({position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:se.palette.background.paper,minHeight:"50px"}),onMouseEnter:()=>T(!0),onMouseLeave:()=>{T(!1)},children:[oe,e.isMarkdown?c.jsx(c.Fragment,{children:n?c.jsx(Wx,{value:d,preview:"edit",autoFocus:!0,onChange:se=>{f(se),i({...e,value:se})},onBlur:()=>{_(),I||K()}}):c.jsx(w.Box,{sx:{px:.5,pt:0,mt:0,"& h1, & h2, & h3, & h4, & h5, & h6":{mt:.5,mb:.5},"& p":{mt:.5,mb:.5},"& ul, & ol":{mt:.5,mb:.5},"& li":{mt:0,mb:0},"& pre, & code":{mt:.5,mb:.5},"& blockquote":{mt:.5,mb:.5}},children:e.value?c.jsx(w.Box,{onClick:a,sx:{cursor:"pointer"},children:c.jsx(wu,{children:e.value})}):c.jsxs(w.Box,{onClick:a,sx:{cursor:"pointer"},children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):c.jsxs(c.Fragment,{children:[c.jsx(w.Collapse,{in:m,timeout:"auto",unmountOnExit:!0,children:c.jsx(w.Stack,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:c.jsx(w.Typography,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:C}})})}),c.jsx(w.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,children:c.jsx(w.Stack,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:c.jsx(w.Typography,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:y}})})}),t&&(H?c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):c.jsx(uN,{sourceAndPaths:r,resourceUri:o,onQueryChange:se=>{S(se)},onSourceChange:se=>{O(se)},cell:e})),!t&&e.result&&c.jsx(De.StyledCard,{variant:"outlined",sx:{borderRadius:0},children:c.jsx(Os,{result:e.result,maxHeight:800})}),!t&&!e.result&&c.jsxs(w.Box,{onClick:a,sx:{cursor:"pointer"},children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),B&&$]})}const Kx=W.createContext(void 0);function dN({children:e,workbookStorage:t}){const n=W.useMemo(()=>({workbookStorage:t}),[t]);return c.jsx(Kx.Provider,{value:n,children:e})}function wp(){const e=W.useContext(Kx);if(!e)throw new Error("useWorkbookStorage must be used within a WorkbookStorageProvider");return e}const Fr=mt(c.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),fN=mt(c.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"}));function kn({error:e,context:t}){const n=e.data?.message||"Unknown Error";return c.jsxs(c.Fragment,{children:[t&&c.jsx(w.Typography,{variant:"body2",sx:{p:"10px",m:"auto"},children:t}),c.jsx("pre",{style:{whiteSpace:"pre-wrap",color:"red",padding:"10px",margin:"auto"},children:n})]})}function pN({initialSelectedModels:e,onModelChange:t,resourceUri:n}){const{environmentName:r,packageName:o,versionId:i}=Ht(n),{apiClients:s}=De.useServer(),{data:a,isLoading:l,isSuccess:u,isError:d,error:f}=Xt({queryKey:["models",r,o,i],queryFn:()=>s.models.listModels(r,o,i)}),[h,p]=W.useState(e||[]),[m,b]=W.useState(null);W.useEffect(()=>{p(e||[])},[e]);const y=v=>{const S=h.filter(I=>I!==v);p(S),t(S)},x=v=>{const S=[...h,v];p(S),t(S),b(null)};let C=[];return u&&a?.data&&(C=a.data.filter(v=>!h.includes(v.path)).map(v=>v.path)),d?c.jsx(kn,{error:f,context:`${r} > ${o} > Model Picker`}):c.jsxs(c.Fragment,{children:[c.jsxs(w.FormControl,{fullWidth:!0,children:[l&&c.jsx(w.Typography,{children:"Loading..."}),c.jsxs(w.Stack,{direction:"row",spacing:1,children:[h.map(v=>c.jsx(w.Chip,{label:v,onDelete:()=>y(v),deleteIcon:c.jsx(Fr,{}),sx:{marginBottom:"5px"}},v)),c.jsx(w.Button,{size:"small",startIcon:c.jsx(fN,{}),onClick:v=>b(v.currentTarget),disabled:l||d||C.length===0,children:"Add Model"})]})]}),c.jsxs(w.Menu,{anchorEl:m,open:!!m,onClose:()=>b(null),children:[c.jsx(w.Typography,{variant:"subtitle2",sx:{ml:1},children:"Models"}),c.jsx(w.Divider,{}),C.length===0?c.jsx(w.MenuItem,{disabled:!0,children:"No models available"}):C.map(v=>c.jsx(w.MenuItem,{onClick:()=>x(v),children:c.jsx(w.Typography,{variant:"body2",children:v})},v))]})]})}function Gx(){const e=oT.useNavigate();return(t,n)=>{if(!n||!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.button!==1){e(t);return}const r=new URL(t,window.location.href).href;(n.metaKey||n.ctrlKey||n.button===1||n.shiftKey)&&window.open(r,"_blank")}}function hN({workbookPath:e,resourceUri:t}){const n=Gx(),{server:r,getAccessToken:o}=De.useServer(),{apiClients:i}=De.useServer(),{workbookStorage:s}=wp(),{environmentName:a,packageName:l}=Ht(t),[u,d]=W.useState(void 0),[f,h]=W.useState(void 0);if(!s)throw new Error("Workbook storage be provided via WorkbookStorageProvider");const[p,m]=W.useState(),[b,y]=W.useState(),[x,C]=W.useState(),[v,S]=W.useState([]),[I,T]=W.useState(null),[N,O]=W.useState(null),F=!!I,B=()=>{T(null),O(null)},j=(oe,se)=>{p&&(m(p.insertCell(se,{isMarkdown:oe,value:""})),oe?C(se):y(se),B(),console.log("handleAddCell",oe,se))},[D,H]=W.useState(!1),_=()=>{H(!0)},L=async()=>{e&&s&&await s.deleteWorkbook(e).then(()=>{h(void 0),d(void 0)}).catch(oe=>{h(`Error deleting workbook: ${oe.message}`),d(void 0)}),H(!1),n(`/${a}/${l}`)},$=()=>{H(!1)},K=W.useCallback(async()=>{if(!p){console.log("No workbook data ref");return}try{m(await p.saveWorkbook()),h(void 0),d("Workbook saved")}catch(oe){h(`Error saving workbook: ${oe.message}`),d(void 0)}},[p]);if(W.useEffect(()=>{if(!p)return;(async()=>{const se=new Map(v.map(({modelPath:J,sourceInfos:Q})=>[J,Q])),z=[],pe=[];for(const J of p.getModels())se.has(J)?z.push({modelPath:J,sourceInfos:se.get(J)}):(console.log("Fetching model from Publisher",J),pe.push(i.models.getModel(a,l,J,void 0).then(Q=>({modelPath:J,sourceInfos:Q.data.sourceInfos.map(re=>JSON.parse(re))}))));if(pe.length>0){const J=await Promise.all(pe);S([...z,...J])}else S(z)})()},[o,p,l,a,r]),W.useEffect(()=>{e&&ns.loadWorkbook(s,e).then(oe=>{m(oe)})},[e,s]),!p)return c.jsx("div",{children:"Loading..."});const G=oe=>{const se=[];for(const z of oe)for(const pe of z.sourceInfos)se.push({modelPath:z.modelPath,sourceInfo:pe});return se},q=(oe,se)=>c.jsx(w.Button,{size:"small",startIcon:c.jsx(fl,{}),onClick:()=>j(oe,se),variant:"contained",sx:{backgroundColor:z=>z.palette.background.paper,color:z=>z.palette.mode==="dark"?z.palette.grey[100]:z.palette.grey[700],boxShadow:"none","&:hover":{backgroundColor:z=>z.palette.mode==="dark"?z.palette.grey[500]:z.palette.grey[300],boxShadow:"none"}},children:oe?"Markdown":"Explore"}),R=c.jsxs(w.Box,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[q(!1,p.getCells().length),q(!0,p.getCells().length)]});return c.jsxs(De.StyledCard,{variant:"outlined",children:[c.jsxs(De.StyledCardContent,{children:[c.jsx(w.Box,{sx:{mb:2},children:c.jsx(w.Box,{sx:{minHeight:"24px"},children:f?c.jsx(w.Typography,{color:"error",variant:"body2",children:f}):u?c.jsx(w.Typography,{color:"success",variant:"body2",children:u}):c.jsx("span",{children:" "})})}),c.jsxs(Ui,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[c.jsxs(Ui,{direction:"row",spacing:1,alignItems:"center",children:[c.jsx(w.Typography,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),c.jsx(w.Typography,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${e.workspace} > ${e.path}`})]}),c.jsxs(Ui,{sx:{display:"flex",flexDirection:"row",gap:1},children:[c.jsx(w.Box,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:c.jsx(mN,{workbookData:p})}),c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[c.jsx(w.Button,{color:"error",onClick:_,size:"small",children:"Delete"}),c.jsxs(w.Dialog,{open:D,onClose:$,children:[c.jsx(w.DialogTitle,{children:"Delete Workbook"}),c.jsx(w.DialogContent,{children:c.jsxs(w.DialogContentText,{children:['Are you sure you want to delete the workbook "',e.path,'"? This action cannot be undone.']})}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:$,color:"primary",size:"small",children:"Cancel"}),c.jsx(w.Button,{onClick:L,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),c.jsx(w.Divider,{}),c.jsxs(Ui,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[c.jsx(w.Box,{sx:{flex:1},children:c.jsx(pN,{initialSelectedModels:p.getModels(),onModelChange:oe=>{m(p.setModels(oe)),K()},resourceUri:t})}),c.jsx(w.Box,{sx:{flex:1}})]})]}),c.jsx(De.StyledCardMedia,{children:c.jsxs(Ui,{children:[p.getCells().length===0&&c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),c.jsx(w.Typography,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),p.getCells().map((oe,se)=>c.jsx(W.Fragment,{children:c.jsx(cN,{cell:oe,resourceUri:t,addButtonCallback:z=>q(z,se),sourceAndPaths:G(v),editingMarkdown:x===se,editingMalloy:b===se,onDelete:()=>{m(p.deleteCell(se)),K()},onCellChange:z=>{m(p.setCell(se,z))},onEdit:()=>{oe.isMarkdown?C(se):y(se)},onClose:()=>{oe.isMarkdown?C(void 0):y(void 0),K()}},`${se}-${oe.isMarkdown}-${e.workspace}-${e.path}`)},`${se}-${p.getCells().length}`)),R,c.jsxs(w.Menu,{anchorEl:I,open:F,onClose:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(w.MenuItem,{onClick:()=>j(!0,N??0),children:"Add Markdown"}),c.jsx(w.MenuItem,{onClick:()=>j(!1,N??0),children:"Add Malloy"})]}),c.jsx(Ui,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function mN({workbookData:e}){const[t,n]=W.useState(!1),r=async()=>{if(!e)return;const o=e.toMalloyWorkbook();try{await navigator.clipboard.writeText(o),n(!0),setTimeout(()=>n(!1),1500)}catch{n(!1),alert("Failed to copy to clipboard")}};return c.jsx(w.Button,{color:"primary",onClick:r,size:"small",children:t?"Copied!":"Export"})}function Qx({onWorkbookClick:e}){const{workbookStorage:t}=wp(),[n,r]=W.useState([]),[o,i]=W.useState(void 0);return W.useEffect(()=>{t&&t.listWorkspaces(!1).then(s=>{const a=[];Promise.all(s.map(async l=>{await t.listWorkbooks(l).then(u=>{a.push(...u)}).catch(u=>{i(`Error listing workbooks: ${u.message}`)})})).then(()=>{r(a),i(void 0)})})},[t]),c.jsxs(c.Fragment,{children:[o&&c.jsx(w.Box,{sx:{mb:2},children:c.jsx(w.Typography,{color:"error",variant:"body2",children:o})}),c.jsx(w.Divider,{}),c.jsx(w.Box,{sx:{maxHeight:"300px",overflow:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"rgba(0,0,0,0.2)",borderRadius:"4px"}},children:c.jsxs(w.List,{dense:!0,children:[n.length===0&&c.jsx(w.ListItem,{children:c.jsx(w.ListItemText,{primary:"No workbooks found.",sx:{textAlign:"center"}})}),n.map(s=>c.jsx(w.ListItem,{onClick:a=>e(s,a),sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}},children:c.jsx(w.ListItemText,{primary:s.path})},s.path))]})})]})}const cg="Local";class gN{async listWorkspaces(t){return Promise.resolve([{name:cg,description:"Stored locally- only accessible to this browser",writeable:!0}])}async listWorkbooks(t){const n=[];for(let r=0;r<localStorage.length;r++){const o=localStorage.key(r);n.push({path:o,workspace:cg})}return n}async getWorkbook(t){const n=localStorage.getItem(t.path);if(n===null)throw new Error(`Notebook not found at path: ${t}`);return n}async deleteWorkbook(t){if(localStorage.getItem(t.path)===null)throw new Error(`Notebook not found at path: ${t}`);localStorage.removeItem(t.path)}async saveWorkbook(t,n){localStorage.setItem(t.path,n)}async moveWorkbook(t,n){const r=localStorage.getItem(t.path);if(r===null)throw new Error(`Notebook not found at path: ${t.path}`);localStorage.setItem(n.path,r),localStorage.removeItem(t.path)}}function bN({onWorkbookSelect:e}){const{workbookStorage:t}=wp(),[n,r]=W.useState(""),[o,i]=W.useState(""),[s,a]=W.useState([]),[l,u]=W.useState(null),[d,f]=W.useState(!1),[h,p]=W.useState(!1),m=!!l,b=T=>{u(T.currentTarget)},y=()=>{u(null)},x=()=>{p(!1)},C=()=>{f(!1),r(""),i("")};W.useEffect(()=>{t&&(console.log("fetching workspaces"),t.listWorkspaces(!0).then(T=>{a(T),T.length===1&&i(T[0].name)}).catch(T=>{console.error("Error fetching workspaces:",T),a([])}))},[t]);const v=(T,N)=>{p(!1),e(T,N)},S=T=>{f(!1),e({path:n,workspace:o},T),r(""),i("")},I=s.length===0;return c.jsxs(c.Fragment,{children:[c.jsx(w.Button,{"aria-controls":m?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":m?"true":void 0,onClick:b,variant:"contained",sx:{height:"40px",px:2,backgroundColor:"#fbbb04","&:hover":{backgroundColor:"#eab308"}},children:"Analyze Package"}),c.jsxs(w.Menu,{id:"basic-menu",anchorEl:l,open:m,onClose:y,MenuListProps:{"aria-labelledby":"basic-button",sx:{py:.5}},children:[c.jsxs(w.MenuItem,{onClick:()=>{f(!0),y()},sx:{py:1,px:2},disabled:I,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Add,{fontSize:"small"})}),c.jsxs(w.ListItemText,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:"New Workbook"}),I?c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"No workspaces available"}):c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"Create a new analysis workbook"})]})]}),c.jsxs(w.MenuItem,{onClick:()=>{p(!0),y()},sx:{py:1,px:2},children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Launch,{fontSize:"small"})}),c.jsxs(w.ListItemText,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:"Open Workbook"}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"Open an existing workbook"})]})]})]}),c.jsxs(w.Dialog,{open:d,onClose:C,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pb:1,pt:2,px:2},children:[c.jsx(w.Typography,{fontWeight:600,sx:{fontSize:"1.5rem",mb:.5},children:"Create New Workbook"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Start a new analysis workbook to explore your data"})]}),c.jsx(w.DialogContent,{sx:{px:2,pb:2},children:c.jsxs(w.Stack,{spacing:2,sx:{mt:1},children:[s.length>1?c.jsxs(w.FormControl,{fullWidth:!0,size:"small",children:[c.jsx(w.InputLabel,{children:"Workspace"}),c.jsx(w.Select,{value:o,label:"Workspace",onChange:T=>i(T.target.value),children:s.map(T=>c.jsx(w.MenuItem,{value:T.name,children:c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:T.name}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:T.description})]})},T.name))})]}):s.length===1?c.jsxs(w.Box,{sx:T=>({p:2,border:1,borderColor:"divider",borderRadius:1,backgroundColor:T.palette.mode==="dark"?"rgba(255, 255, 255, 0.04)":"grey.50"}),children:[c.jsxs(w.Typography,{variant:"body2",fontWeight:500,gutterBottom:!0,children:["Workspace: ",s[0].name]}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:s[0].description})]}):null,c.jsx(w.FormControl,{fullWidth:!0,children:c.jsx(w.TextField,{label:"Workbook Name",value:n,onChange:T=>r(T.target.value),placeholder:"Enter workbook name...",fullWidth:!0,autoFocus:!0,size:"small"})}),c.jsxs(w.Stack,{direction:"row",spacing:1,justifyContent:"flex-end",children:[c.jsx(w.Button,{onClick:C,variant:"outlined",size:"small",children:"Cancel"}),c.jsx(w.Button,{onClick:T=>S(T),variant:"contained",disabled:!n.trim()||s.length>1&&!o,size:"small",children:"Create Workbook"})]})]})})]}),c.jsxs(w.Dialog,{open:h,onClose:x,maxWidth:"md",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pb:1,pt:2,px:2},children:[c.jsx(w.Typography,{fontWeight:600,sx:{mb:.5,fontSize:"1.5rem"},children:"Open Workbook"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Select an existing workbook to continue your analysis"})]}),c.jsx(w.DialogContent,{sx:{px:2,pb:2},children:c.jsx(Qx,{onWorkbookClick:v})})]})]})}const Xx=mt(c.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),yN="publisher:resize";function xN(e){return typeof e=="object"&&e!==null&&e.type===yN&&typeof e.height=="number"}function Zx(e){return e.replace(/\/api\/v0\/?$/,"")}function Jx({server:e,environmentName:t,packageName:n,path:r}){const o=r.startsWith("public/")?r.slice(7):r;return`${Zx(e)}/environments/${encodeURIComponent(t)}/packages/${encodeURIComponent(n)}/`+o}function CN(e){try{const{environmentName:t,packageName:n,modelPath:r}=Ht(e);return!t||!n||!r?null:{environmentName:t,packageName:n,dataAppPath:r}}catch{return null}}function EN({resourceUri:e}){const{server:t,apiClients:n}=De.useServer(),r=CN(e),o=r?.environmentName??"",i=r?.packageName??"",s=r?.dataAppPath??"",a=W.useMemo(()=>Jx({server:t,environmentName:o,packageName:i,path:s}),[t,o,i,s]),u=Xt({queryKey:["data-apps",o,i],queryFn:()=>n.dataApps.listDataApps(o,i),enabled:!!r}).data?.data?.find(b=>b.path===s),d=u?.title??s,f=u?.fit==="viewport",h=W.useRef(null),[p,m]=W.useState(120);return W.useEffect(()=>{if(f)return;function b(y){xN(y.data)&&y.source===h.current?.contentWindow&&y.data.height>0&&m(Math.ceil(y.data.height))}return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[f]),r?c.jsxs(w.Box,{sx:{p:3,...f?{height:"100%",display:"flex",flexDirection:"column"}:{maxWidth:1200,mx:"auto"}},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1,flexShrink:0},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:d}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{fontFamily:De.MONO_FONT_FAMILY},children:s}),c.jsx(w.Box,{sx:{flex:1}}),c.jsx(w.Tooltip,{title:"Open standalone in new tab",children:c.jsx(w.IconButton,{size:"small",href:a,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",sx:{color:"text.secondary"},children:c.jsx(Xx,{fontSize:"small"})})})]}),c.jsx(w.Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",backgroundColor:"background.paper",...f?{flex:1,minHeight:0}:{}},children:c.jsx("iframe",{ref:h,src:a,title:d,sandbox:"allow-scripts allow-same-origin allow-forms",style:{display:"block",width:"100%",height:f?"100%":p,border:0}})})]}):c.jsxs(w.Box,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600},children:"Can't open data app"}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["This data app link is missing an environment, package, or path:",c.jsx(w.Box,{component:"span",sx:{fontFamily:De.MONO_FONT_FAMILY,ml:1},children:e})]})]})}const e2=mt(c.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}));function vN({onSubmit:e,isSubmitting:t,disabled:n,disabledReason:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(!1),l=()=>i(!1),u=async()=>{try{await e({forceRefresh:s}),i(!1)}catch{}},d=c.jsx("span",{children:c.jsx(w.Button,{variant:"contained",startIcon:c.jsx(fl,{}),onClick:()=>i(!0),disabled:n,"aria-label":"New materialization",children:"New materialization"})});return c.jsxs(c.Fragment,{children:[n&&r?c.jsx(w.Tooltip,{title:r,children:d}):d,c.jsxs(w.Dialog,{open:o,onClose:l,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-materialization-title",children:[c.jsx(w.DialogTitle,{id:"create-materialization-title",children:"New materialization"}),c.jsxs(w.DialogContent,{children:[c.jsx(w.DialogContentText,{sx:{mb:2},children:"Materialize every persist source in this package: compile, build the tables, and load them so queries serve from the materialized tables."}),c.jsx(w.FormGroup,{children:c.jsx(w.FormControlLabel,{control:c.jsx(w.Switch,{checked:s,onChange:f=>a(f.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})})]}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:l,children:"Cancel"}),c.jsx(w.Button,{variant:"contained",loading:t,onClick:u,children:"Materialize"})]})]})]})}function Tf({children:e}){return c.jsx(w.Typography,{variant:"caption",component:"h6",sx:{display:"block",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,color:"text.secondary",mb:1},children:e})}function Ja(e){return e===De.MaterializationStatus.Pending||e===De.MaterializationStatus.ManifestRowsReady}function TN(e){return e===De.MaterializationStatus.ManifestFileReady||e===De.MaterializationStatus.Failed||e===De.MaterializationStatus.Cancelled}function t2(e){switch(e){case De.MaterializationStatus.ManifestFileReady:return"Done";case De.MaterializationStatus.Failed:return"Failed";case De.MaterializationStatus.Cancelled:return"Cancelled";case De.MaterializationStatus.Pending:case De.MaterializationStatus.ManifestRowsReady:return"Pending";default:return"Unknown"}}function n2(e){switch(e){case De.MaterializationStatus.ManifestRowsReady:return"info";case De.MaterializationStatus.ManifestFileReady:return"success";case De.MaterializationStatus.Failed:return"error";case De.MaterializationStatus.Cancelled:return"warning";case De.MaterializationStatus.Pending:default:return"default"}}function r2(e){return e.metadata??{}}function SN(e){return e.trigger==="SCHEDULER"?"Scheduled":"Manual"}function o2(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),o=Math.max(0,r-n);if(o<1e3)return`${o}ms`;const i=Math.round(o/1e3);if(i<60)return`${i}s`;const s=Math.floor(i/60),a=i%60;if(s<60)return`${s}m ${a}s`;const l=Math.floor(s/60),u=s%60;return`${l}h ${u}m`}function Sf(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function kN(e){if(!e)return"-";const t=new Date(e).getTime(),n=Math.round((Date.now()-t)/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function wN({entries:e,builtAt:t}){const n=Object.entries(e??{});return c.jsxs(w.Box,{children:[c.jsxs(w.Stack,{direction:"row",alignItems:"baseline",justifyContent:"space-between",children:[c.jsx(Tf,{children:"Build manifest"}),t&&c.jsxs(w.Typography,{variant:"caption",color:"text.secondary",children:["Built ",Sf(t)]})]}),n.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"No materialized tables yet."}):c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"Source"}),c.jsx(w.TableCell,{children:"Table name"}),c.jsx(w.TableCell,{children:"Connection"}),c.jsx(w.TableCell,{children:"Realization"}),c.jsx(w.TableCell,{align:"right",children:"Rows"})]})}),c.jsx(w.TableBody,{children:n.map(([r,o])=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:o.sourceName??r}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:o.physicalTableName??"-"}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:o.connectionName??"-"}),c.jsx(w.TableCell,{children:o.realization??"-"}),c.jsx(w.TableCell,{align:"right",children:o.rowCount??"-"})]},r))})]})]})}const Hu=mt([c.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),c.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")]),DN=mt(c.jsx("path",{d:"M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74m9.84 4.63-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74c-3.6-.76-3.54-.75-3.67-.75-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38"}));function i2({meta:e}){const t=e.trigger==="SCHEDULER";return c.jsx(w.Tooltip,{title:t?"Fired by the materialization schedule":"Triggered manually",children:c.jsx(w.Chip,{size:"small",variant:"outlined",color:t?"info":"default",icon:t?c.jsx(Hu,{fontSize:"small"}):c.jsx(DN,{fontSize:"small"}),label:SN(e)})})}function s2({materialization:e,buildPlan:t,showBuildPlan:n=!0,onClose:r}){const o=e?r2(e):{},i=Object.values(t?.sources??{});return c.jsx(w.Dialog,{open:e!==null,onClose:r,maxWidth:"md",fullWidth:!0,"aria-labelledby":"materialization-detail-title",children:e&&c.jsxs(c.Fragment,{children:[c.jsxs(w.DialogTitle,{sx:{pr:6,pb:1.5},id:"materialization-detail-title",children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.75},children:[c.jsx(w.Chip,{size:"small",label:t2(e.status),color:n2(e.status),variant:Ja(e.status)?"filled":"outlined"}),c.jsx(i2,{meta:o})]}),c.jsx(w.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:e.packageName??"Materialization"}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{fontFamily:De.MONO_FONT_FAMILY,wordBreak:"break-all"},children:e.id}),c.jsx(w.IconButton,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8},children:c.jsx(Fr,{fontSize:"small"})})]}),c.jsxs(w.DialogContent,{dividers:!0,children:[c.jsxs(w.Box,{sx:{bgcolor:"action.hover",borderRadius:2,p:2,mb:3,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:2},children:[c.jsx(na,{label:"Started",value:Sf(e.startedAt??e.createdAt)}),c.jsx(na,{label:"Completed",value:Sf(e.completedAt)}),c.jsx(na,{label:"Duration",value:o2(e.startedAt,e.completedAt)}),c.jsx(na,{label:"Sources",value:`${o.sourcesBuilt??0} built · ${o.sourcesReused??0} reused`}),c.jsx(na,{label:"Force refresh",value:o.forceRefresh?"Yes":"No"})]}),e.error&&c.jsxs(w.Box,{sx:{borderRadius:2,p:2,mb:3,border:"1px solid",borderColor:"error.main"},children:[c.jsx(Tf,{children:c.jsx(w.Box,{component:"span",sx:{color:"error.main"},children:"Error"})}),c.jsx(w.Typography,{variant:"body2",sx:{fontFamily:De.MONO_FONT_FAMILY,whiteSpace:"pre-wrap"},children:e.error})]}),n&&c.jsxs(w.Box,{sx:{mb:3},children:[c.jsx(Tf,{children:"Build plan"}),i.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"This package has no persist sources."}):c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"Source"}),c.jsx(w.TableCell,{children:"Connection"}),c.jsx(w.TableCell,{children:"Dialect"}),c.jsx(w.TableCell,{align:"right",children:"Columns"}),c.jsx(w.TableCell,{children:"Source Entity ID"})]})}),c.jsx(w.TableBody,{children:i.map(s=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:s.name}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY},children:s.connectionName}),c.jsx(w.TableCell,{children:s.dialect??"-"}),c.jsx(w.TableCell,{align:"right",children:s.columns?.length??0}),c.jsx(w.TableCell,{sx:{fontFamily:De.MONO_FONT_FAMILY,fontSize:"0.75rem",wordBreak:"break-all",maxWidth:220},children:s.sourceEntityId})]},s.sourceID))})]})]}),c.jsx(wN,{entries:e.manifest?.entries,builtAt:e.manifest?.builtAt})]})]})})}function na({label:e,value:t}){return c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"caption",color:"text.secondary",display:"block",children:e}),c.jsx(w.Typography,{variant:"body2",children:t})]})}const IN=mt(c.jsx("path",{d:"M6 6h12v12H6z"})),a2=Ee.oneOfType([Ee.func,Ee.object]);function dg(e){try{return e.matches(":focus-visible")}catch{}return!1}const fg={};function l2(e,t){const n=M.useRef(fg);return n.current===fg&&(n.current=e(t)),n}class zu{static create(){return new zu}static use(){const t=l2(zu.create).current,[n,r]=M.useState(!1);return t.shouldMount=n,t.setShouldMount=r,M.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=ON(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function AN(){return zu.use()}function ON(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function kf(e,t){return kf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},kf(e,t)}function Dp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,kf(e,t)}function MN(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function PN(e,t){e.classList?e.classList.add(t):MN(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function pg(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function RN(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=pg(e.className,t):e.setAttribute("class",pg(e.className&&e.className.baseVal||"",t))}const hg={disabled:!1},Uu=W.createContext(null);var u2=function(t){return t.scrollTop},Da="unmounted",ei="exited",ti="entering",Qi="entered",wf="exiting",Dr=(function(e){Dp(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=o,a=s&&!s.isMounting?r.enter:r.appear,l;return i.appearStatus=null,r.in?a?(l=ei,i.appearStatus=ti):l=Qi:r.unmountOnExit||r.mountOnEnter?l=Da:l=ei,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===Da?{status:ei}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==ti&&s!==Qi&&(i=ti):(s===ti||s===Qi)&&(i=wf)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===ti){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Ta.findDOMNode(this);s&&u2(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ei&&this.setState({status:Da})},n.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[Ta.findDOMNode(this),a],u=l[0],d=l[1],f=this.getTimeouts(),h=a?f.appear:f.enter;if(!o&&!s||hg.disabled){this.safeSetState({status:Qi},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:ti},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Qi},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:Ta.findDOMNode(this);if(!i||hg.disabled){this.safeSetState({status:ei},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:wf},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:ei},function(){o.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:Ta.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Da)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=Ze(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return W.createElement(Uu.Provider,{value:null},typeof s=="function"?s(o,a):W.cloneElement(W.Children.only(s),a))},t})(W.Component);Dr.contextType=Uu;Dr.propTypes={};function Yi(){}Dr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yi,onEntering:Yi,onEntered:Yi,onExit:Yi,onExiting:Yi,onExited:Yi};Dr.UNMOUNTED=Da;Dr.EXITED=ei;Dr.ENTERING=ti;Dr.ENTERED=Qi;Dr.EXITING=wf;var NN=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return PN(t,r)})},Pd=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return RN(t,r)})},Ip=(function(e){Dp(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(a,l){var u=r.resolveArguments(a,l),d=u[0],f=u[1];r.removeClasses(d,"exit"),r.addClass(d,f?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(a,l)},r.onEntering=function(a,l){var u=r.resolveArguments(a,l),d=u[0],f=u[1],h=f?"appear":"enter";r.addClass(d,h,"active"),r.props.onEntering&&r.props.onEntering(a,l)},r.onEntered=function(a,l){var u=r.resolveArguments(a,l),d=u[0],f=u[1],h=f?"appear":"enter";r.removeClasses(d,h),r.addClass(d,h,"done"),r.props.onEntered&&r.props.onEntered(a,l)},r.onExit=function(a){var l=r.resolveArguments(a),u=l[0];r.removeClasses(u,"appear"),r.removeClasses(u,"enter"),r.addClass(u,"exit","base"),r.props.onExit&&r.props.onExit(a)},r.onExiting=function(a){var l=r.resolveArguments(a),u=l[0];r.addClass(u,"exit","active"),r.props.onExiting&&r.props.onExiting(a)},r.onExited=function(a){var l=r.resolveArguments(a),u=l[0];r.removeClasses(u,"exit"),r.addClass(u,"exit","done"),r.props.onExited&&r.props.onExited(a)},r.resolveArguments=function(a,l){return r.props.nodeRef?[r.props.nodeRef.current,a]:[a,l]},r.getClassNames=function(a){var l=r.props.classNames,u=typeof l=="string",d=u&&l?l+"-":"",f=u?""+d+a:l[a],h=u?f+"-active":l[a+"Active"],p=u?f+"-done":l[a+"Done"];return{baseClassName:f,activeClassName:h,doneClassName:p}},r}var n=t.prototype;return n.addClass=function(o,i,s){var a=this.getClassNames(i)[s+"ClassName"],l=this.getClassNames("enter"),u=l.doneClassName;i==="appear"&&s==="done"&&u&&(a+=" "+u),s==="active"&&o&&u2(o),a&&(this.appliedClasses[i][s]=a,NN(o,a))},n.removeClasses=function(o,i){var s=this.appliedClasses[i],a=s.base,l=s.active,u=s.done;this.appliedClasses[i]={},a&&Pd(o,a),l&&Pd(o,l),u&&Pd(o,u)},n.render=function(){var o=this.props;o.classNames;var i=Ze(o,["classNames"]);return W.createElement(Dr,Y({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(W.Component);Ip.defaultProps={classNames:""};Ip.propTypes={};function FN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ap(e,t){var n=function(i){return t&&W.isValidElement(i)?t(i):i},r=Object.create(null);return e&&W.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function LN(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var s,a={};for(var l in t){if(r[l])for(s=0;s<r[l].length;s++){var u=r[l][s];a[r[l][s]]=n(u)}a[l]=n(l)}for(s=0;s<o.length;s++)a[o[s]]=n(o[s]);return a}function oi(e,t,n){return n[t]!=null?n[t]:e.props[t]}function _N(e,t){return Ap(e.children,function(n){return W.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:oi(n,"appear",e),enter:oi(n,"enter",e),exit:oi(n,"exit",e)})})}function BN(e,t,n){var r=Ap(e.children),o=LN(t,r);return Object.keys(o).forEach(function(i){var s=o[i];if(W.isValidElement(s)){var a=i in t,l=i in r,u=t[i],d=W.isValidElement(u)&&!u.props.in;l&&(!a||d)?o[i]=W.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:oi(s,"exit",e),enter:oi(s,"enter",e)}):!l&&a&&!d?o[i]=W.cloneElement(s,{in:!1}):l&&a&&W.isValidElement(u)&&(o[i]=W.cloneElement(s,{onExited:n.bind(null,s),in:u.props.in,exit:oi(s,"exit",e),enter:oi(s,"enter",e)}))}}),o}var jN=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},$N={component:"div",childFactory:function(t){return t}},El=(function(e){Dp(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=i.handleExited.bind(FN(i));return i.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var s=i.children,a=i.handleExited,l=i.firstRender;return{children:l?_N(o,a):BN(o,s,a),firstRender:!1}},n.handleExited=function(o,i){var s=Ap(this.props.children);o.key in s||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(a){var l=Y({},a.children);return delete l[o.key],{children:l}}))},n.render=function(){var o=this.props,i=o.component,s=o.childFactory,a=Ze(o,["component","childFactory"]),l=this.state.contextValue,u=jN(this.state.children).map(s);return delete a.appear,delete a.enter,delete a.exit,i===null?W.createElement(Uu.Provider,{value:l},u):W.createElement(Uu.Provider,{value:l},W.createElement(i,a,u))},t})(W.Component);El.propTypes={};El.defaultProps=$N;const HN=[];function zN(e){M.useEffect(e,HN)}class Op{static create(){return new Op}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Sc(){const e=l2(Op.create).current;return zN(e.disposeEffect),e}function UN(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:u}=e,[d,f]=M.useState(!1),h=Ue(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},m=Ue(n.child,d&&n.childLeaving,r&&n.childPulsate);return!a&&!d&&f(!0),M.useEffect(()=>{if(!a&&l!=null){const b=setTimeout(l,u);return()=>{clearTimeout(b)}}},[l,a,u]),c.jsx("span",{className:h,style:p,children:c.jsx("span",{className:m})})}const pr=We("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Df=550,VN=80,WN=Ot.keyframes`
94
94
  0% {
95
95
  transform: scale(0);
96
96
  opacity: 0.1;
@@ -100,7 +100,7 @@ import {${t.sourceName}}" from '${t.modelPath}'"
100
100
  transform: scale(1);
101
101
  opacity: 0.3;
102
102
  }
103
- `,zN=Ot.keyframes`
103
+ `,qN=Ot.keyframes`
104
104
  0% {
105
105
  opacity: 1;
106
106
  }
@@ -108,7 +108,7 @@ import {${t.sourceName}}" from '${t.modelPath}'"
108
108
  100% {
109
109
  opacity: 0;
110
110
  }
111
- `,UN=Ot.keyframes`
111
+ `,YN=Ot.keyframes`
112
112
  0% {
113
113
  transform: scale(1);
114
114
  }
@@ -120,14 +120,14 @@ import {${t.sourceName}}" from '${t.modelPath}'"
120
120
  100% {
121
121
  transform: scale(1);
122
122
  }
123
- `,VN=fe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),WN=fe(jN,{name:"MuiTouchRipple",slot:"Ripple"})`
123
+ `,KN=fe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),GN=fe(UN,{name:"MuiTouchRipple",slot:"Ripple"})`
124
124
  opacity: 0;
125
125
  position: absolute;
126
126
 
127
127
  &.${pr.rippleVisible} {
128
128
  opacity: 0.3;
129
129
  transform: scale(1);
130
- animation-name: ${HN};
130
+ animation-name: ${WN};
131
131
  animation-duration: ${Df}ms;
132
132
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
133
133
  }
@@ -147,7 +147,7 @@ import {${t.sourceName}}" from '${t.modelPath}'"
147
147
 
148
148
  & .${pr.childLeaving} {
149
149
  opacity: 0;
150
- animation-name: ${zN};
150
+ animation-name: ${qN};
151
151
  animation-duration: ${Df}ms;
152
152
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
153
153
  }
@@ -157,13 +157,13 @@ import {${t.sourceName}}" from '${t.modelPath}'"
157
157
  /* @noflip */
158
158
  left: 0px;
159
159
  top: 0;
160
- animation-name: ${UN};
160
+ animation-name: ${YN};
161
161
  animation-duration: 2500ms;
162
162
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
163
163
  animation-iteration-count: infinite;
164
164
  animation-delay: 200ms;
165
165
  }
166
- `,qN=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s,...a}=r,[l,u]=M.useState([]),d=M.useRef(0),f=M.useRef(null);M.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const h=M.useRef(!1),p=Sc(),m=M.useRef(null),b=M.useRef(null),y=M.useCallback(S=>{const{pulsate:I,rippleX:T,rippleY:N,rippleSize:O,cb:F}=S;u(B=>[...B,c.jsx(WN,{classes:{ripple:Ue(i.ripple,pr.ripple),rippleVisible:Ue(i.rippleVisible,pr.rippleVisible),ripplePulsate:Ue(i.ripplePulsate,pr.ripplePulsate),child:Ue(i.child,pr.child),childLeaving:Ue(i.childLeaving,pr.childLeaving),childPulsate:Ue(i.childPulsate,pr.childPulsate)},timeout:Df,pulsate:I,rippleX:T,rippleY:N,rippleSize:O},d.current)]),d.current+=1,f.current=F},[i]),x=M.useCallback((S={},I={},T=()=>{})=>{const{pulsate:N=!1,center:O=o||I.pulsate,fakeElement:F=!1}=I;if(S?.type==="mousedown"&&h.current){h.current=!1;return}S?.type==="touchstart"&&(h.current=!0);const B=F?null:b.current,j=B?B.getBoundingClientRect():{width:0,height:0,left:0,top:0};let D,H,_;if(O||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)D=Math.round(j.width/2),H=Math.round(j.height/2);else{const{clientX:L,clientY:$}=S.touches&&S.touches.length>0?S.touches[0]:S;D=Math.round(L-j.left),H=Math.round($-j.top)}if(O)_=Math.sqrt((2*j.width**2+j.height**2)/3),_%2===0&&(_+=1);else{const L=Math.max(Math.abs((B?B.clientWidth:0)-D),D)*2+2,$=Math.max(Math.abs((B?B.clientHeight:0)-H),H)*2+2;_=Math.sqrt(L**2+$**2)}S?.touches?m.current===null&&(m.current=()=>{y({pulsate:N,rippleX:D,rippleY:H,rippleSize:_,cb:T})},p.start($N,()=>{m.current&&(m.current(),m.current=null)})):y({pulsate:N,rippleX:D,rippleY:H,rippleSize:_,cb:T})},[o,y,p]),C=M.useCallback(()=>{x({},{pulsate:!0})},[x]),v=M.useCallback((S,I)=>{if(p.clear(),S?.type==="touchend"&&m.current){m.current(),m.current=null,p.start(0,()=>{v(S,I)});return}m.current=null,u(T=>T.length>0?T.slice(1):T),f.current=I},[p]);return M.useImperativeHandle(n,()=>({pulsate:C,start:x,stop:v}),[C,x,v]),c.jsx(VN,{className:Ue(pr.root,i.root,s),ref:b,...a,children:c.jsx(El,{component:null,exit:!0,children:l})})});function YN(e){return Ge("MuiButtonBase",e)}const KN=We("MuiButtonBase",["root","disabled","focusVisible"]),GN=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,s=Ke({root:["root",t&&"disabled",n&&"focusVisible"]},YN,o);return n&&r&&(s.root+=` ${r}`),s},QN=fe("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${KN.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),pi=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:u=!1,disableRipple:d=!1,disableTouchRipple:f=!1,focusRipple:h=!1,focusVisibleClassName:p,LinkComponent:m="a",onBlur:b,onClick:y,onContextMenu:x,onDragLeave:C,onFocus:v,onFocusVisible:S,onKeyDown:I,onKeyUp:T,onMouseDown:N,onMouseLeave:O,onMouseUp:F,onTouchEnd:B,onTouchMove:j,onTouchStart:D,tabIndex:H=0,TouchRippleProps:_,touchRippleRef:L,type:$,...K}=r,G=M.useRef(null),q=kN(),R=vt(q.ref,L),[oe,se]=M.useState(!1);u&&oe&&se(!1),M.useImperativeHandle(o,()=>({focusVisible:()=>{se(!0),G.current.focus()}}),[]);const z=q.shouldMount&&!d&&!u;M.useEffect(()=>{oe&&h&&!d&&q.pulsate()},[d,h,oe,q]);const pe=uo(q,"start",N,f),J=uo(q,"stop",x,f),Q=uo(q,"stop",C,f),re=uo(q,"stop",F,f),ne=uo(q,"stop",_e=>{oe&&_e.preventDefault(),O&&O(_e)},f),ae=uo(q,"start",D,f),ie=uo(q,"stop",B,f),Z=uo(q,"stop",j,f),me=uo(q,"stop",_e=>{dg(_e.target)||se(!1),b&&b(_e)},!1),le=Ve(_e=>{G.current||(G.current=_e.currentTarget),dg(_e.target)&&(se(!0),S&&S(_e)),v&&v(_e)}),ue=()=>{const _e=G.current;return l&&l!=="button"&&!(_e.tagName==="A"&&_e.href)},Ie=Ve(_e=>{h&&!_e.repeat&&oe&&_e.key===" "&&q.stop(_e,()=>{q.start(_e)}),_e.target===_e.currentTarget&&ue()&&_e.key===" "&&_e.preventDefault(),I&&I(_e),_e.target===_e.currentTarget&&ue()&&_e.key==="Enter"&&!u&&(_e.preventDefault(),y&&y(_e))}),Ce=Ve(_e=>{h&&_e.key===" "&&oe&&!_e.defaultPrevented&&q.stop(_e,()=>{q.pulsate(_e)}),T&&T(_e),y&&_e.target===_e.currentTarget&&ue()&&_e.key===" "&&!_e.defaultPrevented&&y(_e)});let we=l;we==="button"&&(K.href||K.to)&&(we=m);const ye={};we==="button"?(ye.type=$===void 0?"button":$,ye.disabled=u):(!K.href&&!K.to&&(ye.role="button"),u&&(ye["aria-disabled"]=u));const ze=vt(n,G),Ne={...r,centerRipple:i,component:l,disabled:u,disableRipple:d,disableTouchRipple:f,focusRipple:h,tabIndex:H,focusVisible:oe},nt=GN(Ne);return c.jsxs(QN,{as:we,className:Ue(nt.root,a),ownerState:Ne,onBlur:me,onClick:y,onContextMenu:J,onFocus:le,onKeyDown:Ie,onKeyUp:Ce,onMouseDown:pe,onMouseLeave:ne,onMouseUp:re,onDragLeave:Q,onTouchEnd:ie,onTouchMove:Z,onTouchStart:ae,ref:ze,tabIndex:u?-1:H,type:$,...ye,...K,children:[s,z?c.jsx(qN,{ref:R,center:i,..._}):null]})});function uo(e,t,n,r=!1){return Ve(o=>(n&&n(o),r||e[t](o),!0))}function XN(e){return typeof e.main=="string"}function ZN(e,t=[]){if(!XN(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function Bn(e=[]){return([,t])=>t&&ZN(t,e)}function JN(e){return Ge("MuiCircularProgress",e)}We("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Io=44,If=Ot.keyframes`
166
+ `,QN=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s,...a}=r,[l,u]=M.useState([]),d=M.useRef(0),f=M.useRef(null);M.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const h=M.useRef(!1),p=Sc(),m=M.useRef(null),b=M.useRef(null),y=M.useCallback(S=>{const{pulsate:I,rippleX:T,rippleY:N,rippleSize:O,cb:F}=S;u(B=>[...B,c.jsx(GN,{classes:{ripple:Ue(i.ripple,pr.ripple),rippleVisible:Ue(i.rippleVisible,pr.rippleVisible),ripplePulsate:Ue(i.ripplePulsate,pr.ripplePulsate),child:Ue(i.child,pr.child),childLeaving:Ue(i.childLeaving,pr.childLeaving),childPulsate:Ue(i.childPulsate,pr.childPulsate)},timeout:Df,pulsate:I,rippleX:T,rippleY:N,rippleSize:O},d.current)]),d.current+=1,f.current=F},[i]),x=M.useCallback((S={},I={},T=()=>{})=>{const{pulsate:N=!1,center:O=o||I.pulsate,fakeElement:F=!1}=I;if(S?.type==="mousedown"&&h.current){h.current=!1;return}S?.type==="touchstart"&&(h.current=!0);const B=F?null:b.current,j=B?B.getBoundingClientRect():{width:0,height:0,left:0,top:0};let D,H,_;if(O||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)D=Math.round(j.width/2),H=Math.round(j.height/2);else{const{clientX:L,clientY:$}=S.touches&&S.touches.length>0?S.touches[0]:S;D=Math.round(L-j.left),H=Math.round($-j.top)}if(O)_=Math.sqrt((2*j.width**2+j.height**2)/3),_%2===0&&(_+=1);else{const L=Math.max(Math.abs((B?B.clientWidth:0)-D),D)*2+2,$=Math.max(Math.abs((B?B.clientHeight:0)-H),H)*2+2;_=Math.sqrt(L**2+$**2)}S?.touches?m.current===null&&(m.current=()=>{y({pulsate:N,rippleX:D,rippleY:H,rippleSize:_,cb:T})},p.start(VN,()=>{m.current&&(m.current(),m.current=null)})):y({pulsate:N,rippleX:D,rippleY:H,rippleSize:_,cb:T})},[o,y,p]),C=M.useCallback(()=>{x({},{pulsate:!0})},[x]),v=M.useCallback((S,I)=>{if(p.clear(),S?.type==="touchend"&&m.current){m.current(),m.current=null,p.start(0,()=>{v(S,I)});return}m.current=null,u(T=>T.length>0?T.slice(1):T),f.current=I},[p]);return M.useImperativeHandle(n,()=>({pulsate:C,start:x,stop:v}),[C,x,v]),c.jsx(KN,{className:Ue(pr.root,i.root,s),ref:b,...a,children:c.jsx(El,{component:null,exit:!0,children:l})})});function XN(e){return Ge("MuiButtonBase",e)}const ZN=We("MuiButtonBase",["root","disabled","focusVisible"]),JN=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,s=Ke({root:["root",t&&"disabled",n&&"focusVisible"]},XN,o);return n&&r&&(s.root+=` ${r}`),s},eF=fe("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${ZN.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),pi=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:u=!1,disableRipple:d=!1,disableTouchRipple:f=!1,focusRipple:h=!1,focusVisibleClassName:p,LinkComponent:m="a",onBlur:b,onClick:y,onContextMenu:x,onDragLeave:C,onFocus:v,onFocusVisible:S,onKeyDown:I,onKeyUp:T,onMouseDown:N,onMouseLeave:O,onMouseUp:F,onTouchEnd:B,onTouchMove:j,onTouchStart:D,tabIndex:H=0,TouchRippleProps:_,touchRippleRef:L,type:$,...K}=r,G=M.useRef(null),q=AN(),R=vt(q.ref,L),[oe,se]=M.useState(!1);u&&oe&&se(!1),M.useImperativeHandle(o,()=>({focusVisible:()=>{se(!0),G.current.focus()}}),[]);const z=q.shouldMount&&!d&&!u;M.useEffect(()=>{oe&&h&&!d&&q.pulsate()},[d,h,oe,q]);const pe=uo(q,"start",N,f),J=uo(q,"stop",x,f),Q=uo(q,"stop",C,f),re=uo(q,"stop",F,f),ne=uo(q,"stop",_e=>{oe&&_e.preventDefault(),O&&O(_e)},f),ae=uo(q,"start",D,f),ie=uo(q,"stop",B,f),Z=uo(q,"stop",j,f),me=uo(q,"stop",_e=>{dg(_e.target)||se(!1),b&&b(_e)},!1),le=Ve(_e=>{G.current||(G.current=_e.currentTarget),dg(_e.target)&&(se(!0),S&&S(_e)),v&&v(_e)}),ue=()=>{const _e=G.current;return l&&l!=="button"&&!(_e.tagName==="A"&&_e.href)},Ie=Ve(_e=>{h&&!_e.repeat&&oe&&_e.key===" "&&q.stop(_e,()=>{q.start(_e)}),_e.target===_e.currentTarget&&ue()&&_e.key===" "&&_e.preventDefault(),I&&I(_e),_e.target===_e.currentTarget&&ue()&&_e.key==="Enter"&&!u&&(_e.preventDefault(),y&&y(_e))}),Ce=Ve(_e=>{h&&_e.key===" "&&oe&&!_e.defaultPrevented&&q.stop(_e,()=>{q.pulsate(_e)}),T&&T(_e),y&&_e.target===_e.currentTarget&&ue()&&_e.key===" "&&!_e.defaultPrevented&&y(_e)});let we=l;we==="button"&&(K.href||K.to)&&(we=m);const ye={};we==="button"?(ye.type=$===void 0?"button":$,ye.disabled=u):(!K.href&&!K.to&&(ye.role="button"),u&&(ye["aria-disabled"]=u));const ze=vt(n,G),Ne={...r,centerRipple:i,component:l,disabled:u,disableRipple:d,disableTouchRipple:f,focusRipple:h,tabIndex:H,focusVisible:oe},nt=JN(Ne);return c.jsxs(eF,{as:we,className:Ue(nt.root,a),ownerState:Ne,onBlur:me,onClick:y,onContextMenu:J,onFocus:le,onKeyDown:Ie,onKeyUp:Ce,onMouseDown:pe,onMouseLeave:ne,onMouseUp:re,onDragLeave:Q,onTouchEnd:ie,onTouchMove:Z,onTouchStart:ae,ref:ze,tabIndex:u?-1:H,type:$,...ye,...K,children:[s,z?c.jsx(QN,{ref:R,center:i,..._}):null]})});function uo(e,t,n,r=!1){return Ve(o=>(n&&n(o),r||e[t](o),!0))}function tF(e){return typeof e.main=="string"}function nF(e,t=[]){if(!tF(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function Bn(e=[]){return([,t])=>t&&nF(t,e)}function rF(e){return Ge("MuiCircularProgress",e)}We("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Io=44,If=Ot.keyframes`
167
167
  0% {
168
168
  transform: rotate(0deg);
169
169
  }
@@ -186,25 +186,25 @@ import {${t.sourceName}}" from '${t.modelPath}'"
186
186
  stroke-dasharray: 1px, 200px;
187
187
  stroke-dashoffset: -126px;
188
188
  }
189
- `,eF=typeof If!="string"?Ot.css`
189
+ `,oF=typeof If!="string"?Ot.css`
190
190
  animation: ${If} 1.4s linear infinite;
191
- `:null,tF=typeof Af!="string"?Ot.css`
191
+ `:null,iF=typeof Af!="string"?Ot.css`
192
192
  animation: ${Af} 1.4s ease-in-out infinite;
193
- `:null,nF=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,i={root:["root",n,`color${Fe(r)}`],svg:["svg"],circle:["circle",`circle${Fe(n)}`,o&&"circleDisableShrink"]};return Ke(i,JN,t)},rF=fe("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Fe(n.color)}`]]}})(ft(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:eF||{animation:`${If} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),oF=fe("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),iF=fe("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Fe(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(ft(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:tF||{animation:`${Af} 1.4s ease-in-out infinite`}}]}))),Mp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiCircularProgress"}),{className:o,color:i="primary",disableShrink:s=!1,size:a=40,style:l,thickness:u=3.6,value:d=0,variant:f="indeterminate",...h}=r,p={...r,color:i,disableShrink:s,size:a,thickness:u,value:d,variant:f},m=nF(p),b={},y={},x={};if(f==="determinate"){const C=2*Math.PI*((Io-u)/2);b.strokeDasharray=C.toFixed(3),x["aria-valuenow"]=Math.round(d),b.strokeDashoffset=`${((100-d)/100*C).toFixed(3)}px`,y.transform="rotate(-90deg)"}return c.jsx(rF,{className:Ue(m.root,o),style:{width:a,height:a,...y,...l},ownerState:p,ref:n,role:"progressbar",...x,...h,children:c.jsx(oF,{className:m.svg,ownerState:p,viewBox:`${Io/2} ${Io/2} ${Io} ${Io}`,children:c.jsx(iF,{className:m.circle,style:b,ownerState:p,cx:Io,cy:Io,r:(Io-u)/2,fill:"none",strokeWidth:u})})})});function sF(e){return Ge("MuiButton",e)}const Ko=We("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),aF=M.createContext({}),lF=M.createContext(void 0),uF=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,loading:s,loadingPosition:a,classes:l}=e,u={root:["root",s&&"loading",i,`${i}${Fe(t)}`,`size${Fe(o)}`,`${i}Size${Fe(o)}`,`color${Fe(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${Fe(a)}`],startIcon:["icon","startIcon",`iconSize${Fe(o)}`],endIcon:["icon","endIcon",`iconSize${Fe(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},d=Ke(u,sF,l);return{...l,...d}},a2=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],cF=fe(pi,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Fe(n.color)}`],t[`size${Fe(n.size)}`],t[`${n.variant}Size${Fe(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(ft(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Ko.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Ko.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Ko.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Ko.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(Bn()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Ko.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Ko.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Ko.loading}`]:{color:"transparent"}}}]}})),dF=fe("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Fe(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...a2]})),fF=fe("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Fe(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...a2]})),pF=fe("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),mg=fe("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),tn=M.forwardRef(function(t,n){const r=M.useContext(aF),o=M.useContext(lF),i=Ka(r,t),s=ut({props:i,name:"MuiButton"}),{children:a,color:l="primary",component:u="button",className:d,disabled:f=!1,disableElevation:h=!1,disableFocusRipple:p=!1,endIcon:m,focusVisibleClassName:b,fullWidth:y=!1,id:x,loading:C=null,loadingIndicator:v,loadingPosition:S="center",size:I="medium",startIcon:T,type:N,variant:O="text",...F}=s,B=_r(x),j=v??c.jsx(Mp,{"aria-labelledby":B,color:"inherit",size:16}),D={...s,color:l,component:u,disabled:f,disableElevation:h,disableFocusRipple:p,fullWidth:y,loading:C,loadingIndicator:j,loadingPosition:S,size:I,type:N,variant:O},H=uF(D),_=(T||C&&S==="start")&&c.jsx(dF,{className:H.startIcon,ownerState:D,children:T||c.jsx(mg,{className:H.loadingIconPlaceholder,ownerState:D})}),L=(m||C&&S==="end")&&c.jsx(fF,{className:H.endIcon,ownerState:D,children:m||c.jsx(mg,{className:H.loadingIconPlaceholder,ownerState:D})}),$=o||"",K=typeof C=="boolean"?c.jsx("span",{className:H.loadingWrapper,style:{display:"contents"},children:C&&c.jsx(pF,{className:H.loadingIndicator,ownerState:D,children:j})}):null;return c.jsxs(cF,{ownerState:D,className:Ue(r.className,H.root,d,$),component:u,disabled:f||C,focusRipple:!p,focusVisibleClassName:Ue(H.focusVisible,b),ref:n,type:N,id:C?B:x,...F,classes:H,children:[_,S!=="end"&&K,a,S==="end"&&K,L]})}),kc=M.createContext(void 0);function ar(){return M.useContext(kc)}function hF(e){return Ge("PrivateSwitchBase",e)}We("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);function hs(e){return typeof e=="string"}function l2(e,t,n){return e===void 0||hs(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function br(e,t,n){return typeof e=="function"?e(t,n):e}function Ln(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function gg(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function u2(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const p=Ue(n?.className,i,o?.className,r?.className),m={...n?.style,...o?.style,...r?.style},b={...n,...o,...r};return p.length>0&&(b.className=p),Object.keys(m).length>0&&(b.style=m),{props:b,internalRef:void 0}}const s=Ln({...o,...r}),a=gg(r),l=gg(o),u=t(s),d=Ue(u?.className,n?.className,i,o?.className,r?.className),f={...u?.style,...n?.style,...o?.style,...r?.style},h={...u,...n,...l,...a};return d.length>0&&(h.className=d),Object.keys(f).length>0&&(h.style=f),{props:h,internalRef:u.ref}}function kt(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,internalForwardedProps:s,shouldForwardComponentProp:a=!1,...l}=t,{component:u,slots:d={[e]:void 0},slotProps:f={[e]:void 0},...h}=i,p=d[e]||r,m=br(f[e],o),{props:{component:b,...y},internalRef:x}=u2({className:n,...l,externalForwardedProps:e==="root"?h:void 0,externalSlotProps:m}),C=vt(x,m?.ref,t.ref),v=e==="root"?b||u:b,S=l2(p,{...e==="root"&&!u&&!d[e]&&s,...e!=="root"&&!d[e]&&s,...y,...v&&!a&&{as:v},...v&&a&&{component:v},ref:C},o);return[p,S]}const mF=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,i={root:["root",n&&"checked",r&&"disabled",o&&`edge${Fe(o)}`],input:["input"]};return Ke(i,hF,t)},gF=fe(pi,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),bF=fe("input",{name:"MuiSwitchBase",shouldForwardProp:$n})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),yF=M.forwardRef(function(t,n){const{autoFocus:r,checked:o,checkedIcon:i,defaultChecked:s,disabled:a,disableFocusRipple:l=!1,edge:u=!1,icon:d,id:f,inputProps:h,inputRef:p,name:m,onBlur:b,onChange:y,onFocus:x,readOnly:C,required:v=!1,tabIndex:S,type:I,value:T,slots:N={},slotProps:O={},...F}=t,[B,j]=or({controlled:o,default:!!s,name:"SwitchBase",state:"checked"}),D=ar(),H=J=>{x&&x(J),D&&D.onFocus&&D.onFocus(J)},_=J=>{b&&b(J),D&&D.onBlur&&D.onBlur(J)},L=J=>{if(J.nativeEvent.defaultPrevented)return;const Q=J.target.checked;j(Q),y&&y(J,Q)};let $=a;D&&typeof $>"u"&&($=D.disabled);const K=I==="checkbox"||I==="radio",G={...t,checked:B,disabled:$,disableFocusRipple:l,edge:u},q=mF(G),R={slots:N,slotProps:{input:h,...O}},[oe,se]=kt("root",{ref:n,elementType:gF,className:q.root,shouldForwardComponentProp:!0,externalForwardedProps:{...R,component:"span",...F},getSlotProps:J=>({...J,onFocus:Q=>{J.onFocus?.(Q),H(Q)},onBlur:Q=>{J.onBlur?.(Q),_(Q)}}),ownerState:G,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:$,role:void 0,tabIndex:null}}),[z,pe]=kt("input",{ref:p,elementType:bF,className:q.input,externalForwardedProps:R,getSlotProps:J=>({...J,onChange:Q=>{J.onChange?.(Q),L(Q)}}),ownerState:G,additionalProps:{autoFocus:r,checked:o,defaultChecked:s,disabled:$,id:K?f:void 0,name:m,readOnly:C,required:v,tabIndex:S,type:I,...I==="checkbox"&&T===void 0?{}:{value:T}}});return c.jsxs(oe,{...se,children:[c.jsx(z,{...pe}),B?i:d]})}),xF=mt(c.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),CF=mt(c.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),EF=mt(c.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function vF(e){return Ge("MuiCheckbox",e)}const Rd=We("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),TF=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i={root:["root",n&&"indeterminate",`color${Fe(r)}`,`size${Fe(o)}`]},s=Ke(i,vF,t);return{...t,...s}},SF=fe(yF,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Fe(n.size)}`],n.color!=="default"&&t[`color${Fe(n.color)}`]]}})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{[`&.${Rd.checked}, &.${Rd.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Rd.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),kF=c.jsx(CF,{}),wF=c.jsx(xF,{}),DF=c.jsx(EF,{}),Pp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiCheckbox"}),{checkedIcon:o=kF,color:i="primary",icon:s=wF,indeterminate:a=!1,indeterminateIcon:l=DF,inputProps:u,size:d="medium",disableRipple:f=!1,className:h,slots:p={},slotProps:m={},...b}=r,y=a?l:s,x=a?l:o,C={...r,disableRipple:f,color:i,indeterminate:a,size:d},v=TF(C),S=m.input??u,[I,T]=kt("root",{ref:n,elementType:SF,className:Ue(v.root,h),shouldForwardComponentProp:!0,externalForwardedProps:{slots:p,slotProps:m,...b},ownerState:C,additionalProps:{type:"checkbox",icon:M.cloneElement(y,{fontSize:y.props.fontSize??d}),checkedIcon:M.cloneElement(x,{fontSize:x.props.fontSize??d}),disableRipple:f,slots:p,slotProps:{input:Eb(typeof S=="function"?S(C):S,{"data-indeterminate":a})}}});return c.jsx(I,{...T,classes:v})});function c2(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function IF(e){const t=mn(e);return t.body===e?bo(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Ha(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function bg(e){return parseInt(bo(e).getComputedStyle(e).paddingRight,10)||0}function AF(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function yg(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,s=>{const a=!i.includes(s),l=!AF(s);a&&l&&Ha(s,o)})}function Nd(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function OF(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(IF(r)){const s=c2(bo(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${bg(r)+s}px`;const a=mn(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${bg(l)+s}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=mn(r).body;else{const s=r.parentElement,a=bo(r);i=s?.nodeName==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{n.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function MF(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class PF{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&Ha(t.modalRef,!1);const o=MF(n);yg(n,t.mount,t.modalRef,o,!0);const i=Nd(this.containers,s=>s.container===n);return i!==-1?(this.containers[i].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=Nd(this.containers,i=>i.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=OF(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=Nd(this.containers,s=>s.modals.includes(t)),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(r,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&Ha(t.modalRef,n),yg(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&Ha(s.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function Ms(e){return parseInt(M.version,10)>=19?e?.props?.ref||null:e?.ref||null}const RF=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function NF(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function FF(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function LF(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||FF(e))}function _F(e){const t=[],n=[];return Array.from(e.querySelectorAll(RF)).forEach((r,o)=>{const i=NF(r);i===-1||!LF(r)||(i===0?t.push(r):n.push({documentOrder:o,tabIndex:i,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function BF(){return!0}function d2(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=_F,isEnabled:s=BF,open:a}=e,l=M.useRef(!1),u=M.useRef(null),d=M.useRef(null),f=M.useRef(null),h=M.useRef(null),p=M.useRef(!1),m=M.useRef(null),b=vt(Ms(t),m),y=M.useRef(null);M.useEffect(()=>{!a||!m.current||(p.current=!n)},[n,a]),M.useEffect(()=>{if(!a||!m.current)return;const v=mn(m.current);return m.current.contains(v.activeElement)||(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),p.current&&m.current.focus()),()=>{o||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),M.useEffect(()=>{if(!a||!m.current)return;const v=mn(m.current),S=N=>{y.current=N,!(r||!s()||N.key!=="Tab")&&v.activeElement===m.current&&N.shiftKey&&(l.current=!0,d.current&&d.current.focus())},I=()=>{const N=m.current;if(N===null)return;if(!v.hasFocus()||!s()||l.current){l.current=!1;return}if(N.contains(v.activeElement)||r&&v.activeElement!==u.current&&v.activeElement!==d.current)return;if(v.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!p.current)return;let O=[];if((v.activeElement===u.current||v.activeElement===d.current)&&(O=i(m.current)),O.length>0){const F=!!(y.current?.shiftKey&&y.current?.key==="Tab"),B=O[0],j=O[O.length-1];typeof B!="string"&&typeof j!="string"&&(F?j.focus():B.focus())}else N.focus()};v.addEventListener("focusin",I),v.addEventListener("keydown",S,!0);const T=setInterval(()=>{v.activeElement&&v.activeElement.tagName==="BODY"&&I()},50);return()=>{clearInterval(T),v.removeEventListener("focusin",I),v.removeEventListener("keydown",S,!0)}},[n,r,o,s,a,i]);const x=v=>{f.current===null&&(f.current=v.relatedTarget),p.current=!0,h.current=v.target;const S=t.props.onFocus;S&&S(v)},C=v=>{f.current===null&&(f.current=v.relatedTarget),p.current=!0};return c.jsxs(M.Fragment,{children:[c.jsx("div",{tabIndex:a?0:-1,onFocus:C,ref:u,"data-testid":"sentinelStart"}),M.cloneElement(t,{ref:b,onFocus:x}),c.jsx("div",{tabIndex:a?0:-1,onFocus:C,ref:d,"data-testid":"sentinelEnd"})]})}function jF(e){return typeof e=="function"?e():e}const f2=M.forwardRef(function(t,n){const{children:r,container:o,disablePortal:i=!1}=t,[s,a]=M.useState(null),l=vt(M.isValidElement(r)?Ms(r):null,n);if(yn(()=>{i||a(jF(o)||document.body)},[o,i]),yn(()=>{if(s&&!i)return Zd(n,s),()=>{Zd(n,null)}},[n,s,i]),i){if(M.isValidElement(r)){const u={ref:l};return M.cloneElement(r,u)}return r}return s&&iT.createPortal(r,s)}),p2=e=>e.scrollTop;function ms(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}const $F={entering:{opacity:1},entered:{opacity:1}},hi=M.forwardRef(function(t,n){const r=Lo(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:u,onEnter:d,onEntered:f,onEntering:h,onExit:p,onExited:m,onExiting:b,style:y,timeout:x=o,TransitionComponent:C=Dr,...v}=t,S=M.useRef(null),I=vt(S,Ms(a),n),T=_=>L=>{if(_){const $=S.current;L===void 0?_($):_($,L)}},N=T(h),O=T((_,L)=>{p2(_);const $=ms({style:y,timeout:x,easing:l},{mode:"enter"});_.style.webkitTransition=r.transitions.create("opacity",$),_.style.transition=r.transitions.create("opacity",$),d&&d(_,L)}),F=T(f),B=T(b),j=T(_=>{const L=ms({style:y,timeout:x,easing:l},{mode:"exit"});_.style.webkitTransition=r.transitions.create("opacity",L),_.style.transition=r.transitions.create("opacity",L),p&&p(_)}),D=T(m),H=_=>{i&&i(S.current,_)};return c.jsx(C,{appear:s,in:u,nodeRef:S,onEnter:O,onEntered:F,onEntering:N,onExit:j,onExited:D,onExiting:B,addEndListener:H,timeout:x,...v,children:(_,{ownerState:L,...$})=>M.cloneElement(a,{style:{opacity:0,visibility:_==="exited"&&!u?"hidden":void 0,...$F[_],...y,...a.props.style},ref:I,...$})})});function HF(e){return Ge("MuiBackdrop",e)}We("MuiBackdrop",["root","invisible"]);const zF=e=>{const{classes:t,invisible:n}=e;return Ke({root:["root",n&&"invisible"]},HF,t)},UF=fe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),h2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiBackdrop"}),{children:o,className:i,component:s="div",invisible:a=!1,open:l,components:u={},componentsProps:d={},slotProps:f={},slots:h={},TransitionComponent:p,transitionDuration:m,...b}=r,y={...r,component:s,invisible:a},x=zF(y),C={transition:p,root:u.Root,...h},v={...d,...f},S={component:s,slots:C,slotProps:v},[I,T]=kt("root",{elementType:UF,externalForwardedProps:S,className:Ue(x.root,i),ownerState:y}),[N,O]=kt("transition",{elementType:hi,externalForwardedProps:S,ownerState:y});return c.jsx(N,{in:l,timeout:m,...b,...O,children:c.jsx(I,{"aria-hidden":!0,...T,classes:x,ref:n,children:o})})});function VF(e){return typeof e=="function"?e():e}function WF(e){return e?e.props.hasOwnProperty("in"):!1}const xg=()=>{},Ql=new PF;function qF(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:o=!1,onTransitionEnter:i,onTransitionExited:s,children:a,onClose:l,open:u,rootRef:d}=e,f=M.useRef({}),h=M.useRef(null),p=M.useRef(null),m=vt(p,d),[b,y]=M.useState(!u),x=WF(a);let C=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(C=!1);const v=()=>mn(h.current),S=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),I=()=>{Ql.mount(S(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},T=Ve(()=>{const L=VF(t)||v().body;Ql.add(S(),L),p.current&&I()}),N=()=>Ql.isTopModal(S()),O=Ve(L=>{h.current=L,L&&(u&&N()?I():p.current&&Ha(p.current,C))}),F=M.useCallback(()=>{Ql.remove(S(),C)},[C]);M.useEffect(()=>()=>{F()},[F]),M.useEffect(()=>{u?T():(!x||!o)&&F()},[u,F,x,o,T]);const B=L=>$=>{L.onKeyDown?.($),!($.key!=="Escape"||$.which===229||!N())&&(n||($.stopPropagation(),l&&l($,"escapeKeyDown")))},j=L=>$=>{L.onClick?.($),$.target===$.currentTarget&&l&&l($,"backdropClick")};return{getRootProps:(L={})=>{const $=Ln(e);delete $.onTransitionEnter,delete $.onTransitionExited;const K={...$,...L};return{role:"presentation",...K,onKeyDown:B(K),ref:m}},getBackdropProps:(L={})=>{const $=L;return{"aria-hidden":!0,...$,onClick:j($),open:u}},getTransitionProps:()=>{const L=()=>{y(!1),i&&i()},$=()=>{y(!0),s&&s(),o&&F()};return{onEnter:lm(L,a?.props.onEnter??xg),onExited:lm($,a?.props.onExited??xg)}},rootRef:m,portalRef:O,isTopModal:N,exited:b,hasTransition:x}}function YF(e){return Ge("MuiModal",e)}We("MuiModal",["root","hidden","backdrop"]);const KF=e=>{const{open:t,exited:n,classes:r}=e;return Ke({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},YF,r)},GF=fe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(ft(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),QF=fe(h2,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),m2=M.forwardRef(function(t,n){const r=ut({name:"MuiModal",props:t}),{BackdropComponent:o=QF,BackdropProps:i,classes:s,className:a,closeAfterTransition:l=!1,children:u,container:d,component:f,components:h={},componentsProps:p={},disableAutoFocus:m=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:y=!1,disablePortal:x=!1,disableRestoreFocus:C=!1,disableScrollLock:v=!1,hideBackdrop:S=!1,keepMounted:I=!1,onClose:T,onTransitionEnter:N,onTransitionExited:O,open:F,slotProps:B={},slots:j={},theme:D,...H}=r,_={...r,closeAfterTransition:l,disableAutoFocus:m,disableEnforceFocus:b,disableEscapeKeyDown:y,disablePortal:x,disableRestoreFocus:C,disableScrollLock:v,hideBackdrop:S,keepMounted:I},{getRootProps:L,getBackdropProps:$,getTransitionProps:K,portalRef:G,isTopModal:q,exited:R,hasTransition:oe}=qF({..._,rootRef:n}),se={..._,exited:R},z=KF(se),pe={};if(u.props.tabIndex===void 0&&(pe.tabIndex="-1"),oe){const{onEnter:ie,onExited:Z}=K();pe.onEnter=ie,pe.onExited=Z}const J={slots:{root:h.Root,backdrop:h.Backdrop,...j},slotProps:{...p,...B}},[Q,re]=kt("root",{ref:n,elementType:GF,externalForwardedProps:{...J,...H,component:f},getSlotProps:L,ownerState:se,className:Ue(a,z?.root,!se.open&&se.exited&&z?.hidden)}),[ne,ae]=kt("backdrop",{ref:i?.ref,elementType:o,externalForwardedProps:J,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:ie=>$({...ie,onClick:Z=>{ie?.onClick&&ie.onClick(Z)}}),className:Ue(i?.className,z?.backdrop),ownerState:se});return!I&&!F&&(!oe||R)?null:c.jsx(f2,{ref:G,container:d,disablePortal:x,children:c.jsxs(Q,{...re,children:[!S&&o?c.jsx(ne,{...ae}):null,c.jsx(d2,{disableEnforceFocus:b,disableAutoFocus:m,disableRestoreFocus:C,isEnabled:q,open:F,children:M.cloneElement(u,pe)})]})})});function XF(e){return Ge("MuiPaper",e)}We("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const ZF=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Ke(i,XF,o)},JF=fe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(ft(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Ci=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiPaper"}),o=Lo(),{className:i,component:s="div",elevation:a=1,square:l=!1,variant:u="elevation",...d}=r,f={...r,component:s,elevation:a,square:l,variant:u},h=ZF(f);return c.jsx(JF,{as:s,ownerState:f,className:Ue(h.root,i),ref:n,...d,style:{...u==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[a],...o.vars&&{"--Paper-overlay":o.vars.overlays?.[a]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Iu("#fff",Xd(a))}, ${Iu("#fff",Xd(a))})`}},...d.style}})});function e8(e){return Ge("MuiDialog",e)}const za=We("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),g2=M.createContext({}),t8=fe(h2,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),n8=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:i}=e,s={root:["root"],container:["container",`scroll${Fe(n)}`],paper:["paper",`paperScroll${Fe(n)}`,`paperWidth${Fe(String(r))}`,o&&"paperFullWidth",i&&"paperFullScreen"]};return Ke(s,e8,t)},r8=fe(m2,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),o8=fe("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Fe(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),i8=fe(Ci,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Fe(n.scroll)}`],t[`paperWidth${Fe(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(ft(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${za.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${za.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${za.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),no=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialog"}),o=Lo(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,"aria-modal":l=!0,BackdropComponent:u,BackdropProps:d,children:f,className:h,disableEscapeKeyDown:p=!1,fullScreen:m=!1,fullWidth:b=!1,maxWidth:y="sm",onClick:x,onClose:C,open:v,PaperComponent:S=Ci,PaperProps:I={},scroll:T="paper",slots:N={},slotProps:O={},TransitionComponent:F=hi,transitionDuration:B=i,TransitionProps:j,...D}=r,H={...r,disableEscapeKeyDown:p,fullScreen:m,fullWidth:b,maxWidth:y,scroll:T},_=n8(H),L=M.useRef(),$=le=>{L.current=le.target===le.currentTarget},K=le=>{x&&x(le),L.current&&(L.current=null,C&&C(le,"backdropClick"))},G=_r(a),q=M.useMemo(()=>({titleId:G}),[G]),R={transition:F,...N},oe={transition:j,paper:I,backdrop:d,...O},se={slots:R,slotProps:oe},[z,pe]=kt("root",{elementType:r8,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:H,className:Ue(_.root,h),ref:n}),[J,Q]=kt("backdrop",{elementType:t8,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:H}),[re,ne]=kt("paper",{elementType:i8,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:H,className:Ue(_.paper,I.className)}),[ae,ie]=kt("container",{elementType:o8,externalForwardedProps:se,ownerState:H,className:_.container}),[Z,me]=kt("transition",{elementType:hi,externalForwardedProps:se,ownerState:H,additionalProps:{appear:!0,in:v,timeout:B,role:"presentation"}});return c.jsx(z,{closeAfterTransition:!0,slots:{backdrop:J},slotProps:{backdrop:{transitionDuration:B,as:u,...Q}},disableEscapeKeyDown:p,onClose:C,open:v,onClick:K,...pe,...D,children:c.jsx(Z,{...me,children:c.jsx(ae,{onMouseDown:$,...ie,children:c.jsx(re,{as:S,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":G,"aria-modal":l,...ne,children:c.jsx(g2.Provider,{value:q,children:f})})})})})});function s8(e){return Ge("MuiDialogActions",e)}We("MuiDialogActions",["root","spacing"]);const a8=e=>{const{classes:t,disableSpacing:n}=e;return Ke({root:["root",!n&&"spacing"]},s8,t)},l8=fe("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),ro=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:i=!1,...s}=r,a={...r,disableSpacing:i},l=a8(a);return c.jsx(l8,{className:Ue(l.root,o),ownerState:a,ref:n,...s})});function u8(e){return Ge("MuiDialogContent",e)}We("MuiDialogContent",["root","dividers"]);function c8(e){return Ge("MuiDialogTitle",e)}const d8=We("MuiDialogTitle",["root"]),f8=e=>{const{classes:t,dividers:n}=e;return Ke({root:["root",n&&"dividers"]},u8,t)},p8=fe("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(ft(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${d8.root} + &`]:{paddingTop:0}}}]}))),oo=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogContent"}),{className:o,dividers:i=!1,...s}=r,a={...r,dividers:i},l=f8(a);return c.jsx(p8,{className:Ue(l.root,o),ownerState:a,ref:n,...s})});function h8(e){return Ge("MuiTypography",e)}const Cg=We("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),m8={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},g8=Dk(),b8=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Fe(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Ke(a,h8,s)},y8=fe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Fe(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(ft(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${Fe(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),Eg={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Dt=M.forwardRef(function(t,n){const{color:r,...o}=ut({props:t,name:"MuiTypography"}),i=!m8[r],s=g8({...o,...i&&{color:r}}),{align:a="inherit",className:l,component:u,gutterBottom:d=!1,noWrap:f=!1,paragraph:h=!1,variant:p="body1",variantMapping:m=Eg,...b}=s,y={...s,align:a,color:r,className:l,component:u,gutterBottom:d,noWrap:f,paragraph:h,variant:p,variantMapping:m},x=u||(h?"p":m[p]||Eg[p])||"span",C=b8(y);return c.jsx(y8,{as:x,ref:n,className:Ue(C.root,l),...b,ownerState:y,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...b.style}})}),x8=e=>{const{classes:t}=e;return Ke({root:["root"]},c8,t)},C8=fe(Dt,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),Eo=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogTitle"}),{className:o,id:i,...s}=r,a=r,l=x8(a),{titleId:u=i}=M.useContext(g2);return c.jsx(C8,{component:"h2",className:Ue(l.root,o),ownerState:a,ref:n,variant:"h6",id:i??u,...s})});function vg(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Vu(e,t=!1){return e&&(vg(e.value)&&e.value!==""||t&&vg(e.defaultValue)&&e.defaultValue!=="")}function E8(e){return e.startAdornment}function v8(e){return Ge("MuiFormControl",e)}We("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const T8=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${Fe(n)}`,r&&"fullWidth"]};return Ke(o,v8,t)},S8=fe("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Fe(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Wu=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormControl"}),{children:o,className:i,color:s="primary",component:a="div",disabled:l=!1,error:u=!1,focused:d,fullWidth:f=!1,hiddenLabel:h=!1,margin:p="none",required:m=!1,size:b="medium",variant:y="outlined",...x}=r,C={...r,color:s,component:a,disabled:l,error:u,fullWidth:f,hiddenLabel:h,margin:p,required:m,size:b,variant:y},v=T8(C),[S,I]=M.useState(()=>{let L=!1;return o&&M.Children.forEach(o,$=>{if(!ou($,["Input","Select"]))return;const K=ou($,["Select"])?$.props.input:$;K&&E8(K.props)&&(L=!0)}),L}),[T,N]=M.useState(()=>{let L=!1;return o&&M.Children.forEach(o,$=>{ou($,["Input","Select"])&&(Vu($.props,!0)||Vu($.props.inputProps,!0))&&(L=!0)}),L}),[O,F]=M.useState(!1);l&&O&&F(!1);const B=d!==void 0&&!l?d:O;let j;M.useRef(!1);const D=M.useCallback(()=>{N(!0)},[]),H=M.useCallback(()=>{N(!1)},[]),_=M.useMemo(()=>({adornedStart:S,setAdornedStart:I,color:s,disabled:l,error:u,filled:T,focused:B,fullWidth:f,hiddenLabel:h,size:b,onBlur:()=>{F(!1)},onFocus:()=>{F(!0)},onEmpty:H,onFilled:D,registerEffect:j,required:m,variant:y}),[S,s,l,u,T,B,f,h,j,H,D,m,b,y]);return c.jsx(kc.Provider,{value:_,children:c.jsx(S8,{as:a,ownerState:C,className:Ue(v.root,i),ref:n,...x,children:o})})});function k8(e){return Ge("MuiFormControlLabel",e)}const Ia=We("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);function Ei({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const w8=e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e,s={root:["root",n&&"disabled",`labelPlacement${Fe(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return Ke(s,k8,t)},D8=fe("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Ia.label}`]:t.label},t.root,t[`labelPlacement${Fe(n.labelPlacement)}`]]}})(ft(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Ia.disabled}`]:{cursor:"default"},[`& .${Ia.label}`]:{[`&.${Ia.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),I8=fe("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(ft(({theme:e})=>({[`&.${Ia.error}`]:{color:(e.vars||e).palette.error.main}}))),A8=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormControlLabel"}),{checked:o,className:i,componentsProps:s={},control:a,disabled:l,disableTypography:u,inputRef:d,label:f,labelPlacement:h="end",name:p,onChange:m,required:b,slots:y={},slotProps:x={},value:C,...v}=r,S=ar(),I=l??a.props.disabled??S?.disabled,T=b??a.props.required,N={disabled:I,required:T};["checked","name","onChange","value","inputRef"].forEach(L=>{typeof a.props[L]>"u"&&typeof r[L]<"u"&&(N[L]=r[L])});const O=Ei({props:r,muiFormControl:S,states:["error"]}),F={...r,disabled:I,labelPlacement:h,required:T,error:O.error},B=w8(F),j={slots:y,slotProps:{...s,...x}},[D,H]=kt("typography",{elementType:Dt,externalForwardedProps:j,ownerState:F});let _=f;return _!=null&&_.type!==Dt&&!u&&(_=c.jsx(D,{component:"span",...H,className:Ue(B.label,H?.className),children:_})),c.jsxs(D8,{className:Ue(B.root,i),ownerState:F,ref:n,...v,children:[M.cloneElement(a,N),T?c.jsxs("div",{children:[_,c.jsxs(I8,{ownerState:F,"aria-hidden":!0,className:B.asterisk,children:[" ","*"]})]}):_]})});function O8(e){return Ge("MuiIconButton",e)}const Tg=We("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),M8=e=>{const{classes:t,disabled:n,color:r,edge:o,size:i,loading:s}=e,a={root:["root",s&&"loading",n&&"disabled",r!=="default"&&`color${Fe(r)}`,o&&`edge${Fe(o)}`,`size${Fe(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Ke(a,O8,t)},P8=fe(pi,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Fe(n.color)}`],n.edge&&t[`edge${Fe(n.edge)}`],t[`size${Fe(n.size)}`]]}})(ft(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),ft(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${Tg.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${Tg.loading}`]:{color:"transparent"}}))),R8=fe("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Ir=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:u=!1,size:d="medium",id:f,loading:h=null,loadingIndicator:p,...m}=r,b=_r(f),y=p??c.jsx(Mp,{"aria-labelledby":b,color:"inherit",size:16}),x={...r,edge:o,color:a,disabled:l,disableFocusRipple:u,loading:h,loadingIndicator:y,size:d},C=M8(x);return c.jsxs(P8,{id:h?b:f,className:Ue(C.root,s),centerRipple:!0,focusRipple:!u,disabled:l||h,ref:n,...m,ownerState:x,children:[typeof h=="boolean"&&c.jsx("span",{className:C.loadingWrapper,style:{display:"contents"},children:c.jsx(R8,{className:C.loadingIndicator,ownerState:x,children:h&&y})}),i]})});function N8(e){return Ge("MuiListItemIcon",e)}const Sg=We("MuiListItemIcon",["root","alignItemsFlexStart"]),ho=M.createContext({}),F8=e=>{const{alignItems:t,classes:n}=e;return Ke({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},N8,n)},L8=fe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(ft(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),Rp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemIcon"}),{className:o,...i}=r,s=M.useContext(ho),a={...r,alignItems:s.alignItems},l=F8(a);return c.jsx(L8,{className:Ue(l.root,o),ownerState:a,ref:n,...i})});function _8(e){return Ge("MuiListItemText",e)}const Zi=We("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),B8=e=>{const{classes:t,inset:n,primary:r,secondary:o,dense:i}=e;return Ke({root:["root",n&&"inset",i&&"dense",r&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},_8,t)},j8=fe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Zi.primary}`]:t.primary},{[`& .${Zi.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${Cg.root}:where(& .${Zi.primary})`]:{display:"block"},[`.${Cg.root}:where(& .${Zi.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),Np=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:u,secondary:d,secondaryTypographyProps:f,slots:h={},slotProps:p={},...m}=r,{dense:b}=M.useContext(ho);let y=l??o,x=d;const C={...r,disableTypography:s,inset:a,primary:!!y,secondary:!!x,dense:b},v=B8(C),S={slots:h,slotProps:{primary:u,secondary:f,...p}},[I,T]=kt("root",{className:Ue(v.root,i),elementType:j8,externalForwardedProps:{...S,...m},ownerState:C,ref:n}),[N,O]=kt("primary",{className:v.primary,elementType:Dt,externalForwardedProps:S,ownerState:C}),[F,B]=kt("secondary",{className:v.secondary,elementType:Dt,externalForwardedProps:S,ownerState:C});return y!=null&&y.type!==Dt&&!s&&(y=c.jsx(N,{variant:b?"body2":"body1",component:O?.variant?void 0:"span",...O,children:y})),x!=null&&x.type!==Dt&&!s&&(x=c.jsx(F,{variant:"body2",color:"textSecondary",...B,children:x})),c.jsxs(I,{...T,children:[y,x]})}),kg=We("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);function $8(e){return Ge("MuiMenuItem",e)}const ra=We("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),H8=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},z8=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:i,classes:s}=e,l=Ke({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",i&&"selected"]},$8,s);return{...s,...l}},U8=fe(pi,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:H8})(ft(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ra.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${ra.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${ra.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${ra.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${ra.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${kg.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${kg.inset}`]:{marginLeft:52},[`& .${Zi.root}`]:{marginTop:0,marginBottom:0},[`& .${Zi.inset}`]:{paddingLeft:36},[`& .${Sg.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${Sg.root} svg`]:{fontSize:"1.25rem"}}}]}))),bn=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:u,role:d="menuitem",tabIndex:f,className:h,...p}=r,m=M.useContext(ho),b=M.useMemo(()=>({dense:s||m.dense||!1,disableGutters:l}),[m.dense,s,l]),y=M.useRef(null);yn(()=>{o&&y.current&&y.current.focus()},[o]);const x={...r,dense:b.dense,divider:a,disableGutters:l},C=z8(r),v=vt(y,n);let S;return r.disabled||(S=f!==void 0?f:-1),c.jsx(ho.Provider,{value:b,children:c.jsx(U8,{ref:v,role:d,tabIndex:S,component:i,focusVisibleClassName:Ue(C.focusVisible,u),className:Ue(C.root,h),...p,ownerState:x,classes:C})})});function V8({materialization:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(!1),l=()=>i(!0),u=()=>{i(!1),a(!1),t()};return c.jsxs(W.Fragment,{children:[c.jsxs(bn,{"aria-label":`Delete materialization ${e?.id??""}`.trim(),onClick:d=>{d.stopPropagation(),l()},sx:{color:"error.main"},children:[c.jsx(Rp,{sx:{color:"inherit"},children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(Np,{children:"Delete"})]}),c.jsxs(no,{onClose:u,open:o,"aria-labelledby":"delete-materialization-title",children:[c.jsx(Eo,{sx:{m:0,p:2},id:"delete-materialization-title",children:"Delete Materialization"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:d=>({position:"absolute",right:8,top:8,color:d.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsxs(oo,{dividers:!0,children:[c.jsx(Dt,{gutterBottom:!0,children:"Are you sure you want to delete this materialization record? This action cannot be undone."}),c.jsx(A8,{control:c.jsx(Pp,{checked:s,onChange:d=>a(d.target.checked)}),label:"Also drop the materialized table(s) this run produced"})]}),c.jsx(ro,{children:c.jsx(tn,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(s),color:"error",children:"Delete"})})]})]})}function b2({materializations:e,mutable:t,isMutating:n,showPackage:r=!1,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a}){return e.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:"No materializations yet."}):c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[r&&c.jsx(w.TableCell,{children:"Package"}),c.jsx(w.TableCell,{children:"Status"}),c.jsx(w.TableCell,{children:"Trigger"}),c.jsx(w.TableCell,{children:"Started"}),c.jsx(w.TableCell,{children:"Duration"}),c.jsx(w.TableCell,{children:"Sources"}),c.jsx(w.TableCell,{align:"right",children:"Actions"})]})}),c.jsx(w.TableBody,{children:e.map(l=>c.jsx(W8,{materialization:l,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a},l.id))})]})}function W8({materialization:e,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a}){const[l,u]=W.useState(null),d=!!l,f=()=>u(null),h=e2(e),p=h.sourcesBuilt!==void 0||h.sourcesReused!==void 0?`${h.sourcesBuilt??0} built, ${h.sourcesReused??0} reused`:"-",m=Ja(e.status),b=xN(e.status),y=e.error??void 0,x=t&&(m||b);return c.jsxs(w.TableRow,{hover:!0,sx:{cursor:"pointer","&:focus-visible":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:"-2px"}},onClick:()=>a(e),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a(e))},role:"button",tabIndex:0,"aria-label":`View materialization ${e.id??""} details`.trim(),children:[r&&c.jsx(w.TableCell,{onClick:C=>C.stopPropagation(),children:o?c.jsx(w.Link,{component:"button",underline:"hover",onClick:()=>o(e.packageName??""),sx:{fontWeight:500},children:e.packageName}):e.packageName}),c.jsx(w.TableCell,{children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[c.jsx(w.Chip,{size:"small",label:Zx(e.status),color:Jx(e.status),variant:m?"filled":"outlined"}),y&&c.jsx(w.Tooltip,{title:y,children:c.jsx(Yx,{fontSize:"small",color:"error"})})]})}),c.jsx(w.TableCell,{children:c.jsx(n2,{meta:h})}),c.jsx(w.TableCell,{children:EN(e.startedAt??e.createdAt)}),c.jsx(w.TableCell,{children:t2(e.startedAt,e.completedAt)}),c.jsx(w.TableCell,{children:p}),c.jsx(w.TableCell,{align:"right",onClick:C=>C.stopPropagation(),children:x&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small","aria-label":`Materialization actions for ${e.id??""}`.trim(),onClick:C=>u(C.currentTarget),children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:l,open:d,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t&&m&&c.jsxs(w.MenuItem,{"aria-label":`Stop materialization ${e.id??""}`.trim(),disabled:n,onClick:()=>{f(),i(e)},children:[c.jsx(w.ListItemIcon,{children:c.jsx(SN,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Stop"})]}),t&&b&&c.jsx(V8,{materialization:e,isMutating:n,onCloseDialog:f,onDelete:C=>s(e,C)})]})]})})]})}var Go={},Xn={},oa={},Qo={},Fd={},wg;function q8(){return wg||(wg=1,Object.defineProperty(Fd,"__esModule",{value:!0})),Fd}var ia={},sa={},Dg;function vi(){if(Dg)return sa;Dg=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.CronField=void 0;let e=class y2{#e=!1;#n=!1;#i=!1;#o=[];options={rawValue:""};static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(n,r={rawValue:""}){if(!Array.isArray(n))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(n.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...r,rawValue:r.rawValue??""},this.#o=n.sort(y2.sorter),this.#i=this.options.wildcard!==void 0?this.options.wildcard:this.#r(),this.#e=this.options.rawValue.includes("L")||n.includes("L"),this.#n=this.options.rawValue.includes("?")||n.includes("?")}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#n}get isWildcard(){return this.#i}get values(){return this.#o}static sorter(n,r){const o=typeof n=="number",i=typeof r=="number";return o&&i?n-r:!o&&!i?n.localeCompare(r):o?-1:1}static findNearestValueInList(n,r,o){if(o){for(let i=n.length-1;i>=0;i--)if(n[i]<r)return n[i];return null}for(let i=0;i<n.length;i++)if(n[i]>r)return n[i];return null}findNearestValue(n,r){return this.constructor.findNearestValueInList(this.values,n,r)}serialize(){return{wildcard:this.#i,values:this.#o}}validate(){let n;const r=this.chars.length>0?` or chars ${this.chars.join("")}`:"",o=l=>u=>new RegExp(`^\\d{0,2}${u}$`).test(l),i=l=>(n=l,typeof l=="number"?l>=this.min&&l<=this.max:this.chars.some(o(l)));if(!this.#o.every(i))throw new Error(`${this.constructor.name} Validation error, got value ${n} expected range ${this.min}-${this.max}${r}`);const a=this.#o.find((l,u)=>this.#o.indexOf(l)!==u);if(a)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${a}`)}#r(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(n,r)=>r+this.min).every(n=>this.#o.includes(n))}};return sa.CronField=e,sa}var Ig;function Y8(){if(Ig)return ia;Ig=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.CronDayOfMonth=void 0;const e=vi(),t=1,n=31,r=Object.freeze(["L"]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return ia.CronDayOfMonth=o,ia}var aa={},Ag;function K8(){if(Ag)return aa;Ag=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.CronDayOfWeek=void 0;const e=vi(),t=0,n=7,r=Object.freeze(["L"]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};return aa.CronDayOfWeek=o,aa}var la={},Og;function G8(){if(Og)return la;Og=1,Object.defineProperty(la,"__esModule",{value:!0}),la.CronHour=void 0;const e=vi(),t=0,n=23,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return la.CronHour=o,la}var ua={},Mg;function Q8(){if(Mg)return ua;Mg=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.CronMinute=void 0;const e=vi(),t=0,n=59,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return ua.CronMinute=o,ua}var ca={},Ld={},Un={},Pg;function X8(){if(Pg)return Un;Pg=1,Object.defineProperty(Un,"__esModule",{value:!0});class e extends Error{}class t extends e{constructor(g){super(`Invalid DateTime: ${g.toMessage()}`)}}class n extends e{constructor(g){super(`Invalid Interval: ${g.toMessage()}`)}}class r extends e{constructor(g){super(`Invalid Duration: ${g.toMessage()}`)}}class o extends e{}class i extends e{constructor(g){super(`Invalid unit ${g}`)}}class s extends e{}class a extends e{constructor(){super("Zone is an abstract class")}}const l="numeric",u="short",d="long",f={year:l,month:l,day:l},h={year:l,month:u,day:l},p={year:l,month:u,day:l,weekday:u},m={year:l,month:d,day:l},b={year:l,month:d,day:l,weekday:d},y={hour:l,minute:l},x={hour:l,minute:l,second:l},C={hour:l,minute:l,second:l,timeZoneName:u},v={hour:l,minute:l,second:l,timeZoneName:d},S={hour:l,minute:l,hourCycle:"h23"},I={hour:l,minute:l,second:l,hourCycle:"h23"},T={hour:l,minute:l,second:l,hourCycle:"h23",timeZoneName:u},N={hour:l,minute:l,second:l,hourCycle:"h23",timeZoneName:d},O={year:l,month:l,day:l,hour:l,minute:l},F={year:l,month:l,day:l,hour:l,minute:l,second:l},B={year:l,month:u,day:l,hour:l,minute:l},j={year:l,month:u,day:l,hour:l,minute:l,second:l},D={year:l,month:u,day:l,weekday:u,hour:l,minute:l},H={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},_={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},L={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},$={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d};class K{get type(){throw new a}get name(){throw new a}get ianaName(){return this.name}get isUniversal(){throw new a}offsetName(g,k){throw new a}formatOffset(g,k){throw new a}offset(g){throw new a}equals(g){throw new a}get isValid(){throw new a}}let G=null;class q extends K{static get instance(){return G===null&&(G=new q),G}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(g,{format:k,locale:P}){return yh(g,k,P)}formatOffset(g,k){return Ls(this.offset(g),k)}offset(g){return-new Date(g).getTimezoneOffset()}equals(g){return g.type==="system"}get isValid(){return!0}}const R=new Map;function oe(A){let g=R.get(A);return g===void 0&&(g=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:A,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),R.set(A,g)),g}const se={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function z(A,g){const k=A.format(g).replace(/\u200E/g,""),P=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(k),[,U,ee,ce,de,ge,Be,et]=P;return[ce,U,ee,de,ge,Be,et]}function pe(A,g){const k=A.formatToParts(g),P=[];for(let U=0;U<k.length;U++){const{type:ee,value:ce}=k[U],de=se[ee];ee==="era"?P[de]=ce:je(de)||(P[de]=parseInt(ce,10))}return P}const J=new Map;class Q extends K{static create(g){let k=J.get(g);return k===void 0&&J.set(g,k=new Q(g)),k}static resetCache(){J.clear(),R.clear()}static isValidSpecifier(g){return this.isValidZone(g)}static isValidZone(g){if(!g)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:g}).format(),!0}catch{return!1}}constructor(g){super(),this.zoneName=g,this.valid=Q.isValidZone(g)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(g,{format:k,locale:P}){return yh(g,k,P,this.name)}formatOffset(g,k){return Ls(this.offset(g),k)}offset(g){if(!this.valid)return NaN;const k=new Date(g);if(isNaN(k))return NaN;const P=oe(this.name);let[U,ee,ce,de,ge,Be,et]=P.formatToParts?pe(P,k):z(P,k);de==="BC"&&(U=-Math.abs(U)+1);const Ut=Ol({year:U,month:ee,day:ce,hour:ge===24?0:ge,minute:Be,second:et,millisecond:0});let it=+k;const fn=it%1e3;return it-=fn>=0?fn:1e3+fn,(Ut-it)/(60*1e3)}equals(g){return g.type==="iana"&&g.name===this.name}get isValid(){return this.valid}}let re={};function ne(A,g={}){const k=JSON.stringify([A,g]);let P=re[k];return P||(P=new Intl.ListFormat(A,g),re[k]=P),P}const ae=new Map;function ie(A,g={}){const k=JSON.stringify([A,g]);let P=ae.get(k);return P===void 0&&(P=new Intl.DateTimeFormat(A,g),ae.set(k,P)),P}const Z=new Map;function me(A,g={}){const k=JSON.stringify([A,g]);let P=Z.get(k);return P===void 0&&(P=new Intl.NumberFormat(A,g),Z.set(k,P)),P}const le=new Map;function ue(A,g={}){const{base:k,...P}=g,U=JSON.stringify([A,P]);let ee=le.get(U);return ee===void 0&&(ee=new Intl.RelativeTimeFormat(A,g),le.set(U,ee)),ee}let Ie=null;function Ce(){return Ie||(Ie=new Intl.DateTimeFormat().resolvedOptions().locale,Ie)}const we=new Map;function ye(A){let g=we.get(A);return g===void 0&&(g=new Intl.DateTimeFormat(A).resolvedOptions(),we.set(A,g)),g}const ze=new Map;function Ne(A){let g=ze.get(A);if(!g){const k=new Intl.Locale(A);g="getWeekInfo"in k?k.getWeekInfo():k.weekInfo,"minimalDays"in g||(g={...Xe,...g}),ze.set(A,g)}return g}function nt(A){const g=A.indexOf("-x-");g!==-1&&(A=A.substring(0,g));const k=A.indexOf("-u-");if(k===-1)return[A];{let P,U;try{P=ie(A).resolvedOptions(),U=A}catch{const ge=A.substring(0,k);P=ie(ge).resolvedOptions(),U=ge}const{numberingSystem:ee,calendar:ce}=P;return[U,ee,ce]}}function _e(A,g,k){return(k||g)&&(A.includes("-u-")||(A+="-u"),k&&(A+=`-ca-${k}`),g&&(A+=`-nu-${g}`)),A}function Bt(A){const g=[];for(let k=1;k<=12;k++){const P=at.utc(2009,k,1);g.push(A(P))}return g}function yt(A){const g=[];for(let k=1;k<=7;k++){const P=at.utc(2016,11,13+k);g.push(A(P))}return g}function ot(A,g,k,P){const U=A.listingMode();return U==="error"?null:U==="en"?k(g):P(g)}function xe(A){return A.numberingSystem&&A.numberingSystem!=="latn"?!1:A.numberingSystem==="latn"||!A.locale||A.locale.startsWith("en")||ye(A.locale).numberingSystem==="latn"}class Pe{constructor(g,k,P){this.padTo=P.padTo||0,this.floor=P.floor||!1;const{padTo:U,floor:ee,...ce}=P;if(!k||Object.keys(ce).length>0){const de={useGrouping:!1,...P};P.padTo>0&&(de.minimumIntegerDigits=P.padTo),this.inf=me(g,de)}}format(g){if(this.inf){const k=this.floor?Math.floor(g):g;return this.inf.format(k)}else{const k=this.floor?Math.floor(g):jc(g,3);return dn(k,this.padTo)}}}class qe{constructor(g,k,P){this.opts=P,this.originalZone=void 0;let U;if(this.opts.timeZone)this.dt=g;else if(g.zone.type==="fixed"){const ce=-1*(g.offset/60),de=ce>=0?`Etc/GMT+${ce}`:`Etc/GMT${ce}`;g.offset!==0&&Q.create(de).valid?(U=de,this.dt=g):(U="UTC",this.dt=g.offset===0?g:g.setZone("UTC").plus({minutes:g.offset}),this.originalZone=g.zone)}else g.zone.type==="system"?this.dt=g:g.zone.type==="iana"?(this.dt=g,U=g.zone.name):(U="UTC",this.dt=g.setZone("UTC").plus({minutes:g.offset}),this.originalZone=g.zone);const ee={...this.opts};ee.timeZone=ee.timeZone||U,this.dtf=ie(k,ee)}format(){return this.originalZone?this.formatToParts().map(({value:g})=>g).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const g=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?g.map(k=>{if(k.type==="timeZoneName"){const P=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...k,value:P}}else return k}):g}resolvedOptions(){return this.dtf.resolvedOptions()}}class Je{constructor(g,k,P){this.opts={style:"long",...P},!k&&Ps()&&(this.rtf=ue(g,P))}format(g,k){return this.rtf?this.rtf.format(g,k):LE(k,g,this.opts.numeric,this.opts.style!=="long")}formatToParts(g,k){return this.rtf?this.rtf.formatToParts(g,k):[]}}const Xe={firstDay:1,minimalDays:4,weekend:[6,7]};class Re{static fromOpts(g){return Re.create(g.locale,g.numberingSystem,g.outputCalendar,g.weekSettings,g.defaultToEN)}static create(g,k,P,U,ee=!1){const ce=g||Pt.defaultLocale,de=ce||(ee?"en-US":Ce()),ge=k||Pt.defaultNumberingSystem,Be=P||Pt.defaultOutputCalendar,et=io(U)||Pt.defaultWeekSettings;return new Re(de,ge,Be,et,ce)}static resetCache(){Ie=null,ae.clear(),Z.clear(),le.clear(),we.clear(),ze.clear()}static fromObject({locale:g,numberingSystem:k,outputCalendar:P,weekSettings:U}={}){return Re.create(g,k,P,U)}constructor(g,k,P,U,ee){const[ce,de,ge]=nt(g);this.locale=ce,this.numberingSystem=k||de||null,this.outputCalendar=P||ge||null,this.weekSettings=U,this.intl=_e(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=ee,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=xe(this)),this.fastNumbersCached}listingMode(){const g=this.isEnglish(),k=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return g&&k?"en":"intl"}clone(g){return!g||Object.getOwnPropertyNames(g).length===0?this:Re.create(g.locale||this.specifiedLocale,g.numberingSystem||this.numberingSystem,g.outputCalendar||this.outputCalendar,io(g.weekSettings)||this.weekSettings,g.defaultToEN||!1)}redefaultToEN(g={}){return this.clone({...g,defaultToEN:!0})}redefaultToSystem(g={}){return this.clone({...g,defaultToEN:!1})}months(g,k=!1){return ot(this,g,Eh,()=>{const P=this.intl==="ja"||this.intl.startsWith("ja-");k&=!P;const U=k?{month:g,day:"numeric"}:{month:g},ee=k?"format":"standalone";if(!this.monthsCache[ee][g]){const ce=P?de=>this.dtFormatter(de,U).format():de=>this.extract(de,U,"month");this.monthsCache[ee][g]=Bt(ce)}return this.monthsCache[ee][g]})}weekdays(g,k=!1){return ot(this,g,Sh,()=>{const P=k?{weekday:g,year:"numeric",month:"long",day:"numeric"}:{weekday:g},U=k?"format":"standalone";return this.weekdaysCache[U][g]||(this.weekdaysCache[U][g]=yt(ee=>this.extract(ee,P,"weekday"))),this.weekdaysCache[U][g]})}meridiems(){return ot(this,void 0,()=>kh,()=>{if(!this.meridiemCache){const g={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[at.utc(2016,11,13,9),at.utc(2016,11,13,19)].map(k=>this.extract(k,g,"dayperiod"))}return this.meridiemCache})}eras(g){return ot(this,g,wh,()=>{const k={era:g};return this.eraCache[g]||(this.eraCache[g]=[at.utc(-40,1,1),at.utc(2017,1,1)].map(P=>this.extract(P,k,"era"))),this.eraCache[g]})}extract(g,k,P){const U=this.dtFormatter(g,k),ee=U.formatToParts(),ce=ee.find(de=>de.type.toLowerCase()===P);return ce?ce.value:null}numberFormatter(g={}){return new Pe(this.intl,g.forceSimple||this.fastNumbers,g)}dtFormatter(g,k={}){return new qe(g,this.intl,k)}relFormatter(g={}){return new Je(this.intl,this.isEnglish(),g)}listFormatter(g={}){return ne(this.intl,g)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ye(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Rs()?Ne(this.locale):Xe}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(g){return this.locale===g.locale&&this.numberingSystem===g.numberingSystem&&this.outputCalendar===g.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let ct=null;class lt extends K{static get utcInstance(){return ct===null&&(ct=new lt(0)),ct}static instance(g){return g===0?lt.utcInstance:new lt(g)}static parseSpecifier(g){if(g){const k=g.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(k)return new lt(Ml(k[1],k[2]))}return null}constructor(g){super(),this.fixed=g}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ls(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ls(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(g,k){return Ls(this.fixed,k)}get isUniversal(){return!0}offset(){return this.fixed}equals(g){return g.type==="fixed"&&g.fixed===this.fixed}get isValid(){return!0}}class Mt extends K{constructor(g){super(),this.zoneName=g}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function be(A,g){if(je(A)||A===null)return g;if(A instanceof K)return A;if(Qn(A)){const k=A.toLowerCase();return k==="default"?g:k==="local"||k==="system"?q.instance:k==="utc"||k==="gmt"?lt.utcInstance:lt.parseSpecifier(k)||Q.create(A)}else return zt(A)?lt.instance(A):typeof A=="object"&&"offset"in A&&typeof A.offset=="function"?A:new Mt(A)}const Ae={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Oe={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Qe=Ae.hanidec.replace(/[\[|\]]/g,"").split("");function st(A){let g=parseInt(A,10);if(isNaN(g)){g="";for(let k=0;k<A.length;k++){const P=A.charCodeAt(k);if(A[k].search(Ae.hanidec)!==-1)g+=Qe.indexOf(A[k]);else for(const U in Oe){const[ee,ce]=Oe[U];P>=ee&&P<=ce&&(g+=P-ee)}}return parseInt(g,10)}else return g}const Nt=new Map;function Gt(){Nt.clear()}function bt({numberingSystem:A},g=""){const k=A||"latn";let P=Nt.get(k);P===void 0&&(P=new Map,Nt.set(k,P));let U=P.get(g);return U===void 0&&(U=new RegExp(`${Ae[k]}${g}`),P.set(g,U)),U}let sn=()=>Date.now(),Rn="system",jt=null,gn=null,lr=null,Nn=60,jr,Hn=null;class Pt{static get now(){return sn}static set now(g){sn=g}static set defaultZone(g){Rn=g}static get defaultZone(){return be(Rn,q.instance)}static get defaultLocale(){return jt}static set defaultLocale(g){jt=g}static get defaultNumberingSystem(){return gn}static set defaultNumberingSystem(g){gn=g}static get defaultOutputCalendar(){return lr}static set defaultOutputCalendar(g){lr=g}static get defaultWeekSettings(){return Hn}static set defaultWeekSettings(g){Hn=io(g)}static get twoDigitCutoffYear(){return Nn}static set twoDigitCutoffYear(g){Nn=g%100}static get throwOnInvalid(){return jr}static set throwOnInvalid(g){jr=g}static resetCaches(){Re.resetCache(),Q.resetCache(),at.resetCache(),Gt()}}class xn{constructor(g,k){this.reason=g,this.explanation=k}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const To=[0,31,59,90,120,151,181,212,243,273,304,334],ki=[0,31,60,91,121,152,182,213,244,274,305,335];function wn(A,g){return new xn("unit out of range",`you specified ${g} (of type ${typeof g}) as a ${A}, which is invalid`)}function $o(A,g,k){const P=new Date(Date.UTC(A,g-1,k));A<100&&A>=0&&P.setUTCFullYear(P.getUTCFullYear()-1900);const U=P.getUTCDay();return U===0?7:U}function wi(A,g,k){return k+(Ns(A)?ki:To)[g-1]}function So(A,g){const k=Ns(A)?ki:To,P=k.findIndex(ee=>ee<g),U=g-k[P];return{month:P+1,day:U}}function nn(A,g){return(A-g+7)%7+1}function rn(A,g=4,k=1){const{year:P,month:U,day:ee}=A,ce=wi(P,U,ee),de=nn($o(P,U,ee),k);let ge=Math.floor((ce-de+14-g)/7),Be;return ge<1?(Be=P-1,ge=Fs(Be,g,k)):ge>Fs(P,g,k)?(Be=P+1,ge=1):Be=P,{weekYear:Be,weekNumber:ge,weekday:de,...Rl(A)}}function Ar(A,g=4,k=1){const{weekYear:P,weekNumber:U,weekday:ee}=A,ce=nn($o(P,1,g),k),de=Ii(P);let ge=U*7+ee-ce-7+g,Be;ge<1?(Be=P-1,ge+=Ii(Be)):ge>de?(Be=P+1,ge-=Ii(P)):Be=P;const{month:et,day:pt}=So(Be,ge);return{year:Be,month:et,day:pt,...Rl(A)}}function Ho(A){const{year:g,month:k,day:P}=A,U=wi(g,k,P);return{year:g,ordinal:U,...Rl(A)}}function ko(A){const{year:g,ordinal:k}=A,{month:P,day:U}=So(g,k);return{year:g,month:P,day:U,...Rl(A)}}function zo(A,g){if(!je(A.localWeekday)||!je(A.localWeekNumber)||!je(A.localWeekYear)){if(!je(A.weekday)||!je(A.weekNumber)||!je(A.weekYear))throw new o("Cannot mix locale-based week fields with ISO-based week fields");return je(A.localWeekday)||(A.weekday=A.localWeekday),je(A.localWeekNumber)||(A.weekNumber=A.localWeekNumber),je(A.localWeekYear)||(A.weekYear=A.localWeekYear),delete A.localWeekday,delete A.localWeekNumber,delete A.localWeekYear,{minDaysInFirstWeek:g.getMinDaysInFirstWeek(),startOfWeek:g.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function ke(A,g=4,k=1){const P=Wt(A.weekYear),U=ur(A.weekNumber,1,Fs(A.weekYear,g,k)),ee=ur(A.weekday,1,7);return P?U?ee?!1:wn("weekday",A.weekday):wn("week",A.weekNumber):wn("weekYear",A.weekYear)}function Te(A){const g=Wt(A.year),k=ur(A.ordinal,1,Ii(A.year));return g?k?!1:wn("ordinal",A.ordinal):wn("year",A.year)}function Ye(A){const g=Wt(A.year),k=ur(A.month,1,12),P=ur(A.day,1,Al(A.year,A.month));return g?k?P?!1:wn("day",A.day):wn("month",A.month):wn("year",A.year)}function rt(A){const{hour:g,minute:k,second:P,millisecond:U}=A,ee=ur(g,0,23)||g===24&&k===0&&P===0&&U===0,ce=ur(k,0,59),de=ur(P,0,59),ge=ur(U,0,999);return ee?ce?de?ge?!1:wn("millisecond",U):wn("second",P):wn("minute",k):wn("hour",g)}function je(A){return typeof A>"u"}function zt(A){return typeof A=="number"}function Wt(A){return typeof A=="number"&&A%1===0}function Qn(A){return typeof A=="string"}function Di(A){return Object.prototype.toString.call(A)==="[object Date]"}function Ps(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Rs(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Il(A){return Array.isArray(A)?A:[A]}function wt(A,g,k){if(A.length!==0)return A.reduce((P,U)=>{const ee=[g(U),U];return P&&k(P[0],ee[0])===P[0]?P:ee},null)[1]}function $r(A,g){return g.reduce((k,P)=>(k[P]=A[P],k),{})}function Fn(A,g){return Object.prototype.hasOwnProperty.call(A,g)}function io(A){if(A==null)return null;if(typeof A!="object")throw new s("Week settings must be an object");if(!ur(A.firstDay,1,7)||!ur(A.minimalDays,1,7)||!Array.isArray(A.weekend)||A.weekend.some(g=>!ur(g,1,7)))throw new s("Invalid week settings");return{firstDay:A.firstDay,minimalDays:A.minimalDays,weekend:Array.from(A.weekend)}}function ur(A,g,k){return Wt(A)&&A>=g&&A<=k}function kE(A,g){return A-g*Math.floor(A/g)}function dn(A,g=2){const k=A<0;let P;return k?P="-"+(""+-A).padStart(g,"0"):P=(""+A).padStart(g,"0"),P}function wo(A){if(!(je(A)||A===null||A===""))return parseInt(A,10)}function Uo(A){if(!(je(A)||A===null||A===""))return parseFloat(A)}function Bc(A){if(!(je(A)||A===null||A==="")){const g=parseFloat("0."+A)*1e3;return Math.floor(g)}}function jc(A,g,k="round"){const P=10**g;switch(k){case"expand":return A>0?Math.ceil(A*P)/P:Math.floor(A*P)/P;case"trunc":return Math.trunc(A*P)/P;case"round":return Math.round(A*P)/P;case"floor":return Math.floor(A*P)/P;case"ceil":return Math.ceil(A*P)/P;default:throw new RangeError(`Value rounding ${k} is out of range`)}}function Ns(A){return A%4===0&&(A%100!==0||A%400===0)}function Ii(A){return Ns(A)?366:365}function Al(A,g){const k=kE(g-1,12)+1,P=A+(g-k)/12;return k===2?Ns(P)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][k-1]}function Ol(A){let g=Date.UTC(A.year,A.month-1,A.day,A.hour,A.minute,A.second,A.millisecond);return A.year<100&&A.year>=0&&(g=new Date(g),g.setUTCFullYear(A.year,A.month-1,A.day)),+g}function bh(A,g,k){return-nn($o(A,1,g),k)+g-1}function Fs(A,g=4,k=1){const P=bh(A,g,k),U=bh(A+1,g,k);return(Ii(A)-P+U)/7}function $c(A){return A>99?A:A>Pt.twoDigitCutoffYear?1900+A:2e3+A}function yh(A,g,k,P=null){const U=new Date(A),ee={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};P&&(ee.timeZone=P);const ce={timeZoneName:g,...ee},de=new Intl.DateTimeFormat(k,ce).formatToParts(U).find(ge=>ge.type.toLowerCase()==="timezonename");return de?de.value:null}function Ml(A,g){let k=parseInt(A,10);Number.isNaN(k)&&(k=0);const P=parseInt(g,10)||0,U=k<0||Object.is(k,-0)?-P:P;return k*60+U}function xh(A){const g=Number(A);if(typeof A=="boolean"||A===""||!Number.isFinite(g))throw new s(`Invalid unit value ${A}`);return g}function Pl(A,g){const k={};for(const P in A)if(Fn(A,P)){const U=A[P];if(U==null)continue;k[g(P)]=xh(U)}return k}function Ls(A,g){const k=Math.trunc(Math.abs(A/60)),P=Math.trunc(Math.abs(A%60)),U=A>=0?"+":"-";switch(g){case"short":return`${U}${dn(k,2)}:${dn(P,2)}`;case"narrow":return`${U}${k}${P>0?`:${P}`:""}`;case"techie":return`${U}${dn(k,2)}${dn(P,2)}`;default:throw new RangeError(`Value format ${g} is out of range for property format`)}}function Rl(A){return $r(A,["hour","minute","second","millisecond"])}const wE=["January","February","March","April","May","June","July","August","September","October","November","December"],Ch=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DE=["J","F","M","A","M","J","J","A","S","O","N","D"];function Eh(A){switch(A){case"narrow":return[...DE];case"short":return[...Ch];case"long":return[...wE];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const vh=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Th=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],IE=["M","T","W","T","F","S","S"];function Sh(A){switch(A){case"narrow":return[...IE];case"short":return[...Th];case"long":return[...vh];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const kh=["AM","PM"],AE=["Before Christ","Anno Domini"],OE=["BC","AD"],ME=["B","A"];function wh(A){switch(A){case"narrow":return[...ME];case"short":return[...OE];case"long":return[...AE];default:return null}}function PE(A){return kh[A.hour<12?0:1]}function RE(A,g){return Sh(g)[A.weekday-1]}function NE(A,g){return Eh(g)[A.month-1]}function FE(A,g){return wh(g)[A.year<0?0:1]}function LE(A,g,k="always",P=!1){const U={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},ee=["hours","minutes","seconds"].indexOf(A)===-1;if(k==="auto"&&ee){const pt=A==="days";switch(g){case 1:return pt?"tomorrow":`next ${U[A][0]}`;case-1:return pt?"yesterday":`last ${U[A][0]}`;case 0:return pt?"today":`this ${U[A][0]}`}}const ce=Object.is(g,-0)||g<0,de=Math.abs(g),ge=de===1,Be=U[A],et=P?ge?Be[1]:Be[2]||Be[1]:ge?U[A][0]:A;return ce?`${de} ${et} ago`:`in ${de} ${et}`}function Dh(A,g){let k="";for(const P of A)P.literal?k+=P.val:k+=g(P.val);return k}const _E={D:f,DD:h,DDD:m,DDDD:b,t:y,tt:x,ttt:C,tttt:v,T:S,TT:I,TTT:T,TTTT:N,f:O,ff:B,fff:H,ffff:L,F,FF:j,FFF:_,FFFF:$};class Dn{static create(g,k={}){return new Dn(g,k)}static parseFormat(g){let k=null,P="",U=!1;const ee=[];for(let ce=0;ce<g.length;ce++){const de=g.charAt(ce);de==="'"?((P.length>0||U)&&ee.push({literal:U||/^\s+$/.test(P),val:P===""?"'":P}),k=null,P="",U=!U):U||de===k?P+=de:(P.length>0&&ee.push({literal:/^\s+$/.test(P),val:P}),P=de,k=de)}return P.length>0&&ee.push({literal:U||/^\s+$/.test(P),val:P}),ee}static macroTokenToFormatOpts(g){return _E[g]}constructor(g,k){this.opts=k,this.loc=g,this.systemLoc=null}formatWithSystemDefault(g,k){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(g,{...this.opts,...k}).format()}dtFormatter(g,k={}){return this.loc.dtFormatter(g,{...this.opts,...k})}formatDateTime(g,k){return this.dtFormatter(g,k).format()}formatDateTimeParts(g,k){return this.dtFormatter(g,k).formatToParts()}formatInterval(g,k){return this.dtFormatter(g.start,k).dtf.formatRange(g.start.toJSDate(),g.end.toJSDate())}resolvedOptions(g,k){return this.dtFormatter(g,k).resolvedOptions()}num(g,k=0,P=void 0){if(this.opts.forceSimple)return dn(g,k);const U={...this.opts};return k>0&&(U.padTo=k),P&&(U.signDisplay=P),this.loc.numberFormatter(U).format(g)}formatDateTimeFromString(g,k){const P=this.loc.listingMode()==="en",U=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",ee=(it,fn)=>this.loc.extract(g,it,fn),ce=it=>g.isOffsetFixed&&g.offset===0&&it.allowZ?"Z":g.isValid?g.zone.formatOffset(g.ts,it.format):"",de=()=>P?PE(g):ee({hour:"numeric",hourCycle:"h12"},"dayperiod"),ge=(it,fn)=>P?NE(g,it):ee(fn?{month:it}:{month:it,day:"numeric"},"month"),Be=(it,fn)=>P?RE(g,it):ee(fn?{weekday:it}:{weekday:it,month:"long",day:"numeric"},"weekday"),et=it=>{const fn=Dn.macroTokenToFormatOpts(it);return fn?this.formatWithSystemDefault(g,fn):it},pt=it=>P?FE(g,it):ee({era:it},"era"),Ut=it=>{switch(it){case"S":return this.num(g.millisecond);case"u":case"SSS":return this.num(g.millisecond,3);case"s":return this.num(g.second);case"ss":return this.num(g.second,2);case"uu":return this.num(Math.floor(g.millisecond/10),2);case"uuu":return this.num(Math.floor(g.millisecond/100));case"m":return this.num(g.minute);case"mm":return this.num(g.minute,2);case"h":return this.num(g.hour%12===0?12:g.hour%12);case"hh":return this.num(g.hour%12===0?12:g.hour%12,2);case"H":return this.num(g.hour);case"HH":return this.num(g.hour,2);case"Z":return ce({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return ce({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return ce({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return g.zone.offsetName(g.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return g.zone.offsetName(g.ts,{format:"long",locale:this.loc.locale});case"z":return g.zoneName;case"a":return de();case"d":return U?ee({day:"numeric"},"day"):this.num(g.day);case"dd":return U?ee({day:"2-digit"},"day"):this.num(g.day,2);case"c":return this.num(g.weekday);case"ccc":return Be("short",!0);case"cccc":return Be("long",!0);case"ccccc":return Be("narrow",!0);case"E":return this.num(g.weekday);case"EEE":return Be("short",!1);case"EEEE":return Be("long",!1);case"EEEEE":return Be("narrow",!1);case"L":return U?ee({month:"numeric",day:"numeric"},"month"):this.num(g.month);case"LL":return U?ee({month:"2-digit",day:"numeric"},"month"):this.num(g.month,2);case"LLL":return ge("short",!0);case"LLLL":return ge("long",!0);case"LLLLL":return ge("narrow",!0);case"M":return U?ee({month:"numeric"},"month"):this.num(g.month);case"MM":return U?ee({month:"2-digit"},"month"):this.num(g.month,2);case"MMM":return ge("short",!1);case"MMMM":return ge("long",!1);case"MMMMM":return ge("narrow",!1);case"y":return U?ee({year:"numeric"},"year"):this.num(g.year);case"yy":return U?ee({year:"2-digit"},"year"):this.num(g.year.toString().slice(-2),2);case"yyyy":return U?ee({year:"numeric"},"year"):this.num(g.year,4);case"yyyyyy":return U?ee({year:"numeric"},"year"):this.num(g.year,6);case"G":return pt("short");case"GG":return pt("long");case"GGGGG":return pt("narrow");case"kk":return this.num(g.weekYear.toString().slice(-2),2);case"kkkk":return this.num(g.weekYear,4);case"W":return this.num(g.weekNumber);case"WW":return this.num(g.weekNumber,2);case"n":return this.num(g.localWeekNumber);case"nn":return this.num(g.localWeekNumber,2);case"ii":return this.num(g.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(g.localWeekYear,4);case"o":return this.num(g.ordinal);case"ooo":return this.num(g.ordinal,3);case"q":return this.num(g.quarter);case"qq":return this.num(g.quarter,2);case"X":return this.num(Math.floor(g.ts/1e3));case"x":return this.num(g.ts);default:return et(it)}};return Dh(Dn.parseFormat(k),Ut)}formatDurationFromString(g,k){const P=this.opts.signMode==="negativeLargestOnly"?-1:1,U=et=>{switch(et[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},ee=(et,pt)=>Ut=>{const it=U(Ut);if(it){const fn=pt.isNegativeDuration&&it!==pt.largestUnit?P:1;let Mr;return this.opts.signMode==="negativeLargestOnly"&&it!==pt.largestUnit?Mr="never":this.opts.signMode==="all"?Mr="always":Mr="auto",this.num(et.get(it)*fn,Ut.length,Mr)}else return Ut},ce=Dn.parseFormat(k),de=ce.reduce((et,{literal:pt,val:Ut})=>pt?et:et.concat(Ut),[]),ge=g.shiftTo(...de.map(U).filter(et=>et)),Be={isNegativeDuration:ge<0,largestUnit:Object.keys(ge.values)[0]};return Dh(ce,ee(ge,Be))}}const Ih=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ai(...A){const g=A.reduce((k,P)=>k+P.source,"");return RegExp(`^${g}$`)}function Oi(...A){return g=>A.reduce(([k,P,U],ee)=>{const[ce,de,ge]=ee(g,U);return[{...k,...ce},de||P,ge]},[{},null,1]).slice(0,2)}function Mi(A,...g){if(A==null)return[null,null];for(const[k,P]of g){const U=k.exec(A);if(U)return P(U)}return[null,null]}function Ah(...A){return(g,k)=>{const P={};let U;for(U=0;U<A.length;U++)P[A[U]]=wo(g[k+U]);return[P,null,k+U]}}const Oh=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,BE=`(?:${Oh.source}?(?:\\[(${Ih.source})\\])?)?`,Hc=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Mh=RegExp(`${Hc.source}${BE}`),zc=RegExp(`(?:[Tt]${Mh.source})?`),jE=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,$E=/(\d{4})-?W(\d\d)(?:-?(\d))?/,HE=/(\d{4})-?(\d{3})/,zE=Ah("weekYear","weekNumber","weekDay"),UE=Ah("year","ordinal"),VE=/(\d{4})-(\d\d)-(\d\d)/,Ph=RegExp(`${Hc.source} ?(?:${Oh.source}|(${Ih.source}))?`),WE=RegExp(`(?: ${Ph.source})?`);function Pi(A,g,k){const P=A[g];return je(P)?k:wo(P)}function qE(A,g){return[{year:Pi(A,g),month:Pi(A,g+1,1),day:Pi(A,g+2,1)},null,g+3]}function Ri(A,g){return[{hours:Pi(A,g,0),minutes:Pi(A,g+1,0),seconds:Pi(A,g+2,0),milliseconds:Bc(A[g+3])},null,g+4]}function _s(A,g){const k=!A[g]&&!A[g+1],P=Ml(A[g+1],A[g+2]),U=k?null:lt.instance(P);return[{},U,g+3]}function Bs(A,g){const k=A[g]?Q.create(A[g]):null;return[{},k,g+1]}const YE=RegExp(`^T?${Hc.source}$`),KE=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function GE(A){const[g,k,P,U,ee,ce,de,ge,Be]=A,et=g[0]==="-",pt=ge&&ge[0]==="-",Ut=(it,fn=!1)=>it!==void 0&&(fn||it&&et)?-it:it;return[{years:Ut(Uo(k)),months:Ut(Uo(P)),weeks:Ut(Uo(U)),days:Ut(Uo(ee)),hours:Ut(Uo(ce)),minutes:Ut(Uo(de)),seconds:Ut(Uo(ge),ge==="-0"),milliseconds:Ut(Bc(Be),pt)}]}const QE={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Uc(A,g,k,P,U,ee,ce){const de={year:g.length===2?$c(wo(g)):wo(g),month:Ch.indexOf(k)+1,day:wo(P),hour:wo(U),minute:wo(ee)};return ce&&(de.second=wo(ce)),A&&(de.weekday=A.length>3?vh.indexOf(A)+1:Th.indexOf(A)+1),de}const XE=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ZE(A){const[,g,k,P,U,ee,ce,de,ge,Be,et,pt]=A,Ut=Uc(g,U,P,k,ee,ce,de);let it;return ge?it=QE[ge]:Be?it=0:it=Ml(et,pt),[Ut,new lt(it)]}function JE(A){return A.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ev=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,tv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,nv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Rh(A){const[,g,k,P,U,ee,ce,de]=A;return[Uc(g,U,P,k,ee,ce,de),lt.utcInstance]}function rv(A){const[,g,k,P,U,ee,ce,de]=A;return[Uc(g,de,k,P,U,ee,ce),lt.utcInstance]}const ov=Ai(jE,zc),iv=Ai($E,zc),sv=Ai(HE,zc),av=Ai(Mh),Nh=Oi(qE,Ri,_s,Bs),lv=Oi(zE,Ri,_s,Bs),uv=Oi(UE,Ri,_s,Bs),cv=Oi(Ri,_s,Bs);function dv(A){return Mi(A,[ov,Nh],[iv,lv],[sv,uv],[av,cv])}function fv(A){return Mi(JE(A),[XE,ZE])}function pv(A){return Mi(A,[ev,Rh],[tv,Rh],[nv,rv])}function hv(A){return Mi(A,[KE,GE])}const mv=Oi(Ri);function gv(A){return Mi(A,[YE,mv])}const bv=Ai(VE,WE),yv=Ai(Ph),xv=Oi(Ri,_s,Bs);function Cv(A){return Mi(A,[bv,Nh],[yv,xv])}const Fh="Invalid Duration",Lh={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Ev={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Lh},cr=146097/400,Ni=146097/4800,vv={years:{quarters:4,months:12,weeks:cr/7,days:cr,hours:cr*24,minutes:cr*24*60,seconds:cr*24*60*60,milliseconds:cr*24*60*60*1e3},quarters:{months:3,weeks:cr/28,days:cr/4,hours:cr*24/4,minutes:cr*24*60/4,seconds:cr*24*60*60/4,milliseconds:cr*24*60*60*1e3/4},months:{weeks:Ni/7,days:Ni,hours:Ni*24,minutes:Ni*24*60,seconds:Ni*24*60*60,milliseconds:Ni*24*60*60*1e3},...Lh},Vo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Tv=Vo.slice(0).reverse();function so(A,g,k=!1){const P={values:k?g.values:{...A.values,...g.values||{}},loc:A.loc.clone(g.loc),conversionAccuracy:g.conversionAccuracy||A.conversionAccuracy,matrix:g.matrix||A.matrix};return new It(P)}function _h(A,g){var k;let P=(k=g.milliseconds)!=null?k:0;for(const U of Tv.slice(1))g[U]&&(P+=g[U]*A[U].milliseconds);return P}function Bh(A,g){const k=_h(A,g)<0?-1:1;Vo.reduceRight((P,U)=>{if(je(g[U]))return P;if(P){const ee=g[P]*k,ce=A[U][P],de=Math.floor(ee/ce);g[U]+=de*k,g[P]-=de*ce*k}return U},null),Vo.reduce((P,U)=>{if(je(g[U]))return P;if(P){const ee=g[P]%1;g[P]-=ee,g[U]+=ee*A[P][U]}return U},null)}function jh(A){const g={};for(const[k,P]of Object.entries(A))P!==0&&(g[k]=P);return g}class It{constructor(g){const k=g.conversionAccuracy==="longterm"||!1;let P=k?vv:Ev;g.matrix&&(P=g.matrix),this.values=g.values,this.loc=g.loc||Re.create(),this.conversionAccuracy=k?"longterm":"casual",this.invalid=g.invalid||null,this.matrix=P,this.isLuxonDuration=!0}static fromMillis(g,k){return It.fromObject({milliseconds:g},k)}static fromObject(g,k={}){if(g==null||typeof g!="object")throw new s(`Duration.fromObject: argument expected to be an object, got ${g===null?"null":typeof g}`);return new It({values:Pl(g,It.normalizeUnit),loc:Re.fromObject(k),conversionAccuracy:k.conversionAccuracy,matrix:k.matrix})}static fromDurationLike(g){if(zt(g))return It.fromMillis(g);if(It.isDuration(g))return g;if(typeof g=="object")return It.fromObject(g);throw new s(`Unknown duration argument ${g} of type ${typeof g}`)}static fromISO(g,k){const[P]=hv(g);return P?It.fromObject(P,k):It.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static fromISOTime(g,k){const[P]=gv(g);return P?It.fromObject(P,k):It.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static invalid(g,k=null){if(!g)throw new s("need to specify a reason the Duration is invalid");const P=g instanceof xn?g:new xn(g,k);if(Pt.throwOnInvalid)throw new r(P);return new It({invalid:P})}static normalizeUnit(g){const k={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[g&&g.toLowerCase()];if(!k)throw new i(g);return k}static isDuration(g){return g&&g.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(g,k={}){const P={...k,floor:k.round!==!1&&k.floor!==!1};return this.isValid?Dn.create(this.loc,P).formatDurationFromString(this,g):Fh}toHuman(g={}){if(!this.isValid)return Fh;const k=g.showZeros!==!1,P=Vo.map(U=>{const ee=this.values[U];return je(ee)||ee===0&&!k?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...g,unit:U.slice(0,-1)}).format(ee)}).filter(U=>U);return this.loc.listFormatter({type:"conjunction",style:g.listStyle||"narrow",...g}).format(P)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let g="P";return this.years!==0&&(g+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(g+=this.months+this.quarters*3+"M"),this.weeks!==0&&(g+=this.weeks+"W"),this.days!==0&&(g+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(g+="T"),this.hours!==0&&(g+=this.hours+"H"),this.minutes!==0&&(g+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(g+=jc(this.seconds+this.milliseconds/1e3,3)+"S"),g==="P"&&(g+="T0S"),g}toISOTime(g={}){if(!this.isValid)return null;const k=this.toMillis();return k<0||k>=864e5?null:(g={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...g,includeOffset:!1},at.fromMillis(k,{zone:"UTC"}).toISOTime(g))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?_h(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g),P={};for(const U of Vo)(Fn(k.values,U)||Fn(this.values,U))&&(P[U]=k.get(U)+this.get(U));return so(this,{values:P},!0)}minus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g);return this.plus(k.negate())}mapUnits(g){if(!this.isValid)return this;const k={};for(const P of Object.keys(this.values))k[P]=xh(g(this.values[P],P));return so(this,{values:k},!0)}get(g){return this[It.normalizeUnit(g)]}set(g){if(!this.isValid)return this;const k={...this.values,...Pl(g,It.normalizeUnit)};return so(this,{values:k})}reconfigure({locale:g,numberingSystem:k,conversionAccuracy:P,matrix:U}={}){const ce={loc:this.loc.clone({locale:g,numberingSystem:k}),matrix:U,conversionAccuracy:P};return so(this,ce)}as(g){return this.isValid?this.shiftTo(g).get(g):NaN}normalize(){if(!this.isValid)return this;const g=this.toObject();return Bh(this.matrix,g),so(this,{values:g},!0)}rescale(){if(!this.isValid)return this;const g=jh(this.normalize().shiftToAll().toObject());return so(this,{values:g},!0)}shiftTo(...g){if(!this.isValid)return this;if(g.length===0)return this;g=g.map(ce=>It.normalizeUnit(ce));const k={},P={},U=this.toObject();let ee;for(const ce of Vo)if(g.indexOf(ce)>=0){ee=ce;let de=0;for(const Be in P)de+=this.matrix[Be][ce]*P[Be],P[Be]=0;zt(U[ce])&&(de+=U[ce]);const ge=Math.trunc(de);k[ce]=ge,P[ce]=(de*1e3-ge*1e3)/1e3}else zt(U[ce])&&(P[ce]=U[ce]);for(const ce in P)P[ce]!==0&&(k[ee]+=ce===ee?P[ce]:P[ce]/this.matrix[ee][ce]);return Bh(this.matrix,k),so(this,{values:k},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const g={};for(const k of Object.keys(this.values))g[k]=this.values[k]===0?0:-this.values[k];return so(this,{values:g},!0)}removeZeros(){if(!this.isValid)return this;const g=jh(this.values);return so(this,{values:g},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(g){if(!this.isValid||!g.isValid||!this.loc.equals(g.loc))return!1;function k(P,U){return P===void 0||P===0?U===void 0||U===0:P===U}for(const P of Vo)if(!k(this.values[P],g.values[P]))return!1;return!0}}const Fi="Invalid Interval";function Sv(A,g){return!A||!A.isValid?on.invalid("missing or invalid start"):!g||!g.isValid?on.invalid("missing or invalid end"):g<A?on.invalid("end before start",`The end of an interval must be after its start, but you had start=${A.toISO()} and end=${g.toISO()}`):null}class on{constructor(g){this.s=g.start,this.e=g.end,this.invalid=g.invalid||null,this.isLuxonInterval=!0}static invalid(g,k=null){if(!g)throw new s("need to specify a reason the Interval is invalid");const P=g instanceof xn?g:new xn(g,k);if(Pt.throwOnInvalid)throw new n(P);return new on({invalid:P})}static fromDateTimes(g,k){const P=zs(g),U=zs(k),ee=Sv(P,U);return ee??new on({start:P,end:U})}static after(g,k){const P=It.fromDurationLike(k),U=zs(g);return on.fromDateTimes(U,U.plus(P))}static before(g,k){const P=It.fromDurationLike(k),U=zs(g);return on.fromDateTimes(U.minus(P),U)}static fromISO(g,k){const[P,U]=(g||"").split("/",2);if(P&&U){let ee,ce;try{ee=at.fromISO(P,k),ce=ee.isValid}catch{ce=!1}let de,ge;try{de=at.fromISO(U,k),ge=de.isValid}catch{ge=!1}if(ce&&ge)return on.fromDateTimes(ee,de);if(ce){const Be=It.fromISO(U,k);if(Be.isValid)return on.after(ee,Be)}else if(ge){const Be=It.fromISO(P,k);if(Be.isValid)return on.before(de,Be)}}return on.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static isInterval(g){return g&&g.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(g="milliseconds"){return this.isValid?this.toDuration(g).get(g):NaN}count(g="milliseconds",k){if(!this.isValid)return NaN;const P=this.start.startOf(g,k);let U;return k!=null&&k.useLocaleWeeks?U=this.end.reconfigure({locale:P.locale}):U=this.end,U=U.startOf(g,k),Math.floor(U.diff(P,g).get(g))+(U.valueOf()!==this.end.valueOf())}hasSame(g){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,g):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(g){return this.isValid?this.s>g:!1}isBefore(g){return this.isValid?this.e<=g:!1}contains(g){return this.isValid?this.s<=g&&this.e>g:!1}set({start:g,end:k}={}){return this.isValid?on.fromDateTimes(g||this.s,k||this.e):this}splitAt(...g){if(!this.isValid)return[];const k=g.map(zs).filter(ce=>this.contains(ce)).sort((ce,de)=>ce.toMillis()-de.toMillis()),P=[];let{s:U}=this,ee=0;for(;U<this.e;){const ce=k[ee]||this.e,de=+ce>+this.e?this.e:ce;P.push(on.fromDateTimes(U,de)),U=de,ee+=1}return P}splitBy(g){const k=It.fromDurationLike(g);if(!this.isValid||!k.isValid||k.as("milliseconds")===0)return[];let{s:P}=this,U=1,ee;const ce=[];for(;P<this.e;){const de=this.start.plus(k.mapUnits(ge=>ge*U));ee=+de>+this.e?this.e:de,ce.push(on.fromDateTimes(P,ee)),P=ee,U+=1}return ce}divideEqually(g){return this.isValid?this.splitBy(this.length()/g).slice(0,g):[]}overlaps(g){return this.e>g.s&&this.s<g.e}abutsStart(g){return this.isValid?+this.e==+g.s:!1}abutsEnd(g){return this.isValid?+g.e==+this.s:!1}engulfs(g){return this.isValid?this.s<=g.s&&this.e>=g.e:!1}equals(g){return!this.isValid||!g.isValid?!1:this.s.equals(g.s)&&this.e.equals(g.e)}intersection(g){if(!this.isValid)return this;const k=this.s>g.s?this.s:g.s,P=this.e<g.e?this.e:g.e;return k>=P?null:on.fromDateTimes(k,P)}union(g){if(!this.isValid)return this;const k=this.s<g.s?this.s:g.s,P=this.e>g.e?this.e:g.e;return on.fromDateTimes(k,P)}static merge(g){const[k,P]=g.sort((U,ee)=>U.s-ee.s).reduce(([U,ee],ce)=>ee?ee.overlaps(ce)||ee.abutsStart(ce)?[U,ee.union(ce)]:[U.concat([ee]),ce]:[U,ce],[[],null]);return P&&k.push(P),k}static xor(g){let k=null,P=0;const U=[],ee=g.map(ge=>[{time:ge.s,type:"s"},{time:ge.e,type:"e"}]),ce=Array.prototype.concat(...ee),de=ce.sort((ge,Be)=>ge.time-Be.time);for(const ge of de)P+=ge.type==="s"?1:-1,P===1?k=ge.time:(k&&+k!=+ge.time&&U.push(on.fromDateTimes(k,ge.time)),k=null);return on.merge(U)}difference(...g){return on.xor([this].concat(g)).map(k=>this.intersection(k)).filter(k=>k&&!k.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Fi}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(g=f,k={}){return this.isValid?Dn.create(this.s.loc.clone(k),g).formatInterval(this):Fi}toISO(g){return this.isValid?`${this.s.toISO(g)}/${this.e.toISO(g)}`:Fi}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Fi}toISOTime(g){return this.isValid?`${this.s.toISOTime(g)}/${this.e.toISOTime(g)}`:Fi}toFormat(g,{separator:k=" – "}={}){return this.isValid?`${this.s.toFormat(g)}${k}${this.e.toFormat(g)}`:Fi}toDuration(g,k){return this.isValid?this.e.diff(this.s,g,k):It.invalid(this.invalidReason)}mapEndpoints(g){return on.fromDateTimes(g(this.s),g(this.e))}}class js{static hasDST(g=Pt.defaultZone){const k=at.now().setZone(g).set({month:12});return!g.isUniversal&&k.offset!==k.set({month:6}).offset}static isValidIANAZone(g){return Q.isValidZone(g)}static normalizeZone(g){return be(g,Pt.defaultZone)}static getStartOfWeek({locale:g=null,locObj:k=null}={}){return(k||Re.create(g)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:g=null,locObj:k=null}={}){return(k||Re.create(g)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:g=null,locObj:k=null}={}){return(k||Re.create(g)).getWeekendDays().slice()}static months(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null,outputCalendar:ee="gregory"}={}){return(U||Re.create(k,P,ee)).months(g)}static monthsFormat(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null,outputCalendar:ee="gregory"}={}){return(U||Re.create(k,P,ee)).months(g,!0)}static weekdays(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null}={}){return(U||Re.create(k,P,null)).weekdays(g)}static weekdaysFormat(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null}={}){return(U||Re.create(k,P,null)).weekdays(g,!0)}static meridiems({locale:g=null}={}){return Re.create(g).meridiems()}static eras(g="short",{locale:k=null}={}){return Re.create(k,null,"gregory").eras(g)}static features(){return{relative:Ps(),localeWeek:Rs()}}}function $h(A,g){const k=U=>U.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),P=k(g)-k(A);return Math.floor(It.fromMillis(P).as("days"))}function kv(A,g,k){const P=[["years",(ge,Be)=>Be.year-ge.year],["quarters",(ge,Be)=>Be.quarter-ge.quarter+(Be.year-ge.year)*4],["months",(ge,Be)=>Be.month-ge.month+(Be.year-ge.year)*12],["weeks",(ge,Be)=>{const et=$h(ge,Be);return(et-et%7)/7}],["days",$h]],U={},ee=A;let ce,de;for(const[ge,Be]of P)k.indexOf(ge)>=0&&(ce=ge,U[ge]=Be(A,g),de=ee.plus(U),de>g?(U[ge]--,A=ee.plus(U),A>g&&(de=A,U[ge]--,A=ee.plus(U))):A=de);return[A,U,de,ce]}function wv(A,g,k,P){let[U,ee,ce,de]=kv(A,g,k);const ge=g-U,Be=k.filter(pt=>["hours","minutes","seconds","milliseconds"].indexOf(pt)>=0);Be.length===0&&(ce<g&&(ce=U.plus({[de]:1})),ce!==U&&(ee[de]=(ee[de]||0)+ge/(ce-U)));const et=It.fromObject(ee,P);return Be.length>0?It.fromMillis(ge,P).shiftTo(...Be).plus(et):et}const Dv="missing Intl.DateTimeFormat.formatToParts support";function Rt(A,g=k=>k){return{regex:A,deser:([k])=>g(st(k))}}const Hh="[  ]",zh=new RegExp(Hh,"g");function Iv(A){return A.replace(/\./g,"\\.?").replace(zh,Hh)}function Uh(A){return A.replace(/\./g,"").replace(zh," ").toLowerCase()}function Or(A,g){return A===null?null:{regex:RegExp(A.map(Iv).join("|")),deser:([k])=>A.findIndex(P=>Uh(k)===Uh(P))+g}}function Vh(A,g){return{regex:A,deser:([,k,P])=>Ml(k,P),groups:g}}function Nl(A){return{regex:A,deser:([g])=>g}}function Av(A){return A.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ov(A,g){const k=bt(g),P=bt(g,"{2}"),U=bt(g,"{3}"),ee=bt(g,"{4}"),ce=bt(g,"{6}"),de=bt(g,"{1,2}"),ge=bt(g,"{1,3}"),Be=bt(g,"{1,6}"),et=bt(g,"{1,9}"),pt=bt(g,"{2,4}"),Ut=bt(g,"{4,6}"),it=Hr=>({regex:RegExp(Av(Hr.val)),deser:([_i])=>_i,literal:!0}),Mr=(Hr=>{if(A.literal)return it(Hr);switch(Hr.val){case"G":return Or(g.eras("short"),0);case"GG":return Or(g.eras("long"),0);case"y":return Rt(Be);case"yy":return Rt(pt,$c);case"yyyy":return Rt(ee);case"yyyyy":return Rt(Ut);case"yyyyyy":return Rt(ce);case"M":return Rt(de);case"MM":return Rt(P);case"MMM":return Or(g.months("short",!0),1);case"MMMM":return Or(g.months("long",!0),1);case"L":return Rt(de);case"LL":return Rt(P);case"LLL":return Or(g.months("short",!1),1);case"LLLL":return Or(g.months("long",!1),1);case"d":return Rt(de);case"dd":return Rt(P);case"o":return Rt(ge);case"ooo":return Rt(U);case"HH":return Rt(P);case"H":return Rt(de);case"hh":return Rt(P);case"h":return Rt(de);case"mm":return Rt(P);case"m":return Rt(de);case"q":return Rt(de);case"qq":return Rt(P);case"s":return Rt(de);case"ss":return Rt(P);case"S":return Rt(ge);case"SSS":return Rt(U);case"u":return Nl(et);case"uu":return Nl(de);case"uuu":return Rt(k);case"a":return Or(g.meridiems(),0);case"kkkk":return Rt(ee);case"kk":return Rt(pt,$c);case"W":return Rt(de);case"WW":return Rt(P);case"E":case"c":return Rt(k);case"EEE":return Or(g.weekdays("short",!1),1);case"EEEE":return Or(g.weekdays("long",!1),1);case"ccc":return Or(g.weekdays("short",!0),1);case"cccc":return Or(g.weekdays("long",!0),1);case"Z":case"ZZ":return Vh(new RegExp(`([+-]${de.source})(?::(${P.source}))?`),2);case"ZZZ":return Vh(new RegExp(`([+-]${de.source})(${P.source})?`),2);case"z":return Nl(/[a-z_+-/]{1,256}?/i);case" ":return Nl(/[^\S\n\r]/);default:return it(Hr)}})(A)||{invalidReason:Dv};return Mr.token=A,Mr}const Mv={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Pv(A,g,k){const{type:P,value:U}=A;if(P==="literal"){const ge=/^\s+$/.test(U);return{literal:!ge,val:ge?" ":U}}const ee=g[P];let ce=P;P==="hour"&&(g.hour12!=null?ce=g.hour12?"hour12":"hour24":g.hourCycle!=null?g.hourCycle==="h11"||g.hourCycle==="h12"?ce="hour12":ce="hour24":ce=k.hour12?"hour12":"hour24");let de=Mv[ce];if(typeof de=="object"&&(de=de[ee]),de)return{literal:!1,val:de}}function Rv(A){return[`^${A.map(k=>k.regex).reduce((k,P)=>`${k}(${P.source})`,"")}$`,A]}function Nv(A,g,k){const P=A.match(g);if(P){const U={};let ee=1;for(const ce in k)if(Fn(k,ce)){const de=k[ce],ge=de.groups?de.groups+1:1;!de.literal&&de.token&&(U[de.token.val[0]]=de.deser(P.slice(ee,ee+ge))),ee+=ge}return[P,U]}else return[P,{}]}function Fv(A){const g=ee=>{switch(ee){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let k=null,P;return je(A.z)||(k=Q.create(A.z)),je(A.Z)||(k||(k=new lt(A.Z)),P=A.Z),je(A.q)||(A.M=(A.q-1)*3+1),je(A.h)||(A.h<12&&A.a===1?A.h+=12:A.h===12&&A.a===0&&(A.h=0)),A.G===0&&A.y&&(A.y=-A.y),je(A.u)||(A.S=Bc(A.u)),[Object.keys(A).reduce((ee,ce)=>{const de=g(ce);return de&&(ee[de]=A[ce]),ee},{}),k,P]}let Vc=null;function Lv(){return Vc||(Vc=at.fromMillis(1555555555555)),Vc}function _v(A,g){if(A.literal)return A;const k=Dn.macroTokenToFormatOpts(A.val),P=Kh(k,g);return P==null||P.includes(void 0)?A:P}function Wh(A,g){return Array.prototype.concat(...A.map(k=>_v(k,g)))}class qh{constructor(g,k){if(this.locale=g,this.format=k,this.tokens=Wh(Dn.parseFormat(k),g),this.units=this.tokens.map(P=>Ov(P,g)),this.disqualifyingUnit=this.units.find(P=>P.invalidReason),!this.disqualifyingUnit){const[P,U]=Rv(this.units);this.regex=RegExp(P,"i"),this.handlers=U}}explainFromTokens(g){if(this.isValid){const[k,P]=Nv(g,this.regex,this.handlers),[U,ee,ce]=P?Fv(P):[null,null,void 0];if(Fn(P,"a")&&Fn(P,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:g,tokens:this.tokens,regex:this.regex,rawMatches:k,matches:P,result:U,zone:ee,specificOffset:ce}}else return{input:g,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Yh(A,g,k){return new qh(A,k).explainFromTokens(g)}function Bv(A,g,k){const{result:P,zone:U,specificOffset:ee,invalidReason:ce}=Yh(A,g,k);return[P,U,ee,ce]}function Kh(A,g){if(!A)return null;const P=Dn.create(g,A).dtFormatter(Lv()),U=P.formatToParts(),ee=P.resolvedOptions();return U.map(ce=>Pv(ce,A,ee))}const Wc="Invalid DateTime",Gh=864e13;function $s(A){return new xn("unsupported zone",`the zone "${A.name}" is not supported`)}function qc(A){return A.weekData===null&&(A.weekData=rn(A.c)),A.weekData}function Yc(A){return A.localWeekData===null&&(A.localWeekData=rn(A.c,A.loc.getMinDaysInFirstWeek(),A.loc.getStartOfWeek())),A.localWeekData}function Wo(A,g){const k={ts:A.ts,zone:A.zone,c:A.c,o:A.o,loc:A.loc,invalid:A.invalid};return new at({...k,...g,old:k})}function Qh(A,g,k){let P=A-g*60*1e3;const U=k.offset(P);if(g===U)return[P,g];P-=(U-g)*60*1e3;const ee=k.offset(P);return U===ee?[P,U]:[A-Math.min(U,ee)*60*1e3,Math.max(U,ee)]}function Fl(A,g){A+=g*60*1e3;const k=new Date(A);return{year:k.getUTCFullYear(),month:k.getUTCMonth()+1,day:k.getUTCDate(),hour:k.getUTCHours(),minute:k.getUTCMinutes(),second:k.getUTCSeconds(),millisecond:k.getUTCMilliseconds()}}function Ll(A,g,k){return Qh(Ol(A),g,k)}function Xh(A,g){const k=A.o,P=A.c.year+Math.trunc(g.years),U=A.c.month+Math.trunc(g.months)+Math.trunc(g.quarters)*3,ee={...A.c,year:P,month:U,day:Math.min(A.c.day,Al(P,U))+Math.trunc(g.days)+Math.trunc(g.weeks)*7},ce=It.fromObject({years:g.years-Math.trunc(g.years),quarters:g.quarters-Math.trunc(g.quarters),months:g.months-Math.trunc(g.months),weeks:g.weeks-Math.trunc(g.weeks),days:g.days-Math.trunc(g.days),hours:g.hours,minutes:g.minutes,seconds:g.seconds,milliseconds:g.milliseconds}).as("milliseconds"),de=Ol(ee);let[ge,Be]=Qh(de,k,A.zone);return ce!==0&&(ge+=ce,Be=A.zone.offset(ge)),{ts:ge,o:Be}}function Li(A,g,k,P,U,ee){const{setZone:ce,zone:de}=k;if(A&&Object.keys(A).length!==0||g){const ge=g||de,Be=at.fromObject(A,{...k,zone:ge,specificOffset:ee});return ce?Be:Be.setZone(de)}else return at.invalid(new xn("unparsable",`the input "${U}" can't be parsed as ${P}`))}function _l(A,g,k=!0){return A.isValid?Dn.create(Re.create("en-US"),{allowZ:k,forceSimple:!0}).formatDateTimeFromString(A,g):null}function Kc(A,g,k){const P=A.c.year>9999||A.c.year<0;let U="";if(P&&A.c.year>=0&&(U+="+"),U+=dn(A.c.year,P?6:4),k==="year")return U;if(g){if(U+="-",U+=dn(A.c.month),k==="month")return U;U+="-"}else if(U+=dn(A.c.month),k==="month")return U;return U+=dn(A.c.day),U}function Zh(A,g,k,P,U,ee,ce){let de=!k||A.c.millisecond!==0||A.c.second!==0,ge="";switch(ce){case"day":case"month":case"year":break;default:if(ge+=dn(A.c.hour),ce==="hour")break;if(g){if(ge+=":",ge+=dn(A.c.minute),ce==="minute")break;de&&(ge+=":",ge+=dn(A.c.second))}else{if(ge+=dn(A.c.minute),ce==="minute")break;de&&(ge+=dn(A.c.second))}if(ce==="second")break;de&&(!P||A.c.millisecond!==0)&&(ge+=".",ge+=dn(A.c.millisecond,3))}return U&&(A.isOffsetFixed&&A.offset===0&&!ee?ge+="Z":A.o<0?(ge+="-",ge+=dn(Math.trunc(-A.o/60)),ge+=":",ge+=dn(Math.trunc(-A.o%60))):(ge+="+",ge+=dn(Math.trunc(A.o/60)),ge+=":",ge+=dn(Math.trunc(A.o%60)))),ee&&(ge+="["+A.zone.ianaName+"]"),ge}const Jh={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},jv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},$v={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Bl=["year","month","day","hour","minute","second","millisecond"],Hv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],zv=["year","ordinal","hour","minute","second","millisecond"];function jl(A){const g={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[A.toLowerCase()];if(!g)throw new i(A);return g}function em(A){switch(A.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return jl(A)}}function Uv(A){if(Hs===void 0&&(Hs=Pt.now()),A.type!=="iana")return A.offset(Hs);const g=A.name;let k=Gc.get(g);return k===void 0&&(k=A.offset(Hs),Gc.set(g,k)),k}function tm(A,g){const k=be(g.zone,Pt.defaultZone);if(!k.isValid)return at.invalid($s(k));const P=Re.fromObject(g);let U,ee;if(je(A.year))U=Pt.now();else{for(const ge of Bl)je(A[ge])&&(A[ge]=Jh[ge]);const ce=Ye(A)||rt(A);if(ce)return at.invalid(ce);const de=Uv(k);[U,ee]=Ll(A,de,k)}return new at({ts:U,zone:k,loc:P,o:ee})}function nm(A,g,k){const P=je(k.round)?!0:k.round,U=je(k.rounding)?"trunc":k.rounding,ee=(de,ge)=>(de=jc(de,P||k.calendary?0:2,k.calendary?"round":U),g.loc.clone(k).relFormatter(k).format(de,ge)),ce=de=>k.calendary?g.hasSame(A,de)?0:g.startOf(de).diff(A.startOf(de),de).get(de):g.diff(A,de).get(de);if(k.unit)return ee(ce(k.unit),k.unit);for(const de of k.units){const ge=ce(de);if(Math.abs(ge)>=1)return ee(ge,de)}return ee(A>g?-0:0,k.units[k.units.length-1])}function rm(A){let g={},k;return A.length>0&&typeof A[A.length-1]=="object"?(g=A[A.length-1],k=Array.from(A).slice(0,A.length-1)):k=Array.from(A),[g,k]}let Hs;const Gc=new Map;class at{constructor(g){const k=g.zone||Pt.defaultZone;let P=g.invalid||(Number.isNaN(g.ts)?new xn("invalid input"):null)||(k.isValid?null:$s(k));this.ts=je(g.ts)?Pt.now():g.ts;let U=null,ee=null;if(!P)if(g.old&&g.old.ts===this.ts&&g.old.zone.equals(k))[U,ee]=[g.old.c,g.old.o];else{const de=zt(g.o)&&!g.old?g.o:k.offset(this.ts);U=Fl(this.ts,de),P=Number.isNaN(U.year)?new xn("invalid input"):null,U=P?null:U,ee=P?null:de}this._zone=k,this.loc=g.loc||Re.create(),this.invalid=P,this.weekData=null,this.localWeekData=null,this.c=U,this.o=ee,this.isLuxonDateTime=!0}static now(){return new at({})}static local(){const[g,k]=rm(arguments),[P,U,ee,ce,de,ge,Be]=k;return tm({year:P,month:U,day:ee,hour:ce,minute:de,second:ge,millisecond:Be},g)}static utc(){const[g,k]=rm(arguments),[P,U,ee,ce,de,ge,Be]=k;return g.zone=lt.utcInstance,tm({year:P,month:U,day:ee,hour:ce,minute:de,second:ge,millisecond:Be},g)}static fromJSDate(g,k={}){const P=Di(g)?g.valueOf():NaN;if(Number.isNaN(P))return at.invalid("invalid input");const U=be(k.zone,Pt.defaultZone);return U.isValid?new at({ts:P,zone:U,loc:Re.fromObject(k)}):at.invalid($s(U))}static fromMillis(g,k={}){if(zt(g))return g<-Gh||g>Gh?at.invalid("Timestamp out of range"):new at({ts:g,zone:be(k.zone,Pt.defaultZone),loc:Re.fromObject(k)});throw new s(`fromMillis requires a numerical input, but received a ${typeof g} with value ${g}`)}static fromSeconds(g,k={}){if(zt(g))return new at({ts:g*1e3,zone:be(k.zone,Pt.defaultZone),loc:Re.fromObject(k)});throw new s("fromSeconds requires a numerical input")}static fromObject(g,k={}){g=g||{};const P=be(k.zone,Pt.defaultZone);if(!P.isValid)return at.invalid($s(P));const U=Re.fromObject(k),ee=Pl(g,em),{minDaysInFirstWeek:ce,startOfWeek:de}=zo(ee,U),ge=Pt.now(),Be=je(k.specificOffset)?P.offset(ge):k.specificOffset,et=!je(ee.ordinal),pt=!je(ee.year),Ut=!je(ee.month)||!je(ee.day),it=pt||Ut,fn=ee.weekYear||ee.weekNumber;if((it||et)&&fn)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(Ut&&et)throw new o("Can't mix ordinal dates with month/day");const Mr=fn||ee.weekday&&!it;let Hr,_i,Us=Fl(ge,Be);Mr?(Hr=Hv,_i=jv,Us=rn(Us,ce,de)):et?(Hr=zv,_i=$v,Us=Ho(Us)):(Hr=Bl,_i=Jh);let om=!1;for(const Ws of Hr){const Gv=ee[Ws];je(Gv)?om?ee[Ws]=_i[Ws]:ee[Ws]=Us[Ws]:om=!0}const Wv=Mr?ke(ee,ce,de):et?Te(ee):Ye(ee),im=Wv||rt(ee);if(im)return at.invalid(im);const qv=Mr?Ar(ee,ce,de):et?ko(ee):ee,[Yv,Kv]=Ll(qv,Be,P),Vs=new at({ts:Yv,zone:P,o:Kv,loc:U});return ee.weekday&&it&&g.weekday!==Vs.weekday?at.invalid("mismatched weekday",`you can't specify both a weekday of ${ee.weekday} and a date of ${Vs.toISO()}`):Vs.isValid?Vs:at.invalid(Vs.invalid)}static fromISO(g,k={}){const[P,U]=dv(g);return Li(P,U,k,"ISO 8601",g)}static fromRFC2822(g,k={}){const[P,U]=fv(g);return Li(P,U,k,"RFC 2822",g)}static fromHTTP(g,k={}){const[P,U]=pv(g);return Li(P,U,k,"HTTP",k)}static fromFormat(g,k,P={}){if(je(g)||je(k))throw new s("fromFormat requires an input string and a format");const{locale:U=null,numberingSystem:ee=null}=P,ce=Re.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0}),[de,ge,Be,et]=Bv(ce,g,k);return et?at.invalid(et):Li(de,ge,P,`format ${k}`,g,Be)}static fromString(g,k,P={}){return at.fromFormat(g,k,P)}static fromSQL(g,k={}){const[P,U]=Cv(g);return Li(P,U,k,"SQL",g)}static invalid(g,k=null){if(!g)throw new s("need to specify a reason the DateTime is invalid");const P=g instanceof xn?g:new xn(g,k);if(Pt.throwOnInvalid)throw new t(P);return new at({invalid:P})}static isDateTime(g){return g&&g.isLuxonDateTime||!1}static parseFormatForOpts(g,k={}){const P=Kh(g,Re.fromObject(k));return P?P.map(U=>U?U.val:null).join(""):null}static expandFormat(g,k={}){return Wh(Dn.parseFormat(g),Re.fromObject(k)).map(U=>U.val).join("")}static resetCache(){Hs=void 0,Gc.clear()}get(g){return this[g]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?qc(this).weekYear:NaN}get weekNumber(){return this.isValid?qc(this).weekNumber:NaN}get weekday(){return this.isValid?qc(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Yc(this).weekday:NaN}get localWeekNumber(){return this.isValid?Yc(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Yc(this).weekYear:NaN}get ordinal(){return this.isValid?Ho(this.c).ordinal:NaN}get monthShort(){return this.isValid?js.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?js.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?js.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?js.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const g=864e5,k=6e4,P=Ol(this.c),U=this.zone.offset(P-g),ee=this.zone.offset(P+g),ce=this.zone.offset(P-U*k),de=this.zone.offset(P-ee*k);if(ce===de)return[this];const ge=P-ce*k,Be=P-de*k,et=Fl(ge,ce),pt=Fl(Be,de);return et.hour===pt.hour&&et.minute===pt.minute&&et.second===pt.second&&et.millisecond===pt.millisecond?[Wo(this,{ts:ge}),Wo(this,{ts:Be})]:[this]}get isInLeapYear(){return Ns(this.year)}get daysInMonth(){return Al(this.year,this.month)}get daysInYear(){return this.isValid?Ii(this.year):NaN}get weeksInWeekYear(){return this.isValid?Fs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Fs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(g={}){const{locale:k,numberingSystem:P,calendar:U}=Dn.create(this.loc.clone(g),g).resolvedOptions(this);return{locale:k,numberingSystem:P,outputCalendar:U}}toUTC(g=0,k={}){return this.setZone(lt.instance(g),k)}toLocal(){return this.setZone(Pt.defaultZone)}setZone(g,{keepLocalTime:k=!1,keepCalendarTime:P=!1}={}){if(g=be(g,Pt.defaultZone),g.equals(this.zone))return this;if(g.isValid){let U=this.ts;if(k||P){const ee=g.offset(this.ts),ce=this.toObject();[U]=Ll(ce,ee,g)}return Wo(this,{ts:U,zone:g})}else return at.invalid($s(g))}reconfigure({locale:g,numberingSystem:k,outputCalendar:P}={}){const U=this.loc.clone({locale:g,numberingSystem:k,outputCalendar:P});return Wo(this,{loc:U})}setLocale(g){return this.reconfigure({locale:g})}set(g){if(!this.isValid)return this;const k=Pl(g,em),{minDaysInFirstWeek:P,startOfWeek:U}=zo(k,this.loc),ee=!je(k.weekYear)||!je(k.weekNumber)||!je(k.weekday),ce=!je(k.ordinal),de=!je(k.year),ge=!je(k.month)||!je(k.day),Be=de||ge,et=k.weekYear||k.weekNumber;if((Be||ce)&&et)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(ge&&ce)throw new o("Can't mix ordinal dates with month/day");let pt;ee?pt=Ar({...rn(this.c,P,U),...k},P,U):je(k.ordinal)?(pt={...this.toObject(),...k},je(k.day)&&(pt.day=Math.min(Al(pt.year,pt.month),pt.day))):pt=ko({...Ho(this.c),...k});const[Ut,it]=Ll(pt,this.o,this.zone);return Wo(this,{ts:Ut,o:it})}plus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g);return Wo(this,Xh(this,k))}minus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g).negate();return Wo(this,Xh(this,k))}startOf(g,{useLocaleWeeks:k=!1}={}){if(!this.isValid)return this;const P={},U=It.normalizeUnit(g);switch(U){case"years":P.month=1;case"quarters":case"months":P.day=1;case"weeks":case"days":P.hour=0;case"hours":P.minute=0;case"minutes":P.second=0;case"seconds":P.millisecond=0;break}if(U==="weeks")if(k){const ee=this.loc.getStartOfWeek(),{weekday:ce}=this;ce<ee&&(P.weekNumber=this.weekNumber-1),P.weekday=ee}else P.weekday=1;if(U==="quarters"){const ee=Math.ceil(this.month/3);P.month=(ee-1)*3+1}return this.set(P)}endOf(g,k){return this.isValid?this.plus({[g]:1}).startOf(g,k).minus(1):this}toFormat(g,k={}){return this.isValid?Dn.create(this.loc.redefaultToEN(k)).formatDateTimeFromString(this,g):Wc}toLocaleString(g=f,k={}){return this.isValid?Dn.create(this.loc.clone(k),g).formatDateTime(this):Wc}toLocaleParts(g={}){return this.isValid?Dn.create(this.loc.clone(g),g).formatDateTimeParts(this):[]}toISO({format:g="extended",suppressSeconds:k=!1,suppressMilliseconds:P=!1,includeOffset:U=!0,extendedZone:ee=!1,precision:ce="milliseconds"}={}){if(!this.isValid)return null;ce=jl(ce);const de=g==="extended";let ge=Kc(this,de,ce);return Bl.indexOf(ce)>=3&&(ge+="T"),ge+=Zh(this,de,k,P,U,ee,ce),ge}toISODate({format:g="extended",precision:k="day"}={}){return this.isValid?Kc(this,g==="extended",jl(k)):null}toISOWeekDate(){return _l(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:g=!1,suppressSeconds:k=!1,includeOffset:P=!0,includePrefix:U=!1,extendedZone:ee=!1,format:ce="extended",precision:de="milliseconds"}={}){return this.isValid?(de=jl(de),(U&&Bl.indexOf(de)>=3?"T":"")+Zh(this,ce==="extended",k,g,P,ee,de)):null}toRFC2822(){return _l(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return _l(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Kc(this,!0):null}toSQLTime({includeOffset:g=!0,includeZone:k=!1,includeOffsetSpace:P=!0}={}){let U="HH:mm:ss.SSS";return(k||g)&&(P&&(U+=" "),k?U+="z":g&&(U+="ZZ")),_l(this,U,!0)}toSQL(g={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(g)}`:null}toString(){return this.isValid?this.toISO():Wc}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(g={}){if(!this.isValid)return{};const k={...this.c};return g.includeConfig&&(k.outputCalendar=this.outputCalendar,k.numberingSystem=this.loc.numberingSystem,k.locale=this.loc.locale),k}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(g,k="milliseconds",P={}){if(!this.isValid||!g.isValid)return It.invalid("created by diffing an invalid DateTime");const U={locale:this.locale,numberingSystem:this.numberingSystem,...P},ee=Il(k).map(It.normalizeUnit),ce=g.valueOf()>this.valueOf(),de=ce?this:g,ge=ce?g:this,Be=wv(de,ge,ee,U);return ce?Be.negate():Be}diffNow(g="milliseconds",k={}){return this.diff(at.now(),g,k)}until(g){return this.isValid?on.fromDateTimes(this,g):this}hasSame(g,k,P){if(!this.isValid)return!1;const U=g.valueOf(),ee=this.setZone(g.zone,{keepLocalTime:!0});return ee.startOf(k,P)<=U&&U<=ee.endOf(k,P)}equals(g){return this.isValid&&g.isValid&&this.valueOf()===g.valueOf()&&this.zone.equals(g.zone)&&this.loc.equals(g.loc)}toRelative(g={}){if(!this.isValid)return null;const k=g.base||at.fromObject({},{zone:this.zone}),P=g.padding?this<k?-g.padding:g.padding:0;let U=["years","months","days","hours","minutes","seconds"],ee=g.unit;return Array.isArray(g.unit)&&(U=g.unit,ee=void 0),nm(k,this.plus(P),{...g,numeric:"always",units:U,unit:ee})}toRelativeCalendar(g={}){return this.isValid?nm(g.base||at.fromObject({},{zone:this.zone}),this,{...g,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...g){if(!g.every(at.isDateTime))throw new s("min requires all arguments be DateTimes");return wt(g,k=>k.valueOf(),Math.min)}static max(...g){if(!g.every(at.isDateTime))throw new s("max requires all arguments be DateTimes");return wt(g,k=>k.valueOf(),Math.max)}static fromFormatExplain(g,k,P={}){const{locale:U=null,numberingSystem:ee=null}=P,ce=Re.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0});return Yh(ce,g,k)}static fromStringExplain(g,k,P={}){return at.fromFormatExplain(g,k,P)}static buildFormatParser(g,k={}){const{locale:P=null,numberingSystem:U=null}=k,ee=Re.fromOpts({locale:P,numberingSystem:U,defaultToEN:!0});return new qh(ee,g)}static fromFormatParser(g,k,P={}){if(je(g)||je(k))throw new s("fromFormatParser requires an input string and a format parser");const{locale:U=null,numberingSystem:ee=null}=P,ce=Re.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0});if(!ce.equals(k.locale))throw new s(`fromFormatParser called with a locale of ${ce}, but the format parser was created for ${k.locale}`);const{result:de,zone:ge,specificOffset:Be,invalidReason:et}=k.explainFromTokens(g);return et?at.invalid(et):Li(de,ge,P,`format ${k.format}`,g,Be)}static get DATE_SHORT(){return f}static get DATE_MED(){return h}static get DATE_MED_WITH_WEEKDAY(){return p}static get DATE_FULL(){return m}static get DATE_HUGE(){return b}static get TIME_SIMPLE(){return y}static get TIME_WITH_SECONDS(){return x}static get TIME_WITH_SHORT_OFFSET(){return C}static get TIME_WITH_LONG_OFFSET(){return v}static get TIME_24_SIMPLE(){return S}static get TIME_24_WITH_SECONDS(){return I}static get TIME_24_WITH_SHORT_OFFSET(){return T}static get TIME_24_WITH_LONG_OFFSET(){return N}static get DATETIME_SHORT(){return O}static get DATETIME_SHORT_WITH_SECONDS(){return F}static get DATETIME_MED(){return B}static get DATETIME_MED_WITH_SECONDS(){return j}static get DATETIME_MED_WITH_WEEKDAY(){return D}static get DATETIME_FULL(){return H}static get DATETIME_FULL_WITH_SECONDS(){return _}static get DATETIME_HUGE(){return L}static get DATETIME_HUGE_WITH_SECONDS(){return $}}function zs(A){if(at.isDateTime(A))return A;if(A&&A.valueOf&&zt(A.valueOf()))return at.fromJSDate(A);if(A&&typeof A=="object")return at.fromObject(A);throw new s(`Unknown datetime argument: ${A}, of type ${typeof A}`)}const Vv="3.7.2";return Un.DateTime=at,Un.Duration=It,Un.FixedOffsetZone=lt,Un.IANAZone=Q,Un.Info=js,Un.Interval=on,Un.InvalidZone=Mt,Un.Settings=Pt,Un.SystemZone=q,Un.VERSION=Vv,Un.Zone=K,Un}var Rg;function Fp(){return Rg||(Rg=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;const t=X8();var n;(function(i){i.Second="Second",i.Minute="Minute",i.Hour="Hour",i.Day="Day",i.Month="Month",i.Year="Year"})(n||(e.TimeUnit=n={}));var r;(function(i){i.Add="Add",i.Subtract="Subtract"})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);class o{#e;#n=null;#i=null;constructor(s,a){const l={zone:a};if(s?s instanceof o?(this.#e=s.#e,this.#n=s.#n,this.#i=s.#i):s instanceof Date?this.#e=t.DateTime.fromJSDate(s,l):typeof s=="number"?this.#e=t.DateTime.fromMillis(s,l):(this.#e=t.DateTime.fromISO(s,l),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(s,l)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(s,l)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(s,"EEE, d MMM yyyy HH:mm:ss",l))):this.#e=t.DateTime.local(),!this.#e.isValid)throw new Error(`CronDate: unhandled timestamp: ${s}`);a&&a!==this.#e.zoneName&&(this.#e=this.#e.setZone(a))}static#o(s){return s%4===0&&s%100!==0||s%400===0}get dstStart(){return this.#n}set dstStart(s){this.#n=s}get dstEnd(){return this.#i}set dstEnd(s){this.#i=s}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf("month")}addDay(){this.#e=this.#e.plus({days:1}).startOf("day")}addHour(){this.#e=this.#e.plus({hours:1}).startOf("hour")}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf("minute")}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#e=this.#e.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(s){switch(s){case n.Year:return this.addYear();case n.Month:return this.addMonth();case n.Day:return this.addDay();case n.Hour:return this.addHour();case n.Minute:return this.addMinute();case n.Second:return this.addSecond()}}subtractUnit(s){switch(s){case n.Year:return this.subtractYear();case n.Month:return this.subtractMonth();case n.Day:return this.subtractDay();case n.Hour:return this.subtractHour();case n.Minute:return this.subtractMinute();case n.Second:return this.subtractSecond()}}invokeDateOperation(s,a){if(s===r.Add){this.addUnit(a);return}if(s===r.Subtract){this.subtractUnit(a);return}throw new Error(`Invalid verb: ${s}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){const s=this.#e.weekday;return s===7?0:s}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf("day")}setEndOfDay(){this.#e=this.#e.endOf("day")}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#r().day}getUTCFullYear(){return this.#r().year}getUTCDay(){const s=this.#r().weekday;return s===7?0:s}getUTCMonth(){return this.#r().month-1}getUTCHours(){return this.#r().hour}getUTCMinutes(){return this.#r().minute}getUTCSeconds(){return this.#r().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(s){this.#e=this.#e.set({day:s})}setFullYear(s){this.#e=this.#e.set({year:s})}setDay(s){this.#e=this.#e.set({weekday:s})}setMonth(s){this.#e=this.#e.set({month:s+1})}setHours(s){this.#e=this.#e.set({hour:s})}setMinutes(s){this.#e=this.#e.set({minute:s})}setSeconds(s){this.#e=this.#e.set({second:s})}setMilliseconds(s){this.#e=this.#e.set({millisecond:s})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){const{day:s,month:a}=this.#e;if(a===2){const l=o.#o(this.#e.year);return s===e.DAYS_IN_MONTH[a-1]-(l?0:1)}return s===e.DAYS_IN_MONTH[a-1]}isLastWeekdayOfMonth(){const{day:s,month:a}=this.#e;let l;return a===2?l=e.DAYS_IN_MONTH[a-1]-(o.#o(this.#e.year)?0:1):l=e.DAYS_IN_MONTH[a-1],s>l-7}applyDateOperation(s,a,l){if(a===n.Month||a===n.Day){this.invokeDateOperation(s,a);return}const u=this.getHours();this.invokeDateOperation(s,a);const d=this.getHours(),f=d-u;f===2?l!==24&&(this.dstStart=u+1):f===0&&this.getMinutes()===0&&this.getSeconds()===0&&l!==24&&(this.dstEnd=d)}#r(){return this.#e.toUTC()}}e.CronDate=o,e.default=o})(Ld)),Ld}var Ng;function Z8(){if(Ng)return ca;Ng=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.CronMonth=void 0;const e=Fp(),t=vi(),n=1,r=12,o=Object.freeze([]);let i=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return o}static get daysInMonth(){return e.DAYS_IN_MONTH}constructor(a,l){super(a,l),this.validate()}get values(){return super.values}};return ca.CronMonth=i,ca}var da={},Fg;function J8(){if(Fg)return da;Fg=1,Object.defineProperty(da,"__esModule",{value:!0}),da.CronSecond=void 0;const e=vi(),t=0,n=59,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return da.CronSecond=o,da}var Lg;function Lp(){return Lg||(Lg=1,(function(e){var t=Qo&&Qo.__createBinding||(Object.create?(function(r,o,i,s){s===void 0&&(s=i);var a=Object.getOwnPropertyDescriptor(o,i);(!a||("get"in a?!o.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return o[i]}}),Object.defineProperty(r,s,a)}):(function(r,o,i,s){s===void 0&&(s=i),r[s]=o[i]})),n=Qo&&Qo.__exportStar||function(r,o){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(o,i)&&t(o,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(q8(),e),n(Y8(),e),n(K8(),e),n(vi(),e),n(G8(),e),n(Q8(),e),n(Z8(),e),n(J8(),e)})(Qo)),Qo}var _g;function x2(){if(_g)return oa;_g=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.CronFieldCollection=void 0;const e=Lp();let t=class Aa{#e;#n;#i;#o;#r;#t;static from(r,o){return new Aa({second:this.resolveField(e.CronSecond,r.second,o.second),minute:this.resolveField(e.CronMinute,r.minute,o.minute),hour:this.resolveField(e.CronHour,r.hour,o.hour),dayOfMonth:this.resolveField(e.CronDayOfMonth,r.dayOfMonth,o.dayOfMonth),month:this.resolveField(e.CronMonth,r.month,o.month),dayOfWeek:this.resolveField(e.CronDayOfWeek,r.dayOfWeek,o.dayOfWeek)})}static resolveField(r,o,i){return i?i instanceof e.CronField?i:new r(i):o}constructor({second:r,minute:o,hour:i,dayOfMonth:s,month:a,dayOfWeek:l}){if(!r)throw new Error("Validation error, Field second is missing");if(!o)throw new Error("Validation error, Field minute is missing");if(!i)throw new Error("Validation error, Field hour is missing");if(!s)throw new Error("Validation error, Field dayOfMonth is missing");if(!a)throw new Error("Validation error, Field month is missing");if(!l)throw new Error("Validation error, Field dayOfWeek is missing");if(a.values.length===1&&!s.hasLastChar&&l.isWildcard&&!(parseInt(s.values[0],10)<=e.CronMonth.daysInMonth[a.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#e=r,this.#n=o,this.#i=i,this.#r=a,this.#t=l,this.#o=s}get second(){return this.#e}get minute(){return this.#n}get hour(){return this.#i}get dayOfMonth(){return this.#o}get month(){return this.#r}get dayOfWeek(){return this.#t}static compactField(r){if(r.length===0)return[];const o=[];let i;return r.forEach((s,a,l)=>{if(i===void 0){i={start:s,count:1};return}const u=l[a-1]||i.start,d=l[a+1];if(s==="L"||s==="W"){o.push(i),o.push({start:s,count:1}),i=void 0;return}if(i.step===void 0&&d!==void 0){const f=s-u,h=d-s;if(f<=h){i={...i,count:2,end:s,step:f};return}i.step=1}s-(i.end??0)===i.step?(i.count++,i.end=s):(i.count===1?o.push({start:i.start,count:1}):i.count===2?(o.push({start:i.start,count:1}),o.push({start:i.end??u,count:1})):o.push(i),i={start:s,count:1})}),i&&o.push(i),o}static#u(r,o,i){const s=o.step;return s?s===1&&o.start===r.min&&o.end&&o.end>=i?r.hasQuestionMarkChar?"?":"*":s!==1&&o.start===r.min&&o.end&&o.end>=i-s+1?`*/${s}`:null:null}static#l(r,o){const i=r.step;if(i===1)return`${r.start}-${r.end}`;const s=r.start===0?r.count-1:r.count;if(!i)throw new Error("Unexpected range step");if(!r.end)throw new Error("Unexpected range end");if(i*s>r.end){const a=(u,d)=>{if(typeof r.start!="number")throw new Error("Unexpected range start");return d%i===0?r.start+d:null};if(typeof r.start!="number")throw new Error("Unexpected range start");const l={length:r.end-r.start+1};return Array.from(l,a).filter(u=>u!==null).join(",")}return r.end===o-i+1?`${r.start}/${i}`:`${r.start}-${r.end}/${i}`}stringifyField(r){let o=r.max,i=r.values;if(r instanceof e.CronDayOfWeek){o=6;const a=this.#t.values;i=a[a.length-1]===7?a.slice(0,-1):a}r instanceof e.CronDayOfMonth&&(o=this.#r.values.length===1?e.CronMonth.daysInMonth[this.#r.values[0]-1]:r.max);const s=Aa.compactField(i);if(s.length===1){const a=Aa.#u(r,s[0],o);if(a)return a}return s.map(a=>{const l=a.count===1?a.start.toString():Aa.#l(a,o);return r instanceof e.CronDayOfWeek&&r.nthDay>0?`${l}#${r.nthDay}`:l}).join(",")}stringify(r=!1){const o=[];return r&&o.push(this.stringifyField(this.#e)),o.push(this.stringifyField(this.#n),this.stringifyField(this.#i),this.stringifyField(this.#o),this.stringifyField(this.#r),this.stringifyField(this.#t)),o.join(" ")}serialize(){return{second:this.#e.serialize(),minute:this.#n.serialize(),hour:this.#i.serialize(),dayOfMonth:this.#o.serialize(),month:this.#r.serialize(),dayOfWeek:this.#t.serialize()}}};return oa.CronFieldCollection=t,oa}var _d={},Bg;function C2(){return Bg||(Bg=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;const t=Fp();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range",e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";const n=1e4;class r{#e;#n;#i;#o;#r;#t;#u=null;#l=!1;constructor(i,s){this.#e=s,this.#n=s.tz,this.#o=s.startDate?new t.CronDate(s.startDate,this.#n):null,this.#r=s.endDate?new t.CronDate(s.endDate,this.#n):null;let a=s.currentDate??s.startDate;if(a){const l=new t.CronDate(a,this.#n);this.#o&&l.getTime()<this.#o.getTime()?a=this.#o:this.#r&&l.getTime()>this.#r.getTime()&&(a=this.#r)}this.#i=new t.CronDate(a,this.#n),this.#t=i}get fields(){return this.#t}static fieldsToExpression(i,s){return new r(i,s||{})}static#s(i,s){return s.some(a=>a===i)}#a(i,s){return i[s?i.length-1:0]}#d(i){const s=`${i.getFullYear()}-${i.getMonth()+1}-${i.getDate()}`;if(this.#u===s)return this.#l;const a=new t.CronDate(i);a.setStartOfDay();const l=new t.CronDate(i);return l.setEndOfDay(),this.#u=s,this.#l=a.getUTCOffset()!==l.getUTCOffset(),this.#l}#f(i,s,a){const l=this.#t.second.values,u=i.getSeconds(),d=this.#t.second.findNearestValue(u,a);if(d!==null){i.setSeconds(d);return}i.applyDateOperation(s,t.TimeUnit.Minute,this.#t.hour.values.length),i.setSeconds(this.#a(l,a))}#h(i,s,a){const l=this.#t.minute.values,u=this.#t.second.values,d=i.getMinutes(),f=this.#t.minute.findNearestValue(d,a);if(f!==null){i.setMinutes(f),i.setSeconds(this.#a(u,a));return}i.applyDateOperation(s,t.TimeUnit.Hour,this.#t.hour.values.length),i.setMinutes(this.#a(l,a)),i.setSeconds(this.#a(u,a))}static#m(i,s){const a=s.isLastWeekdayOfMonth();return i.some(l=>{const u=parseInt(l.toString().charAt(0),10)%7;if(Number.isNaN(u))throw new Error(`Invalid last weekday of the month expression: ${l}`);return s.getDay()===u&&a})}next(){return this.#c()}prev(){return this.#c(!0)}hasNext(){const i=this.#i;try{return this.#c(),!0}catch{return!1}finally{this.#i=i}}hasPrev(){const i=this.#i;try{return this.#c(!0),!0}catch{return!1}finally{this.#i=i}}take(i){const s=[];if(i>=0)for(let a=0;a<i;a++)try{s.push(this.next())}catch{return s}else for(let a=0;a>i;a--)try{s.push(this.prev())}catch{return s}return s}reset(i){this.#i=new t.CronDate(i||this.#e.currentDate,this.#n)}stringify(i=!1){return this.#t.stringify(i)}includesDate(i){const{second:s,minute:a,hour:l,month:u}=this.#t,d=new t.CronDate(i,this.#n);return!(!s.values.includes(d.getSeconds())||!a.values.includes(d.getMinutes())||!l.values.includes(d.getHours())||!u.values.includes(d.getMonth()+1)||!this.#p(d)||this.#t.dayOfWeek.nthDay>0&&Math.ceil(d.getDate()/7)!==this.#t.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#p(i){const s=this.#t.dayOfMonth.isWildcard,a=!s,l=this.#t.dayOfWeek.isWildcard,u=!l,d=r.#s(i.getDate(),this.#t.dayOfMonth.values)||this.#t.dayOfMonth.hasLastChar&&i.isLastDayOfMonth(),f=r.#s(i.getDay(),this.#t.dayOfWeek.values)||this.#t.dayOfWeek.hasLastChar&&r.#m(this.#t.dayOfWeek.values,i);return!!(a&&u&&(d||f)||d&&!u||s&&!l&&f)}#g(i,s,a){const l=this.#t.hour.values,u=l,d=i.getHours(),f=r.#s(d,l),h=i.dstEnd===d;if(i.dstStart!==null&&i.dstStart===d-1&&r.#s(i.dstStart,l))return!0;if(h&&!a)return i.dstEnd=null,i.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,u.length),!1;if(f)return!0;i.dstStart=null;const p=this.#t.hour.findNearestValue(d,a);if(p===null)return i.applyDateOperation(s,t.TimeUnit.Day,u.length),!1;if(this.#d(i)){const m=a?d-p:p-d;for(let b=0;b<m&&(i.applyDateOperation(s,t.TimeUnit.Hour,u.length),!(!a&&i.getHours()>=p||a&&i.getHours()<=p));b++);}else i.setHours(p);return i.setMinutes(this.#a(this.#t.minute.values,a)),i.setSeconds(this.#a(this.#t.second.values,a)),!1}#b(i){if(!this.#o&&!this.#r)return;const s=i.getTime();if(this.#o&&s<this.#o.getTime())throw new Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(this.#r&&s>this.#r.getTime())throw new Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#c(i=!1){const s=i?t.DateMathOp.Subtract:t.DateMathOp.Add,a=new t.CronDate(this.#i),l=a.getTime();let u=0;for(;++u<n;){if(this.#b(a),!this.#p(a)){a.applyDateOperation(s,t.TimeUnit.Day,this.#t.hour.values.length);continue}if(!(this.#t.dayOfWeek.nthDay<=0||Math.ceil(a.getDate()/7)===this.#t.dayOfWeek.nthDay)){a.applyDateOperation(s,t.TimeUnit.Day,this.#t.hour.values.length);continue}if(!r.#s(a.getMonth()+1,this.#t.month.values)){a.applyDateOperation(s,t.TimeUnit.Month,this.#t.hour.values.length);continue}if(this.#g(a,s,i)){if(!r.#s(a.getMinutes(),this.#t.minute.values)){this.#h(a,s,i);continue}if(!r.#s(a.getSeconds(),this.#t.second.values)){this.#f(a,s,i);continue}if(l===a.getTime()){(s==="Add"||a.getMilliseconds()===0)&&a.applyDateOperation(s,t.TimeUnit.Second,this.#t.hour.values.length);continue}break}}if(u>n)throw new Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return a.getMilliseconds()!==0&&a.setMilliseconds(0),this.#i=a,a}[Symbol.iterator](){return{next:()=>{try{return{value:this.#c(),done:!1}}catch{return{value:void 0,done:!0}}}}}}e.CronExpression=r,e.default=r})(_d)),_d}var Xl={},jg;function eL(){if(jg)return Xl;jg=1,Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.seededRandom=n;function e(r){let o=2166136261;for(let i=0;i<r.length;i++)o^=r.charCodeAt(i),o=Math.imul(o,16777619);return()=>o>>>0}function t(r){return()=>{let o=r+=1831565813;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}function n(r){const o=r?e(r)():Math.floor(Math.random()*1e10);return t(o)}return Xl}var $g;function Of(){if($g)return Xn;$g=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.CronExpressionParser=Xn.DayOfWeek=Xn.Months=Xn.CronUnit=Xn.PredefinedExpressions=void 0;const e=x2(),t=C2(),n=eL(),r=Lp();var o;(function(u){u["@yearly"]="0 0 0 1 1 *",u["@annually"]="0 0 0 1 1 *",u["@monthly"]="0 0 0 1 * *",u["@weekly"]="0 0 0 * * 0",u["@daily"]="0 0 0 * * *",u["@hourly"]="0 0 * * * *",u["@minutely"]="0 * * * * *",u["@secondly"]="* * * * * *",u["@weekdays"]="0 0 0 * * 1-5",u["@weekends"]="0 0 0 * * 0,6"})(o||(Xn.PredefinedExpressions=o={}));var i;(function(u){u.Second="Second",u.Minute="Minute",u.Hour="Hour",u.DayOfMonth="DayOfMonth",u.Month="Month",u.DayOfWeek="DayOfWeek"})(i||(Xn.CronUnit=i={}));var s;(function(u){u[u.jan=1]="jan",u[u.feb=2]="feb",u[u.mar=3]="mar",u[u.apr=4]="apr",u[u.may=5]="may",u[u.jun=6]="jun",u[u.jul=7]="jul",u[u.aug=8]="aug",u[u.sep=9]="sep",u[u.oct=10]="oct",u[u.nov=11]="nov",u[u.dec=12]="dec"})(s||(Xn.Months=s={}));var a;(function(u){u[u.sun=0]="sun",u[u.mon=1]="mon",u[u.tue=2]="tue",u[u.wed=3]="wed",u[u.thu=4]="thu",u[u.fri=5]="fri",u[u.sat=6]="sat"})(a||(Xn.DayOfWeek=a={}));let l=class er{static parse(d,f={}){const{strict:h=!1,hashSeed:p}=f,m=(0,n.seededRandom)(p);d=o[d]||d;const b=er.#e(d,h);if(!(b.dayOfMonth==="*"||b.dayOfWeek==="*"||!h))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const y=er.#n(i.Second,b.second,r.CronSecond.constraints,m),x=er.#n(i.Minute,b.minute,r.CronMinute.constraints,m),C=er.#n(i.Hour,b.hour,r.CronHour.constraints,m),v=er.#n(i.Month,b.month,r.CronMonth.constraints,m),S=er.#n(i.DayOfMonth,b.dayOfMonth,r.CronDayOfMonth.constraints,m),{dayOfWeek:I,nthDayOfWeek:T}=er.#d(b.dayOfWeek),N=er.#n(i.DayOfWeek,I,r.CronDayOfWeek.constraints,m),O=new e.CronFieldCollection({second:new r.CronSecond(y,{rawValue:b.second}),minute:new r.CronMinute(x,{rawValue:b.minute}),hour:new r.CronHour(C,{rawValue:b.hour}),dayOfMonth:new r.CronDayOfMonth(S,{rawValue:b.dayOfMonth}),month:new r.CronMonth(v,{rawValue:b.month}),dayOfWeek:new r.CronDayOfWeek(N,{rawValue:b.dayOfWeek,nthDayOfWeek:T})});return new t.CronExpression(O,{...f,expression:d})}static#e(d,f){if(f&&!d.length)throw new Error("Invalid cron expression");d=d||"0 * * * * *";const h=d.trim().split(/\s+/);if(f&&h.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(h.length>6)throw new Error("Invalid cron expression, too many fields");const p=["*","*","*","*","*","0"];h.length<p.length&&h.unshift(...p.slice(h.length));const[m,b,y,x,C,v]=h;return{second:m,minute:b,hour:y,dayOfMonth:x,month:C,dayOfWeek:v}}static#n(d,f,h,p){if((d===i.Month||d===i.DayOfWeek)&&(f=f.replace(/[a-z]{3}/gi,m=>{m=m.toLowerCase();const b=s[m]||a[m];if(b===void 0)throw new Error(`Validation error, cannot resolve alias "${m}"`);return b.toString()})),!h.validChars.test(f))throw new Error(`Invalid characters, got value: ${f}`);return f=this.#i(f,h),f=this.#o(f,h,p),this.#r(d,f,h)}static#i(d,f){return d.replace(/[*?]/g,f.min+"-"+f.max)}static#o(d,f,h){const p=h();return d.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(m,b,y,x)=>{if(b&&y&&x){const C=parseInt(b,10),v=parseInt(y,10),S=parseInt(x,10);if(C>v)throw new Error(`Invalid range: ${C}-${v}, min > max`);if(S<=0)throw new Error(`Invalid step: ${S}, must be positive`);const I=Math.max(C,f.min),T=Math.floor(p*S),N=[];for(let O=Math.floor(I/S)*S+T;O<=v;O+=S)O>=I&&N.push(O);return N.join(",")}else if(b&&y){const C=parseInt(b,10),v=parseInt(y,10);if(C>v)throw new Error(`Invalid range: ${C}-${v}, min > max`);return String(Math.floor(p*(v-C+1))+C)}else if(x){const C=parseInt(x,10);if(C<=0)throw new Error(`Invalid step: ${C}, must be positive`);const v=Math.floor(p*C),S=[];for(let I=Math.floor(f.min/C)*C+v;I<=f.max;I+=C)I>=f.min&&S.push(I);return S.join(",")}else return String(Math.floor(p*(f.max-f.min+1)+f.min))})}static#r(d,f,h){const p=[];function m(y,x){if(Array.isArray(y))p.push(...y);else if(er.#f(x,y))p.push(y);else{const C=parseInt(y.toString(),10);if(!(C>=x.min&&C<=x.max))throw new Error(`Constraint error, got value ${y} expected range ${x.min}-${x.max}`);p.push(d===i.DayOfWeek?C%7:y)}}return f.split(",").forEach(y=>{if(!(y.length>0))throw new Error("Invalid list value format");m(er.#t(d,y,h),h)}),p}static#t(d,f,h){const p=f.split("/");if(p.length>2)throw new Error(`Invalid repeat: ${f}`);return p.length===2?(p[0].includes("-")||(p[0]=`${p[0]}-${h.max}`),er.#a(d,p[0],parseInt(p[1],10),h)):er.#a(d,f,1,h)}static#u(d,f,h){if(!(!isNaN(d)&&!isNaN(f)&&d>=h.min&&f<=h.max))throw new Error(`Constraint error, got range ${d}-${f} expected range ${h.min}-${h.max}`);if(d>f)throw new Error(`Invalid range: ${d}-${f}, min(${d}) > max(${f})`)}static#l(d){if(!(!isNaN(d)&&d>0))throw new Error(`Constraint error, cannot repeat at every ${d} time.`)}static#s(d,f,h,p){const m=[];d===i.DayOfWeek&&h%7===0&&m.push(0);for(let b=f;b<=h;b+=p)m.indexOf(b)===-1&&m.push(b);return m}static#a(d,f,h,p){const m=f.split("-");if(m.length<=1)return isNaN(+f)?f:+f;const[b,y]=m.map(x=>parseInt(x,10));return this.#u(b,y,p),this.#l(h),this.#s(d,b,y,h)}static#d(d){const f=d.split("#");if(f.length<=1)return{dayOfWeek:f[0]};const h=+f[f.length-1],p=d.match(/([,-/])/);if(p!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${p?.[0]}\` special characters are incompatible`);if(!(f.length<=2&&!isNaN(h)&&h>=1&&h<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:f[0],nthDayOfWeek:h}}static#f(d,f){return d.chars.some(h=>f.toString().includes(h))}};return Xn.CronExpressionParser=l,Xn}var Pr={};const tL={},nL=Object.freeze(Object.defineProperty({__proto__:null,default:tL},Symbol.toStringTag,{value:"Module"})),Hg=aT(nL);var zg;function rL(){if(zg)return Pr;zg=1;var e=Pr&&Pr.__createBinding||(Object.create?(function(i,s,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(s,a);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(i,l,u)}):(function(i,s,a,l){l===void 0&&(l=a),i[l]=s[a]})),t=Pr&&Pr.__setModuleDefault||(Object.create?(function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}):function(i,s){i.default=s}),n=Pr&&Pr.__importStar||(function(){var i=function(s){return i=Object.getOwnPropertyNames||function(a){var l=[];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(l[l.length]=u);return l},i(s)};return function(s){if(s&&s.__esModule)return s;var a={};if(s!=null)for(var l=i(s),u=0;u<l.length;u++)l[u]!=="default"&&e(a,s,l[u]);return t(a,s),a}})();Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.CronFileParser=void 0;const r=Of();let o=class pu{static async parseFile(s){const{readFile:a}=await Promise.resolve().then(()=>n(Hg)),l=await a(s,"utf8");return pu.#e(l)}static parseFileSync(s){const{readFileSync:a}=Hg,l=a(s,"utf8");return pu.#e(l)}static#e(s){const a=s.split(`
194
- `),l={variables:{},expressions:[],errors:{}};for(const u of a){const d=u.trim();if(d.length===0||d.startsWith("#"))continue;const f=d.match(/^(.*)=(.*)$/);if(f){const[,h,p]=f;l.variables[h]=p.replace(/["']/g,"");continue}try{const h=pu.#n(d);l.expressions.push(h.interval)}catch(h){l.errors[d]=h}}return l}static#n(s){const a=s.split(" ");return{interval:r.CronExpressionParser.parse(a.slice(0,5).join(" ")),command:a.slice(5,a.length)}}};return Pr.CronFileParser=o,Pr}var Ug;function oL(){return Ug||(Ug=1,(function(e){var t=Go&&Go.__createBinding||(Object.create?(function(u,d,f,h){h===void 0&&(h=f);var p=Object.getOwnPropertyDescriptor(d,f);(!p||("get"in p?!d.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(u,h,p)}):(function(u,d,f,h){h===void 0&&(h=f),u[h]=d[f]})),n=Go&&Go.__exportStar||function(u,d){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&t(d,u,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;const r=Of();var o=Fp();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return o.CronDate}});var i=x2();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return i.CronFieldCollection}});var s=C2();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return s.CronExpression}});var a=Of();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return a.CronExpressionParser}});var l=rL();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return l.CronFileParser}}),n(Lp(),e),e.default=r.CronExpressionParser})(Go)),Go}var iL=oL(),Bd={exports:{}},Vg;function sL(){return Vg||(Vg=1,(function(e,t){(function(r,o){e.exports=o()})(globalThis,()=>(()=>{var n={949:((s,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CronParser=void 0;var u=l(515),d=(function(){function f(h,p,m){p===void 0&&(p=!0),m===void 0&&(m=!1),this.expression=h,this.dayOfWeekStartIndexZero=p,this.monthStartIndexZero=m}return f.prototype.parse=function(){var h,p,m=(h=this.expression)!==null&&h!==void 0?h:"";if(m==="@reboot")return p=["@reboot","","","","","",""],p;if(m.startsWith("@")){var b=this.parseSpecial(this.expression);p=this.extractParts(b)}else p=this.extractParts(this.expression);return this.normalize(p),this.validate(p),p},f.prototype.parseSpecial=function(h){var p={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},m=p[h];if(!m)throw new Error("Unknown special expression.");return m},f.prototype.extractParts=function(h){if(!this.expression)throw new Error("cron expression is empty");for(var p=h.trim().split(/[ ]+/),m=0;m<p.length;m++)if(p[m].includes(",")){var b=p[m].split(",").map(function(x){return x.trim()}).filter(function(x){return x!==""}).map(function(x){return isNaN(Number(x))?x:Number(x)}).filter(function(x){return x!==null&&x!==""});b.length===0&&b.push("*"),b.sort(function(x,C){return x!==null&&C!==null?x-C:0}),p[m]=b.map(function(x){return x!==null?x.toString():""}).join(",")}if(p.length<5)throw new Error("Expression has only ".concat(p.length," part").concat(p.length==1?"":"s",". At least 5 parts are required."));if(p.length==5)p.unshift(""),p.push("");else if(p.length==6){var y=/\d{4}$/.test(p[5])||p[4]=="?"||p[2]=="?";y?p.unshift(""):p.push("")}else if(p.length>7)throw new Error("Expression has ".concat(p.length," parts; too many!"));return p},f.prototype.normalize=function(h){var p=this;if(h[3]=h[3].replace("?","*"),h[5]=h[5].replace("?","*"),h[2]=h[2].replace("?","*"),h[0].indexOf("0/")==0&&(h[0]=h[0].replace("0/","*/")),h[1].indexOf("0/")==0&&(h[1]=h[1].replace("0/","*/")),h[2].indexOf("0/")==0&&(h[2]=h[2].replace("0/","*/")),h[3].indexOf("1/")==0&&(h[3]=h[3].replace("1/","*/")),h[4].indexOf("1/")==0&&(h[4]=h[4].replace("1/","*/")),h[6].indexOf("1/")==0&&(h[6]=h[6].replace("1/","*/")),h[5]=h[5].replace(/(^\d)|([^#/\s]\d)/g,function(I){var T=I.replace(/\D/,""),N=T;return p.dayOfWeekStartIndexZero?T=="7"&&(N="0"):N=(parseInt(T)-1).toString(),I.replace(T,N)}),h[5]=="L"&&(h[5]="6"),h[3]=="?"&&(h[3]="*"),h[3].indexOf("W")>-1&&(h[3].indexOf(",")>-1||h[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var m={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var b in m)h[5]=h[5].replace(new RegExp(b,"gi"),m[b].toString());h[4]=h[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(I){var T=I.replace(/\D/,""),N=T;return p.monthStartIndexZero&&(N=(parseInt(T)+1).toString()),I.replace(T,N)});var y={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var x in y)h[4]=h[4].replace(new RegExp(x,"gi"),y[x].toString());h[0]=="0"&&(h[0]=""),!/\*|\-|\,|\//.test(h[2])&&(/\*|\//.test(h[1])||/\*|\//.test(h[0]))&&(h[2]+="-".concat(h[2]));for(var C=0;C<h.length;C++)if(h[C].indexOf(",")!=-1&&(h[C]=h[C].split(",").filter(function(I){return I!==""}).join(",")||"*"),h[C]=="*/1"&&(h[C]="*"),h[C].indexOf("/")>-1&&!/^\*|\-|\,/.test(h[C])){var v=null;switch(C){case 4:v="12";break;case 5:v="6";break;case 6:v="9999";break;default:v=null;break}if(v!==null){var S=h[C].split("/");h[C]="".concat(S[0],"-").concat(v,"/").concat(S[1])}}},f.prototype.validate=function(h){var p="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(h[0],p),this.validateOnlyExpectedCharactersFound(h[1],p),this.validateOnlyExpectedCharactersFound(h[2],p),this.validateOnlyExpectedCharactersFound(h[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(h[4],p),this.validateOnlyExpectedCharactersFound(h[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(h[6],p),this.validateAnyRanges(h)},f.prototype.validateAnyRanges=function(h){u.default.secondRange(h[0]),u.default.minuteRange(h[1]),u.default.hourRange(h[2]),u.default.dayOfMonthRange(h[3]),u.default.monthRange(h[4],this.monthStartIndexZero),u.default.dayOfWeekRange(h[5],this.dayOfWeekStartIndexZero)},f.prototype.validateOnlyExpectedCharactersFound=function(h,p){var m=h.match(new RegExp("[^".concat(p,"]+"),"gi"));if(m&&m.length)throw new Error("Expression contains invalid values: '".concat(m.toString(),"'"))},f})();a.CronParser=d}),333:((s,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExpressionDescriptor=void 0;var u=l(823),d=l(949),f=(function(){function h(p,m){if(this.expression=p,this.options=m,this.expressionParts=new Array(5),!this.options.locale&&h.defaultLocale&&(this.options.locale=h.defaultLocale),!h.locales[this.options.locale]){var b=Object.keys(h.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(b,"'.")),this.options.locale=b}this.i18n=h.locales[this.options.locale],m.use24HourTimeFormat===void 0&&(m.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return h.toString=function(p,m){var b=m===void 0?{}:m,y=b.throwExceptionOnParseError,x=y===void 0?!0:y,C=b.verbose,v=C===void 0?!1:C,S=b.dayOfWeekStartIndexZero,I=S===void 0?!0:S,T=b.monthStartIndexZero,N=T===void 0?!1:T,O=b.use24HourTimeFormat,F=b.locale,B=F===void 0?null:F,j={throwExceptionOnParseError:x,verbose:v,dayOfWeekStartIndexZero:I,monthStartIndexZero:N,use24HourTimeFormat:O,locale:B};j.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var D=new h(p,j);return D.getFullDescription()},h.initialize=function(p,m){m===void 0&&(m="en"),h.specialCharacters=["/","-",",","*"],h.defaultLocale=m,p.load(h.locales)},h.prototype.getFullDescription=function(){var p,m,b="";try{var y=new d.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=y.parse(),this.expressionParts[0]==="@reboot")return((m=(p=this.i18n).atReboot)===null||m===void 0?void 0:m.call(p))||"Run once, at startup";var x=this.getTimeOfDayDescription(),C=this.getDayOfMonthDescription(),v=this.getMonthDescription(),S=this.getDayOfWeekDescription(),I=this.getYearDescription();b+=x+C+S+v+I,b=this.transformVerbosity(b,!!this.options.verbose),b=b.charAt(0).toLocaleUpperCase()+b.substr(1)}catch(T){if(!this.options.throwExceptionOnParseError)b=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(T)}return b},h.prototype.getTimeOfDayDescription=function(){var p=this.expressionParts[0],m=this.expressionParts[1],b=this.expressionParts[2],y="";if(!u.StringUtilities.containsAny(m,h.specialCharacters)&&!u.StringUtilities.containsAny(b,h.specialCharacters)&&!u.StringUtilities.containsAny(p,h.specialCharacters))y+=this.i18n.atSpace()+this.formatTime(b,m,p);else if(!p&&m.indexOf("-")>-1&&!(m.indexOf(",")>-1)&&!(m.indexOf("/")>-1)&&!u.StringUtilities.containsAny(b,h.specialCharacters)){var x=m.split("-");y+=u.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(b,x[0],""),this.formatTime(b,x[1],""))}else if(!p&&b.indexOf(",")>-1&&b.indexOf("-")==-1&&b.indexOf("/")==-1&&!u.StringUtilities.containsAny(m,h.specialCharacters)){var C=b.split(",");y+=this.i18n.at();for(var v=0;v<C.length;v++)y+=" ",y+=this.formatTime(C[v],m,""),v<C.length-2&&(y+=","),v==C.length-2&&(y+=this.i18n.spaceAnd())}else{var S=this.getSecondsDescription(),I=this.getMinutesDescription(),T=this.getHoursDescription();if(y+=S,y&&I&&(y+=", "),y+=I,I===T)return y;y&&T&&(y+=", "),y+=T}return y},h.prototype.getSecondsDescription=function(){var p=this,m=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(b){return b},function(b){return u.StringUtilities.format(p.i18n.everyX0Seconds(b),b)},function(b){return p.i18n.secondsX0ThroughX1PastTheMinute()},function(b){return b=="0"?"":parseInt(b)<20?p.i18n.atX0SecondsPastTheMinute(b):p.i18n.atX0SecondsPastTheMinuteGt20()||p.i18n.atX0SecondsPastTheMinute(b)});return m},h.prototype.getMinutesDescription=function(){var p=this,m=this.expressionParts[0],b=this.expressionParts[2],y=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(x){return x},function(x){return u.StringUtilities.format(p.i18n.everyX0Minutes(x),x)},function(x){return p.i18n.minutesX0ThroughX1PastTheHour()},function(x){try{return x=="0"&&b.indexOf("/")==-1&&m==""?p.i18n.everyHour():parseInt(x)<20?p.i18n.atX0MinutesPastTheHour(x):p.i18n.atX0MinutesPastTheHourGt20()||p.i18n.atX0MinutesPastTheHour(x)}catch{return p.i18n.atX0MinutesPastTheHour(x)}});return y},h.prototype.getHoursDescription=function(){var p=this,m=this.expressionParts[2],b=0,y=[];m.split("/")[0].split(",").forEach(function(v){var S=v.split("-");S.length===2&&y.push({value:S[1],index:b+1}),b+=S.length});var x=0,C=this.getSegmentDescription(m,this.i18n.everyHour(),function(v){var S=y.find(function(T){return T.value===v&&T.index===x}),I=S&&p.expressionParts[1]!=="0";return x++,I?p.formatTime(v,"59",""):p.formatTime(v,"0","")},function(v){return u.StringUtilities.format(p.i18n.everyX0Hours(v),v)},function(v){return p.i18n.betweenX0AndX1()},function(v){return p.i18n.atX0()});return C},h.prototype.getDayOfWeekDescription=function(){var p=this,m=this.i18n.daysOfTheWeek(),b=null;return this.expressionParts[5]=="*"?b="":b=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(y,x){var C=y;y.indexOf("#")>-1?C=y.substring(0,y.indexOf("#")):y.indexOf("L")>-1&&(C=C.replace("L",""));var v=parseInt(C),S=p.i18n.daysOfTheWeekInCase?p.i18n.daysOfTheWeekInCase(x)[v]:m[v];if(y.indexOf("#")>-1){var I=null,T=y.substring(y.indexOf("#")+1),N=y.substring(0,y.indexOf("#"));switch(T){case"1":I=p.i18n.first(N);break;case"2":I=p.i18n.second(N);break;case"3":I=p.i18n.third(N);break;case"4":I=p.i18n.fourth(N);break;case"5":I=p.i18n.fifth(N);break}S=I+" "+S}return S},function(y){return parseInt(y)==1?"":u.StringUtilities.format(p.i18n.commaEveryX0DaysOfTheWeek(y),y)},function(y){var x=y.substring(0,y.indexOf("-")),C=p.expressionParts[3]!="*";return C?p.i18n.commaAndX0ThroughX1(x):p.i18n.commaX0ThroughX1(x)},function(y){var x=null;if(y.indexOf("#")>-1){var C=y.substring(y.indexOf("#")+1),v=y.substring(0,y.indexOf("#"));x=p.i18n.commaOnThe(C,v).trim()+p.i18n.spaceX0OfTheMonth()}else if(y.indexOf("L")>-1)x=p.i18n.commaOnTheLastX0OfTheMonth(y.replace("L",""));else{var S=p.expressionParts[3]!="*";x=S?p.i18n.commaAndOnX0():p.i18n.commaOnlyOnX0(y)}return x}),b},h.prototype.getMonthDescription=function(){var p=this,m=this.i18n.monthsOfTheYear(),b=this.getSegmentDescription(this.expressionParts[4],"",function(y,x){return x&&p.i18n.monthsOfTheYearInCase?p.i18n.monthsOfTheYearInCase(x)[parseInt(y)-1]:m[parseInt(y)-1]},function(y){return parseInt(y)==1?"":u.StringUtilities.format(p.i18n.commaEveryX0Months(y),y)},function(y){return p.i18n.commaMonthX0ThroughMonthX1()||p.i18n.commaX0ThroughX1()},function(y){return p.i18n.commaOnlyInMonthX0?p.i18n.commaOnlyInMonthX0():p.i18n.commaOnlyInX0()});return b},h.prototype.getDayOfMonthDescription=function(){var p=this,m=null,b=this.expressionParts[3];switch(b){case"L":m=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":m=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var y=b.match(/(\d{1,2}W)|(W\d{1,2})/);if(y){var x=parseInt(y[0].replace("W","")),C=x==1?this.i18n.firstWeekday():u.StringUtilities.format(this.i18n.weekdayNearestDayX0(),x.toString());m=u.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),C);break}else{var v=b.match(/L-(\d{1,2})/);if(v){var S=v[1];m=u.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(S),S);break}else{if(b=="*"&&this.expressionParts[5]!="*")return"";m=this.getSegmentDescription(b,this.i18n.commaEveryDay(),function(I){return I=="L"?p.i18n.lastDay():p.i18n.dayX0?u.StringUtilities.format(p.i18n.dayX0(),I):I},function(I){return I=="1"?p.i18n.commaEveryDay():p.i18n.commaEveryX0Days(I)},function(I){return p.i18n.commaBetweenDayX0AndX1OfTheMonth(I)},function(I){return p.i18n.commaOnDayX0OfTheMonth(I)})}break}}return m},h.prototype.getYearDescription=function(){var p=this,m=this.getSegmentDescription(this.expressionParts[6],"",function(b){return/^\d+$/.test(b)?new Date(parseInt(b),1).getFullYear().toString():b},function(b){return u.StringUtilities.format(p.i18n.commaEveryX0Years(b),b)},function(b){return p.i18n.commaYearX0ThroughYearX1()||p.i18n.commaX0ThroughX1()},function(b){return p.i18n.commaOnlyInYearX0?p.i18n.commaOnlyInYearX0():p.i18n.commaOnlyInX0()});return m},h.prototype.getSegmentDescription=function(p,m,b,y,x,C){var v=null,S=p.indexOf("/")>-1,I=p.indexOf("-")>-1,T=p.indexOf(",")>-1;if(!p)v="";else if(p==="*")v=m;else if(!S&&!I&&!T)v=u.StringUtilities.format(C(p),b(p));else if(T){for(var N=p.split(","),O="",F=0;F<N.length;F++)if(F>0&&N.length>2&&(O+=",",F<N.length-1&&(O+=" ")),F>0&&N.length>1&&(F==N.length-1||N.length==2)&&(O+="".concat(this.i18n.spaceAnd()," ")),N[F].indexOf("/")>-1||N[F].indexOf("-")>-1){var B=N[F].indexOf("-")>-1&&N[F].indexOf("/")==-1,j=this.getSegmentDescription(N[F],m,b,y,B?this.i18n.commaX0ThroughX1:x,C);B&&(j=j.replace(", ","")),O+=j}else S?O+=this.getSegmentDescription(N[F],m,b,y,x,C):O+=b(N[F]);S?v=O:v=u.StringUtilities.format(C(p),O)}else if(S){var N=p.split("/");if(v=u.StringUtilities.format(y(N[1]),N[1]),N[0].indexOf("-")>-1){var D=this.generateRangeSegmentDescription(N[0],x,b);D.indexOf(", ")!=0&&(v+=", "),v+=D}else if(N[0].indexOf("*")==-1){var H=u.StringUtilities.format(C(N[0]),b(N[0]));H=H.replace(", ",""),v+=u.StringUtilities.format(this.i18n.commaStartingX0(),H)}}else I&&(v=this.generateRangeSegmentDescription(p,x,b));return v},h.prototype.generateRangeSegmentDescription=function(p,m,b){var y="",x=p.split("-"),C=b(x[0],1),v=b(x[1],2),S=m(p);return y+=u.StringUtilities.format(S,C,v),y},h.prototype.formatTime=function(p,m,b){var y=0,x=0,C=parseInt(p)+y,v=parseInt(m)+x;v>=60?(v-=60,C+=1):v<0&&(v+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var S="",I=!1;this.options.use24HourTimeFormat||(I=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),S=I?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var T="";return b&&(T=":".concat(("00"+b).substring(b.length))),"".concat(I?S:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+v.toString()).substring(v.toString().length)).concat(T).concat(I?"":S)},h.prototype.transformVerbosity=function(p,m){if(!m&&(p=p.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),p=p.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),p=p.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),p=p.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var b=0,y=Object.entries(this.i18n.conciseVerbosityReplacements());b<y.length;b++){var x=y[b],C=x[0],v=x[1];p=p.replace(new RegExp(C,"g"),v)}return p},h.prototype.getPeriod=function(p){return p>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},h.locales={},h})();a.ExpressionDescriptor=f}),747:((s,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.enLocaleLoader=void 0;var u=l(486),d=(function(){function f(){}return f.prototype.load=function(h){h.en=new u.en},f})();a.enLocaleLoader=d}),486:((s,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.en=void 0;var l=(function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!1},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},u.prototype.everyMinute=function(){return"every minute"},u.prototype.everyHour=function(){return"every hour"},u.prototype.atSpace=function(){return"At "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},u.prototype.at=function(){return"At"},u.prototype.spaceAnd=function(){return" and"},u.prototype.everySecond=function(){return"every second"},u.prototype.everyX0Seconds=function(){return"every %s seconds"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},u.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},u.prototype.everyX0Minutes=function(){return"every %s minutes"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},u.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},u.prototype.everyX0Hours=function(){return"every %s hours"},u.prototype.betweenX0AndX1=function(){return"between %s and %s"},u.prototype.atX0=function(){return"at %s"},u.prototype.commaEveryDay=function(){return", every day"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},u.prototype.commaX0ThroughX1=function(){return", %s through %s"},u.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},u.prototype.first=function(){return"first"},u.prototype.second=function(){return"second"},u.prototype.third=function(){return"third"},u.prototype.fourth=function(){return"fourth"},u.prototype.fifth=function(){return"fifth"},u.prototype.commaOnThe=function(){return", on the "},u.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},u.prototype.lastDay=function(){return"the last day"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},u.prototype.commaOnlyOnX0=function(){return", only on %s"},u.prototype.commaAndOnX0=function(){return", and on %s"},u.prototype.commaEveryX0Months=function(){return", every %s months"},u.prototype.commaOnlyInX0=function(){return", only in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},u.prototype.firstWeekday=function(){return"first weekday"},u.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},u.prototype.commaEveryX0Days=function(){return", every %s days"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},u.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},u.prototype.commaEveryHour=function(){return", every hour"},u.prototype.commaEveryX0Years=function(){return", every %s years"},u.prototype.commaStartingX0=function(){return", starting %s"},u.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},u.prototype.atReboot=function(){return"Run once, at startup"},u})();a.en=l}),515:((s,a)=>{Object.defineProperty(a,"__esModule",{value:!0});function l(d,f){if(!d)throw new Error(f)}var u=(function(){function d(){}return d.secondRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=0&&m<=59,"seconds part must be >= 0 and <= 59")}},d.minuteRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=0&&m<=59,"minutes part must be >= 0 and <= 59")}},d.hourRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=0&&m<=23,"hours part must be >= 0 and <= 23")}},d.dayOfMonthRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=1&&m<=31,"DOM part must be >= 1 and <= 31")}},d.monthRange=function(f,h){for(var p=f.split(","),m=0;m<p.length;m++)if(!isNaN(parseInt(p[m],10))){var b=parseInt(p[m],10);l(b>=1&&b<=12,h?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},d.dayOfWeekRange=function(f,h){for(var p=f.split(","),m=0;m<p.length;m++)if(!isNaN(parseInt(p[m],10))){var b=parseInt(p[m],10);l(b>=0&&b<=6,h?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},d})();a.default=u}),823:((s,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.StringUtilities=void 0;var l=(function(){function u(){}return u.format=function(d){for(var f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];return d.replace(/%s/g,function(p){return f.shift()})},u.containsAny=function(d,f){return f.some(function(h){return d.indexOf(h)>-1})},u})();a.StringUtilities=l})},r={};function o(s){var a=r[s];if(a!==void 0)return a.exports;var l=r[s]={exports:{}};return n[s](l,l.exports,o),l.exports}var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.toString=void 0;var a=o(333),l=o(747);a.ExpressionDescriptor.initialize(new l.enLocaleLoader),s.default=a.ExpressionDescriptor;var u=a.ExpressionDescriptor.toString;s.toString=u})(),i})())})(Bd)),Bd.exports}var aL=sL();const lL=Tr(aL),uL=new Set(["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","SUN","MON","TUE","WED","THU","FRI","SAT"]);function cL(e){for(const t of e.trim().split(/\s+/)){if(/[#?]/.test(t))return!1;for(const n of t.split(/[,\-/]/))if(!(n===""||n==="*")&&/[A-Za-z]/.test(n)&&!uL.has(n.toUpperCase()))return!1}return!0}function E2(e){const t=(e??"").trim();if(t.split(/\s+/).filter(Boolean).length!==5)return{valid:!1,description:"",nextRun:null,error:"Expected a 5-field UNIX cron: minute hour day-of-month month day-of-week."};if(!cL(t))return{valid:!1,description:"",nextRun:null,error:"Unsupported cron syntax: L, W, #, and ? extensions are not allowed (plain 5-field UNIX cron only)."};try{const n=lL.toString(t,{use24HourTimeFormat:!0,verbose:!1}),r=iL.CronExpressionParser.parse(t,{tz:"UTC"}).next().toDate();return{valid:!0,description:n,nextRun:r}}catch(n){return{valid:!1,description:"",nextRun:null,error:n instanceof Error?n.message:"Invalid cron expression."}}}function v2(e){return e?e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC",hour12:!1})+" UTC":"—"}const Wg="0 6 * * *";function dL({currentSchedule:e,isSubmitting:t,disabled:n,disabledReason:r,onSubmit:o}){const[i,s]=W.useState(!1),[a,l]=W.useState(e??Wg),u=()=>{l(e??Wg),s(!0)},d=()=>s(!1),f=E2(a),h=async m=>{try{await o(m),s(!1)}catch{}},p=c.jsx("span",{children:c.jsx(w.Button,{variant:"outlined",size:"small",startIcon:c.jsx(Hu,{}),onClick:u,disabled:n,"aria-label":e?"Edit schedule":"Set schedule",children:e?"Edit schedule":"Set schedule"})});return c.jsxs(c.Fragment,{children:[n&&r?c.jsx(w.Tooltip,{title:r,children:p}):p,c.jsxs(w.Dialog,{open:i,onClose:d,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"set-schedule-title",children:[c.jsx(w.DialogTitle,{id:"set-schedule-title",children:e?"Edit schedule":"Set schedule"}),c.jsxs(w.DialogContent,{children:[c.jsx(w.DialogContentText,{sx:{mb:2},children:"The publisher rebuilds the materializations in this package on this cadence. Enter a 5-field UNIX cron, evaluated in UTC. In a hosted deployment, the change takes effect on your next publish."}),c.jsx(w.TextField,{autoFocus:!0,fullWidth:!0,label:"Cron expression",value:a,onChange:m=>l(m.target.value),error:a.trim()!==""&&!f.valid,slotProps:{htmlInput:{style:{fontFamily:De.MONO_FONT_FAMILY}}}}),c.jsx(w.Box,{sx:{mt:1.5,minHeight:48},children:f.valid?c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{variant:"body2",children:f.description}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Next run: ",v2(f.nextRun)]})]}):c.jsx(w.Typography,{variant:"body2",color:"error",children:f.error})}),c.jsxs(w.Alert,{severity:"info",sx:{mt:2},children:["A schedule runs only on version-scoped packages, so saving one sets ",c.jsx("code",{children:"scope: version"})," for this package."]})]}),c.jsxs(w.DialogActions,{sx:{justifyContent:"space-between",px:3},children:[c.jsx(w.Box,{children:e&&c.jsx(w.Button,{color:"error",loading:t,onClick:()=>h(null),children:"Clear schedule"})}),c.jsxs(w.Box,{children:[c.jsx(w.Button,{onClick:d,children:"Cancel"}),c.jsx(w.Button,{variant:"contained",loading:t,disabled:!f.valid,onClick:()=>h(a.trim()),sx:{ml:1},children:"Save"})]})]})]})]})}function fL({schedule:e,scope:t,manifestLocation:n,hasFreshness:r,mutable:o,isSubmitting:i,isScopeMutating:s,onSubmit:a,onScopeChange:l}){const u=!!n,d=e?E2(e):null,f=!!e;return c.jsx(w.Card,{variant:"outlined",sx:{borderRadius:2,mb:6},children:c.jsx(w.CardContent,{children:c.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:2,children:[c.jsxs(w.Box,{sx:{minWidth:0},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[c.jsx(Hu,{fontSize:"small",color:"action"}),c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Schedule"})]}),u?c.jsxs(w.Box,{children:[c.jsx(w.Chip,{size:"small",color:"default",variant:"outlined",label:"Control-plane managed",sx:{mb:1}}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Refresh is driven by the control plane; the built-in scheduler does not fire this package."})]}):d?c.jsxs(w.Box,{children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5,flexWrap:"wrap"},children:[c.jsx(w.Chip,{size:"small",color:"success",variant:"outlined",icon:c.jsx(Hu,{fontSize:"small"}),label:"Active"}),c.jsx(w.Box,{component:"code",sx:{fontFamily:De.MONO_FONT_FAMILY,fontSize:"0.8125rem",px:.75,py:.25,borderRadius:1,bgcolor:"action.hover"},children:e})]}),c.jsx(w.Typography,{variant:"body2",children:d.valid?d.description:"Unrecognized cron expression."}),d.valid&&c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Next run: ",v2(d.nextRun)]})]}):r?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"This package uses a freshness policy; a cron schedule is not applicable."}):c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"On-demand only — no schedule set."}),!u&&c.jsxs(w.Box,{sx:{mt:2},children:[c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Scope"}),c.jsx(w.Tooltip,{title:f?"A schedule requires version scope. Clear the schedule to change it.":"",children:c.jsx("span",{children:c.jsxs(w.ToggleButtonGroup,{size:"small",exclusive:!0,value:t,disabled:!o||!l||f||!!s,onChange:(h,p)=>{p&&p!==t&&l?.(p)},children:[c.jsx(w.ToggleButton,{value:"package",children:"package"}),c.jsx(w.ToggleButton,{value:"version",children:"version"})]})})}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:.5},children:t==="version"?"Materialized artifacts are per version (required for a schedule).":"Materialized artifacts are shared across versions."})]}),c.jsxs(w.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1.5},children:["Declared in ",c.jsx("code",{children:"publisher.json"}),".",!u&&c.jsxs(c.Fragment,{children:[" ","In a hosted deployment, a change takes effect on your next publish."]})]})]}),o&&!u&&c.jsx(dL,{currentSchedule:e,isSubmitting:i,disabled:r,disabledReason:"This package declares a freshness policy; a schedule and freshness are mutually exclusive.",onSubmit:a})]})})})}const pL=3e3;function hL({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=De.useServer(),o=Lr.useQueryClient(),{environmentName:i,packageName:s}=Ht(e),[a,l]=W.useState(""),[u,d]=W.useState(null),f=t??(F=>{window.location.href=F});if(!s)throw new Error("Materializations requires a package in the resource URI");const h=Xt({queryKey:["materializations",i,s],queryFn:()=>n.materializations.listMaterializations(i,s),refetchInterval:F=>(F.state.data?.data??[]).some(D=>Ja(D.status))?pL:!1}),p=Xt({queryKey:["package",i,s],queryFn:()=>n.packages.getPackage(i,s)}),m=()=>o.invalidateQueries({queryKey:["materializations",i,s]}),b=vn({mutationFn:F=>n.materializations.createMaterialization(i,s,{forceRefresh:F.forceRefresh}),onSuccess(){l("Materialization requested"),m()},onError(F){l(F.message),m()}}),y=vn({mutationFn:F=>n.materializations.materializationAction(i,s,F.id,De.MaterializationActionActionEnum.Stop),onSuccess(){l("Materialization stopped"),m()},onError(F){l(F.message)}}),x=vn({mutationFn:({materialization:F,dropTables:B})=>n.materializations.deleteMaterialization(i,s,F.id,B),onSuccess(){l("Materialization deleted"),m()},onError(F){l(F.message)}}),C=p.data?.data,v=vn({mutationFn:F=>n.packages.updatePackage(i,s,{name:s,description:C?.description,...F?{scope:De.PackageScopeEnum.Version}:{},materialization:{schedule:F}}),onSuccess(F,B){l(B?"Schedule updated":"Schedule cleared"),o.invalidateQueries({queryKey:["package",i,s]})},onError(F){l(F.message)}}),S=vn({mutationFn:F=>n.packages.updatePackage(i,s,{name:s,description:C?.description,scope:F}),onSuccess(){l("Scope updated"),o.invalidateQueries({queryKey:["package",i,s]})},onError(F){l(F.message)}}),I=h.data?.data??[],T=I.find(F=>F.id===u)??null,N=I.some(F=>Ja(F.status)),O=b.isPending||y.isPending||x.isPending;return c.jsxs(w.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Link,{onClick:F=>f(`/${i}/${s}`,F),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[c.jsx(Xx,{sx:{fontSize:18}}),"Back to ",s]}),c.jsxs(w.Stack,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:"Materializations"}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Materialize the persist sources in ",s," into tables and serve queries from them"]})]}),r&&c.jsx(yN,{onSubmit:F=>b.mutateAsync(F),isSubmitting:b.isPending,disabled:N,disabledReason:"A materialization is already pending or running for this package."})]})]}),p.isSuccess&&c.jsx(fL,{schedule:C?.materialization?.schedule??null,scope:C?.scope===De.PackageScopeEnum.Version?"version":"package",manifestLocation:C?.manifestLocation??null,hasFreshness:!!C?.materialization?.freshness,mutable:r,isSubmitting:v.isPending,isScopeMutating:S.isPending,onSubmit:F=>v.mutateAsync(F),onScopeChange:F=>S.mutateAsync(F==="version"?De.PackageScopeEnum.Version:De.PackageScopeEnum.Package)}),c.jsxs(w.Box,{sx:{mb:6},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:1},children:"Runs"}),h.isError&&c.jsx(kn,{error:h.error,context:`${i} > ${s} > Materializations`}),!h.isSuccess&&!h.isError&&c.jsx(Sn,{text:"Loading materializations..."}),h.isSuccess&&c.jsx(b2,{materializations:I,mutable:r,isMutating:O,onStop:F=>y.mutate(F),onDelete:(F,B)=>x.mutate({materialization:F,dropTables:B}),onViewDetails:F=>d(F.id??null)})]}),c.jsx(r2,{materialization:T,buildPlan:p.data?.data?.buildPlan??null,onClose:()=>d(null)}),c.jsx(w.Snackbar,{open:a!=="",autoHideDuration:6e3,onClose:()=>l(""),message:a})]})}function mL({packages:e,onSubmit:t,isSubmitting:n,disabled:r}){const[o,i]=W.useState(!1),[s,a]=W.useState({}),[l,u]=W.useState(!1),d=()=>{a({}),u(!1),i(!0)},f=()=>i(!1),h=e.map(y=>y.name).filter(y=>s[y]),p=y=>a(x=>({...x,[y]:!x[y]})),m=e.length>0&&h.length===e.length,b=async()=>{try{await t({packageNames:h,forceRefresh:l}),i(!1)}catch{}};return c.jsxs(c.Fragment,{children:[c.jsx(w.Button,{variant:"contained",startIcon:c.jsx(fl,{}),onClick:d,disabled:r,"aria-label":"New materialization",children:"New materialization"}),c.jsxs(w.Dialog,{open:o,onClose:f,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-env-materialization-title",children:[c.jsx(w.DialogTitle,{id:"create-env-materialization-title",children:"New materialization"}),c.jsxs(w.DialogContent,{children:[c.jsx(w.DialogContentText,{sx:{mb:1},children:"Pick the packages to materialize. Each runs an independent build of every persist source in that package."}),e.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"No packages in this environment."}):c.jsxs(c.Fragment,{children:[c.jsx(w.FormControlLabel,{control:c.jsx(w.Checkbox,{checked:m,indeterminate:h.length>0&&!m,onChange:y=>{const x={};y.target.checked&&e.forEach(C=>x[C.name]=!0),a(x)}}),label:c.jsx(w.Typography,{variant:"body2",children:"Select all"})}),c.jsx(w.Box,{sx:{maxHeight:240,overflowY:"auto",pl:1,borderLeft:"2px solid",borderColor:"divider"},children:c.jsx(w.FormGroup,{children:e.map(y=>c.jsx(w.FormControlLabel,{control:c.jsx(w.Checkbox,{checked:!!s[y.name],onChange:()=>p(y.name)}),label:y.name},y.name))})}),c.jsx(w.FormControlLabel,{sx:{mt:1},control:c.jsx(w.Switch,{checked:l,onChange:y=>u(y.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})]})]}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:f,children:"Cancel"}),c.jsxs(w.Button,{variant:"contained",loading:n,disabled:h.length===0,onClick:b,children:["Materialize",h.length>0?` (${h.length})`:""]})]})]})]})}const gL=3e3,qg=10;function T2({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=De.useServer(),o=Lr.useQueryClient(),{environmentName:i}=Ht(e),[s,a]=W.useState(""),[l,u]=W.useState(null),[d,f]=W.useState(qg),h=t??(O=>{window.location.href=O}),p=Xt({queryKey:["env-materializations",i,d],queryFn:()=>n.materializations.listEnvironmentMaterializations(i,d),placeholderData:O=>O,refetchInterval:O=>(O.state.data?.data??[]).some(j=>Ja(j.status))?gL:!1}),m=Xt({queryKey:["packages",i],queryFn:()=>n.packages.listPackages(i)}),b=()=>o.invalidateQueries({queryKey:["env-materializations",i]}),y=vn({mutationFn:async O=>{const B=(await Promise.allSettled(O.packageNames.map(j=>n.materializations.createMaterialization(i,j,{forceRefresh:O.forceRefresh})))).filter(j=>j.status==="rejected").length;return{total:O.packageNames.length,failed:B}},onSuccess(O){const F=O.total-O.failed;a(O.failed===0?`Started ${F} materialization${F===1?"":"s"}`:`Started ${F} of ${O.total} (${O.failed} could not start — a build may already be active)`),b()},onError(O){a(O.message),b()}}),x=vn({mutationFn:O=>n.materializations.materializationAction(i,O.packageName,O.id,De.MaterializationActionActionEnum.Stop),onSuccess(){a("Materialization stopped"),b()},onError(O){a(O.message)}}),C=vn({mutationFn:({materialization:O,dropTables:F})=>n.materializations.deleteMaterialization(i,O.packageName,O.id,F),onSuccess(){a("Materialization deleted"),b()},onError(O){a(O.message)}}),v=p.data?.data??[],S=m.data?.data??[],I=v.find(O=>O.id===l)??null,T=y.isPending||x.isPending||C.isPending,N=v.length>=d;return c.jsxs(w.Box,{children:[c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Materializations"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"All materialization builds across the packages in this environment"})]}),r&&c.jsx(mL,{packages:S,onSubmit:O=>y.mutateAsync(O),isSubmitting:y.isPending})]}),p.isError&&c.jsx(kn,{error:p.error,context:`${i} > Materializations`}),!p.isSuccess&&!p.isError&&c.jsx(Sn,{text:"Loading materializations..."}),p.isSuccess&&c.jsx(b2,{materializations:v,mutable:r,isMutating:T,showPackage:!0,onClickPackage:O=>h(`/${i}/${O}/materializations`),onStop:O=>x.mutate(O),onDelete:(O,F)=>C.mutate({materialization:O,dropTables:F}),onViewDetails:O=>u(O.id??null)}),p.isSuccess&&v.length>0&&c.jsxs(w.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:2,sx:{mt:2},children:[c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:N?`Showing ${v.length} most recent`:`${v.length} materialization${v.length===1?"":"s"}`}),N&&c.jsx(w.Button,{size:"small",onClick:()=>f(O=>O+qg),disabled:p.isFetching,children:"Show more"})]}),c.jsx(r2,{materialization:I,buildPlan:null,showBuildPlan:!1,onClose:()=>u(null)}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})}function bL({resourceUri:e}){const{environmentName:t}=Ht(e),{apiClients:n}=De.useServer(),[r,o]=W.useState(!1),i=90,{data:s,isSuccess:a,isError:l,error:u}=Xt({queryKey:["about",t],queryFn:()=>n.environments.getEnvironment(t,!1)}),d=s?.data?.readme||"",f=d.split(/\s+/),h=f.length>i,p=f.slice(0,i).join(" ");return c.jsxs(c.Fragment,{children:[!a&&!l&&c.jsx(Sn,{text:"Fetching About..."}),a&&d&&c.jsx(De.PackageCard,{children:c.jsxs(De.PackageCardContent,{children:[c.jsx(De.PackageSectionTitle,{children:"Readme"}),c.jsxs(w.Box,{sx:{mt:1,fontSize:"0.875rem",lineHeight:1.6},children:[c.jsx(wu,{options:{overrides:{h1:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h2:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h3:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}}}},children:r||!h?d:p}),h&&c.jsxs(w.Box,{sx:{mt:1},children:[" ",c.jsx(w.Button,{variant:"text",size:"small",onClick:()=>o(!r),children:r?"Read less":"Read more"})]})]})]})}),l&&c.jsx(kn,{error:u,context:`${t} > About`})]})}const S2="https://docs.malloydata.dev/documentation",jd=`${S2}/user_guides/publishing`,ss={docsHome:`${S2}/`,publishing:`${jd}/publishing`,explorer:`${jd}/explorer`,mcpAgents:`${jd}/mcp_agents`};function yL({resourceUri:e}){const[t,n]=W.useState(!1),{apiClients:r}=De.useServer(),o=Lr.useQueryClient(),[i,s]=W.useState(""),{environmentName:a}=Ht(e),l=vn({async mutationFn(d){return r.packages.createPackage(a,{name:d.name,description:d.description,location:d.location})},onSuccess(){n(!1),s("Package created successfully"),o.invalidateQueries({queryKey:["packages",a]})},onError(d){s(d instanceof Error?d.message:"An unknown error occurred")}}),u=d=>{d.preventDefault();const f=new FormData(d.currentTarget),h=f.get("name")?.toString(),p=f.get("description")?.toString(),m=f.get("location")?.toString();l.mutate({name:h,description:p,location:m})};return c.jsxs(c.Fragment,{children:[c.jsx(w.Button,{onClick:()=>n(!0),variant:"contained",color:"primary",startIcon:c.jsx(On.Add,{}),children:"Add Package"}),c.jsxs(w.Dialog,{open:t,onClose:()=>n(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[c.jsx(w.DialogTitle,{sx:{fontSize:"1.25rem",fontWeight:600,letterSpacing:"-0.025em",pt:3,pb:1,px:3},children:"Create New Package"}),c.jsxs(w.DialogContent,{sx:{px:3,pb:0},children:[c.jsxs(w.Box,{sx:{mb:3},children:[c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"Create a new Malloy package to start exploring your data."}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"The location can be a GitHub/S3/GCP URL containing a package (zipped or unzipped), or an absolute path to a directory the publisher server has access to."}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Make sure to conform to the"," ",c.jsx(w.Box,{component:"a",href:ss.publishing,target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Package Format"}),"."]})]}),c.jsx("form",{onSubmit:u,id:"package-form",children:c.jsxs(w.Stack,{spacing:2.5,children:[c.jsx(w.TextField,{autoFocus:!0,required:!0,id:"name",name:"name",label:"Package Name",type:"text",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),c.jsx(w.TextField,{id:"description",name:"description",label:"Description",multiline:!0,rows:3,fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),c.jsx(w.TextField,{id:"location",name:"location",label:"Location",type:"text",placeholder:"e.g. s3://my-bucket/my-package.zip",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}})]})})]}),c.jsxs(w.DialogActions,{sx:{px:3,pt:2,pb:3,gap:1},children:[c.jsx(w.Button,{variant:"outlined",disabled:l.isPending,onClick:()=>n(!1),children:"Cancel"}),c.jsx(w.Button,{type:"submit",form:"package-form",variant:"contained",loading:l.isPending,children:"Save Changes"})]})]}),c.jsx(w.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})}const xL=mt(c.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),k2=mt(c.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}));function w2(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:Ka(t.components[n].defaultProps,r)}function CL({props:e,name:t,defaultTheme:n,themeId:r}){let o=$S(n);return o=o[r]||o,w2({theme:o,name:t,props:e})}function Kt({props:e,name:t}){return CL({props:e,name:t,defaultTheme:uc,themeId:Cs})}const EL=We("MuiBox",["root"]),vL=bb(),Qt=Ot.createBox({themeId:Cs,defaultTheme:vL,defaultClassName:EL.root,generateClassName:nb.generate});function TL(e){return Ge("MuiDialogContentText",e)}We("MuiDialogContentText",["root"]);const SL=e=>{const{classes:t}=e,r=Ke({root:["root"]},TL,t);return{...t,...r}},kL=fe(Dt,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiDialogContentText",slot:"Root"})({}),vl=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogContentText"}),{children:o,className:i,...s}=r,a=SL(s);return c.jsx(kL,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:s,className:Ue(a.root,i),...r,classes:a})});function Zl(e){return parseInt(e,10)||0}const wL={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function DL(e){for(const t in e)return!1;return!0}function Yg(e){return DL(e)||e.outerHeightStyle===0&&!e.overflowing}const IL=M.forwardRef(function(t,n){const{onChange:r,maxRows:o,minRows:i=1,style:s,value:a,...l}=t,{current:u}=M.useRef(a!=null),d=M.useRef(null),f=vt(n,d),h=M.useRef(null),p=M.useRef(null),m=M.useCallback(()=>{const v=d.current,S=p.current;if(!v||!S)return;const T=bo(v).getComputedStyle(v);if(T.width==="0px")return{outerHeightStyle:0,overflowing:!1};S.style.width=T.width,S.value=v.value||t.placeholder||"x",S.value.slice(-1)===`
193
+ `:null,sF=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,i={root:["root",n,`color${Fe(r)}`],svg:["svg"],circle:["circle",`circle${Fe(n)}`,o&&"circleDisableShrink"]};return Ke(i,rF,t)},aF=fe("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Fe(n.color)}`]]}})(ft(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:oF||{animation:`${If} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),lF=fe("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),uF=fe("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Fe(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(ft(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:iF||{animation:`${Af} 1.4s ease-in-out infinite`}}]}))),Mp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiCircularProgress"}),{className:o,color:i="primary",disableShrink:s=!1,size:a=40,style:l,thickness:u=3.6,value:d=0,variant:f="indeterminate",...h}=r,p={...r,color:i,disableShrink:s,size:a,thickness:u,value:d,variant:f},m=sF(p),b={},y={},x={};if(f==="determinate"){const C=2*Math.PI*((Io-u)/2);b.strokeDasharray=C.toFixed(3),x["aria-valuenow"]=Math.round(d),b.strokeDashoffset=`${((100-d)/100*C).toFixed(3)}px`,y.transform="rotate(-90deg)"}return c.jsx(aF,{className:Ue(m.root,o),style:{width:a,height:a,...y,...l},ownerState:p,ref:n,role:"progressbar",...x,...h,children:c.jsx(lF,{className:m.svg,ownerState:p,viewBox:`${Io/2} ${Io/2} ${Io} ${Io}`,children:c.jsx(uF,{className:m.circle,style:b,ownerState:p,cx:Io,cy:Io,r:(Io-u)/2,fill:"none",strokeWidth:u})})})});function cF(e){return Ge("MuiButton",e)}const Ko=We("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),dF=M.createContext({}),fF=M.createContext(void 0),pF=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,loading:s,loadingPosition:a,classes:l}=e,u={root:["root",s&&"loading",i,`${i}${Fe(t)}`,`size${Fe(o)}`,`${i}Size${Fe(o)}`,`color${Fe(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${Fe(a)}`],startIcon:["icon","startIcon",`iconSize${Fe(o)}`],endIcon:["icon","endIcon",`iconSize${Fe(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},d=Ke(u,cF,l);return{...l,...d}},c2=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],hF=fe(pi,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Fe(n.color)}`],t[`size${Fe(n.size)}`],t[`${n.variant}Size${Fe(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(ft(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Ko.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Ko.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Ko.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Ko.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(Bn()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Ko.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Ko.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Ko.loading}`]:{color:"transparent"}}}]}})),mF=fe("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Fe(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...c2]})),gF=fe("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Fe(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...c2]})),bF=fe("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),mg=fe("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),tn=M.forwardRef(function(t,n){const r=M.useContext(dF),o=M.useContext(fF),i=Ka(r,t),s=ut({props:i,name:"MuiButton"}),{children:a,color:l="primary",component:u="button",className:d,disabled:f=!1,disableElevation:h=!1,disableFocusRipple:p=!1,endIcon:m,focusVisibleClassName:b,fullWidth:y=!1,id:x,loading:C=null,loadingIndicator:v,loadingPosition:S="center",size:I="medium",startIcon:T,type:N,variant:O="text",...F}=s,B=_r(x),j=v??c.jsx(Mp,{"aria-labelledby":B,color:"inherit",size:16}),D={...s,color:l,component:u,disabled:f,disableElevation:h,disableFocusRipple:p,fullWidth:y,loading:C,loadingIndicator:j,loadingPosition:S,size:I,type:N,variant:O},H=pF(D),_=(T||C&&S==="start")&&c.jsx(mF,{className:H.startIcon,ownerState:D,children:T||c.jsx(mg,{className:H.loadingIconPlaceholder,ownerState:D})}),L=(m||C&&S==="end")&&c.jsx(gF,{className:H.endIcon,ownerState:D,children:m||c.jsx(mg,{className:H.loadingIconPlaceholder,ownerState:D})}),$=o||"",K=typeof C=="boolean"?c.jsx("span",{className:H.loadingWrapper,style:{display:"contents"},children:C&&c.jsx(bF,{className:H.loadingIndicator,ownerState:D,children:j})}):null;return c.jsxs(hF,{ownerState:D,className:Ue(r.className,H.root,d,$),component:u,disabled:f||C,focusRipple:!p,focusVisibleClassName:Ue(H.focusVisible,b),ref:n,type:N,id:C?B:x,...F,classes:H,children:[_,S!=="end"&&K,a,S==="end"&&K,L]})}),kc=M.createContext(void 0);function ar(){return M.useContext(kc)}function yF(e){return Ge("PrivateSwitchBase",e)}We("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);function hs(e){return typeof e=="string"}function d2(e,t,n){return e===void 0||hs(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function br(e,t,n){return typeof e=="function"?e(t,n):e}function Ln(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function gg(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function f2(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const p=Ue(n?.className,i,o?.className,r?.className),m={...n?.style,...o?.style,...r?.style},b={...n,...o,...r};return p.length>0&&(b.className=p),Object.keys(m).length>0&&(b.style=m),{props:b,internalRef:void 0}}const s=Ln({...o,...r}),a=gg(r),l=gg(o),u=t(s),d=Ue(u?.className,n?.className,i,o?.className,r?.className),f={...u?.style,...n?.style,...o?.style,...r?.style},h={...u,...n,...l,...a};return d.length>0&&(h.className=d),Object.keys(f).length>0&&(h.style=f),{props:h,internalRef:u.ref}}function kt(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,internalForwardedProps:s,shouldForwardComponentProp:a=!1,...l}=t,{component:u,slots:d={[e]:void 0},slotProps:f={[e]:void 0},...h}=i,p=d[e]||r,m=br(f[e],o),{props:{component:b,...y},internalRef:x}=f2({className:n,...l,externalForwardedProps:e==="root"?h:void 0,externalSlotProps:m}),C=vt(x,m?.ref,t.ref),v=e==="root"?b||u:b,S=d2(p,{...e==="root"&&!u&&!d[e]&&s,...e!=="root"&&!d[e]&&s,...y,...v&&!a&&{as:v},...v&&a&&{component:v},ref:C},o);return[p,S]}const xF=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,i={root:["root",n&&"checked",r&&"disabled",o&&`edge${Fe(o)}`],input:["input"]};return Ke(i,yF,t)},CF=fe(pi,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),EF=fe("input",{name:"MuiSwitchBase",shouldForwardProp:$n})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),vF=M.forwardRef(function(t,n){const{autoFocus:r,checked:o,checkedIcon:i,defaultChecked:s,disabled:a,disableFocusRipple:l=!1,edge:u=!1,icon:d,id:f,inputProps:h,inputRef:p,name:m,onBlur:b,onChange:y,onFocus:x,readOnly:C,required:v=!1,tabIndex:S,type:I,value:T,slots:N={},slotProps:O={},...F}=t,[B,j]=or({controlled:o,default:!!s,name:"SwitchBase",state:"checked"}),D=ar(),H=J=>{x&&x(J),D&&D.onFocus&&D.onFocus(J)},_=J=>{b&&b(J),D&&D.onBlur&&D.onBlur(J)},L=J=>{if(J.nativeEvent.defaultPrevented)return;const Q=J.target.checked;j(Q),y&&y(J,Q)};let $=a;D&&typeof $>"u"&&($=D.disabled);const K=I==="checkbox"||I==="radio",G={...t,checked:B,disabled:$,disableFocusRipple:l,edge:u},q=xF(G),R={slots:N,slotProps:{input:h,...O}},[oe,se]=kt("root",{ref:n,elementType:CF,className:q.root,shouldForwardComponentProp:!0,externalForwardedProps:{...R,component:"span",...F},getSlotProps:J=>({...J,onFocus:Q=>{J.onFocus?.(Q),H(Q)},onBlur:Q=>{J.onBlur?.(Q),_(Q)}}),ownerState:G,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:$,role:void 0,tabIndex:null}}),[z,pe]=kt("input",{ref:p,elementType:EF,className:q.input,externalForwardedProps:R,getSlotProps:J=>({...J,onChange:Q=>{J.onChange?.(Q),L(Q)}}),ownerState:G,additionalProps:{autoFocus:r,checked:o,defaultChecked:s,disabled:$,id:K?f:void 0,name:m,readOnly:C,required:v,tabIndex:S,type:I,...I==="checkbox"&&T===void 0?{}:{value:T}}});return c.jsxs(oe,{...se,children:[c.jsx(z,{...pe}),B?i:d]})}),TF=mt(c.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),SF=mt(c.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),kF=mt(c.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function wF(e){return Ge("MuiCheckbox",e)}const Rd=We("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),DF=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i={root:["root",n&&"indeterminate",`color${Fe(r)}`,`size${Fe(o)}`]},s=Ke(i,wF,t);return{...t,...s}},IF=fe(vF,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${Fe(n.size)}`],n.color!=="default"&&t[`color${Fe(n.color)}`]]}})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{[`&.${Rd.checked}, &.${Rd.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Rd.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),AF=c.jsx(SF,{}),OF=c.jsx(TF,{}),MF=c.jsx(kF,{}),Pp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiCheckbox"}),{checkedIcon:o=AF,color:i="primary",icon:s=OF,indeterminate:a=!1,indeterminateIcon:l=MF,inputProps:u,size:d="medium",disableRipple:f=!1,className:h,slots:p={},slotProps:m={},...b}=r,y=a?l:s,x=a?l:o,C={...r,disableRipple:f,color:i,indeterminate:a,size:d},v=DF(C),S=m.input??u,[I,T]=kt("root",{ref:n,elementType:IF,className:Ue(v.root,h),shouldForwardComponentProp:!0,externalForwardedProps:{slots:p,slotProps:m,...b},ownerState:C,additionalProps:{type:"checkbox",icon:M.cloneElement(y,{fontSize:y.props.fontSize??d}),checkedIcon:M.cloneElement(x,{fontSize:x.props.fontSize??d}),disableRipple:f,slots:p,slotProps:{input:Eb(typeof S=="function"?S(C):S,{"data-indeterminate":a})}}});return c.jsx(I,{...T,classes:v})});function p2(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function PF(e){const t=mn(e);return t.body===e?bo(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Ha(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function bg(e){return parseInt(bo(e).getComputedStyle(e).paddingRight,10)||0}function RF(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function yg(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,s=>{const a=!i.includes(s),l=!RF(s);a&&l&&Ha(s,o)})}function Nd(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function NF(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(PF(r)){const s=p2(bo(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${bg(r)+s}px`;const a=mn(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${bg(l)+s}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=mn(r).body;else{const s=r.parentElement,a=bo(r);i=s?.nodeName==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{n.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function FF(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class LF{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&Ha(t.modalRef,!1);const o=FF(n);yg(n,t.mount,t.modalRef,o,!0);const i=Nd(this.containers,s=>s.container===n);return i!==-1?(this.containers[i].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=Nd(this.containers,i=>i.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=NF(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=Nd(this.containers,s=>s.modals.includes(t)),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(r,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&Ha(t.modalRef,n),yg(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&Ha(s.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function Ms(e){return parseInt(M.version,10)>=19?e?.props?.ref||null:e?.ref||null}const _F=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function BF(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function jF(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function $F(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||jF(e))}function HF(e){const t=[],n=[];return Array.from(e.querySelectorAll(_F)).forEach((r,o)=>{const i=BF(r);i===-1||!$F(r)||(i===0?t.push(r):n.push({documentOrder:o,tabIndex:i,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function zF(){return!0}function h2(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=HF,isEnabled:s=zF,open:a}=e,l=M.useRef(!1),u=M.useRef(null),d=M.useRef(null),f=M.useRef(null),h=M.useRef(null),p=M.useRef(!1),m=M.useRef(null),b=vt(Ms(t),m),y=M.useRef(null);M.useEffect(()=>{!a||!m.current||(p.current=!n)},[n,a]),M.useEffect(()=>{if(!a||!m.current)return;const v=mn(m.current);return m.current.contains(v.activeElement)||(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),p.current&&m.current.focus()),()=>{o||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),M.useEffect(()=>{if(!a||!m.current)return;const v=mn(m.current),S=N=>{y.current=N,!(r||!s()||N.key!=="Tab")&&v.activeElement===m.current&&N.shiftKey&&(l.current=!0,d.current&&d.current.focus())},I=()=>{const N=m.current;if(N===null)return;if(!v.hasFocus()||!s()||l.current){l.current=!1;return}if(N.contains(v.activeElement)||r&&v.activeElement!==u.current&&v.activeElement!==d.current)return;if(v.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!p.current)return;let O=[];if((v.activeElement===u.current||v.activeElement===d.current)&&(O=i(m.current)),O.length>0){const F=!!(y.current?.shiftKey&&y.current?.key==="Tab"),B=O[0],j=O[O.length-1];typeof B!="string"&&typeof j!="string"&&(F?j.focus():B.focus())}else N.focus()};v.addEventListener("focusin",I),v.addEventListener("keydown",S,!0);const T=setInterval(()=>{v.activeElement&&v.activeElement.tagName==="BODY"&&I()},50);return()=>{clearInterval(T),v.removeEventListener("focusin",I),v.removeEventListener("keydown",S,!0)}},[n,r,o,s,a,i]);const x=v=>{f.current===null&&(f.current=v.relatedTarget),p.current=!0,h.current=v.target;const S=t.props.onFocus;S&&S(v)},C=v=>{f.current===null&&(f.current=v.relatedTarget),p.current=!0};return c.jsxs(M.Fragment,{children:[c.jsx("div",{tabIndex:a?0:-1,onFocus:C,ref:u,"data-testid":"sentinelStart"}),M.cloneElement(t,{ref:b,onFocus:x}),c.jsx("div",{tabIndex:a?0:-1,onFocus:C,ref:d,"data-testid":"sentinelEnd"})]})}function UF(e){return typeof e=="function"?e():e}const m2=M.forwardRef(function(t,n){const{children:r,container:o,disablePortal:i=!1}=t,[s,a]=M.useState(null),l=vt(M.isValidElement(r)?Ms(r):null,n);if(yn(()=>{i||a(UF(o)||document.body)},[o,i]),yn(()=>{if(s&&!i)return Zd(n,s),()=>{Zd(n,null)}},[n,s,i]),i){if(M.isValidElement(r)){const u={ref:l};return M.cloneElement(r,u)}return r}return s&&iT.createPortal(r,s)}),g2=e=>e.scrollTop;function ms(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}const VF={entering:{opacity:1},entered:{opacity:1}},hi=M.forwardRef(function(t,n){const r=Lo(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:u,onEnter:d,onEntered:f,onEntering:h,onExit:p,onExited:m,onExiting:b,style:y,timeout:x=o,TransitionComponent:C=Dr,...v}=t,S=M.useRef(null),I=vt(S,Ms(a),n),T=_=>L=>{if(_){const $=S.current;L===void 0?_($):_($,L)}},N=T(h),O=T((_,L)=>{g2(_);const $=ms({style:y,timeout:x,easing:l},{mode:"enter"});_.style.webkitTransition=r.transitions.create("opacity",$),_.style.transition=r.transitions.create("opacity",$),d&&d(_,L)}),F=T(f),B=T(b),j=T(_=>{const L=ms({style:y,timeout:x,easing:l},{mode:"exit"});_.style.webkitTransition=r.transitions.create("opacity",L),_.style.transition=r.transitions.create("opacity",L),p&&p(_)}),D=T(m),H=_=>{i&&i(S.current,_)};return c.jsx(C,{appear:s,in:u,nodeRef:S,onEnter:O,onEntered:F,onEntering:N,onExit:j,onExited:D,onExiting:B,addEndListener:H,timeout:x,...v,children:(_,{ownerState:L,...$})=>M.cloneElement(a,{style:{opacity:0,visibility:_==="exited"&&!u?"hidden":void 0,...VF[_],...y,...a.props.style},ref:I,...$})})});function WF(e){return Ge("MuiBackdrop",e)}We("MuiBackdrop",["root","invisible"]);const qF=e=>{const{classes:t,invisible:n}=e;return Ke({root:["root",n&&"invisible"]},WF,t)},YF=fe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),b2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiBackdrop"}),{children:o,className:i,component:s="div",invisible:a=!1,open:l,components:u={},componentsProps:d={},slotProps:f={},slots:h={},TransitionComponent:p,transitionDuration:m,...b}=r,y={...r,component:s,invisible:a},x=qF(y),C={transition:p,root:u.Root,...h},v={...d,...f},S={component:s,slots:C,slotProps:v},[I,T]=kt("root",{elementType:YF,externalForwardedProps:S,className:Ue(x.root,i),ownerState:y}),[N,O]=kt("transition",{elementType:hi,externalForwardedProps:S,ownerState:y});return c.jsx(N,{in:l,timeout:m,...b,...O,children:c.jsx(I,{"aria-hidden":!0,...T,classes:x,ref:n,children:o})})});function KF(e){return typeof e=="function"?e():e}function GF(e){return e?e.props.hasOwnProperty("in"):!1}const xg=()=>{},Ql=new LF;function QF(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:o=!1,onTransitionEnter:i,onTransitionExited:s,children:a,onClose:l,open:u,rootRef:d}=e,f=M.useRef({}),h=M.useRef(null),p=M.useRef(null),m=vt(p,d),[b,y]=M.useState(!u),x=GF(a);let C=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(C=!1);const v=()=>mn(h.current),S=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),I=()=>{Ql.mount(S(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},T=Ve(()=>{const L=KF(t)||v().body;Ql.add(S(),L),p.current&&I()}),N=()=>Ql.isTopModal(S()),O=Ve(L=>{h.current=L,L&&(u&&N()?I():p.current&&Ha(p.current,C))}),F=M.useCallback(()=>{Ql.remove(S(),C)},[C]);M.useEffect(()=>()=>{F()},[F]),M.useEffect(()=>{u?T():(!x||!o)&&F()},[u,F,x,o,T]);const B=L=>$=>{L.onKeyDown?.($),!($.key!=="Escape"||$.which===229||!N())&&(n||($.stopPropagation(),l&&l($,"escapeKeyDown")))},j=L=>$=>{L.onClick?.($),$.target===$.currentTarget&&l&&l($,"backdropClick")};return{getRootProps:(L={})=>{const $=Ln(e);delete $.onTransitionEnter,delete $.onTransitionExited;const K={...$,...L};return{role:"presentation",...K,onKeyDown:B(K),ref:m}},getBackdropProps:(L={})=>{const $=L;return{"aria-hidden":!0,...$,onClick:j($),open:u}},getTransitionProps:()=>{const L=()=>{y(!1),i&&i()},$=()=>{y(!0),s&&s(),o&&F()};return{onEnter:lm(L,a?.props.onEnter??xg),onExited:lm($,a?.props.onExited??xg)}},rootRef:m,portalRef:O,isTopModal:N,exited:b,hasTransition:x}}function XF(e){return Ge("MuiModal",e)}We("MuiModal",["root","hidden","backdrop"]);const ZF=e=>{const{open:t,exited:n,classes:r}=e;return Ke({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},XF,r)},JF=fe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(ft(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),e8=fe(b2,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),y2=M.forwardRef(function(t,n){const r=ut({name:"MuiModal",props:t}),{BackdropComponent:o=e8,BackdropProps:i,classes:s,className:a,closeAfterTransition:l=!1,children:u,container:d,component:f,components:h={},componentsProps:p={},disableAutoFocus:m=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:y=!1,disablePortal:x=!1,disableRestoreFocus:C=!1,disableScrollLock:v=!1,hideBackdrop:S=!1,keepMounted:I=!1,onClose:T,onTransitionEnter:N,onTransitionExited:O,open:F,slotProps:B={},slots:j={},theme:D,...H}=r,_={...r,closeAfterTransition:l,disableAutoFocus:m,disableEnforceFocus:b,disableEscapeKeyDown:y,disablePortal:x,disableRestoreFocus:C,disableScrollLock:v,hideBackdrop:S,keepMounted:I},{getRootProps:L,getBackdropProps:$,getTransitionProps:K,portalRef:G,isTopModal:q,exited:R,hasTransition:oe}=QF({..._,rootRef:n}),se={..._,exited:R},z=ZF(se),pe={};if(u.props.tabIndex===void 0&&(pe.tabIndex="-1"),oe){const{onEnter:ie,onExited:Z}=K();pe.onEnter=ie,pe.onExited=Z}const J={slots:{root:h.Root,backdrop:h.Backdrop,...j},slotProps:{...p,...B}},[Q,re]=kt("root",{ref:n,elementType:JF,externalForwardedProps:{...J,...H,component:f},getSlotProps:L,ownerState:se,className:Ue(a,z?.root,!se.open&&se.exited&&z?.hidden)}),[ne,ae]=kt("backdrop",{ref:i?.ref,elementType:o,externalForwardedProps:J,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:ie=>$({...ie,onClick:Z=>{ie?.onClick&&ie.onClick(Z)}}),className:Ue(i?.className,z?.backdrop),ownerState:se});return!I&&!F&&(!oe||R)?null:c.jsx(m2,{ref:G,container:d,disablePortal:x,children:c.jsxs(Q,{...re,children:[!S&&o?c.jsx(ne,{...ae}):null,c.jsx(h2,{disableEnforceFocus:b,disableAutoFocus:m,disableRestoreFocus:C,isEnabled:q,open:F,children:M.cloneElement(u,pe)})]})})});function t8(e){return Ge("MuiPaper",e)}We("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const n8=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Ke(i,t8,o)},r8=fe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(ft(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Ci=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiPaper"}),o=Lo(),{className:i,component:s="div",elevation:a=1,square:l=!1,variant:u="elevation",...d}=r,f={...r,component:s,elevation:a,square:l,variant:u},h=n8(f);return c.jsx(r8,{as:s,ownerState:f,className:Ue(h.root,i),ref:n,...d,style:{...u==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[a],...o.vars&&{"--Paper-overlay":o.vars.overlays?.[a]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Iu("#fff",Xd(a))}, ${Iu("#fff",Xd(a))})`}},...d.style}})});function o8(e){return Ge("MuiDialog",e)}const za=We("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),x2=M.createContext({}),i8=fe(b2,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),s8=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:i}=e,s={root:["root"],container:["container",`scroll${Fe(n)}`],paper:["paper",`paperScroll${Fe(n)}`,`paperWidth${Fe(String(r))}`,o&&"paperFullWidth",i&&"paperFullScreen"]};return Ke(s,o8,t)},a8=fe(y2,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),l8=fe("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Fe(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),u8=fe(Ci,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Fe(n.scroll)}`],t[`paperWidth${Fe(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(ft(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${za.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${za.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${za.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),no=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialog"}),o=Lo(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,"aria-modal":l=!0,BackdropComponent:u,BackdropProps:d,children:f,className:h,disableEscapeKeyDown:p=!1,fullScreen:m=!1,fullWidth:b=!1,maxWidth:y="sm",onClick:x,onClose:C,open:v,PaperComponent:S=Ci,PaperProps:I={},scroll:T="paper",slots:N={},slotProps:O={},TransitionComponent:F=hi,transitionDuration:B=i,TransitionProps:j,...D}=r,H={...r,disableEscapeKeyDown:p,fullScreen:m,fullWidth:b,maxWidth:y,scroll:T},_=s8(H),L=M.useRef(),$=le=>{L.current=le.target===le.currentTarget},K=le=>{x&&x(le),L.current&&(L.current=null,C&&C(le,"backdropClick"))},G=_r(a),q=M.useMemo(()=>({titleId:G}),[G]),R={transition:F,...N},oe={transition:j,paper:I,backdrop:d,...O},se={slots:R,slotProps:oe},[z,pe]=kt("root",{elementType:a8,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:H,className:Ue(_.root,h),ref:n}),[J,Q]=kt("backdrop",{elementType:i8,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:H}),[re,ne]=kt("paper",{elementType:u8,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:H,className:Ue(_.paper,I.className)}),[ae,ie]=kt("container",{elementType:l8,externalForwardedProps:se,ownerState:H,className:_.container}),[Z,me]=kt("transition",{elementType:hi,externalForwardedProps:se,ownerState:H,additionalProps:{appear:!0,in:v,timeout:B,role:"presentation"}});return c.jsx(z,{closeAfterTransition:!0,slots:{backdrop:J},slotProps:{backdrop:{transitionDuration:B,as:u,...Q}},disableEscapeKeyDown:p,onClose:C,open:v,onClick:K,...pe,...D,children:c.jsx(Z,{...me,children:c.jsx(ae,{onMouseDown:$,...ie,children:c.jsx(re,{as:S,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":G,"aria-modal":l,...ne,children:c.jsx(x2.Provider,{value:q,children:f})})})})})});function c8(e){return Ge("MuiDialogActions",e)}We("MuiDialogActions",["root","spacing"]);const d8=e=>{const{classes:t,disableSpacing:n}=e;return Ke({root:["root",!n&&"spacing"]},c8,t)},f8=fe("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),ro=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:i=!1,...s}=r,a={...r,disableSpacing:i},l=d8(a);return c.jsx(f8,{className:Ue(l.root,o),ownerState:a,ref:n,...s})});function p8(e){return Ge("MuiDialogContent",e)}We("MuiDialogContent",["root","dividers"]);function h8(e){return Ge("MuiDialogTitle",e)}const m8=We("MuiDialogTitle",["root"]),g8=e=>{const{classes:t,dividers:n}=e;return Ke({root:["root",n&&"dividers"]},p8,t)},b8=fe("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(ft(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${m8.root} + &`]:{paddingTop:0}}}]}))),oo=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogContent"}),{className:o,dividers:i=!1,...s}=r,a={...r,dividers:i},l=g8(a);return c.jsx(b8,{className:Ue(l.root,o),ownerState:a,ref:n,...s})});function y8(e){return Ge("MuiTypography",e)}const Cg=We("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),x8={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},C8=Dk(),E8=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Fe(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Ke(a,y8,s)},v8=fe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Fe(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(ft(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${Fe(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),Eg={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Dt=M.forwardRef(function(t,n){const{color:r,...o}=ut({props:t,name:"MuiTypography"}),i=!x8[r],s=C8({...o,...i&&{color:r}}),{align:a="inherit",className:l,component:u,gutterBottom:d=!1,noWrap:f=!1,paragraph:h=!1,variant:p="body1",variantMapping:m=Eg,...b}=s,y={...s,align:a,color:r,className:l,component:u,gutterBottom:d,noWrap:f,paragraph:h,variant:p,variantMapping:m},x=u||(h?"p":m[p]||Eg[p])||"span",C=E8(y);return c.jsx(v8,{as:x,ref:n,className:Ue(C.root,l),...b,ownerState:y,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...b.style}})}),T8=e=>{const{classes:t}=e;return Ke({root:["root"]},h8,t)},S8=fe(Dt,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),Eo=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogTitle"}),{className:o,id:i,...s}=r,a=r,l=T8(a),{titleId:u=i}=M.useContext(x2);return c.jsx(S8,{component:"h2",className:Ue(l.root,o),ownerState:a,ref:n,variant:"h6",id:i??u,...s})});function vg(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Vu(e,t=!1){return e&&(vg(e.value)&&e.value!==""||t&&vg(e.defaultValue)&&e.defaultValue!=="")}function k8(e){return e.startAdornment}function w8(e){return Ge("MuiFormControl",e)}We("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const D8=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${Fe(n)}`,r&&"fullWidth"]};return Ke(o,w8,t)},I8=fe("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Fe(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Wu=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormControl"}),{children:o,className:i,color:s="primary",component:a="div",disabled:l=!1,error:u=!1,focused:d,fullWidth:f=!1,hiddenLabel:h=!1,margin:p="none",required:m=!1,size:b="medium",variant:y="outlined",...x}=r,C={...r,color:s,component:a,disabled:l,error:u,fullWidth:f,hiddenLabel:h,margin:p,required:m,size:b,variant:y},v=D8(C),[S,I]=M.useState(()=>{let L=!1;return o&&M.Children.forEach(o,$=>{if(!ou($,["Input","Select"]))return;const K=ou($,["Select"])?$.props.input:$;K&&k8(K.props)&&(L=!0)}),L}),[T,N]=M.useState(()=>{let L=!1;return o&&M.Children.forEach(o,$=>{ou($,["Input","Select"])&&(Vu($.props,!0)||Vu($.props.inputProps,!0))&&(L=!0)}),L}),[O,F]=M.useState(!1);l&&O&&F(!1);const B=d!==void 0&&!l?d:O;let j;M.useRef(!1);const D=M.useCallback(()=>{N(!0)},[]),H=M.useCallback(()=>{N(!1)},[]),_=M.useMemo(()=>({adornedStart:S,setAdornedStart:I,color:s,disabled:l,error:u,filled:T,focused:B,fullWidth:f,hiddenLabel:h,size:b,onBlur:()=>{F(!1)},onFocus:()=>{F(!0)},onEmpty:H,onFilled:D,registerEffect:j,required:m,variant:y}),[S,s,l,u,T,B,f,h,j,H,D,m,b,y]);return c.jsx(kc.Provider,{value:_,children:c.jsx(I8,{as:a,ownerState:C,className:Ue(v.root,i),ref:n,...x,children:o})})});function A8(e){return Ge("MuiFormControlLabel",e)}const Ia=We("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);function Ei({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const O8=e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e,s={root:["root",n&&"disabled",`labelPlacement${Fe(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return Ke(s,A8,t)},M8=fe("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Ia.label}`]:t.label},t.root,t[`labelPlacement${Fe(n.labelPlacement)}`]]}})(ft(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Ia.disabled}`]:{cursor:"default"},[`& .${Ia.label}`]:{[`&.${Ia.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),P8=fe("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(ft(({theme:e})=>({[`&.${Ia.error}`]:{color:(e.vars||e).palette.error.main}}))),R8=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormControlLabel"}),{checked:o,className:i,componentsProps:s={},control:a,disabled:l,disableTypography:u,inputRef:d,label:f,labelPlacement:h="end",name:p,onChange:m,required:b,slots:y={},slotProps:x={},value:C,...v}=r,S=ar(),I=l??a.props.disabled??S?.disabled,T=b??a.props.required,N={disabled:I,required:T};["checked","name","onChange","value","inputRef"].forEach(L=>{typeof a.props[L]>"u"&&typeof r[L]<"u"&&(N[L]=r[L])});const O=Ei({props:r,muiFormControl:S,states:["error"]}),F={...r,disabled:I,labelPlacement:h,required:T,error:O.error},B=O8(F),j={slots:y,slotProps:{...s,...x}},[D,H]=kt("typography",{elementType:Dt,externalForwardedProps:j,ownerState:F});let _=f;return _!=null&&_.type!==Dt&&!u&&(_=c.jsx(D,{component:"span",...H,className:Ue(B.label,H?.className),children:_})),c.jsxs(M8,{className:Ue(B.root,i),ownerState:F,ref:n,...v,children:[M.cloneElement(a,N),T?c.jsxs("div",{children:[_,c.jsxs(P8,{ownerState:F,"aria-hidden":!0,className:B.asterisk,children:[" ","*"]})]}):_]})});function N8(e){return Ge("MuiIconButton",e)}const Tg=We("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),F8=e=>{const{classes:t,disabled:n,color:r,edge:o,size:i,loading:s}=e,a={root:["root",s&&"loading",n&&"disabled",r!=="default"&&`color${Fe(r)}`,o&&`edge${Fe(o)}`,`size${Fe(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Ke(a,N8,t)},L8=fe(pi,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Fe(n.color)}`],n.edge&&t[`edge${Fe(n.edge)}`],t[`size${Fe(n.size)}`]]}})(ft(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),ft(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${Tg.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${Tg.loading}`]:{color:"transparent"}}))),_8=fe("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Ir=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:u=!1,size:d="medium",id:f,loading:h=null,loadingIndicator:p,...m}=r,b=_r(f),y=p??c.jsx(Mp,{"aria-labelledby":b,color:"inherit",size:16}),x={...r,edge:o,color:a,disabled:l,disableFocusRipple:u,loading:h,loadingIndicator:y,size:d},C=F8(x);return c.jsxs(L8,{id:h?b:f,className:Ue(C.root,s),centerRipple:!0,focusRipple:!u,disabled:l||h,ref:n,...m,ownerState:x,children:[typeof h=="boolean"&&c.jsx("span",{className:C.loadingWrapper,style:{display:"contents"},children:c.jsx(_8,{className:C.loadingIndicator,ownerState:x,children:h&&y})}),i]})});function B8(e){return Ge("MuiListItemIcon",e)}const Sg=We("MuiListItemIcon",["root","alignItemsFlexStart"]),ho=M.createContext({}),j8=e=>{const{alignItems:t,classes:n}=e;return Ke({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},B8,n)},$8=fe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(ft(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),Rp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemIcon"}),{className:o,...i}=r,s=M.useContext(ho),a={...r,alignItems:s.alignItems},l=j8(a);return c.jsx($8,{className:Ue(l.root,o),ownerState:a,ref:n,...i})});function H8(e){return Ge("MuiListItemText",e)}const Zi=We("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),z8=e=>{const{classes:t,inset:n,primary:r,secondary:o,dense:i}=e;return Ke({root:["root",n&&"inset",i&&"dense",r&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},H8,t)},U8=fe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Zi.primary}`]:t.primary},{[`& .${Zi.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${Cg.root}:where(& .${Zi.primary})`]:{display:"block"},[`.${Cg.root}:where(& .${Zi.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),Np=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:u,secondary:d,secondaryTypographyProps:f,slots:h={},slotProps:p={},...m}=r,{dense:b}=M.useContext(ho);let y=l??o,x=d;const C={...r,disableTypography:s,inset:a,primary:!!y,secondary:!!x,dense:b},v=z8(C),S={slots:h,slotProps:{primary:u,secondary:f,...p}},[I,T]=kt("root",{className:Ue(v.root,i),elementType:U8,externalForwardedProps:{...S,...m},ownerState:C,ref:n}),[N,O]=kt("primary",{className:v.primary,elementType:Dt,externalForwardedProps:S,ownerState:C}),[F,B]=kt("secondary",{className:v.secondary,elementType:Dt,externalForwardedProps:S,ownerState:C});return y!=null&&y.type!==Dt&&!s&&(y=c.jsx(N,{variant:b?"body2":"body1",component:O?.variant?void 0:"span",...O,children:y})),x!=null&&x.type!==Dt&&!s&&(x=c.jsx(F,{variant:"body2",color:"textSecondary",...B,children:x})),c.jsxs(I,{...T,children:[y,x]})}),kg=We("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);function V8(e){return Ge("MuiMenuItem",e)}const ra=We("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),W8=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},q8=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:i,classes:s}=e,l=Ke({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",i&&"selected"]},V8,s);return{...s,...l}},Y8=fe(pi,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:W8})(ft(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ra.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${ra.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${ra.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${ra.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${ra.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${kg.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${kg.inset}`]:{marginLeft:52},[`& .${Zi.root}`]:{marginTop:0,marginBottom:0},[`& .${Zi.inset}`]:{paddingLeft:36},[`& .${Sg.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${Sg.root} svg`]:{fontSize:"1.25rem"}}}]}))),bn=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:u,role:d="menuitem",tabIndex:f,className:h,...p}=r,m=M.useContext(ho),b=M.useMemo(()=>({dense:s||m.dense||!1,disableGutters:l}),[m.dense,s,l]),y=M.useRef(null);yn(()=>{o&&y.current&&y.current.focus()},[o]);const x={...r,dense:b.dense,divider:a,disableGutters:l},C=q8(r),v=vt(y,n);let S;return r.disabled||(S=f!==void 0?f:-1),c.jsx(ho.Provider,{value:b,children:c.jsx(Y8,{ref:v,role:d,tabIndex:S,component:i,focusVisibleClassName:Ue(C.focusVisible,u),className:Ue(C.root,h),...p,ownerState:x,classes:C})})});function K8({materialization:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(!1),l=()=>i(!0),u=()=>{i(!1),a(!1),t()};return c.jsxs(W.Fragment,{children:[c.jsxs(bn,{"aria-label":`Delete materialization ${e?.id??""}`.trim(),onClick:d=>{d.stopPropagation(),l()},sx:{color:"error.main"},children:[c.jsx(Rp,{sx:{color:"inherit"},children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(Np,{children:"Delete"})]}),c.jsxs(no,{onClose:u,open:o,"aria-labelledby":"delete-materialization-title",children:[c.jsx(Eo,{sx:{m:0,p:2},id:"delete-materialization-title",children:"Delete Materialization"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:d=>({position:"absolute",right:8,top:8,color:d.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsxs(oo,{dividers:!0,children:[c.jsx(Dt,{gutterBottom:!0,children:"Are you sure you want to delete this materialization record? This action cannot be undone."}),c.jsx(R8,{control:c.jsx(Pp,{checked:s,onChange:d=>a(d.target.checked)}),label:"Also drop the materialized table(s) this run produced"})]}),c.jsx(ro,{children:c.jsx(tn,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(s),color:"error",children:"Delete"})})]})]})}function C2({materializations:e,mutable:t,isMutating:n,showPackage:r=!1,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a}){return e.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:"No materializations yet."}):c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[r&&c.jsx(w.TableCell,{children:"Package"}),c.jsx(w.TableCell,{children:"Status"}),c.jsx(w.TableCell,{children:"Trigger"}),c.jsx(w.TableCell,{children:"Started"}),c.jsx(w.TableCell,{children:"Duration"}),c.jsx(w.TableCell,{children:"Sources"}),c.jsx(w.TableCell,{align:"right",children:"Actions"})]})}),c.jsx(w.TableBody,{children:e.map(l=>c.jsx(G8,{materialization:l,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a},l.id))})]})}function G8({materialization:e,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a}){const[l,u]=W.useState(null),d=!!l,f=()=>u(null),h=r2(e),p=h.sourcesBuilt!==void 0||h.sourcesReused!==void 0?`${h.sourcesBuilt??0} built, ${h.sourcesReused??0} reused`:"-",m=Ja(e.status),b=TN(e.status),y=e.error??void 0,x=t&&(m||b);return c.jsxs(w.TableRow,{hover:!0,sx:{cursor:"pointer","&:focus-visible":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:"-2px"}},onClick:()=>a(e),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a(e))},role:"button",tabIndex:0,"aria-label":`View materialization ${e.id??""} details`.trim(),children:[r&&c.jsx(w.TableCell,{onClick:C=>C.stopPropagation(),children:o?c.jsx(w.Link,{component:"button",underline:"hover",onClick:()=>o(e.packageName??""),sx:{fontWeight:500},children:e.packageName}):e.packageName}),c.jsx(w.TableCell,{children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[c.jsx(w.Chip,{size:"small",label:t2(e.status),color:n2(e.status),variant:m?"filled":"outlined"}),y&&c.jsx(w.Tooltip,{title:y,children:c.jsx(Yx,{fontSize:"small",color:"error"})})]})}),c.jsx(w.TableCell,{children:c.jsx(i2,{meta:h})}),c.jsx(w.TableCell,{children:kN(e.startedAt??e.createdAt)}),c.jsx(w.TableCell,{children:o2(e.startedAt,e.completedAt)}),c.jsx(w.TableCell,{children:p}),c.jsx(w.TableCell,{align:"right",onClick:C=>C.stopPropagation(),children:x&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small","aria-label":`Materialization actions for ${e.id??""}`.trim(),onClick:C=>u(C.currentTarget),children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:l,open:d,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t&&m&&c.jsxs(w.MenuItem,{"aria-label":`Stop materialization ${e.id??""}`.trim(),disabled:n,onClick:()=>{f(),i(e)},children:[c.jsx(w.ListItemIcon,{children:c.jsx(IN,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Stop"})]}),t&&b&&c.jsx(K8,{materialization:e,isMutating:n,onCloseDialog:f,onDelete:C=>s(e,C)})]})]})})]})}var Go={},Xn={},oa={},Qo={},Fd={},wg;function Q8(){return wg||(wg=1,Object.defineProperty(Fd,"__esModule",{value:!0})),Fd}var ia={},sa={},Dg;function vi(){if(Dg)return sa;Dg=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.CronField=void 0;let e=class E2{#e=!1;#n=!1;#i=!1;#o=[];options={rawValue:""};static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(n,r={rawValue:""}){if(!Array.isArray(n))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(n.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...r,rawValue:r.rawValue??""},this.#o=n.sort(E2.sorter),this.#i=this.options.wildcard!==void 0?this.options.wildcard:this.#r(),this.#e=this.options.rawValue.includes("L")||n.includes("L"),this.#n=this.options.rawValue.includes("?")||n.includes("?")}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#n}get isWildcard(){return this.#i}get values(){return this.#o}static sorter(n,r){const o=typeof n=="number",i=typeof r=="number";return o&&i?n-r:!o&&!i?n.localeCompare(r):o?-1:1}static findNearestValueInList(n,r,o){if(o){for(let i=n.length-1;i>=0;i--)if(n[i]<r)return n[i];return null}for(let i=0;i<n.length;i++)if(n[i]>r)return n[i];return null}findNearestValue(n,r){return this.constructor.findNearestValueInList(this.values,n,r)}serialize(){return{wildcard:this.#i,values:this.#o}}validate(){let n;const r=this.chars.length>0?` or chars ${this.chars.join("")}`:"",o=l=>u=>new RegExp(`^\\d{0,2}${u}$`).test(l),i=l=>(n=l,typeof l=="number"?l>=this.min&&l<=this.max:this.chars.some(o(l)));if(!this.#o.every(i))throw new Error(`${this.constructor.name} Validation error, got value ${n} expected range ${this.min}-${this.max}${r}`);const a=this.#o.find((l,u)=>this.#o.indexOf(l)!==u);if(a)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${a}`)}#r(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(n,r)=>r+this.min).every(n=>this.#o.includes(n))}};return sa.CronField=e,sa}var Ig;function X8(){if(Ig)return ia;Ig=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.CronDayOfMonth=void 0;const e=vi(),t=1,n=31,r=Object.freeze(["L"]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return ia.CronDayOfMonth=o,ia}var aa={},Ag;function Z8(){if(Ag)return aa;Ag=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.CronDayOfWeek=void 0;const e=vi(),t=0,n=7,r=Object.freeze(["L"]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};return aa.CronDayOfWeek=o,aa}var la={},Og;function J8(){if(Og)return la;Og=1,Object.defineProperty(la,"__esModule",{value:!0}),la.CronHour=void 0;const e=vi(),t=0,n=23,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return la.CronHour=o,la}var ua={},Mg;function eL(){if(Mg)return ua;Mg=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.CronMinute=void 0;const e=vi(),t=0,n=59,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return ua.CronMinute=o,ua}var ca={},Ld={},Un={},Pg;function tL(){if(Pg)return Un;Pg=1,Object.defineProperty(Un,"__esModule",{value:!0});class e extends Error{}class t extends e{constructor(g){super(`Invalid DateTime: ${g.toMessage()}`)}}class n extends e{constructor(g){super(`Invalid Interval: ${g.toMessage()}`)}}class r extends e{constructor(g){super(`Invalid Duration: ${g.toMessage()}`)}}class o extends e{}class i extends e{constructor(g){super(`Invalid unit ${g}`)}}class s extends e{}class a extends e{constructor(){super("Zone is an abstract class")}}const l="numeric",u="short",d="long",f={year:l,month:l,day:l},h={year:l,month:u,day:l},p={year:l,month:u,day:l,weekday:u},m={year:l,month:d,day:l},b={year:l,month:d,day:l,weekday:d},y={hour:l,minute:l},x={hour:l,minute:l,second:l},C={hour:l,minute:l,second:l,timeZoneName:u},v={hour:l,minute:l,second:l,timeZoneName:d},S={hour:l,minute:l,hourCycle:"h23"},I={hour:l,minute:l,second:l,hourCycle:"h23"},T={hour:l,minute:l,second:l,hourCycle:"h23",timeZoneName:u},N={hour:l,minute:l,second:l,hourCycle:"h23",timeZoneName:d},O={year:l,month:l,day:l,hour:l,minute:l},F={year:l,month:l,day:l,hour:l,minute:l,second:l},B={year:l,month:u,day:l,hour:l,minute:l},j={year:l,month:u,day:l,hour:l,minute:l,second:l},D={year:l,month:u,day:l,weekday:u,hour:l,minute:l},H={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},_={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},L={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},$={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d};class K{get type(){throw new a}get name(){throw new a}get ianaName(){return this.name}get isUniversal(){throw new a}offsetName(g,k){throw new a}formatOffset(g,k){throw new a}offset(g){throw new a}equals(g){throw new a}get isValid(){throw new a}}let G=null;class q extends K{static get instance(){return G===null&&(G=new q),G}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(g,{format:k,locale:P}){return yh(g,k,P)}formatOffset(g,k){return Ls(this.offset(g),k)}offset(g){return-new Date(g).getTimezoneOffset()}equals(g){return g.type==="system"}get isValid(){return!0}}const R=new Map;function oe(A){let g=R.get(A);return g===void 0&&(g=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:A,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),R.set(A,g)),g}const se={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function z(A,g){const k=A.format(g).replace(/\u200E/g,""),P=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(k),[,U,ee,ce,de,ge,Be,et]=P;return[ce,U,ee,de,ge,Be,et]}function pe(A,g){const k=A.formatToParts(g),P=[];for(let U=0;U<k.length;U++){const{type:ee,value:ce}=k[U],de=se[ee];ee==="era"?P[de]=ce:je(de)||(P[de]=parseInt(ce,10))}return P}const J=new Map;class Q extends K{static create(g){let k=J.get(g);return k===void 0&&J.set(g,k=new Q(g)),k}static resetCache(){J.clear(),R.clear()}static isValidSpecifier(g){return this.isValidZone(g)}static isValidZone(g){if(!g)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:g}).format(),!0}catch{return!1}}constructor(g){super(),this.zoneName=g,this.valid=Q.isValidZone(g)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(g,{format:k,locale:P}){return yh(g,k,P,this.name)}formatOffset(g,k){return Ls(this.offset(g),k)}offset(g){if(!this.valid)return NaN;const k=new Date(g);if(isNaN(k))return NaN;const P=oe(this.name);let[U,ee,ce,de,ge,Be,et]=P.formatToParts?pe(P,k):z(P,k);de==="BC"&&(U=-Math.abs(U)+1);const Ut=Ol({year:U,month:ee,day:ce,hour:ge===24?0:ge,minute:Be,second:et,millisecond:0});let it=+k;const fn=it%1e3;return it-=fn>=0?fn:1e3+fn,(Ut-it)/(60*1e3)}equals(g){return g.type==="iana"&&g.name===this.name}get isValid(){return this.valid}}let re={};function ne(A,g={}){const k=JSON.stringify([A,g]);let P=re[k];return P||(P=new Intl.ListFormat(A,g),re[k]=P),P}const ae=new Map;function ie(A,g={}){const k=JSON.stringify([A,g]);let P=ae.get(k);return P===void 0&&(P=new Intl.DateTimeFormat(A,g),ae.set(k,P)),P}const Z=new Map;function me(A,g={}){const k=JSON.stringify([A,g]);let P=Z.get(k);return P===void 0&&(P=new Intl.NumberFormat(A,g),Z.set(k,P)),P}const le=new Map;function ue(A,g={}){const{base:k,...P}=g,U=JSON.stringify([A,P]);let ee=le.get(U);return ee===void 0&&(ee=new Intl.RelativeTimeFormat(A,g),le.set(U,ee)),ee}let Ie=null;function Ce(){return Ie||(Ie=new Intl.DateTimeFormat().resolvedOptions().locale,Ie)}const we=new Map;function ye(A){let g=we.get(A);return g===void 0&&(g=new Intl.DateTimeFormat(A).resolvedOptions(),we.set(A,g)),g}const ze=new Map;function Ne(A){let g=ze.get(A);if(!g){const k=new Intl.Locale(A);g="getWeekInfo"in k?k.getWeekInfo():k.weekInfo,"minimalDays"in g||(g={...Xe,...g}),ze.set(A,g)}return g}function nt(A){const g=A.indexOf("-x-");g!==-1&&(A=A.substring(0,g));const k=A.indexOf("-u-");if(k===-1)return[A];{let P,U;try{P=ie(A).resolvedOptions(),U=A}catch{const ge=A.substring(0,k);P=ie(ge).resolvedOptions(),U=ge}const{numberingSystem:ee,calendar:ce}=P;return[U,ee,ce]}}function _e(A,g,k){return(k||g)&&(A.includes("-u-")||(A+="-u"),k&&(A+=`-ca-${k}`),g&&(A+=`-nu-${g}`)),A}function Bt(A){const g=[];for(let k=1;k<=12;k++){const P=at.utc(2009,k,1);g.push(A(P))}return g}function yt(A){const g=[];for(let k=1;k<=7;k++){const P=at.utc(2016,11,13+k);g.push(A(P))}return g}function ot(A,g,k,P){const U=A.listingMode();return U==="error"?null:U==="en"?k(g):P(g)}function xe(A){return A.numberingSystem&&A.numberingSystem!=="latn"?!1:A.numberingSystem==="latn"||!A.locale||A.locale.startsWith("en")||ye(A.locale).numberingSystem==="latn"}class Pe{constructor(g,k,P){this.padTo=P.padTo||0,this.floor=P.floor||!1;const{padTo:U,floor:ee,...ce}=P;if(!k||Object.keys(ce).length>0){const de={useGrouping:!1,...P};P.padTo>0&&(de.minimumIntegerDigits=P.padTo),this.inf=me(g,de)}}format(g){if(this.inf){const k=this.floor?Math.floor(g):g;return this.inf.format(k)}else{const k=this.floor?Math.floor(g):jc(g,3);return dn(k,this.padTo)}}}class qe{constructor(g,k,P){this.opts=P,this.originalZone=void 0;let U;if(this.opts.timeZone)this.dt=g;else if(g.zone.type==="fixed"){const ce=-1*(g.offset/60),de=ce>=0?`Etc/GMT+${ce}`:`Etc/GMT${ce}`;g.offset!==0&&Q.create(de).valid?(U=de,this.dt=g):(U="UTC",this.dt=g.offset===0?g:g.setZone("UTC").plus({minutes:g.offset}),this.originalZone=g.zone)}else g.zone.type==="system"?this.dt=g:g.zone.type==="iana"?(this.dt=g,U=g.zone.name):(U="UTC",this.dt=g.setZone("UTC").plus({minutes:g.offset}),this.originalZone=g.zone);const ee={...this.opts};ee.timeZone=ee.timeZone||U,this.dtf=ie(k,ee)}format(){return this.originalZone?this.formatToParts().map(({value:g})=>g).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const g=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?g.map(k=>{if(k.type==="timeZoneName"){const P=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...k,value:P}}else return k}):g}resolvedOptions(){return this.dtf.resolvedOptions()}}class Je{constructor(g,k,P){this.opts={style:"long",...P},!k&&Ps()&&(this.rtf=ue(g,P))}format(g,k){return this.rtf?this.rtf.format(g,k):LE(k,g,this.opts.numeric,this.opts.style!=="long")}formatToParts(g,k){return this.rtf?this.rtf.formatToParts(g,k):[]}}const Xe={firstDay:1,minimalDays:4,weekend:[6,7]};class Re{static fromOpts(g){return Re.create(g.locale,g.numberingSystem,g.outputCalendar,g.weekSettings,g.defaultToEN)}static create(g,k,P,U,ee=!1){const ce=g||Pt.defaultLocale,de=ce||(ee?"en-US":Ce()),ge=k||Pt.defaultNumberingSystem,Be=P||Pt.defaultOutputCalendar,et=io(U)||Pt.defaultWeekSettings;return new Re(de,ge,Be,et,ce)}static resetCache(){Ie=null,ae.clear(),Z.clear(),le.clear(),we.clear(),ze.clear()}static fromObject({locale:g,numberingSystem:k,outputCalendar:P,weekSettings:U}={}){return Re.create(g,k,P,U)}constructor(g,k,P,U,ee){const[ce,de,ge]=nt(g);this.locale=ce,this.numberingSystem=k||de||null,this.outputCalendar=P||ge||null,this.weekSettings=U,this.intl=_e(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=ee,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=xe(this)),this.fastNumbersCached}listingMode(){const g=this.isEnglish(),k=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return g&&k?"en":"intl"}clone(g){return!g||Object.getOwnPropertyNames(g).length===0?this:Re.create(g.locale||this.specifiedLocale,g.numberingSystem||this.numberingSystem,g.outputCalendar||this.outputCalendar,io(g.weekSettings)||this.weekSettings,g.defaultToEN||!1)}redefaultToEN(g={}){return this.clone({...g,defaultToEN:!0})}redefaultToSystem(g={}){return this.clone({...g,defaultToEN:!1})}months(g,k=!1){return ot(this,g,Eh,()=>{const P=this.intl==="ja"||this.intl.startsWith("ja-");k&=!P;const U=k?{month:g,day:"numeric"}:{month:g},ee=k?"format":"standalone";if(!this.monthsCache[ee][g]){const ce=P?de=>this.dtFormatter(de,U).format():de=>this.extract(de,U,"month");this.monthsCache[ee][g]=Bt(ce)}return this.monthsCache[ee][g]})}weekdays(g,k=!1){return ot(this,g,Sh,()=>{const P=k?{weekday:g,year:"numeric",month:"long",day:"numeric"}:{weekday:g},U=k?"format":"standalone";return this.weekdaysCache[U][g]||(this.weekdaysCache[U][g]=yt(ee=>this.extract(ee,P,"weekday"))),this.weekdaysCache[U][g]})}meridiems(){return ot(this,void 0,()=>kh,()=>{if(!this.meridiemCache){const g={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[at.utc(2016,11,13,9),at.utc(2016,11,13,19)].map(k=>this.extract(k,g,"dayperiod"))}return this.meridiemCache})}eras(g){return ot(this,g,wh,()=>{const k={era:g};return this.eraCache[g]||(this.eraCache[g]=[at.utc(-40,1,1),at.utc(2017,1,1)].map(P=>this.extract(P,k,"era"))),this.eraCache[g]})}extract(g,k,P){const U=this.dtFormatter(g,k),ee=U.formatToParts(),ce=ee.find(de=>de.type.toLowerCase()===P);return ce?ce.value:null}numberFormatter(g={}){return new Pe(this.intl,g.forceSimple||this.fastNumbers,g)}dtFormatter(g,k={}){return new qe(g,this.intl,k)}relFormatter(g={}){return new Je(this.intl,this.isEnglish(),g)}listFormatter(g={}){return ne(this.intl,g)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ye(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Rs()?Ne(this.locale):Xe}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(g){return this.locale===g.locale&&this.numberingSystem===g.numberingSystem&&this.outputCalendar===g.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let ct=null;class lt extends K{static get utcInstance(){return ct===null&&(ct=new lt(0)),ct}static instance(g){return g===0?lt.utcInstance:new lt(g)}static parseSpecifier(g){if(g){const k=g.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(k)return new lt(Ml(k[1],k[2]))}return null}constructor(g){super(),this.fixed=g}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ls(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ls(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(g,k){return Ls(this.fixed,k)}get isUniversal(){return!0}offset(){return this.fixed}equals(g){return g.type==="fixed"&&g.fixed===this.fixed}get isValid(){return!0}}class Mt extends K{constructor(g){super(),this.zoneName=g}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function be(A,g){if(je(A)||A===null)return g;if(A instanceof K)return A;if(Qn(A)){const k=A.toLowerCase();return k==="default"?g:k==="local"||k==="system"?q.instance:k==="utc"||k==="gmt"?lt.utcInstance:lt.parseSpecifier(k)||Q.create(A)}else return zt(A)?lt.instance(A):typeof A=="object"&&"offset"in A&&typeof A.offset=="function"?A:new Mt(A)}const Ae={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Oe={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Qe=Ae.hanidec.replace(/[\[|\]]/g,"").split("");function st(A){let g=parseInt(A,10);if(isNaN(g)){g="";for(let k=0;k<A.length;k++){const P=A.charCodeAt(k);if(A[k].search(Ae.hanidec)!==-1)g+=Qe.indexOf(A[k]);else for(const U in Oe){const[ee,ce]=Oe[U];P>=ee&&P<=ce&&(g+=P-ee)}}return parseInt(g,10)}else return g}const Nt=new Map;function Gt(){Nt.clear()}function bt({numberingSystem:A},g=""){const k=A||"latn";let P=Nt.get(k);P===void 0&&(P=new Map,Nt.set(k,P));let U=P.get(g);return U===void 0&&(U=new RegExp(`${Ae[k]}${g}`),P.set(g,U)),U}let sn=()=>Date.now(),Rn="system",jt=null,gn=null,lr=null,Nn=60,jr,Hn=null;class Pt{static get now(){return sn}static set now(g){sn=g}static set defaultZone(g){Rn=g}static get defaultZone(){return be(Rn,q.instance)}static get defaultLocale(){return jt}static set defaultLocale(g){jt=g}static get defaultNumberingSystem(){return gn}static set defaultNumberingSystem(g){gn=g}static get defaultOutputCalendar(){return lr}static set defaultOutputCalendar(g){lr=g}static get defaultWeekSettings(){return Hn}static set defaultWeekSettings(g){Hn=io(g)}static get twoDigitCutoffYear(){return Nn}static set twoDigitCutoffYear(g){Nn=g%100}static get throwOnInvalid(){return jr}static set throwOnInvalid(g){jr=g}static resetCaches(){Re.resetCache(),Q.resetCache(),at.resetCache(),Gt()}}class xn{constructor(g,k){this.reason=g,this.explanation=k}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const To=[0,31,59,90,120,151,181,212,243,273,304,334],ki=[0,31,60,91,121,152,182,213,244,274,305,335];function wn(A,g){return new xn("unit out of range",`you specified ${g} (of type ${typeof g}) as a ${A}, which is invalid`)}function $o(A,g,k){const P=new Date(Date.UTC(A,g-1,k));A<100&&A>=0&&P.setUTCFullYear(P.getUTCFullYear()-1900);const U=P.getUTCDay();return U===0?7:U}function wi(A,g,k){return k+(Ns(A)?ki:To)[g-1]}function So(A,g){const k=Ns(A)?ki:To,P=k.findIndex(ee=>ee<g),U=g-k[P];return{month:P+1,day:U}}function nn(A,g){return(A-g+7)%7+1}function rn(A,g=4,k=1){const{year:P,month:U,day:ee}=A,ce=wi(P,U,ee),de=nn($o(P,U,ee),k);let ge=Math.floor((ce-de+14-g)/7),Be;return ge<1?(Be=P-1,ge=Fs(Be,g,k)):ge>Fs(P,g,k)?(Be=P+1,ge=1):Be=P,{weekYear:Be,weekNumber:ge,weekday:de,...Rl(A)}}function Ar(A,g=4,k=1){const{weekYear:P,weekNumber:U,weekday:ee}=A,ce=nn($o(P,1,g),k),de=Ii(P);let ge=U*7+ee-ce-7+g,Be;ge<1?(Be=P-1,ge+=Ii(Be)):ge>de?(Be=P+1,ge-=Ii(P)):Be=P;const{month:et,day:pt}=So(Be,ge);return{year:Be,month:et,day:pt,...Rl(A)}}function Ho(A){const{year:g,month:k,day:P}=A,U=wi(g,k,P);return{year:g,ordinal:U,...Rl(A)}}function ko(A){const{year:g,ordinal:k}=A,{month:P,day:U}=So(g,k);return{year:g,month:P,day:U,...Rl(A)}}function zo(A,g){if(!je(A.localWeekday)||!je(A.localWeekNumber)||!je(A.localWeekYear)){if(!je(A.weekday)||!je(A.weekNumber)||!je(A.weekYear))throw new o("Cannot mix locale-based week fields with ISO-based week fields");return je(A.localWeekday)||(A.weekday=A.localWeekday),je(A.localWeekNumber)||(A.weekNumber=A.localWeekNumber),je(A.localWeekYear)||(A.weekYear=A.localWeekYear),delete A.localWeekday,delete A.localWeekNumber,delete A.localWeekYear,{minDaysInFirstWeek:g.getMinDaysInFirstWeek(),startOfWeek:g.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function ke(A,g=4,k=1){const P=Wt(A.weekYear),U=ur(A.weekNumber,1,Fs(A.weekYear,g,k)),ee=ur(A.weekday,1,7);return P?U?ee?!1:wn("weekday",A.weekday):wn("week",A.weekNumber):wn("weekYear",A.weekYear)}function Te(A){const g=Wt(A.year),k=ur(A.ordinal,1,Ii(A.year));return g?k?!1:wn("ordinal",A.ordinal):wn("year",A.year)}function Ye(A){const g=Wt(A.year),k=ur(A.month,1,12),P=ur(A.day,1,Al(A.year,A.month));return g?k?P?!1:wn("day",A.day):wn("month",A.month):wn("year",A.year)}function rt(A){const{hour:g,minute:k,second:P,millisecond:U}=A,ee=ur(g,0,23)||g===24&&k===0&&P===0&&U===0,ce=ur(k,0,59),de=ur(P,0,59),ge=ur(U,0,999);return ee?ce?de?ge?!1:wn("millisecond",U):wn("second",P):wn("minute",k):wn("hour",g)}function je(A){return typeof A>"u"}function zt(A){return typeof A=="number"}function Wt(A){return typeof A=="number"&&A%1===0}function Qn(A){return typeof A=="string"}function Di(A){return Object.prototype.toString.call(A)==="[object Date]"}function Ps(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Rs(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Il(A){return Array.isArray(A)?A:[A]}function wt(A,g,k){if(A.length!==0)return A.reduce((P,U)=>{const ee=[g(U),U];return P&&k(P[0],ee[0])===P[0]?P:ee},null)[1]}function $r(A,g){return g.reduce((k,P)=>(k[P]=A[P],k),{})}function Fn(A,g){return Object.prototype.hasOwnProperty.call(A,g)}function io(A){if(A==null)return null;if(typeof A!="object")throw new s("Week settings must be an object");if(!ur(A.firstDay,1,7)||!ur(A.minimalDays,1,7)||!Array.isArray(A.weekend)||A.weekend.some(g=>!ur(g,1,7)))throw new s("Invalid week settings");return{firstDay:A.firstDay,minimalDays:A.minimalDays,weekend:Array.from(A.weekend)}}function ur(A,g,k){return Wt(A)&&A>=g&&A<=k}function kE(A,g){return A-g*Math.floor(A/g)}function dn(A,g=2){const k=A<0;let P;return k?P="-"+(""+-A).padStart(g,"0"):P=(""+A).padStart(g,"0"),P}function wo(A){if(!(je(A)||A===null||A===""))return parseInt(A,10)}function Uo(A){if(!(je(A)||A===null||A===""))return parseFloat(A)}function Bc(A){if(!(je(A)||A===null||A==="")){const g=parseFloat("0."+A)*1e3;return Math.floor(g)}}function jc(A,g,k="round"){const P=10**g;switch(k){case"expand":return A>0?Math.ceil(A*P)/P:Math.floor(A*P)/P;case"trunc":return Math.trunc(A*P)/P;case"round":return Math.round(A*P)/P;case"floor":return Math.floor(A*P)/P;case"ceil":return Math.ceil(A*P)/P;default:throw new RangeError(`Value rounding ${k} is out of range`)}}function Ns(A){return A%4===0&&(A%100!==0||A%400===0)}function Ii(A){return Ns(A)?366:365}function Al(A,g){const k=kE(g-1,12)+1,P=A+(g-k)/12;return k===2?Ns(P)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][k-1]}function Ol(A){let g=Date.UTC(A.year,A.month-1,A.day,A.hour,A.minute,A.second,A.millisecond);return A.year<100&&A.year>=0&&(g=new Date(g),g.setUTCFullYear(A.year,A.month-1,A.day)),+g}function bh(A,g,k){return-nn($o(A,1,g),k)+g-1}function Fs(A,g=4,k=1){const P=bh(A,g,k),U=bh(A+1,g,k);return(Ii(A)-P+U)/7}function $c(A){return A>99?A:A>Pt.twoDigitCutoffYear?1900+A:2e3+A}function yh(A,g,k,P=null){const U=new Date(A),ee={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};P&&(ee.timeZone=P);const ce={timeZoneName:g,...ee},de=new Intl.DateTimeFormat(k,ce).formatToParts(U).find(ge=>ge.type.toLowerCase()==="timezonename");return de?de.value:null}function Ml(A,g){let k=parseInt(A,10);Number.isNaN(k)&&(k=0);const P=parseInt(g,10)||0,U=k<0||Object.is(k,-0)?-P:P;return k*60+U}function xh(A){const g=Number(A);if(typeof A=="boolean"||A===""||!Number.isFinite(g))throw new s(`Invalid unit value ${A}`);return g}function Pl(A,g){const k={};for(const P in A)if(Fn(A,P)){const U=A[P];if(U==null)continue;k[g(P)]=xh(U)}return k}function Ls(A,g){const k=Math.trunc(Math.abs(A/60)),P=Math.trunc(Math.abs(A%60)),U=A>=0?"+":"-";switch(g){case"short":return`${U}${dn(k,2)}:${dn(P,2)}`;case"narrow":return`${U}${k}${P>0?`:${P}`:""}`;case"techie":return`${U}${dn(k,2)}${dn(P,2)}`;default:throw new RangeError(`Value format ${g} is out of range for property format`)}}function Rl(A){return $r(A,["hour","minute","second","millisecond"])}const wE=["January","February","March","April","May","June","July","August","September","October","November","December"],Ch=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DE=["J","F","M","A","M","J","J","A","S","O","N","D"];function Eh(A){switch(A){case"narrow":return[...DE];case"short":return[...Ch];case"long":return[...wE];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const vh=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Th=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],IE=["M","T","W","T","F","S","S"];function Sh(A){switch(A){case"narrow":return[...IE];case"short":return[...Th];case"long":return[...vh];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const kh=["AM","PM"],AE=["Before Christ","Anno Domini"],OE=["BC","AD"],ME=["B","A"];function wh(A){switch(A){case"narrow":return[...ME];case"short":return[...OE];case"long":return[...AE];default:return null}}function PE(A){return kh[A.hour<12?0:1]}function RE(A,g){return Sh(g)[A.weekday-1]}function NE(A,g){return Eh(g)[A.month-1]}function FE(A,g){return wh(g)[A.year<0?0:1]}function LE(A,g,k="always",P=!1){const U={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},ee=["hours","minutes","seconds"].indexOf(A)===-1;if(k==="auto"&&ee){const pt=A==="days";switch(g){case 1:return pt?"tomorrow":`next ${U[A][0]}`;case-1:return pt?"yesterday":`last ${U[A][0]}`;case 0:return pt?"today":`this ${U[A][0]}`}}const ce=Object.is(g,-0)||g<0,de=Math.abs(g),ge=de===1,Be=U[A],et=P?ge?Be[1]:Be[2]||Be[1]:ge?U[A][0]:A;return ce?`${de} ${et} ago`:`in ${de} ${et}`}function Dh(A,g){let k="";for(const P of A)P.literal?k+=P.val:k+=g(P.val);return k}const _E={D:f,DD:h,DDD:m,DDDD:b,t:y,tt:x,ttt:C,tttt:v,T:S,TT:I,TTT:T,TTTT:N,f:O,ff:B,fff:H,ffff:L,F,FF:j,FFF:_,FFFF:$};class Dn{static create(g,k={}){return new Dn(g,k)}static parseFormat(g){let k=null,P="",U=!1;const ee=[];for(let ce=0;ce<g.length;ce++){const de=g.charAt(ce);de==="'"?((P.length>0||U)&&ee.push({literal:U||/^\s+$/.test(P),val:P===""?"'":P}),k=null,P="",U=!U):U||de===k?P+=de:(P.length>0&&ee.push({literal:/^\s+$/.test(P),val:P}),P=de,k=de)}return P.length>0&&ee.push({literal:U||/^\s+$/.test(P),val:P}),ee}static macroTokenToFormatOpts(g){return _E[g]}constructor(g,k){this.opts=k,this.loc=g,this.systemLoc=null}formatWithSystemDefault(g,k){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(g,{...this.opts,...k}).format()}dtFormatter(g,k={}){return this.loc.dtFormatter(g,{...this.opts,...k})}formatDateTime(g,k){return this.dtFormatter(g,k).format()}formatDateTimeParts(g,k){return this.dtFormatter(g,k).formatToParts()}formatInterval(g,k){return this.dtFormatter(g.start,k).dtf.formatRange(g.start.toJSDate(),g.end.toJSDate())}resolvedOptions(g,k){return this.dtFormatter(g,k).resolvedOptions()}num(g,k=0,P=void 0){if(this.opts.forceSimple)return dn(g,k);const U={...this.opts};return k>0&&(U.padTo=k),P&&(U.signDisplay=P),this.loc.numberFormatter(U).format(g)}formatDateTimeFromString(g,k){const P=this.loc.listingMode()==="en",U=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",ee=(it,fn)=>this.loc.extract(g,it,fn),ce=it=>g.isOffsetFixed&&g.offset===0&&it.allowZ?"Z":g.isValid?g.zone.formatOffset(g.ts,it.format):"",de=()=>P?PE(g):ee({hour:"numeric",hourCycle:"h12"},"dayperiod"),ge=(it,fn)=>P?NE(g,it):ee(fn?{month:it}:{month:it,day:"numeric"},"month"),Be=(it,fn)=>P?RE(g,it):ee(fn?{weekday:it}:{weekday:it,month:"long",day:"numeric"},"weekday"),et=it=>{const fn=Dn.macroTokenToFormatOpts(it);return fn?this.formatWithSystemDefault(g,fn):it},pt=it=>P?FE(g,it):ee({era:it},"era"),Ut=it=>{switch(it){case"S":return this.num(g.millisecond);case"u":case"SSS":return this.num(g.millisecond,3);case"s":return this.num(g.second);case"ss":return this.num(g.second,2);case"uu":return this.num(Math.floor(g.millisecond/10),2);case"uuu":return this.num(Math.floor(g.millisecond/100));case"m":return this.num(g.minute);case"mm":return this.num(g.minute,2);case"h":return this.num(g.hour%12===0?12:g.hour%12);case"hh":return this.num(g.hour%12===0?12:g.hour%12,2);case"H":return this.num(g.hour);case"HH":return this.num(g.hour,2);case"Z":return ce({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return ce({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return ce({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return g.zone.offsetName(g.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return g.zone.offsetName(g.ts,{format:"long",locale:this.loc.locale});case"z":return g.zoneName;case"a":return de();case"d":return U?ee({day:"numeric"},"day"):this.num(g.day);case"dd":return U?ee({day:"2-digit"},"day"):this.num(g.day,2);case"c":return this.num(g.weekday);case"ccc":return Be("short",!0);case"cccc":return Be("long",!0);case"ccccc":return Be("narrow",!0);case"E":return this.num(g.weekday);case"EEE":return Be("short",!1);case"EEEE":return Be("long",!1);case"EEEEE":return Be("narrow",!1);case"L":return U?ee({month:"numeric",day:"numeric"},"month"):this.num(g.month);case"LL":return U?ee({month:"2-digit",day:"numeric"},"month"):this.num(g.month,2);case"LLL":return ge("short",!0);case"LLLL":return ge("long",!0);case"LLLLL":return ge("narrow",!0);case"M":return U?ee({month:"numeric"},"month"):this.num(g.month);case"MM":return U?ee({month:"2-digit"},"month"):this.num(g.month,2);case"MMM":return ge("short",!1);case"MMMM":return ge("long",!1);case"MMMMM":return ge("narrow",!1);case"y":return U?ee({year:"numeric"},"year"):this.num(g.year);case"yy":return U?ee({year:"2-digit"},"year"):this.num(g.year.toString().slice(-2),2);case"yyyy":return U?ee({year:"numeric"},"year"):this.num(g.year,4);case"yyyyyy":return U?ee({year:"numeric"},"year"):this.num(g.year,6);case"G":return pt("short");case"GG":return pt("long");case"GGGGG":return pt("narrow");case"kk":return this.num(g.weekYear.toString().slice(-2),2);case"kkkk":return this.num(g.weekYear,4);case"W":return this.num(g.weekNumber);case"WW":return this.num(g.weekNumber,2);case"n":return this.num(g.localWeekNumber);case"nn":return this.num(g.localWeekNumber,2);case"ii":return this.num(g.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(g.localWeekYear,4);case"o":return this.num(g.ordinal);case"ooo":return this.num(g.ordinal,3);case"q":return this.num(g.quarter);case"qq":return this.num(g.quarter,2);case"X":return this.num(Math.floor(g.ts/1e3));case"x":return this.num(g.ts);default:return et(it)}};return Dh(Dn.parseFormat(k),Ut)}formatDurationFromString(g,k){const P=this.opts.signMode==="negativeLargestOnly"?-1:1,U=et=>{switch(et[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},ee=(et,pt)=>Ut=>{const it=U(Ut);if(it){const fn=pt.isNegativeDuration&&it!==pt.largestUnit?P:1;let Mr;return this.opts.signMode==="negativeLargestOnly"&&it!==pt.largestUnit?Mr="never":this.opts.signMode==="all"?Mr="always":Mr="auto",this.num(et.get(it)*fn,Ut.length,Mr)}else return Ut},ce=Dn.parseFormat(k),de=ce.reduce((et,{literal:pt,val:Ut})=>pt?et:et.concat(Ut),[]),ge=g.shiftTo(...de.map(U).filter(et=>et)),Be={isNegativeDuration:ge<0,largestUnit:Object.keys(ge.values)[0]};return Dh(ce,ee(ge,Be))}}const Ih=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ai(...A){const g=A.reduce((k,P)=>k+P.source,"");return RegExp(`^${g}$`)}function Oi(...A){return g=>A.reduce(([k,P,U],ee)=>{const[ce,de,ge]=ee(g,U);return[{...k,...ce},de||P,ge]},[{},null,1]).slice(0,2)}function Mi(A,...g){if(A==null)return[null,null];for(const[k,P]of g){const U=k.exec(A);if(U)return P(U)}return[null,null]}function Ah(...A){return(g,k)=>{const P={};let U;for(U=0;U<A.length;U++)P[A[U]]=wo(g[k+U]);return[P,null,k+U]}}const Oh=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,BE=`(?:${Oh.source}?(?:\\[(${Ih.source})\\])?)?`,Hc=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Mh=RegExp(`${Hc.source}${BE}`),zc=RegExp(`(?:[Tt]${Mh.source})?`),jE=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,$E=/(\d{4})-?W(\d\d)(?:-?(\d))?/,HE=/(\d{4})-?(\d{3})/,zE=Ah("weekYear","weekNumber","weekDay"),UE=Ah("year","ordinal"),VE=/(\d{4})-(\d\d)-(\d\d)/,Ph=RegExp(`${Hc.source} ?(?:${Oh.source}|(${Ih.source}))?`),WE=RegExp(`(?: ${Ph.source})?`);function Pi(A,g,k){const P=A[g];return je(P)?k:wo(P)}function qE(A,g){return[{year:Pi(A,g),month:Pi(A,g+1,1),day:Pi(A,g+2,1)},null,g+3]}function Ri(A,g){return[{hours:Pi(A,g,0),minutes:Pi(A,g+1,0),seconds:Pi(A,g+2,0),milliseconds:Bc(A[g+3])},null,g+4]}function _s(A,g){const k=!A[g]&&!A[g+1],P=Ml(A[g+1],A[g+2]),U=k?null:lt.instance(P);return[{},U,g+3]}function Bs(A,g){const k=A[g]?Q.create(A[g]):null;return[{},k,g+1]}const YE=RegExp(`^T?${Hc.source}$`),KE=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function GE(A){const[g,k,P,U,ee,ce,de,ge,Be]=A,et=g[0]==="-",pt=ge&&ge[0]==="-",Ut=(it,fn=!1)=>it!==void 0&&(fn||it&&et)?-it:it;return[{years:Ut(Uo(k)),months:Ut(Uo(P)),weeks:Ut(Uo(U)),days:Ut(Uo(ee)),hours:Ut(Uo(ce)),minutes:Ut(Uo(de)),seconds:Ut(Uo(ge),ge==="-0"),milliseconds:Ut(Bc(Be),pt)}]}const QE={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Uc(A,g,k,P,U,ee,ce){const de={year:g.length===2?$c(wo(g)):wo(g),month:Ch.indexOf(k)+1,day:wo(P),hour:wo(U),minute:wo(ee)};return ce&&(de.second=wo(ce)),A&&(de.weekday=A.length>3?vh.indexOf(A)+1:Th.indexOf(A)+1),de}const XE=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ZE(A){const[,g,k,P,U,ee,ce,de,ge,Be,et,pt]=A,Ut=Uc(g,U,P,k,ee,ce,de);let it;return ge?it=QE[ge]:Be?it=0:it=Ml(et,pt),[Ut,new lt(it)]}function JE(A){return A.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ev=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,tv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,nv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Rh(A){const[,g,k,P,U,ee,ce,de]=A;return[Uc(g,U,P,k,ee,ce,de),lt.utcInstance]}function rv(A){const[,g,k,P,U,ee,ce,de]=A;return[Uc(g,de,k,P,U,ee,ce),lt.utcInstance]}const ov=Ai(jE,zc),iv=Ai($E,zc),sv=Ai(HE,zc),av=Ai(Mh),Nh=Oi(qE,Ri,_s,Bs),lv=Oi(zE,Ri,_s,Bs),uv=Oi(UE,Ri,_s,Bs),cv=Oi(Ri,_s,Bs);function dv(A){return Mi(A,[ov,Nh],[iv,lv],[sv,uv],[av,cv])}function fv(A){return Mi(JE(A),[XE,ZE])}function pv(A){return Mi(A,[ev,Rh],[tv,Rh],[nv,rv])}function hv(A){return Mi(A,[KE,GE])}const mv=Oi(Ri);function gv(A){return Mi(A,[YE,mv])}const bv=Ai(VE,WE),yv=Ai(Ph),xv=Oi(Ri,_s,Bs);function Cv(A){return Mi(A,[bv,Nh],[yv,xv])}const Fh="Invalid Duration",Lh={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Ev={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Lh},cr=146097/400,Ni=146097/4800,vv={years:{quarters:4,months:12,weeks:cr/7,days:cr,hours:cr*24,minutes:cr*24*60,seconds:cr*24*60*60,milliseconds:cr*24*60*60*1e3},quarters:{months:3,weeks:cr/28,days:cr/4,hours:cr*24/4,minutes:cr*24*60/4,seconds:cr*24*60*60/4,milliseconds:cr*24*60*60*1e3/4},months:{weeks:Ni/7,days:Ni,hours:Ni*24,minutes:Ni*24*60,seconds:Ni*24*60*60,milliseconds:Ni*24*60*60*1e3},...Lh},Vo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Tv=Vo.slice(0).reverse();function so(A,g,k=!1){const P={values:k?g.values:{...A.values,...g.values||{}},loc:A.loc.clone(g.loc),conversionAccuracy:g.conversionAccuracy||A.conversionAccuracy,matrix:g.matrix||A.matrix};return new It(P)}function _h(A,g){var k;let P=(k=g.milliseconds)!=null?k:0;for(const U of Tv.slice(1))g[U]&&(P+=g[U]*A[U].milliseconds);return P}function Bh(A,g){const k=_h(A,g)<0?-1:1;Vo.reduceRight((P,U)=>{if(je(g[U]))return P;if(P){const ee=g[P]*k,ce=A[U][P],de=Math.floor(ee/ce);g[U]+=de*k,g[P]-=de*ce*k}return U},null),Vo.reduce((P,U)=>{if(je(g[U]))return P;if(P){const ee=g[P]%1;g[P]-=ee,g[U]+=ee*A[P][U]}return U},null)}function jh(A){const g={};for(const[k,P]of Object.entries(A))P!==0&&(g[k]=P);return g}class It{constructor(g){const k=g.conversionAccuracy==="longterm"||!1;let P=k?vv:Ev;g.matrix&&(P=g.matrix),this.values=g.values,this.loc=g.loc||Re.create(),this.conversionAccuracy=k?"longterm":"casual",this.invalid=g.invalid||null,this.matrix=P,this.isLuxonDuration=!0}static fromMillis(g,k){return It.fromObject({milliseconds:g},k)}static fromObject(g,k={}){if(g==null||typeof g!="object")throw new s(`Duration.fromObject: argument expected to be an object, got ${g===null?"null":typeof g}`);return new It({values:Pl(g,It.normalizeUnit),loc:Re.fromObject(k),conversionAccuracy:k.conversionAccuracy,matrix:k.matrix})}static fromDurationLike(g){if(zt(g))return It.fromMillis(g);if(It.isDuration(g))return g;if(typeof g=="object")return It.fromObject(g);throw new s(`Unknown duration argument ${g} of type ${typeof g}`)}static fromISO(g,k){const[P]=hv(g);return P?It.fromObject(P,k):It.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static fromISOTime(g,k){const[P]=gv(g);return P?It.fromObject(P,k):It.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static invalid(g,k=null){if(!g)throw new s("need to specify a reason the Duration is invalid");const P=g instanceof xn?g:new xn(g,k);if(Pt.throwOnInvalid)throw new r(P);return new It({invalid:P})}static normalizeUnit(g){const k={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[g&&g.toLowerCase()];if(!k)throw new i(g);return k}static isDuration(g){return g&&g.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(g,k={}){const P={...k,floor:k.round!==!1&&k.floor!==!1};return this.isValid?Dn.create(this.loc,P).formatDurationFromString(this,g):Fh}toHuman(g={}){if(!this.isValid)return Fh;const k=g.showZeros!==!1,P=Vo.map(U=>{const ee=this.values[U];return je(ee)||ee===0&&!k?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...g,unit:U.slice(0,-1)}).format(ee)}).filter(U=>U);return this.loc.listFormatter({type:"conjunction",style:g.listStyle||"narrow",...g}).format(P)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let g="P";return this.years!==0&&(g+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(g+=this.months+this.quarters*3+"M"),this.weeks!==0&&(g+=this.weeks+"W"),this.days!==0&&(g+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(g+="T"),this.hours!==0&&(g+=this.hours+"H"),this.minutes!==0&&(g+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(g+=jc(this.seconds+this.milliseconds/1e3,3)+"S"),g==="P"&&(g+="T0S"),g}toISOTime(g={}){if(!this.isValid)return null;const k=this.toMillis();return k<0||k>=864e5?null:(g={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...g,includeOffset:!1},at.fromMillis(k,{zone:"UTC"}).toISOTime(g))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?_h(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g),P={};for(const U of Vo)(Fn(k.values,U)||Fn(this.values,U))&&(P[U]=k.get(U)+this.get(U));return so(this,{values:P},!0)}minus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g);return this.plus(k.negate())}mapUnits(g){if(!this.isValid)return this;const k={};for(const P of Object.keys(this.values))k[P]=xh(g(this.values[P],P));return so(this,{values:k},!0)}get(g){return this[It.normalizeUnit(g)]}set(g){if(!this.isValid)return this;const k={...this.values,...Pl(g,It.normalizeUnit)};return so(this,{values:k})}reconfigure({locale:g,numberingSystem:k,conversionAccuracy:P,matrix:U}={}){const ce={loc:this.loc.clone({locale:g,numberingSystem:k}),matrix:U,conversionAccuracy:P};return so(this,ce)}as(g){return this.isValid?this.shiftTo(g).get(g):NaN}normalize(){if(!this.isValid)return this;const g=this.toObject();return Bh(this.matrix,g),so(this,{values:g},!0)}rescale(){if(!this.isValid)return this;const g=jh(this.normalize().shiftToAll().toObject());return so(this,{values:g},!0)}shiftTo(...g){if(!this.isValid)return this;if(g.length===0)return this;g=g.map(ce=>It.normalizeUnit(ce));const k={},P={},U=this.toObject();let ee;for(const ce of Vo)if(g.indexOf(ce)>=0){ee=ce;let de=0;for(const Be in P)de+=this.matrix[Be][ce]*P[Be],P[Be]=0;zt(U[ce])&&(de+=U[ce]);const ge=Math.trunc(de);k[ce]=ge,P[ce]=(de*1e3-ge*1e3)/1e3}else zt(U[ce])&&(P[ce]=U[ce]);for(const ce in P)P[ce]!==0&&(k[ee]+=ce===ee?P[ce]:P[ce]/this.matrix[ee][ce]);return Bh(this.matrix,k),so(this,{values:k},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const g={};for(const k of Object.keys(this.values))g[k]=this.values[k]===0?0:-this.values[k];return so(this,{values:g},!0)}removeZeros(){if(!this.isValid)return this;const g=jh(this.values);return so(this,{values:g},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(g){if(!this.isValid||!g.isValid||!this.loc.equals(g.loc))return!1;function k(P,U){return P===void 0||P===0?U===void 0||U===0:P===U}for(const P of Vo)if(!k(this.values[P],g.values[P]))return!1;return!0}}const Fi="Invalid Interval";function Sv(A,g){return!A||!A.isValid?on.invalid("missing or invalid start"):!g||!g.isValid?on.invalid("missing or invalid end"):g<A?on.invalid("end before start",`The end of an interval must be after its start, but you had start=${A.toISO()} and end=${g.toISO()}`):null}class on{constructor(g){this.s=g.start,this.e=g.end,this.invalid=g.invalid||null,this.isLuxonInterval=!0}static invalid(g,k=null){if(!g)throw new s("need to specify a reason the Interval is invalid");const P=g instanceof xn?g:new xn(g,k);if(Pt.throwOnInvalid)throw new n(P);return new on({invalid:P})}static fromDateTimes(g,k){const P=zs(g),U=zs(k),ee=Sv(P,U);return ee??new on({start:P,end:U})}static after(g,k){const P=It.fromDurationLike(k),U=zs(g);return on.fromDateTimes(U,U.plus(P))}static before(g,k){const P=It.fromDurationLike(k),U=zs(g);return on.fromDateTimes(U.minus(P),U)}static fromISO(g,k){const[P,U]=(g||"").split("/",2);if(P&&U){let ee,ce;try{ee=at.fromISO(P,k),ce=ee.isValid}catch{ce=!1}let de,ge;try{de=at.fromISO(U,k),ge=de.isValid}catch{ge=!1}if(ce&&ge)return on.fromDateTimes(ee,de);if(ce){const Be=It.fromISO(U,k);if(Be.isValid)return on.after(ee,Be)}else if(ge){const Be=It.fromISO(P,k);if(Be.isValid)return on.before(de,Be)}}return on.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static isInterval(g){return g&&g.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(g="milliseconds"){return this.isValid?this.toDuration(g).get(g):NaN}count(g="milliseconds",k){if(!this.isValid)return NaN;const P=this.start.startOf(g,k);let U;return k!=null&&k.useLocaleWeeks?U=this.end.reconfigure({locale:P.locale}):U=this.end,U=U.startOf(g,k),Math.floor(U.diff(P,g).get(g))+(U.valueOf()!==this.end.valueOf())}hasSame(g){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,g):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(g){return this.isValid?this.s>g:!1}isBefore(g){return this.isValid?this.e<=g:!1}contains(g){return this.isValid?this.s<=g&&this.e>g:!1}set({start:g,end:k}={}){return this.isValid?on.fromDateTimes(g||this.s,k||this.e):this}splitAt(...g){if(!this.isValid)return[];const k=g.map(zs).filter(ce=>this.contains(ce)).sort((ce,de)=>ce.toMillis()-de.toMillis()),P=[];let{s:U}=this,ee=0;for(;U<this.e;){const ce=k[ee]||this.e,de=+ce>+this.e?this.e:ce;P.push(on.fromDateTimes(U,de)),U=de,ee+=1}return P}splitBy(g){const k=It.fromDurationLike(g);if(!this.isValid||!k.isValid||k.as("milliseconds")===0)return[];let{s:P}=this,U=1,ee;const ce=[];for(;P<this.e;){const de=this.start.plus(k.mapUnits(ge=>ge*U));ee=+de>+this.e?this.e:de,ce.push(on.fromDateTimes(P,ee)),P=ee,U+=1}return ce}divideEqually(g){return this.isValid?this.splitBy(this.length()/g).slice(0,g):[]}overlaps(g){return this.e>g.s&&this.s<g.e}abutsStart(g){return this.isValid?+this.e==+g.s:!1}abutsEnd(g){return this.isValid?+g.e==+this.s:!1}engulfs(g){return this.isValid?this.s<=g.s&&this.e>=g.e:!1}equals(g){return!this.isValid||!g.isValid?!1:this.s.equals(g.s)&&this.e.equals(g.e)}intersection(g){if(!this.isValid)return this;const k=this.s>g.s?this.s:g.s,P=this.e<g.e?this.e:g.e;return k>=P?null:on.fromDateTimes(k,P)}union(g){if(!this.isValid)return this;const k=this.s<g.s?this.s:g.s,P=this.e>g.e?this.e:g.e;return on.fromDateTimes(k,P)}static merge(g){const[k,P]=g.sort((U,ee)=>U.s-ee.s).reduce(([U,ee],ce)=>ee?ee.overlaps(ce)||ee.abutsStart(ce)?[U,ee.union(ce)]:[U.concat([ee]),ce]:[U,ce],[[],null]);return P&&k.push(P),k}static xor(g){let k=null,P=0;const U=[],ee=g.map(ge=>[{time:ge.s,type:"s"},{time:ge.e,type:"e"}]),ce=Array.prototype.concat(...ee),de=ce.sort((ge,Be)=>ge.time-Be.time);for(const ge of de)P+=ge.type==="s"?1:-1,P===1?k=ge.time:(k&&+k!=+ge.time&&U.push(on.fromDateTimes(k,ge.time)),k=null);return on.merge(U)}difference(...g){return on.xor([this].concat(g)).map(k=>this.intersection(k)).filter(k=>k&&!k.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Fi}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(g=f,k={}){return this.isValid?Dn.create(this.s.loc.clone(k),g).formatInterval(this):Fi}toISO(g){return this.isValid?`${this.s.toISO(g)}/${this.e.toISO(g)}`:Fi}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Fi}toISOTime(g){return this.isValid?`${this.s.toISOTime(g)}/${this.e.toISOTime(g)}`:Fi}toFormat(g,{separator:k=" – "}={}){return this.isValid?`${this.s.toFormat(g)}${k}${this.e.toFormat(g)}`:Fi}toDuration(g,k){return this.isValid?this.e.diff(this.s,g,k):It.invalid(this.invalidReason)}mapEndpoints(g){return on.fromDateTimes(g(this.s),g(this.e))}}class js{static hasDST(g=Pt.defaultZone){const k=at.now().setZone(g).set({month:12});return!g.isUniversal&&k.offset!==k.set({month:6}).offset}static isValidIANAZone(g){return Q.isValidZone(g)}static normalizeZone(g){return be(g,Pt.defaultZone)}static getStartOfWeek({locale:g=null,locObj:k=null}={}){return(k||Re.create(g)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:g=null,locObj:k=null}={}){return(k||Re.create(g)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:g=null,locObj:k=null}={}){return(k||Re.create(g)).getWeekendDays().slice()}static months(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null,outputCalendar:ee="gregory"}={}){return(U||Re.create(k,P,ee)).months(g)}static monthsFormat(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null,outputCalendar:ee="gregory"}={}){return(U||Re.create(k,P,ee)).months(g,!0)}static weekdays(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null}={}){return(U||Re.create(k,P,null)).weekdays(g)}static weekdaysFormat(g="long",{locale:k=null,numberingSystem:P=null,locObj:U=null}={}){return(U||Re.create(k,P,null)).weekdays(g,!0)}static meridiems({locale:g=null}={}){return Re.create(g).meridiems()}static eras(g="short",{locale:k=null}={}){return Re.create(k,null,"gregory").eras(g)}static features(){return{relative:Ps(),localeWeek:Rs()}}}function $h(A,g){const k=U=>U.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),P=k(g)-k(A);return Math.floor(It.fromMillis(P).as("days"))}function kv(A,g,k){const P=[["years",(ge,Be)=>Be.year-ge.year],["quarters",(ge,Be)=>Be.quarter-ge.quarter+(Be.year-ge.year)*4],["months",(ge,Be)=>Be.month-ge.month+(Be.year-ge.year)*12],["weeks",(ge,Be)=>{const et=$h(ge,Be);return(et-et%7)/7}],["days",$h]],U={},ee=A;let ce,de;for(const[ge,Be]of P)k.indexOf(ge)>=0&&(ce=ge,U[ge]=Be(A,g),de=ee.plus(U),de>g?(U[ge]--,A=ee.plus(U),A>g&&(de=A,U[ge]--,A=ee.plus(U))):A=de);return[A,U,de,ce]}function wv(A,g,k,P){let[U,ee,ce,de]=kv(A,g,k);const ge=g-U,Be=k.filter(pt=>["hours","minutes","seconds","milliseconds"].indexOf(pt)>=0);Be.length===0&&(ce<g&&(ce=U.plus({[de]:1})),ce!==U&&(ee[de]=(ee[de]||0)+ge/(ce-U)));const et=It.fromObject(ee,P);return Be.length>0?It.fromMillis(ge,P).shiftTo(...Be).plus(et):et}const Dv="missing Intl.DateTimeFormat.formatToParts support";function Rt(A,g=k=>k){return{regex:A,deser:([k])=>g(st(k))}}const Hh="[  ]",zh=new RegExp(Hh,"g");function Iv(A){return A.replace(/\./g,"\\.?").replace(zh,Hh)}function Uh(A){return A.replace(/\./g,"").replace(zh," ").toLowerCase()}function Or(A,g){return A===null?null:{regex:RegExp(A.map(Iv).join("|")),deser:([k])=>A.findIndex(P=>Uh(k)===Uh(P))+g}}function Vh(A,g){return{regex:A,deser:([,k,P])=>Ml(k,P),groups:g}}function Nl(A){return{regex:A,deser:([g])=>g}}function Av(A){return A.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ov(A,g){const k=bt(g),P=bt(g,"{2}"),U=bt(g,"{3}"),ee=bt(g,"{4}"),ce=bt(g,"{6}"),de=bt(g,"{1,2}"),ge=bt(g,"{1,3}"),Be=bt(g,"{1,6}"),et=bt(g,"{1,9}"),pt=bt(g,"{2,4}"),Ut=bt(g,"{4,6}"),it=Hr=>({regex:RegExp(Av(Hr.val)),deser:([_i])=>_i,literal:!0}),Mr=(Hr=>{if(A.literal)return it(Hr);switch(Hr.val){case"G":return Or(g.eras("short"),0);case"GG":return Or(g.eras("long"),0);case"y":return Rt(Be);case"yy":return Rt(pt,$c);case"yyyy":return Rt(ee);case"yyyyy":return Rt(Ut);case"yyyyyy":return Rt(ce);case"M":return Rt(de);case"MM":return Rt(P);case"MMM":return Or(g.months("short",!0),1);case"MMMM":return Or(g.months("long",!0),1);case"L":return Rt(de);case"LL":return Rt(P);case"LLL":return Or(g.months("short",!1),1);case"LLLL":return Or(g.months("long",!1),1);case"d":return Rt(de);case"dd":return Rt(P);case"o":return Rt(ge);case"ooo":return Rt(U);case"HH":return Rt(P);case"H":return Rt(de);case"hh":return Rt(P);case"h":return Rt(de);case"mm":return Rt(P);case"m":return Rt(de);case"q":return Rt(de);case"qq":return Rt(P);case"s":return Rt(de);case"ss":return Rt(P);case"S":return Rt(ge);case"SSS":return Rt(U);case"u":return Nl(et);case"uu":return Nl(de);case"uuu":return Rt(k);case"a":return Or(g.meridiems(),0);case"kkkk":return Rt(ee);case"kk":return Rt(pt,$c);case"W":return Rt(de);case"WW":return Rt(P);case"E":case"c":return Rt(k);case"EEE":return Or(g.weekdays("short",!1),1);case"EEEE":return Or(g.weekdays("long",!1),1);case"ccc":return Or(g.weekdays("short",!0),1);case"cccc":return Or(g.weekdays("long",!0),1);case"Z":case"ZZ":return Vh(new RegExp(`([+-]${de.source})(?::(${P.source}))?`),2);case"ZZZ":return Vh(new RegExp(`([+-]${de.source})(${P.source})?`),2);case"z":return Nl(/[a-z_+-/]{1,256}?/i);case" ":return Nl(/[^\S\n\r]/);default:return it(Hr)}})(A)||{invalidReason:Dv};return Mr.token=A,Mr}const Mv={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Pv(A,g,k){const{type:P,value:U}=A;if(P==="literal"){const ge=/^\s+$/.test(U);return{literal:!ge,val:ge?" ":U}}const ee=g[P];let ce=P;P==="hour"&&(g.hour12!=null?ce=g.hour12?"hour12":"hour24":g.hourCycle!=null?g.hourCycle==="h11"||g.hourCycle==="h12"?ce="hour12":ce="hour24":ce=k.hour12?"hour12":"hour24");let de=Mv[ce];if(typeof de=="object"&&(de=de[ee]),de)return{literal:!1,val:de}}function Rv(A){return[`^${A.map(k=>k.regex).reduce((k,P)=>`${k}(${P.source})`,"")}$`,A]}function Nv(A,g,k){const P=A.match(g);if(P){const U={};let ee=1;for(const ce in k)if(Fn(k,ce)){const de=k[ce],ge=de.groups?de.groups+1:1;!de.literal&&de.token&&(U[de.token.val[0]]=de.deser(P.slice(ee,ee+ge))),ee+=ge}return[P,U]}else return[P,{}]}function Fv(A){const g=ee=>{switch(ee){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let k=null,P;return je(A.z)||(k=Q.create(A.z)),je(A.Z)||(k||(k=new lt(A.Z)),P=A.Z),je(A.q)||(A.M=(A.q-1)*3+1),je(A.h)||(A.h<12&&A.a===1?A.h+=12:A.h===12&&A.a===0&&(A.h=0)),A.G===0&&A.y&&(A.y=-A.y),je(A.u)||(A.S=Bc(A.u)),[Object.keys(A).reduce((ee,ce)=>{const de=g(ce);return de&&(ee[de]=A[ce]),ee},{}),k,P]}let Vc=null;function Lv(){return Vc||(Vc=at.fromMillis(1555555555555)),Vc}function _v(A,g){if(A.literal)return A;const k=Dn.macroTokenToFormatOpts(A.val),P=Kh(k,g);return P==null||P.includes(void 0)?A:P}function Wh(A,g){return Array.prototype.concat(...A.map(k=>_v(k,g)))}class qh{constructor(g,k){if(this.locale=g,this.format=k,this.tokens=Wh(Dn.parseFormat(k),g),this.units=this.tokens.map(P=>Ov(P,g)),this.disqualifyingUnit=this.units.find(P=>P.invalidReason),!this.disqualifyingUnit){const[P,U]=Rv(this.units);this.regex=RegExp(P,"i"),this.handlers=U}}explainFromTokens(g){if(this.isValid){const[k,P]=Nv(g,this.regex,this.handlers),[U,ee,ce]=P?Fv(P):[null,null,void 0];if(Fn(P,"a")&&Fn(P,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:g,tokens:this.tokens,regex:this.regex,rawMatches:k,matches:P,result:U,zone:ee,specificOffset:ce}}else return{input:g,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Yh(A,g,k){return new qh(A,k).explainFromTokens(g)}function Bv(A,g,k){const{result:P,zone:U,specificOffset:ee,invalidReason:ce}=Yh(A,g,k);return[P,U,ee,ce]}function Kh(A,g){if(!A)return null;const P=Dn.create(g,A).dtFormatter(Lv()),U=P.formatToParts(),ee=P.resolvedOptions();return U.map(ce=>Pv(ce,A,ee))}const Wc="Invalid DateTime",Gh=864e13;function $s(A){return new xn("unsupported zone",`the zone "${A.name}" is not supported`)}function qc(A){return A.weekData===null&&(A.weekData=rn(A.c)),A.weekData}function Yc(A){return A.localWeekData===null&&(A.localWeekData=rn(A.c,A.loc.getMinDaysInFirstWeek(),A.loc.getStartOfWeek())),A.localWeekData}function Wo(A,g){const k={ts:A.ts,zone:A.zone,c:A.c,o:A.o,loc:A.loc,invalid:A.invalid};return new at({...k,...g,old:k})}function Qh(A,g,k){let P=A-g*60*1e3;const U=k.offset(P);if(g===U)return[P,g];P-=(U-g)*60*1e3;const ee=k.offset(P);return U===ee?[P,U]:[A-Math.min(U,ee)*60*1e3,Math.max(U,ee)]}function Fl(A,g){A+=g*60*1e3;const k=new Date(A);return{year:k.getUTCFullYear(),month:k.getUTCMonth()+1,day:k.getUTCDate(),hour:k.getUTCHours(),minute:k.getUTCMinutes(),second:k.getUTCSeconds(),millisecond:k.getUTCMilliseconds()}}function Ll(A,g,k){return Qh(Ol(A),g,k)}function Xh(A,g){const k=A.o,P=A.c.year+Math.trunc(g.years),U=A.c.month+Math.trunc(g.months)+Math.trunc(g.quarters)*3,ee={...A.c,year:P,month:U,day:Math.min(A.c.day,Al(P,U))+Math.trunc(g.days)+Math.trunc(g.weeks)*7},ce=It.fromObject({years:g.years-Math.trunc(g.years),quarters:g.quarters-Math.trunc(g.quarters),months:g.months-Math.trunc(g.months),weeks:g.weeks-Math.trunc(g.weeks),days:g.days-Math.trunc(g.days),hours:g.hours,minutes:g.minutes,seconds:g.seconds,milliseconds:g.milliseconds}).as("milliseconds"),de=Ol(ee);let[ge,Be]=Qh(de,k,A.zone);return ce!==0&&(ge+=ce,Be=A.zone.offset(ge)),{ts:ge,o:Be}}function Li(A,g,k,P,U,ee){const{setZone:ce,zone:de}=k;if(A&&Object.keys(A).length!==0||g){const ge=g||de,Be=at.fromObject(A,{...k,zone:ge,specificOffset:ee});return ce?Be:Be.setZone(de)}else return at.invalid(new xn("unparsable",`the input "${U}" can't be parsed as ${P}`))}function _l(A,g,k=!0){return A.isValid?Dn.create(Re.create("en-US"),{allowZ:k,forceSimple:!0}).formatDateTimeFromString(A,g):null}function Kc(A,g,k){const P=A.c.year>9999||A.c.year<0;let U="";if(P&&A.c.year>=0&&(U+="+"),U+=dn(A.c.year,P?6:4),k==="year")return U;if(g){if(U+="-",U+=dn(A.c.month),k==="month")return U;U+="-"}else if(U+=dn(A.c.month),k==="month")return U;return U+=dn(A.c.day),U}function Zh(A,g,k,P,U,ee,ce){let de=!k||A.c.millisecond!==0||A.c.second!==0,ge="";switch(ce){case"day":case"month":case"year":break;default:if(ge+=dn(A.c.hour),ce==="hour")break;if(g){if(ge+=":",ge+=dn(A.c.minute),ce==="minute")break;de&&(ge+=":",ge+=dn(A.c.second))}else{if(ge+=dn(A.c.minute),ce==="minute")break;de&&(ge+=dn(A.c.second))}if(ce==="second")break;de&&(!P||A.c.millisecond!==0)&&(ge+=".",ge+=dn(A.c.millisecond,3))}return U&&(A.isOffsetFixed&&A.offset===0&&!ee?ge+="Z":A.o<0?(ge+="-",ge+=dn(Math.trunc(-A.o/60)),ge+=":",ge+=dn(Math.trunc(-A.o%60))):(ge+="+",ge+=dn(Math.trunc(A.o/60)),ge+=":",ge+=dn(Math.trunc(A.o%60)))),ee&&(ge+="["+A.zone.ianaName+"]"),ge}const Jh={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},jv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},$v={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Bl=["year","month","day","hour","minute","second","millisecond"],Hv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],zv=["year","ordinal","hour","minute","second","millisecond"];function jl(A){const g={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[A.toLowerCase()];if(!g)throw new i(A);return g}function em(A){switch(A.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return jl(A)}}function Uv(A){if(Hs===void 0&&(Hs=Pt.now()),A.type!=="iana")return A.offset(Hs);const g=A.name;let k=Gc.get(g);return k===void 0&&(k=A.offset(Hs),Gc.set(g,k)),k}function tm(A,g){const k=be(g.zone,Pt.defaultZone);if(!k.isValid)return at.invalid($s(k));const P=Re.fromObject(g);let U,ee;if(je(A.year))U=Pt.now();else{for(const ge of Bl)je(A[ge])&&(A[ge]=Jh[ge]);const ce=Ye(A)||rt(A);if(ce)return at.invalid(ce);const de=Uv(k);[U,ee]=Ll(A,de,k)}return new at({ts:U,zone:k,loc:P,o:ee})}function nm(A,g,k){const P=je(k.round)?!0:k.round,U=je(k.rounding)?"trunc":k.rounding,ee=(de,ge)=>(de=jc(de,P||k.calendary?0:2,k.calendary?"round":U),g.loc.clone(k).relFormatter(k).format(de,ge)),ce=de=>k.calendary?g.hasSame(A,de)?0:g.startOf(de).diff(A.startOf(de),de).get(de):g.diff(A,de).get(de);if(k.unit)return ee(ce(k.unit),k.unit);for(const de of k.units){const ge=ce(de);if(Math.abs(ge)>=1)return ee(ge,de)}return ee(A>g?-0:0,k.units[k.units.length-1])}function rm(A){let g={},k;return A.length>0&&typeof A[A.length-1]=="object"?(g=A[A.length-1],k=Array.from(A).slice(0,A.length-1)):k=Array.from(A),[g,k]}let Hs;const Gc=new Map;class at{constructor(g){const k=g.zone||Pt.defaultZone;let P=g.invalid||(Number.isNaN(g.ts)?new xn("invalid input"):null)||(k.isValid?null:$s(k));this.ts=je(g.ts)?Pt.now():g.ts;let U=null,ee=null;if(!P)if(g.old&&g.old.ts===this.ts&&g.old.zone.equals(k))[U,ee]=[g.old.c,g.old.o];else{const de=zt(g.o)&&!g.old?g.o:k.offset(this.ts);U=Fl(this.ts,de),P=Number.isNaN(U.year)?new xn("invalid input"):null,U=P?null:U,ee=P?null:de}this._zone=k,this.loc=g.loc||Re.create(),this.invalid=P,this.weekData=null,this.localWeekData=null,this.c=U,this.o=ee,this.isLuxonDateTime=!0}static now(){return new at({})}static local(){const[g,k]=rm(arguments),[P,U,ee,ce,de,ge,Be]=k;return tm({year:P,month:U,day:ee,hour:ce,minute:de,second:ge,millisecond:Be},g)}static utc(){const[g,k]=rm(arguments),[P,U,ee,ce,de,ge,Be]=k;return g.zone=lt.utcInstance,tm({year:P,month:U,day:ee,hour:ce,minute:de,second:ge,millisecond:Be},g)}static fromJSDate(g,k={}){const P=Di(g)?g.valueOf():NaN;if(Number.isNaN(P))return at.invalid("invalid input");const U=be(k.zone,Pt.defaultZone);return U.isValid?new at({ts:P,zone:U,loc:Re.fromObject(k)}):at.invalid($s(U))}static fromMillis(g,k={}){if(zt(g))return g<-Gh||g>Gh?at.invalid("Timestamp out of range"):new at({ts:g,zone:be(k.zone,Pt.defaultZone),loc:Re.fromObject(k)});throw new s(`fromMillis requires a numerical input, but received a ${typeof g} with value ${g}`)}static fromSeconds(g,k={}){if(zt(g))return new at({ts:g*1e3,zone:be(k.zone,Pt.defaultZone),loc:Re.fromObject(k)});throw new s("fromSeconds requires a numerical input")}static fromObject(g,k={}){g=g||{};const P=be(k.zone,Pt.defaultZone);if(!P.isValid)return at.invalid($s(P));const U=Re.fromObject(k),ee=Pl(g,em),{minDaysInFirstWeek:ce,startOfWeek:de}=zo(ee,U),ge=Pt.now(),Be=je(k.specificOffset)?P.offset(ge):k.specificOffset,et=!je(ee.ordinal),pt=!je(ee.year),Ut=!je(ee.month)||!je(ee.day),it=pt||Ut,fn=ee.weekYear||ee.weekNumber;if((it||et)&&fn)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(Ut&&et)throw new o("Can't mix ordinal dates with month/day");const Mr=fn||ee.weekday&&!it;let Hr,_i,Us=Fl(ge,Be);Mr?(Hr=Hv,_i=jv,Us=rn(Us,ce,de)):et?(Hr=zv,_i=$v,Us=Ho(Us)):(Hr=Bl,_i=Jh);let om=!1;for(const Ws of Hr){const Gv=ee[Ws];je(Gv)?om?ee[Ws]=_i[Ws]:ee[Ws]=Us[Ws]:om=!0}const Wv=Mr?ke(ee,ce,de):et?Te(ee):Ye(ee),im=Wv||rt(ee);if(im)return at.invalid(im);const qv=Mr?Ar(ee,ce,de):et?ko(ee):ee,[Yv,Kv]=Ll(qv,Be,P),Vs=new at({ts:Yv,zone:P,o:Kv,loc:U});return ee.weekday&&it&&g.weekday!==Vs.weekday?at.invalid("mismatched weekday",`you can't specify both a weekday of ${ee.weekday} and a date of ${Vs.toISO()}`):Vs.isValid?Vs:at.invalid(Vs.invalid)}static fromISO(g,k={}){const[P,U]=dv(g);return Li(P,U,k,"ISO 8601",g)}static fromRFC2822(g,k={}){const[P,U]=fv(g);return Li(P,U,k,"RFC 2822",g)}static fromHTTP(g,k={}){const[P,U]=pv(g);return Li(P,U,k,"HTTP",k)}static fromFormat(g,k,P={}){if(je(g)||je(k))throw new s("fromFormat requires an input string and a format");const{locale:U=null,numberingSystem:ee=null}=P,ce=Re.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0}),[de,ge,Be,et]=Bv(ce,g,k);return et?at.invalid(et):Li(de,ge,P,`format ${k}`,g,Be)}static fromString(g,k,P={}){return at.fromFormat(g,k,P)}static fromSQL(g,k={}){const[P,U]=Cv(g);return Li(P,U,k,"SQL",g)}static invalid(g,k=null){if(!g)throw new s("need to specify a reason the DateTime is invalid");const P=g instanceof xn?g:new xn(g,k);if(Pt.throwOnInvalid)throw new t(P);return new at({invalid:P})}static isDateTime(g){return g&&g.isLuxonDateTime||!1}static parseFormatForOpts(g,k={}){const P=Kh(g,Re.fromObject(k));return P?P.map(U=>U?U.val:null).join(""):null}static expandFormat(g,k={}){return Wh(Dn.parseFormat(g),Re.fromObject(k)).map(U=>U.val).join("")}static resetCache(){Hs=void 0,Gc.clear()}get(g){return this[g]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?qc(this).weekYear:NaN}get weekNumber(){return this.isValid?qc(this).weekNumber:NaN}get weekday(){return this.isValid?qc(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Yc(this).weekday:NaN}get localWeekNumber(){return this.isValid?Yc(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Yc(this).weekYear:NaN}get ordinal(){return this.isValid?Ho(this.c).ordinal:NaN}get monthShort(){return this.isValid?js.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?js.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?js.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?js.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const g=864e5,k=6e4,P=Ol(this.c),U=this.zone.offset(P-g),ee=this.zone.offset(P+g),ce=this.zone.offset(P-U*k),de=this.zone.offset(P-ee*k);if(ce===de)return[this];const ge=P-ce*k,Be=P-de*k,et=Fl(ge,ce),pt=Fl(Be,de);return et.hour===pt.hour&&et.minute===pt.minute&&et.second===pt.second&&et.millisecond===pt.millisecond?[Wo(this,{ts:ge}),Wo(this,{ts:Be})]:[this]}get isInLeapYear(){return Ns(this.year)}get daysInMonth(){return Al(this.year,this.month)}get daysInYear(){return this.isValid?Ii(this.year):NaN}get weeksInWeekYear(){return this.isValid?Fs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Fs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(g={}){const{locale:k,numberingSystem:P,calendar:U}=Dn.create(this.loc.clone(g),g).resolvedOptions(this);return{locale:k,numberingSystem:P,outputCalendar:U}}toUTC(g=0,k={}){return this.setZone(lt.instance(g),k)}toLocal(){return this.setZone(Pt.defaultZone)}setZone(g,{keepLocalTime:k=!1,keepCalendarTime:P=!1}={}){if(g=be(g,Pt.defaultZone),g.equals(this.zone))return this;if(g.isValid){let U=this.ts;if(k||P){const ee=g.offset(this.ts),ce=this.toObject();[U]=Ll(ce,ee,g)}return Wo(this,{ts:U,zone:g})}else return at.invalid($s(g))}reconfigure({locale:g,numberingSystem:k,outputCalendar:P}={}){const U=this.loc.clone({locale:g,numberingSystem:k,outputCalendar:P});return Wo(this,{loc:U})}setLocale(g){return this.reconfigure({locale:g})}set(g){if(!this.isValid)return this;const k=Pl(g,em),{minDaysInFirstWeek:P,startOfWeek:U}=zo(k,this.loc),ee=!je(k.weekYear)||!je(k.weekNumber)||!je(k.weekday),ce=!je(k.ordinal),de=!je(k.year),ge=!je(k.month)||!je(k.day),Be=de||ge,et=k.weekYear||k.weekNumber;if((Be||ce)&&et)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(ge&&ce)throw new o("Can't mix ordinal dates with month/day");let pt;ee?pt=Ar({...rn(this.c,P,U),...k},P,U):je(k.ordinal)?(pt={...this.toObject(),...k},je(k.day)&&(pt.day=Math.min(Al(pt.year,pt.month),pt.day))):pt=ko({...Ho(this.c),...k});const[Ut,it]=Ll(pt,this.o,this.zone);return Wo(this,{ts:Ut,o:it})}plus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g);return Wo(this,Xh(this,k))}minus(g){if(!this.isValid)return this;const k=It.fromDurationLike(g).negate();return Wo(this,Xh(this,k))}startOf(g,{useLocaleWeeks:k=!1}={}){if(!this.isValid)return this;const P={},U=It.normalizeUnit(g);switch(U){case"years":P.month=1;case"quarters":case"months":P.day=1;case"weeks":case"days":P.hour=0;case"hours":P.minute=0;case"minutes":P.second=0;case"seconds":P.millisecond=0;break}if(U==="weeks")if(k){const ee=this.loc.getStartOfWeek(),{weekday:ce}=this;ce<ee&&(P.weekNumber=this.weekNumber-1),P.weekday=ee}else P.weekday=1;if(U==="quarters"){const ee=Math.ceil(this.month/3);P.month=(ee-1)*3+1}return this.set(P)}endOf(g,k){return this.isValid?this.plus({[g]:1}).startOf(g,k).minus(1):this}toFormat(g,k={}){return this.isValid?Dn.create(this.loc.redefaultToEN(k)).formatDateTimeFromString(this,g):Wc}toLocaleString(g=f,k={}){return this.isValid?Dn.create(this.loc.clone(k),g).formatDateTime(this):Wc}toLocaleParts(g={}){return this.isValid?Dn.create(this.loc.clone(g),g).formatDateTimeParts(this):[]}toISO({format:g="extended",suppressSeconds:k=!1,suppressMilliseconds:P=!1,includeOffset:U=!0,extendedZone:ee=!1,precision:ce="milliseconds"}={}){if(!this.isValid)return null;ce=jl(ce);const de=g==="extended";let ge=Kc(this,de,ce);return Bl.indexOf(ce)>=3&&(ge+="T"),ge+=Zh(this,de,k,P,U,ee,ce),ge}toISODate({format:g="extended",precision:k="day"}={}){return this.isValid?Kc(this,g==="extended",jl(k)):null}toISOWeekDate(){return _l(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:g=!1,suppressSeconds:k=!1,includeOffset:P=!0,includePrefix:U=!1,extendedZone:ee=!1,format:ce="extended",precision:de="milliseconds"}={}){return this.isValid?(de=jl(de),(U&&Bl.indexOf(de)>=3?"T":"")+Zh(this,ce==="extended",k,g,P,ee,de)):null}toRFC2822(){return _l(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return _l(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Kc(this,!0):null}toSQLTime({includeOffset:g=!0,includeZone:k=!1,includeOffsetSpace:P=!0}={}){let U="HH:mm:ss.SSS";return(k||g)&&(P&&(U+=" "),k?U+="z":g&&(U+="ZZ")),_l(this,U,!0)}toSQL(g={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(g)}`:null}toString(){return this.isValid?this.toISO():Wc}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(g={}){if(!this.isValid)return{};const k={...this.c};return g.includeConfig&&(k.outputCalendar=this.outputCalendar,k.numberingSystem=this.loc.numberingSystem,k.locale=this.loc.locale),k}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(g,k="milliseconds",P={}){if(!this.isValid||!g.isValid)return It.invalid("created by diffing an invalid DateTime");const U={locale:this.locale,numberingSystem:this.numberingSystem,...P},ee=Il(k).map(It.normalizeUnit),ce=g.valueOf()>this.valueOf(),de=ce?this:g,ge=ce?g:this,Be=wv(de,ge,ee,U);return ce?Be.negate():Be}diffNow(g="milliseconds",k={}){return this.diff(at.now(),g,k)}until(g){return this.isValid?on.fromDateTimes(this,g):this}hasSame(g,k,P){if(!this.isValid)return!1;const U=g.valueOf(),ee=this.setZone(g.zone,{keepLocalTime:!0});return ee.startOf(k,P)<=U&&U<=ee.endOf(k,P)}equals(g){return this.isValid&&g.isValid&&this.valueOf()===g.valueOf()&&this.zone.equals(g.zone)&&this.loc.equals(g.loc)}toRelative(g={}){if(!this.isValid)return null;const k=g.base||at.fromObject({},{zone:this.zone}),P=g.padding?this<k?-g.padding:g.padding:0;let U=["years","months","days","hours","minutes","seconds"],ee=g.unit;return Array.isArray(g.unit)&&(U=g.unit,ee=void 0),nm(k,this.plus(P),{...g,numeric:"always",units:U,unit:ee})}toRelativeCalendar(g={}){return this.isValid?nm(g.base||at.fromObject({},{zone:this.zone}),this,{...g,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...g){if(!g.every(at.isDateTime))throw new s("min requires all arguments be DateTimes");return wt(g,k=>k.valueOf(),Math.min)}static max(...g){if(!g.every(at.isDateTime))throw new s("max requires all arguments be DateTimes");return wt(g,k=>k.valueOf(),Math.max)}static fromFormatExplain(g,k,P={}){const{locale:U=null,numberingSystem:ee=null}=P,ce=Re.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0});return Yh(ce,g,k)}static fromStringExplain(g,k,P={}){return at.fromFormatExplain(g,k,P)}static buildFormatParser(g,k={}){const{locale:P=null,numberingSystem:U=null}=k,ee=Re.fromOpts({locale:P,numberingSystem:U,defaultToEN:!0});return new qh(ee,g)}static fromFormatParser(g,k,P={}){if(je(g)||je(k))throw new s("fromFormatParser requires an input string and a format parser");const{locale:U=null,numberingSystem:ee=null}=P,ce=Re.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0});if(!ce.equals(k.locale))throw new s(`fromFormatParser called with a locale of ${ce}, but the format parser was created for ${k.locale}`);const{result:de,zone:ge,specificOffset:Be,invalidReason:et}=k.explainFromTokens(g);return et?at.invalid(et):Li(de,ge,P,`format ${k.format}`,g,Be)}static get DATE_SHORT(){return f}static get DATE_MED(){return h}static get DATE_MED_WITH_WEEKDAY(){return p}static get DATE_FULL(){return m}static get DATE_HUGE(){return b}static get TIME_SIMPLE(){return y}static get TIME_WITH_SECONDS(){return x}static get TIME_WITH_SHORT_OFFSET(){return C}static get TIME_WITH_LONG_OFFSET(){return v}static get TIME_24_SIMPLE(){return S}static get TIME_24_WITH_SECONDS(){return I}static get TIME_24_WITH_SHORT_OFFSET(){return T}static get TIME_24_WITH_LONG_OFFSET(){return N}static get DATETIME_SHORT(){return O}static get DATETIME_SHORT_WITH_SECONDS(){return F}static get DATETIME_MED(){return B}static get DATETIME_MED_WITH_SECONDS(){return j}static get DATETIME_MED_WITH_WEEKDAY(){return D}static get DATETIME_FULL(){return H}static get DATETIME_FULL_WITH_SECONDS(){return _}static get DATETIME_HUGE(){return L}static get DATETIME_HUGE_WITH_SECONDS(){return $}}function zs(A){if(at.isDateTime(A))return A;if(A&&A.valueOf&&zt(A.valueOf()))return at.fromJSDate(A);if(A&&typeof A=="object")return at.fromObject(A);throw new s(`Unknown datetime argument: ${A}, of type ${typeof A}`)}const Vv="3.7.2";return Un.DateTime=at,Un.Duration=It,Un.FixedOffsetZone=lt,Un.IANAZone=Q,Un.Info=js,Un.Interval=on,Un.InvalidZone=Mt,Un.Settings=Pt,Un.SystemZone=q,Un.VERSION=Vv,Un.Zone=K,Un}var Rg;function Fp(){return Rg||(Rg=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;const t=tL();var n;(function(i){i.Second="Second",i.Minute="Minute",i.Hour="Hour",i.Day="Day",i.Month="Month",i.Year="Year"})(n||(e.TimeUnit=n={}));var r;(function(i){i.Add="Add",i.Subtract="Subtract"})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);class o{#e;#n=null;#i=null;constructor(s,a){const l={zone:a};if(s?s instanceof o?(this.#e=s.#e,this.#n=s.#n,this.#i=s.#i):s instanceof Date?this.#e=t.DateTime.fromJSDate(s,l):typeof s=="number"?this.#e=t.DateTime.fromMillis(s,l):(this.#e=t.DateTime.fromISO(s,l),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(s,l)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(s,l)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(s,"EEE, d MMM yyyy HH:mm:ss",l))):this.#e=t.DateTime.local(),!this.#e.isValid)throw new Error(`CronDate: unhandled timestamp: ${s}`);a&&a!==this.#e.zoneName&&(this.#e=this.#e.setZone(a))}static#o(s){return s%4===0&&s%100!==0||s%400===0}get dstStart(){return this.#n}set dstStart(s){this.#n=s}get dstEnd(){return this.#i}set dstEnd(s){this.#i=s}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf("month")}addDay(){this.#e=this.#e.plus({days:1}).startOf("day")}addHour(){this.#e=this.#e.plus({hours:1}).startOf("hour")}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf("minute")}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#e=this.#e.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(s){switch(s){case n.Year:return this.addYear();case n.Month:return this.addMonth();case n.Day:return this.addDay();case n.Hour:return this.addHour();case n.Minute:return this.addMinute();case n.Second:return this.addSecond()}}subtractUnit(s){switch(s){case n.Year:return this.subtractYear();case n.Month:return this.subtractMonth();case n.Day:return this.subtractDay();case n.Hour:return this.subtractHour();case n.Minute:return this.subtractMinute();case n.Second:return this.subtractSecond()}}invokeDateOperation(s,a){if(s===r.Add){this.addUnit(a);return}if(s===r.Subtract){this.subtractUnit(a);return}throw new Error(`Invalid verb: ${s}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){const s=this.#e.weekday;return s===7?0:s}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf("day")}setEndOfDay(){this.#e=this.#e.endOf("day")}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#r().day}getUTCFullYear(){return this.#r().year}getUTCDay(){const s=this.#r().weekday;return s===7?0:s}getUTCMonth(){return this.#r().month-1}getUTCHours(){return this.#r().hour}getUTCMinutes(){return this.#r().minute}getUTCSeconds(){return this.#r().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(s){this.#e=this.#e.set({day:s})}setFullYear(s){this.#e=this.#e.set({year:s})}setDay(s){this.#e=this.#e.set({weekday:s})}setMonth(s){this.#e=this.#e.set({month:s+1})}setHours(s){this.#e=this.#e.set({hour:s})}setMinutes(s){this.#e=this.#e.set({minute:s})}setSeconds(s){this.#e=this.#e.set({second:s})}setMilliseconds(s){this.#e=this.#e.set({millisecond:s})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){const{day:s,month:a}=this.#e;if(a===2){const l=o.#o(this.#e.year);return s===e.DAYS_IN_MONTH[a-1]-(l?0:1)}return s===e.DAYS_IN_MONTH[a-1]}isLastWeekdayOfMonth(){const{day:s,month:a}=this.#e;let l;return a===2?l=e.DAYS_IN_MONTH[a-1]-(o.#o(this.#e.year)?0:1):l=e.DAYS_IN_MONTH[a-1],s>l-7}applyDateOperation(s,a,l){if(a===n.Month||a===n.Day){this.invokeDateOperation(s,a);return}const u=this.getHours();this.invokeDateOperation(s,a);const d=this.getHours(),f=d-u;f===2?l!==24&&(this.dstStart=u+1):f===0&&this.getMinutes()===0&&this.getSeconds()===0&&l!==24&&(this.dstEnd=d)}#r(){return this.#e.toUTC()}}e.CronDate=o,e.default=o})(Ld)),Ld}var Ng;function nL(){if(Ng)return ca;Ng=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.CronMonth=void 0;const e=Fp(),t=vi(),n=1,r=12,o=Object.freeze([]);let i=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return o}static get daysInMonth(){return e.DAYS_IN_MONTH}constructor(a,l){super(a,l),this.validate()}get values(){return super.values}};return ca.CronMonth=i,ca}var da={},Fg;function rL(){if(Fg)return da;Fg=1,Object.defineProperty(da,"__esModule",{value:!0}),da.CronSecond=void 0;const e=vi(),t=0,n=59,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(s,a){super(s,a),this.validate()}get values(){return super.values}};return da.CronSecond=o,da}var Lg;function Lp(){return Lg||(Lg=1,(function(e){var t=Qo&&Qo.__createBinding||(Object.create?(function(r,o,i,s){s===void 0&&(s=i);var a=Object.getOwnPropertyDescriptor(o,i);(!a||("get"in a?!o.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return o[i]}}),Object.defineProperty(r,s,a)}):(function(r,o,i,s){s===void 0&&(s=i),r[s]=o[i]})),n=Qo&&Qo.__exportStar||function(r,o){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(o,i)&&t(o,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Q8(),e),n(X8(),e),n(Z8(),e),n(vi(),e),n(J8(),e),n(eL(),e),n(nL(),e),n(rL(),e)})(Qo)),Qo}var _g;function v2(){if(_g)return oa;_g=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.CronFieldCollection=void 0;const e=Lp();let t=class Aa{#e;#n;#i;#o;#r;#t;static from(r,o){return new Aa({second:this.resolveField(e.CronSecond,r.second,o.second),minute:this.resolveField(e.CronMinute,r.minute,o.minute),hour:this.resolveField(e.CronHour,r.hour,o.hour),dayOfMonth:this.resolveField(e.CronDayOfMonth,r.dayOfMonth,o.dayOfMonth),month:this.resolveField(e.CronMonth,r.month,o.month),dayOfWeek:this.resolveField(e.CronDayOfWeek,r.dayOfWeek,o.dayOfWeek)})}static resolveField(r,o,i){return i?i instanceof e.CronField?i:new r(i):o}constructor({second:r,minute:o,hour:i,dayOfMonth:s,month:a,dayOfWeek:l}){if(!r)throw new Error("Validation error, Field second is missing");if(!o)throw new Error("Validation error, Field minute is missing");if(!i)throw new Error("Validation error, Field hour is missing");if(!s)throw new Error("Validation error, Field dayOfMonth is missing");if(!a)throw new Error("Validation error, Field month is missing");if(!l)throw new Error("Validation error, Field dayOfWeek is missing");if(a.values.length===1&&!s.hasLastChar&&l.isWildcard&&!(parseInt(s.values[0],10)<=e.CronMonth.daysInMonth[a.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#e=r,this.#n=o,this.#i=i,this.#r=a,this.#t=l,this.#o=s}get second(){return this.#e}get minute(){return this.#n}get hour(){return this.#i}get dayOfMonth(){return this.#o}get month(){return this.#r}get dayOfWeek(){return this.#t}static compactField(r){if(r.length===0)return[];const o=[];let i;return r.forEach((s,a,l)=>{if(i===void 0){i={start:s,count:1};return}const u=l[a-1]||i.start,d=l[a+1];if(s==="L"||s==="W"){o.push(i),o.push({start:s,count:1}),i=void 0;return}if(i.step===void 0&&d!==void 0){const f=s-u,h=d-s;if(f<=h){i={...i,count:2,end:s,step:f};return}i.step=1}s-(i.end??0)===i.step?(i.count++,i.end=s):(i.count===1?o.push({start:i.start,count:1}):i.count===2?(o.push({start:i.start,count:1}),o.push({start:i.end??u,count:1})):o.push(i),i={start:s,count:1})}),i&&o.push(i),o}static#u(r,o,i){const s=o.step;return s?s===1&&o.start===r.min&&o.end&&o.end>=i?r.hasQuestionMarkChar?"?":"*":s!==1&&o.start===r.min&&o.end&&o.end>=i-s+1?`*/${s}`:null:null}static#l(r,o){const i=r.step;if(i===1)return`${r.start}-${r.end}`;const s=r.start===0?r.count-1:r.count;if(!i)throw new Error("Unexpected range step");if(!r.end)throw new Error("Unexpected range end");if(i*s>r.end){const a=(u,d)=>{if(typeof r.start!="number")throw new Error("Unexpected range start");return d%i===0?r.start+d:null};if(typeof r.start!="number")throw new Error("Unexpected range start");const l={length:r.end-r.start+1};return Array.from(l,a).filter(u=>u!==null).join(",")}return r.end===o-i+1?`${r.start}/${i}`:`${r.start}-${r.end}/${i}`}stringifyField(r){let o=r.max,i=r.values;if(r instanceof e.CronDayOfWeek){o=6;const a=this.#t.values;i=a[a.length-1]===7?a.slice(0,-1):a}r instanceof e.CronDayOfMonth&&(o=this.#r.values.length===1?e.CronMonth.daysInMonth[this.#r.values[0]-1]:r.max);const s=Aa.compactField(i);if(s.length===1){const a=Aa.#u(r,s[0],o);if(a)return a}return s.map(a=>{const l=a.count===1?a.start.toString():Aa.#l(a,o);return r instanceof e.CronDayOfWeek&&r.nthDay>0?`${l}#${r.nthDay}`:l}).join(",")}stringify(r=!1){const o=[];return r&&o.push(this.stringifyField(this.#e)),o.push(this.stringifyField(this.#n),this.stringifyField(this.#i),this.stringifyField(this.#o),this.stringifyField(this.#r),this.stringifyField(this.#t)),o.join(" ")}serialize(){return{second:this.#e.serialize(),minute:this.#n.serialize(),hour:this.#i.serialize(),dayOfMonth:this.#o.serialize(),month:this.#r.serialize(),dayOfWeek:this.#t.serialize()}}};return oa.CronFieldCollection=t,oa}var _d={},Bg;function T2(){return Bg||(Bg=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;const t=Fp();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range",e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";const n=1e4;class r{#e;#n;#i;#o;#r;#t;#u=null;#l=!1;constructor(i,s){this.#e=s,this.#n=s.tz,this.#o=s.startDate?new t.CronDate(s.startDate,this.#n):null,this.#r=s.endDate?new t.CronDate(s.endDate,this.#n):null;let a=s.currentDate??s.startDate;if(a){const l=new t.CronDate(a,this.#n);this.#o&&l.getTime()<this.#o.getTime()?a=this.#o:this.#r&&l.getTime()>this.#r.getTime()&&(a=this.#r)}this.#i=new t.CronDate(a,this.#n),this.#t=i}get fields(){return this.#t}static fieldsToExpression(i,s){return new r(i,s||{})}static#s(i,s){return s.some(a=>a===i)}#a(i,s){return i[s?i.length-1:0]}#d(i){const s=`${i.getFullYear()}-${i.getMonth()+1}-${i.getDate()}`;if(this.#u===s)return this.#l;const a=new t.CronDate(i);a.setStartOfDay();const l=new t.CronDate(i);return l.setEndOfDay(),this.#u=s,this.#l=a.getUTCOffset()!==l.getUTCOffset(),this.#l}#f(i,s,a){const l=this.#t.second.values,u=i.getSeconds(),d=this.#t.second.findNearestValue(u,a);if(d!==null){i.setSeconds(d);return}i.applyDateOperation(s,t.TimeUnit.Minute,this.#t.hour.values.length),i.setSeconds(this.#a(l,a))}#h(i,s,a){const l=this.#t.minute.values,u=this.#t.second.values,d=i.getMinutes(),f=this.#t.minute.findNearestValue(d,a);if(f!==null){i.setMinutes(f),i.setSeconds(this.#a(u,a));return}i.applyDateOperation(s,t.TimeUnit.Hour,this.#t.hour.values.length),i.setMinutes(this.#a(l,a)),i.setSeconds(this.#a(u,a))}static#m(i,s){const a=s.isLastWeekdayOfMonth();return i.some(l=>{const u=parseInt(l.toString().charAt(0),10)%7;if(Number.isNaN(u))throw new Error(`Invalid last weekday of the month expression: ${l}`);return s.getDay()===u&&a})}next(){return this.#c()}prev(){return this.#c(!0)}hasNext(){const i=this.#i;try{return this.#c(),!0}catch{return!1}finally{this.#i=i}}hasPrev(){const i=this.#i;try{return this.#c(!0),!0}catch{return!1}finally{this.#i=i}}take(i){const s=[];if(i>=0)for(let a=0;a<i;a++)try{s.push(this.next())}catch{return s}else for(let a=0;a>i;a--)try{s.push(this.prev())}catch{return s}return s}reset(i){this.#i=new t.CronDate(i||this.#e.currentDate,this.#n)}stringify(i=!1){return this.#t.stringify(i)}includesDate(i){const{second:s,minute:a,hour:l,month:u}=this.#t,d=new t.CronDate(i,this.#n);return!(!s.values.includes(d.getSeconds())||!a.values.includes(d.getMinutes())||!l.values.includes(d.getHours())||!u.values.includes(d.getMonth()+1)||!this.#p(d)||this.#t.dayOfWeek.nthDay>0&&Math.ceil(d.getDate()/7)!==this.#t.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#p(i){const s=this.#t.dayOfMonth.isWildcard,a=!s,l=this.#t.dayOfWeek.isWildcard,u=!l,d=r.#s(i.getDate(),this.#t.dayOfMonth.values)||this.#t.dayOfMonth.hasLastChar&&i.isLastDayOfMonth(),f=r.#s(i.getDay(),this.#t.dayOfWeek.values)||this.#t.dayOfWeek.hasLastChar&&r.#m(this.#t.dayOfWeek.values,i);return!!(a&&u&&(d||f)||d&&!u||s&&!l&&f)}#g(i,s,a){const l=this.#t.hour.values,u=l,d=i.getHours(),f=r.#s(d,l),h=i.dstEnd===d;if(i.dstStart!==null&&i.dstStart===d-1&&r.#s(i.dstStart,l))return!0;if(h&&!a)return i.dstEnd=null,i.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,u.length),!1;if(f)return!0;i.dstStart=null;const p=this.#t.hour.findNearestValue(d,a);if(p===null)return i.applyDateOperation(s,t.TimeUnit.Day,u.length),!1;if(this.#d(i)){const m=a?d-p:p-d;for(let b=0;b<m&&(i.applyDateOperation(s,t.TimeUnit.Hour,u.length),!(!a&&i.getHours()>=p||a&&i.getHours()<=p));b++);}else i.setHours(p);return i.setMinutes(this.#a(this.#t.minute.values,a)),i.setSeconds(this.#a(this.#t.second.values,a)),!1}#b(i){if(!this.#o&&!this.#r)return;const s=i.getTime();if(this.#o&&s<this.#o.getTime())throw new Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(this.#r&&s>this.#r.getTime())throw new Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#c(i=!1){const s=i?t.DateMathOp.Subtract:t.DateMathOp.Add,a=new t.CronDate(this.#i),l=a.getTime();let u=0;for(;++u<n;){if(this.#b(a),!this.#p(a)){a.applyDateOperation(s,t.TimeUnit.Day,this.#t.hour.values.length);continue}if(!(this.#t.dayOfWeek.nthDay<=0||Math.ceil(a.getDate()/7)===this.#t.dayOfWeek.nthDay)){a.applyDateOperation(s,t.TimeUnit.Day,this.#t.hour.values.length);continue}if(!r.#s(a.getMonth()+1,this.#t.month.values)){a.applyDateOperation(s,t.TimeUnit.Month,this.#t.hour.values.length);continue}if(this.#g(a,s,i)){if(!r.#s(a.getMinutes(),this.#t.minute.values)){this.#h(a,s,i);continue}if(!r.#s(a.getSeconds(),this.#t.second.values)){this.#f(a,s,i);continue}if(l===a.getTime()){(s==="Add"||a.getMilliseconds()===0)&&a.applyDateOperation(s,t.TimeUnit.Second,this.#t.hour.values.length);continue}break}}if(u>n)throw new Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return a.getMilliseconds()!==0&&a.setMilliseconds(0),this.#i=a,a}[Symbol.iterator](){return{next:()=>{try{return{value:this.#c(),done:!1}}catch{return{value:void 0,done:!0}}}}}}e.CronExpression=r,e.default=r})(_d)),_d}var Xl={},jg;function oL(){if(jg)return Xl;jg=1,Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.seededRandom=n;function e(r){let o=2166136261;for(let i=0;i<r.length;i++)o^=r.charCodeAt(i),o=Math.imul(o,16777619);return()=>o>>>0}function t(r){return()=>{let o=r+=1831565813;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}function n(r){const o=r?e(r)():Math.floor(Math.random()*1e10);return t(o)}return Xl}var $g;function Of(){if($g)return Xn;$g=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.CronExpressionParser=Xn.DayOfWeek=Xn.Months=Xn.CronUnit=Xn.PredefinedExpressions=void 0;const e=v2(),t=T2(),n=oL(),r=Lp();var o;(function(u){u["@yearly"]="0 0 0 1 1 *",u["@annually"]="0 0 0 1 1 *",u["@monthly"]="0 0 0 1 * *",u["@weekly"]="0 0 0 * * 0",u["@daily"]="0 0 0 * * *",u["@hourly"]="0 0 * * * *",u["@minutely"]="0 * * * * *",u["@secondly"]="* * * * * *",u["@weekdays"]="0 0 0 * * 1-5",u["@weekends"]="0 0 0 * * 0,6"})(o||(Xn.PredefinedExpressions=o={}));var i;(function(u){u.Second="Second",u.Minute="Minute",u.Hour="Hour",u.DayOfMonth="DayOfMonth",u.Month="Month",u.DayOfWeek="DayOfWeek"})(i||(Xn.CronUnit=i={}));var s;(function(u){u[u.jan=1]="jan",u[u.feb=2]="feb",u[u.mar=3]="mar",u[u.apr=4]="apr",u[u.may=5]="may",u[u.jun=6]="jun",u[u.jul=7]="jul",u[u.aug=8]="aug",u[u.sep=9]="sep",u[u.oct=10]="oct",u[u.nov=11]="nov",u[u.dec=12]="dec"})(s||(Xn.Months=s={}));var a;(function(u){u[u.sun=0]="sun",u[u.mon=1]="mon",u[u.tue=2]="tue",u[u.wed=3]="wed",u[u.thu=4]="thu",u[u.fri=5]="fri",u[u.sat=6]="sat"})(a||(Xn.DayOfWeek=a={}));let l=class er{static parse(d,f={}){const{strict:h=!1,hashSeed:p}=f,m=(0,n.seededRandom)(p);d=o[d]||d;const b=er.#e(d,h);if(!(b.dayOfMonth==="*"||b.dayOfWeek==="*"||!h))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const y=er.#n(i.Second,b.second,r.CronSecond.constraints,m),x=er.#n(i.Minute,b.minute,r.CronMinute.constraints,m),C=er.#n(i.Hour,b.hour,r.CronHour.constraints,m),v=er.#n(i.Month,b.month,r.CronMonth.constraints,m),S=er.#n(i.DayOfMonth,b.dayOfMonth,r.CronDayOfMonth.constraints,m),{dayOfWeek:I,nthDayOfWeek:T}=er.#d(b.dayOfWeek),N=er.#n(i.DayOfWeek,I,r.CronDayOfWeek.constraints,m),O=new e.CronFieldCollection({second:new r.CronSecond(y,{rawValue:b.second}),minute:new r.CronMinute(x,{rawValue:b.minute}),hour:new r.CronHour(C,{rawValue:b.hour}),dayOfMonth:new r.CronDayOfMonth(S,{rawValue:b.dayOfMonth}),month:new r.CronMonth(v,{rawValue:b.month}),dayOfWeek:new r.CronDayOfWeek(N,{rawValue:b.dayOfWeek,nthDayOfWeek:T})});return new t.CronExpression(O,{...f,expression:d})}static#e(d,f){if(f&&!d.length)throw new Error("Invalid cron expression");d=d||"0 * * * * *";const h=d.trim().split(/\s+/);if(f&&h.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(h.length>6)throw new Error("Invalid cron expression, too many fields");const p=["*","*","*","*","*","0"];h.length<p.length&&h.unshift(...p.slice(h.length));const[m,b,y,x,C,v]=h;return{second:m,minute:b,hour:y,dayOfMonth:x,month:C,dayOfWeek:v}}static#n(d,f,h,p){if((d===i.Month||d===i.DayOfWeek)&&(f=f.replace(/[a-z]{3}/gi,m=>{m=m.toLowerCase();const b=s[m]||a[m];if(b===void 0)throw new Error(`Validation error, cannot resolve alias "${m}"`);return b.toString()})),!h.validChars.test(f))throw new Error(`Invalid characters, got value: ${f}`);return f=this.#i(f,h),f=this.#o(f,h,p),this.#r(d,f,h)}static#i(d,f){return d.replace(/[*?]/g,f.min+"-"+f.max)}static#o(d,f,h){const p=h();return d.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(m,b,y,x)=>{if(b&&y&&x){const C=parseInt(b,10),v=parseInt(y,10),S=parseInt(x,10);if(C>v)throw new Error(`Invalid range: ${C}-${v}, min > max`);if(S<=0)throw new Error(`Invalid step: ${S}, must be positive`);const I=Math.max(C,f.min),T=Math.floor(p*S),N=[];for(let O=Math.floor(I/S)*S+T;O<=v;O+=S)O>=I&&N.push(O);return N.join(",")}else if(b&&y){const C=parseInt(b,10),v=parseInt(y,10);if(C>v)throw new Error(`Invalid range: ${C}-${v}, min > max`);return String(Math.floor(p*(v-C+1))+C)}else if(x){const C=parseInt(x,10);if(C<=0)throw new Error(`Invalid step: ${C}, must be positive`);const v=Math.floor(p*C),S=[];for(let I=Math.floor(f.min/C)*C+v;I<=f.max;I+=C)I>=f.min&&S.push(I);return S.join(",")}else return String(Math.floor(p*(f.max-f.min+1)+f.min))})}static#r(d,f,h){const p=[];function m(y,x){if(Array.isArray(y))p.push(...y);else if(er.#f(x,y))p.push(y);else{const C=parseInt(y.toString(),10);if(!(C>=x.min&&C<=x.max))throw new Error(`Constraint error, got value ${y} expected range ${x.min}-${x.max}`);p.push(d===i.DayOfWeek?C%7:y)}}return f.split(",").forEach(y=>{if(!(y.length>0))throw new Error("Invalid list value format");m(er.#t(d,y,h),h)}),p}static#t(d,f,h){const p=f.split("/");if(p.length>2)throw new Error(`Invalid repeat: ${f}`);return p.length===2?(p[0].includes("-")||(p[0]=`${p[0]}-${h.max}`),er.#a(d,p[0],parseInt(p[1],10),h)):er.#a(d,f,1,h)}static#u(d,f,h){if(!(!isNaN(d)&&!isNaN(f)&&d>=h.min&&f<=h.max))throw new Error(`Constraint error, got range ${d}-${f} expected range ${h.min}-${h.max}`);if(d>f)throw new Error(`Invalid range: ${d}-${f}, min(${d}) > max(${f})`)}static#l(d){if(!(!isNaN(d)&&d>0))throw new Error(`Constraint error, cannot repeat at every ${d} time.`)}static#s(d,f,h,p){const m=[];d===i.DayOfWeek&&h%7===0&&m.push(0);for(let b=f;b<=h;b+=p)m.indexOf(b)===-1&&m.push(b);return m}static#a(d,f,h,p){const m=f.split("-");if(m.length<=1)return isNaN(+f)?f:+f;const[b,y]=m.map(x=>parseInt(x,10));return this.#u(b,y,p),this.#l(h),this.#s(d,b,y,h)}static#d(d){const f=d.split("#");if(f.length<=1)return{dayOfWeek:f[0]};const h=+f[f.length-1],p=d.match(/([,-/])/);if(p!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${p?.[0]}\` special characters are incompatible`);if(!(f.length<=2&&!isNaN(h)&&h>=1&&h<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:f[0],nthDayOfWeek:h}}static#f(d,f){return d.chars.some(h=>f.toString().includes(h))}};return Xn.CronExpressionParser=l,Xn}var Pr={};const iL={},sL=Object.freeze(Object.defineProperty({__proto__:null,default:iL},Symbol.toStringTag,{value:"Module"})),Hg=aT(sL);var zg;function aL(){if(zg)return Pr;zg=1;var e=Pr&&Pr.__createBinding||(Object.create?(function(i,s,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(s,a);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(i,l,u)}):(function(i,s,a,l){l===void 0&&(l=a),i[l]=s[a]})),t=Pr&&Pr.__setModuleDefault||(Object.create?(function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}):function(i,s){i.default=s}),n=Pr&&Pr.__importStar||(function(){var i=function(s){return i=Object.getOwnPropertyNames||function(a){var l=[];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(l[l.length]=u);return l},i(s)};return function(s){if(s&&s.__esModule)return s;var a={};if(s!=null)for(var l=i(s),u=0;u<l.length;u++)l[u]!=="default"&&e(a,s,l[u]);return t(a,s),a}})();Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.CronFileParser=void 0;const r=Of();let o=class pu{static async parseFile(s){const{readFile:a}=await Promise.resolve().then(()=>n(Hg)),l=await a(s,"utf8");return pu.#e(l)}static parseFileSync(s){const{readFileSync:a}=Hg,l=a(s,"utf8");return pu.#e(l)}static#e(s){const a=s.split(`
194
+ `),l={variables:{},expressions:[],errors:{}};for(const u of a){const d=u.trim();if(d.length===0||d.startsWith("#"))continue;const f=d.match(/^(.*)=(.*)$/);if(f){const[,h,p]=f;l.variables[h]=p.replace(/["']/g,"");continue}try{const h=pu.#n(d);l.expressions.push(h.interval)}catch(h){l.errors[d]=h}}return l}static#n(s){const a=s.split(" ");return{interval:r.CronExpressionParser.parse(a.slice(0,5).join(" ")),command:a.slice(5,a.length)}}};return Pr.CronFileParser=o,Pr}var Ug;function lL(){return Ug||(Ug=1,(function(e){var t=Go&&Go.__createBinding||(Object.create?(function(u,d,f,h){h===void 0&&(h=f);var p=Object.getOwnPropertyDescriptor(d,f);(!p||("get"in p?!d.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(u,h,p)}):(function(u,d,f,h){h===void 0&&(h=f),u[h]=d[f]})),n=Go&&Go.__exportStar||function(u,d){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&t(d,u,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;const r=Of();var o=Fp();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return o.CronDate}});var i=v2();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return i.CronFieldCollection}});var s=T2();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return s.CronExpression}});var a=Of();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return a.CronExpressionParser}});var l=aL();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return l.CronFileParser}}),n(Lp(),e),e.default=r.CronExpressionParser})(Go)),Go}var uL=lL(),Bd={exports:{}},Vg;function cL(){return Vg||(Vg=1,(function(e,t){(function(r,o){e.exports=o()})(globalThis,()=>(()=>{var n={949:((s,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CronParser=void 0;var u=l(515),d=(function(){function f(h,p,m){p===void 0&&(p=!0),m===void 0&&(m=!1),this.expression=h,this.dayOfWeekStartIndexZero=p,this.monthStartIndexZero=m}return f.prototype.parse=function(){var h,p,m=(h=this.expression)!==null&&h!==void 0?h:"";if(m==="@reboot")return p=["@reboot","","","","","",""],p;if(m.startsWith("@")){var b=this.parseSpecial(this.expression);p=this.extractParts(b)}else p=this.extractParts(this.expression);return this.normalize(p),this.validate(p),p},f.prototype.parseSpecial=function(h){var p={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},m=p[h];if(!m)throw new Error("Unknown special expression.");return m},f.prototype.extractParts=function(h){if(!this.expression)throw new Error("cron expression is empty");for(var p=h.trim().split(/[ ]+/),m=0;m<p.length;m++)if(p[m].includes(",")){var b=p[m].split(",").map(function(x){return x.trim()}).filter(function(x){return x!==""}).map(function(x){return isNaN(Number(x))?x:Number(x)}).filter(function(x){return x!==null&&x!==""});b.length===0&&b.push("*"),b.sort(function(x,C){return x!==null&&C!==null?x-C:0}),p[m]=b.map(function(x){return x!==null?x.toString():""}).join(",")}if(p.length<5)throw new Error("Expression has only ".concat(p.length," part").concat(p.length==1?"":"s",". At least 5 parts are required."));if(p.length==5)p.unshift(""),p.push("");else if(p.length==6){var y=/\d{4}$/.test(p[5])||p[4]=="?"||p[2]=="?";y?p.unshift(""):p.push("")}else if(p.length>7)throw new Error("Expression has ".concat(p.length," parts; too many!"));return p},f.prototype.normalize=function(h){var p=this;if(h[3]=h[3].replace("?","*"),h[5]=h[5].replace("?","*"),h[2]=h[2].replace("?","*"),h[0].indexOf("0/")==0&&(h[0]=h[0].replace("0/","*/")),h[1].indexOf("0/")==0&&(h[1]=h[1].replace("0/","*/")),h[2].indexOf("0/")==0&&(h[2]=h[2].replace("0/","*/")),h[3].indexOf("1/")==0&&(h[3]=h[3].replace("1/","*/")),h[4].indexOf("1/")==0&&(h[4]=h[4].replace("1/","*/")),h[6].indexOf("1/")==0&&(h[6]=h[6].replace("1/","*/")),h[5]=h[5].replace(/(^\d)|([^#/\s]\d)/g,function(I){var T=I.replace(/\D/,""),N=T;return p.dayOfWeekStartIndexZero?T=="7"&&(N="0"):N=(parseInt(T)-1).toString(),I.replace(T,N)}),h[5]=="L"&&(h[5]="6"),h[3]=="?"&&(h[3]="*"),h[3].indexOf("W")>-1&&(h[3].indexOf(",")>-1||h[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var m={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var b in m)h[5]=h[5].replace(new RegExp(b,"gi"),m[b].toString());h[4]=h[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(I){var T=I.replace(/\D/,""),N=T;return p.monthStartIndexZero&&(N=(parseInt(T)+1).toString()),I.replace(T,N)});var y={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var x in y)h[4]=h[4].replace(new RegExp(x,"gi"),y[x].toString());h[0]=="0"&&(h[0]=""),!/\*|\-|\,|\//.test(h[2])&&(/\*|\//.test(h[1])||/\*|\//.test(h[0]))&&(h[2]+="-".concat(h[2]));for(var C=0;C<h.length;C++)if(h[C].indexOf(",")!=-1&&(h[C]=h[C].split(",").filter(function(I){return I!==""}).join(",")||"*"),h[C]=="*/1"&&(h[C]="*"),h[C].indexOf("/")>-1&&!/^\*|\-|\,/.test(h[C])){var v=null;switch(C){case 4:v="12";break;case 5:v="6";break;case 6:v="9999";break;default:v=null;break}if(v!==null){var S=h[C].split("/");h[C]="".concat(S[0],"-").concat(v,"/").concat(S[1])}}},f.prototype.validate=function(h){var p="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(h[0],p),this.validateOnlyExpectedCharactersFound(h[1],p),this.validateOnlyExpectedCharactersFound(h[2],p),this.validateOnlyExpectedCharactersFound(h[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(h[4],p),this.validateOnlyExpectedCharactersFound(h[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(h[6],p),this.validateAnyRanges(h)},f.prototype.validateAnyRanges=function(h){u.default.secondRange(h[0]),u.default.minuteRange(h[1]),u.default.hourRange(h[2]),u.default.dayOfMonthRange(h[3]),u.default.monthRange(h[4],this.monthStartIndexZero),u.default.dayOfWeekRange(h[5],this.dayOfWeekStartIndexZero)},f.prototype.validateOnlyExpectedCharactersFound=function(h,p){var m=h.match(new RegExp("[^".concat(p,"]+"),"gi"));if(m&&m.length)throw new Error("Expression contains invalid values: '".concat(m.toString(),"'"))},f})();a.CronParser=d}),333:((s,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExpressionDescriptor=void 0;var u=l(823),d=l(949),f=(function(){function h(p,m){if(this.expression=p,this.options=m,this.expressionParts=new Array(5),!this.options.locale&&h.defaultLocale&&(this.options.locale=h.defaultLocale),!h.locales[this.options.locale]){var b=Object.keys(h.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(b,"'.")),this.options.locale=b}this.i18n=h.locales[this.options.locale],m.use24HourTimeFormat===void 0&&(m.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return h.toString=function(p,m){var b=m===void 0?{}:m,y=b.throwExceptionOnParseError,x=y===void 0?!0:y,C=b.verbose,v=C===void 0?!1:C,S=b.dayOfWeekStartIndexZero,I=S===void 0?!0:S,T=b.monthStartIndexZero,N=T===void 0?!1:T,O=b.use24HourTimeFormat,F=b.locale,B=F===void 0?null:F,j={throwExceptionOnParseError:x,verbose:v,dayOfWeekStartIndexZero:I,monthStartIndexZero:N,use24HourTimeFormat:O,locale:B};j.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var D=new h(p,j);return D.getFullDescription()},h.initialize=function(p,m){m===void 0&&(m="en"),h.specialCharacters=["/","-",",","*"],h.defaultLocale=m,p.load(h.locales)},h.prototype.getFullDescription=function(){var p,m,b="";try{var y=new d.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=y.parse(),this.expressionParts[0]==="@reboot")return((m=(p=this.i18n).atReboot)===null||m===void 0?void 0:m.call(p))||"Run once, at startup";var x=this.getTimeOfDayDescription(),C=this.getDayOfMonthDescription(),v=this.getMonthDescription(),S=this.getDayOfWeekDescription(),I=this.getYearDescription();b+=x+C+S+v+I,b=this.transformVerbosity(b,!!this.options.verbose),b=b.charAt(0).toLocaleUpperCase()+b.substr(1)}catch(T){if(!this.options.throwExceptionOnParseError)b=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(T)}return b},h.prototype.getTimeOfDayDescription=function(){var p=this.expressionParts[0],m=this.expressionParts[1],b=this.expressionParts[2],y="";if(!u.StringUtilities.containsAny(m,h.specialCharacters)&&!u.StringUtilities.containsAny(b,h.specialCharacters)&&!u.StringUtilities.containsAny(p,h.specialCharacters))y+=this.i18n.atSpace()+this.formatTime(b,m,p);else if(!p&&m.indexOf("-")>-1&&!(m.indexOf(",")>-1)&&!(m.indexOf("/")>-1)&&!u.StringUtilities.containsAny(b,h.specialCharacters)){var x=m.split("-");y+=u.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(b,x[0],""),this.formatTime(b,x[1],""))}else if(!p&&b.indexOf(",")>-1&&b.indexOf("-")==-1&&b.indexOf("/")==-1&&!u.StringUtilities.containsAny(m,h.specialCharacters)){var C=b.split(",");y+=this.i18n.at();for(var v=0;v<C.length;v++)y+=" ",y+=this.formatTime(C[v],m,""),v<C.length-2&&(y+=","),v==C.length-2&&(y+=this.i18n.spaceAnd())}else{var S=this.getSecondsDescription(),I=this.getMinutesDescription(),T=this.getHoursDescription();if(y+=S,y&&I&&(y+=", "),y+=I,I===T)return y;y&&T&&(y+=", "),y+=T}return y},h.prototype.getSecondsDescription=function(){var p=this,m=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(b){return b},function(b){return u.StringUtilities.format(p.i18n.everyX0Seconds(b),b)},function(b){return p.i18n.secondsX0ThroughX1PastTheMinute()},function(b){return b=="0"?"":parseInt(b)<20?p.i18n.atX0SecondsPastTheMinute(b):p.i18n.atX0SecondsPastTheMinuteGt20()||p.i18n.atX0SecondsPastTheMinute(b)});return m},h.prototype.getMinutesDescription=function(){var p=this,m=this.expressionParts[0],b=this.expressionParts[2],y=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(x){return x},function(x){return u.StringUtilities.format(p.i18n.everyX0Minutes(x),x)},function(x){return p.i18n.minutesX0ThroughX1PastTheHour()},function(x){try{return x=="0"&&b.indexOf("/")==-1&&m==""?p.i18n.everyHour():parseInt(x)<20?p.i18n.atX0MinutesPastTheHour(x):p.i18n.atX0MinutesPastTheHourGt20()||p.i18n.atX0MinutesPastTheHour(x)}catch{return p.i18n.atX0MinutesPastTheHour(x)}});return y},h.prototype.getHoursDescription=function(){var p=this,m=this.expressionParts[2],b=0,y=[];m.split("/")[0].split(",").forEach(function(v){var S=v.split("-");S.length===2&&y.push({value:S[1],index:b+1}),b+=S.length});var x=0,C=this.getSegmentDescription(m,this.i18n.everyHour(),function(v){var S=y.find(function(T){return T.value===v&&T.index===x}),I=S&&p.expressionParts[1]!=="0";return x++,I?p.formatTime(v,"59",""):p.formatTime(v,"0","")},function(v){return u.StringUtilities.format(p.i18n.everyX0Hours(v),v)},function(v){return p.i18n.betweenX0AndX1()},function(v){return p.i18n.atX0()});return C},h.prototype.getDayOfWeekDescription=function(){var p=this,m=this.i18n.daysOfTheWeek(),b=null;return this.expressionParts[5]=="*"?b="":b=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(y,x){var C=y;y.indexOf("#")>-1?C=y.substring(0,y.indexOf("#")):y.indexOf("L")>-1&&(C=C.replace("L",""));var v=parseInt(C),S=p.i18n.daysOfTheWeekInCase?p.i18n.daysOfTheWeekInCase(x)[v]:m[v];if(y.indexOf("#")>-1){var I=null,T=y.substring(y.indexOf("#")+1),N=y.substring(0,y.indexOf("#"));switch(T){case"1":I=p.i18n.first(N);break;case"2":I=p.i18n.second(N);break;case"3":I=p.i18n.third(N);break;case"4":I=p.i18n.fourth(N);break;case"5":I=p.i18n.fifth(N);break}S=I+" "+S}return S},function(y){return parseInt(y)==1?"":u.StringUtilities.format(p.i18n.commaEveryX0DaysOfTheWeek(y),y)},function(y){var x=y.substring(0,y.indexOf("-")),C=p.expressionParts[3]!="*";return C?p.i18n.commaAndX0ThroughX1(x):p.i18n.commaX0ThroughX1(x)},function(y){var x=null;if(y.indexOf("#")>-1){var C=y.substring(y.indexOf("#")+1),v=y.substring(0,y.indexOf("#"));x=p.i18n.commaOnThe(C,v).trim()+p.i18n.spaceX0OfTheMonth()}else if(y.indexOf("L")>-1)x=p.i18n.commaOnTheLastX0OfTheMonth(y.replace("L",""));else{var S=p.expressionParts[3]!="*";x=S?p.i18n.commaAndOnX0():p.i18n.commaOnlyOnX0(y)}return x}),b},h.prototype.getMonthDescription=function(){var p=this,m=this.i18n.monthsOfTheYear(),b=this.getSegmentDescription(this.expressionParts[4],"",function(y,x){return x&&p.i18n.monthsOfTheYearInCase?p.i18n.monthsOfTheYearInCase(x)[parseInt(y)-1]:m[parseInt(y)-1]},function(y){return parseInt(y)==1?"":u.StringUtilities.format(p.i18n.commaEveryX0Months(y),y)},function(y){return p.i18n.commaMonthX0ThroughMonthX1()||p.i18n.commaX0ThroughX1()},function(y){return p.i18n.commaOnlyInMonthX0?p.i18n.commaOnlyInMonthX0():p.i18n.commaOnlyInX0()});return b},h.prototype.getDayOfMonthDescription=function(){var p=this,m=null,b=this.expressionParts[3];switch(b){case"L":m=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":m=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var y=b.match(/(\d{1,2}W)|(W\d{1,2})/);if(y){var x=parseInt(y[0].replace("W","")),C=x==1?this.i18n.firstWeekday():u.StringUtilities.format(this.i18n.weekdayNearestDayX0(),x.toString());m=u.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),C);break}else{var v=b.match(/L-(\d{1,2})/);if(v){var S=v[1];m=u.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(S),S);break}else{if(b=="*"&&this.expressionParts[5]!="*")return"";m=this.getSegmentDescription(b,this.i18n.commaEveryDay(),function(I){return I=="L"?p.i18n.lastDay():p.i18n.dayX0?u.StringUtilities.format(p.i18n.dayX0(),I):I},function(I){return I=="1"?p.i18n.commaEveryDay():p.i18n.commaEveryX0Days(I)},function(I){return p.i18n.commaBetweenDayX0AndX1OfTheMonth(I)},function(I){return p.i18n.commaOnDayX0OfTheMonth(I)})}break}}return m},h.prototype.getYearDescription=function(){var p=this,m=this.getSegmentDescription(this.expressionParts[6],"",function(b){return/^\d+$/.test(b)?new Date(parseInt(b),1).getFullYear().toString():b},function(b){return u.StringUtilities.format(p.i18n.commaEveryX0Years(b),b)},function(b){return p.i18n.commaYearX0ThroughYearX1()||p.i18n.commaX0ThroughX1()},function(b){return p.i18n.commaOnlyInYearX0?p.i18n.commaOnlyInYearX0():p.i18n.commaOnlyInX0()});return m},h.prototype.getSegmentDescription=function(p,m,b,y,x,C){var v=null,S=p.indexOf("/")>-1,I=p.indexOf("-")>-1,T=p.indexOf(",")>-1;if(!p)v="";else if(p==="*")v=m;else if(!S&&!I&&!T)v=u.StringUtilities.format(C(p),b(p));else if(T){for(var N=p.split(","),O="",F=0;F<N.length;F++)if(F>0&&N.length>2&&(O+=",",F<N.length-1&&(O+=" ")),F>0&&N.length>1&&(F==N.length-1||N.length==2)&&(O+="".concat(this.i18n.spaceAnd()," ")),N[F].indexOf("/")>-1||N[F].indexOf("-")>-1){var B=N[F].indexOf("-")>-1&&N[F].indexOf("/")==-1,j=this.getSegmentDescription(N[F],m,b,y,B?this.i18n.commaX0ThroughX1:x,C);B&&(j=j.replace(", ","")),O+=j}else S?O+=this.getSegmentDescription(N[F],m,b,y,x,C):O+=b(N[F]);S?v=O:v=u.StringUtilities.format(C(p),O)}else if(S){var N=p.split("/");if(v=u.StringUtilities.format(y(N[1]),N[1]),N[0].indexOf("-")>-1){var D=this.generateRangeSegmentDescription(N[0],x,b);D.indexOf(", ")!=0&&(v+=", "),v+=D}else if(N[0].indexOf("*")==-1){var H=u.StringUtilities.format(C(N[0]),b(N[0]));H=H.replace(", ",""),v+=u.StringUtilities.format(this.i18n.commaStartingX0(),H)}}else I&&(v=this.generateRangeSegmentDescription(p,x,b));return v},h.prototype.generateRangeSegmentDescription=function(p,m,b){var y="",x=p.split("-"),C=b(x[0],1),v=b(x[1],2),S=m(p);return y+=u.StringUtilities.format(S,C,v),y},h.prototype.formatTime=function(p,m,b){var y=0,x=0,C=parseInt(p)+y,v=parseInt(m)+x;v>=60?(v-=60,C+=1):v<0&&(v+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var S="",I=!1;this.options.use24HourTimeFormat||(I=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),S=I?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var T="";return b&&(T=":".concat(("00"+b).substring(b.length))),"".concat(I?S:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+v.toString()).substring(v.toString().length)).concat(T).concat(I?"":S)},h.prototype.transformVerbosity=function(p,m){if(!m&&(p=p.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),p=p.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),p=p.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),p=p.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var b=0,y=Object.entries(this.i18n.conciseVerbosityReplacements());b<y.length;b++){var x=y[b],C=x[0],v=x[1];p=p.replace(new RegExp(C,"g"),v)}return p},h.prototype.getPeriod=function(p){return p>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},h.locales={},h})();a.ExpressionDescriptor=f}),747:((s,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.enLocaleLoader=void 0;var u=l(486),d=(function(){function f(){}return f.prototype.load=function(h){h.en=new u.en},f})();a.enLocaleLoader=d}),486:((s,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.en=void 0;var l=(function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!1},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},u.prototype.everyMinute=function(){return"every minute"},u.prototype.everyHour=function(){return"every hour"},u.prototype.atSpace=function(){return"At "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},u.prototype.at=function(){return"At"},u.prototype.spaceAnd=function(){return" and"},u.prototype.everySecond=function(){return"every second"},u.prototype.everyX0Seconds=function(){return"every %s seconds"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},u.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},u.prototype.everyX0Minutes=function(){return"every %s minutes"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},u.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},u.prototype.everyX0Hours=function(){return"every %s hours"},u.prototype.betweenX0AndX1=function(){return"between %s and %s"},u.prototype.atX0=function(){return"at %s"},u.prototype.commaEveryDay=function(){return", every day"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},u.prototype.commaX0ThroughX1=function(){return", %s through %s"},u.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},u.prototype.first=function(){return"first"},u.prototype.second=function(){return"second"},u.prototype.third=function(){return"third"},u.prototype.fourth=function(){return"fourth"},u.prototype.fifth=function(){return"fifth"},u.prototype.commaOnThe=function(){return", on the "},u.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},u.prototype.lastDay=function(){return"the last day"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},u.prototype.commaOnlyOnX0=function(){return", only on %s"},u.prototype.commaAndOnX0=function(){return", and on %s"},u.prototype.commaEveryX0Months=function(){return", every %s months"},u.prototype.commaOnlyInX0=function(){return", only in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},u.prototype.firstWeekday=function(){return"first weekday"},u.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},u.prototype.commaEveryX0Days=function(){return", every %s days"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},u.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},u.prototype.commaEveryHour=function(){return", every hour"},u.prototype.commaEveryX0Years=function(){return", every %s years"},u.prototype.commaStartingX0=function(){return", starting %s"},u.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},u.prototype.atReboot=function(){return"Run once, at startup"},u})();a.en=l}),515:((s,a)=>{Object.defineProperty(a,"__esModule",{value:!0});function l(d,f){if(!d)throw new Error(f)}var u=(function(){function d(){}return d.secondRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=0&&m<=59,"seconds part must be >= 0 and <= 59")}},d.minuteRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=0&&m<=59,"minutes part must be >= 0 and <= 59")}},d.hourRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=0&&m<=23,"hours part must be >= 0 and <= 23")}},d.dayOfMonthRange=function(f){for(var h=f.split(","),p=0;p<h.length;p++)if(!isNaN(parseInt(h[p],10))){var m=parseInt(h[p],10);l(m>=1&&m<=31,"DOM part must be >= 1 and <= 31")}},d.monthRange=function(f,h){for(var p=f.split(","),m=0;m<p.length;m++)if(!isNaN(parseInt(p[m],10))){var b=parseInt(p[m],10);l(b>=1&&b<=12,h?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},d.dayOfWeekRange=function(f,h){for(var p=f.split(","),m=0;m<p.length;m++)if(!isNaN(parseInt(p[m],10))){var b=parseInt(p[m],10);l(b>=0&&b<=6,h?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},d})();a.default=u}),823:((s,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.StringUtilities=void 0;var l=(function(){function u(){}return u.format=function(d){for(var f=[],h=1;h<arguments.length;h++)f[h-1]=arguments[h];return d.replace(/%s/g,function(p){return f.shift()})},u.containsAny=function(d,f){return f.some(function(h){return d.indexOf(h)>-1})},u})();a.StringUtilities=l})},r={};function o(s){var a=r[s];if(a!==void 0)return a.exports;var l=r[s]={exports:{}};return n[s](l,l.exports,o),l.exports}var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.toString=void 0;var a=o(333),l=o(747);a.ExpressionDescriptor.initialize(new l.enLocaleLoader),s.default=a.ExpressionDescriptor;var u=a.ExpressionDescriptor.toString;s.toString=u})(),i})())})(Bd)),Bd.exports}var dL=cL();const fL=Tr(dL),pL=new Set(["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","SUN","MON","TUE","WED","THU","FRI","SAT"]);function hL(e){for(const t of e.trim().split(/\s+/)){if(/[#?]/.test(t))return!1;for(const n of t.split(/[,\-/]/))if(!(n===""||n==="*")&&/[A-Za-z]/.test(n)&&!pL.has(n.toUpperCase()))return!1}return!0}function S2(e){const t=(e??"").trim();if(t.split(/\s+/).filter(Boolean).length!==5)return{valid:!1,description:"",nextRun:null,error:"Expected a 5-field UNIX cron: minute hour day-of-month month day-of-week."};if(!hL(t))return{valid:!1,description:"",nextRun:null,error:"Unsupported cron syntax: L, W, #, and ? extensions are not allowed (plain 5-field UNIX cron only)."};try{const n=fL.toString(t,{use24HourTimeFormat:!0,verbose:!1}),r=uL.CronExpressionParser.parse(t,{tz:"UTC"}).next().toDate();return{valid:!0,description:n,nextRun:r}}catch(n){return{valid:!1,description:"",nextRun:null,error:n instanceof Error?n.message:"Invalid cron expression."}}}function k2(e){return e?e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC",hour12:!1})+" UTC":"—"}const Wg="0 6 * * *";function mL({currentSchedule:e,isSubmitting:t,disabled:n,disabledReason:r,onSubmit:o}){const[i,s]=W.useState(!1),[a,l]=W.useState(e??Wg),u=()=>{l(e??Wg),s(!0)},d=()=>s(!1),f=S2(a),h=async m=>{try{await o(m),s(!1)}catch{}},p=c.jsx("span",{children:c.jsx(w.Button,{variant:"outlined",size:"small",startIcon:c.jsx(Hu,{}),onClick:u,disabled:n,"aria-label":e?"Edit schedule":"Set schedule",children:e?"Edit schedule":"Set schedule"})});return c.jsxs(c.Fragment,{children:[n&&r?c.jsx(w.Tooltip,{title:r,children:p}):p,c.jsxs(w.Dialog,{open:i,onClose:d,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"set-schedule-title",children:[c.jsx(w.DialogTitle,{id:"set-schedule-title",children:e?"Edit schedule":"Set schedule"}),c.jsxs(w.DialogContent,{children:[c.jsx(w.DialogContentText,{sx:{mb:2},children:"The publisher rebuilds the materializations in this package on this cadence. Enter a 5-field UNIX cron, evaluated in UTC. In a hosted deployment, the change takes effect on your next publish."}),c.jsx(w.TextField,{autoFocus:!0,fullWidth:!0,label:"Cron expression",value:a,onChange:m=>l(m.target.value),error:a.trim()!==""&&!f.valid,slotProps:{htmlInput:{style:{fontFamily:De.MONO_FONT_FAMILY}}}}),c.jsx(w.Box,{sx:{mt:1.5,minHeight:48},children:f.valid?c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{variant:"body2",children:f.description}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Next run: ",k2(f.nextRun)]})]}):c.jsx(w.Typography,{variant:"body2",color:"error",children:f.error})}),c.jsxs(w.Alert,{severity:"info",sx:{mt:2},children:["A schedule runs only on version-scoped packages, so saving one sets ",c.jsx("code",{children:"scope: version"})," for this package."]})]}),c.jsxs(w.DialogActions,{sx:{justifyContent:"space-between",px:3},children:[c.jsx(w.Box,{children:e&&c.jsx(w.Button,{color:"error",loading:t,onClick:()=>h(null),children:"Clear schedule"})}),c.jsxs(w.Box,{children:[c.jsx(w.Button,{onClick:d,children:"Cancel"}),c.jsx(w.Button,{variant:"contained",loading:t,disabled:!f.valid,onClick:()=>h(a.trim()),sx:{ml:1},children:"Save"})]})]})]})]})}function gL({schedule:e,scope:t,manifestLocation:n,hasFreshness:r,mutable:o,isSubmitting:i,isScopeMutating:s,onSubmit:a,onScopeChange:l}){const u=!!n,d=e?S2(e):null,f=!!e;return c.jsx(w.Card,{variant:"outlined",sx:{borderRadius:2,mb:6},children:c.jsx(w.CardContent,{children:c.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:2,children:[c.jsxs(w.Box,{sx:{minWidth:0},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[c.jsx(Hu,{fontSize:"small",color:"action"}),c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Schedule"})]}),u?c.jsxs(w.Box,{children:[c.jsx(w.Chip,{size:"small",color:"default",variant:"outlined",label:"Control-plane managed",sx:{mb:1}}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Refresh is driven by the control plane; the built-in scheduler does not fire this package."})]}):d?c.jsxs(w.Box,{children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5,flexWrap:"wrap"},children:[c.jsx(w.Chip,{size:"small",color:"success",variant:"outlined",icon:c.jsx(Hu,{fontSize:"small"}),label:"Active"}),c.jsx(w.Box,{component:"code",sx:{fontFamily:De.MONO_FONT_FAMILY,fontSize:"0.8125rem",px:.75,py:.25,borderRadius:1,bgcolor:"action.hover"},children:e})]}),c.jsx(w.Typography,{variant:"body2",children:d.valid?d.description:"Unrecognized cron expression."}),d.valid&&c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Next run: ",k2(d.nextRun)]})]}):r?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"This package uses a freshness policy; a cron schedule is not applicable."}):c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"On-demand only — no schedule set."}),!u&&c.jsxs(w.Box,{sx:{mt:2},children:[c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Scope"}),c.jsx(w.Tooltip,{title:f?"A schedule requires version scope. Clear the schedule to change it.":"",children:c.jsx("span",{children:c.jsxs(w.ToggleButtonGroup,{size:"small",exclusive:!0,value:t,disabled:!o||!l||f||!!s,onChange:(h,p)=>{p&&p!==t&&l?.(p)},children:[c.jsx(w.ToggleButton,{value:"package",children:"package"}),c.jsx(w.ToggleButton,{value:"version",children:"version"})]})})}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:.5},children:t==="version"?"Materialized artifacts are per version (required for a schedule).":"Materialized artifacts are shared across versions."})]}),c.jsxs(w.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1.5},children:["Declared in ",c.jsx("code",{children:"publisher.json"}),".",!u&&c.jsxs(c.Fragment,{children:[" ","In a hosted deployment, a change takes effect on your next publish."]})]})]}),o&&!u&&c.jsx(mL,{currentSchedule:e,isSubmitting:i,disabled:r,disabledReason:"This package declares a freshness policy; a schedule and freshness are mutually exclusive.",onSubmit:a})]})})})}const bL=3e3;function yL({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=De.useServer(),o=Lr.useQueryClient(),{environmentName:i,packageName:s}=Ht(e),[a,l]=W.useState(""),[u,d]=W.useState(null),f=t??(F=>{window.location.href=F});if(!s)throw new Error("Materializations requires a package in the resource URI");const h=Xt({queryKey:["materializations",i,s],queryFn:()=>n.materializations.listMaterializations(i,s),refetchInterval:F=>(F.state.data?.data??[]).some(D=>Ja(D.status))?bL:!1}),p=Xt({queryKey:["package",i,s],queryFn:()=>n.packages.getPackage(i,s)}),m=()=>o.invalidateQueries({queryKey:["materializations",i,s]}),b=vn({mutationFn:F=>n.materializations.createMaterialization(i,s,{forceRefresh:F.forceRefresh}),onSuccess(){l("Materialization requested"),m()},onError(F){l(F.message),m()}}),y=vn({mutationFn:F=>n.materializations.materializationAction(i,s,F.id,De.MaterializationActionActionEnum.Stop),onSuccess(){l("Materialization stopped"),m()},onError(F){l(F.message)}}),x=vn({mutationFn:({materialization:F,dropTables:B})=>n.materializations.deleteMaterialization(i,s,F.id,B),onSuccess(){l("Materialization deleted"),m()},onError(F){l(F.message)}}),C=p.data?.data,v=vn({mutationFn:F=>n.packages.updatePackage(i,s,{name:s,description:C?.description,...F?{scope:De.PackageScopeEnum.Version}:{},materialization:{schedule:F}}),onSuccess(F,B){l(B?"Schedule updated":"Schedule cleared"),o.invalidateQueries({queryKey:["package",i,s]})},onError(F){l(F.message)}}),S=vn({mutationFn:F=>n.packages.updatePackage(i,s,{name:s,description:C?.description,scope:F}),onSuccess(){l("Scope updated"),o.invalidateQueries({queryKey:["package",i,s]})},onError(F){l(F.message)}}),I=h.data?.data??[],T=I.find(F=>F.id===u)??null,N=I.some(F=>Ja(F.status)),O=b.isPending||y.isPending||x.isPending;return c.jsxs(w.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Link,{onClick:F=>f(`/${i}/${s}`,F),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[c.jsx(e2,{sx:{fontSize:18}}),"Back to ",s]}),c.jsxs(w.Stack,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:"Materializations"}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Materialize the persist sources in ",s," into tables and serve queries from them"]})]}),r&&c.jsx(vN,{onSubmit:F=>b.mutateAsync(F),isSubmitting:b.isPending,disabled:N,disabledReason:"A materialization is already pending or running for this package."})]})]}),p.isSuccess&&c.jsx(gL,{schedule:C?.materialization?.schedule??null,scope:C?.scope===De.PackageScopeEnum.Version?"version":"package",manifestLocation:C?.manifestLocation??null,hasFreshness:!!C?.materialization?.freshness,mutable:r,isSubmitting:v.isPending,isScopeMutating:S.isPending,onSubmit:F=>v.mutateAsync(F),onScopeChange:F=>S.mutateAsync(F==="version"?De.PackageScopeEnum.Version:De.PackageScopeEnum.Package)}),c.jsxs(w.Box,{sx:{mb:6},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:1},children:"Runs"}),h.isError&&c.jsx(kn,{error:h.error,context:`${i} > ${s} > Materializations`}),!h.isSuccess&&!h.isError&&c.jsx(Sn,{text:"Loading materializations..."}),h.isSuccess&&c.jsx(C2,{materializations:I,mutable:r,isMutating:O,onStop:F=>y.mutate(F),onDelete:(F,B)=>x.mutate({materialization:F,dropTables:B}),onViewDetails:F=>d(F.id??null)})]}),c.jsx(s2,{materialization:T,buildPlan:p.data?.data?.buildPlan??null,onClose:()=>d(null)}),c.jsx(w.Snackbar,{open:a!=="",autoHideDuration:6e3,onClose:()=>l(""),message:a})]})}function xL({packages:e,onSubmit:t,isSubmitting:n,disabled:r}){const[o,i]=W.useState(!1),[s,a]=W.useState({}),[l,u]=W.useState(!1),d=()=>{a({}),u(!1),i(!0)},f=()=>i(!1),h=e.map(y=>y.name).filter(y=>s[y]),p=y=>a(x=>({...x,[y]:!x[y]})),m=e.length>0&&h.length===e.length,b=async()=>{try{await t({packageNames:h,forceRefresh:l}),i(!1)}catch{}};return c.jsxs(c.Fragment,{children:[c.jsx(w.Button,{variant:"contained",startIcon:c.jsx(fl,{}),onClick:d,disabled:r,"aria-label":"New materialization",children:"New materialization"}),c.jsxs(w.Dialog,{open:o,onClose:f,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-env-materialization-title",children:[c.jsx(w.DialogTitle,{id:"create-env-materialization-title",children:"New materialization"}),c.jsxs(w.DialogContent,{children:[c.jsx(w.DialogContentText,{sx:{mb:1},children:"Pick the packages to materialize. Each runs an independent build of every persist source in that package."}),e.length===0?c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"No packages in this environment."}):c.jsxs(c.Fragment,{children:[c.jsx(w.FormControlLabel,{control:c.jsx(w.Checkbox,{checked:m,indeterminate:h.length>0&&!m,onChange:y=>{const x={};y.target.checked&&e.forEach(C=>x[C.name]=!0),a(x)}}),label:c.jsx(w.Typography,{variant:"body2",children:"Select all"})}),c.jsx(w.Box,{sx:{maxHeight:240,overflowY:"auto",pl:1,borderLeft:"2px solid",borderColor:"divider"},children:c.jsx(w.FormGroup,{children:e.map(y=>c.jsx(w.FormControlLabel,{control:c.jsx(w.Checkbox,{checked:!!s[y.name],onChange:()=>p(y.name)}),label:y.name},y.name))})}),c.jsx(w.FormControlLabel,{sx:{mt:1},control:c.jsx(w.Switch,{checked:l,onChange:y=>u(y.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})]})]}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:f,children:"Cancel"}),c.jsxs(w.Button,{variant:"contained",loading:n,disabled:h.length===0,onClick:b,children:["Materialize",h.length>0?` (${h.length})`:""]})]})]})]})}const CL=3e3,qg=10;function w2({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=De.useServer(),o=Lr.useQueryClient(),{environmentName:i}=Ht(e),[s,a]=W.useState(""),[l,u]=W.useState(null),[d,f]=W.useState(qg),h=t??(O=>{window.location.href=O}),p=Xt({queryKey:["env-materializations",i,d],queryFn:()=>n.materializations.listEnvironmentMaterializations(i,d),placeholderData:O=>O,refetchInterval:O=>(O.state.data?.data??[]).some(j=>Ja(j.status))?CL:!1}),m=Xt({queryKey:["packages",i],queryFn:()=>n.packages.listPackages(i)}),b=()=>o.invalidateQueries({queryKey:["env-materializations",i]}),y=vn({mutationFn:async O=>{const B=(await Promise.allSettled(O.packageNames.map(j=>n.materializations.createMaterialization(i,j,{forceRefresh:O.forceRefresh})))).filter(j=>j.status==="rejected").length;return{total:O.packageNames.length,failed:B}},onSuccess(O){const F=O.total-O.failed;a(O.failed===0?`Started ${F} materialization${F===1?"":"s"}`:`Started ${F} of ${O.total} (${O.failed} could not start — a build may already be active)`),b()},onError(O){a(O.message),b()}}),x=vn({mutationFn:O=>n.materializations.materializationAction(i,O.packageName,O.id,De.MaterializationActionActionEnum.Stop),onSuccess(){a("Materialization stopped"),b()},onError(O){a(O.message)}}),C=vn({mutationFn:({materialization:O,dropTables:F})=>n.materializations.deleteMaterialization(i,O.packageName,O.id,F),onSuccess(){a("Materialization deleted"),b()},onError(O){a(O.message)}}),v=p.data?.data??[],S=m.data?.data??[],I=v.find(O=>O.id===l)??null,T=y.isPending||x.isPending||C.isPending,N=v.length>=d;return c.jsxs(w.Box,{children:[c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Materializations"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"All materialization builds across the packages in this environment"})]}),r&&c.jsx(xL,{packages:S,onSubmit:O=>y.mutateAsync(O),isSubmitting:y.isPending})]}),p.isError&&c.jsx(kn,{error:p.error,context:`${i} > Materializations`}),!p.isSuccess&&!p.isError&&c.jsx(Sn,{text:"Loading materializations..."}),p.isSuccess&&c.jsx(C2,{materializations:v,mutable:r,isMutating:T,showPackage:!0,onClickPackage:O=>h(`/${i}/${O}/materializations`),onStop:O=>x.mutate(O),onDelete:(O,F)=>C.mutate({materialization:O,dropTables:F}),onViewDetails:O=>u(O.id??null)}),p.isSuccess&&v.length>0&&c.jsxs(w.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:2,sx:{mt:2},children:[c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:N?`Showing ${v.length} most recent`:`${v.length} materialization${v.length===1?"":"s"}`}),N&&c.jsx(w.Button,{size:"small",onClick:()=>f(O=>O+qg),disabled:p.isFetching,children:"Show more"})]}),c.jsx(s2,{materialization:I,buildPlan:null,showBuildPlan:!1,onClose:()=>u(null)}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})}function EL({resourceUri:e}){const{environmentName:t}=Ht(e),{apiClients:n}=De.useServer(),[r,o]=W.useState(!1),i=90,{data:s,isSuccess:a,isError:l,error:u}=Xt({queryKey:["about",t],queryFn:()=>n.environments.getEnvironment(t,!1)}),d=s?.data?.readme||"",f=d.split(/\s+/),h=f.length>i,p=f.slice(0,i).join(" ");return c.jsxs(c.Fragment,{children:[!a&&!l&&c.jsx(Sn,{text:"Fetching About..."}),a&&d&&c.jsx(De.PackageCard,{children:c.jsxs(De.PackageCardContent,{children:[c.jsx(De.PackageSectionTitle,{children:"Readme"}),c.jsxs(w.Box,{sx:{mt:1,fontSize:"0.875rem",lineHeight:1.6},children:[c.jsx(wu,{options:{overrides:{h1:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h2:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h3:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}}}},children:r||!h?d:p}),h&&c.jsxs(w.Box,{sx:{mt:1},children:[" ",c.jsx(w.Button,{variant:"text",size:"small",onClick:()=>o(!r),children:r?"Read less":"Read more"})]})]})]})}),l&&c.jsx(kn,{error:u,context:`${t} > About`})]})}const D2="https://docs.malloydata.dev/documentation",jd=`${D2}/user_guides/publishing`,ss={docsHome:`${D2}/`,publishing:`${jd}/publishing`,explorer:`${jd}/explorer`,mcpAgents:`${jd}/mcp_agents`};function vL({resourceUri:e}){const[t,n]=W.useState(!1),{apiClients:r}=De.useServer(),o=Lr.useQueryClient(),[i,s]=W.useState(""),{environmentName:a}=Ht(e),l=vn({async mutationFn(d){return r.packages.createPackage(a,{name:d.name,description:d.description,location:d.location})},onSuccess(){n(!1),s("Package created successfully"),o.invalidateQueries({queryKey:["packages",a]})},onError(d){s(d instanceof Error?d.message:"An unknown error occurred")}}),u=d=>{d.preventDefault();const f=new FormData(d.currentTarget),h=f.get("name")?.toString(),p=f.get("description")?.toString(),m=f.get("location")?.toString();l.mutate({name:h,description:p,location:m})};return c.jsxs(c.Fragment,{children:[c.jsx(w.Button,{onClick:()=>n(!0),variant:"contained",color:"primary",startIcon:c.jsx(On.Add,{}),children:"Add Package"}),c.jsxs(w.Dialog,{open:t,onClose:()=>n(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[c.jsx(w.DialogTitle,{sx:{fontSize:"1.25rem",fontWeight:600,letterSpacing:"-0.025em",pt:3,pb:1,px:3},children:"Create New Package"}),c.jsxs(w.DialogContent,{sx:{px:3,pb:0},children:[c.jsxs(w.Box,{sx:{mb:3},children:[c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"Create a new Malloy package to start exploring your data."}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"The location can be a GitHub/S3/GCP URL containing a package (zipped or unzipped), or an absolute path to a directory the publisher server has access to."}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Make sure to conform to the"," ",c.jsx(w.Box,{component:"a",href:ss.publishing,target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Package Format"}),"."]})]}),c.jsx("form",{onSubmit:u,id:"package-form",children:c.jsxs(w.Stack,{spacing:2.5,children:[c.jsx(w.TextField,{autoFocus:!0,required:!0,id:"name",name:"name",label:"Package Name",type:"text",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),c.jsx(w.TextField,{id:"description",name:"description",label:"Description",multiline:!0,rows:3,fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),c.jsx(w.TextField,{id:"location",name:"location",label:"Location",type:"text",placeholder:"e.g. s3://my-bucket/my-package.zip",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}})]})})]}),c.jsxs(w.DialogActions,{sx:{px:3,pt:2,pb:3,gap:1},children:[c.jsx(w.Button,{variant:"outlined",disabled:l.isPending,onClick:()=>n(!1),children:"Cancel"}),c.jsx(w.Button,{type:"submit",form:"package-form",variant:"contained",loading:l.isPending,children:"Save Changes"})]})]}),c.jsx(w.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})}const TL=mt(c.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),I2=mt(c.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}));function A2(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:Ka(t.components[n].defaultProps,r)}function SL({props:e,name:t,defaultTheme:n,themeId:r}){let o=$S(n);return o=o[r]||o,A2({theme:o,name:t,props:e})}function Kt({props:e,name:t}){return SL({props:e,name:t,defaultTheme:uc,themeId:Cs})}const kL=We("MuiBox",["root"]),wL=bb(),Qt=Ot.createBox({themeId:Cs,defaultTheme:wL,defaultClassName:kL.root,generateClassName:nb.generate});function DL(e){return Ge("MuiDialogContentText",e)}We("MuiDialogContentText",["root"]);const IL=e=>{const{classes:t}=e,r=Ke({root:["root"]},DL,t);return{...t,...r}},AL=fe(Dt,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiDialogContentText",slot:"Root"})({}),vl=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogContentText"}),{children:o,className:i,...s}=r,a=IL(s);return c.jsx(AL,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:s,className:Ue(a.root,i),...r,classes:a})});function Zl(e){return parseInt(e,10)||0}const OL={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function ML(e){for(const t in e)return!1;return!0}function Yg(e){return ML(e)||e.outerHeightStyle===0&&!e.overflowing}const PL=M.forwardRef(function(t,n){const{onChange:r,maxRows:o,minRows:i=1,style:s,value:a,...l}=t,{current:u}=M.useRef(a!=null),d=M.useRef(null),f=vt(n,d),h=M.useRef(null),p=M.useRef(null),m=M.useCallback(()=>{const v=d.current,S=p.current;if(!v||!S)return;const T=bo(v).getComputedStyle(v);if(T.width==="0px")return{outerHeightStyle:0,overflowing:!1};S.style.width=T.width,S.value=v.value||t.placeholder||"x",S.value.slice(-1)===`
195
195
  `&&(S.value+=" ");const N=T.boxSizing,O=Zl(T.paddingBottom)+Zl(T.paddingTop),F=Zl(T.borderBottomWidth)+Zl(T.borderTopWidth),B=S.scrollHeight;S.value="x";const j=S.scrollHeight;let D=B;i&&(D=Math.max(Number(i)*j,D)),o&&(D=Math.min(Number(o)*j,D)),D=Math.max(D,j);const H=D+(N==="border-box"?O+F:0),_=Math.abs(D-B)<=1;return{outerHeightStyle:H,overflowing:_}},[o,i,t.placeholder]),b=Ve(()=>{const v=d.current,S=m();if(!v||!S||Yg(S))return!1;const I=S.outerHeightStyle;return h.current!=null&&h.current!==I}),y=M.useCallback(()=>{const v=d.current,S=m();if(!v||!S||Yg(S))return;const I=S.outerHeightStyle;h.current!==I&&(h.current=I,v.style.height=`${I}px`),v.style.overflow=S.overflowing?"hidden":""},[m]),x=M.useRef(-1);yn(()=>{const v=Cb(y),S=d?.current;if(!S)return;const I=bo(S);I.addEventListener("resize",v);let T;return typeof ResizeObserver<"u"&&(T=new ResizeObserver(()=>{b()&&(T.unobserve(S),cancelAnimationFrame(x.current),y(),x.current=requestAnimationFrame(()=>{T.observe(S)}))}),T.observe(S)),()=>{v.clear(),cancelAnimationFrame(x.current),I.removeEventListener("resize",v),T&&T.disconnect()}},[m,y,b]),yn(()=>{y()});const C=v=>{u||y();const S=v.target,I=S.value.length,T=S.value.endsWith(`
196
- `),N=S.selectionStart===I;T&&N&&S.setSelectionRange(I,I),r&&r(v)};return c.jsxs(M.Fragment,{children:[c.jsx("textarea",{value:a,onChange:C,ref:f,rows:i,style:s,...l}),c.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:p,tabIndex:-1,style:{...wL.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function AL(e){return Ge("MuiInputBase",e)}const tr=We("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Kg;const wc=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Fe(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Dc=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},OL=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:i,focused:s,formControl:a,fullWidth:l,hiddenLabel:u,multiline:d,readOnly:f,size:h,startAdornment:p,type:m}=e,b={root:["root",`color${Fe(n)}`,r&&"disabled",o&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",h&&h!=="medium"&&`size${Fe(h)}`,d&&"multiline",p&&"adornedStart",i&&"adornedEnd",u&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",m==="search"&&"inputTypeSearch",d&&"inputMultiline",h==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",i&&"inputAdornedEnd",f&&"readOnly"]};return Ke(b,AL,t)},Ic=fe("div",{name:"MuiInputBase",slot:"Root",overridesResolver:wc})(ft(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${tr.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),Ac=fe("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Dc})(ft(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${tr.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${tr.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:i})=>!i.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:i})=>i.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),Gg=wk({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),_p=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:i,autoFocus:s,className:a,color:l,components:u={},componentsProps:d={},defaultValue:f,disabled:h,disableInjectingGlobalStyles:p,endAdornment:m,error:b,fullWidth:y=!1,id:x,inputComponent:C="input",inputProps:v={},inputRef:S,margin:I,maxRows:T,minRows:N,multiline:O=!1,name:F,onBlur:B,onChange:j,onClick:D,onFocus:H,onKeyDown:_,onKeyUp:L,placeholder:$,readOnly:K,renderSuffix:G,rows:q,size:R,slotProps:oe={},slots:se={},startAdornment:z,type:pe="text",value:J,...Q}=r,re=v.value!=null?v.value:J,{current:ne}=M.useRef(re!=null),ae=M.useRef(),ie=M.useCallback(Re=>{},[]),Z=vt(ae,S,v.ref,ie),[me,le]=M.useState(!1),ue=ar(),Ie=Ei({props:r,muiFormControl:ue,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Ie.focused=ue?ue.focused:me,M.useEffect(()=>{!ue&&h&&me&&(le(!1),B&&B())},[ue,h,me,B]);const Ce=ue&&ue.onFilled,we=ue&&ue.onEmpty,ye=M.useCallback(Re=>{Vu(Re)?Ce&&Ce():we&&we()},[Ce,we]);yn(()=>{ne&&ye({value:re})},[re,ye,ne]);const ze=Re=>{H&&H(Re),v.onFocus&&v.onFocus(Re),ue&&ue.onFocus?ue.onFocus(Re):le(!0)},Ne=Re=>{B&&B(Re),v.onBlur&&v.onBlur(Re),ue&&ue.onBlur?ue.onBlur(Re):le(!1)},nt=(Re,...ct)=>{if(!ne){const lt=Re.target||ae.current;if(lt==null)throw new Error(mo(1));ye({value:lt.value})}v.onChange&&v.onChange(Re,...ct),j&&j(Re,...ct)};M.useEffect(()=>{ye(ae.current)},[]);const _e=Re=>{ae.current&&Re.currentTarget===Re.target&&ae.current.focus(),D&&D(Re)};let Bt=C,yt=v;O&&Bt==="input"&&(q?yt={type:void 0,minRows:q,maxRows:q,...yt}:yt={type:void 0,maxRows:T,minRows:N,...yt},Bt=IL);const ot=Re=>{ye(Re.animationName==="mui-auto-fill-cancel"?ae.current:{value:"x"})};M.useEffect(()=>{ue&&ue.setAdornedStart(!!z)},[ue,z]);const xe={...r,color:Ie.color||"primary",disabled:Ie.disabled,endAdornment:m,error:Ie.error,focused:Ie.focused,formControl:ue,fullWidth:y,hiddenLabel:Ie.hiddenLabel,multiline:O,size:Ie.size,startAdornment:z,type:pe},Pe=OL(xe),qe=se.root||u.Root||Ic,Je=oe.root||d.root||{},Xe=se.input||u.Input||Ac;return yt={...yt,...oe.input??d.input},c.jsxs(M.Fragment,{children:[!p&&typeof Gg=="function"&&(Kg||(Kg=c.jsx(Gg,{}))),c.jsxs(qe,{...Je,ref:n,onClick:_e,...Q,...!hs(qe)&&{ownerState:{...xe,...Je.ownerState}},className:Ue(Pe.root,Je.className,a,K&&"MuiInputBase-readOnly"),children:[z,c.jsx(kc.Provider,{value:null,children:c.jsx(Xe,{"aria-invalid":Ie.error,"aria-describedby":o,autoComplete:i,autoFocus:s,defaultValue:f,disabled:Ie.disabled,id:x,onAnimationStart:ot,name:F,placeholder:$,readOnly:K,required:Ie.required,rows:q,value:re,onKeyDown:_,onKeyUp:L,type:pe,...yt,...!hs(Xe)&&{as:Bt,ownerState:{...xe,...yt.ownerState}},ref:Z,className:Ue(Pe.input,yt.className,K&&"MuiInputBase-readOnly"),onBlur:Ne,onChange:nt,onFocus:ze})}),m,G?G({...Ie,startAdornment:z}):null]})]})});function ML(e){return Ge("MuiInput",e)}const Mo={...tr,...We("MuiInput",["root","underline","input"])},PL=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},ML,t);return{...t,...o}},RL=fe(Ic,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...wc(e,t),!n.disableUnderline&&t.underline]}})(ft(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Mo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Mo.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Mo.disabled}, .${Mo.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${Mo.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Bn()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}}))]}})),NL=fe(Ac,{name:"MuiInput",slot:"Input",overridesResolver:Dc})({}),Bp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiInput"}),{disableUnderline:o=!1,components:i={},componentsProps:s,fullWidth:a=!1,inputComponent:l="input",multiline:u=!1,slotProps:d,slots:f={},type:h="text",...p}=r,m=PL(r),y={root:{ownerState:{disableUnderline:o}}},x=d??s?An(d??s,y):y,C=f.root??i.Root??RL,v=f.input??i.Input??NL;return c.jsx(_p,{slots:{root:C,input:v},slotProps:x,fullWidth:a,inputComponent:l,multiline:u,ref:n,type:h,...p,classes:m})});Bp.muiName="Input";function FL(e){return Ge("MuiFilledInput",e)}const nr={...tr,...We("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},LL=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:i,hiddenLabel:s,multiline:a}=e,l={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",i==="small"&&`size${Fe(i)}`,s&&"hiddenLabel",a&&"multiline"],input:["input"]},u=Ke(l,FL,t);return{...t,...u}},_L=fe(Ic,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...wc(e,t),!n.disableUnderline&&t.underline]}})(ft(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${nr.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${nr.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${nr.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${nr.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${nr.disabled}, .${nr.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${nr.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Bn()).map(([s])=>({props:{disableUnderline:!1,color:s},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s]?.main}`}}})),{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:12}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:12}},{props:({ownerState:s})=>s.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:s,size:a})=>s.multiline&&a==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),BL=fe(Ac,{name:"MuiFilledInput",slot:"Input",overridesResolver:Dc})(ft(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),jp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:i={},componentsProps:s,fullWidth:a=!1,hiddenLabel:l,inputComponent:u="input",multiline:d=!1,slotProps:f,slots:h={},type:p="text",...m}=r,b={...r,disableUnderline:o,fullWidth:a,inputComponent:u,multiline:d,type:p},y=LL(r),x={root:{ownerState:b},input:{ownerState:b}},C=f??s?An(x,f??s):x,v=h.root??i.Root??_L,S=h.input??i.Input??BL;return c.jsx(_p,{slots:{root:v,input:S},slotProps:C,fullWidth:a,inputComponent:u,multiline:d,ref:n,type:p,...m,classes:y})});jp.muiName="Input";var Qg;const jL=fe("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:$n})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),$L=fe("legend",{name:"MuiNotchedOutlined",shouldForwardProp:$n})(ft(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function HL(e){const{children:t,classes:n,className:r,label:o,notched:i,...s}=e,a=o!=null&&o!=="",l={...e,notched:i,withLabel:a};return c.jsx(jL,{"aria-hidden":!0,className:r,ownerState:l,...s,children:c.jsx($L,{ownerState:l,children:a?c.jsx("span",{children:o}):Qg||(Qg=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}function zL(e){return Ge("MuiOutlinedInput",e)}const fr={...tr,...We("MuiOutlinedInput",["root","notchedOutline","input"])},UL=e=>{const{classes:t}=e,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},zL,t);return{...t,...r}},VL=fe(Ic,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:wc})(ft(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${fr.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${fr.focused} .${fr.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(Bn()).map(([n])=>({props:{color:n},style:{[`&.${fr.focused} .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${fr.error} .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${fr.disabled} .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),WL=fe(HL,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(ft(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),qL=fe(Ac,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Dc})(ft(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),$p=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiOutlinedInput"}),{components:o={},fullWidth:i=!1,inputComponent:s="input",label:a,multiline:l=!1,notched:u,slots:d={},slotProps:f={},type:h="text",...p}=r,m=UL(r),b=ar(),y=Ei({props:r,muiFormControl:b,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),x={...r,color:y.color||"primary",disabled:y.disabled,error:y.error,focused:y.focused,formControl:b,fullWidth:i,hiddenLabel:y.hiddenLabel,multiline:l,size:y.size,type:h},C=d.root??o.Root??VL,v=d.input??o.Input??qL,[S,I]=kt("notchedOutline",{elementType:WL,className:m.notchedOutline,shouldForwardComponentProp:!0,ownerState:x,externalForwardedProps:{slots:d,slotProps:f},additionalProps:{label:a!=null&&a!==""&&y.required?c.jsxs(M.Fragment,{children:[a," ","*"]}):a}});return c.jsx(_p,{slots:{root:C,input:v},slotProps:f,renderSuffix:T=>c.jsx(S,{...I,notched:typeof u<"u"?u:!!(T.startAdornment||T.filled||T.focused)}),fullWidth:i,inputComponent:s,multiline:l,ref:n,type:h,...p,classes:{...m,notchedOutline:null}})});$p.muiName="Input";function YL(e){return Ge("MuiFormLabel",e)}const Ua=We("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),KL=e=>{const{classes:t,color:n,focused:r,disabled:o,error:i,filled:s,required:a}=e,l={root:["root",`color${Fe(n)}`,o&&"disabled",i&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",i&&"error"]};return Ke(l,YL,t)},GL=fe("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{[`&.${Ua.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${Ua.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Ua.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),QL=fe("span",{name:"MuiFormLabel",slot:"Asterisk"})(ft(({theme:e})=>({[`&.${Ua.error}`]:{color:(e.vars||e).palette.error.main}}))),XL=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormLabel"}),{children:o,className:i,color:s,component:a="label",disabled:l,error:u,filled:d,focused:f,required:h,...p}=r,m=ar(),b=Ei({props:r,muiFormControl:m,states:["color","required","focused","disabled","error","filled"]}),y={...r,color:b.color||"primary",component:a,disabled:b.disabled,error:b.error,filled:b.filled,focused:b.focused,required:b.required},x=KL(y);return c.jsxs(GL,{as:a,ownerState:y,className:Ue(x.root,i),ref:n,...p,children:[o,b.required&&c.jsxs(QL,{ownerState:y,"aria-hidden":!0,className:x.asterisk,children:[" ","*"]})]})});function ZL(e){return Ge("MuiInputLabel",e)}We("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const JL=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:i,variant:s,required:a}=e,l={root:["root",n&&"formControl",!i&&"animated",o&&"shrink",r&&r!=="medium"&&`size${Fe(r)}`,s],asterisk:[a&&"asterisk"]},u=Ke(l,ZL,t);return{...t,...u}},e_=fe(XL,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Ua.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(ft(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),qu=M.forwardRef(function(t,n){const r=ut({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,margin:i,shrink:s,variant:a,className:l,...u}=r,d=ar();let f=s;typeof f>"u"&&d&&(f=d.filled||d.focused||d.adornedStart);const h=Ei({props:r,muiFormControl:d,states:["size","variant","required","focused"]}),p={...r,disableAnimation:o,formControl:d,shrink:f,size:h.size,variant:h.variant,required:h.required,focused:h.focused},m=JL(p);return c.jsx(e_,{"data-shrink":f,ref:n,className:Ue(m.root,l),...u,ownerState:p,classes:m})});function t_(e){return Ge("MuiFormHelperText",e)}const Xg=We("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Zg;const n_=e=>{const{classes:t,contained:n,size:r,disabled:o,error:i,filled:s,focused:a,required:l}=e,u={root:["root",o&&"disabled",i&&"error",r&&`size${Fe(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Ke(u,t_,t)},r_=fe("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Fe(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Xg.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Xg.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),D2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormHelperText"}),{children:o,className:i,component:s="p",disabled:a,error:l,filled:u,focused:d,margin:f,required:h,variant:p,...m}=r,b=ar(),y=Ei({props:r,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),x={...r,component:s,contained:y.variant==="filled"||y.variant==="outlined",variant:y.variant,size:y.size,disabled:y.disabled,error:y.error,filled:y.filled,focused:y.focused,required:y.required};delete x.ownerState;const C=n_(x);return c.jsx(r_,{as:s,className:Ue(C.root,i),ref:n,...m,ownerState:x,children:o===" "?Zg||(Zg=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):o})});function Et(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...i}=e,s=o?{}:br(n,r),{props:a,internalRef:l}=u2({...i,externalSlotProps:s}),u=vt(l,s?.ref,e.additionalProps?.ref);return l2(t,{...a,ref:u},r)}function o_(e){return Ge("MuiList",e)}We("MuiList",["root","padding","dense","subheader"]);const i_=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Ke({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},o_,t)},s_=fe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),I2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:u,...d}=r,f=M.useMemo(()=>({dense:a}),[a]),h={...r,component:s,dense:a,disablePadding:l},p=i_(h);return c.jsx(ho.Provider,{value:f,children:c.jsxs(s_,{as:s,className:Ue(p.root,i),ref:n,ownerState:h,...d,children:[u,o]})})});function $d(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function Jg(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function A2(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function fa(e,t,n,r,o,i){let s=!1,a=o(e,t,t?n:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!A2(a,i)||l)a=o(e,a,n);else return a.focus(),!0}return!1}const a_=M.forwardRef(function(t,n){const{actions:r,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:u=!1,onKeyDown:d,variant:f="selectedMenu",...h}=t,p=M.useRef(null),m=M.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});yn(()=>{o&&p.current.focus()},[o]),M.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(v,{direction:S})=>{const I=!p.current.style.width;if(v.clientHeight<p.current.clientHeight&&I){const T=`${c2(bo(v))}px`;p.current.style[S==="rtl"?"paddingLeft":"paddingRight"]=T,p.current.style.width=`calc(100% + ${T})`}return p.current}}),[]);const b=v=>{const S=p.current,I=v.key;if(v.ctrlKey||v.metaKey||v.altKey){d&&d(v);return}const N=mn(S).activeElement;if(I==="ArrowDown")v.preventDefault(),fa(S,N,u,l,$d);else if(I==="ArrowUp")v.preventDefault(),fa(S,N,u,l,Jg);else if(I==="Home")v.preventDefault(),fa(S,null,u,l,$d);else if(I==="End")v.preventDefault(),fa(S,null,u,l,Jg);else if(I.length===1){const O=m.current,F=I.toLowerCase(),B=performance.now();O.keys.length>0&&(B-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&F!==O.keys[0]&&(O.repeating=!1)),O.lastTime=B,O.keys.push(F);const j=N&&!O.repeating&&A2(N,O);O.previousKeyMatched&&(j||fa(S,N,!1,l,$d,O))?v.preventDefault():O.previousKeyMatched=!1}d&&d(v)},y=vt(p,n);let x=-1;M.Children.forEach(s,(v,S)=>{if(!M.isValidElement(v)){x===S&&(x+=1,x>=s.length&&(x=-1));return}v.props.disabled||(f==="selectedMenu"&&v.props.selected||x===-1)&&(x=S),x===S&&(v.props.disabled||v.props.muiSkipListHighlight||v.type.muiSkipListHighlight)&&(x+=1,x>=s.length&&(x=-1))});const C=M.Children.map(s,(v,S)=>{if(S===x){const I={};return i&&(I.autoFocus=!0),v.props.tabIndex===void 0&&f==="selectedMenu"&&(I.tabIndex=0),M.cloneElement(v,I)}return v});return c.jsx(I2,{role:"menu",ref:y,className:a,onKeyDown:b,tabIndex:o?0:-1,...h,children:C})});function Mf(e){return`scale(${e}, ${e**2})`}const l_={entering:{opacity:1,transform:Mf(1)},entered:{opacity:1,transform:"none"}},Hd=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),el=M.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:u,onEntering:d,onExit:f,onExited:h,onExiting:p,style:m,timeout:b="auto",TransitionComponent:y=Dr,...x}=t,C=Sc(),v=M.useRef(),S=Lo(),I=M.useRef(null),T=vt(I,Ms(i),n),N=L=>$=>{if(L){const K=I.current;$===void 0?L(K):L(K,$)}},O=N(d),F=N((L,$)=>{p2(L);const{duration:K,delay:G,easing:q}=ms({style:m,timeout:b,easing:s},{mode:"enter"});let R;b==="auto"?(R=S.transitions.getAutoHeightDuration(L.clientHeight),v.current=R):R=K,L.style.transition=[S.transitions.create("opacity",{duration:R,delay:G}),S.transitions.create("transform",{duration:Hd?R:R*.666,delay:G,easing:q})].join(","),l&&l(L,$)}),B=N(u),j=N(p),D=N(L=>{const{duration:$,delay:K,easing:G}=ms({style:m,timeout:b,easing:s},{mode:"exit"});let q;b==="auto"?(q=S.transitions.getAutoHeightDuration(L.clientHeight),v.current=q):q=$,L.style.transition=[S.transitions.create("opacity",{duration:q,delay:K}),S.transitions.create("transform",{duration:Hd?q:q*.666,delay:Hd?K:K||q*.333,easing:G})].join(","),L.style.opacity=0,L.style.transform=Mf(.75),f&&f(L)}),H=N(h),_=L=>{b==="auto"&&C.start(v.current||0,L),r&&r(I.current,L)};return c.jsx(y,{appear:o,in:a,nodeRef:I,onEnter:F,onEntered:B,onEntering:O,onExit:D,onExited:H,onExiting:j,addEndListener:_,timeout:b==="auto"?null:b,...x,children:(L,{ownerState:$,...K})=>M.cloneElement(i,{style:{opacity:0,transform:Mf(.75),visibility:L==="exited"&&!a?"hidden":void 0,...l_[L],...m,...i.props.style},ref:T,...K})})});el&&(el.muiSupportAuto=!0);function u_(e){return Ge("MuiPopover",e)}We("MuiPopover",["root","paper"]);function e1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function t1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function n1(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Jl(e){return typeof e=="function"?e():e}const c_=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"]},u_,t)},d_=fe(m2,{name:"MuiPopover",slot:"Root"})({}),O2=fe(Ci,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),f_=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiPopover"}),{action:o,anchorEl:i,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:a,anchorReference:l="anchorEl",children:u,className:d,container:f,elevation:h=8,marginThreshold:p=16,open:m,PaperProps:b={},slots:y={},slotProps:x={},transformOrigin:C={vertical:"top",horizontal:"left"},TransitionComponent:v,transitionDuration:S="auto",TransitionProps:I={},disableScrollLock:T=!1,...N}=r,O=M.useRef(),F={...r,anchorOrigin:s,anchorReference:l,elevation:h,marginThreshold:p,transformOrigin:C,TransitionComponent:v,transitionDuration:S,TransitionProps:I},B=c_(F),j=M.useCallback(()=>{if(l==="anchorPosition")return a;const ie=Jl(i),me=(ie&&ie.nodeType===1?ie:mn(O.current).body).getBoundingClientRect();return{top:me.top+e1(me,s.vertical),left:me.left+t1(me,s.horizontal)}},[i,s.horizontal,s.vertical,a,l]),D=M.useCallback(ie=>({vertical:e1(ie,C.vertical),horizontal:t1(ie,C.horizontal)}),[C.horizontal,C.vertical]),H=M.useCallback(ie=>{const Z={width:ie.offsetWidth,height:ie.offsetHeight},me=D(Z);if(l==="none")return{top:null,left:null,transformOrigin:n1(me)};const le=j();let ue=le.top-me.vertical,Ie=le.left-me.horizontal;const Ce=ue+Z.height,we=Ie+Z.width,ye=bo(Jl(i)),ze=ye.innerHeight-p,Ne=ye.innerWidth-p;if(p!==null&&ue<p){const nt=ue-p;ue-=nt,me.vertical+=nt}else if(p!==null&&Ce>ze){const nt=Ce-ze;ue-=nt,me.vertical+=nt}if(p!==null&&Ie<p){const nt=Ie-p;Ie-=nt,me.horizontal+=nt}else if(we>Ne){const nt=we-Ne;Ie-=nt,me.horizontal+=nt}return{top:`${Math.round(ue)}px`,left:`${Math.round(Ie)}px`,transformOrigin:n1(me)}},[i,l,j,D,p]),[_,L]=M.useState(m),$=M.useCallback(()=>{const ie=O.current;if(!ie)return;const Z=H(ie);Z.top!==null&&ie.style.setProperty("top",Z.top),Z.left!==null&&(ie.style.left=Z.left),ie.style.transformOrigin=Z.transformOrigin,L(!0)},[H]);M.useEffect(()=>(T&&window.addEventListener("scroll",$),()=>window.removeEventListener("scroll",$)),[i,T,$]);const K=()=>{$()},G=()=>{L(!1)};M.useEffect(()=>{m&&$()}),M.useImperativeHandle(o,()=>m?{updatePosition:()=>{$()}}:null,[m,$]),M.useEffect(()=>{if(!m)return;const ie=Cb(()=>{$()}),Z=bo(Jl(i));return Z.addEventListener("resize",ie),()=>{ie.clear(),Z.removeEventListener("resize",ie)}},[i,m,$]);let q=S;const R={slots:{transition:v,...y},slotProps:{transition:I,paper:b,...x}},[oe,se]=kt("transition",{elementType:el,externalForwardedProps:R,ownerState:F,getSlotProps:ie=>({...ie,onEntering:(Z,me)=>{ie.onEntering?.(Z,me),K()},onExited:Z=>{ie.onExited?.(Z),G()}}),additionalProps:{appear:!0,in:m}});S==="auto"&&!oe.muiSupportAuto&&(q=void 0);const z=f||(i?mn(Jl(i)).body:void 0),[pe,{slots:J,slotProps:Q,...re}]=kt("root",{ref:n,elementType:d_,externalForwardedProps:{...R,...N},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:y.backdrop},slotProps:{backdrop:Eb(typeof x.backdrop=="function"?x.backdrop(F):x.backdrop,{invisible:!0})},container:z,open:m},ownerState:F,className:Ue(B.root,d)}),[ne,ae]=kt("paper",{ref:O,className:B.paper,elementType:O2,externalForwardedProps:R,shouldForwardComponentProp:!0,additionalProps:{elevation:h,style:_?void 0:{opacity:0}},ownerState:F});return c.jsx(pe,{...re,...!hs(pe)&&{slots:J,slotProps:Q,disableScrollLock:T},children:c.jsx(oe,{...se,timeout:q,children:c.jsx(ne,{...ae,children:u})})})});function p_(e){return Ge("MuiMenu",e)}We("MuiMenu",["root","paper","list"]);const h_={vertical:"top",horizontal:"right"},m_={vertical:"top",horizontal:"left"},g_=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"],list:["list"]},p_,t)},b_=fe(f_,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),y_=fe(O2,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),x_=fe(a_,{name:"MuiMenu",slot:"List"})({outline:0}),C_=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:i,className:s,disableAutoFocusItem:a=!1,MenuListProps:l={},onClose:u,open:d,PaperProps:f={},PopoverClasses:h,transitionDuration:p="auto",TransitionProps:{onEntering:m,...b}={},variant:y="selectedMenu",slots:x={},slotProps:C={},...v}=r,S=kr(),I={...r,autoFocus:o,disableAutoFocusItem:a,MenuListProps:l,onEntering:m,PaperProps:f,transitionDuration:p,TransitionProps:b,variant:y},T=g_(I),N=o&&!a&&d,O=M.useRef(null),F=(q,R)=>{O.current&&O.current.adjustStyleForScrollbar(q,{direction:S?"rtl":"ltr"}),m&&m(q,R)},B=q=>{q.key==="Tab"&&(q.preventDefault(),u&&u(q,"tabKeyDown"))};let j=-1;M.Children.map(i,(q,R)=>{M.isValidElement(q)&&(q.props.disabled||(y==="selectedMenu"&&q.props.selected||j===-1)&&(j=R))});const D={slots:x,slotProps:{list:l,transition:b,paper:f,...C}},H=Et({elementType:x.root,externalSlotProps:C.root,ownerState:I,className:[T.root,s]}),[_,L]=kt("paper",{className:T.paper,elementType:y_,externalForwardedProps:D,shouldForwardComponentProp:!0,ownerState:I}),[$,K]=kt("list",{className:Ue(T.list,l.className),elementType:x_,shouldForwardComponentProp:!0,externalForwardedProps:D,getSlotProps:q=>({...q,onKeyDown:R=>{B(R),q.onKeyDown?.(R)}}),ownerState:I}),G=typeof D.slotProps.transition=="function"?D.slotProps.transition(I):D.slotProps.transition;return c.jsx(b_,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?h_:m_,slots:{root:x.root,paper:_,backdrop:x.backdrop,...x.transition&&{transition:x.transition}},slotProps:{root:H,paper:L,backdrop:typeof C.backdrop=="function"?C.backdrop(I):C.backdrop,transition:{...G,onEntering:(...q)=>{F(...q),G?.onEntering?.(...q)}}},open:d,ref:n,transitionDuration:p,ownerState:I,...v,classes:h,children:c.jsx($,{actions:O,autoFocus:o&&(j===-1||a),autoFocusItem:N,variant:y,...K,children:i})})});function E_(e){return Ge("MuiNativeSelect",e)}const Hp=We("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),v_=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:s}=e,a={select:["select",n,r&&"disabled",o&&"multiple",s&&"error"],icon:["icon",`icon${Fe(n)}`,i&&"iconOpen",r&&"disabled"]};return Ke(a,E_,t)},M2=fe("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${Hp.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),T_=fe(M2,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:$n,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${Hp.multiple}`]:t.multiple}]}})({}),P2=fe("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${Hp.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),S_=fe(P2,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Fe(n.variant)}`],n.open&&t.iconOpen]}})({}),k_=M.forwardRef(function(t,n){const{className:r,disabled:o,error:i,IconComponent:s,inputRef:a,variant:l="standard",...u}=t,d={...t,disabled:o,variant:l,error:i},f=v_(d);return c.jsxs(M.Fragment,{children:[c.jsx(T_,{ownerState:d,className:Ue(f.select,r),disabled:o,ref:a||n,...u}),t.multiple?null:c.jsx(S_,{as:s,ownerState:d,className:f.icon})]})});function R2(e){return Ge("MuiSelect",e)}const pa=We("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var r1;const w_=fe(M2,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${pa.select}`]:t.select},{[`&.${pa.select}`]:t[n.variant]},{[`&.${pa.error}`]:t.error},{[`&.${pa.multiple}`]:t.multiple}]}})({[`&.${pa.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),D_=fe(P2,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Fe(n.variant)}`],n.open&&t.iconOpen]}})({}),I_=fe("input",{shouldForwardProp:e=>xb(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function o1(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function A_(e){return e==null||typeof e=="string"&&!e.trim()}const O_=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:s}=e,a={select:["select",n,r&&"disabled",o&&"multiple",s&&"error"],icon:["icon",`icon${Fe(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ke(a,R2,t)},M_=M.forwardRef(function(t,n){const{"aria-describedby":r,"aria-label":o,autoFocus:i,autoWidth:s,children:a,className:l,defaultOpen:u,defaultValue:d,disabled:f,displayEmpty:h,error:p=!1,IconComponent:m,inputRef:b,labelId:y,MenuProps:x={},multiple:C,name:v,onBlur:S,onChange:I,onClose:T,onFocus:N,onOpen:O,open:F,readOnly:B,renderValue:j,required:D,SelectDisplayProps:H={},tabIndex:_,type:L,value:$,variant:K="standard",...G}=t,[q,R]=or({controlled:$,default:d,name:"Select"}),[oe,se]=or({controlled:F,default:u,name:"Select"}),z=M.useRef(null),pe=M.useRef(null),[J,Q]=M.useState(null),{current:re}=M.useRef(F!=null),[ne,ae]=M.useState(),ie=vt(n,b),Z=M.useCallback(be=>{pe.current=be,be&&Q(be)},[]),me=J?.parentNode;M.useImperativeHandle(ie,()=>({focus:()=>{pe.current.focus()},node:z.current,value:q}),[q]),M.useEffect(()=>{u&&oe&&J&&!re&&(ae(s?null:me.clientWidth),pe.current.focus())},[J,s]),M.useEffect(()=>{i&&pe.current.focus()},[i]),M.useEffect(()=>{if(!y)return;const be=mn(pe.current).getElementById(y);if(be){const Ae=()=>{getSelection().isCollapsed&&pe.current.focus()};return be.addEventListener("click",Ae),()=>{be.removeEventListener("click",Ae)}}},[y]);const le=(be,Ae)=>{be?O&&O(Ae):T&&T(Ae),re||(ae(s?null:me.clientWidth),se(be))},ue=be=>{be.button===0&&(be.preventDefault(),pe.current.focus(),le(!0,be))},Ie=be=>{le(!1,be)},Ce=M.Children.toArray(a),we=be=>{const Ae=Ce.find(Oe=>Oe.props.value===be.target.value);Ae!==void 0&&(R(Ae.props.value),I&&I(be,Ae))},ye=be=>Ae=>{let Oe;if(Ae.currentTarget.hasAttribute("tabindex")){if(C){Oe=Array.isArray(q)?q.slice():[];const Qe=q.indexOf(be.props.value);Qe===-1?Oe.push(be.props.value):Oe.splice(Qe,1)}else Oe=be.props.value;if(be.props.onClick&&be.props.onClick(Ae),q!==Oe&&(R(Oe),I)){const Qe=Ae.nativeEvent||Ae,st=new Qe.constructor(Qe.type,Qe);Object.defineProperty(st,"target",{writable:!0,value:{value:Oe,name:v}}),I(st,be)}C||le(!1,Ae)}},ze=be=>{B||[" ","ArrowUp","ArrowDown","Enter"].includes(be.key)&&(be.preventDefault(),le(!0,be))},Ne=J!==null&&oe,nt=be=>{!Ne&&S&&(Object.defineProperty(be,"target",{writable:!0,value:{value:q,name:v}}),S(be))};delete G["aria-invalid"];let _e,Bt;const yt=[];let ot=!1;(Vu({value:q})||h)&&(j?_e=j(q):ot=!0);const xe=Ce.map(be=>{if(!M.isValidElement(be))return null;let Ae;if(C){if(!Array.isArray(q))throw new Error(mo(2));Ae=q.some(Oe=>o1(Oe,be.props.value)),Ae&&ot&&yt.push(be.props.children)}else Ae=o1(q,be.props.value),Ae&&ot&&(Bt=be.props.children);return M.cloneElement(be,{"aria-selected":Ae?"true":"false",onClick:ye(be),onKeyUp:Oe=>{Oe.key===" "&&Oe.preventDefault(),be.props.onKeyUp&&be.props.onKeyUp(Oe)},role:"option",selected:Ae,value:void 0,"data-value":be.props.value})});ot&&(C?yt.length===0?_e=null:_e=yt.reduce((be,Ae,Oe)=>(be.push(Ae),Oe<yt.length-1&&be.push(", "),be),[]):_e=Bt);let Pe=ne;!s&&re&&J&&(Pe=me.clientWidth);let qe;typeof _<"u"?qe=_:qe=f?null:0;const Je=H.id||(v?`mui-component-select-${v}`:void 0),Xe={...t,variant:K,value:q,open:Ne,error:p},Re=O_(Xe),ct={...x.PaperProps,...typeof x.slotProps?.paper=="function"?x.slotProps.paper(Xe):x.slotProps?.paper},lt={...x.MenuListProps,...typeof x.slotProps?.list=="function"?x.slotProps.list(Xe):x.slotProps?.list},Mt=_r();return c.jsxs(M.Fragment,{children:[c.jsx(w_,{as:"div",ref:Z,tabIndex:qe,role:"combobox","aria-controls":Ne?Mt:void 0,"aria-disabled":f?"true":void 0,"aria-expanded":Ne?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[y,Je].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":D?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:ze,onMouseDown:f||B?null:ue,onBlur:nt,onFocus:N,...H,ownerState:Xe,className:Ue(H.className,Re.select,l),id:Je,children:A_(_e)?r1||(r1=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):_e}),c.jsx(I_,{"aria-invalid":p,value:Array.isArray(q)?q.join(","):q,name:v,ref:z,"aria-hidden":!0,onChange:we,tabIndex:-1,disabled:f,className:Re.nativeInput,autoFocus:i,required:D,...G,ownerState:Xe}),c.jsx(D_,{as:m,className:Re.icon,ownerState:Xe}),c.jsx(C_,{id:`menu-${v||""}`,anchorEl:me,open:Ne,onClose:Ie,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...x,slotProps:{...x.slotProps,list:{"aria-labelledby":y,role:"listbox","aria-multiselectable":C?"true":void 0,disableListWrap:!0,id:Mt,...lt},paper:{...ct,style:{minWidth:Pe,...ct!=null?ct.style:null}}},children:xe})]})}),N2=mt(c.jsx("path",{d:"M7 10l5 5 5-5z"})),P_=e=>{const{classes:t}=e,r=Ke({root:["root"]},R2,t);return{...t,...r}},zp={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>$n(e)&&e!=="variant"},R_=fe(Bp,zp)(""),N_=fe($p,zp)(""),F_=fe(jp,zp)(""),Yu=M.forwardRef(function(t,n){const r=ut({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:i,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:u=!1,IconComponent:d=N2,id:f,input:h,inputProps:p,label:m,labelId:b,MenuProps:y,multiple:x=!1,native:C=!1,onClose:v,onOpen:S,open:I,renderValue:T,SelectDisplayProps:N,variant:O="outlined",...F}=r,B=C?k_:M_,j=ar(),D=Ei({props:r,muiFormControl:j,states:["variant","error"]}),H=D.variant||O,_={...r,variant:H,classes:s},L=P_(_),{root:$,...K}=L,G=h||{standard:c.jsx(R_,{ownerState:_}),outlined:c.jsx(N_,{label:m,ownerState:_}),filled:c.jsx(F_,{ownerState:_})}[H],q=vt(n,Ms(G));return c.jsx(M.Fragment,{children:M.cloneElement(G,{inputComponent:B,inputProps:{children:i,error:D.error,IconComponent:d,variant:H,type:void 0,multiple:x,...C?{id:f}:{autoWidth:o,defaultOpen:l,displayEmpty:u,labelId:b,MenuProps:y,onClose:v,onOpen:S,open:I,renderValue:T,SelectDisplayProps:{id:f,...N}},...p,classes:p?An(K,p.classes):K,...h?h.props.inputProps:{}},...(x&&C||u)&&H==="outlined"?{notched:!0}:{},ref:q,className:Ue(G.props.className,a,L.root),...!h&&{variant:H},...F})})});Yu.muiName="Select";function L_(e){return Ge("MuiTextField",e)}We("MuiTextField",["root"]);const __={standard:Bp,filled:jp,outlined:$p},B_=e=>{const{classes:t}=e;return Ke({root:["root"]},L_,t)},j_=fe(Wu,{name:"MuiTextField",slot:"Root"})({}),Ct=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:s,className:a,color:l="primary",defaultValue:u,disabled:d=!1,error:f=!1,FormHelperTextProps:h,fullWidth:p=!1,helperText:m,id:b,InputLabelProps:y,inputProps:x,InputProps:C,inputRef:v,label:S,maxRows:I,minRows:T,multiline:N=!1,name:O,onBlur:F,onChange:B,onFocus:j,placeholder:D,required:H=!1,rows:_,select:L=!1,SelectProps:$,slots:K={},slotProps:G={},type:q,value:R,variant:oe="outlined",...se}=r,z={...r,autoFocus:i,color:l,disabled:d,error:f,fullWidth:p,multiline:N,required:H,select:L,variant:oe},pe=B_(z),J=_r(b),Q=m&&J?`${J}-helper-text`:void 0,re=S&&J?`${J}-label`:void 0,ne=__[oe],ae={slots:K,slotProps:{input:C,inputLabel:y,htmlInput:x,formHelperText:h,select:$,...G}},ie={},Z=ae.slotProps.inputLabel;oe==="outlined"&&(Z&&typeof Z.shrink<"u"&&(ie.notched=Z.shrink),ie.label=S),L&&((!$||!$.native)&&(ie.id=void 0),ie["aria-describedby"]=void 0);const[me,le]=kt("root",{elementType:j_,shouldForwardComponentProp:!0,externalForwardedProps:{...ae,...se},ownerState:z,className:Ue(pe.root,a),ref:n,additionalProps:{disabled:d,error:f,fullWidth:p,required:H,color:l,variant:oe}}),[ue,Ie]=kt("input",{elementType:ne,externalForwardedProps:ae,additionalProps:ie,ownerState:z}),[Ce,we]=kt("inputLabel",{elementType:qu,externalForwardedProps:ae,ownerState:z}),[ye,ze]=kt("htmlInput",{elementType:"input",externalForwardedProps:ae,ownerState:z}),[Ne,nt]=kt("formHelperText",{elementType:D2,externalForwardedProps:ae,ownerState:z}),[_e,Bt]=kt("select",{elementType:Yu,externalForwardedProps:ae,ownerState:z}),yt=c.jsx(ue,{"aria-describedby":Q,autoComplete:o,autoFocus:i,defaultValue:u,fullWidth:p,multiline:N,name:O,rows:_,maxRows:I,minRows:T,type:q,value:R,id:J,inputRef:v,onBlur:F,onChange:B,onFocus:j,placeholder:D,inputProps:ze,slots:{input:K.htmlInput?ye:void 0},...Ie});return c.jsxs(me,{...le,children:[S!=null&&S!==""&&c.jsx(Ce,{htmlFor:J,id:re,...we,children:S}),L?c.jsx(_e,{"aria-describedby":Q,id:J,labelId:re,value:R,input:yt,...Bt,children:s}):yt,m&&c.jsx(Ne,{id:Q,...nt,children:m})]})}),po={postgres:[{label:"Host",name:"host",type:"text",required:!1},{label:"Port",name:"port",type:"number",required:!1},{label:"Database Name",name:"databaseName",type:"text",required:!1},{label:"User Name",name:"userName",type:"text",required:!1},{label:"Password",name:"password",type:"password",required:!1},{label:"Connection String",name:"connectionString",type:"text",required:!1}],bigquery:[{label:"Project ID",name:"defaultProjectId",type:"text",required:!1},{label:"Billing Project ID",name:"billingProjectId",type:"text",required:!1},{label:"Location",name:"location",type:"text",required:!1},{label:"Service Account Key JSON",name:"serviceAccountKeyJson",type:"text",required:!0},{label:"Maximum Bytes Billed",name:"maximumBytesBilled",type:"text",required:!1},{label:"Query Timeout Milliseconds",name:"queryTimeoutMilliseconds",type:"text",required:!1}],snowflake:[{label:"Account",name:"account",type:"text",required:!0},{label:"Username",name:"username",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Role",name:"role",type:"text",required:!1},{label:"Warehouse",name:"warehouse",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"Response Timeout Milliseconds",name:"responseTimeoutMilliseconds",type:"text",required:!1},{label:"Private Key",name:"privateKey",type:"password",required:!1},{label:"Private Key Passphrase",name:"privateKeyPass",type:"password",required:!1}],trino:[{label:"Server",name:"server",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!1},{label:"Catalog",name:"catalog",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Peaka Key",name:"peakaKey",type:"password",required:!1}],databricks:[{label:"Host",name:"host",type:"text",required:!0},{label:"HTTP Path",name:"path",type:"text",required:!0},{label:"Access Token",name:"token",type:"password",required:!1},{label:"OAuth Client ID",name:"oauthClientId",type:"text",required:!1},{label:"OAuth Client Secret",name:"oauthClientSecret",type:"password",required:!1},{label:"Default Catalog",name:"defaultCatalog",type:"text",required:!1},{label:"Default Schema",name:"defaultSchema",type:"text",required:!1}],mysql:[{label:"Host",name:"host",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!0},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!0},{label:"Database",name:"database",type:"text",required:!0}],duckdb:[],motherduck:[{label:"Access Token",name:"accessToken",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1}],ducklake:[],publisher:[]},hu={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",databricks:"databricksConnection",mysql:"mysqlConnection",duckdb:"duckdbConnection",motherduck:"motherduckConnection",ducklake:"ducklakeConnection",publisher:"publisherConnection"},F2=Object.values(De.ConnectionTypeEnum).filter(e=>e!==De.ConnectionTypeEnum.Publisher),Pf={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",gcs:"gcsConnection",s3:"s3Connection",azure:"azureConnection"},tl=[{label:"Access Key ID",name:"accessKeyId",type:"text",required:!0},{label:"Secret Access Key",name:"secretAccessKey",type:"password",required:!0},{label:"Region",name:"region",type:"text",required:!1},{label:"Endpoint",name:"endpoint",type:"text",required:!1},{label:"Session Token",name:"sessionToken",type:"password",required:!1}],nl=[{label:"Key ID",name:"keyId",type:"text",required:!0},{label:"Secret",name:"secret",type:"password",required:!0}],$_=[{label:"Auth Type",name:"authType",type:"text",required:!0,selectOptions:[{label:"SAS Token",value:"sas_token"},{label:"Service Principal (SPN)",value:"service_principal"}]},{label:"SAS URL (e.g. https://account.blob.core.windows.net/container/file.parquet?sp=r&st=...)",name:"sasUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"sas_token"}},{label:"Tenant ID",name:"tenantId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client ID",name:"clientId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client Secret",name:"clientSecret",type:"password",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Account Name",name:"accountName",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"File URL (e.g. abfss://container/path/file.parquet)",name:"fileUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}}];function Ku(e){return e==="postgres"||e==="bigquery"||e==="snowflake"?po[e]||[]:e==="s3"?tl:e==="gcs"?nl:e==="azure"?$_:[]}function H_({onSubmit:e,isSubmitting:t}){const[n,r]=W.useState(!1),[o,i]=W.useState("postgres"),[s,a]=W.useState([]),[l,u]=W.useState("postgres"),[d,f]=W.useState("s3"),h=()=>{r(!0)},p=()=>{r(!1),a([]),i("postgres"),u("postgres"),f("s3")},m=async C=>{C.preventDefault();const v=new FormData(C.currentTarget),S=v.get("name")?.toString(),I=v.get("type")?.toString(),T=po[I];if(!S)throw new Error("Name is required");if(!I)throw new Error("Type is required");let N;if(I==="ducklake"){const O={};if(l==="postgres"){const j=po.postgres,D={};if(j.forEach(H=>{const _=v.get(`ducklake_pg_${H.name}`)?.toString();_&&(D[H.name]=_)}),Object.keys(D).length===0)throw new Error("DuckLake requires catalog connection");O.postgresConnection=D}const F=v.get("ducklake_bucketUrl")?.toString();if(!F)throw new Error("DuckLake requires a bucket URL");const B={bucketUrl:F};if(d==="s3"){const j={};if(tl.forEach(D=>{const H=v.get(`ducklake_s3_${D.name}`)?.toString();H&&(j[D.name]=H)}),!j.accessKeyId)throw new Error("S3 Access Key ID is required");if(!j.secretAccessKey)throw new Error("S3 Secret Access Key is required");Object.keys(j).length>0&&(B.s3Connection=j)}else if(d==="gcs"){const j={};if(nl.forEach(D=>{const H=v.get(`ducklake_gcs_${D.name}`)?.toString();H&&(j[D.name]=H)}),!j.keyId)throw new Error("GCS Key ID is required");if(!j.secret)throw new Error("GCS Secret is required");Object.keys(j).length>0&&(B.gcsConnection=j)}N={name:S,type:I,ducklakeConnection:{catalog:O,storage:B}}}else if(I==="duckdb"){if(s.length===0)throw new Error("DuckDB connection must have at least one attached database");const O=s.map((F,B)=>{const j=F.dbType,D=v.get(`attachedDb_${B}_name`)?.toString();if(!D)throw new Error(`Attached database at index ${B} must have a name`);const H={name:D,type:j},_=Ku(j);if(_&&_.length>0){const L={};_.forEach(K=>{const G=v.get(`attachedDb_${B}_${K.name}`)?.toString();G&&(L[K.name]=G)});const $=Pf[j];$&&(H[$]=L)}return H});N={name:S,type:I,duckdbConnection:{attachedDatabases:O}}}else{const O={};if(T.forEach(F=>{const B=v.get(F.name)?.toString();B&&(O[F.name]=B)}),I==="postgres"){if(!!!O.connectionString?.trim()){const B=["host","port","databaseName","userName","password"];for(const j of B)if(!O[j])throw new Error(`${T.find(D=>D.name===j)?.label||j} is required`)}}else if(I==="bigquery"){if(!O.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(I==="snowflake"){if(!O.account)throw new Error("Account is required");if(!O.username)throw new Error("Username is required");if(!O.warehouse)throw new Error("Warehouse is required");if(!O.password&&!O.privateKey)throw new Error("Either password or private key is required")}else if(I==="trino"){if(!O.server)throw new Error("Server is required");if(!O.user)throw new Error("User is required");if(O.server.trim().startsWith("https://")&&!O.password&&!O.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(I==="mysql"){const F=["host","port","database","user","password"];for(const B of F)if(!O[B])throw new Error(`${T.find(j=>j.name===B)?.label||B} is required`)}else if(I==="motherduck"){if(!O.accessToken)throw new Error("Access Token is required")}else if(I==="databricks"){if(!O.host)throw new Error("Host is required");if(!O.path)throw new Error("HTTP Path is required");const F=O.oauthClientId&&O.oauthClientSecret;if(!O.token&&!F)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}N={name:S,type:I,[hu[I]]:O}}await e(N),p()},b=()=>{a([...s,{name:"",dbType:"postgres"}])},y=C=>{a(s.filter((v,S)=>S!==C))},x=(C,v)=>{const S=[...s];S[C]={...S[C],dbType:v},a(S)};return c.jsxs(W.Fragment,{children:[c.jsx(tn,{variant:"outlined",onClick:h,children:"Add Connection"}),c.jsxs(no,{open:n,onClose:p,children:[c.jsx(Eo,{children:"Create New Connection"}),c.jsxs(oo,{children:[c.jsx(vl,{children:"Add a new connection to query your data database using Malloy."}),c.jsxs("form",{onSubmit:m,id:"connection-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard"}),c.jsx(Ct,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:o,select:!0,onChange:C=>i(C.target.value),children:F2.map(C=>c.jsx(bn,{value:C,children:C},C))}),o==="ducklake"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),c.jsx(Ct,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:l,select:!0,onChange:C=>u(C.target.value),children:c.jsx(bn,{value:"postgres",children:"PostgreSQL"})}),l==="postgres"&&c.jsx(c.Fragment,{children:po.postgres.map(C=>c.jsx(Ct,{margin:"dense",id:`ducklake_pg_${C.name}`,name:`ducklake_pg_${C.name}`,label:C.label,type:C.type,fullWidth:!0,variant:"standard"},`pg_${C.name}`))})]}),c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),c.jsxs(Ct,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:d,select:!0,onChange:C=>f(C.target.value),children:[c.jsx(bn,{value:"s3",children:"S3"}),c.jsx(bn,{value:"gcs",children:"GCS"})]}),c.jsx(Ct,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:d==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard"}),d==="s3"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),tl.map(C=>c.jsx(Ct,{margin:"dense",id:`ducklake_s3_${C.name}`,name:`ducklake_s3_${C.name}`,label:C.label,type:C.type,fullWidth:!0,variant:"standard",required:C.required,placeholder:C.name==="region"?"us-east-1":void 0},`s3_${C.name}`))]}),d==="gcs"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),nl.map(C=>c.jsx(Ct,{margin:"dense",id:`ducklake_gcs_${C.name}`,name:`ducklake_gcs_${C.name}`,label:C.label,type:C.type,fullWidth:!0,variant:"standard",required:C.required},`gcs_${C.name}`))]})]})]}):o==="duckdb"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsx(Dt,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),c.jsx(tn,{startIcon:c.jsx(fl,{}),onClick:b,size:"small",variant:"outlined",children:"Add Database"})]}),s.length===0&&c.jsx(Dt,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),s.map((C,v)=>{const S=Ku(C.dbType);return c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsxs(Dt,{variant:"subtitle2",children:["Database ",v+1]}),c.jsx(Ir,{onClick:()=>y(v),size:"small",color:"error",children:c.jsx(k2,{fontSize:"small"})})]}),c.jsx(Ct,{margin:"dense",required:!0,id:`attachedDb_${v}_name`,name:`attachedDb_${v}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:C.name}),c.jsx(Ct,{margin:"dense",id:`attachedDb_${v}_type`,name:`attachedDb_${v}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:C.dbType,select:!0,onChange:I=>x(v,I.target.value),children:Object.values(De.AttachedDatabaseTypeEnum).map(I=>c.jsx(bn,{value:I,children:I},I))}),S.filter(I=>I.visibleWhen?(C[I.visibleWhen.field]||S.find(N=>N.name===I.visibleWhen?.field)?.selectOptions?.[0]?.value)===I.visibleWhen.value:!0).map(I=>c.jsx(Ct,{margin:"dense",id:`attachedDb_${v}_${I.name}`,name:`attachedDb_${v}_${I.name}`,label:I.label,type:I.selectOptions?void 0:I.type,fullWidth:!0,variant:"standard",required:I.required,select:!!I.selectOptions,defaultValue:I.selectOptions?.[0]?.value,onChange:I.selectOptions?T=>{const N=[...s];N[v]={...N[v],[I.name]:T.target.value},a(N)}:void 0,children:I.selectOptions?.map(T=>c.jsx(bn,{value:T.value,children:T.label},T.value))},I.name))]},v)})]}):po[o].map(C=>c.jsx(Ct,{margin:"dense",id:C.name,name:C.name,label:C.label,type:C.type,fullWidth:!0,variant:"standard",required:C.required},C.name))]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:t,onClick:p,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"connection-form",loading:t,children:"Create Connection"})]})]})]})}function z_({connection:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(""),l=()=>{i(!0)},u=()=>{i(!1),t()};return c.jsxs(W.Fragment,{children:[c.jsxs(bn,{"aria-label":`Delete connection ${e?.name??""}`.trim(),onClick:d=>{d.stopPropagation(),l()},sx:{color:"error.main"},children:[c.jsx(Rp,{sx:{color:"inherit"},children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(Np,{children:"Delete"})]}),c.jsxs(no,{onClose:u,"aria-labelledby":"customized-dialog-title",open:o,children:[c.jsx(Eo,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Connection"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:d=>({position:"absolute",right:8,top:8,color:d.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsx(oo,{dividers:!0,children:c.jsxs(Dt,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),c.jsx(ro,{children:c.jsx(tn,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(),color:"error",children:"Delete"})}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function i1(e){const t=e.duckdbConnection?.attachedDatabases;return!t||t.length===0?[]:t.map(n=>({name:n.name||"",dbType:n.type||"postgres"}))}function s1(e){const t=e.ducklakeConnection;return t&&t.storage?.gcsConnection?"gcs":"s3"}function U_({connection:e,onSubmit:t,isSubmitting:n,onCloseDialog:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(e.type),[l,u]=W.useState(()=>i1(e)),[d,f]=W.useState("postgres"),[h,p]=W.useState(()=>s1(e)),m=()=>{u(i1(e)),a(e.type),f("postgres"),p(s1(e)),i(!0)},b=()=>{i(!1),r?.()},y=async T=>{T.preventDefault();const N=new FormData(T.currentTarget),O=N.get("name")?.toString(),F=N.get("type")?.toString(),B=po[F];if(!O)throw new Error("Name is required");if(!F)throw new Error("Type is required");let j;if(F==="ducklake"){const D={};if(d==="postgres"){const L=po.postgres,$={};if(L.forEach(K=>{const G=N.get(`ducklake_pg_${K.name}`)?.toString();G&&($[K.name]=G)}),Object.keys($).length===0)throw new Error("DuckLake requires catalog connection");D.postgresConnection=$}const H=N.get("ducklake_bucketUrl")?.toString();if(!H)throw new Error("DuckLake requires a bucket URL");const _={bucketUrl:H};if(h==="s3"){const L={};tl.forEach(K=>{const G=N.get(`ducklake_s3_${K.name}`)?.toString();G&&(L[K.name]=G)});const $=e.ducklakeConnection?.storage?.s3Connection;if($&&(!L.accessKeyId&&$.accessKeyId&&(L.accessKeyId=$.accessKeyId),!L.secretAccessKey&&$.secretAccessKey&&(L.secretAccessKey=$.secretAccessKey)),!L.accessKeyId)throw new Error("S3 Access Key ID is required");if(!L.secretAccessKey)throw new Error("S3 Secret Access Key is required");Object.keys(L).length>0&&(_.s3Connection=L)}else if(h==="gcs"){const L={};nl.forEach(K=>{const G=N.get(`ducklake_gcs_${K.name}`)?.toString();G&&(L[K.name]=G)});const $=e.ducklakeConnection?.storage?.gcsConnection;if($&&(!L.keyId&&$.keyId&&(L.keyId=$.keyId),!L.secret&&$.secret&&(L.secret=$.secret)),!L.keyId)throw new Error("GCS Key ID is required");if(!L.secret)throw new Error("GCS Secret is required");Object.keys(L).length>0&&(_.gcsConnection=L)}j={name:O,type:F,ducklakeConnection:{catalog:D,storage:_}}}else if(F==="duckdb"){if(l.length===0)throw new Error("DuckDB connection must have at least one attached database");const D=l.map((H,_)=>{const L=H.dbType,$=N.get(`attachedDb_${_}_name`)?.toString();if(!$)throw new Error(`Attached database at index ${_} must have a name`);const K={name:$,type:L},G=Ku(L);if(G&&G.length>0){const q={};G.forEach(oe=>{const se=N.get(`attachedDb_${_}_${oe.name}`)?.toString();se&&(q[oe.name]=se)});const R=Pf[L];R&&(K[R]=q)}return K});j={name:O,type:F,duckdbConnection:{attachedDatabases:D}}}else{const D=e[hu[F]]||{},H={};if(B.forEach(_=>{const L=N.get(_.name)?.toString(),$=D[_.name],K=_.type==="password"||_.name==="password"||_.name==="secretAccessKey"||_.name==="secret"||_.name==="accessToken"||_.name==="privateKey";L?H[_.name]=L:K&&$?H[_.name]=$:L!==void 0?H[_.name]=L:$&&(H[_.name]=$)}),F==="postgres"){if(!!!H.connectionString?.trim()){const L=["host","port","databaseName","userName","password"];for(const $ of L)if(!H[$])throw new Error(`${B.find(K=>K.name===$)?.label||$} is required`)}}else if(F==="bigquery"){if(!H.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(F==="snowflake"){if(!H.account)throw new Error("Account is required");if(!H.username)throw new Error("Username is required");if(!H.warehouse)throw new Error("Warehouse is required");if(!H.password&&!H.privateKey)throw new Error("Either password or private key is required")}else if(F==="trino"){if(!H.server)throw new Error("Server is required");if(!H.user)throw new Error("User is required");if(H.server.trim().startsWith("https://")&&!H.password&&!H.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(F==="mysql"){const _=["host","port","database","user","password"];for(const L of _)if(!H[L])throw new Error(`${B.find($=>$.name===L)?.label||L} is required`)}else if(F==="motherduck"){if(!H.accessToken)throw new Error("Access Token is required")}else if(F==="databricks"){if(!H.host)throw new Error("Host is required");if(!H.path)throw new Error("HTTP Path is required");const _=H.oauthClientId&&H.oauthClientSecret;if(!H.token&&!_)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}j={name:O,type:F,[hu[F]]:H}}await t(j),b()},x=()=>{u([...l,{name:"",dbType:"postgres"}])},C=T=>{u(l.filter((N,O)=>O!==T))},v=(T,N)=>{const O=[...l];O[T]={...O[T],dbType:N},u(O)},S=(T,N)=>{const O=e.duckdbConnection?.attachedDatabases;if(!O||!O[T])return"";const F=O[T],B=Pf[F.type||""];return B&&F[B]?F[B][N]??"":""},I=T=>{const N=e.ducklakeConnection;if(!N)return"";if(T.startsWith("pg_")){const O=T.replace("pg_","");return N.catalog?.postgresConnection?.[O]??""}if(T==="bucketUrl")return N.storage?.bucketUrl??"";if(T.startsWith("s3_")){const O=T.replace("s3_","");return N.storage?.s3Connection?.[O]??""}if(T.startsWith("gcs_")){const O=T.replace("gcs_","");return N.storage?.gcsConnection?.[O]??""}return""};return c.jsxs(W.Fragment,{children:[c.jsxs(bn,{"aria-label":`Edit connection ${e?.name??""}`.trim(),onClick:T=>{T.preventDefault(),T.stopPropagation(),m()},children:[c.jsx(Rp,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(Np,{children:"Edit"})]}),c.jsxs(no,{open:o,onClose:b,children:[c.jsx(Eo,{onClick:T=>{T.stopPropagation()},children:"Edit Connection"}),c.jsxs(oo,{onClick:T=>{T.stopPropagation()},children:[c.jsx(vl,{children:"Edit a connection to query your data database using Malloy."}),c.jsxs("form",{onSubmit:y,id:"connection-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),c.jsx(Ct,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:s,select:!0,onChange:T=>a(T.target.value),children:F2.map(T=>c.jsx(bn,{value:T,children:T},T))}),s==="ducklake"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),c.jsx(Ct,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:d,select:!0,onChange:T=>f(T.target.value),children:c.jsx(bn,{value:"postgres",children:"PostgreSQL"})}),d==="postgres"&&c.jsx(c.Fragment,{children:po.postgres.map(T=>c.jsx(Ct,{margin:"dense",id:`ducklake_pg_${T.name}`,name:`ducklake_pg_${T.name}`,label:T.label,type:T.type,fullWidth:!0,variant:"standard",defaultValue:I(`pg_${T.name}`)},`pg_${T.name}`))})]}),c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),c.jsxs(Ct,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:h,select:!0,onChange:T=>p(T.target.value),children:[c.jsx(bn,{value:"s3",children:"S3"}),c.jsx(bn,{value:"gcs",children:"GCS"})]}),c.jsx(Ct,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:h==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard",defaultValue:I("bucketUrl")}),h==="s3"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),tl.map(T=>c.jsx(Ct,{margin:"dense",id:`ducklake_s3_${T.name}`,name:`ducklake_s3_${T.name}`,label:T.label,type:T.type,fullWidth:!0,variant:"standard",required:T.required&&T.name!=="secretAccessKey",defaultValue:I(`s3_${T.name}`),placeholder:T.name==="region"?"us-east-1":T.name==="secretAccessKey"?"Leave empty to keep existing":void 0},`s3_${T.name}`))]}),h==="gcs"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),nl.map(T=>c.jsx(Ct,{margin:"dense",id:`ducklake_gcs_${T.name}`,name:`ducklake_gcs_${T.name}`,label:T.label,type:T.type,fullWidth:!0,variant:"standard",required:T.required&&T.name!=="secret",defaultValue:I(`gcs_${T.name}`),placeholder:T.name==="secret"?"Leave empty to keep existing":void 0},`gcs_${T.name}`))]})]})]}):s==="duckdb"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsx(Dt,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),c.jsx(tn,{startIcon:c.jsx(fl,{}),onClick:x,size:"small",variant:"outlined",children:"Add Database"})]}),l.length===0&&c.jsx(Dt,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),l.map((T,N)=>{const O=Ku(T.dbType);return c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsxs(Dt,{variant:"subtitle2",children:["Database ",N+1]}),c.jsx(Ir,{"aria-label":`Remove attached database ${N+1}`,onClick:()=>C(N),size:"small",color:"error",children:c.jsx(k2,{fontSize:"small"})})]}),c.jsx(Ct,{margin:"dense",required:!0,id:`attachedDb_${N}_name`,name:`attachedDb_${N}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:T.name}),c.jsx(Ct,{margin:"dense",id:`attachedDb_${N}_type`,name:`attachedDb_${N}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:T.dbType,select:!0,onChange:F=>v(N,F.target.value),children:Object.values(De.AttachedDatabaseTypeEnum).map(F=>c.jsx(bn,{value:F,children:F},F))}),O.filter(F=>F.visibleWhen?(T[F.visibleWhen.field]||S(N,F.visibleWhen.field)||O.find(j=>j.name===F.visibleWhen?.field)?.selectOptions?.[0]?.value)===F.visibleWhen.value:!0).map(F=>c.jsx(Ct,{margin:"dense",id:`attachedDb_${N}_${F.name}`,name:`attachedDb_${N}_${F.name}`,label:F.label,type:F.selectOptions?void 0:F.type,fullWidth:!0,variant:"standard",required:F.required,select:!!F.selectOptions,defaultValue:S(N,F.name)||F.selectOptions?.[0]?.value,onChange:F.selectOptions?B=>{const j=[...l];j[N]={...j[N],[F.name]:B.target.value},u(j)}:void 0,children:F.selectOptions?.map(B=>c.jsx(bn,{value:B.value,children:B.label},B.value))},F.name))]},N)})]}):po[s].map(T=>{const N=e?.[hu[s]??""]?.[T.name??""]??"",O=T.type==="password"||T.name==="password"||T.name==="secretAccessKey"||T.name==="secret"||T.name==="accessToken"||T.name==="privateKey";return c.jsx(Ct,{margin:"dense",id:T.name,name:T.name,label:T.label,type:T.type,fullWidth:!0,variant:"standard",required:T.required&&!O&&!N,defaultValue:N,placeholder:O&&N?"Leave empty to keep existing":void 0},T.name)})]})]}),c.jsxs(ro,{onClick:T=>{T.stopPropagation()},children:[c.jsx(tn,{disabled:n,onClick:b,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"connection-form",loading:n,children:"Edit Connection"})]})]})]})}function a1(e,t){return!e||e.type!=="duckdb"?!1:(e.duckdbConnection?.attachedDatabases||[]).some(r=>r.type==="azure"&&r.name===t)}function V_(e){return e.startsWith("gs://")||e.startsWith("s3://")||e.startsWith("https://")||e.startsWith("abfss://")||e.startsWith("az://")}function L2({connectionName:e,resourceUri:t,schema:n,connection:r}){const{apiClients:o}=De.useServer(),{environmentName:i}=Ht(t),[s,a]=W.useState(null),[l,u]=W.useState(n||null),[d,f]=W.useState(!1),{data:h,isError:p,isLoading:m,error:b}=Xt({queryKey:["schemas",i,e],queryFn:()=>o.connections.listSchemas(i,e)}),y=h?.data||[];return c.jsxs(w.Grid,{container:!0,spacing:1,children:[!n&&c.jsx(w.Grid,{size:{xs:12,md:4},children:c.jsxs(w.Paper,{sx:{p:1,m:0},children:[c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[c.jsx(w.Typography,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),c.jsx(w.FormControlLabel,{control:c.jsx(w.Switch,{checked:d,onChange:x=>f(x.target.checked)}),label:"Hidden Schemas"})]}),c.jsx(w.Divider,{sx:{mt:"2px"}}),c.jsxs(w.Box,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[m&&c.jsx(Sn,{text:"Loading schemas..."}),p&&c.jsx(kn,{error:b,context:`${i} > ${e} > Schemas`}),!m&&!p&&y.length===0&&c.jsx(w.Typography,{variant:"body2",children:"No Schemas"}),!m&&!p&&y.length>0&&c.jsx(w.List,{dense:!0,disablePadding:!0,children:y.map(x=>{const C=x.name;if(x.isHidden&&!d)return null;const S=l===C;return c.jsx(w.ListItemButton,{selected:S,onClick:()=>{u(C),a(null)},children:c.jsx(w.ListItemText,{primary:C})},C)})})]})]})}),c.jsx(w.Grid,{size:{xs:12,md:n?6:4},children:l&&c.jsx(w.Paper,{sx:{p:1,m:0},children:c.jsx(Y_,{connectionName:e,schemaName:l,onTableSelect:x=>{a(x)},resourceUri:t,connection:r})})}),c.jsx(w.Grid,{size:{xs:12,md:n?6:4},children:l&&s&&c.jsx(W_,{environmentName:i,connectionName:e,schemaName:l,tableResource:s})})]})}function W_({environmentName:e,connectionName:t,schemaName:n,tableResource:r}){const{apiClients:o}=De.useServer(),{data:i,isLoading:s,isError:a,error:l}=Xt({queryKey:["connectionTableDetail",e,t,n,r],queryFn:()=>o.connections.getTable(e,t,n,r),enabled:!!n&&!!r}),u={resource:i?.data?.resource??r,columns:i?.data?.columns??[]};return c.jsxs(w.Paper,{sx:{p:1,m:0},children:[a&&c.jsx(kn,{error:l,context:`${e} > ${t} > ${n} > ${r}`}),!a&&c.jsx(q_,{table:u,loading:s})]})}function q_({table:e,loading:t}){return t?c.jsx(Sn,{text:"Loading columns..."}):c.jsxs(c.Fragment,{children:[c.jsxs(w.Typography,{variant:"overline",fontWeight:"bold",sx:{display:"block",wordBreak:"break-all"},children:[e.resource.includes("://")||/\.(parquet|csv|json|tsv|ndjson)$/i.test(e.resource)?"File":"Table",": ",e.resource]}),c.jsx(w.Divider,{}),c.jsx(w.Box,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:c.jsx(w.TableContainer,{children:c.jsxs(w.Table,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"NAME"}),c.jsx(w.TableCell,{children:"TYPE"})]})}),c.jsx(w.TableBody,{children:e.columns?.sort((n,r)=>n.name.localeCompare(r.name))?.map(n=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:n.name}),c.jsx(w.TableCell,{children:n.type})]},n.name))})]})})})]})}function Y_({connectionName:e,schemaName:t,onTableSelect:n,resourceUri:r,connection:o}){const{environmentName:i}=Ht(r),{apiClients:s}=De.useServer(),[a,l]=W.useState(""),{data:u,isSuccess:d,isError:f,error:h,isLoading:p}=Xt({queryKey:["tablesInSchema",i,e,t],queryFn:()=>s.connections.listTables(i,e,t)}),m=a1(o,t),b=x=>m?x:x.split(".").pop()||x,y=d&&u?.data?u.data.filter(x=>b(x.resource).toLowerCase().includes(a.toLowerCase())).sort((x,C)=>b(x.resource).localeCompare(b(C.resource))):[];return c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{variant:"overline",fontWeight:"bold",children:V_(t)||a1(o,t)?`Files in ${t}`:`Tables in ${t}`}),c.jsx(w.Divider,{}),c.jsx(w.Box,{sx:{mt:1,mb:1},children:c.jsx(w.TextField,{size:"small",fullWidth:!0,placeholder:"Search tables...",value:a,onChange:x=>l(x.target.value),variant:"outlined"})}),c.jsx(w.Divider,{}),c.jsxs(w.Box,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[p&&c.jsx(Sn,{text:"Fetching Tables..."}),f&&c.jsx(kn,{error:h,context:`${i} > ${e} > ${t}`}),d&&y.length===0&&c.jsx(w.Typography,{variant:"body2",children:"No Tables"}),d&&u?.data&&u.data.length>0&&c.jsx(w.List,{dense:!0,disablePadding:!0,children:y.map(x=>{let C=b(x.resource);return!m&&x.resource.includes("://")&&(C=x.resource.split("/").pop()||x.resource),c.jsx(w.ListItemButton,{onClick:()=>n(x.resource),children:c.jsx(w.ListItemText,{primary:C,secondary:x.columns.length>0?`${x.columns.length} columns`:void 0})},x.resource)})})]})]})}const K_={bigquery:"BigQuery",snowflake:"Snowflake",postgres:"PostgreSQL",mysql:"MySQL",trino:"Trino",databricks:"Databricks",duckdb:"DuckDB",ducklake:"DuckLake",s3:"S3",gcs:"GCS",azure:"Azure"};function G_(e){return e?K_[e]??e:""}function Q_({resourceUri:e}){const{apiClients:t,mutable:n}=De.useServer(),r=Lr.useQueryClient(),{environmentName:o}=Ht(e),[i,s]=W.useState(""),[a,l]=W.useState(null),u=Cl({environmentName:o,connectionName:a}),{data:d,isSuccess:f,isError:h,error:p}=Xt({queryKey:["connections",o],queryFn:()=>t.connections.listConnections(o)}),m=()=>{l(null)},b=vn({mutationFn:S=>t.environments.updateEnvironment(o,{name:o,connections:[...d.data,S]}),onSuccess(){s("Connection added successfully"),r.invalidateQueries({queryKey:["connections",o]})},onError(S){s(S.message)}}),y=vn({mutationFn:S=>t.environments.updateEnvironment(o,{name:o,connections:d.data.map(I=>I.name===S.name?S:I)}),onSuccess(S,I){s(`Connection ${I.name} updated successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(S){s(S.message)}}),x=vn({mutationFn:S=>t.environments.updateEnvironment(o,{name:o,connections:d.data.filter(I=>I.name!==S.name)}),onSuccess(S,I){s(`Connection ${I.name} deleted successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(S){s(S.message)}}),C=f?[...d.data].sort((S,I)=>(S.name??"").localeCompare(I.name??"")):[],v=b.isPending||y.isPending||x.isPending;return c.jsxs(w.Box,{children:[c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Connections"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Database connections available to packages in this environment"})]}),n&&f&&c.jsx(H_,{onSubmit:S=>b.mutateAsync(S),isSubmitting:b.isPending})]}),!f&&!h&&c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Fetching Connections..."}),h&&c.jsx(kn,{error:p,context:`${o} > Connections`}),f&&C.length===0&&c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"No connections yet."}),f&&C.length>0&&c.jsx(w.Grid,{container:!0,spacing:2,children:C.map(S=>c.jsx(w.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(X_,{connection:S,mutable:n,isMutating:v,onOpenExplorer:()=>l(S.name??null),onEdit:I=>y.mutateAsync(I),onDelete:I=>{S.resource?s("Cannot delete this connection"):x.mutateAsync(I)}})},S.name))}),c.jsx(w.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i}),c.jsxs(w.Dialog,{open:a!==null,onClose:m,maxWidth:"lg",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{children:["Connection Explorer: ",a,c.jsx(w.IconButton,{"aria-label":"close",onClick:m,sx:{position:"absolute",right:8,top:8},children:c.jsx(w.Box,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),c.jsx(w.DialogContent,{children:a&&c.jsx(L2,{resourceUri:u,connectionName:a,connection:d?.data?.find(S=>S.name===a)})})]})]})}function X_({connection:e,mutable:t,isMutating:n,onOpenExplorer:r,onEdit:o,onDelete:i}){const[s,a]=W.useState(null),l=!!s,u=f=>{f.stopPropagation(),a(f.currentTarget)},d=()=>{a(null)};return c.jsx(w.Card,{variant:"outlined",onClick:r,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:c.jsx(w.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(w.Box,{sx:{width:36,height:36,borderRadius:1.5,bgcolor:"warning.light",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"warning.main"},children:c.jsx(xL,{sx:{fontSize:20}})}),c.jsxs(w.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(w.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",noWrap:!0,children:G_(e.type)})]}),t&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small",onClick:u,"aria-label":`Connection actions for ${e.name??""}`.trim(),sx:{flexShrink:0,mt:-.5,mr:-.5},children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:s,open:l,onClose:d,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(U_,{connection:e,onSubmit:o,isSubmitting:n,onCloseDialog:d}),c.jsx(z_,{connection:e,onCloseDialog:d,isMutating:n,onDelete:()=>i(e)})]})]})]})})})}const Z_=mt([c.jsx("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),c.jsx("path",{d:"M9 12h6v2H9z"},"1")]);function J_({resourceUri:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=De.useServer(),i=Lr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},{environmentName:d,packageName:f}=Ht(e),h=vn({mutationFn:()=>o.packages.deletePackage(d,f),onSuccess(){u(),i.invalidateQueries({queryKey:["packages"]}),a("Package deleted successfully")},onError(p){a(p instanceof Error?p.message:"An unknown error occurred")}});return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:l,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Delete"})]}),c.jsxs(no,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[c.jsx(Eo,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Package"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:p=>({position:"absolute",right:8,top:8,color:p.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsx(oo,{dividers:!0,children:c.jsxs(Dt,{gutterBottom:!0,children:['Are you sure you want to delete "',f,'"? This action cannot be undone.']})}),c.jsxs(ro,{children:[c.jsx(tn,{variant:"outlined",onClick:u,style:{borderColor:De.MALLOY_BRAND.teal,color:De.MALLOY_BRAND.teal},children:"Cancel"}),c.jsx(tn,{variant:"contained",autoFocus:!0,onClick:()=>h.mutate(),color:"error",loading:h.isPending,children:"Delete"})]}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function e7({package:e,resourceUri:t,onCloseDialog:n}){const[r,o]=W.useState(!1),{apiClients:i}=De.useServer(),s=Lr.useQueryClient(),[a,l]=W.useState(""),u=()=>{o(!0)},d=()=>{o(!1),n()},{packageName:f,environmentName:h}=Ht(t),p=vn({async mutationFn(b){return i.packages.updatePackage(h,f,{name:f,description:b.description})},onSuccess(){d(),l("Package updated successfully"),s.invalidateQueries({queryKey:["packages",h]})},onError(b){l(b instanceof Error?b.message:"An unknown error occurred")}}),m=b=>{b.preventDefault();const x=new FormData(b.currentTarget).get("description")?.toString();p.mutate({description:x})};return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:u,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Edit"})]}),c.jsxs(no,{open:r,onClose:d,children:[c.jsx(Eo,{children:"Edit Package"}),c.jsxs(oo,{children:[c.jsxs(vl,{children:['Update the details for "',e.name,'".']}),c.jsxs("form",{onSubmit:m,id:"package-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Package Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),c.jsx(Ct,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,defaultValue:e.description,variant:"standard"})]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:p.isPending,onClick:d,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"package-form",loading:p.isPending,children:"Save Changes"})]})]}),c.jsx(w.Snackbar,{open:a!=="",autoHideDuration:6e3,onClose:()=>l(""),message:a})]})}function _2({onSelectPackage:e,resourceUri:t}){const{apiClients:n}=De.useServer(),{environmentName:r}=Ht(t),{data:o,isSuccess:i,isError:s,error:a}=Xt({queryKey:["packages",r],queryFn:()=>n.packages.listPackages(r)});if(s)return c.jsx(kn,{error:a,context:`${r} > Packages`});if(!i)return c.jsx(Sn,{text:"Fetching Packages..."});const l=[...o.data].sort((u,d)=>u.name.localeCompare(d.name));return c.jsx(w.Grid,{container:!0,spacing:2,children:l.map(u=>{const d=Cl({environmentName:r,packageName:u.name});return c.jsx(w.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(t7,{pkg:u,packageResourceUri:d,onSelectPackage:e})},u.name)})})}function t7({pkg:e,packageResourceUri:t,onSelectPackage:n}){const{mutable:r}=De.useServer(),[o,i]=W.useState(null),s=!!o,a=f=>{n(e.name,f)},l=f=>{f.stopPropagation(),i(f.currentTarget)},u=()=>{i(null)},d=e.description??"";return c.jsx(w.Card,{variant:"outlined",onClick:a,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:c.jsx(w.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(w.Box,{sx:f=>({width:36,height:36,borderRadius:1.5,bgcolor:f.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:c.jsx(Z_,{sx:{fontSize:20}})}),c.jsxs(w.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(w.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(w.Tooltip,{title:d,followCursor:!0,enterDelay:1e3,children:c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:d})})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small",onClick:l,"aria-label":`Package actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:o,open:s,onClose:u,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(e7,{package:e,resourceUri:t,onCloseDialog:u}),c.jsx(J_,{resourceUri:t,onCloseDialog:u})]})]})]})})})}function n7({onSelectPackage:e,resourceUri:t}){const{mutable:n}=De.useServer(),{environmentName:r}=Ht(t);return W.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"})},[]),c.jsxs(w.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:4,py:3},children:[c.jsxs(w.Box,{sx:{mb:5},children:[c.jsx(w.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:r}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Manage packages and database connections in this environment. Open a package to explore its models and notebooks."})]}),c.jsxs(w.Box,{sx:{mb:5},children:[c.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Packages"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Published packages available for use in this environment"})]}),n&&c.jsx(yL,{resourceUri:t})]}),c.jsx(_2,{onSelectPackage:e,resourceUri:t})]}),c.jsx(w.Box,{sx:{mb:5},children:c.jsx(Q_,{resourceUri:t})}),c.jsx(w.Box,{sx:{mb:5},children:c.jsx(T2,{resourceUri:t,onClickPackageFile:e})}),c.jsx(bL,{resourceUri:t})]})}const r7=e=>{const t=M.useRef({});return M.useEffect(()=>{t.current=e}),t.current};function l1({array1:e,array2:t,parser:n=r=>r}){return e&&t&&e.length===t.length&&e.every((r,o)=>n(r)===n(t[o]))}function u1(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function o7(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:s=!1}=e;return(a,{inputValue:l,getOptionLabel:u})=>{let d=s?l.trim():l;n&&(d=d.toLowerCase()),t&&(d=u1(d));const f=d?a.filter(h=>{let p=(i||u)(h);return n&&(p=p.toLowerCase()),t&&(p=u1(p)),o==="start"?p.startsWith(d):p.includes(d)}):a;return typeof r=="number"?f.slice(0,r):f}}const i7=o7(),c1=5,s7=e=>e.current!==null&&e.current.parentElement?.contains(document.activeElement),a7=[];function d1(e,t,n,r){if(t||e==null||r)return"";const o=n(e);return typeof o=="string"?o:""}function l7(e){const{unstable_isActiveElementInListbox:t=s7,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:s=!1,clearOnBlur:a=!e.freeSolo,clearOnEscape:l=!1,componentName:u="useAutocomplete",defaultValue:d=e.multiple?a7:null,disableClearable:f=!1,disableCloseOnSelect:h=!1,disabled:p,disabledItemsFocusable:m=!1,disableListWrap:b=!1,filterOptions:y=i7,filterSelectedOptions:x=!1,freeSolo:C=!1,getOptionDisabled:v,getOptionKey:S,getOptionLabel:I=ke=>ke.label??ke,groupBy:T,handleHomeEndKeys:N=!e.freeSolo,id:O,includeInputInList:F=!1,inputValue:B,isOptionEqualToValue:j=(ke,Te)=>ke===Te,multiple:D=!1,onChange:H,onClose:_,onHighlightChange:L,onInputChange:$,onOpen:K,open:G,openOnFocus:q=!1,options:R,readOnly:oe=!1,renderValue:se,selectOnFocus:z=!e.freeSolo,value:pe}=e,J=_r(O);let Q=I;Q=ke=>{const Te=I(ke);return typeof Te!="string"?String(Te):Te};const re=M.useRef(!1),ne=M.useRef(!0),ae=M.useRef(null),ie=M.useRef(null),[Z,me]=M.useState(null),[le,ue]=M.useState(-1),Ie=o?0:-1,Ce=M.useRef(Ie),we=M.useRef(d1(d??pe,D,Q)).current,[ye,ze]=or({controlled:pe,default:d,name:u}),[Ne,nt]=or({controlled:B,default:we,name:u,state:"inputValue"}),[_e,Bt]=M.useState(!1),yt=M.useCallback((ke,Te,Ye)=>{if(!(D?ye.length<Te.length:Te!==null)&&!a)return;const je=d1(Te,D,Q,se);Ne!==je&&(nt(je),$&&$(ke,je,Ye))},[Q,Ne,D,$,nt,a,ye,se]),[ot,xe]=or({controlled:G,default:!1,name:u,state:"open"}),[Pe,qe]=M.useState(!0),Je=!D&&ye!=null&&Ne===Q(ye),Xe=ot&&!oe,Re=Xe?y(R.filter(ke=>!(x&&(D?ye:[ye]).some(Te=>Te!==null&&j(ke,Te)))),{inputValue:Je&&Pe?"":Ne,getOptionLabel:Q}):[],ct=r7({filteredOptions:Re,value:ye,inputValue:Ne});M.useEffect(()=>{const ke=ye!==ct.value;_e&&!ke||C&&!ke||yt(null,ye,"reset")},[ye,yt,_e,ct.value,C]);const lt=ot&&Re.length>0&&!oe,Mt=Ve(ke=>{if(ke===-1)ae.current.focus();else{const Te=se?"data-item-index":"data-tag-index";Z.querySelector(`[${Te}="${ke}"]`).focus()}});M.useEffect(()=>{D&&le>ye.length-1&&(ue(-1),Mt(-1))},[ye,D,le,Mt]);function be(ke,Te){if(!ie.current||ke<0||ke>=Re.length)return-1;let Ye=ke;for(;;){const rt=ie.current.querySelector(`[data-option-index="${Ye}"]`),je=m?!1:!rt||rt.disabled||rt.getAttribute("aria-disabled")==="true";if(rt&&rt.hasAttribute("tabindex")&&!je)return Ye;if(Te==="next"?Ye=(Ye+1)%Re.length:Ye=(Ye-1+Re.length)%Re.length,Ye===ke)return-1}}const Ae=Ve(({event:ke,index:Te,reason:Ye})=>{if(Ce.current=Te,Te===-1?ae.current.removeAttribute("aria-activedescendant"):ae.current.setAttribute("aria-activedescendant",`${J}-option-${Te}`),L&&["mouse","keyboard","touch"].includes(Ye)&&L(ke,Te===-1?null:Re[Te],Ye),!ie.current)return;const rt=ie.current.querySelector(`[role="option"].${n}-focused`);rt&&(rt.classList.remove(`${n}-focused`),rt.classList.remove(`${n}-focusVisible`));let je=ie.current;if(ie.current.getAttribute("role")!=="listbox"&&(je=ie.current.parentElement.querySelector('[role="listbox"]')),!je)return;if(Te===-1){je.scrollTop=0;return}const zt=ie.current.querySelector(`[data-option-index="${Te}"]`);if(zt&&(zt.classList.add(`${n}-focused`),Ye==="keyboard"&&zt.classList.add(`${n}-focusVisible`),je.scrollHeight>je.clientHeight&&Ye!=="mouse"&&Ye!=="touch")){const Wt=zt,Qn=je.clientHeight+je.scrollTop,Di=Wt.offsetTop+Wt.offsetHeight;Di>Qn?je.scrollTop=Di-je.clientHeight:Wt.offsetTop-Wt.offsetHeight*(T?1.3:0)<je.scrollTop&&(je.scrollTop=Wt.offsetTop-Wt.offsetHeight*(T?1.3:0))}}),Oe=Ve(({event:ke,diff:Te,direction:Ye="next",reason:rt})=>{if(!Xe)return;const zt=be((()=>{const Wt=Re.length-1;if(Te==="reset")return Ie;if(Te==="start")return 0;if(Te==="end")return Wt;const Qn=Ce.current+Te;return Qn<0?Qn===-1&&F?-1:b&&Ce.current!==-1||Math.abs(Te)>1?0:Wt:Qn>Wt?Qn===Wt+1&&F?-1:b||Math.abs(Te)>1?Wt:0:Qn})(),Ye);if(Ae({index:zt,reason:rt,event:ke}),r&&Te!=="reset")if(zt===-1)ae.current.value=Ne;else{const Wt=Q(Re[zt]);ae.current.value=Wt,Wt.toLowerCase().indexOf(Ne.toLowerCase())===0&&Ne.length>0&&ae.current.setSelectionRange(Ne.length,Wt.length)}}),Qe=!l1({array1:ct.filteredOptions,array2:Re,parser:Q}),st=()=>{const ke=(Te,Ye)=>{const rt=Te?Q(Te):"",je=Ye?Q(Ye):"";return rt===je};if(Ce.current!==-1&&!l1({array1:ct.filteredOptions,array2:Re,parser:Q})&&ct.inputValue===Ne&&(D?ye.length===ct.value.length&&ct.value.every((Te,Ye)=>Q(ye[Ye])===Q(Te)):ke(ct.value,ye))){const Te=ct.filteredOptions[Ce.current];if(Te)return Re.findIndex(Ye=>Q(Ye)===Q(Te))}return-1},Nt=M.useCallback(()=>{if(!Xe)return;const ke=st();if(ke!==-1){Ce.current=ke;return}const Te=D?ye[0]:ye;if(Re.length===0||Te==null){Oe({diff:"reset"});return}if(ie.current){if(Te!=null){const Ye=Re[Ce.current];if(D&&Ye&&ye.findIndex(je=>j(Ye,je))!==-1)return;const rt=Re.findIndex(je=>j(je,Te));rt===-1?Oe({diff:"reset"}):Ae({index:rt});return}if(Ce.current>=Re.length-1){Ae({index:Re.length-1});return}Ae({index:Ce.current})}},[Re.length,D?!1:ye,x,Oe,Ae,Xe,Ne,D]),Gt=Ve(ke=>{Zd(ie,ke),ke&&Nt()});M.useEffect(()=>{Qe&&Nt()},[Nt,Qe]);const bt=ke=>{ot||(xe(!0),qe(!0),K&&K(ke))},sn=(ke,Te)=>{ot&&(xe(!1),_&&_(ke,Te))},Rn=(ke,Te,Ye,rt)=>{if(D){if(ye.length===Te.length&&ye.every((je,zt)=>je===Te[zt]))return}else if(ye===Te)return;H&&H(ke,Te,Ye,rt),ze(Te)},jt=M.useRef(!1),gn=(ke,Te,Ye="selectOption",rt="options")=>{let je=Ye,zt=Te;if(D){zt=Array.isArray(ye)?ye.slice():[];const Wt=zt.findIndex(Qn=>j(Te,Qn));Wt===-1?zt.push(Te):rt!=="freeSolo"&&(zt.splice(Wt,1),je="removeOption")}yt(ke,zt,je),Rn(ke,zt,je,{option:Te}),!h&&(!ke||!ke.ctrlKey&&!ke.metaKey)&&sn(ke,je),(s===!0||s==="touch"&&jt.current||s==="mouse"&&!jt.current)&&ae.current.blur()};function lr(ke,Te){if(ke===-1)return-1;let Ye=ke;for(;;){if(Te==="next"&&Ye===ye.length||Te==="previous"&&Ye===-1)return-1;const rt=se?"data-item-index":"data-tag-index",je=Z.querySelector(`[${rt}="${Ye}"]`);if(!je||!je.hasAttribute("tabindex")||je.disabled||je.getAttribute("aria-disabled")==="true")Ye+=Te==="next"?1:-1;else return Ye}}const Nn=(ke,Te)=>{if(!D)return;Ne===""&&sn(ke,"toggleInput");let Ye=le;le===-1?Ne===""&&Te==="previous"&&(Ye=ye.length-1):(Ye+=Te==="next"?1:-1,Ye<0&&(Ye=0),Ye===ye.length&&(Ye=-1)),Ye=lr(Ye,Te),ue(Ye),Mt(Ye)},jr=ke=>{re.current=!0,nt(""),$&&$(ke,"","clear"),Rn(ke,D?[]:null,"clear")},Hn=ke=>Te=>{if(ke.onKeyDown&&ke.onKeyDown(Te),!Te.defaultMuiPrevented&&(le!==-1&&!["ArrowLeft","ArrowRight"].includes(Te.key)&&(ue(-1),Mt(-1)),Te.which!==229))switch(Te.key){case"Home":Xe&&N&&(Te.preventDefault(),Oe({diff:"start",direction:"next",reason:"keyboard",event:Te}));break;case"End":Xe&&N&&(Te.preventDefault(),Oe({diff:"end",direction:"previous",reason:"keyboard",event:Te}));break;case"PageUp":Te.preventDefault(),Oe({diff:-c1,direction:"previous",reason:"keyboard",event:Te}),bt(Te);break;case"PageDown":Te.preventDefault(),Oe({diff:c1,direction:"next",reason:"keyboard",event:Te}),bt(Te);break;case"ArrowDown":Te.preventDefault(),Oe({diff:1,direction:"next",reason:"keyboard",event:Te}),bt(Te);break;case"ArrowUp":Te.preventDefault(),Oe({diff:-1,direction:"previous",reason:"keyboard",event:Te}),bt(Te);break;case"ArrowLeft":!D&&se?Mt(0):Nn(Te,"previous");break;case"ArrowRight":!D&&se?Mt(-1):Nn(Te,"next");break;case"Enter":if(Ce.current!==-1&&Xe){const Ye=Re[Ce.current],rt=v?v(Ye):!1;if(Te.preventDefault(),rt)return;gn(Te,Ye,"selectOption"),r&&ae.current.setSelectionRange(ae.current.value.length,ae.current.value.length)}else C&&Ne!==""&&Je===!1&&(D&&Te.preventDefault(),gn(Te,Ne,"createOption","freeSolo"));break;case"Escape":Xe?(Te.preventDefault(),Te.stopPropagation(),sn(Te,"escape")):l&&(Ne!==""||D&&ye.length>0||se)&&(Te.preventDefault(),Te.stopPropagation(),jr(Te));break;case"Backspace":if(D&&!oe&&Ne===""&&ye.length>0){const Ye=le===-1?ye.length-1:le,rt=ye.slice();rt.splice(Ye,1),Rn(Te,rt,"removeOption",{option:ye[Ye]})}!D&&se&&!oe&&(ze(null),Mt(-1));break;case"Delete":if(D&&!oe&&Ne===""&&ye.length>0&&le!==-1){const Ye=le,rt=ye.slice();rt.splice(Ye,1),Rn(Te,rt,"removeOption",{option:ye[Ye]})}!D&&se&&!oe&&(ze(null),Mt(-1));break}},Pt=ke=>{Bt(!0),q&&!re.current&&bt(ke)},xn=ke=>{if(t(ie)){ae.current.focus();return}Bt(!1),ne.current=!0,re.current=!1,i&&Ce.current!==-1&&Xe?gn(ke,Re[Ce.current],"blur"):i&&C&&Ne!==""?gn(ke,Ne,"blur","freeSolo"):a&&yt(ke,ye,"blur"),sn(ke,"blur")},To=ke=>{const Te=ke.target.value;Ne!==Te&&(nt(Te),qe(!1),$&&$(ke,Te,"input")),Te===""?!f&&!D&&Rn(ke,null,"clear"):bt(ke)},ki=ke=>{const Te=Number(ke.currentTarget.getAttribute("data-option-index"));Ce.current!==Te&&Ae({event:ke,index:Te,reason:"mouse"})},wn=ke=>{Ae({event:ke,index:Number(ke.currentTarget.getAttribute("data-option-index")),reason:"touch"}),jt.current=!0},$o=ke=>{const Te=Number(ke.currentTarget.getAttribute("data-option-index"));gn(ke,Re[Te],"selectOption"),jt.current=!1},wi=ke=>Te=>{const Ye=ye.slice();Ye.splice(ke,1),Rn(Te,Ye,"removeOption",{option:ye[ke]})},So=ke=>{Rn(ke,null,"removeOption",{option:ye})},nn=ke=>{ot?sn(ke,"toggleInput"):bt(ke)},rn=ke=>{ke.currentTarget.contains(ke.target)&&ke.target.getAttribute("id")!==J&&ke.preventDefault()},Ar=ke=>{ke.currentTarget.contains(ke.target)&&(ae.current.focus(),z&&ne.current&&ae.current.selectionEnd-ae.current.selectionStart===0&&ae.current.select(),ne.current=!1)},Ho=ke=>{!p&&(Ne===""||!ot)&&nn(ke)};let ko=C&&Ne.length>0;ko=ko||(D?ye.length>0:ye!==null);let zo=Re;return T&&(zo=Re.reduce((ke,Te,Ye)=>{const rt=T(Te);return ke.length>0&&ke[ke.length-1].group===rt?ke[ke.length-1].options.push(Te):ke.push({key:Ye,index:Ye,group:rt,options:[Te]}),ke},[])),p&&_e&&xn(),{getRootProps:(ke={})=>({...ke,onKeyDown:Hn(ke),onMouseDown:rn,onClick:Ar}),getInputLabelProps:()=>({id:`${J}-label`,htmlFor:J}),getInputProps:()=>({id:J,value:Ne,onBlur:xn,onFocus:Pt,onChange:To,onMouseDown:Ho,"aria-activedescendant":Xe?"":null,"aria-autocomplete":r?"both":"list","aria-controls":lt?`${J}-listbox`:void 0,"aria-expanded":lt,autoComplete:"off",ref:ae,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:p}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:jr}),getItemProps:({index:ke=0}={})=>({...D&&{key:ke},...se?{"data-item-index":ke}:{"data-tag-index":ke},tabIndex:-1,...!oe&&{onDelete:D?wi(ke):So}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:nn}),getTagProps:({index:ke})=>({key:ke,"data-tag-index":ke,tabIndex:-1,...!oe&&{onDelete:wi(ke)}}),getListboxProps:()=>({role:"listbox",id:`${J}-listbox`,"aria-labelledby":`${J}-label`,ref:Gt,onMouseDown:ke=>{ke.preventDefault()}}),getOptionProps:({index:ke,option:Te})=>{const Ye=(D?ye:[ye]).some(je=>je!=null&&j(Te,je)),rt=v?v(Te):!1;return{key:S?.(Te)??Q(Te),tabIndex:-1,role:"option",id:`${J}-option-${ke}`,onMouseMove:ki,onClick:$o,onTouchStart:wn,"data-option-index":ke,"aria-disabled":rt,"aria-selected":Ye}},id:J,inputValue:Ne,value:ye,dirty:ko,expanded:Xe&&Z,popupOpen:Xe,focused:_e||le!==-1,anchorEl:Z,setAnchorEl:me,focusedItem:le,focusedTag:le,groupedOptions:zo}}var qn="top",Cr="bottom",Er="right",Yn="left",Up="auto",Tl=[qn,Cr,Er,Yn],gs="start",rl="end",u7="clippingParents",B2="viewport",ha="popper",c7="reference",f1=Tl.reduce(function(e,t){return e.concat([t+"-"+gs,t+"-"+rl])},[]),j2=[].concat(Tl,[Up]).reduce(function(e,t){return e.concat([t,t+"-"+gs,t+"-"+rl])},[]),d7="beforeRead",f7="read",p7="afterRead",h7="beforeMain",m7="main",g7="afterMain",b7="beforeWrite",y7="write",x7="afterWrite",C7=[d7,f7,p7,h7,m7,g7,b7,y7,x7];function Xr(e){return e?(e.nodeName||"").toLowerCase():null}function sr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function mi(e){var t=sr(e).Element;return e instanceof t||e instanceof Element}function yr(e){var t=sr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Vp(e){if(typeof ShadowRoot>"u")return!1;var t=sr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function E7(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!yr(i)||!Xr(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function v7(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!yr(o)||!Xr(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const T7={name:"applyStyles",enabled:!0,phase:"write",fn:E7,effect:v7,requires:["computeStyles"]};function Qr(e){return e.split("-")[0]}var li=Math.max,Gu=Math.min,bs=Math.round;function Rf(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function $2(){return!/^((?!chrome|android).)*safari/i.test(Rf())}function ys(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&yr(e)&&(o=e.offsetWidth>0&&bs(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&bs(r.height)/e.offsetHeight||1);var s=mi(e)?sr(e):window,a=s.visualViewport,l=!$2()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/o,d=(r.top+(l&&a?a.offsetTop:0))/i,f=r.width/o,h=r.height/i;return{width:f,height:h,top:d,right:u+f,bottom:d+h,left:u,x:u,y:d}}function Wp(e){var t=ys(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function H2(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Vp(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function yo(e){return sr(e).getComputedStyle(e)}function S7(e){return["table","td","th"].indexOf(Xr(e))>=0}function jo(e){return((mi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Oc(e){return Xr(e)==="html"?e:e.assignedSlot||e.parentNode||(Vp(e)?e.host:null)||jo(e)}function p1(e){return!yr(e)||yo(e).position==="fixed"?null:e.offsetParent}function k7(e){var t=/firefox/i.test(Rf()),n=/Trident/i.test(Rf());if(n&&yr(e)){var r=yo(e);if(r.position==="fixed")return null}var o=Oc(e);for(Vp(o)&&(o=o.host);yr(o)&&["html","body"].indexOf(Xr(o))<0;){var i=yo(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Sl(e){for(var t=sr(e),n=p1(e);n&&S7(n)&&yo(n).position==="static";)n=p1(n);return n&&(Xr(n)==="html"||Xr(n)==="body"&&yo(n).position==="static")?t:n||k7(e)||t}function qp(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Va(e,t,n){return li(e,Gu(t,n))}function w7(e,t,n){var r=Va(e,t,n);return r>n?n:r}function z2(){return{top:0,right:0,bottom:0,left:0}}function U2(e){return Object.assign({},z2(),e)}function V2(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var D7=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,U2(typeof t!="number"?t:V2(t,Tl))};function I7(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Qr(n.placement),l=qp(a),u=[Yn,Er].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!s)){var f=D7(o.padding,n),h=Wp(i),p=l==="y"?qn:Yn,m=l==="y"?Cr:Er,b=n.rects.reference[d]+n.rects.reference[l]-s[l]-n.rects.popper[d],y=s[l]-n.rects.reference[l],x=Sl(i),C=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,v=b/2-y/2,S=f[p],I=C-h[d]-f[m],T=C/2-h[d]/2+v,N=Va(S,T,I),O=l;n.modifiersData[r]=(t={},t[O]=N,t.centerOffset=N-T,t)}}function A7(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||H2(t.elements.popper,o)&&(t.elements.arrow=o))}const O7={name:"arrow",enabled:!0,phase:"main",fn:I7,effect:A7,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xs(e){return e.split("-")[1]}var M7={top:"auto",right:"auto",bottom:"auto",left:"auto"};function P7(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:bs(n*o)/o||0,y:bs(r*o)/o||0}}function h1(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,h=s.x,p=h===void 0?0:h,m=s.y,b=m===void 0?0:m,y=typeof d=="function"?d({x:p,y:b}):{x:p,y:b};p=y.x,b=y.y;var x=s.hasOwnProperty("x"),C=s.hasOwnProperty("y"),v=Yn,S=qn,I=window;if(u){var T=Sl(n),N="clientHeight",O="clientWidth";if(T===sr(n)&&(T=jo(n),yo(T).position!=="static"&&a==="absolute"&&(N="scrollHeight",O="scrollWidth")),T=T,o===qn||(o===Yn||o===Er)&&i===rl){S=Cr;var F=f&&T===I&&I.visualViewport?I.visualViewport.height:T[N];b-=F-r.height,b*=l?1:-1}if(o===Yn||(o===qn||o===Cr)&&i===rl){v=Er;var B=f&&T===I&&I.visualViewport?I.visualViewport.width:T[O];p-=B-r.width,p*=l?1:-1}}var j=Object.assign({position:a},u&&M7),D=d===!0?P7({x:p,y:b},sr(n)):{x:p,y:b};if(p=D.x,b=D.y,l){var H;return Object.assign({},j,(H={},H[S]=C?"0":"",H[v]=x?"0":"",H.transform=(I.devicePixelRatio||1)<=1?"translate("+p+"px, "+b+"px)":"translate3d("+p+"px, "+b+"px, 0)",H))}return Object.assign({},j,(t={},t[S]=C?b+"px":"",t[v]=x?p+"px":"",t.transform="",t))}function R7(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:Qr(t.placement),variation:xs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,h1(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,h1(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const N7={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:R7,data:{}};var eu={passive:!0};function F7(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=sr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,eu)}),a&&l.addEventListener("resize",n.update,eu),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,eu)}),a&&l.removeEventListener("resize",n.update,eu)}}const L7={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:F7,data:{}};var _7={left:"right",right:"left",bottom:"top",top:"bottom"};function mu(e){return e.replace(/left|right|bottom|top/g,function(t){return _7[t]})}var B7={start:"end",end:"start"};function m1(e){return e.replace(/start|end/g,function(t){return B7[t]})}function Yp(e){var t=sr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Kp(e){return ys(jo(e)).left+Yp(e).scrollLeft}function j7(e,t){var n=sr(e),r=jo(e),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var u=$2();(u||!u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Kp(e),y:l}}function $7(e){var t,n=jo(e),r=Yp(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=li(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=li(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Kp(e),l=-r.scrollTop;return yo(o||n).direction==="rtl"&&(a+=li(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Gp(e){var t=yo(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function W2(e){return["html","body","#document"].indexOf(Xr(e))>=0?e.ownerDocument.body:yr(e)&&Gp(e)?e:W2(Oc(e))}function Wa(e,t){var n;t===void 0&&(t=[]);var r=W2(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=sr(r),s=o?[i].concat(i.visualViewport||[],Gp(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(Wa(Oc(s)))}function Nf(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function H7(e,t){var n=ys(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function g1(e,t,n){return t===B2?Nf(j7(e,n)):mi(t)?H7(t,n):Nf($7(jo(e)))}function z7(e){var t=Wa(Oc(e)),n=["absolute","fixed"].indexOf(yo(e).position)>=0,r=n&&yr(e)?Sl(e):e;return mi(r)?t.filter(function(o){return mi(o)&&H2(o,r)&&Xr(o)!=="body"}):[]}function U7(e,t,n,r){var o=t==="clippingParents"?z7(e):[].concat(t),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,u){var d=g1(e,u,r);return l.top=li(d.top,l.top),l.right=Gu(d.right,l.right),l.bottom=Gu(d.bottom,l.bottom),l.left=li(d.left,l.left),l},g1(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function q2(e){var t=e.reference,n=e.element,r=e.placement,o=r?Qr(r):null,i=r?xs(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(o){case qn:l={x:s,y:t.y-n.height};break;case Cr:l={x:s,y:t.y+t.height};break;case Er:l={x:t.x+t.width,y:a};break;case Yn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=o?qp(o):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case gs:l[u]=l[u]-(t[d]/2-n[d]/2);break;case rl:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function ol(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,s=i===void 0?e.strategy:i,a=n.boundary,l=a===void 0?u7:a,u=n.rootBoundary,d=u===void 0?B2:u,f=n.elementContext,h=f===void 0?ha:f,p=n.altBoundary,m=p===void 0?!1:p,b=n.padding,y=b===void 0?0:b,x=U2(typeof y!="number"?y:V2(y,Tl)),C=h===ha?c7:ha,v=e.rects.popper,S=e.elements[m?C:h],I=U7(mi(S)?S:S.contextElement||jo(e.elements.popper),l,d,s),T=ys(e.elements.reference),N=q2({reference:T,element:v,placement:o}),O=Nf(Object.assign({},v,N)),F=h===ha?O:T,B={top:I.top-F.top+x.top,bottom:F.bottom-I.bottom+x.bottom,left:I.left-F.left+x.left,right:F.right-I.right+x.right},j=e.modifiersData.offset;if(h===ha&&j){var D=j[o];Object.keys(B).forEach(function(H){var _=[Er,Cr].indexOf(H)>=0?1:-1,L=[qn,Cr].indexOf(H)>=0?"y":"x";B[H]+=D[L]*_})}return B}function V7(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?j2:l,d=xs(r),f=d?a?f1:f1.filter(function(m){return xs(m)===d}):Tl,h=f.filter(function(m){return u.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,b){return m[b]=ol(e,{placement:b,boundary:o,rootBoundary:i,padding:s})[Qr(b)],m},{});return Object.keys(p).sort(function(m,b){return p[m]-p[b]})}function W7(e){if(Qr(e)===Up)return[];var t=mu(e);return[m1(e),t,m1(t)]}function q7(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,b=n.allowedAutoPlacements,y=t.options.placement,x=Qr(y),C=x===y,v=l||(C||!m?[mu(y)]:W7(y)),S=[y].concat(v).reduce(function(pe,J){return pe.concat(Qr(J)===Up?V7(t,{placement:J,boundary:d,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:b}):J)},[]),I=t.rects.reference,T=t.rects.popper,N=new Map,O=!0,F=S[0],B=0;B<S.length;B++){var j=S[B],D=Qr(j),H=xs(j)===gs,_=[qn,Cr].indexOf(D)>=0,L=_?"width":"height",$=ol(t,{placement:j,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),K=_?H?Er:Yn:H?Cr:qn;I[L]>T[L]&&(K=mu(K));var G=mu(K),q=[];if(i&&q.push($[D]<=0),a&&q.push($[K]<=0,$[G]<=0),q.every(function(pe){return pe})){F=j,O=!1;break}N.set(j,q)}if(O)for(var R=m?3:1,oe=function(J){var Q=S.find(function(re){var ne=N.get(re);if(ne)return ne.slice(0,J).every(function(ae){return ae})});if(Q)return F=Q,"break"},se=R;se>0;se--){var z=oe(se);if(z==="break")break}t.placement!==F&&(t.modifiersData[r]._skip=!0,t.placement=F,t.reset=!0)}}const Y7={name:"flip",enabled:!0,phase:"main",fn:q7,requiresIfExists:["offset"],data:{_skip:!1}};function b1(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function y1(e){return[qn,Er,Cr,Yn].some(function(t){return e[t]>=0})}function K7(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=ol(t,{elementContext:"reference"}),a=ol(t,{altBoundary:!0}),l=b1(s,r),u=b1(a,o,i),d=y1(l),f=y1(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const G7={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:K7};function Q7(e,t,n){var r=Qr(e),o=[Yn,qn].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Yn,Er].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function X7(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,s=j2.reduce(function(d,f){return d[f]=Q7(f,t.rects,i),d},{}),a=s[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const Z7={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:X7};function J7(e){var t=e.state,n=e.name;t.modifiersData[n]=q2({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const e9={name:"popperOffsets",enabled:!0,phase:"read",fn:J7,data:{}};function t9(e){return e==="x"?"y":"x"}function n9(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,b=m===void 0?0:m,y=ol(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:d}),x=Qr(t.placement),C=xs(t.placement),v=!C,S=qp(x),I=t9(S),T=t.modifiersData.popperOffsets,N=t.rects.reference,O=t.rects.popper,F=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,B=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(T){if(i){var H,_=S==="y"?qn:Yn,L=S==="y"?Cr:Er,$=S==="y"?"height":"width",K=T[S],G=K+y[_],q=K-y[L],R=p?-O[$]/2:0,oe=C===gs?N[$]:O[$],se=C===gs?-O[$]:-N[$],z=t.elements.arrow,pe=p&&z?Wp(z):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:z2(),Q=J[_],re=J[L],ne=Va(0,N[$],pe[$]),ae=v?N[$]/2-R-ne-Q-B.mainAxis:oe-ne-Q-B.mainAxis,ie=v?-N[$]/2+R+ne+re+B.mainAxis:se+ne+re+B.mainAxis,Z=t.elements.arrow&&Sl(t.elements.arrow),me=Z?S==="y"?Z.clientTop||0:Z.clientLeft||0:0,le=(H=j?.[S])!=null?H:0,ue=K+ae-le-me,Ie=K+ie-le,Ce=Va(p?Gu(G,ue):G,K,p?li(q,Ie):q);T[S]=Ce,D[S]=Ce-K}if(a){var we,ye=S==="x"?qn:Yn,ze=S==="x"?Cr:Er,Ne=T[I],nt=I==="y"?"height":"width",_e=Ne+y[ye],Bt=Ne-y[ze],yt=[qn,Yn].indexOf(x)!==-1,ot=(we=j?.[I])!=null?we:0,xe=yt?_e:Ne-N[nt]-O[nt]-ot+B.altAxis,Pe=yt?Ne+N[nt]+O[nt]-ot-B.altAxis:Bt,qe=p&&yt?w7(xe,Ne,Pe):Va(p?xe:_e,Ne,p?Pe:Bt);T[I]=qe,D[I]=qe-Ne}t.modifiersData[r]=D}}const r9={name:"preventOverflow",enabled:!0,phase:"main",fn:n9,requiresIfExists:["offset"]};function o9(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function i9(e){return e===sr(e)||!yr(e)?Yp(e):o9(e)}function s9(e){var t=e.getBoundingClientRect(),n=bs(t.width)/e.offsetWidth||1,r=bs(t.height)/e.offsetHeight||1;return n!==1||r!==1}function a9(e,t,n){n===void 0&&(n=!1);var r=yr(t),o=yr(t)&&s9(t),i=jo(t),s=ys(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Xr(t)!=="body"||Gp(i))&&(a=i9(t)),yr(t)?(l=ys(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Kp(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function l9(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function u9(e){var t=l9(e);return C7.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function c9(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function d9(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var x1={placement:"bottom",modifiers:[],strategy:"absolute"};function C1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function f9(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,i=o===void 0?x1:o;return function(a,l,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},x1,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],h=!1,p={state:d,setOptions:function(x){var C=typeof x=="function"?x(d.options):x;b(),d.options=Object.assign({},i,d.options,C),d.scrollParents={reference:mi(a)?Wa(a):a.contextElement?Wa(a.contextElement):[],popper:Wa(l)};var v=u9(d9([].concat(r,d.options.modifiers)));return d.orderedModifiers=v.filter(function(S){return S.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var x=d.elements,C=x.reference,v=x.popper;if(C1(C,v)){d.rects={reference:a9(C,Sl(v),d.options.strategy==="fixed"),popper:Wp(v)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(B){return d.modifiersData[B.name]=Object.assign({},B.data)});for(var S=0;S<d.orderedModifiers.length;S++){if(d.reset===!0){d.reset=!1,S=-1;continue}var I=d.orderedModifiers[S],T=I.fn,N=I.options,O=N===void 0?{}:N,F=I.name;typeof T=="function"&&(d=T({state:d,options:O,name:F,instance:p})||d)}}}},update:c9(function(){return new Promise(function(y){p.forceUpdate(),y(d)})}),destroy:function(){b(),h=!0}};if(!C1(a,l))return p;p.setOptions(u).then(function(y){!h&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){d.orderedModifiers.forEach(function(y){var x=y.name,C=y.options,v=C===void 0?{}:C,S=y.effect;if(typeof S=="function"){var I=S({state:d,name:x,instance:p,options:v}),T=function(){};f.push(I||T)}})}function b(){f.forEach(function(y){return y()}),f=[]}return p}}var p9=[L7,e9,N7,T7,Z7,Y7,r9,O7,G7],h9=f9({defaultModifiers:p9});function m9(e){return Ge("MuiPopper",e)}We("MuiPopper",["root"]);function g9(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function Ff(e){return typeof e=="function"?e():e}function b9(e){return e.nodeType!==void 0}const y9=e=>{const{classes:t}=e;return Ke({root:["root"]},m9,t)},x9={},C9=M.forwardRef(function(t,n){const{anchorEl:r,children:o,direction:i,disablePortal:s,modifiers:a,open:l,placement:u,popperOptions:d,popperRef:f,slotProps:h={},slots:p={},TransitionProps:m,ownerState:b,...y}=t,x=M.useRef(null),C=vt(x,n),v=M.useRef(null),S=vt(v,f),I=M.useRef(S);yn(()=>{I.current=S},[S]),M.useImperativeHandle(f,()=>v.current,[]);const T=g9(u,i),[N,O]=M.useState(T),[F,B]=M.useState(Ff(r));M.useEffect(()=>{v.current&&v.current.forceUpdate()}),M.useEffect(()=>{r&&B(Ff(r))},[r]),yn(()=>{if(!F||!l)return;const L=G=>{O(G.placement)};let $=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:G})=>{L(G)}}];a!=null&&($=$.concat(a)),d&&d.modifiers!=null&&($=$.concat(d.modifiers));const K=h9(F,x.current,{placement:T,...d,modifiers:$});return I.current(K),()=>{K.destroy(),I.current(null)}},[F,s,a,l,d,T]);const j={placement:N};m!==null&&(j.TransitionProps=m);const D=y9(t),H=p.root??"div",_=Et({elementType:H,externalSlotProps:h.root,externalForwardedProps:y,additionalProps:{role:"tooltip",ref:C},ownerState:t,className:D.root});return c.jsx(H,{..._,children:typeof o=="function"?o(j):o})}),E9=M.forwardRef(function(t,n){const{anchorEl:r,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:u,open:d,placement:f="bottom",popperOptions:h=x9,popperRef:p,style:m,transition:b=!1,slotProps:y={},slots:x={},...C}=t,[v,S]=M.useState(!0),I=()=>{S(!1)},T=()=>{S(!0)};if(!l&&!d&&(!b||v))return null;let N;if(i)N=i;else if(r){const B=Ff(r);N=B&&b9(B)?mn(B).body:mn(null).body}const O=!d&&l&&(!b||v)?"none":void 0,F=b?{in:d,onEnter:I,onExited:T}:void 0;return c.jsx(f2,{disablePortal:a,container:N,children:c.jsx(C9,{anchorEl:r,direction:s,disablePortal:a,modifiers:u,ref:n,open:b?!v:d,placement:f,popperOptions:h,popperRef:p,slotProps:y,slots:x,...C,style:{position:"fixed",top:0,left:0,display:O,...m},TransitionProps:F,children:o})})}),v9=fe(E9,{name:"MuiPopper",slot:"Root"})({}),Qp=M.forwardRef(function(t,n){const r=kr(),o=ut({props:t,name:"MuiPopper"}),{anchorEl:i,component:s,components:a,componentsProps:l,container:u,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:m,popperOptions:b,popperRef:y,transition:x,slots:C,slotProps:v,...S}=o,I=C?.root??a?.Root,T={anchorEl:i,container:u,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:m,popperOptions:b,popperRef:y,transition:x,...S};return c.jsx(v9,{as:s,direction:r?"rtl":"ltr",slots:{root:I},slotProps:v??l,...T,ref:n})});function T9(e){return Ge("MuiListSubheader",e)}We("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const S9=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:i}=e,s={root:["root",n!=="default"&&`color${Fe(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Ke(s,T9,t)},k9=fe("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${Fe(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(ft(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),Lf=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListSubheader"}),{className:o,color:i="default",component:s="li",disableGutters:a=!1,disableSticky:l=!1,inset:u=!1,...d}=r,f={...r,color:i,component:s,disableGutters:a,disableSticky:l,inset:u},h=S9(f);return c.jsx(k9,{as:s,className:Ue(h.root,o),ref:n,ownerState:f,...d})});Lf&&(Lf.muiSkipListHighlight=!0);const w9=mt(c.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function D9(e){return Ge("MuiChip",e)}const Tt=We("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),I9=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:s,clickable:a,variant:l}=e,u={root:["root",l,n&&"disabled",`size${Fe(r)}`,`color${Fe(o)}`,a&&"clickable",a&&`clickableColor${Fe(o)}`,s&&"deletable",s&&`deletableColor${Fe(o)}`,`${l}${Fe(o)}`],label:["label",`label${Fe(r)}`],avatar:["avatar",`avatar${Fe(r)}`,`avatarColor${Fe(o)}`],icon:["icon",`icon${Fe(r)}`,`iconColor${Fe(i)}`],deleteIcon:["deleteIcon",`deleteIcon${Fe(r)}`,`deleteIconColor${Fe(o)}`,`deleteIcon${Fe(l)}Color${Fe(o)}`]};return Ke(u,D9,t)},A9=fe("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:s,size:a,variant:l}=n;return[{[`& .${Tt.avatar}`]:t.avatar},{[`& .${Tt.avatar}`]:t[`avatar${Fe(a)}`]},{[`& .${Tt.avatar}`]:t[`avatarColor${Fe(r)}`]},{[`& .${Tt.icon}`]:t.icon},{[`& .${Tt.icon}`]:t[`icon${Fe(a)}`]},{[`& .${Tt.icon}`]:t[`iconColor${Fe(o)}`]},{[`& .${Tt.deleteIcon}`]:t.deleteIcon},{[`& .${Tt.deleteIcon}`]:t[`deleteIcon${Fe(a)}`]},{[`& .${Tt.deleteIcon}`]:t[`deleteIconColor${Fe(r)}`]},{[`& .${Tt.deleteIcon}`]:t[`deleteIcon${Fe(l)}Color${Fe(r)}`]},t.root,t[`size${Fe(a)}`],t[`color${Fe(r)}`],i&&t.clickable,i&&r!=="default"&&t[`clickableColor${Fe(r)})`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${Fe(r)}`],t[l],t[`${l}${Fe(r)}`]]}})(ft(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Tt.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Tt.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${Tt.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${Tt.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${Tt.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Tt.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Tt.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Tt.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Tt.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Bn(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${Tt.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Tt.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Tt.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Tt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(Bn(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Tt.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${Tt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Bn(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Tt.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Tt.avatar}`]:{marginLeft:4},[`& .${Tt.avatarSmall}`]:{marginLeft:2},[`& .${Tt.icon}`]:{marginLeft:4},[`& .${Tt.iconSmall}`]:{marginLeft:2},[`& .${Tt.deleteIcon}`]:{marginRight:5},[`& .${Tt.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Bn()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${Tt.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${Tt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${Tt.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),O9=fe("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${Fe(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function E1(e){return e.key==="Backspace"||e.key==="Delete"}const Y2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:s,color:a="default",component:l,deleteIcon:u,disabled:d=!1,icon:f,label:h,onClick:p,onDelete:m,onKeyDown:b,onKeyUp:y,size:x="medium",variant:C="filled",tabIndex:v,skipFocusWhenDisabled:S=!1,slots:I={},slotProps:T={},...N}=r,O=M.useRef(null),F=vt(O,n),B=Q=>{Q.stopPropagation(),m&&m(Q)},j=Q=>{Q.currentTarget===Q.target&&E1(Q)&&Q.preventDefault(),b&&b(Q)},D=Q=>{Q.currentTarget===Q.target&&m&&E1(Q)&&m(Q),y&&y(Q)},H=s!==!1&&p?!0:s,_=H||m?pi:l||"div",L={...r,component:_,disabled:d,size:x,color:a,iconColor:M.isValidElement(f)&&f.props.color||a,onDelete:!!m,clickable:H,variant:C},$=I9(L),K=_===pi?{component:l||"div",focusVisibleClassName:$.focusVisible,...m&&{disableRipple:!0}}:{};let G=null;m&&(G=u&&M.isValidElement(u)?M.cloneElement(u,{className:Ue(u.props.className,$.deleteIcon),onClick:B}):c.jsx(w9,{className:$.deleteIcon,onClick:B}));let q=null;o&&M.isValidElement(o)&&(q=M.cloneElement(o,{className:Ue($.avatar,o.props.className)}));let R=null;f&&M.isValidElement(f)&&(R=M.cloneElement(f,{className:Ue($.icon,f.props.className)}));const oe={slots:I,slotProps:T},[se,z]=kt("root",{elementType:A9,externalForwardedProps:{...oe,...N},ownerState:L,shouldForwardComponentProp:!0,ref:F,className:Ue($.root,i),additionalProps:{disabled:H&&d?!0:void 0,tabIndex:S&&d?-1:v,...K},getSlotProps:Q=>({...Q,onClick:re=>{Q.onClick?.(re),p?.(re)},onKeyDown:re=>{Q.onKeyDown?.(re),j(re)},onKeyUp:re=>{Q.onKeyUp?.(re),D(re)}})}),[pe,J]=kt("label",{elementType:O9,externalForwardedProps:oe,ownerState:L,className:$.label});return c.jsxs(se,{as:_,...z,children:[q||R,c.jsx(pe,{...J,children:h}),G]})}),M9=mt(c.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function P9(e){return Ge("MuiAutocomplete",e)}const gt=We("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var v1,T1;const R9=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:u,size:d}=e,f={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Fe(d)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Ke(f,P9,t)},N9=fe("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:s,size:a}=n;return[{[`& .${gt.tag}`]:t.tag},{[`& .${gt.tag}`]:t[`tagSize${Fe(a)}`]},{[`& .${gt.inputRoot}`]:t.inputRoot},{[`& .${gt.input}`]:t.input},{[`& .${gt.input}`]:s&&t.inputFocused},t.root,r&&t.fullWidth,i&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${gt.focused} .${gt.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${gt.clearIndicator}`]:{visibility:"visible"}},[`& .${gt.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${gt.inputRoot}`]:{[`.${gt.hasPopupIcon}&, .${gt.hasClearIcon}&`]:{paddingRight:30},[`.${gt.hasPopupIcon}.${gt.hasClearIcon}&`]:{paddingRight:56},[`& .${gt.input}`]:{width:0,minWidth:30}},[`& .${Mo.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Mo.root}.${tr.sizeSmall}`]:{[`& .${Mo.input}`]:{padding:"2px 4px 3px 0"}},[`& .${fr.root}`]:{padding:9,[`.${gt.hasPopupIcon}&, .${gt.hasClearIcon}&`]:{paddingRight:39},[`.${gt.hasPopupIcon}.${gt.hasClearIcon}&`]:{paddingRight:65},[`& .${gt.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${gt.endAdornment}`]:{right:9}},[`& .${fr.root}.${tr.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${gt.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${nr.root}`]:{paddingTop:19,paddingLeft:8,[`.${gt.hasPopupIcon}&, .${gt.hasClearIcon}&`]:{paddingRight:39},[`.${gt.hasPopupIcon}.${gt.hasClearIcon}&`]:{paddingRight:65},[`& .${nr.input}`]:{padding:"7px 4px"},[`& .${gt.endAdornment}`]:{right:9}},[`& .${nr.root}.${tr.sizeSmall}`]:{paddingBottom:1,[`& .${nr.input}`]:{padding:"2.5px 4px"}},[`& .${tr.hiddenLabel}`]:{paddingTop:8},[`& .${nr.root}.${tr.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${gt.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${nr.root}.${tr.hiddenLabel}.${tr.sizeSmall}`]:{[`& .${gt.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${gt.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${gt.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${gt.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${gt.inputRoot}`]:{flexWrap:"wrap"}}}]}),F9=fe("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),L9=fe(Ir,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),_9=fe(Ir,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),B9=fe(Qp,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${gt.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(ft(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),j9=fe(Ci,{name:"MuiAutocomplete",slot:"Paper"})(ft(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),$9=fe("div",{name:"MuiAutocomplete",slot:"Loading"})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),H9=fe("div",{name:"MuiAutocomplete",slot:"NoOptions"})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),z9=fe("ul",{name:"MuiAutocomplete",slot:"Listbox"})(ft(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${gt.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${gt.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${gt.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${gt.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${gt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),U9=fe(Lf,{name:"MuiAutocomplete",slot:"GroupLabel"})(ft(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),V9=fe("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${gt.option}`]:{paddingLeft:24}}),_f=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiAutocomplete"}),{autoComplete:o=!1,autoHighlight:i=!1,autoSelect:s=!1,blurOnSelect:a=!1,ChipProps:l,className:u,clearIcon:d=v1||(v1=c.jsx(M9,{fontSize:"small"})),clearOnBlur:f=!r.freeSolo,clearOnEscape:h=!1,clearText:p="Clear",closeText:m="Close",componentsProps:b,defaultValue:y=r.multiple?[]:null,disableClearable:x=!1,disableCloseOnSelect:C=!1,disabled:v=!1,disabledItemsFocusable:S=!1,disableListWrap:I=!1,disablePortal:T=!1,filterOptions:N,filterSelectedOptions:O=!1,forcePopupIcon:F="auto",freeSolo:B=!1,fullWidth:j=!1,getLimitTagsText:D=wt=>`+${wt}`,getOptionDisabled:H,getOptionKey:_,getOptionLabel:L,isOptionEqualToValue:$,groupBy:K,handleHomeEndKeys:G=!r.freeSolo,id:q,includeInputInList:R=!1,inputValue:oe,limitTags:se=-1,ListboxComponent:z,ListboxProps:pe,loading:J=!1,loadingText:Q="Loading…",multiple:re=!1,noOptionsText:ne="No options",onChange:ae,onClose:ie,onHighlightChange:Z,onInputChange:me,onOpen:le,open:ue,openOnFocus:Ie=!1,openText:Ce="Open",options:we,PaperComponent:ye,PopperComponent:ze,popupIcon:Ne=T1||(T1=c.jsx(N2,{})),readOnly:nt=!1,renderGroup:_e,renderInput:Bt,renderOption:yt,renderTags:ot,renderValue:xe,selectOnFocus:Pe=!r.freeSolo,size:qe="medium",slots:Je={},slotProps:Xe={},value:Re,...ct}=r,{getRootProps:lt,getInputProps:Mt,getInputLabelProps:be,getPopupIndicatorProps:Ae,getClearProps:Oe,getItemProps:Qe,getListboxProps:st,getOptionProps:Nt,value:Gt,dirty:bt,expanded:sn,id:Rn,popupOpen:jt,focused:gn,focusedItem:lr,anchorEl:Nn,setAnchorEl:jr,inputValue:Hn,groupedOptions:Pt}=l7({...r,componentName:"Autocomplete"}),xn=!x&&!v&&bt&&!nt,To=(!B||F===!0)&&F!==!1,{onMouseDown:ki}=Mt(),{ref:wn,...$o}=st(),So=L||(wt=>wt.label??wt),nn={...r,disablePortal:T,expanded:sn,focused:gn,fullWidth:j,getOptionLabel:So,hasClearIcon:xn,hasPopupIcon:To,inputFocused:lr===-1,popupOpen:jt,size:qe},rn=R9(nn),Ar={slots:{paper:ye,popper:ze,...Je},slotProps:{chip:l,listbox:pe,...b,...Xe}},[Ho,ko]=kt("listbox",{elementType:z9,externalForwardedProps:Ar,ownerState:nn,className:rn.listbox,additionalProps:$o,ref:wn}),[zo,ke]=kt("paper",{elementType:Ci,externalForwardedProps:Ar,ownerState:nn,className:rn.paper}),[Te,Ye]=kt("popper",{elementType:Qp,externalForwardedProps:Ar,ownerState:nn,className:rn.popper,additionalProps:{disablePortal:T,style:{width:Nn?Nn.clientWidth:null},role:"presentation",anchorEl:Nn,open:jt}});let rt;const je=wt=>({className:rn.tag,disabled:v,...Qe(wt)});if(re?Gt.length>0&&(ot?rt=ot(Gt,je,nn):xe?rt=xe(Gt,je,nn):rt=Gt.map((wt,$r)=>{const{key:Fn,...io}=je({index:$r});return c.jsx(Y2,{label:So(wt),size:qe,...io,...Ar.slotProps.chip},Fn)})):xe&&Gt!=null&&(rt=xe(Gt,je,nn)),se>-1&&Array.isArray(rt)){const wt=rt.length-se;!gn&&wt>0&&(rt=rt.splice(0,se),rt.push(c.jsx("span",{className:rn.tag,children:D(wt)},rt.length)))}const Wt=_e||(wt=>c.jsxs("li",{children:[c.jsx(U9,{className:rn.groupLabel,ownerState:nn,component:"div",children:wt.group}),c.jsx(V9,{className:rn.groupUl,ownerState:nn,children:wt.children})]},wt.key)),Di=yt||((wt,$r)=>{const{key:Fn,...io}=wt;return c.jsx("li",{...io,children:So($r)},Fn)}),Ps=(wt,$r)=>{const Fn=Nt({option:wt,index:$r});return Di({...Fn,className:rn.option},wt,{selected:Fn["aria-selected"],index:$r,inputValue:Hn},nn)},Rs=Ar.slotProps.clearIndicator,Il=Ar.slotProps.popupIndicator;return c.jsxs(M.Fragment,{children:[c.jsx(N9,{ref:n,className:Ue(rn.root,u),ownerState:nn,...lt(ct),children:Bt({id:Rn,disabled:v,fullWidth:!0,size:qe==="small"?"small":void 0,InputLabelProps:be(),InputProps:{ref:jr,className:rn.inputRoot,startAdornment:rt,onMouseDown:wt=>{wt.target===wt.currentTarget&&ki(wt)},...(xn||To)&&{endAdornment:c.jsxs(F9,{className:rn.endAdornment,ownerState:nn,children:[xn?c.jsx(L9,{...Oe(),"aria-label":p,title:p,ownerState:nn,...Rs,className:Ue(rn.clearIndicator,Rs?.className),children:d}):null,To?c.jsx(_9,{...Ae(),disabled:v,"aria-label":jt?m:Ce,title:jt?m:Ce,ownerState:nn,...Il,className:Ue(rn.popupIndicator,Il?.className),children:Ne}):null]})}},inputProps:{className:rn.input,disabled:v,readOnly:nt,...Mt()}})}),Nn?c.jsx(B9,{as:Te,...Ye,children:c.jsxs(j9,{as:zo,...ke,children:[J&&Pt.length===0?c.jsx($9,{className:rn.loading,ownerState:nn,children:Q}):null,Pt.length===0&&!B&&!J?c.jsx(H9,{className:rn.noOptions,ownerState:nn,role:"presentation",onMouseDown:wt=>{wt.preventDefault()},children:ne}):null,Pt.length>0?c.jsx(Ho,{as:z,...ko,children:Pt.map((wt,$r)=>K?Wt({key:wt.key,group:wt.group,children:wt.options.map((Fn,io)=>Ps(Fn,wt.index+io))}):Ps(wt,$r))}):null]})}):null]})});var gu={exports:{}},W9=gu.exports,S1;function q9(){return S1||(S1=1,(function(e,t){(function(n,r){e.exports=r()})(W9,(function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",l="hour",u="day",d="week",f="month",h="quarter",p="year",m="date",b="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var L=["th","st","nd","rd"],$=_%100;return"["+_+(L[($-20)%10]||L[$]||L[0])+"]"}},v=function(_,L,$){var K=String(_);return!K||K.length>=L?_:""+Array(L+1-K.length).join($)+_},S={s:v,z:function(_){var L=-_.utcOffset(),$=Math.abs(L),K=Math.floor($/60),G=$%60;return(L<=0?"+":"-")+v(K,2,"0")+":"+v(G,2,"0")},m:function _(L,$){if(L.date()<$.date())return-_($,L);var K=12*($.year()-L.year())+($.month()-L.month()),G=L.clone().add(K,f),q=$-G<0,R=L.clone().add(K+(q?-1:1),f);return+(-(K+($-G)/(q?G-R:R-G))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:f,y:p,w:d,d:u,D:m,h:l,m:a,s,ms:i,Q:h}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},I="en",T={};T[I]=C;var N="$isDayjsObject",O=function(_){return _ instanceof D||!(!_||!_[N])},F=function _(L,$,K){var G;if(!L)return I;if(typeof L=="string"){var q=L.toLowerCase();T[q]&&(G=q),$&&(T[q]=$,G=q);var R=L.split("-");if(!G&&R.length>1)return _(R[0])}else{var oe=L.name;T[oe]=L,G=oe}return!K&&G&&(I=G),G||!K&&I},B=function(_,L){if(O(_))return _.clone();var $=typeof L=="object"?L:{};return $.date=_,$.args=arguments,new D($)},j=S;j.l=F,j.i=O,j.w=function(_,L){return B(_,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var D=(function(){function _($){this.$L=F($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[N]=!0}var L=_.prototype;return L.parse=function($){this.$d=(function(K){var G=K.date,q=K.utc;if(G===null)return new Date(NaN);if(j.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var R=G.match(y);if(R){var oe=R[2]-1||0,se=(R[7]||"0").substring(0,3);return q?new Date(Date.UTC(R[1],oe,R[3]||1,R[4]||0,R[5]||0,R[6]||0,se)):new Date(R[1],oe,R[3]||1,R[4]||0,R[5]||0,R[6]||0,se)}}return new Date(G)})($),this.init()},L.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},L.$utils=function(){return j},L.isValid=function(){return this.$d.toString()!==b},L.isSame=function($,K){var G=B($);return this.startOf(K)<=G&&G<=this.endOf(K)},L.isAfter=function($,K){return B($)<this.startOf(K)},L.isBefore=function($,K){return this.endOf(K)<B($)},L.$g=function($,K,G){return j.u($)?this[K]:this.set(G,$)},L.unix=function(){return Math.floor(this.valueOf()/1e3)},L.valueOf=function(){return this.$d.getTime()},L.startOf=function($,K){var G=this,q=!!j.u(K)||K,R=j.p($),oe=function(ae,ie){var Z=j.w(G.$u?Date.UTC(G.$y,ie,ae):new Date(G.$y,ie,ae),G);return q?Z:Z.endOf(u)},se=function(ae,ie){return j.w(G.toDate()[ae].apply(G.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(ie)),G)},z=this.$W,pe=this.$M,J=this.$D,Q="set"+(this.$u?"UTC":"");switch(R){case p:return q?oe(1,0):oe(31,11);case f:return q?oe(1,pe):oe(0,pe+1);case d:var re=this.$locale().weekStart||0,ne=(z<re?z+7:z)-re;return oe(q?J-ne:J+(6-ne),pe);case u:case m:return se(Q+"Hours",0);case l:return se(Q+"Minutes",1);case a:return se(Q+"Seconds",2);case s:return se(Q+"Milliseconds",3);default:return this.clone()}},L.endOf=function($){return this.startOf($,!1)},L.$set=function($,K){var G,q=j.p($),R="set"+(this.$u?"UTC":""),oe=(G={},G[u]=R+"Date",G[m]=R+"Date",G[f]=R+"Month",G[p]=R+"FullYear",G[l]=R+"Hours",G[a]=R+"Minutes",G[s]=R+"Seconds",G[i]=R+"Milliseconds",G)[q],se=q===u?this.$D+(K-this.$W):K;if(q===f||q===p){var z=this.clone().set(m,1);z.$d[oe](se),z.init(),this.$d=z.set(m,Math.min(this.$D,z.daysInMonth())).$d}else oe&&this.$d[oe](se);return this.init(),this},L.set=function($,K){return this.clone().$set($,K)},L.get=function($){return this[j.p($)]()},L.add=function($,K){var G,q=this;$=Number($);var R=j.p(K),oe=function(pe){var J=B(q);return j.w(J.date(J.date()+Math.round(pe*$)),q)};if(R===f)return this.set(f,this.$M+$);if(R===p)return this.set(p,this.$y+$);if(R===u)return oe(1);if(R===d)return oe(7);var se=(G={},G[a]=r,G[l]=o,G[s]=n,G)[R]||1,z=this.$d.getTime()+$*se;return j.w(z,this)},L.subtract=function($,K){return this.add(-1*$,K)},L.format=function($){var K=this,G=this.$locale();if(!this.isValid())return G.invalidDate||b;var q=$||"YYYY-MM-DDTHH:mm:ssZ",R=j.z(this),oe=this.$H,se=this.$m,z=this.$M,pe=G.weekdays,J=G.months,Q=G.meridiem,re=function(ie,Z,me,le){return ie&&(ie[Z]||ie(K,q))||me[Z].slice(0,le)},ne=function(ie){return j.s(oe%12||12,ie,"0")},ae=Q||function(ie,Z,me){var le=ie<12?"AM":"PM";return me?le.toLowerCase():le};return q.replace(x,(function(ie,Z){return Z||(function(me){switch(me){case"YY":return String(K.$y).slice(-2);case"YYYY":return j.s(K.$y,4,"0");case"M":return z+1;case"MM":return j.s(z+1,2,"0");case"MMM":return re(G.monthsShort,z,J,3);case"MMMM":return re(J,z);case"D":return K.$D;case"DD":return j.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return re(G.weekdaysMin,K.$W,pe,2);case"ddd":return re(G.weekdaysShort,K.$W,pe,3);case"dddd":return pe[K.$W];case"H":return String(oe);case"HH":return j.s(oe,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return ae(oe,se,!0);case"A":return ae(oe,se,!1);case"m":return String(se);case"mm":return j.s(se,2,"0");case"s":return String(K.$s);case"ss":return j.s(K.$s,2,"0");case"SSS":return j.s(K.$ms,3,"0");case"Z":return R}return null})(ie)||R.replace(":","")}))},L.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},L.diff=function($,K,G){var q,R=this,oe=j.p(K),se=B($),z=(se.utcOffset()-this.utcOffset())*r,pe=this-se,J=function(){return j.m(R,se)};switch(oe){case p:q=J()/12;break;case f:q=J();break;case h:q=J()/3;break;case d:q=(pe-z)/6048e5;break;case u:q=(pe-z)/864e5;break;case l:q=pe/o;break;case a:q=pe/r;break;case s:q=pe/n;break;default:q=pe}return G?q:j.a(q)},L.daysInMonth=function(){return this.endOf(f).$D},L.$locale=function(){return T[this.$L]},L.locale=function($,K){if(!$)return this.$L;var G=this.clone(),q=F($,K,!0);return q&&(G.$L=q),G},L.clone=function(){return j.w(this.$d,this)},L.toDate=function(){return new Date(this.valueOf())},L.toJSON=function(){return this.isValid()?this.toISOString():null},L.toISOString=function(){return this.$d.toISOString()},L.toString=function(){return this.$d.toUTCString()},_})(),H=D.prototype;return B.prototype=H,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",u],["$M",f],["$y",p],["$D",m]].forEach((function(_){H[_[1]]=function(L){return this.$g(L,_[0],_[1])}})),B.extend=function(_,L){return _.$i||(_(L,D,B),_.$i=!0),B},B.locale=F,B.isDayjs=O,B.unix=function(_){return B(1e3*_)},B.en=T[I],B.Ls=T,B.p={},B}))})(gu)),gu.exports}var Y9=q9();const _t=Tr(Y9);var bu={exports:{}},K9=bu.exports,k1;function G9(){return k1||(k1=1,(function(e,t){(function(n,r){e.exports=r()})(K9,(function(){var n="week",r="year";return function(o,i,s){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var d=s(this).startOf(r).add(1,r).date(u),f=s(this).endOf(n);if(d.isBefore(f))return 1}var h=s(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),p=this.diff(h,n,!0);return p<0?s(this).startOf("week").week():Math.ceil(p)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}}))})(bu)),bu.exports}var Q9=G9();const X9=Tr(Q9);var yu={exports:{}},Z9=yu.exports,w1;function J9(){return w1||(w1=1,(function(e,t){(function(n,r){e.exports=r()})(Z9,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,i=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},d=function(y){return function(x){this[y]=+x}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(x){if(!x||x==="Z")return 0;var C=x.match(/([+-]|\d\d)/g),v=60*C[1]+(+C[2]||0);return v===0?0:C[0]==="+"?-v:v})(y)}],h=function(y){var x=l[y];return x&&(x.indexOf?x:x.s.concat(x.f))},p=function(y,x){var C,v=l.meridiem;if(v){for(var S=1;S<=24;S+=1)if(y.indexOf(v(S,0,x))>-1){C=S>12;break}}else C=y===(x?"pm":"PM");return C},m={A:[a,function(y){this.afternoon=p(y,!1)}],a:[a,function(y){this.afternoon=p(y,!0)}],Q:[o,function(y){this.month=3*(y-1)+1}],S:[o,function(y){this.milliseconds=100*+y}],SS:[i,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,d("seconds")],ss:[s,d("seconds")],m:[s,d("minutes")],mm:[s,d("minutes")],H:[s,d("hours")],h:[s,d("hours")],HH:[s,d("hours")],hh:[s,d("hours")],D:[s,d("day")],DD:[i,d("day")],Do:[a,function(y){var x=l.ordinal,C=y.match(/\d+/);if(this.day=C[0],x)for(var v=1;v<=31;v+=1)x(v).replace(/\[|\]/g,"")===y&&(this.day=v)}],w:[s,d("week")],ww:[i,d("week")],M:[s,d("month")],MM:[i,d("month")],MMM:[a,function(y){var x=h("months"),C=(h("monthsShort")||x.map((function(v){return v.slice(0,3)}))).indexOf(y)+1;if(C<1)throw new Error;this.month=C%12||C}],MMMM:[a,function(y){var x=h("months").indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,d("year")],YY:[i,function(y){this.year=u(y)}],YYYY:[/\d{4}/,d("year")],Z:f,ZZ:f};function b(y){var x,C;x=y,C=l&&l.formats;for(var v=(y=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(B,j,D){var H=D&&D.toUpperCase();return j||C[D]||n[D]||C[H].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(_,L,$){return L||$.slice(1)}))}))).match(r),S=v.length,I=0;I<S;I+=1){var T=v[I],N=m[T],O=N&&N[0],F=N&&N[1];v[I]=F?{regex:O,parser:F}:T.replace(/^\[|\]$/g,"")}return function(B){for(var j={},D=0,H=0;D<S;D+=1){var _=v[D];if(typeof _=="string")H+=_.length;else{var L=_.regex,$=_.parser,K=B.slice(H),G=L.exec(K)[0];$.call(j,G),B=B.replace(G,"")}}return(function(q){var R=q.afternoon;if(R!==void 0){var oe=q.hours;R?oe<12&&(q.hours+=12):oe===12&&(q.hours=0),delete q.afternoon}})(j),j}}return function(y,x,C){C.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(u=y.parseTwoDigitYear);var v=x.prototype,S=v.parse;v.parse=function(I){var T=I.date,N=I.utc,O=I.args;this.$u=N;var F=O[1];if(typeof F=="string"){var B=O[2]===!0,j=O[3]===!0,D=B||j,H=O[2];j&&(H=O[2]),l=this.$locale(),!B&&H&&(l=C.Ls[H]),this.$d=(function(K,G,q,R){try{if(["x","X"].indexOf(G)>-1)return new Date((G==="X"?1e3:1)*K);var oe=b(G)(K),se=oe.year,z=oe.month,pe=oe.day,J=oe.hours,Q=oe.minutes,re=oe.seconds,ne=oe.milliseconds,ae=oe.zone,ie=oe.week,Z=new Date,me=pe||(se||z?1:Z.getDate()),le=se||Z.getFullYear(),ue=0;se&&!z||(ue=z>0?z-1:Z.getMonth());var Ie,Ce=J||0,we=Q||0,ye=re||0,ze=ne||0;return ae?new Date(Date.UTC(le,ue,me,Ce,we,ye,ze+60*ae.offset*1e3)):q?new Date(Date.UTC(le,ue,me,Ce,we,ye,ze)):(Ie=new Date(le,ue,me,Ce,we,ye,ze),ie&&(Ie=R(Ie).week(ie).toDate()),Ie)}catch{return new Date("")}})(T,F,N,C),this.init(),H&&H!==!0&&(this.$L=this.locale(H).$L),D&&T!=this.format(F)&&(this.$d=new Date("")),l={}}else if(F instanceof Array)for(var _=F.length,L=1;L<=_;L+=1){O[1]=F[L-1];var $=C.apply(this,O);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}L===_&&(this.$d=new Date(""))}else S.call(this,I)}}}))})(yu)),yu.exports}var eB=J9();const tB=Tr(eB);var xu={exports:{}},nB=xu.exports,D1;function rB(){return D1||(D1=1,(function(e,t){(function(n,r){e.exports=r()})(nB,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,i){var s=o.prototype,a=s.format;i.en.formats=n,s.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,d=(function(f,h){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(p,m,b){var y=b&&b.toUpperCase();return m||h[b]||n[b]||h[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(x,C,v){return C||v.slice(1)}))}))})(l,u===void 0?{}:u);return a.call(this,d)}}}))})(xu)),xu.exports}var oB=rB();const iB=Tr(oB);var Cu={exports:{}},sB=Cu.exports,I1;function aB(){return I1||(I1=1,(function(e,t){(function(n,r){e.exports=r()})(sB,(function(){return function(n,r,o){r.prototype.isBetween=function(i,s,a,l){var u=o(i),d=o(s),f=(l=l||"()")[0]==="(",h=l[1]===")";return(f?this.isAfter(u,a):!this.isBefore(u,a))&&(h?this.isBefore(d,a):!this.isAfter(d,a))||(f?this.isBefore(u,a):!this.isAfter(u,a))&&(h?this.isAfter(d,a):!this.isBefore(d,a))}}}))})(Cu)),Cu.exports}var lB=aB();const uB=Tr(lB);var Eu={exports:{}},cB=Eu.exports,A1;function dB(){return A1||(A1=1,(function(e,t){(function(n,r){e.exports=r()})(cB,(function(){return function(n,r){var o=r.prototype,i=o.format;o.format=function(s){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(s);var u=this.$utils(),d=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return u.s(a.week(),f==="w"?1:2,"0");case"W":case"WW":return u.s(a.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return u.s(String(a.$H===0?24:a.$H),f==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return f}}));return i.bind(this)(d)}}}))})(Eu)),Eu.exports}var fB=dB();const pB=Tr(fB);_t.extend(iB);_t.extend(X9);_t.extend(uB);_t.extend(pB);const hB={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},mB={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},zd=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
196
+ `),N=S.selectionStart===I;T&&N&&S.setSelectionRange(I,I),r&&r(v)};return c.jsxs(M.Fragment,{children:[c.jsx("textarea",{value:a,onChange:C,ref:f,rows:i,style:s,...l}),c.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:p,tabIndex:-1,style:{...OL.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function RL(e){return Ge("MuiInputBase",e)}const tr=We("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Kg;const wc=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Fe(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Dc=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},NL=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:i,focused:s,formControl:a,fullWidth:l,hiddenLabel:u,multiline:d,readOnly:f,size:h,startAdornment:p,type:m}=e,b={root:["root",`color${Fe(n)}`,r&&"disabled",o&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",h&&h!=="medium"&&`size${Fe(h)}`,d&&"multiline",p&&"adornedStart",i&&"adornedEnd",u&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",m==="search"&&"inputTypeSearch",d&&"inputMultiline",h==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",i&&"inputAdornedEnd",f&&"readOnly"]};return Ke(b,RL,t)},Ic=fe("div",{name:"MuiInputBase",slot:"Root",overridesResolver:wc})(ft(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${tr.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),Ac=fe("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Dc})(ft(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${tr.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${tr.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:i})=>!i.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:i})=>i.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),Gg=wk({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),_p=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:i,autoFocus:s,className:a,color:l,components:u={},componentsProps:d={},defaultValue:f,disabled:h,disableInjectingGlobalStyles:p,endAdornment:m,error:b,fullWidth:y=!1,id:x,inputComponent:C="input",inputProps:v={},inputRef:S,margin:I,maxRows:T,minRows:N,multiline:O=!1,name:F,onBlur:B,onChange:j,onClick:D,onFocus:H,onKeyDown:_,onKeyUp:L,placeholder:$,readOnly:K,renderSuffix:G,rows:q,size:R,slotProps:oe={},slots:se={},startAdornment:z,type:pe="text",value:J,...Q}=r,re=v.value!=null?v.value:J,{current:ne}=M.useRef(re!=null),ae=M.useRef(),ie=M.useCallback(Re=>{},[]),Z=vt(ae,S,v.ref,ie),[me,le]=M.useState(!1),ue=ar(),Ie=Ei({props:r,muiFormControl:ue,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Ie.focused=ue?ue.focused:me,M.useEffect(()=>{!ue&&h&&me&&(le(!1),B&&B())},[ue,h,me,B]);const Ce=ue&&ue.onFilled,we=ue&&ue.onEmpty,ye=M.useCallback(Re=>{Vu(Re)?Ce&&Ce():we&&we()},[Ce,we]);yn(()=>{ne&&ye({value:re})},[re,ye,ne]);const ze=Re=>{H&&H(Re),v.onFocus&&v.onFocus(Re),ue&&ue.onFocus?ue.onFocus(Re):le(!0)},Ne=Re=>{B&&B(Re),v.onBlur&&v.onBlur(Re),ue&&ue.onBlur?ue.onBlur(Re):le(!1)},nt=(Re,...ct)=>{if(!ne){const lt=Re.target||ae.current;if(lt==null)throw new Error(mo(1));ye({value:lt.value})}v.onChange&&v.onChange(Re,...ct),j&&j(Re,...ct)};M.useEffect(()=>{ye(ae.current)},[]);const _e=Re=>{ae.current&&Re.currentTarget===Re.target&&ae.current.focus(),D&&D(Re)};let Bt=C,yt=v;O&&Bt==="input"&&(q?yt={type:void 0,minRows:q,maxRows:q,...yt}:yt={type:void 0,maxRows:T,minRows:N,...yt},Bt=PL);const ot=Re=>{ye(Re.animationName==="mui-auto-fill-cancel"?ae.current:{value:"x"})};M.useEffect(()=>{ue&&ue.setAdornedStart(!!z)},[ue,z]);const xe={...r,color:Ie.color||"primary",disabled:Ie.disabled,endAdornment:m,error:Ie.error,focused:Ie.focused,formControl:ue,fullWidth:y,hiddenLabel:Ie.hiddenLabel,multiline:O,size:Ie.size,startAdornment:z,type:pe},Pe=NL(xe),qe=se.root||u.Root||Ic,Je=oe.root||d.root||{},Xe=se.input||u.Input||Ac;return yt={...yt,...oe.input??d.input},c.jsxs(M.Fragment,{children:[!p&&typeof Gg=="function"&&(Kg||(Kg=c.jsx(Gg,{}))),c.jsxs(qe,{...Je,ref:n,onClick:_e,...Q,...!hs(qe)&&{ownerState:{...xe,...Je.ownerState}},className:Ue(Pe.root,Je.className,a,K&&"MuiInputBase-readOnly"),children:[z,c.jsx(kc.Provider,{value:null,children:c.jsx(Xe,{"aria-invalid":Ie.error,"aria-describedby":o,autoComplete:i,autoFocus:s,defaultValue:f,disabled:Ie.disabled,id:x,onAnimationStart:ot,name:F,placeholder:$,readOnly:K,required:Ie.required,rows:q,value:re,onKeyDown:_,onKeyUp:L,type:pe,...yt,...!hs(Xe)&&{as:Bt,ownerState:{...xe,...yt.ownerState}},ref:Z,className:Ue(Pe.input,yt.className,K&&"MuiInputBase-readOnly"),onBlur:Ne,onChange:nt,onFocus:ze})}),m,G?G({...Ie,startAdornment:z}):null]})]})});function FL(e){return Ge("MuiInput",e)}const Mo={...tr,...We("MuiInput",["root","underline","input"])},LL=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},FL,t);return{...t,...o}},_L=fe(Ic,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...wc(e,t),!n.disableUnderline&&t.underline]}})(ft(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Mo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Mo.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Mo.disabled}, .${Mo.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${Mo.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Bn()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}}))]}})),BL=fe(Ac,{name:"MuiInput",slot:"Input",overridesResolver:Dc})({}),Bp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiInput"}),{disableUnderline:o=!1,components:i={},componentsProps:s,fullWidth:a=!1,inputComponent:l="input",multiline:u=!1,slotProps:d,slots:f={},type:h="text",...p}=r,m=LL(r),y={root:{ownerState:{disableUnderline:o}}},x=d??s?An(d??s,y):y,C=f.root??i.Root??_L,v=f.input??i.Input??BL;return c.jsx(_p,{slots:{root:C,input:v},slotProps:x,fullWidth:a,inputComponent:l,multiline:u,ref:n,type:h,...p,classes:m})});Bp.muiName="Input";function jL(e){return Ge("MuiFilledInput",e)}const nr={...tr,...We("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},$L=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:i,hiddenLabel:s,multiline:a}=e,l={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",i==="small"&&`size${Fe(i)}`,s&&"hiddenLabel",a&&"multiline"],input:["input"]},u=Ke(l,jL,t);return{...t,...u}},HL=fe(Ic,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...wc(e,t),!n.disableUnderline&&t.underline]}})(ft(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${nr.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${nr.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${nr.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${nr.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${nr.disabled}, .${nr.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${nr.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Bn()).map(([s])=>({props:{disableUnderline:!1,color:s},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s]?.main}`}}})),{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:12}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:12}},{props:({ownerState:s})=>s.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:s,size:a})=>s.multiline&&a==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),zL=fe(Ac,{name:"MuiFilledInput",slot:"Input",overridesResolver:Dc})(ft(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),jp=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:i={},componentsProps:s,fullWidth:a=!1,hiddenLabel:l,inputComponent:u="input",multiline:d=!1,slotProps:f,slots:h={},type:p="text",...m}=r,b={...r,disableUnderline:o,fullWidth:a,inputComponent:u,multiline:d,type:p},y=$L(r),x={root:{ownerState:b},input:{ownerState:b}},C=f??s?An(x,f??s):x,v=h.root??i.Root??HL,S=h.input??i.Input??zL;return c.jsx(_p,{slots:{root:v,input:S},slotProps:C,fullWidth:a,inputComponent:u,multiline:d,ref:n,type:p,...m,classes:y})});jp.muiName="Input";var Qg;const UL=fe("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:$n})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),VL=fe("legend",{name:"MuiNotchedOutlined",shouldForwardProp:$n})(ft(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function WL(e){const{children:t,classes:n,className:r,label:o,notched:i,...s}=e,a=o!=null&&o!=="",l={...e,notched:i,withLabel:a};return c.jsx(UL,{"aria-hidden":!0,className:r,ownerState:l,...s,children:c.jsx(VL,{ownerState:l,children:a?c.jsx("span",{children:o}):Qg||(Qg=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}function qL(e){return Ge("MuiOutlinedInput",e)}const fr={...tr,...We("MuiOutlinedInput",["root","notchedOutline","input"])},YL=e=>{const{classes:t}=e,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},qL,t);return{...t,...r}},KL=fe(Ic,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:wc})(ft(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${fr.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${fr.focused} .${fr.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(Bn()).map(([n])=>({props:{color:n},style:{[`&.${fr.focused} .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${fr.error} .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${fr.disabled} .${fr.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),GL=fe(WL,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(ft(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),QL=fe(Ac,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Dc})(ft(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),$p=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiOutlinedInput"}),{components:o={},fullWidth:i=!1,inputComponent:s="input",label:a,multiline:l=!1,notched:u,slots:d={},slotProps:f={},type:h="text",...p}=r,m=YL(r),b=ar(),y=Ei({props:r,muiFormControl:b,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),x={...r,color:y.color||"primary",disabled:y.disabled,error:y.error,focused:y.focused,formControl:b,fullWidth:i,hiddenLabel:y.hiddenLabel,multiline:l,size:y.size,type:h},C=d.root??o.Root??KL,v=d.input??o.Input??QL,[S,I]=kt("notchedOutline",{elementType:GL,className:m.notchedOutline,shouldForwardComponentProp:!0,ownerState:x,externalForwardedProps:{slots:d,slotProps:f},additionalProps:{label:a!=null&&a!==""&&y.required?c.jsxs(M.Fragment,{children:[a," ","*"]}):a}});return c.jsx(_p,{slots:{root:C,input:v},slotProps:f,renderSuffix:T=>c.jsx(S,{...I,notched:typeof u<"u"?u:!!(T.startAdornment||T.filled||T.focused)}),fullWidth:i,inputComponent:s,multiline:l,ref:n,type:h,...p,classes:{...m,notchedOutline:null}})});$p.muiName="Input";function XL(e){return Ge("MuiFormLabel",e)}const Ua=We("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ZL=e=>{const{classes:t,color:n,focused:r,disabled:o,error:i,filled:s,required:a}=e,l={root:["root",`color${Fe(n)}`,o&&"disabled",i&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",i&&"error"]};return Ke(l,XL,t)},JL=fe("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{[`&.${Ua.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${Ua.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Ua.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),e_=fe("span",{name:"MuiFormLabel",slot:"Asterisk"})(ft(({theme:e})=>({[`&.${Ua.error}`]:{color:(e.vars||e).palette.error.main}}))),t_=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormLabel"}),{children:o,className:i,color:s,component:a="label",disabled:l,error:u,filled:d,focused:f,required:h,...p}=r,m=ar(),b=Ei({props:r,muiFormControl:m,states:["color","required","focused","disabled","error","filled"]}),y={...r,color:b.color||"primary",component:a,disabled:b.disabled,error:b.error,filled:b.filled,focused:b.focused,required:b.required},x=ZL(y);return c.jsxs(JL,{as:a,ownerState:y,className:Ue(x.root,i),ref:n,...p,children:[o,b.required&&c.jsxs(e_,{ownerState:y,"aria-hidden":!0,className:x.asterisk,children:[" ","*"]})]})});function n_(e){return Ge("MuiInputLabel",e)}We("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const r_=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:i,variant:s,required:a}=e,l={root:["root",n&&"formControl",!i&&"animated",o&&"shrink",r&&r!=="medium"&&`size${Fe(r)}`,s],asterisk:[a&&"asterisk"]},u=Ke(l,n_,t);return{...t,...u}},o_=fe(t_,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Ua.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(ft(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),qu=M.forwardRef(function(t,n){const r=ut({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,margin:i,shrink:s,variant:a,className:l,...u}=r,d=ar();let f=s;typeof f>"u"&&d&&(f=d.filled||d.focused||d.adornedStart);const h=Ei({props:r,muiFormControl:d,states:["size","variant","required","focused"]}),p={...r,disableAnimation:o,formControl:d,shrink:f,size:h.size,variant:h.variant,required:h.required,focused:h.focused},m=r_(p);return c.jsx(o_,{"data-shrink":f,ref:n,className:Ue(m.root,l),...u,ownerState:p,classes:m})});function i_(e){return Ge("MuiFormHelperText",e)}const Xg=We("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Zg;const s_=e=>{const{classes:t,contained:n,size:r,disabled:o,error:i,filled:s,focused:a,required:l}=e,u={root:["root",o&&"disabled",i&&"error",r&&`size${Fe(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Ke(u,i_,t)},a_=fe("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Fe(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Xg.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Xg.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),O2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiFormHelperText"}),{children:o,className:i,component:s="p",disabled:a,error:l,filled:u,focused:d,margin:f,required:h,variant:p,...m}=r,b=ar(),y=Ei({props:r,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),x={...r,component:s,contained:y.variant==="filled"||y.variant==="outlined",variant:y.variant,size:y.size,disabled:y.disabled,error:y.error,filled:y.filled,focused:y.focused,required:y.required};delete x.ownerState;const C=s_(x);return c.jsx(a_,{as:s,className:Ue(C.root,i),ref:n,...m,ownerState:x,children:o===" "?Zg||(Zg=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):o})});function Et(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...i}=e,s=o?{}:br(n,r),{props:a,internalRef:l}=f2({...i,externalSlotProps:s}),u=vt(l,s?.ref,e.additionalProps?.ref);return d2(t,{...a,ref:u},r)}function l_(e){return Ge("MuiList",e)}We("MuiList",["root","padding","dense","subheader"]);const u_=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Ke({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},l_,t)},c_=fe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),M2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:u,...d}=r,f=M.useMemo(()=>({dense:a}),[a]),h={...r,component:s,dense:a,disablePadding:l},p=u_(h);return c.jsx(ho.Provider,{value:f,children:c.jsxs(c_,{as:s,className:Ue(p.root,i),ref:n,ownerState:h,...d,children:[u,o]})})});function $d(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function Jg(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function P2(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function fa(e,t,n,r,o,i){let s=!1,a=o(e,t,t?n:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!P2(a,i)||l)a=o(e,a,n);else return a.focus(),!0}return!1}const d_=M.forwardRef(function(t,n){const{actions:r,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:u=!1,onKeyDown:d,variant:f="selectedMenu",...h}=t,p=M.useRef(null),m=M.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});yn(()=>{o&&p.current.focus()},[o]),M.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(v,{direction:S})=>{const I=!p.current.style.width;if(v.clientHeight<p.current.clientHeight&&I){const T=`${p2(bo(v))}px`;p.current.style[S==="rtl"?"paddingLeft":"paddingRight"]=T,p.current.style.width=`calc(100% + ${T})`}return p.current}}),[]);const b=v=>{const S=p.current,I=v.key;if(v.ctrlKey||v.metaKey||v.altKey){d&&d(v);return}const N=mn(S).activeElement;if(I==="ArrowDown")v.preventDefault(),fa(S,N,u,l,$d);else if(I==="ArrowUp")v.preventDefault(),fa(S,N,u,l,Jg);else if(I==="Home")v.preventDefault(),fa(S,null,u,l,$d);else if(I==="End")v.preventDefault(),fa(S,null,u,l,Jg);else if(I.length===1){const O=m.current,F=I.toLowerCase(),B=performance.now();O.keys.length>0&&(B-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&F!==O.keys[0]&&(O.repeating=!1)),O.lastTime=B,O.keys.push(F);const j=N&&!O.repeating&&P2(N,O);O.previousKeyMatched&&(j||fa(S,N,!1,l,$d,O))?v.preventDefault():O.previousKeyMatched=!1}d&&d(v)},y=vt(p,n);let x=-1;M.Children.forEach(s,(v,S)=>{if(!M.isValidElement(v)){x===S&&(x+=1,x>=s.length&&(x=-1));return}v.props.disabled||(f==="selectedMenu"&&v.props.selected||x===-1)&&(x=S),x===S&&(v.props.disabled||v.props.muiSkipListHighlight||v.type.muiSkipListHighlight)&&(x+=1,x>=s.length&&(x=-1))});const C=M.Children.map(s,(v,S)=>{if(S===x){const I={};return i&&(I.autoFocus=!0),v.props.tabIndex===void 0&&f==="selectedMenu"&&(I.tabIndex=0),M.cloneElement(v,I)}return v});return c.jsx(M2,{role:"menu",ref:y,className:a,onKeyDown:b,tabIndex:o?0:-1,...h,children:C})});function Mf(e){return`scale(${e}, ${e**2})`}const f_={entering:{opacity:1,transform:Mf(1)},entered:{opacity:1,transform:"none"}},Hd=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),el=M.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:u,onEntering:d,onExit:f,onExited:h,onExiting:p,style:m,timeout:b="auto",TransitionComponent:y=Dr,...x}=t,C=Sc(),v=M.useRef(),S=Lo(),I=M.useRef(null),T=vt(I,Ms(i),n),N=L=>$=>{if(L){const K=I.current;$===void 0?L(K):L(K,$)}},O=N(d),F=N((L,$)=>{g2(L);const{duration:K,delay:G,easing:q}=ms({style:m,timeout:b,easing:s},{mode:"enter"});let R;b==="auto"?(R=S.transitions.getAutoHeightDuration(L.clientHeight),v.current=R):R=K,L.style.transition=[S.transitions.create("opacity",{duration:R,delay:G}),S.transitions.create("transform",{duration:Hd?R:R*.666,delay:G,easing:q})].join(","),l&&l(L,$)}),B=N(u),j=N(p),D=N(L=>{const{duration:$,delay:K,easing:G}=ms({style:m,timeout:b,easing:s},{mode:"exit"});let q;b==="auto"?(q=S.transitions.getAutoHeightDuration(L.clientHeight),v.current=q):q=$,L.style.transition=[S.transitions.create("opacity",{duration:q,delay:K}),S.transitions.create("transform",{duration:Hd?q:q*.666,delay:Hd?K:K||q*.333,easing:G})].join(","),L.style.opacity=0,L.style.transform=Mf(.75),f&&f(L)}),H=N(h),_=L=>{b==="auto"&&C.start(v.current||0,L),r&&r(I.current,L)};return c.jsx(y,{appear:o,in:a,nodeRef:I,onEnter:F,onEntered:B,onEntering:O,onExit:D,onExited:H,onExiting:j,addEndListener:_,timeout:b==="auto"?null:b,...x,children:(L,{ownerState:$,...K})=>M.cloneElement(i,{style:{opacity:0,transform:Mf(.75),visibility:L==="exited"&&!a?"hidden":void 0,...f_[L],...m,...i.props.style},ref:T,...K})})});el&&(el.muiSupportAuto=!0);function p_(e){return Ge("MuiPopover",e)}We("MuiPopover",["root","paper"]);function e1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function t1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function n1(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Jl(e){return typeof e=="function"?e():e}const h_=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"]},p_,t)},m_=fe(y2,{name:"MuiPopover",slot:"Root"})({}),R2=fe(Ci,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),g_=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiPopover"}),{action:o,anchorEl:i,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:a,anchorReference:l="anchorEl",children:u,className:d,container:f,elevation:h=8,marginThreshold:p=16,open:m,PaperProps:b={},slots:y={},slotProps:x={},transformOrigin:C={vertical:"top",horizontal:"left"},TransitionComponent:v,transitionDuration:S="auto",TransitionProps:I={},disableScrollLock:T=!1,...N}=r,O=M.useRef(),F={...r,anchorOrigin:s,anchorReference:l,elevation:h,marginThreshold:p,transformOrigin:C,TransitionComponent:v,transitionDuration:S,TransitionProps:I},B=h_(F),j=M.useCallback(()=>{if(l==="anchorPosition")return a;const ie=Jl(i),me=(ie&&ie.nodeType===1?ie:mn(O.current).body).getBoundingClientRect();return{top:me.top+e1(me,s.vertical),left:me.left+t1(me,s.horizontal)}},[i,s.horizontal,s.vertical,a,l]),D=M.useCallback(ie=>({vertical:e1(ie,C.vertical),horizontal:t1(ie,C.horizontal)}),[C.horizontal,C.vertical]),H=M.useCallback(ie=>{const Z={width:ie.offsetWidth,height:ie.offsetHeight},me=D(Z);if(l==="none")return{top:null,left:null,transformOrigin:n1(me)};const le=j();let ue=le.top-me.vertical,Ie=le.left-me.horizontal;const Ce=ue+Z.height,we=Ie+Z.width,ye=bo(Jl(i)),ze=ye.innerHeight-p,Ne=ye.innerWidth-p;if(p!==null&&ue<p){const nt=ue-p;ue-=nt,me.vertical+=nt}else if(p!==null&&Ce>ze){const nt=Ce-ze;ue-=nt,me.vertical+=nt}if(p!==null&&Ie<p){const nt=Ie-p;Ie-=nt,me.horizontal+=nt}else if(we>Ne){const nt=we-Ne;Ie-=nt,me.horizontal+=nt}return{top:`${Math.round(ue)}px`,left:`${Math.round(Ie)}px`,transformOrigin:n1(me)}},[i,l,j,D,p]),[_,L]=M.useState(m),$=M.useCallback(()=>{const ie=O.current;if(!ie)return;const Z=H(ie);Z.top!==null&&ie.style.setProperty("top",Z.top),Z.left!==null&&(ie.style.left=Z.left),ie.style.transformOrigin=Z.transformOrigin,L(!0)},[H]);M.useEffect(()=>(T&&window.addEventListener("scroll",$),()=>window.removeEventListener("scroll",$)),[i,T,$]);const K=()=>{$()},G=()=>{L(!1)};M.useEffect(()=>{m&&$()}),M.useImperativeHandle(o,()=>m?{updatePosition:()=>{$()}}:null,[m,$]),M.useEffect(()=>{if(!m)return;const ie=Cb(()=>{$()}),Z=bo(Jl(i));return Z.addEventListener("resize",ie),()=>{ie.clear(),Z.removeEventListener("resize",ie)}},[i,m,$]);let q=S;const R={slots:{transition:v,...y},slotProps:{transition:I,paper:b,...x}},[oe,se]=kt("transition",{elementType:el,externalForwardedProps:R,ownerState:F,getSlotProps:ie=>({...ie,onEntering:(Z,me)=>{ie.onEntering?.(Z,me),K()},onExited:Z=>{ie.onExited?.(Z),G()}}),additionalProps:{appear:!0,in:m}});S==="auto"&&!oe.muiSupportAuto&&(q=void 0);const z=f||(i?mn(Jl(i)).body:void 0),[pe,{slots:J,slotProps:Q,...re}]=kt("root",{ref:n,elementType:m_,externalForwardedProps:{...R,...N},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:y.backdrop},slotProps:{backdrop:Eb(typeof x.backdrop=="function"?x.backdrop(F):x.backdrop,{invisible:!0})},container:z,open:m},ownerState:F,className:Ue(B.root,d)}),[ne,ae]=kt("paper",{ref:O,className:B.paper,elementType:R2,externalForwardedProps:R,shouldForwardComponentProp:!0,additionalProps:{elevation:h,style:_?void 0:{opacity:0}},ownerState:F});return c.jsx(pe,{...re,...!hs(pe)&&{slots:J,slotProps:Q,disableScrollLock:T},children:c.jsx(oe,{...se,timeout:q,children:c.jsx(ne,{...ae,children:u})})})});function b_(e){return Ge("MuiMenu",e)}We("MuiMenu",["root","paper","list"]);const y_={vertical:"top",horizontal:"right"},x_={vertical:"top",horizontal:"left"},C_=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"],list:["list"]},b_,t)},E_=fe(g_,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),v_=fe(R2,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),T_=fe(d_,{name:"MuiMenu",slot:"List"})({outline:0}),S_=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:i,className:s,disableAutoFocusItem:a=!1,MenuListProps:l={},onClose:u,open:d,PaperProps:f={},PopoverClasses:h,transitionDuration:p="auto",TransitionProps:{onEntering:m,...b}={},variant:y="selectedMenu",slots:x={},slotProps:C={},...v}=r,S=kr(),I={...r,autoFocus:o,disableAutoFocusItem:a,MenuListProps:l,onEntering:m,PaperProps:f,transitionDuration:p,TransitionProps:b,variant:y},T=C_(I),N=o&&!a&&d,O=M.useRef(null),F=(q,R)=>{O.current&&O.current.adjustStyleForScrollbar(q,{direction:S?"rtl":"ltr"}),m&&m(q,R)},B=q=>{q.key==="Tab"&&(q.preventDefault(),u&&u(q,"tabKeyDown"))};let j=-1;M.Children.map(i,(q,R)=>{M.isValidElement(q)&&(q.props.disabled||(y==="selectedMenu"&&q.props.selected||j===-1)&&(j=R))});const D={slots:x,slotProps:{list:l,transition:b,paper:f,...C}},H=Et({elementType:x.root,externalSlotProps:C.root,ownerState:I,className:[T.root,s]}),[_,L]=kt("paper",{className:T.paper,elementType:v_,externalForwardedProps:D,shouldForwardComponentProp:!0,ownerState:I}),[$,K]=kt("list",{className:Ue(T.list,l.className),elementType:T_,shouldForwardComponentProp:!0,externalForwardedProps:D,getSlotProps:q=>({...q,onKeyDown:R=>{B(R),q.onKeyDown?.(R)}}),ownerState:I}),G=typeof D.slotProps.transition=="function"?D.slotProps.transition(I):D.slotProps.transition;return c.jsx(E_,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?y_:x_,slots:{root:x.root,paper:_,backdrop:x.backdrop,...x.transition&&{transition:x.transition}},slotProps:{root:H,paper:L,backdrop:typeof C.backdrop=="function"?C.backdrop(I):C.backdrop,transition:{...G,onEntering:(...q)=>{F(...q),G?.onEntering?.(...q)}}},open:d,ref:n,transitionDuration:p,ownerState:I,...v,classes:h,children:c.jsx($,{actions:O,autoFocus:o&&(j===-1||a),autoFocusItem:N,variant:y,...K,children:i})})});function k_(e){return Ge("MuiNativeSelect",e)}const Hp=We("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),w_=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:s}=e,a={select:["select",n,r&&"disabled",o&&"multiple",s&&"error"],icon:["icon",`icon${Fe(n)}`,i&&"iconOpen",r&&"disabled"]};return Ke(a,k_,t)},N2=fe("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${Hp.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),D_=fe(N2,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:$n,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${Hp.multiple}`]:t.multiple}]}})({}),F2=fe("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${Hp.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),I_=fe(F2,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Fe(n.variant)}`],n.open&&t.iconOpen]}})({}),A_=M.forwardRef(function(t,n){const{className:r,disabled:o,error:i,IconComponent:s,inputRef:a,variant:l="standard",...u}=t,d={...t,disabled:o,variant:l,error:i},f=w_(d);return c.jsxs(M.Fragment,{children:[c.jsx(D_,{ownerState:d,className:Ue(f.select,r),disabled:o,ref:a||n,...u}),t.multiple?null:c.jsx(I_,{as:s,ownerState:d,className:f.icon})]})});function L2(e){return Ge("MuiSelect",e)}const pa=We("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var r1;const O_=fe(N2,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${pa.select}`]:t.select},{[`&.${pa.select}`]:t[n.variant]},{[`&.${pa.error}`]:t.error},{[`&.${pa.multiple}`]:t.multiple}]}})({[`&.${pa.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),M_=fe(F2,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Fe(n.variant)}`],n.open&&t.iconOpen]}})({}),P_=fe("input",{shouldForwardProp:e=>xb(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function o1(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function R_(e){return e==null||typeof e=="string"&&!e.trim()}const N_=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:s}=e,a={select:["select",n,r&&"disabled",o&&"multiple",s&&"error"],icon:["icon",`icon${Fe(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ke(a,L2,t)},F_=M.forwardRef(function(t,n){const{"aria-describedby":r,"aria-label":o,autoFocus:i,autoWidth:s,children:a,className:l,defaultOpen:u,defaultValue:d,disabled:f,displayEmpty:h,error:p=!1,IconComponent:m,inputRef:b,labelId:y,MenuProps:x={},multiple:C,name:v,onBlur:S,onChange:I,onClose:T,onFocus:N,onOpen:O,open:F,readOnly:B,renderValue:j,required:D,SelectDisplayProps:H={},tabIndex:_,type:L,value:$,variant:K="standard",...G}=t,[q,R]=or({controlled:$,default:d,name:"Select"}),[oe,se]=or({controlled:F,default:u,name:"Select"}),z=M.useRef(null),pe=M.useRef(null),[J,Q]=M.useState(null),{current:re}=M.useRef(F!=null),[ne,ae]=M.useState(),ie=vt(n,b),Z=M.useCallback(be=>{pe.current=be,be&&Q(be)},[]),me=J?.parentNode;M.useImperativeHandle(ie,()=>({focus:()=>{pe.current.focus()},node:z.current,value:q}),[q]),M.useEffect(()=>{u&&oe&&J&&!re&&(ae(s?null:me.clientWidth),pe.current.focus())},[J,s]),M.useEffect(()=>{i&&pe.current.focus()},[i]),M.useEffect(()=>{if(!y)return;const be=mn(pe.current).getElementById(y);if(be){const Ae=()=>{getSelection().isCollapsed&&pe.current.focus()};return be.addEventListener("click",Ae),()=>{be.removeEventListener("click",Ae)}}},[y]);const le=(be,Ae)=>{be?O&&O(Ae):T&&T(Ae),re||(ae(s?null:me.clientWidth),se(be))},ue=be=>{be.button===0&&(be.preventDefault(),pe.current.focus(),le(!0,be))},Ie=be=>{le(!1,be)},Ce=M.Children.toArray(a),we=be=>{const Ae=Ce.find(Oe=>Oe.props.value===be.target.value);Ae!==void 0&&(R(Ae.props.value),I&&I(be,Ae))},ye=be=>Ae=>{let Oe;if(Ae.currentTarget.hasAttribute("tabindex")){if(C){Oe=Array.isArray(q)?q.slice():[];const Qe=q.indexOf(be.props.value);Qe===-1?Oe.push(be.props.value):Oe.splice(Qe,1)}else Oe=be.props.value;if(be.props.onClick&&be.props.onClick(Ae),q!==Oe&&(R(Oe),I)){const Qe=Ae.nativeEvent||Ae,st=new Qe.constructor(Qe.type,Qe);Object.defineProperty(st,"target",{writable:!0,value:{value:Oe,name:v}}),I(st,be)}C||le(!1,Ae)}},ze=be=>{B||[" ","ArrowUp","ArrowDown","Enter"].includes(be.key)&&(be.preventDefault(),le(!0,be))},Ne=J!==null&&oe,nt=be=>{!Ne&&S&&(Object.defineProperty(be,"target",{writable:!0,value:{value:q,name:v}}),S(be))};delete G["aria-invalid"];let _e,Bt;const yt=[];let ot=!1;(Vu({value:q})||h)&&(j?_e=j(q):ot=!0);const xe=Ce.map(be=>{if(!M.isValidElement(be))return null;let Ae;if(C){if(!Array.isArray(q))throw new Error(mo(2));Ae=q.some(Oe=>o1(Oe,be.props.value)),Ae&&ot&&yt.push(be.props.children)}else Ae=o1(q,be.props.value),Ae&&ot&&(Bt=be.props.children);return M.cloneElement(be,{"aria-selected":Ae?"true":"false",onClick:ye(be),onKeyUp:Oe=>{Oe.key===" "&&Oe.preventDefault(),be.props.onKeyUp&&be.props.onKeyUp(Oe)},role:"option",selected:Ae,value:void 0,"data-value":be.props.value})});ot&&(C?yt.length===0?_e=null:_e=yt.reduce((be,Ae,Oe)=>(be.push(Ae),Oe<yt.length-1&&be.push(", "),be),[]):_e=Bt);let Pe=ne;!s&&re&&J&&(Pe=me.clientWidth);let qe;typeof _<"u"?qe=_:qe=f?null:0;const Je=H.id||(v?`mui-component-select-${v}`:void 0),Xe={...t,variant:K,value:q,open:Ne,error:p},Re=N_(Xe),ct={...x.PaperProps,...typeof x.slotProps?.paper=="function"?x.slotProps.paper(Xe):x.slotProps?.paper},lt={...x.MenuListProps,...typeof x.slotProps?.list=="function"?x.slotProps.list(Xe):x.slotProps?.list},Mt=_r();return c.jsxs(M.Fragment,{children:[c.jsx(O_,{as:"div",ref:Z,tabIndex:qe,role:"combobox","aria-controls":Ne?Mt:void 0,"aria-disabled":f?"true":void 0,"aria-expanded":Ne?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[y,Je].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":D?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:ze,onMouseDown:f||B?null:ue,onBlur:nt,onFocus:N,...H,ownerState:Xe,className:Ue(H.className,Re.select,l),id:Je,children:R_(_e)?r1||(r1=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):_e}),c.jsx(P_,{"aria-invalid":p,value:Array.isArray(q)?q.join(","):q,name:v,ref:z,"aria-hidden":!0,onChange:we,tabIndex:-1,disabled:f,className:Re.nativeInput,autoFocus:i,required:D,...G,ownerState:Xe}),c.jsx(M_,{as:m,className:Re.icon,ownerState:Xe}),c.jsx(S_,{id:`menu-${v||""}`,anchorEl:me,open:Ne,onClose:Ie,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...x,slotProps:{...x.slotProps,list:{"aria-labelledby":y,role:"listbox","aria-multiselectable":C?"true":void 0,disableListWrap:!0,id:Mt,...lt},paper:{...ct,style:{minWidth:Pe,...ct!=null?ct.style:null}}},children:xe})]})}),_2=mt(c.jsx("path",{d:"M7 10l5 5 5-5z"})),L_=e=>{const{classes:t}=e,r=Ke({root:["root"]},L2,t);return{...t,...r}},zp={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>$n(e)&&e!=="variant"},__=fe(Bp,zp)(""),B_=fe($p,zp)(""),j_=fe(jp,zp)(""),Yu=M.forwardRef(function(t,n){const r=ut({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:i,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:u=!1,IconComponent:d=_2,id:f,input:h,inputProps:p,label:m,labelId:b,MenuProps:y,multiple:x=!1,native:C=!1,onClose:v,onOpen:S,open:I,renderValue:T,SelectDisplayProps:N,variant:O="outlined",...F}=r,B=C?A_:F_,j=ar(),D=Ei({props:r,muiFormControl:j,states:["variant","error"]}),H=D.variant||O,_={...r,variant:H,classes:s},L=L_(_),{root:$,...K}=L,G=h||{standard:c.jsx(__,{ownerState:_}),outlined:c.jsx(B_,{label:m,ownerState:_}),filled:c.jsx(j_,{ownerState:_})}[H],q=vt(n,Ms(G));return c.jsx(M.Fragment,{children:M.cloneElement(G,{inputComponent:B,inputProps:{children:i,error:D.error,IconComponent:d,variant:H,type:void 0,multiple:x,...C?{id:f}:{autoWidth:o,defaultOpen:l,displayEmpty:u,labelId:b,MenuProps:y,onClose:v,onOpen:S,open:I,renderValue:T,SelectDisplayProps:{id:f,...N}},...p,classes:p?An(K,p.classes):K,...h?h.props.inputProps:{}},...(x&&C||u)&&H==="outlined"?{notched:!0}:{},ref:q,className:Ue(G.props.className,a,L.root),...!h&&{variant:H},...F})})});Yu.muiName="Select";function $_(e){return Ge("MuiTextField",e)}We("MuiTextField",["root"]);const H_={standard:Bp,filled:jp,outlined:$p},z_=e=>{const{classes:t}=e;return Ke({root:["root"]},$_,t)},U_=fe(Wu,{name:"MuiTextField",slot:"Root"})({}),Ct=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:s,className:a,color:l="primary",defaultValue:u,disabled:d=!1,error:f=!1,FormHelperTextProps:h,fullWidth:p=!1,helperText:m,id:b,InputLabelProps:y,inputProps:x,InputProps:C,inputRef:v,label:S,maxRows:I,minRows:T,multiline:N=!1,name:O,onBlur:F,onChange:B,onFocus:j,placeholder:D,required:H=!1,rows:_,select:L=!1,SelectProps:$,slots:K={},slotProps:G={},type:q,value:R,variant:oe="outlined",...se}=r,z={...r,autoFocus:i,color:l,disabled:d,error:f,fullWidth:p,multiline:N,required:H,select:L,variant:oe},pe=z_(z),J=_r(b),Q=m&&J?`${J}-helper-text`:void 0,re=S&&J?`${J}-label`:void 0,ne=H_[oe],ae={slots:K,slotProps:{input:C,inputLabel:y,htmlInput:x,formHelperText:h,select:$,...G}},ie={},Z=ae.slotProps.inputLabel;oe==="outlined"&&(Z&&typeof Z.shrink<"u"&&(ie.notched=Z.shrink),ie.label=S),L&&((!$||!$.native)&&(ie.id=void 0),ie["aria-describedby"]=void 0);const[me,le]=kt("root",{elementType:U_,shouldForwardComponentProp:!0,externalForwardedProps:{...ae,...se},ownerState:z,className:Ue(pe.root,a),ref:n,additionalProps:{disabled:d,error:f,fullWidth:p,required:H,color:l,variant:oe}}),[ue,Ie]=kt("input",{elementType:ne,externalForwardedProps:ae,additionalProps:ie,ownerState:z}),[Ce,we]=kt("inputLabel",{elementType:qu,externalForwardedProps:ae,ownerState:z}),[ye,ze]=kt("htmlInput",{elementType:"input",externalForwardedProps:ae,ownerState:z}),[Ne,nt]=kt("formHelperText",{elementType:O2,externalForwardedProps:ae,ownerState:z}),[_e,Bt]=kt("select",{elementType:Yu,externalForwardedProps:ae,ownerState:z}),yt=c.jsx(ue,{"aria-describedby":Q,autoComplete:o,autoFocus:i,defaultValue:u,fullWidth:p,multiline:N,name:O,rows:_,maxRows:I,minRows:T,type:q,value:R,id:J,inputRef:v,onBlur:F,onChange:B,onFocus:j,placeholder:D,inputProps:ze,slots:{input:K.htmlInput?ye:void 0},...Ie});return c.jsxs(me,{...le,children:[S!=null&&S!==""&&c.jsx(Ce,{htmlFor:J,id:re,...we,children:S}),L?c.jsx(_e,{"aria-describedby":Q,id:J,labelId:re,value:R,input:yt,...Bt,children:s}):yt,m&&c.jsx(Ne,{id:Q,...nt,children:m})]})}),po={postgres:[{label:"Host",name:"host",type:"text",required:!1},{label:"Port",name:"port",type:"number",required:!1},{label:"Database Name",name:"databaseName",type:"text",required:!1},{label:"User Name",name:"userName",type:"text",required:!1},{label:"Password",name:"password",type:"password",required:!1},{label:"Connection String",name:"connectionString",type:"text",required:!1}],bigquery:[{label:"Project ID",name:"defaultProjectId",type:"text",required:!1},{label:"Billing Project ID",name:"billingProjectId",type:"text",required:!1},{label:"Location",name:"location",type:"text",required:!1},{label:"Service Account Key JSON",name:"serviceAccountKeyJson",type:"text",required:!0},{label:"Maximum Bytes Billed",name:"maximumBytesBilled",type:"text",required:!1},{label:"Query Timeout Milliseconds",name:"queryTimeoutMilliseconds",type:"text",required:!1}],snowflake:[{label:"Account",name:"account",type:"text",required:!0},{label:"Username",name:"username",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Role",name:"role",type:"text",required:!1},{label:"Warehouse",name:"warehouse",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"Response Timeout Milliseconds",name:"responseTimeoutMilliseconds",type:"text",required:!1},{label:"Private Key",name:"privateKey",type:"password",required:!1},{label:"Private Key Passphrase",name:"privateKeyPass",type:"password",required:!1}],trino:[{label:"Server",name:"server",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!1},{label:"Catalog",name:"catalog",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Peaka Key",name:"peakaKey",type:"password",required:!1}],databricks:[{label:"Host",name:"host",type:"text",required:!0},{label:"HTTP Path",name:"path",type:"text",required:!0},{label:"Access Token",name:"token",type:"password",required:!1},{label:"OAuth Client ID",name:"oauthClientId",type:"text",required:!1},{label:"OAuth Client Secret",name:"oauthClientSecret",type:"password",required:!1},{label:"Default Catalog",name:"defaultCatalog",type:"text",required:!1},{label:"Default Schema",name:"defaultSchema",type:"text",required:!1}],mysql:[{label:"Host",name:"host",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!0},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!0},{label:"Database",name:"database",type:"text",required:!0}],duckdb:[],motherduck:[{label:"Access Token",name:"accessToken",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1}],ducklake:[],publisher:[]},hu={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",databricks:"databricksConnection",mysql:"mysqlConnection",duckdb:"duckdbConnection",motherduck:"motherduckConnection",ducklake:"ducklakeConnection",publisher:"publisherConnection"},B2=Object.values(De.ConnectionTypeEnum).filter(e=>e!==De.ConnectionTypeEnum.Publisher),Pf={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",gcs:"gcsConnection",s3:"s3Connection",azure:"azureConnection"},tl=[{label:"Access Key ID",name:"accessKeyId",type:"text",required:!0},{label:"Secret Access Key",name:"secretAccessKey",type:"password",required:!0},{label:"Region",name:"region",type:"text",required:!1},{label:"Endpoint",name:"endpoint",type:"text",required:!1},{label:"Session Token",name:"sessionToken",type:"password",required:!1}],nl=[{label:"Key ID",name:"keyId",type:"text",required:!0},{label:"Secret",name:"secret",type:"password",required:!0}],V_=[{label:"Auth Type",name:"authType",type:"text",required:!0,selectOptions:[{label:"SAS Token",value:"sas_token"},{label:"Service Principal (SPN)",value:"service_principal"}]},{label:"SAS URL (e.g. https://account.blob.core.windows.net/container/file.parquet?sp=r&st=...)",name:"sasUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"sas_token"}},{label:"Tenant ID",name:"tenantId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client ID",name:"clientId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client Secret",name:"clientSecret",type:"password",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Account Name",name:"accountName",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"File URL (e.g. abfss://container/path/file.parquet)",name:"fileUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}}];function Ku(e){return e==="postgres"||e==="bigquery"||e==="snowflake"?po[e]||[]:e==="s3"?tl:e==="gcs"?nl:e==="azure"?V_:[]}function W_({onSubmit:e,isSubmitting:t}){const[n,r]=W.useState(!1),[o,i]=W.useState("postgres"),[s,a]=W.useState([]),[l,u]=W.useState("postgres"),[d,f]=W.useState("s3"),h=()=>{r(!0)},p=()=>{r(!1),a([]),i("postgres"),u("postgres"),f("s3")},m=async C=>{C.preventDefault();const v=new FormData(C.currentTarget),S=v.get("name")?.toString(),I=v.get("type")?.toString(),T=po[I];if(!S)throw new Error("Name is required");if(!I)throw new Error("Type is required");let N;if(I==="ducklake"){const O={};if(l==="postgres"){const j=po.postgres,D={};if(j.forEach(H=>{const _=v.get(`ducklake_pg_${H.name}`)?.toString();_&&(D[H.name]=_)}),Object.keys(D).length===0)throw new Error("DuckLake requires catalog connection");O.postgresConnection=D}const F=v.get("ducklake_bucketUrl")?.toString();if(!F)throw new Error("DuckLake requires a bucket URL");const B={bucketUrl:F};if(d==="s3"){const j={};if(tl.forEach(D=>{const H=v.get(`ducklake_s3_${D.name}`)?.toString();H&&(j[D.name]=H)}),!j.accessKeyId)throw new Error("S3 Access Key ID is required");if(!j.secretAccessKey)throw new Error("S3 Secret Access Key is required");Object.keys(j).length>0&&(B.s3Connection=j)}else if(d==="gcs"){const j={};if(nl.forEach(D=>{const H=v.get(`ducklake_gcs_${D.name}`)?.toString();H&&(j[D.name]=H)}),!j.keyId)throw new Error("GCS Key ID is required");if(!j.secret)throw new Error("GCS Secret is required");Object.keys(j).length>0&&(B.gcsConnection=j)}N={name:S,type:I,ducklakeConnection:{catalog:O,storage:B}}}else if(I==="duckdb"){if(s.length===0)throw new Error("DuckDB connection must have at least one attached database");const O=s.map((F,B)=>{const j=F.dbType,D=v.get(`attachedDb_${B}_name`)?.toString();if(!D)throw new Error(`Attached database at index ${B} must have a name`);const H={name:D,type:j},_=Ku(j);if(_&&_.length>0){const L={};_.forEach(K=>{const G=v.get(`attachedDb_${B}_${K.name}`)?.toString();G&&(L[K.name]=G)});const $=Pf[j];$&&(H[$]=L)}return H});N={name:S,type:I,duckdbConnection:{attachedDatabases:O}}}else{const O={};if(T.forEach(F=>{const B=v.get(F.name)?.toString();B&&(O[F.name]=B)}),I==="postgres"){if(!!!O.connectionString?.trim()){const B=["host","port","databaseName","userName","password"];for(const j of B)if(!O[j])throw new Error(`${T.find(D=>D.name===j)?.label||j} is required`)}}else if(I==="bigquery"){if(!O.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(I==="snowflake"){if(!O.account)throw new Error("Account is required");if(!O.username)throw new Error("Username is required");if(!O.warehouse)throw new Error("Warehouse is required");if(!O.password&&!O.privateKey)throw new Error("Either password or private key is required")}else if(I==="trino"){if(!O.server)throw new Error("Server is required");if(!O.user)throw new Error("User is required");if(O.server.trim().startsWith("https://")&&!O.password&&!O.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(I==="mysql"){const F=["host","port","database","user","password"];for(const B of F)if(!O[B])throw new Error(`${T.find(j=>j.name===B)?.label||B} is required`)}else if(I==="motherduck"){if(!O.accessToken)throw new Error("Access Token is required")}else if(I==="databricks"){if(!O.host)throw new Error("Host is required");if(!O.path)throw new Error("HTTP Path is required");const F=O.oauthClientId&&O.oauthClientSecret;if(!O.token&&!F)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}N={name:S,type:I,[hu[I]]:O}}await e(N),p()},b=()=>{a([...s,{name:"",dbType:"postgres"}])},y=C=>{a(s.filter((v,S)=>S!==C))},x=(C,v)=>{const S=[...s];S[C]={...S[C],dbType:v},a(S)};return c.jsxs(W.Fragment,{children:[c.jsx(tn,{variant:"outlined",onClick:h,children:"Add Connection"}),c.jsxs(no,{open:n,onClose:p,children:[c.jsx(Eo,{children:"Create New Connection"}),c.jsxs(oo,{children:[c.jsx(vl,{children:"Add a new connection to query your data database using Malloy."}),c.jsxs("form",{onSubmit:m,id:"connection-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard"}),c.jsx(Ct,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:o,select:!0,onChange:C=>i(C.target.value),children:B2.map(C=>c.jsx(bn,{value:C,children:C},C))}),o==="ducklake"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),c.jsx(Ct,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:l,select:!0,onChange:C=>u(C.target.value),children:c.jsx(bn,{value:"postgres",children:"PostgreSQL"})}),l==="postgres"&&c.jsx(c.Fragment,{children:po.postgres.map(C=>c.jsx(Ct,{margin:"dense",id:`ducklake_pg_${C.name}`,name:`ducklake_pg_${C.name}`,label:C.label,type:C.type,fullWidth:!0,variant:"standard"},`pg_${C.name}`))})]}),c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),c.jsxs(Ct,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:d,select:!0,onChange:C=>f(C.target.value),children:[c.jsx(bn,{value:"s3",children:"S3"}),c.jsx(bn,{value:"gcs",children:"GCS"})]}),c.jsx(Ct,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:d==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard"}),d==="s3"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),tl.map(C=>c.jsx(Ct,{margin:"dense",id:`ducklake_s3_${C.name}`,name:`ducklake_s3_${C.name}`,label:C.label,type:C.type,fullWidth:!0,variant:"standard",required:C.required,placeholder:C.name==="region"?"us-east-1":void 0},`s3_${C.name}`))]}),d==="gcs"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),nl.map(C=>c.jsx(Ct,{margin:"dense",id:`ducklake_gcs_${C.name}`,name:`ducklake_gcs_${C.name}`,label:C.label,type:C.type,fullWidth:!0,variant:"standard",required:C.required},`gcs_${C.name}`))]})]})]}):o==="duckdb"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsx(Dt,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),c.jsx(tn,{startIcon:c.jsx(fl,{}),onClick:b,size:"small",variant:"outlined",children:"Add Database"})]}),s.length===0&&c.jsx(Dt,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),s.map((C,v)=>{const S=Ku(C.dbType);return c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsxs(Dt,{variant:"subtitle2",children:["Database ",v+1]}),c.jsx(Ir,{onClick:()=>y(v),size:"small",color:"error",children:c.jsx(I2,{fontSize:"small"})})]}),c.jsx(Ct,{margin:"dense",required:!0,id:`attachedDb_${v}_name`,name:`attachedDb_${v}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:C.name}),c.jsx(Ct,{margin:"dense",id:`attachedDb_${v}_type`,name:`attachedDb_${v}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:C.dbType,select:!0,onChange:I=>x(v,I.target.value),children:Object.values(De.AttachedDatabaseTypeEnum).map(I=>c.jsx(bn,{value:I,children:I},I))}),S.filter(I=>I.visibleWhen?(C[I.visibleWhen.field]||S.find(N=>N.name===I.visibleWhen?.field)?.selectOptions?.[0]?.value)===I.visibleWhen.value:!0).map(I=>c.jsx(Ct,{margin:"dense",id:`attachedDb_${v}_${I.name}`,name:`attachedDb_${v}_${I.name}`,label:I.label,type:I.selectOptions?void 0:I.type,fullWidth:!0,variant:"standard",required:I.required,select:!!I.selectOptions,defaultValue:I.selectOptions?.[0]?.value,onChange:I.selectOptions?T=>{const N=[...s];N[v]={...N[v],[I.name]:T.target.value},a(N)}:void 0,children:I.selectOptions?.map(T=>c.jsx(bn,{value:T.value,children:T.label},T.value))},I.name))]},v)})]}):po[o].map(C=>c.jsx(Ct,{margin:"dense",id:C.name,name:C.name,label:C.label,type:C.type,fullWidth:!0,variant:"standard",required:C.required},C.name))]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:t,onClick:p,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"connection-form",loading:t,children:"Create Connection"})]})]})]})}function q_({connection:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(""),l=()=>{i(!0)},u=()=>{i(!1),t()};return c.jsxs(W.Fragment,{children:[c.jsxs(bn,{"aria-label":`Delete connection ${e?.name??""}`.trim(),onClick:d=>{d.stopPropagation(),l()},sx:{color:"error.main"},children:[c.jsx(Rp,{sx:{color:"inherit"},children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(Np,{children:"Delete"})]}),c.jsxs(no,{onClose:u,"aria-labelledby":"customized-dialog-title",open:o,children:[c.jsx(Eo,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Connection"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:d=>({position:"absolute",right:8,top:8,color:d.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsx(oo,{dividers:!0,children:c.jsxs(Dt,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),c.jsx(ro,{children:c.jsx(tn,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(),color:"error",children:"Delete"})}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function i1(e){const t=e.duckdbConnection?.attachedDatabases;return!t||t.length===0?[]:t.map(n=>({name:n.name||"",dbType:n.type||"postgres"}))}function s1(e){const t=e.ducklakeConnection;return t&&t.storage?.gcsConnection?"gcs":"s3"}function Y_({connection:e,onSubmit:t,isSubmitting:n,onCloseDialog:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(e.type),[l,u]=W.useState(()=>i1(e)),[d,f]=W.useState("postgres"),[h,p]=W.useState(()=>s1(e)),m=()=>{u(i1(e)),a(e.type),f("postgres"),p(s1(e)),i(!0)},b=()=>{i(!1),r?.()},y=async T=>{T.preventDefault();const N=new FormData(T.currentTarget),O=N.get("name")?.toString(),F=N.get("type")?.toString(),B=po[F];if(!O)throw new Error("Name is required");if(!F)throw new Error("Type is required");let j;if(F==="ducklake"){const D={};if(d==="postgres"){const L=po.postgres,$={};if(L.forEach(K=>{const G=N.get(`ducklake_pg_${K.name}`)?.toString();G&&($[K.name]=G)}),Object.keys($).length===0)throw new Error("DuckLake requires catalog connection");D.postgresConnection=$}const H=N.get("ducklake_bucketUrl")?.toString();if(!H)throw new Error("DuckLake requires a bucket URL");const _={bucketUrl:H};if(h==="s3"){const L={};tl.forEach(K=>{const G=N.get(`ducklake_s3_${K.name}`)?.toString();G&&(L[K.name]=G)});const $=e.ducklakeConnection?.storage?.s3Connection;if($&&(!L.accessKeyId&&$.accessKeyId&&(L.accessKeyId=$.accessKeyId),!L.secretAccessKey&&$.secretAccessKey&&(L.secretAccessKey=$.secretAccessKey)),!L.accessKeyId)throw new Error("S3 Access Key ID is required");if(!L.secretAccessKey)throw new Error("S3 Secret Access Key is required");Object.keys(L).length>0&&(_.s3Connection=L)}else if(h==="gcs"){const L={};nl.forEach(K=>{const G=N.get(`ducklake_gcs_${K.name}`)?.toString();G&&(L[K.name]=G)});const $=e.ducklakeConnection?.storage?.gcsConnection;if($&&(!L.keyId&&$.keyId&&(L.keyId=$.keyId),!L.secret&&$.secret&&(L.secret=$.secret)),!L.keyId)throw new Error("GCS Key ID is required");if(!L.secret)throw new Error("GCS Secret is required");Object.keys(L).length>0&&(_.gcsConnection=L)}j={name:O,type:F,ducklakeConnection:{catalog:D,storage:_}}}else if(F==="duckdb"){if(l.length===0)throw new Error("DuckDB connection must have at least one attached database");const D=l.map((H,_)=>{const L=H.dbType,$=N.get(`attachedDb_${_}_name`)?.toString();if(!$)throw new Error(`Attached database at index ${_} must have a name`);const K={name:$,type:L},G=Ku(L);if(G&&G.length>0){const q={};G.forEach(oe=>{const se=N.get(`attachedDb_${_}_${oe.name}`)?.toString();se&&(q[oe.name]=se)});const R=Pf[L];R&&(K[R]=q)}return K});j={name:O,type:F,duckdbConnection:{attachedDatabases:D}}}else{const D=e[hu[F]]||{},H={};if(B.forEach(_=>{const L=N.get(_.name)?.toString(),$=D[_.name],K=_.type==="password"||_.name==="password"||_.name==="secretAccessKey"||_.name==="secret"||_.name==="accessToken"||_.name==="privateKey";L?H[_.name]=L:K&&$?H[_.name]=$:L!==void 0?H[_.name]=L:$&&(H[_.name]=$)}),F==="postgres"){if(!!!H.connectionString?.trim()){const L=["host","port","databaseName","userName","password"];for(const $ of L)if(!H[$])throw new Error(`${B.find(K=>K.name===$)?.label||$} is required`)}}else if(F==="bigquery"){if(!H.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(F==="snowflake"){if(!H.account)throw new Error("Account is required");if(!H.username)throw new Error("Username is required");if(!H.warehouse)throw new Error("Warehouse is required");if(!H.password&&!H.privateKey)throw new Error("Either password or private key is required")}else if(F==="trino"){if(!H.server)throw new Error("Server is required");if(!H.user)throw new Error("User is required");if(H.server.trim().startsWith("https://")&&!H.password&&!H.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(F==="mysql"){const _=["host","port","database","user","password"];for(const L of _)if(!H[L])throw new Error(`${B.find($=>$.name===L)?.label||L} is required`)}else if(F==="motherduck"){if(!H.accessToken)throw new Error("Access Token is required")}else if(F==="databricks"){if(!H.host)throw new Error("Host is required");if(!H.path)throw new Error("HTTP Path is required");const _=H.oauthClientId&&H.oauthClientSecret;if(!H.token&&!_)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}j={name:O,type:F,[hu[F]]:H}}await t(j),b()},x=()=>{u([...l,{name:"",dbType:"postgres"}])},C=T=>{u(l.filter((N,O)=>O!==T))},v=(T,N)=>{const O=[...l];O[T]={...O[T],dbType:N},u(O)},S=(T,N)=>{const O=e.duckdbConnection?.attachedDatabases;if(!O||!O[T])return"";const F=O[T],B=Pf[F.type||""];return B&&F[B]?F[B][N]??"":""},I=T=>{const N=e.ducklakeConnection;if(!N)return"";if(T.startsWith("pg_")){const O=T.replace("pg_","");return N.catalog?.postgresConnection?.[O]??""}if(T==="bucketUrl")return N.storage?.bucketUrl??"";if(T.startsWith("s3_")){const O=T.replace("s3_","");return N.storage?.s3Connection?.[O]??""}if(T.startsWith("gcs_")){const O=T.replace("gcs_","");return N.storage?.gcsConnection?.[O]??""}return""};return c.jsxs(W.Fragment,{children:[c.jsxs(bn,{"aria-label":`Edit connection ${e?.name??""}`.trim(),onClick:T=>{T.preventDefault(),T.stopPropagation(),m()},children:[c.jsx(Rp,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(Np,{children:"Edit"})]}),c.jsxs(no,{open:o,onClose:b,children:[c.jsx(Eo,{onClick:T=>{T.stopPropagation()},children:"Edit Connection"}),c.jsxs(oo,{onClick:T=>{T.stopPropagation()},children:[c.jsx(vl,{children:"Edit a connection to query your data database using Malloy."}),c.jsxs("form",{onSubmit:y,id:"connection-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),c.jsx(Ct,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:s,select:!0,onChange:T=>a(T.target.value),children:B2.map(T=>c.jsx(bn,{value:T,children:T},T))}),s==="ducklake"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),c.jsx(Ct,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:d,select:!0,onChange:T=>f(T.target.value),children:c.jsx(bn,{value:"postgres",children:"PostgreSQL"})}),d==="postgres"&&c.jsx(c.Fragment,{children:po.postgres.map(T=>c.jsx(Ct,{margin:"dense",id:`ducklake_pg_${T.name}`,name:`ducklake_pg_${T.name}`,label:T.label,type:T.type,fullWidth:!0,variant:"standard",defaultValue:I(`pg_${T.name}`)},`pg_${T.name}`))})]}),c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsx(Dt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),c.jsxs(Ct,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:h,select:!0,onChange:T=>p(T.target.value),children:[c.jsx(bn,{value:"s3",children:"S3"}),c.jsx(bn,{value:"gcs",children:"GCS"})]}),c.jsx(Ct,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:h==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard",defaultValue:I("bucketUrl")}),h==="s3"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),tl.map(T=>c.jsx(Ct,{margin:"dense",id:`ducklake_s3_${T.name}`,name:`ducklake_s3_${T.name}`,label:T.label,type:T.type,fullWidth:!0,variant:"standard",required:T.required&&T.name!=="secretAccessKey",defaultValue:I(`s3_${T.name}`),placeholder:T.name==="region"?"us-east-1":T.name==="secretAccessKey"?"Leave empty to keep existing":void 0},`s3_${T.name}`))]}),h==="gcs"&&c.jsxs(c.Fragment,{children:[c.jsx(Dt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),nl.map(T=>c.jsx(Ct,{margin:"dense",id:`ducklake_gcs_${T.name}`,name:`ducklake_gcs_${T.name}`,label:T.label,type:T.type,fullWidth:!0,variant:"standard",required:T.required&&T.name!=="secret",defaultValue:I(`gcs_${T.name}`),placeholder:T.name==="secret"?"Leave empty to keep existing":void 0},`gcs_${T.name}`))]})]})]}):s==="duckdb"?c.jsxs(Qt,{sx:{mt:2},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsx(Dt,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),c.jsx(tn,{startIcon:c.jsx(fl,{}),onClick:x,size:"small",variant:"outlined",children:"Add Database"})]}),l.length===0&&c.jsx(Dt,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),l.map((T,N)=>{const O=Ku(T.dbType);return c.jsxs(Qt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsxs(Qt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsxs(Dt,{variant:"subtitle2",children:["Database ",N+1]}),c.jsx(Ir,{"aria-label":`Remove attached database ${N+1}`,onClick:()=>C(N),size:"small",color:"error",children:c.jsx(I2,{fontSize:"small"})})]}),c.jsx(Ct,{margin:"dense",required:!0,id:`attachedDb_${N}_name`,name:`attachedDb_${N}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:T.name}),c.jsx(Ct,{margin:"dense",id:`attachedDb_${N}_type`,name:`attachedDb_${N}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:T.dbType,select:!0,onChange:F=>v(N,F.target.value),children:Object.values(De.AttachedDatabaseTypeEnum).map(F=>c.jsx(bn,{value:F,children:F},F))}),O.filter(F=>F.visibleWhen?(T[F.visibleWhen.field]||S(N,F.visibleWhen.field)||O.find(j=>j.name===F.visibleWhen?.field)?.selectOptions?.[0]?.value)===F.visibleWhen.value:!0).map(F=>c.jsx(Ct,{margin:"dense",id:`attachedDb_${N}_${F.name}`,name:`attachedDb_${N}_${F.name}`,label:F.label,type:F.selectOptions?void 0:F.type,fullWidth:!0,variant:"standard",required:F.required,select:!!F.selectOptions,defaultValue:S(N,F.name)||F.selectOptions?.[0]?.value,onChange:F.selectOptions?B=>{const j=[...l];j[N]={...j[N],[F.name]:B.target.value},u(j)}:void 0,children:F.selectOptions?.map(B=>c.jsx(bn,{value:B.value,children:B.label},B.value))},F.name))]},N)})]}):po[s].map(T=>{const N=e?.[hu[s]??""]?.[T.name??""]??"",O=T.type==="password"||T.name==="password"||T.name==="secretAccessKey"||T.name==="secret"||T.name==="accessToken"||T.name==="privateKey";return c.jsx(Ct,{margin:"dense",id:T.name,name:T.name,label:T.label,type:T.type,fullWidth:!0,variant:"standard",required:T.required&&!O&&!N,defaultValue:N,placeholder:O&&N?"Leave empty to keep existing":void 0},T.name)})]})]}),c.jsxs(ro,{onClick:T=>{T.stopPropagation()},children:[c.jsx(tn,{disabled:n,onClick:b,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"connection-form",loading:n,children:"Edit Connection"})]})]})]})}function a1(e,t){return!e||e.type!=="duckdb"?!1:(e.duckdbConnection?.attachedDatabases||[]).some(r=>r.type==="azure"&&r.name===t)}function K_(e){return e.startsWith("gs://")||e.startsWith("s3://")||e.startsWith("https://")||e.startsWith("abfss://")||e.startsWith("az://")}function j2({connectionName:e,resourceUri:t,schema:n,connection:r}){const{apiClients:o}=De.useServer(),{environmentName:i}=Ht(t),[s,a]=W.useState(null),[l,u]=W.useState(n||null),[d,f]=W.useState(!1),{data:h,isError:p,isLoading:m,error:b}=Xt({queryKey:["schemas",i,e],queryFn:()=>o.connections.listSchemas(i,e)}),y=h?.data||[];return c.jsxs(w.Grid,{container:!0,spacing:1,children:[!n&&c.jsx(w.Grid,{size:{xs:12,md:4},children:c.jsxs(w.Paper,{sx:{p:1,m:0},children:[c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[c.jsx(w.Typography,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),c.jsx(w.FormControlLabel,{control:c.jsx(w.Switch,{checked:d,onChange:x=>f(x.target.checked)}),label:"Hidden Schemas"})]}),c.jsx(w.Divider,{sx:{mt:"2px"}}),c.jsxs(w.Box,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[m&&c.jsx(Sn,{text:"Loading schemas..."}),p&&c.jsx(kn,{error:b,context:`${i} > ${e} > Schemas`}),!m&&!p&&y.length===0&&c.jsx(w.Typography,{variant:"body2",children:"No Schemas"}),!m&&!p&&y.length>0&&c.jsx(w.List,{dense:!0,disablePadding:!0,children:y.map(x=>{const C=x.name;if(x.isHidden&&!d)return null;const S=l===C;return c.jsx(w.ListItemButton,{selected:S,onClick:()=>{u(C),a(null)},children:c.jsx(w.ListItemText,{primary:C})},C)})})]})]})}),c.jsx(w.Grid,{size:{xs:12,md:n?6:4},children:l&&c.jsx(w.Paper,{sx:{p:1,m:0},children:c.jsx(X_,{connectionName:e,schemaName:l,onTableSelect:x=>{a(x)},resourceUri:t,connection:r})})}),c.jsx(w.Grid,{size:{xs:12,md:n?6:4},children:l&&s&&c.jsx(G_,{environmentName:i,connectionName:e,schemaName:l,tableResource:s})})]})}function G_({environmentName:e,connectionName:t,schemaName:n,tableResource:r}){const{apiClients:o}=De.useServer(),{data:i,isLoading:s,isError:a,error:l}=Xt({queryKey:["connectionTableDetail",e,t,n,r],queryFn:()=>o.connections.getTable(e,t,n,r),enabled:!!n&&!!r}),u={resource:i?.data?.resource??r,columns:i?.data?.columns??[]};return c.jsxs(w.Paper,{sx:{p:1,m:0},children:[a&&c.jsx(kn,{error:l,context:`${e} > ${t} > ${n} > ${r}`}),!a&&c.jsx(Q_,{table:u,loading:s})]})}function Q_({table:e,loading:t}){return t?c.jsx(Sn,{text:"Loading columns..."}):c.jsxs(c.Fragment,{children:[c.jsxs(w.Typography,{variant:"overline",fontWeight:"bold",sx:{display:"block",wordBreak:"break-all"},children:[e.resource.includes("://")||/\.(parquet|csv|json|tsv|ndjson)$/i.test(e.resource)?"File":"Table",": ",e.resource]}),c.jsx(w.Divider,{}),c.jsx(w.Box,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:c.jsx(w.TableContainer,{children:c.jsxs(w.Table,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"NAME"}),c.jsx(w.TableCell,{children:"TYPE"})]})}),c.jsx(w.TableBody,{children:e.columns?.sort((n,r)=>n.name.localeCompare(r.name))?.map(n=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:n.name}),c.jsx(w.TableCell,{children:n.type})]},n.name))})]})})})]})}function X_({connectionName:e,schemaName:t,onTableSelect:n,resourceUri:r,connection:o}){const{environmentName:i}=Ht(r),{apiClients:s}=De.useServer(),[a,l]=W.useState(""),{data:u,isSuccess:d,isError:f,error:h,isLoading:p}=Xt({queryKey:["tablesInSchema",i,e,t],queryFn:()=>s.connections.listTables(i,e,t)}),m=a1(o,t),b=x=>m?x:x.split(".").pop()||x,y=d&&u?.data?u.data.filter(x=>b(x.resource).toLowerCase().includes(a.toLowerCase())).sort((x,C)=>b(x.resource).localeCompare(b(C.resource))):[];return c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{variant:"overline",fontWeight:"bold",children:K_(t)||a1(o,t)?`Files in ${t}`:`Tables in ${t}`}),c.jsx(w.Divider,{}),c.jsx(w.Box,{sx:{mt:1,mb:1},children:c.jsx(w.TextField,{size:"small",fullWidth:!0,placeholder:"Search tables...",value:a,onChange:x=>l(x.target.value),variant:"outlined"})}),c.jsx(w.Divider,{}),c.jsxs(w.Box,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[p&&c.jsx(Sn,{text:"Fetching Tables..."}),f&&c.jsx(kn,{error:h,context:`${i} > ${e} > ${t}`}),d&&y.length===0&&c.jsx(w.Typography,{variant:"body2",children:"No Tables"}),d&&u?.data&&u.data.length>0&&c.jsx(w.List,{dense:!0,disablePadding:!0,children:y.map(x=>{let C=b(x.resource);return!m&&x.resource.includes("://")&&(C=x.resource.split("/").pop()||x.resource),c.jsx(w.ListItemButton,{onClick:()=>n(x.resource),children:c.jsx(w.ListItemText,{primary:C,secondary:x.columns.length>0?`${x.columns.length} columns`:void 0})},x.resource)})})]})]})}const Z_={bigquery:"BigQuery",snowflake:"Snowflake",postgres:"PostgreSQL",mysql:"MySQL",trino:"Trino",databricks:"Databricks",duckdb:"DuckDB",ducklake:"DuckLake",s3:"S3",gcs:"GCS",azure:"Azure"};function J_(e){return e?Z_[e]??e:""}function e7({resourceUri:e}){const{apiClients:t,mutable:n}=De.useServer(),r=Lr.useQueryClient(),{environmentName:o}=Ht(e),[i,s]=W.useState(""),[a,l]=W.useState(null),u=Cl({environmentName:o,connectionName:a}),{data:d,isSuccess:f,isError:h,error:p}=Xt({queryKey:["connections",o],queryFn:()=>t.connections.listConnections(o)}),m=()=>{l(null)},b=vn({mutationFn:S=>t.environments.updateEnvironment(o,{name:o,connections:[...d.data,S]}),onSuccess(){s("Connection added successfully"),r.invalidateQueries({queryKey:["connections",o]})},onError(S){s(S.message)}}),y=vn({mutationFn:S=>t.environments.updateEnvironment(o,{name:o,connections:d.data.map(I=>I.name===S.name?S:I)}),onSuccess(S,I){s(`Connection ${I.name} updated successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(S){s(S.message)}}),x=vn({mutationFn:S=>t.environments.updateEnvironment(o,{name:o,connections:d.data.filter(I=>I.name!==S.name)}),onSuccess(S,I){s(`Connection ${I.name} deleted successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(S){s(S.message)}}),C=f?[...d.data].sort((S,I)=>(S.name??"").localeCompare(I.name??"")):[],v=b.isPending||y.isPending||x.isPending;return c.jsxs(w.Box,{children:[c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Connections"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Database connections available to packages in this environment"})]}),n&&f&&c.jsx(W_,{onSubmit:S=>b.mutateAsync(S),isSubmitting:b.isPending})]}),!f&&!h&&c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Fetching Connections..."}),h&&c.jsx(kn,{error:p,context:`${o} > Connections`}),f&&C.length===0&&c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"No connections yet."}),f&&C.length>0&&c.jsx(w.Grid,{container:!0,spacing:2,children:C.map(S=>c.jsx(w.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(t7,{connection:S,mutable:n,isMutating:v,onOpenExplorer:()=>l(S.name??null),onEdit:I=>y.mutateAsync(I),onDelete:I=>{S.resource?s("Cannot delete this connection"):x.mutateAsync(I)}})},S.name))}),c.jsx(w.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i}),c.jsxs(w.Dialog,{open:a!==null,onClose:m,maxWidth:"lg",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{children:["Connection Explorer: ",a,c.jsx(w.IconButton,{"aria-label":"close",onClick:m,sx:{position:"absolute",right:8,top:8},children:c.jsx(w.Box,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),c.jsx(w.DialogContent,{children:a&&c.jsx(j2,{resourceUri:u,connectionName:a,connection:d?.data?.find(S=>S.name===a)})})]})]})}function t7({connection:e,mutable:t,isMutating:n,onOpenExplorer:r,onEdit:o,onDelete:i}){const[s,a]=W.useState(null),l=!!s,u=f=>{f.stopPropagation(),a(f.currentTarget)},d=()=>{a(null)};return c.jsx(w.Card,{variant:"outlined",onClick:r,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:c.jsx(w.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(w.Box,{sx:{width:36,height:36,borderRadius:1.5,bgcolor:"warning.light",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"warning.main"},children:c.jsx(TL,{sx:{fontSize:20}})}),c.jsxs(w.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(w.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",noWrap:!0,children:J_(e.type)})]}),t&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small",onClick:u,"aria-label":`Connection actions for ${e.name??""}`.trim(),sx:{flexShrink:0,mt:-.5,mr:-.5},children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:s,open:l,onClose:d,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(Y_,{connection:e,onSubmit:o,isSubmitting:n,onCloseDialog:d}),c.jsx(q_,{connection:e,onCloseDialog:d,isMutating:n,onDelete:()=>i(e)})]})]})]})})})}const n7=mt([c.jsx("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),c.jsx("path",{d:"M9 12h6v2H9z"},"1")]);function r7({resourceUri:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=De.useServer(),i=Lr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},{environmentName:d,packageName:f}=Ht(e),h=vn({mutationFn:()=>o.packages.deletePackage(d,f),onSuccess(){u(),i.invalidateQueries({queryKey:["packages"]}),a("Package deleted successfully")},onError(p){a(p instanceof Error?p.message:"An unknown error occurred")}});return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:l,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Delete"})]}),c.jsxs(no,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[c.jsx(Eo,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Package"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:p=>({position:"absolute",right:8,top:8,color:p.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsx(oo,{dividers:!0,children:c.jsxs(Dt,{gutterBottom:!0,children:['Are you sure you want to delete "',f,'"? This action cannot be undone.']})}),c.jsxs(ro,{children:[c.jsx(tn,{variant:"outlined",onClick:u,style:{borderColor:De.MALLOY_BRAND.teal,color:De.MALLOY_BRAND.teal},children:"Cancel"}),c.jsx(tn,{variant:"contained",autoFocus:!0,onClick:()=>h.mutate(),color:"error",loading:h.isPending,children:"Delete"})]}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function o7({package:e,resourceUri:t,onCloseDialog:n}){const[r,o]=W.useState(!1),{apiClients:i}=De.useServer(),s=Lr.useQueryClient(),[a,l]=W.useState(""),u=()=>{o(!0)},d=()=>{o(!1),n()},{packageName:f,environmentName:h}=Ht(t),p=vn({async mutationFn(b){return i.packages.updatePackage(h,f,{name:f,description:b.description})},onSuccess(){d(),l("Package updated successfully"),s.invalidateQueries({queryKey:["packages",h]})},onError(b){l(b instanceof Error?b.message:"An unknown error occurred")}}),m=b=>{b.preventDefault();const x=new FormData(b.currentTarget).get("description")?.toString();p.mutate({description:x})};return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:u,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Edit"})]}),c.jsxs(no,{open:r,onClose:d,children:[c.jsx(Eo,{children:"Edit Package"}),c.jsxs(oo,{children:[c.jsxs(vl,{children:['Update the details for "',e.name,'".']}),c.jsxs("form",{onSubmit:m,id:"package-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Package Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),c.jsx(Ct,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,defaultValue:e.description,variant:"standard"})]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:p.isPending,onClick:d,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"package-form",loading:p.isPending,children:"Save Changes"})]})]}),c.jsx(w.Snackbar,{open:a!=="",autoHideDuration:6e3,onClose:()=>l(""),message:a})]})}function $2({onSelectPackage:e,resourceUri:t}){const{apiClients:n}=De.useServer(),{environmentName:r}=Ht(t),{data:o,isSuccess:i,isError:s,error:a}=Xt({queryKey:["packages",r],queryFn:()=>n.packages.listPackages(r)});if(s)return c.jsx(kn,{error:a,context:`${r} > Packages`});if(!i)return c.jsx(Sn,{text:"Fetching Packages..."});const l=[...o.data].sort((u,d)=>u.name.localeCompare(d.name));return c.jsx(w.Grid,{container:!0,spacing:2,children:l.map(u=>{const d=Cl({environmentName:r,packageName:u.name});return c.jsx(w.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(i7,{pkg:u,packageResourceUri:d,onSelectPackage:e})},u.name)})})}function i7({pkg:e,packageResourceUri:t,onSelectPackage:n}){const{mutable:r}=De.useServer(),[o,i]=W.useState(null),s=!!o,a=f=>{n(e.name,f)},l=f=>{f.stopPropagation(),i(f.currentTarget)},u=()=>{i(null)},d=e.description??"";return c.jsx(w.Card,{variant:"outlined",onClick:a,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:c.jsx(w.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(w.Box,{sx:f=>({width:36,height:36,borderRadius:1.5,bgcolor:f.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:c.jsx(n7,{sx:{fontSize:20}})}),c.jsxs(w.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(w.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(w.Tooltip,{title:d,followCursor:!0,enterDelay:1e3,children:c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:d})})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small",onClick:l,"aria-label":`Package actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:o,open:s,onClose:u,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(o7,{package:e,resourceUri:t,onCloseDialog:u}),c.jsx(r7,{resourceUri:t,onCloseDialog:u})]})]})]})})})}function s7({onSelectPackage:e,resourceUri:t}){const{mutable:n}=De.useServer(),{environmentName:r}=Ht(t);return W.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"})},[]),c.jsxs(w.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:4,py:3},children:[c.jsxs(w.Box,{sx:{mb:5},children:[c.jsx(w.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:r}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Manage packages and database connections in this environment. Open a package to explore its models and notebooks."})]}),c.jsxs(w.Box,{sx:{mb:5},children:[c.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Packages"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Published packages available for use in this environment"})]}),n&&c.jsx(vL,{resourceUri:t})]}),c.jsx($2,{onSelectPackage:e,resourceUri:t})]}),c.jsx(w.Box,{sx:{mb:5},children:c.jsx(e7,{resourceUri:t})}),c.jsx(w.Box,{sx:{mb:5},children:c.jsx(w2,{resourceUri:t,onClickPackageFile:e})}),c.jsx(EL,{resourceUri:t})]})}const a7=e=>{const t=M.useRef({});return M.useEffect(()=>{t.current=e}),t.current};function l1({array1:e,array2:t,parser:n=r=>r}){return e&&t&&e.length===t.length&&e.every((r,o)=>n(r)===n(t[o]))}function u1(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function l7(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:s=!1}=e;return(a,{inputValue:l,getOptionLabel:u})=>{let d=s?l.trim():l;n&&(d=d.toLowerCase()),t&&(d=u1(d));const f=d?a.filter(h=>{let p=(i||u)(h);return n&&(p=p.toLowerCase()),t&&(p=u1(p)),o==="start"?p.startsWith(d):p.includes(d)}):a;return typeof r=="number"?f.slice(0,r):f}}const u7=l7(),c1=5,c7=e=>e.current!==null&&e.current.parentElement?.contains(document.activeElement),d7=[];function d1(e,t,n,r){if(t||e==null||r)return"";const o=n(e);return typeof o=="string"?o:""}function f7(e){const{unstable_isActiveElementInListbox:t=c7,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:s=!1,clearOnBlur:a=!e.freeSolo,clearOnEscape:l=!1,componentName:u="useAutocomplete",defaultValue:d=e.multiple?d7:null,disableClearable:f=!1,disableCloseOnSelect:h=!1,disabled:p,disabledItemsFocusable:m=!1,disableListWrap:b=!1,filterOptions:y=u7,filterSelectedOptions:x=!1,freeSolo:C=!1,getOptionDisabled:v,getOptionKey:S,getOptionLabel:I=ke=>ke.label??ke,groupBy:T,handleHomeEndKeys:N=!e.freeSolo,id:O,includeInputInList:F=!1,inputValue:B,isOptionEqualToValue:j=(ke,Te)=>ke===Te,multiple:D=!1,onChange:H,onClose:_,onHighlightChange:L,onInputChange:$,onOpen:K,open:G,openOnFocus:q=!1,options:R,readOnly:oe=!1,renderValue:se,selectOnFocus:z=!e.freeSolo,value:pe}=e,J=_r(O);let Q=I;Q=ke=>{const Te=I(ke);return typeof Te!="string"?String(Te):Te};const re=M.useRef(!1),ne=M.useRef(!0),ae=M.useRef(null),ie=M.useRef(null),[Z,me]=M.useState(null),[le,ue]=M.useState(-1),Ie=o?0:-1,Ce=M.useRef(Ie),we=M.useRef(d1(d??pe,D,Q)).current,[ye,ze]=or({controlled:pe,default:d,name:u}),[Ne,nt]=or({controlled:B,default:we,name:u,state:"inputValue"}),[_e,Bt]=M.useState(!1),yt=M.useCallback((ke,Te,Ye)=>{if(!(D?ye.length<Te.length:Te!==null)&&!a)return;const je=d1(Te,D,Q,se);Ne!==je&&(nt(je),$&&$(ke,je,Ye))},[Q,Ne,D,$,nt,a,ye,se]),[ot,xe]=or({controlled:G,default:!1,name:u,state:"open"}),[Pe,qe]=M.useState(!0),Je=!D&&ye!=null&&Ne===Q(ye),Xe=ot&&!oe,Re=Xe?y(R.filter(ke=>!(x&&(D?ye:[ye]).some(Te=>Te!==null&&j(ke,Te)))),{inputValue:Je&&Pe?"":Ne,getOptionLabel:Q}):[],ct=a7({filteredOptions:Re,value:ye,inputValue:Ne});M.useEffect(()=>{const ke=ye!==ct.value;_e&&!ke||C&&!ke||yt(null,ye,"reset")},[ye,yt,_e,ct.value,C]);const lt=ot&&Re.length>0&&!oe,Mt=Ve(ke=>{if(ke===-1)ae.current.focus();else{const Te=se?"data-item-index":"data-tag-index";Z.querySelector(`[${Te}="${ke}"]`).focus()}});M.useEffect(()=>{D&&le>ye.length-1&&(ue(-1),Mt(-1))},[ye,D,le,Mt]);function be(ke,Te){if(!ie.current||ke<0||ke>=Re.length)return-1;let Ye=ke;for(;;){const rt=ie.current.querySelector(`[data-option-index="${Ye}"]`),je=m?!1:!rt||rt.disabled||rt.getAttribute("aria-disabled")==="true";if(rt&&rt.hasAttribute("tabindex")&&!je)return Ye;if(Te==="next"?Ye=(Ye+1)%Re.length:Ye=(Ye-1+Re.length)%Re.length,Ye===ke)return-1}}const Ae=Ve(({event:ke,index:Te,reason:Ye})=>{if(Ce.current=Te,Te===-1?ae.current.removeAttribute("aria-activedescendant"):ae.current.setAttribute("aria-activedescendant",`${J}-option-${Te}`),L&&["mouse","keyboard","touch"].includes(Ye)&&L(ke,Te===-1?null:Re[Te],Ye),!ie.current)return;const rt=ie.current.querySelector(`[role="option"].${n}-focused`);rt&&(rt.classList.remove(`${n}-focused`),rt.classList.remove(`${n}-focusVisible`));let je=ie.current;if(ie.current.getAttribute("role")!=="listbox"&&(je=ie.current.parentElement.querySelector('[role="listbox"]')),!je)return;if(Te===-1){je.scrollTop=0;return}const zt=ie.current.querySelector(`[data-option-index="${Te}"]`);if(zt&&(zt.classList.add(`${n}-focused`),Ye==="keyboard"&&zt.classList.add(`${n}-focusVisible`),je.scrollHeight>je.clientHeight&&Ye!=="mouse"&&Ye!=="touch")){const Wt=zt,Qn=je.clientHeight+je.scrollTop,Di=Wt.offsetTop+Wt.offsetHeight;Di>Qn?je.scrollTop=Di-je.clientHeight:Wt.offsetTop-Wt.offsetHeight*(T?1.3:0)<je.scrollTop&&(je.scrollTop=Wt.offsetTop-Wt.offsetHeight*(T?1.3:0))}}),Oe=Ve(({event:ke,diff:Te,direction:Ye="next",reason:rt})=>{if(!Xe)return;const zt=be((()=>{const Wt=Re.length-1;if(Te==="reset")return Ie;if(Te==="start")return 0;if(Te==="end")return Wt;const Qn=Ce.current+Te;return Qn<0?Qn===-1&&F?-1:b&&Ce.current!==-1||Math.abs(Te)>1?0:Wt:Qn>Wt?Qn===Wt+1&&F?-1:b||Math.abs(Te)>1?Wt:0:Qn})(),Ye);if(Ae({index:zt,reason:rt,event:ke}),r&&Te!=="reset")if(zt===-1)ae.current.value=Ne;else{const Wt=Q(Re[zt]);ae.current.value=Wt,Wt.toLowerCase().indexOf(Ne.toLowerCase())===0&&Ne.length>0&&ae.current.setSelectionRange(Ne.length,Wt.length)}}),Qe=!l1({array1:ct.filteredOptions,array2:Re,parser:Q}),st=()=>{const ke=(Te,Ye)=>{const rt=Te?Q(Te):"",je=Ye?Q(Ye):"";return rt===je};if(Ce.current!==-1&&!l1({array1:ct.filteredOptions,array2:Re,parser:Q})&&ct.inputValue===Ne&&(D?ye.length===ct.value.length&&ct.value.every((Te,Ye)=>Q(ye[Ye])===Q(Te)):ke(ct.value,ye))){const Te=ct.filteredOptions[Ce.current];if(Te)return Re.findIndex(Ye=>Q(Ye)===Q(Te))}return-1},Nt=M.useCallback(()=>{if(!Xe)return;const ke=st();if(ke!==-1){Ce.current=ke;return}const Te=D?ye[0]:ye;if(Re.length===0||Te==null){Oe({diff:"reset"});return}if(ie.current){if(Te!=null){const Ye=Re[Ce.current];if(D&&Ye&&ye.findIndex(je=>j(Ye,je))!==-1)return;const rt=Re.findIndex(je=>j(je,Te));rt===-1?Oe({diff:"reset"}):Ae({index:rt});return}if(Ce.current>=Re.length-1){Ae({index:Re.length-1});return}Ae({index:Ce.current})}},[Re.length,D?!1:ye,x,Oe,Ae,Xe,Ne,D]),Gt=Ve(ke=>{Zd(ie,ke),ke&&Nt()});M.useEffect(()=>{Qe&&Nt()},[Nt,Qe]);const bt=ke=>{ot||(xe(!0),qe(!0),K&&K(ke))},sn=(ke,Te)=>{ot&&(xe(!1),_&&_(ke,Te))},Rn=(ke,Te,Ye,rt)=>{if(D){if(ye.length===Te.length&&ye.every((je,zt)=>je===Te[zt]))return}else if(ye===Te)return;H&&H(ke,Te,Ye,rt),ze(Te)},jt=M.useRef(!1),gn=(ke,Te,Ye="selectOption",rt="options")=>{let je=Ye,zt=Te;if(D){zt=Array.isArray(ye)?ye.slice():[];const Wt=zt.findIndex(Qn=>j(Te,Qn));Wt===-1?zt.push(Te):rt!=="freeSolo"&&(zt.splice(Wt,1),je="removeOption")}yt(ke,zt,je),Rn(ke,zt,je,{option:Te}),!h&&(!ke||!ke.ctrlKey&&!ke.metaKey)&&sn(ke,je),(s===!0||s==="touch"&&jt.current||s==="mouse"&&!jt.current)&&ae.current.blur()};function lr(ke,Te){if(ke===-1)return-1;let Ye=ke;for(;;){if(Te==="next"&&Ye===ye.length||Te==="previous"&&Ye===-1)return-1;const rt=se?"data-item-index":"data-tag-index",je=Z.querySelector(`[${rt}="${Ye}"]`);if(!je||!je.hasAttribute("tabindex")||je.disabled||je.getAttribute("aria-disabled")==="true")Ye+=Te==="next"?1:-1;else return Ye}}const Nn=(ke,Te)=>{if(!D)return;Ne===""&&sn(ke,"toggleInput");let Ye=le;le===-1?Ne===""&&Te==="previous"&&(Ye=ye.length-1):(Ye+=Te==="next"?1:-1,Ye<0&&(Ye=0),Ye===ye.length&&(Ye=-1)),Ye=lr(Ye,Te),ue(Ye),Mt(Ye)},jr=ke=>{re.current=!0,nt(""),$&&$(ke,"","clear"),Rn(ke,D?[]:null,"clear")},Hn=ke=>Te=>{if(ke.onKeyDown&&ke.onKeyDown(Te),!Te.defaultMuiPrevented&&(le!==-1&&!["ArrowLeft","ArrowRight"].includes(Te.key)&&(ue(-1),Mt(-1)),Te.which!==229))switch(Te.key){case"Home":Xe&&N&&(Te.preventDefault(),Oe({diff:"start",direction:"next",reason:"keyboard",event:Te}));break;case"End":Xe&&N&&(Te.preventDefault(),Oe({diff:"end",direction:"previous",reason:"keyboard",event:Te}));break;case"PageUp":Te.preventDefault(),Oe({diff:-c1,direction:"previous",reason:"keyboard",event:Te}),bt(Te);break;case"PageDown":Te.preventDefault(),Oe({diff:c1,direction:"next",reason:"keyboard",event:Te}),bt(Te);break;case"ArrowDown":Te.preventDefault(),Oe({diff:1,direction:"next",reason:"keyboard",event:Te}),bt(Te);break;case"ArrowUp":Te.preventDefault(),Oe({diff:-1,direction:"previous",reason:"keyboard",event:Te}),bt(Te);break;case"ArrowLeft":!D&&se?Mt(0):Nn(Te,"previous");break;case"ArrowRight":!D&&se?Mt(-1):Nn(Te,"next");break;case"Enter":if(Ce.current!==-1&&Xe){const Ye=Re[Ce.current],rt=v?v(Ye):!1;if(Te.preventDefault(),rt)return;gn(Te,Ye,"selectOption"),r&&ae.current.setSelectionRange(ae.current.value.length,ae.current.value.length)}else C&&Ne!==""&&Je===!1&&(D&&Te.preventDefault(),gn(Te,Ne,"createOption","freeSolo"));break;case"Escape":Xe?(Te.preventDefault(),Te.stopPropagation(),sn(Te,"escape")):l&&(Ne!==""||D&&ye.length>0||se)&&(Te.preventDefault(),Te.stopPropagation(),jr(Te));break;case"Backspace":if(D&&!oe&&Ne===""&&ye.length>0){const Ye=le===-1?ye.length-1:le,rt=ye.slice();rt.splice(Ye,1),Rn(Te,rt,"removeOption",{option:ye[Ye]})}!D&&se&&!oe&&(ze(null),Mt(-1));break;case"Delete":if(D&&!oe&&Ne===""&&ye.length>0&&le!==-1){const Ye=le,rt=ye.slice();rt.splice(Ye,1),Rn(Te,rt,"removeOption",{option:ye[Ye]})}!D&&se&&!oe&&(ze(null),Mt(-1));break}},Pt=ke=>{Bt(!0),q&&!re.current&&bt(ke)},xn=ke=>{if(t(ie)){ae.current.focus();return}Bt(!1),ne.current=!0,re.current=!1,i&&Ce.current!==-1&&Xe?gn(ke,Re[Ce.current],"blur"):i&&C&&Ne!==""?gn(ke,Ne,"blur","freeSolo"):a&&yt(ke,ye,"blur"),sn(ke,"blur")},To=ke=>{const Te=ke.target.value;Ne!==Te&&(nt(Te),qe(!1),$&&$(ke,Te,"input")),Te===""?!f&&!D&&Rn(ke,null,"clear"):bt(ke)},ki=ke=>{const Te=Number(ke.currentTarget.getAttribute("data-option-index"));Ce.current!==Te&&Ae({event:ke,index:Te,reason:"mouse"})},wn=ke=>{Ae({event:ke,index:Number(ke.currentTarget.getAttribute("data-option-index")),reason:"touch"}),jt.current=!0},$o=ke=>{const Te=Number(ke.currentTarget.getAttribute("data-option-index"));gn(ke,Re[Te],"selectOption"),jt.current=!1},wi=ke=>Te=>{const Ye=ye.slice();Ye.splice(ke,1),Rn(Te,Ye,"removeOption",{option:ye[ke]})},So=ke=>{Rn(ke,null,"removeOption",{option:ye})},nn=ke=>{ot?sn(ke,"toggleInput"):bt(ke)},rn=ke=>{ke.currentTarget.contains(ke.target)&&ke.target.getAttribute("id")!==J&&ke.preventDefault()},Ar=ke=>{ke.currentTarget.contains(ke.target)&&(ae.current.focus(),z&&ne.current&&ae.current.selectionEnd-ae.current.selectionStart===0&&ae.current.select(),ne.current=!1)},Ho=ke=>{!p&&(Ne===""||!ot)&&nn(ke)};let ko=C&&Ne.length>0;ko=ko||(D?ye.length>0:ye!==null);let zo=Re;return T&&(zo=Re.reduce((ke,Te,Ye)=>{const rt=T(Te);return ke.length>0&&ke[ke.length-1].group===rt?ke[ke.length-1].options.push(Te):ke.push({key:Ye,index:Ye,group:rt,options:[Te]}),ke},[])),p&&_e&&xn(),{getRootProps:(ke={})=>({...ke,onKeyDown:Hn(ke),onMouseDown:rn,onClick:Ar}),getInputLabelProps:()=>({id:`${J}-label`,htmlFor:J}),getInputProps:()=>({id:J,value:Ne,onBlur:xn,onFocus:Pt,onChange:To,onMouseDown:Ho,"aria-activedescendant":Xe?"":null,"aria-autocomplete":r?"both":"list","aria-controls":lt?`${J}-listbox`:void 0,"aria-expanded":lt,autoComplete:"off",ref:ae,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:p}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:jr}),getItemProps:({index:ke=0}={})=>({...D&&{key:ke},...se?{"data-item-index":ke}:{"data-tag-index":ke},tabIndex:-1,...!oe&&{onDelete:D?wi(ke):So}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:nn}),getTagProps:({index:ke})=>({key:ke,"data-tag-index":ke,tabIndex:-1,...!oe&&{onDelete:wi(ke)}}),getListboxProps:()=>({role:"listbox",id:`${J}-listbox`,"aria-labelledby":`${J}-label`,ref:Gt,onMouseDown:ke=>{ke.preventDefault()}}),getOptionProps:({index:ke,option:Te})=>{const Ye=(D?ye:[ye]).some(je=>je!=null&&j(Te,je)),rt=v?v(Te):!1;return{key:S?.(Te)??Q(Te),tabIndex:-1,role:"option",id:`${J}-option-${ke}`,onMouseMove:ki,onClick:$o,onTouchStart:wn,"data-option-index":ke,"aria-disabled":rt,"aria-selected":Ye}},id:J,inputValue:Ne,value:ye,dirty:ko,expanded:Xe&&Z,popupOpen:Xe,focused:_e||le!==-1,anchorEl:Z,setAnchorEl:me,focusedItem:le,focusedTag:le,groupedOptions:zo}}var qn="top",Cr="bottom",Er="right",Yn="left",Up="auto",Tl=[qn,Cr,Er,Yn],gs="start",rl="end",p7="clippingParents",H2="viewport",ha="popper",h7="reference",f1=Tl.reduce(function(e,t){return e.concat([t+"-"+gs,t+"-"+rl])},[]),z2=[].concat(Tl,[Up]).reduce(function(e,t){return e.concat([t,t+"-"+gs,t+"-"+rl])},[]),m7="beforeRead",g7="read",b7="afterRead",y7="beforeMain",x7="main",C7="afterMain",E7="beforeWrite",v7="write",T7="afterWrite",S7=[m7,g7,b7,y7,x7,C7,E7,v7,T7];function Xr(e){return e?(e.nodeName||"").toLowerCase():null}function sr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function mi(e){var t=sr(e).Element;return e instanceof t||e instanceof Element}function yr(e){var t=sr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Vp(e){if(typeof ShadowRoot>"u")return!1;var t=sr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function k7(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!yr(i)||!Xr(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function w7(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!yr(o)||!Xr(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const D7={name:"applyStyles",enabled:!0,phase:"write",fn:k7,effect:w7,requires:["computeStyles"]};function Qr(e){return e.split("-")[0]}var li=Math.max,Gu=Math.min,bs=Math.round;function Rf(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function U2(){return!/^((?!chrome|android).)*safari/i.test(Rf())}function ys(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&yr(e)&&(o=e.offsetWidth>0&&bs(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&bs(r.height)/e.offsetHeight||1);var s=mi(e)?sr(e):window,a=s.visualViewport,l=!U2()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/o,d=(r.top+(l&&a?a.offsetTop:0))/i,f=r.width/o,h=r.height/i;return{width:f,height:h,top:d,right:u+f,bottom:d+h,left:u,x:u,y:d}}function Wp(e){var t=ys(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function V2(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Vp(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function yo(e){return sr(e).getComputedStyle(e)}function I7(e){return["table","td","th"].indexOf(Xr(e))>=0}function jo(e){return((mi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Oc(e){return Xr(e)==="html"?e:e.assignedSlot||e.parentNode||(Vp(e)?e.host:null)||jo(e)}function p1(e){return!yr(e)||yo(e).position==="fixed"?null:e.offsetParent}function A7(e){var t=/firefox/i.test(Rf()),n=/Trident/i.test(Rf());if(n&&yr(e)){var r=yo(e);if(r.position==="fixed")return null}var o=Oc(e);for(Vp(o)&&(o=o.host);yr(o)&&["html","body"].indexOf(Xr(o))<0;){var i=yo(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Sl(e){for(var t=sr(e),n=p1(e);n&&I7(n)&&yo(n).position==="static";)n=p1(n);return n&&(Xr(n)==="html"||Xr(n)==="body"&&yo(n).position==="static")?t:n||A7(e)||t}function qp(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Va(e,t,n){return li(e,Gu(t,n))}function O7(e,t,n){var r=Va(e,t,n);return r>n?n:r}function W2(){return{top:0,right:0,bottom:0,left:0}}function q2(e){return Object.assign({},W2(),e)}function Y2(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var M7=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,q2(typeof t!="number"?t:Y2(t,Tl))};function P7(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Qr(n.placement),l=qp(a),u=[Yn,Er].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!s)){var f=M7(o.padding,n),h=Wp(i),p=l==="y"?qn:Yn,m=l==="y"?Cr:Er,b=n.rects.reference[d]+n.rects.reference[l]-s[l]-n.rects.popper[d],y=s[l]-n.rects.reference[l],x=Sl(i),C=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,v=b/2-y/2,S=f[p],I=C-h[d]-f[m],T=C/2-h[d]/2+v,N=Va(S,T,I),O=l;n.modifiersData[r]=(t={},t[O]=N,t.centerOffset=N-T,t)}}function R7(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||V2(t.elements.popper,o)&&(t.elements.arrow=o))}const N7={name:"arrow",enabled:!0,phase:"main",fn:P7,effect:R7,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xs(e){return e.split("-")[1]}var F7={top:"auto",right:"auto",bottom:"auto",left:"auto"};function L7(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:bs(n*o)/o||0,y:bs(r*o)/o||0}}function h1(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,h=s.x,p=h===void 0?0:h,m=s.y,b=m===void 0?0:m,y=typeof d=="function"?d({x:p,y:b}):{x:p,y:b};p=y.x,b=y.y;var x=s.hasOwnProperty("x"),C=s.hasOwnProperty("y"),v=Yn,S=qn,I=window;if(u){var T=Sl(n),N="clientHeight",O="clientWidth";if(T===sr(n)&&(T=jo(n),yo(T).position!=="static"&&a==="absolute"&&(N="scrollHeight",O="scrollWidth")),T=T,o===qn||(o===Yn||o===Er)&&i===rl){S=Cr;var F=f&&T===I&&I.visualViewport?I.visualViewport.height:T[N];b-=F-r.height,b*=l?1:-1}if(o===Yn||(o===qn||o===Cr)&&i===rl){v=Er;var B=f&&T===I&&I.visualViewport?I.visualViewport.width:T[O];p-=B-r.width,p*=l?1:-1}}var j=Object.assign({position:a},u&&F7),D=d===!0?L7({x:p,y:b},sr(n)):{x:p,y:b};if(p=D.x,b=D.y,l){var H;return Object.assign({},j,(H={},H[S]=C?"0":"",H[v]=x?"0":"",H.transform=(I.devicePixelRatio||1)<=1?"translate("+p+"px, "+b+"px)":"translate3d("+p+"px, "+b+"px, 0)",H))}return Object.assign({},j,(t={},t[S]=C?b+"px":"",t[v]=x?p+"px":"",t.transform="",t))}function _7(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:Qr(t.placement),variation:xs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,h1(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,h1(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const B7={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_7,data:{}};var eu={passive:!0};function j7(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=sr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,eu)}),a&&l.addEventListener("resize",n.update,eu),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,eu)}),a&&l.removeEventListener("resize",n.update,eu)}}const $7={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:j7,data:{}};var H7={left:"right",right:"left",bottom:"top",top:"bottom"};function mu(e){return e.replace(/left|right|bottom|top/g,function(t){return H7[t]})}var z7={start:"end",end:"start"};function m1(e){return e.replace(/start|end/g,function(t){return z7[t]})}function Yp(e){var t=sr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Kp(e){return ys(jo(e)).left+Yp(e).scrollLeft}function U7(e,t){var n=sr(e),r=jo(e),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var u=U2();(u||!u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Kp(e),y:l}}function V7(e){var t,n=jo(e),r=Yp(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=li(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=li(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Kp(e),l=-r.scrollTop;return yo(o||n).direction==="rtl"&&(a+=li(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Gp(e){var t=yo(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function K2(e){return["html","body","#document"].indexOf(Xr(e))>=0?e.ownerDocument.body:yr(e)&&Gp(e)?e:K2(Oc(e))}function Wa(e,t){var n;t===void 0&&(t=[]);var r=K2(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=sr(r),s=o?[i].concat(i.visualViewport||[],Gp(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(Wa(Oc(s)))}function Nf(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function W7(e,t){var n=ys(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function g1(e,t,n){return t===H2?Nf(U7(e,n)):mi(t)?W7(t,n):Nf(V7(jo(e)))}function q7(e){var t=Wa(Oc(e)),n=["absolute","fixed"].indexOf(yo(e).position)>=0,r=n&&yr(e)?Sl(e):e;return mi(r)?t.filter(function(o){return mi(o)&&V2(o,r)&&Xr(o)!=="body"}):[]}function Y7(e,t,n,r){var o=t==="clippingParents"?q7(e):[].concat(t),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,u){var d=g1(e,u,r);return l.top=li(d.top,l.top),l.right=Gu(d.right,l.right),l.bottom=Gu(d.bottom,l.bottom),l.left=li(d.left,l.left),l},g1(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function G2(e){var t=e.reference,n=e.element,r=e.placement,o=r?Qr(r):null,i=r?xs(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(o){case qn:l={x:s,y:t.y-n.height};break;case Cr:l={x:s,y:t.y+t.height};break;case Er:l={x:t.x+t.width,y:a};break;case Yn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=o?qp(o):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case gs:l[u]=l[u]-(t[d]/2-n[d]/2);break;case rl:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function ol(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,s=i===void 0?e.strategy:i,a=n.boundary,l=a===void 0?p7:a,u=n.rootBoundary,d=u===void 0?H2:u,f=n.elementContext,h=f===void 0?ha:f,p=n.altBoundary,m=p===void 0?!1:p,b=n.padding,y=b===void 0?0:b,x=q2(typeof y!="number"?y:Y2(y,Tl)),C=h===ha?h7:ha,v=e.rects.popper,S=e.elements[m?C:h],I=Y7(mi(S)?S:S.contextElement||jo(e.elements.popper),l,d,s),T=ys(e.elements.reference),N=G2({reference:T,element:v,placement:o}),O=Nf(Object.assign({},v,N)),F=h===ha?O:T,B={top:I.top-F.top+x.top,bottom:F.bottom-I.bottom+x.bottom,left:I.left-F.left+x.left,right:F.right-I.right+x.right},j=e.modifiersData.offset;if(h===ha&&j){var D=j[o];Object.keys(B).forEach(function(H){var _=[Er,Cr].indexOf(H)>=0?1:-1,L=[qn,Cr].indexOf(H)>=0?"y":"x";B[H]+=D[L]*_})}return B}function K7(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?z2:l,d=xs(r),f=d?a?f1:f1.filter(function(m){return xs(m)===d}):Tl,h=f.filter(function(m){return u.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,b){return m[b]=ol(e,{placement:b,boundary:o,rootBoundary:i,padding:s})[Qr(b)],m},{});return Object.keys(p).sort(function(m,b){return p[m]-p[b]})}function G7(e){if(Qr(e)===Up)return[];var t=mu(e);return[m1(e),t,m1(t)]}function Q7(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,b=n.allowedAutoPlacements,y=t.options.placement,x=Qr(y),C=x===y,v=l||(C||!m?[mu(y)]:G7(y)),S=[y].concat(v).reduce(function(pe,J){return pe.concat(Qr(J)===Up?K7(t,{placement:J,boundary:d,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:b}):J)},[]),I=t.rects.reference,T=t.rects.popper,N=new Map,O=!0,F=S[0],B=0;B<S.length;B++){var j=S[B],D=Qr(j),H=xs(j)===gs,_=[qn,Cr].indexOf(D)>=0,L=_?"width":"height",$=ol(t,{placement:j,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),K=_?H?Er:Yn:H?Cr:qn;I[L]>T[L]&&(K=mu(K));var G=mu(K),q=[];if(i&&q.push($[D]<=0),a&&q.push($[K]<=0,$[G]<=0),q.every(function(pe){return pe})){F=j,O=!1;break}N.set(j,q)}if(O)for(var R=m?3:1,oe=function(J){var Q=S.find(function(re){var ne=N.get(re);if(ne)return ne.slice(0,J).every(function(ae){return ae})});if(Q)return F=Q,"break"},se=R;se>0;se--){var z=oe(se);if(z==="break")break}t.placement!==F&&(t.modifiersData[r]._skip=!0,t.placement=F,t.reset=!0)}}const X7={name:"flip",enabled:!0,phase:"main",fn:Q7,requiresIfExists:["offset"],data:{_skip:!1}};function b1(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function y1(e){return[qn,Er,Cr,Yn].some(function(t){return e[t]>=0})}function Z7(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=ol(t,{elementContext:"reference"}),a=ol(t,{altBoundary:!0}),l=b1(s,r),u=b1(a,o,i),d=y1(l),f=y1(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const J7={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Z7};function e9(e,t,n){var r=Qr(e),o=[Yn,qn].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Yn,Er].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function t9(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,s=z2.reduce(function(d,f){return d[f]=e9(f,t.rects,i),d},{}),a=s[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const n9={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:t9};function r9(e){var t=e.state,n=e.name;t.modifiersData[n]=G2({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const o9={name:"popperOffsets",enabled:!0,phase:"read",fn:r9,data:{}};function i9(e){return e==="x"?"y":"x"}function s9(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,b=m===void 0?0:m,y=ol(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:d}),x=Qr(t.placement),C=xs(t.placement),v=!C,S=qp(x),I=i9(S),T=t.modifiersData.popperOffsets,N=t.rects.reference,O=t.rects.popper,F=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,B=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(T){if(i){var H,_=S==="y"?qn:Yn,L=S==="y"?Cr:Er,$=S==="y"?"height":"width",K=T[S],G=K+y[_],q=K-y[L],R=p?-O[$]/2:0,oe=C===gs?N[$]:O[$],se=C===gs?-O[$]:-N[$],z=t.elements.arrow,pe=p&&z?Wp(z):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:W2(),Q=J[_],re=J[L],ne=Va(0,N[$],pe[$]),ae=v?N[$]/2-R-ne-Q-B.mainAxis:oe-ne-Q-B.mainAxis,ie=v?-N[$]/2+R+ne+re+B.mainAxis:se+ne+re+B.mainAxis,Z=t.elements.arrow&&Sl(t.elements.arrow),me=Z?S==="y"?Z.clientTop||0:Z.clientLeft||0:0,le=(H=j?.[S])!=null?H:0,ue=K+ae-le-me,Ie=K+ie-le,Ce=Va(p?Gu(G,ue):G,K,p?li(q,Ie):q);T[S]=Ce,D[S]=Ce-K}if(a){var we,ye=S==="x"?qn:Yn,ze=S==="x"?Cr:Er,Ne=T[I],nt=I==="y"?"height":"width",_e=Ne+y[ye],Bt=Ne-y[ze],yt=[qn,Yn].indexOf(x)!==-1,ot=(we=j?.[I])!=null?we:0,xe=yt?_e:Ne-N[nt]-O[nt]-ot+B.altAxis,Pe=yt?Ne+N[nt]+O[nt]-ot-B.altAxis:Bt,qe=p&&yt?O7(xe,Ne,Pe):Va(p?xe:_e,Ne,p?Pe:Bt);T[I]=qe,D[I]=qe-Ne}t.modifiersData[r]=D}}const a9={name:"preventOverflow",enabled:!0,phase:"main",fn:s9,requiresIfExists:["offset"]};function l9(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function u9(e){return e===sr(e)||!yr(e)?Yp(e):l9(e)}function c9(e){var t=e.getBoundingClientRect(),n=bs(t.width)/e.offsetWidth||1,r=bs(t.height)/e.offsetHeight||1;return n!==1||r!==1}function d9(e,t,n){n===void 0&&(n=!1);var r=yr(t),o=yr(t)&&c9(t),i=jo(t),s=ys(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Xr(t)!=="body"||Gp(i))&&(a=u9(t)),yr(t)?(l=ys(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Kp(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function f9(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function p9(e){var t=f9(e);return S7.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function h9(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function m9(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var x1={placement:"bottom",modifiers:[],strategy:"absolute"};function C1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function g9(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,i=o===void 0?x1:o;return function(a,l,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},x1,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],h=!1,p={state:d,setOptions:function(x){var C=typeof x=="function"?x(d.options):x;b(),d.options=Object.assign({},i,d.options,C),d.scrollParents={reference:mi(a)?Wa(a):a.contextElement?Wa(a.contextElement):[],popper:Wa(l)};var v=p9(m9([].concat(r,d.options.modifiers)));return d.orderedModifiers=v.filter(function(S){return S.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var x=d.elements,C=x.reference,v=x.popper;if(C1(C,v)){d.rects={reference:d9(C,Sl(v),d.options.strategy==="fixed"),popper:Wp(v)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(B){return d.modifiersData[B.name]=Object.assign({},B.data)});for(var S=0;S<d.orderedModifiers.length;S++){if(d.reset===!0){d.reset=!1,S=-1;continue}var I=d.orderedModifiers[S],T=I.fn,N=I.options,O=N===void 0?{}:N,F=I.name;typeof T=="function"&&(d=T({state:d,options:O,name:F,instance:p})||d)}}}},update:h9(function(){return new Promise(function(y){p.forceUpdate(),y(d)})}),destroy:function(){b(),h=!0}};if(!C1(a,l))return p;p.setOptions(u).then(function(y){!h&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){d.orderedModifiers.forEach(function(y){var x=y.name,C=y.options,v=C===void 0?{}:C,S=y.effect;if(typeof S=="function"){var I=S({state:d,name:x,instance:p,options:v}),T=function(){};f.push(I||T)}})}function b(){f.forEach(function(y){return y()}),f=[]}return p}}var b9=[$7,o9,B7,D7,n9,X7,a9,N7,J7],y9=g9({defaultModifiers:b9});function x9(e){return Ge("MuiPopper",e)}We("MuiPopper",["root"]);function C9(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function Ff(e){return typeof e=="function"?e():e}function E9(e){return e.nodeType!==void 0}const v9=e=>{const{classes:t}=e;return Ke({root:["root"]},x9,t)},T9={},S9=M.forwardRef(function(t,n){const{anchorEl:r,children:o,direction:i,disablePortal:s,modifiers:a,open:l,placement:u,popperOptions:d,popperRef:f,slotProps:h={},slots:p={},TransitionProps:m,ownerState:b,...y}=t,x=M.useRef(null),C=vt(x,n),v=M.useRef(null),S=vt(v,f),I=M.useRef(S);yn(()=>{I.current=S},[S]),M.useImperativeHandle(f,()=>v.current,[]);const T=C9(u,i),[N,O]=M.useState(T),[F,B]=M.useState(Ff(r));M.useEffect(()=>{v.current&&v.current.forceUpdate()}),M.useEffect(()=>{r&&B(Ff(r))},[r]),yn(()=>{if(!F||!l)return;const L=G=>{O(G.placement)};let $=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:G})=>{L(G)}}];a!=null&&($=$.concat(a)),d&&d.modifiers!=null&&($=$.concat(d.modifiers));const K=y9(F,x.current,{placement:T,...d,modifiers:$});return I.current(K),()=>{K.destroy(),I.current(null)}},[F,s,a,l,d,T]);const j={placement:N};m!==null&&(j.TransitionProps=m);const D=v9(t),H=p.root??"div",_=Et({elementType:H,externalSlotProps:h.root,externalForwardedProps:y,additionalProps:{role:"tooltip",ref:C},ownerState:t,className:D.root});return c.jsx(H,{..._,children:typeof o=="function"?o(j):o})}),k9=M.forwardRef(function(t,n){const{anchorEl:r,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:u,open:d,placement:f="bottom",popperOptions:h=T9,popperRef:p,style:m,transition:b=!1,slotProps:y={},slots:x={},...C}=t,[v,S]=M.useState(!0),I=()=>{S(!1)},T=()=>{S(!0)};if(!l&&!d&&(!b||v))return null;let N;if(i)N=i;else if(r){const B=Ff(r);N=B&&E9(B)?mn(B).body:mn(null).body}const O=!d&&l&&(!b||v)?"none":void 0,F=b?{in:d,onEnter:I,onExited:T}:void 0;return c.jsx(m2,{disablePortal:a,container:N,children:c.jsx(S9,{anchorEl:r,direction:s,disablePortal:a,modifiers:u,ref:n,open:b?!v:d,placement:f,popperOptions:h,popperRef:p,slotProps:y,slots:x,...C,style:{position:"fixed",top:0,left:0,display:O,...m},TransitionProps:F,children:o})})}),w9=fe(k9,{name:"MuiPopper",slot:"Root"})({}),Qp=M.forwardRef(function(t,n){const r=kr(),o=ut({props:t,name:"MuiPopper"}),{anchorEl:i,component:s,components:a,componentsProps:l,container:u,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:m,popperOptions:b,popperRef:y,transition:x,slots:C,slotProps:v,...S}=o,I=C?.root??a?.Root,T={anchorEl:i,container:u,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:m,popperOptions:b,popperRef:y,transition:x,...S};return c.jsx(w9,{as:s,direction:r?"rtl":"ltr",slots:{root:I},slotProps:v??l,...T,ref:n})});function D9(e){return Ge("MuiListSubheader",e)}We("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const I9=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:i}=e,s={root:["root",n!=="default"&&`color${Fe(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Ke(s,D9,t)},A9=fe("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${Fe(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(ft(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),Lf=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListSubheader"}),{className:o,color:i="default",component:s="li",disableGutters:a=!1,disableSticky:l=!1,inset:u=!1,...d}=r,f={...r,color:i,component:s,disableGutters:a,disableSticky:l,inset:u},h=I9(f);return c.jsx(A9,{as:s,className:Ue(h.root,o),ref:n,ownerState:f,...d})});Lf&&(Lf.muiSkipListHighlight=!0);const O9=mt(c.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function M9(e){return Ge("MuiChip",e)}const Tt=We("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),P9=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:s,clickable:a,variant:l}=e,u={root:["root",l,n&&"disabled",`size${Fe(r)}`,`color${Fe(o)}`,a&&"clickable",a&&`clickableColor${Fe(o)}`,s&&"deletable",s&&`deletableColor${Fe(o)}`,`${l}${Fe(o)}`],label:["label",`label${Fe(r)}`],avatar:["avatar",`avatar${Fe(r)}`,`avatarColor${Fe(o)}`],icon:["icon",`icon${Fe(r)}`,`iconColor${Fe(i)}`],deleteIcon:["deleteIcon",`deleteIcon${Fe(r)}`,`deleteIconColor${Fe(o)}`,`deleteIcon${Fe(l)}Color${Fe(o)}`]};return Ke(u,M9,t)},R9=fe("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:s,size:a,variant:l}=n;return[{[`& .${Tt.avatar}`]:t.avatar},{[`& .${Tt.avatar}`]:t[`avatar${Fe(a)}`]},{[`& .${Tt.avatar}`]:t[`avatarColor${Fe(r)}`]},{[`& .${Tt.icon}`]:t.icon},{[`& .${Tt.icon}`]:t[`icon${Fe(a)}`]},{[`& .${Tt.icon}`]:t[`iconColor${Fe(o)}`]},{[`& .${Tt.deleteIcon}`]:t.deleteIcon},{[`& .${Tt.deleteIcon}`]:t[`deleteIcon${Fe(a)}`]},{[`& .${Tt.deleteIcon}`]:t[`deleteIconColor${Fe(r)}`]},{[`& .${Tt.deleteIcon}`]:t[`deleteIcon${Fe(l)}Color${Fe(r)}`]},t.root,t[`size${Fe(a)}`],t[`color${Fe(r)}`],i&&t.clickable,i&&r!=="default"&&t[`clickableColor${Fe(r)})`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${Fe(r)}`],t[l],t[`${l}${Fe(r)}`]]}})(ft(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Tt.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Tt.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${Tt.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${Tt.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${Tt.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Tt.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Tt.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Tt.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Tt.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Bn(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${Tt.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Tt.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Tt.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Tt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(Bn(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Tt.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${Tt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Bn(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Tt.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Tt.avatar}`]:{marginLeft:4},[`& .${Tt.avatarSmall}`]:{marginLeft:2},[`& .${Tt.icon}`]:{marginLeft:4},[`& .${Tt.iconSmall}`]:{marginLeft:2},[`& .${Tt.deleteIcon}`]:{marginRight:5},[`& .${Tt.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Bn()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${Tt.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${Tt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${Tt.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),N9=fe("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${Fe(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function E1(e){return e.key==="Backspace"||e.key==="Delete"}const Q2=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:s,color:a="default",component:l,deleteIcon:u,disabled:d=!1,icon:f,label:h,onClick:p,onDelete:m,onKeyDown:b,onKeyUp:y,size:x="medium",variant:C="filled",tabIndex:v,skipFocusWhenDisabled:S=!1,slots:I={},slotProps:T={},...N}=r,O=M.useRef(null),F=vt(O,n),B=Q=>{Q.stopPropagation(),m&&m(Q)},j=Q=>{Q.currentTarget===Q.target&&E1(Q)&&Q.preventDefault(),b&&b(Q)},D=Q=>{Q.currentTarget===Q.target&&m&&E1(Q)&&m(Q),y&&y(Q)},H=s!==!1&&p?!0:s,_=H||m?pi:l||"div",L={...r,component:_,disabled:d,size:x,color:a,iconColor:M.isValidElement(f)&&f.props.color||a,onDelete:!!m,clickable:H,variant:C},$=P9(L),K=_===pi?{component:l||"div",focusVisibleClassName:$.focusVisible,...m&&{disableRipple:!0}}:{};let G=null;m&&(G=u&&M.isValidElement(u)?M.cloneElement(u,{className:Ue(u.props.className,$.deleteIcon),onClick:B}):c.jsx(O9,{className:$.deleteIcon,onClick:B}));let q=null;o&&M.isValidElement(o)&&(q=M.cloneElement(o,{className:Ue($.avatar,o.props.className)}));let R=null;f&&M.isValidElement(f)&&(R=M.cloneElement(f,{className:Ue($.icon,f.props.className)}));const oe={slots:I,slotProps:T},[se,z]=kt("root",{elementType:R9,externalForwardedProps:{...oe,...N},ownerState:L,shouldForwardComponentProp:!0,ref:F,className:Ue($.root,i),additionalProps:{disabled:H&&d?!0:void 0,tabIndex:S&&d?-1:v,...K},getSlotProps:Q=>({...Q,onClick:re=>{Q.onClick?.(re),p?.(re)},onKeyDown:re=>{Q.onKeyDown?.(re),j(re)},onKeyUp:re=>{Q.onKeyUp?.(re),D(re)}})}),[pe,J]=kt("label",{elementType:N9,externalForwardedProps:oe,ownerState:L,className:$.label});return c.jsxs(se,{as:_,...z,children:[q||R,c.jsx(pe,{...J,children:h}),G]})}),F9=mt(c.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function L9(e){return Ge("MuiAutocomplete",e)}const gt=We("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var v1,T1;const _9=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:u,size:d}=e,f={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Fe(d)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Ke(f,L9,t)},B9=fe("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:s,size:a}=n;return[{[`& .${gt.tag}`]:t.tag},{[`& .${gt.tag}`]:t[`tagSize${Fe(a)}`]},{[`& .${gt.inputRoot}`]:t.inputRoot},{[`& .${gt.input}`]:t.input},{[`& .${gt.input}`]:s&&t.inputFocused},t.root,r&&t.fullWidth,i&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${gt.focused} .${gt.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${gt.clearIndicator}`]:{visibility:"visible"}},[`& .${gt.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${gt.inputRoot}`]:{[`.${gt.hasPopupIcon}&, .${gt.hasClearIcon}&`]:{paddingRight:30},[`.${gt.hasPopupIcon}.${gt.hasClearIcon}&`]:{paddingRight:56},[`& .${gt.input}`]:{width:0,minWidth:30}},[`& .${Mo.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Mo.root}.${tr.sizeSmall}`]:{[`& .${Mo.input}`]:{padding:"2px 4px 3px 0"}},[`& .${fr.root}`]:{padding:9,[`.${gt.hasPopupIcon}&, .${gt.hasClearIcon}&`]:{paddingRight:39},[`.${gt.hasPopupIcon}.${gt.hasClearIcon}&`]:{paddingRight:65},[`& .${gt.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${gt.endAdornment}`]:{right:9}},[`& .${fr.root}.${tr.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${gt.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${nr.root}`]:{paddingTop:19,paddingLeft:8,[`.${gt.hasPopupIcon}&, .${gt.hasClearIcon}&`]:{paddingRight:39},[`.${gt.hasPopupIcon}.${gt.hasClearIcon}&`]:{paddingRight:65},[`& .${nr.input}`]:{padding:"7px 4px"},[`& .${gt.endAdornment}`]:{right:9}},[`& .${nr.root}.${tr.sizeSmall}`]:{paddingBottom:1,[`& .${nr.input}`]:{padding:"2.5px 4px"}},[`& .${tr.hiddenLabel}`]:{paddingTop:8},[`& .${nr.root}.${tr.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${gt.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${nr.root}.${tr.hiddenLabel}.${tr.sizeSmall}`]:{[`& .${gt.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${gt.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${gt.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${gt.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${gt.inputRoot}`]:{flexWrap:"wrap"}}}]}),j9=fe("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),$9=fe(Ir,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),H9=fe(Ir,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),z9=fe(Qp,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${gt.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(ft(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),U9=fe(Ci,{name:"MuiAutocomplete",slot:"Paper"})(ft(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),V9=fe("div",{name:"MuiAutocomplete",slot:"Loading"})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),W9=fe("div",{name:"MuiAutocomplete",slot:"NoOptions"})(ft(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),q9=fe("ul",{name:"MuiAutocomplete",slot:"Listbox"})(ft(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${gt.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${gt.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${gt.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${gt.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${gt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),Y9=fe(Lf,{name:"MuiAutocomplete",slot:"GroupLabel"})(ft(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),K9=fe("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${gt.option}`]:{paddingLeft:24}}),_f=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiAutocomplete"}),{autoComplete:o=!1,autoHighlight:i=!1,autoSelect:s=!1,blurOnSelect:a=!1,ChipProps:l,className:u,clearIcon:d=v1||(v1=c.jsx(F9,{fontSize:"small"})),clearOnBlur:f=!r.freeSolo,clearOnEscape:h=!1,clearText:p="Clear",closeText:m="Close",componentsProps:b,defaultValue:y=r.multiple?[]:null,disableClearable:x=!1,disableCloseOnSelect:C=!1,disabled:v=!1,disabledItemsFocusable:S=!1,disableListWrap:I=!1,disablePortal:T=!1,filterOptions:N,filterSelectedOptions:O=!1,forcePopupIcon:F="auto",freeSolo:B=!1,fullWidth:j=!1,getLimitTagsText:D=wt=>`+${wt}`,getOptionDisabled:H,getOptionKey:_,getOptionLabel:L,isOptionEqualToValue:$,groupBy:K,handleHomeEndKeys:G=!r.freeSolo,id:q,includeInputInList:R=!1,inputValue:oe,limitTags:se=-1,ListboxComponent:z,ListboxProps:pe,loading:J=!1,loadingText:Q="Loading…",multiple:re=!1,noOptionsText:ne="No options",onChange:ae,onClose:ie,onHighlightChange:Z,onInputChange:me,onOpen:le,open:ue,openOnFocus:Ie=!1,openText:Ce="Open",options:we,PaperComponent:ye,PopperComponent:ze,popupIcon:Ne=T1||(T1=c.jsx(_2,{})),readOnly:nt=!1,renderGroup:_e,renderInput:Bt,renderOption:yt,renderTags:ot,renderValue:xe,selectOnFocus:Pe=!r.freeSolo,size:qe="medium",slots:Je={},slotProps:Xe={},value:Re,...ct}=r,{getRootProps:lt,getInputProps:Mt,getInputLabelProps:be,getPopupIndicatorProps:Ae,getClearProps:Oe,getItemProps:Qe,getListboxProps:st,getOptionProps:Nt,value:Gt,dirty:bt,expanded:sn,id:Rn,popupOpen:jt,focused:gn,focusedItem:lr,anchorEl:Nn,setAnchorEl:jr,inputValue:Hn,groupedOptions:Pt}=f7({...r,componentName:"Autocomplete"}),xn=!x&&!v&&bt&&!nt,To=(!B||F===!0)&&F!==!1,{onMouseDown:ki}=Mt(),{ref:wn,...$o}=st(),So=L||(wt=>wt.label??wt),nn={...r,disablePortal:T,expanded:sn,focused:gn,fullWidth:j,getOptionLabel:So,hasClearIcon:xn,hasPopupIcon:To,inputFocused:lr===-1,popupOpen:jt,size:qe},rn=_9(nn),Ar={slots:{paper:ye,popper:ze,...Je},slotProps:{chip:l,listbox:pe,...b,...Xe}},[Ho,ko]=kt("listbox",{elementType:q9,externalForwardedProps:Ar,ownerState:nn,className:rn.listbox,additionalProps:$o,ref:wn}),[zo,ke]=kt("paper",{elementType:Ci,externalForwardedProps:Ar,ownerState:nn,className:rn.paper}),[Te,Ye]=kt("popper",{elementType:Qp,externalForwardedProps:Ar,ownerState:nn,className:rn.popper,additionalProps:{disablePortal:T,style:{width:Nn?Nn.clientWidth:null},role:"presentation",anchorEl:Nn,open:jt}});let rt;const je=wt=>({className:rn.tag,disabled:v,...Qe(wt)});if(re?Gt.length>0&&(ot?rt=ot(Gt,je,nn):xe?rt=xe(Gt,je,nn):rt=Gt.map((wt,$r)=>{const{key:Fn,...io}=je({index:$r});return c.jsx(Q2,{label:So(wt),size:qe,...io,...Ar.slotProps.chip},Fn)})):xe&&Gt!=null&&(rt=xe(Gt,je,nn)),se>-1&&Array.isArray(rt)){const wt=rt.length-se;!gn&&wt>0&&(rt=rt.splice(0,se),rt.push(c.jsx("span",{className:rn.tag,children:D(wt)},rt.length)))}const Wt=_e||(wt=>c.jsxs("li",{children:[c.jsx(Y9,{className:rn.groupLabel,ownerState:nn,component:"div",children:wt.group}),c.jsx(K9,{className:rn.groupUl,ownerState:nn,children:wt.children})]},wt.key)),Di=yt||((wt,$r)=>{const{key:Fn,...io}=wt;return c.jsx("li",{...io,children:So($r)},Fn)}),Ps=(wt,$r)=>{const Fn=Nt({option:wt,index:$r});return Di({...Fn,className:rn.option},wt,{selected:Fn["aria-selected"],index:$r,inputValue:Hn},nn)},Rs=Ar.slotProps.clearIndicator,Il=Ar.slotProps.popupIndicator;return c.jsxs(M.Fragment,{children:[c.jsx(B9,{ref:n,className:Ue(rn.root,u),ownerState:nn,...lt(ct),children:Bt({id:Rn,disabled:v,fullWidth:!0,size:qe==="small"?"small":void 0,InputLabelProps:be(),InputProps:{ref:jr,className:rn.inputRoot,startAdornment:rt,onMouseDown:wt=>{wt.target===wt.currentTarget&&ki(wt)},...(xn||To)&&{endAdornment:c.jsxs(j9,{className:rn.endAdornment,ownerState:nn,children:[xn?c.jsx($9,{...Oe(),"aria-label":p,title:p,ownerState:nn,...Rs,className:Ue(rn.clearIndicator,Rs?.className),children:d}):null,To?c.jsx(H9,{...Ae(),disabled:v,"aria-label":jt?m:Ce,title:jt?m:Ce,ownerState:nn,...Il,className:Ue(rn.popupIndicator,Il?.className),children:Ne}):null]})}},inputProps:{className:rn.input,disabled:v,readOnly:nt,...Mt()}})}),Nn?c.jsx(z9,{as:Te,...Ye,children:c.jsxs(U9,{as:zo,...ke,children:[J&&Pt.length===0?c.jsx(V9,{className:rn.loading,ownerState:nn,children:Q}):null,Pt.length===0&&!B&&!J?c.jsx(W9,{className:rn.noOptions,ownerState:nn,role:"presentation",onMouseDown:wt=>{wt.preventDefault()},children:ne}):null,Pt.length>0?c.jsx(Ho,{as:z,...ko,children:Pt.map((wt,$r)=>K?Wt({key:wt.key,group:wt.group,children:wt.options.map((Fn,io)=>Ps(Fn,wt.index+io))}):Ps(wt,$r))}):null]})}):null]})});var gu={exports:{}},G9=gu.exports,S1;function Q9(){return S1||(S1=1,(function(e,t){(function(n,r){e.exports=r()})(G9,(function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",l="hour",u="day",d="week",f="month",h="quarter",p="year",m="date",b="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var L=["th","st","nd","rd"],$=_%100;return"["+_+(L[($-20)%10]||L[$]||L[0])+"]"}},v=function(_,L,$){var K=String(_);return!K||K.length>=L?_:""+Array(L+1-K.length).join($)+_},S={s:v,z:function(_){var L=-_.utcOffset(),$=Math.abs(L),K=Math.floor($/60),G=$%60;return(L<=0?"+":"-")+v(K,2,"0")+":"+v(G,2,"0")},m:function _(L,$){if(L.date()<$.date())return-_($,L);var K=12*($.year()-L.year())+($.month()-L.month()),G=L.clone().add(K,f),q=$-G<0,R=L.clone().add(K+(q?-1:1),f);return+(-(K+($-G)/(q?G-R:R-G))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:f,y:p,w:d,d:u,D:m,h:l,m:a,s,ms:i,Q:h}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},I="en",T={};T[I]=C;var N="$isDayjsObject",O=function(_){return _ instanceof D||!(!_||!_[N])},F=function _(L,$,K){var G;if(!L)return I;if(typeof L=="string"){var q=L.toLowerCase();T[q]&&(G=q),$&&(T[q]=$,G=q);var R=L.split("-");if(!G&&R.length>1)return _(R[0])}else{var oe=L.name;T[oe]=L,G=oe}return!K&&G&&(I=G),G||!K&&I},B=function(_,L){if(O(_))return _.clone();var $=typeof L=="object"?L:{};return $.date=_,$.args=arguments,new D($)},j=S;j.l=F,j.i=O,j.w=function(_,L){return B(_,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var D=(function(){function _($){this.$L=F($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[N]=!0}var L=_.prototype;return L.parse=function($){this.$d=(function(K){var G=K.date,q=K.utc;if(G===null)return new Date(NaN);if(j.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var R=G.match(y);if(R){var oe=R[2]-1||0,se=(R[7]||"0").substring(0,3);return q?new Date(Date.UTC(R[1],oe,R[3]||1,R[4]||0,R[5]||0,R[6]||0,se)):new Date(R[1],oe,R[3]||1,R[4]||0,R[5]||0,R[6]||0,se)}}return new Date(G)})($),this.init()},L.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},L.$utils=function(){return j},L.isValid=function(){return this.$d.toString()!==b},L.isSame=function($,K){var G=B($);return this.startOf(K)<=G&&G<=this.endOf(K)},L.isAfter=function($,K){return B($)<this.startOf(K)},L.isBefore=function($,K){return this.endOf(K)<B($)},L.$g=function($,K,G){return j.u($)?this[K]:this.set(G,$)},L.unix=function(){return Math.floor(this.valueOf()/1e3)},L.valueOf=function(){return this.$d.getTime()},L.startOf=function($,K){var G=this,q=!!j.u(K)||K,R=j.p($),oe=function(ae,ie){var Z=j.w(G.$u?Date.UTC(G.$y,ie,ae):new Date(G.$y,ie,ae),G);return q?Z:Z.endOf(u)},se=function(ae,ie){return j.w(G.toDate()[ae].apply(G.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(ie)),G)},z=this.$W,pe=this.$M,J=this.$D,Q="set"+(this.$u?"UTC":"");switch(R){case p:return q?oe(1,0):oe(31,11);case f:return q?oe(1,pe):oe(0,pe+1);case d:var re=this.$locale().weekStart||0,ne=(z<re?z+7:z)-re;return oe(q?J-ne:J+(6-ne),pe);case u:case m:return se(Q+"Hours",0);case l:return se(Q+"Minutes",1);case a:return se(Q+"Seconds",2);case s:return se(Q+"Milliseconds",3);default:return this.clone()}},L.endOf=function($){return this.startOf($,!1)},L.$set=function($,K){var G,q=j.p($),R="set"+(this.$u?"UTC":""),oe=(G={},G[u]=R+"Date",G[m]=R+"Date",G[f]=R+"Month",G[p]=R+"FullYear",G[l]=R+"Hours",G[a]=R+"Minutes",G[s]=R+"Seconds",G[i]=R+"Milliseconds",G)[q],se=q===u?this.$D+(K-this.$W):K;if(q===f||q===p){var z=this.clone().set(m,1);z.$d[oe](se),z.init(),this.$d=z.set(m,Math.min(this.$D,z.daysInMonth())).$d}else oe&&this.$d[oe](se);return this.init(),this},L.set=function($,K){return this.clone().$set($,K)},L.get=function($){return this[j.p($)]()},L.add=function($,K){var G,q=this;$=Number($);var R=j.p(K),oe=function(pe){var J=B(q);return j.w(J.date(J.date()+Math.round(pe*$)),q)};if(R===f)return this.set(f,this.$M+$);if(R===p)return this.set(p,this.$y+$);if(R===u)return oe(1);if(R===d)return oe(7);var se=(G={},G[a]=r,G[l]=o,G[s]=n,G)[R]||1,z=this.$d.getTime()+$*se;return j.w(z,this)},L.subtract=function($,K){return this.add(-1*$,K)},L.format=function($){var K=this,G=this.$locale();if(!this.isValid())return G.invalidDate||b;var q=$||"YYYY-MM-DDTHH:mm:ssZ",R=j.z(this),oe=this.$H,se=this.$m,z=this.$M,pe=G.weekdays,J=G.months,Q=G.meridiem,re=function(ie,Z,me,le){return ie&&(ie[Z]||ie(K,q))||me[Z].slice(0,le)},ne=function(ie){return j.s(oe%12||12,ie,"0")},ae=Q||function(ie,Z,me){var le=ie<12?"AM":"PM";return me?le.toLowerCase():le};return q.replace(x,(function(ie,Z){return Z||(function(me){switch(me){case"YY":return String(K.$y).slice(-2);case"YYYY":return j.s(K.$y,4,"0");case"M":return z+1;case"MM":return j.s(z+1,2,"0");case"MMM":return re(G.monthsShort,z,J,3);case"MMMM":return re(J,z);case"D":return K.$D;case"DD":return j.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return re(G.weekdaysMin,K.$W,pe,2);case"ddd":return re(G.weekdaysShort,K.$W,pe,3);case"dddd":return pe[K.$W];case"H":return String(oe);case"HH":return j.s(oe,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return ae(oe,se,!0);case"A":return ae(oe,se,!1);case"m":return String(se);case"mm":return j.s(se,2,"0");case"s":return String(K.$s);case"ss":return j.s(K.$s,2,"0");case"SSS":return j.s(K.$ms,3,"0");case"Z":return R}return null})(ie)||R.replace(":","")}))},L.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},L.diff=function($,K,G){var q,R=this,oe=j.p(K),se=B($),z=(se.utcOffset()-this.utcOffset())*r,pe=this-se,J=function(){return j.m(R,se)};switch(oe){case p:q=J()/12;break;case f:q=J();break;case h:q=J()/3;break;case d:q=(pe-z)/6048e5;break;case u:q=(pe-z)/864e5;break;case l:q=pe/o;break;case a:q=pe/r;break;case s:q=pe/n;break;default:q=pe}return G?q:j.a(q)},L.daysInMonth=function(){return this.endOf(f).$D},L.$locale=function(){return T[this.$L]},L.locale=function($,K){if(!$)return this.$L;var G=this.clone(),q=F($,K,!0);return q&&(G.$L=q),G},L.clone=function(){return j.w(this.$d,this)},L.toDate=function(){return new Date(this.valueOf())},L.toJSON=function(){return this.isValid()?this.toISOString():null},L.toISOString=function(){return this.$d.toISOString()},L.toString=function(){return this.$d.toUTCString()},_})(),H=D.prototype;return B.prototype=H,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",u],["$M",f],["$y",p],["$D",m]].forEach((function(_){H[_[1]]=function(L){return this.$g(L,_[0],_[1])}})),B.extend=function(_,L){return _.$i||(_(L,D,B),_.$i=!0),B},B.locale=F,B.isDayjs=O,B.unix=function(_){return B(1e3*_)},B.en=T[I],B.Ls=T,B.p={},B}))})(gu)),gu.exports}var X9=Q9();const _t=Tr(X9);var bu={exports:{}},Z9=bu.exports,k1;function J9(){return k1||(k1=1,(function(e,t){(function(n,r){e.exports=r()})(Z9,(function(){var n="week",r="year";return function(o,i,s){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var d=s(this).startOf(r).add(1,r).date(u),f=s(this).endOf(n);if(d.isBefore(f))return 1}var h=s(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),p=this.diff(h,n,!0);return p<0?s(this).startOf("week").week():Math.ceil(p)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}}))})(bu)),bu.exports}var eB=J9();const tB=Tr(eB);var yu={exports:{}},nB=yu.exports,w1;function rB(){return w1||(w1=1,(function(e,t){(function(n,r){e.exports=r()})(nB,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,i=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},d=function(y){return function(x){this[y]=+x}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(x){if(!x||x==="Z")return 0;var C=x.match(/([+-]|\d\d)/g),v=60*C[1]+(+C[2]||0);return v===0?0:C[0]==="+"?-v:v})(y)}],h=function(y){var x=l[y];return x&&(x.indexOf?x:x.s.concat(x.f))},p=function(y,x){var C,v=l.meridiem;if(v){for(var S=1;S<=24;S+=1)if(y.indexOf(v(S,0,x))>-1){C=S>12;break}}else C=y===(x?"pm":"PM");return C},m={A:[a,function(y){this.afternoon=p(y,!1)}],a:[a,function(y){this.afternoon=p(y,!0)}],Q:[o,function(y){this.month=3*(y-1)+1}],S:[o,function(y){this.milliseconds=100*+y}],SS:[i,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,d("seconds")],ss:[s,d("seconds")],m:[s,d("minutes")],mm:[s,d("minutes")],H:[s,d("hours")],h:[s,d("hours")],HH:[s,d("hours")],hh:[s,d("hours")],D:[s,d("day")],DD:[i,d("day")],Do:[a,function(y){var x=l.ordinal,C=y.match(/\d+/);if(this.day=C[0],x)for(var v=1;v<=31;v+=1)x(v).replace(/\[|\]/g,"")===y&&(this.day=v)}],w:[s,d("week")],ww:[i,d("week")],M:[s,d("month")],MM:[i,d("month")],MMM:[a,function(y){var x=h("months"),C=(h("monthsShort")||x.map((function(v){return v.slice(0,3)}))).indexOf(y)+1;if(C<1)throw new Error;this.month=C%12||C}],MMMM:[a,function(y){var x=h("months").indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,d("year")],YY:[i,function(y){this.year=u(y)}],YYYY:[/\d{4}/,d("year")],Z:f,ZZ:f};function b(y){var x,C;x=y,C=l&&l.formats;for(var v=(y=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(B,j,D){var H=D&&D.toUpperCase();return j||C[D]||n[D]||C[H].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(_,L,$){return L||$.slice(1)}))}))).match(r),S=v.length,I=0;I<S;I+=1){var T=v[I],N=m[T],O=N&&N[0],F=N&&N[1];v[I]=F?{regex:O,parser:F}:T.replace(/^\[|\]$/g,"")}return function(B){for(var j={},D=0,H=0;D<S;D+=1){var _=v[D];if(typeof _=="string")H+=_.length;else{var L=_.regex,$=_.parser,K=B.slice(H),G=L.exec(K)[0];$.call(j,G),B=B.replace(G,"")}}return(function(q){var R=q.afternoon;if(R!==void 0){var oe=q.hours;R?oe<12&&(q.hours+=12):oe===12&&(q.hours=0),delete q.afternoon}})(j),j}}return function(y,x,C){C.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(u=y.parseTwoDigitYear);var v=x.prototype,S=v.parse;v.parse=function(I){var T=I.date,N=I.utc,O=I.args;this.$u=N;var F=O[1];if(typeof F=="string"){var B=O[2]===!0,j=O[3]===!0,D=B||j,H=O[2];j&&(H=O[2]),l=this.$locale(),!B&&H&&(l=C.Ls[H]),this.$d=(function(K,G,q,R){try{if(["x","X"].indexOf(G)>-1)return new Date((G==="X"?1e3:1)*K);var oe=b(G)(K),se=oe.year,z=oe.month,pe=oe.day,J=oe.hours,Q=oe.minutes,re=oe.seconds,ne=oe.milliseconds,ae=oe.zone,ie=oe.week,Z=new Date,me=pe||(se||z?1:Z.getDate()),le=se||Z.getFullYear(),ue=0;se&&!z||(ue=z>0?z-1:Z.getMonth());var Ie,Ce=J||0,we=Q||0,ye=re||0,ze=ne||0;return ae?new Date(Date.UTC(le,ue,me,Ce,we,ye,ze+60*ae.offset*1e3)):q?new Date(Date.UTC(le,ue,me,Ce,we,ye,ze)):(Ie=new Date(le,ue,me,Ce,we,ye,ze),ie&&(Ie=R(Ie).week(ie).toDate()),Ie)}catch{return new Date("")}})(T,F,N,C),this.init(),H&&H!==!0&&(this.$L=this.locale(H).$L),D&&T!=this.format(F)&&(this.$d=new Date("")),l={}}else if(F instanceof Array)for(var _=F.length,L=1;L<=_;L+=1){O[1]=F[L-1];var $=C.apply(this,O);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}L===_&&(this.$d=new Date(""))}else S.call(this,I)}}}))})(yu)),yu.exports}var oB=rB();const iB=Tr(oB);var xu={exports:{}},sB=xu.exports,D1;function aB(){return D1||(D1=1,(function(e,t){(function(n,r){e.exports=r()})(sB,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,i){var s=o.prototype,a=s.format;i.en.formats=n,s.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,d=(function(f,h){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(p,m,b){var y=b&&b.toUpperCase();return m||h[b]||n[b]||h[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(x,C,v){return C||v.slice(1)}))}))})(l,u===void 0?{}:u);return a.call(this,d)}}}))})(xu)),xu.exports}var lB=aB();const uB=Tr(lB);var Cu={exports:{}},cB=Cu.exports,I1;function dB(){return I1||(I1=1,(function(e,t){(function(n,r){e.exports=r()})(cB,(function(){return function(n,r,o){r.prototype.isBetween=function(i,s,a,l){var u=o(i),d=o(s),f=(l=l||"()")[0]==="(",h=l[1]===")";return(f?this.isAfter(u,a):!this.isBefore(u,a))&&(h?this.isBefore(d,a):!this.isAfter(d,a))||(f?this.isBefore(u,a):!this.isAfter(u,a))&&(h?this.isAfter(d,a):!this.isBefore(d,a))}}}))})(Cu)),Cu.exports}var fB=dB();const pB=Tr(fB);var Eu={exports:{}},hB=Eu.exports,A1;function mB(){return A1||(A1=1,(function(e,t){(function(n,r){e.exports=r()})(hB,(function(){return function(n,r){var o=r.prototype,i=o.format;o.format=function(s){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(s);var u=this.$utils(),d=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return u.s(a.week(),f==="w"?1:2,"0");case"W":case"WW":return u.s(a.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return u.s(String(a.$H===0?24:a.$H),f==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return f}}));return i.bind(this)(d)}}}))})(Eu)),Eu.exports}var gB=mB();const bB=Tr(gB);_t.extend(uB);_t.extend(tB);_t.extend(pB);_t.extend(bB);const yB={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},xB={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},zd=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
197
197
  `),O1=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
198
- `),gB=(e,t)=>t?(...n)=>e(...n).locale(t):e;class Bf{constructor({locale:t,formats:n}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=hB,this.setLocaleToValue=r=>{const o=this.getCurrentLocaleCode();return o===r.locale()?r:r.locale(o)},this.hasUTCPlugin=()=>typeof _t.utc<"u",this.hasTimezonePlugin=()=>typeof _t.tz<"u",this.isSame=(r,o,i)=>{const s=this.setTimezone(o,this.getTimezone(r));return r.format(i)===s.format(i)},this.cleanTimezone=r=>{switch(r){case"default":return;case"system":return _t.tz.guess();default:return r}},this.createSystemDate=r=>{if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const o=_t.tz.guess();return o!=="UTC"?_t.tz(r,o):_t(r)}return _t(r)},this.createUTCDate=r=>{if(!this.hasUTCPlugin())throw new Error(zd);return _t.utc(r)},this.createTZDate=(r,o)=>{if(!this.hasUTCPlugin())throw new Error(zd);if(!this.hasTimezonePlugin())throw new Error(O1);const i=r!==void 0&&!r.endsWith("Z");return _t(r).tz(this.cleanTimezone(o),i)},this.getLocaleFormats=()=>{const r=_t.Ls,o=this.locale||"en";let i=r[o];return i===void 0&&(i=r.en),i.formats},this.adjustOffset=r=>{if(!this.hasTimezonePlugin())return r;const o=this.getTimezone(r);if(o!=="UTC"){const i=r.tz(this.cleanTimezone(o),!0);if(i.$offset===(r.$offset??0))return r;r.$offset=i.$offset}return r},this.date=(r,o="default")=>{if(r===null)return null;let i;return o==="UTC"?i=this.createUTCDate(r):o==="system"||o==="default"&&!this.hasTimezonePlugin()?i=this.createSystemDate(r):i=this.createTZDate(r,o),this.locale===void 0?i:i.locale(this.locale)},this.getInvalidDate=()=>_t(new Date("Invalid date")),this.getTimezone=r=>{if(this.hasTimezonePlugin()){const o=r.$x?.$timezone;if(o)return o}return this.hasUTCPlugin()&&r.isUTC()?"UTC":"system"},this.setTimezone=(r,o)=>{if(this.getTimezone(r)===o)return r;if(o==="UTC"){if(!this.hasUTCPlugin())throw new Error(zd);return r.utc()}if(o==="system")return r.local();if(!this.hasTimezonePlugin()){if(o==="default")return r;throw new Error(O1)}return _t.tz(r,this.cleanTimezone(o))},this.toJsDate=r=>r.toDate(),this.parse=(r,o)=>r===""?null:this.dayjs(r,o,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=r=>{const o=this.getLocaleFormats(),i=s=>s.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(a,l,u)=>l||u.slice(1));return r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(s,a,l)=>{const u=l&&l.toUpperCase();return a||o[l]||i(o[u])})},this.isValid=r=>r==null?!1:r.isValid(),this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>this.dayjs(r).format(o),this.formatNumber=r=>r,this.isEqual=(r,o)=>r===null&&o===null?!0:r===null||o===null?!1:r.toDate().getTime()===o.toDate().getTime(),this.isSameYear=(r,o)=>this.isSame(r,o,"YYYY"),this.isSameMonth=(r,o)=>this.isSame(r,o,"YYYY-MM"),this.isSameDay=(r,o)=>this.isSame(r,o,"YYYY-MM-DD"),this.isSameHour=(r,o)=>r.isSame(o,"hour"),this.isAfter=(r,o)=>r>o,this.isAfterYear=(r,o)=>this.hasUTCPlugin()?!this.isSameYear(r,o)&&r.utc()>o.utc():r.isAfter(o,"year"),this.isAfterDay=(r,o)=>this.hasUTCPlugin()?!this.isSameDay(r,o)&&r.utc()>o.utc():r.isAfter(o,"day"),this.isBefore=(r,o)=>r<o,this.isBeforeYear=(r,o)=>this.hasUTCPlugin()?!this.isSameYear(r,o)&&r.utc()<o.utc():r.isBefore(o,"year"),this.isBeforeDay=(r,o)=>this.hasUTCPlugin()?!this.isSameDay(r,o)&&r.utc()<o.utc():r.isBefore(o,"day"),this.isWithinRange=(r,[o,i])=>r>=o&&r<=i,this.startOfYear=r=>this.adjustOffset(r.startOf("year")),this.startOfMonth=r=>this.adjustOffset(r.startOf("month")),this.startOfWeek=r=>this.adjustOffset(this.setLocaleToValue(r).startOf("week")),this.startOfDay=r=>this.adjustOffset(r.startOf("day")),this.endOfYear=r=>this.adjustOffset(r.endOf("year")),this.endOfMonth=r=>this.adjustOffset(r.endOf("month")),this.endOfWeek=r=>this.adjustOffset(this.setLocaleToValue(r).endOf("week")),this.endOfDay=r=>this.adjustOffset(r.endOf("day")),this.addYears=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"year"):r.add(o,"year")),this.addMonths=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"month"):r.add(o,"month")),this.addWeeks=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"week"):r.add(o,"week")),this.addDays=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"day"):r.add(o,"day")),this.addHours=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"hour"):r.add(o,"hour")),this.addMinutes=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"minute"):r.add(o,"minute")),this.addSeconds=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"second"):r.add(o,"second")),this.getYear=r=>r.year(),this.getMonth=r=>r.month(),this.getDate=r=>r.date(),this.getHours=r=>r.hour(),this.getMinutes=r=>r.minute(),this.getSeconds=r=>r.second(),this.getMilliseconds=r=>r.millisecond(),this.setYear=(r,o)=>this.adjustOffset(r.set("year",o)),this.setMonth=(r,o)=>this.adjustOffset(r.set("month",o)),this.setDate=(r,o)=>this.adjustOffset(r.set("date",o)),this.setHours=(r,o)=>this.adjustOffset(r.set("hour",o)),this.setMinutes=(r,o)=>this.adjustOffset(r.set("minute",o)),this.setSeconds=(r,o)=>this.adjustOffset(r.set("second",o)),this.setMilliseconds=(r,o)=>this.adjustOffset(r.set("millisecond",o)),this.getDaysInMonth=r=>r.daysInMonth(),this.getWeekArray=r=>{const o=this.startOfWeek(this.startOfMonth(r)),i=this.endOfWeek(this.endOfMonth(r));let s=0,a=o;const l=[];for(;a<i;){const u=Math.floor(s/7);l[u]=l[u]||[],l[u].push(a),a=this.addDays(a,1),s+=1}return l},this.getWeekNumber=r=>r.week(),this.getYearRange=([r,o])=>{const i=this.startOfYear(r),s=this.endOfYear(o),a=[];let l=i;for(;this.isBefore(l,s);)a.push(l),l=this.addYears(l,1);return a},this.dayjs=gB(_t,t),this.locale=t,this.formats=Y({},mB,n),_t.extend(tB)}getDayOfWeek(t){return t.day()+1}}function bB(e,t,n,r,o){const[i,s]=M.useState(()=>o&&n?n(e).matches:r?r(e).matches:t);return yn(()=>{if(!n)return;const a=n(e),l=()=>{s(a.matches)};return l(),a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[e,n]),i}const yB={...M},K2=yB.useSyncExternalStore;function xB(e,t,n,r,o){const i=M.useCallback(()=>t,[t]),s=M.useMemo(()=>{if(o&&n)return()=>n(e).matches;if(r!==null){const{matches:d}=r(e);return()=>d}return i},[i,e,r,o,n]),[a,l]=M.useMemo(()=>{if(n===null)return[i,()=>()=>{}];const d=n(e);return[()=>d.matches,f=>(d.addEventListener("change",f),()=>{d.removeEventListener("change",f)})]},[i,n,e]);return K2(l,a,s)}function G2(e={}){const{themeId:t}=e;return function(r,o={}){let i=fb();i&&t&&(i=i[t]||i);const s=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:a=!1,matchMedia:l=s?window.matchMedia:null,ssrMatchMedia:u=null,noSsr:d=!1}=w2({name:"MuiUseMediaQuery",props:o,theme:i});let f=typeof r=="function"?r(i):r;return f=f.replace(/^@media( ?)/m,""),f.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
199
- `)),(K2!==void 0?xB:bB)(f,a,l,u,d)}}G2();const Q2=G2({themeId:Cs}),CB={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},ma=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),EB=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let i;if(e!=null)i=e;else if(o.includes(t))i=t;else if(o.length>0)i=o[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:i}},Qu=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},qa=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,utils:s,timezone:a})=>{const l=Qu(s,s.date(void 0,a),e);n&&s.isBefore(o,l)&&(o=l),t&&s.isAfter(r,l)&&(r=l);let u=e,d=e;for(s.isBefore(e,o)&&(u=o,d=null),s.isAfter(e,r)&&(d&&(d=r),u=null);u||d;){if(u&&s.isAfter(u,r)&&(u=null),d&&s.isBefore(d,o)&&(d=null),u){if(!i(u))return u;u=s.addDays(u,1)}if(d){if(!i(d))return d;d=s.addDays(d,-1)}}return null},vB=(e,t)=>t==null||!e.isValid(t)?null:t,vr=(e,t,n)=>t==null||!e.isValid(t)?n:t,TB=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),Xp=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const o=r[r.length-1];r.push(e.addMonths(o,1))}return r},X2=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),SB=["year","month","day"],M1=e=>SB.includes(e),Zp=(e,{format:t,views:n},r)=>{if(t!=null)return t;const o=e.formats;return ma(n,["year"])?o.year:ma(n,["month"])?o.month:ma(n,["day"])?o.dayOfMonth:ma(n,["month","year"])?`${o.month} ${o.year}`:ma(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},kB=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},wB=["hours","minutes","seconds"],DB=e=>wB.includes(e),P1=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),IB=(e,t)=>(n,r)=>e?t.isAfter(n,r):P1(n,t)>P1(r,t),Kr={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},AB=e=>Math.max(...e.map(t=>Kr[t.type]??1)),ga=(e,t,n)=>{if(t===Kr.year)return e.startOfYear(n);if(t===Kr.month)return e.startOfMonth(n);if(t===Kr.day)return e.startOfDay(n);let r=n;return t<Kr.minutes&&(r=e.setMinutes(r,0)),t<Kr.seconds&&(r=e.setSeconds(r,0)),t<Kr.milliseconds&&(r=e.setMilliseconds(r,0)),r},OB=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:o})=>{let i=o?o():ga(t,n,X2(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,i)&&(i=ga(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,i)&&(i=ga(t,n,e.maxDate));const s=IB(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&s(e.minTime,i)&&(i=ga(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:Qu(t,i,e.minTime))),e.maxTime!=null&&s(i,e.maxTime)&&(i=ga(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:Qu(t,i,e.maxTime))),i},Z2=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
200
- `));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},MB=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},Mc=(e,t)=>{const n=[],r=e.date(void 0,"default"),o=e.startOfWeek(r),i=e.endOfWeek(r);let s=o;for(;e.isBefore(s,i);)n.push(s),s=e.addDays(s,1);return n.map(a=>e.formatByString(a,t))},J2=(e,t,n,r)=>{switch(n){case"month":return Xp(e,e.date(void 0,t)).map(o=>e.formatByString(o,r));case"weekDay":return Mc(e,r);case"meridiem":{const o=e.date(void 0,t);return[e.startOfDay(o),e.endOfDay(o)].map(i=>e.formatByString(i,r))}default:return[]}},R1="s",PB=["0","1","2","3","4","5","6","7","8","9"],RB=e=>{const t=e.date(void 0);return e.formatByString(e.setSeconds(t,0),R1)==="0"?PB:Array.from({length:10}).map((r,o)=>e.formatByString(e.setSeconds(t,o),R1))},gi=(e,t)=>{if(t[0]==="0")return e;const n=[];let r="";for(let o=0;o<e.length;o+=1){r+=e[o];const i=t.indexOf(r);i>-1&&(n.push(i.toString()),r="")}return n.join("")},Jp=(e,t)=>t[0]==="0"?e:e.split("").map(n=>t[Number(n)]).join(""),N1=(e,t)=>{const n=gi(e,t);return n!==" "&&!Number.isNaN(Number(n))},eC=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},tC=(e,t,n,r,o)=>{if(o.type==="day"&&o.contentType==="digit-with-letter"){const s=e.setDate(n.longestMonth,t);return e.formatByString(s,o.format)}let i=t.toString();return o.hasLeadingZerosInInput&&(i=eC(i,o.maxLength)),Jp(i,r)},NB=(e,t,n,r,o,i,s,a)=>{const l=MB(r),u=r==="Home",d=r==="End",f=n.value===""||u||d,h=()=>{const m=o[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),b=C=>tC(e,C,m,i,n),y=n.type==="minutes"&&a?.minutesStep?a.minutesStep:1;let x;if(f){if(n.type==="year"&&!d&&!u)return e.formatByString(e.date(void 0,t),n.format);l>0||u?x=m.minimum:x=m.maximum}else x=parseInt(gi(n.value,i),10)+l*y;return x%y!==0&&((l<0||u)&&(x+=y-(y+x)%y),(l>0||d)&&(x-=x%y)),x>m.maximum?b(m.minimum+(x-m.maximum-1)%(m.maximum-m.minimum+1)):x<m.minimum?b(m.maximum-(m.minimum-x-1)%(m.maximum-m.minimum+1)):b(x)},p=()=>{const m=J2(e,t,n.type,n.format);if(m.length===0)return n.value;if(f)return l>0||u?m[0]:m[m.length-1];const x=((m.indexOf(n.value)+l)%m.length+m.length)%m.length;return m[x]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?h():p()},eh=(e,t,n)=>{let r=e.value||e.placeholder;const o=t==="non-input"?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return t==="non-input"&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(gi(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&e.contentType==="digit"&&!o&&r.length===1&&(r=`${r}‎`),t==="input-rtl"&&(r=`⁨${r}⁩`),r},F1=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),FB=(e,t)=>e.formatByString(e.date(void 0,"system"),t).length===4,nC=(e,t,n,r)=>{if(t!=="digit")return!1;const o=e.date(void 0,"default");switch(n){case"year":return e.lib==="dayjs"&&r==="YY"?!0:e.formatByString(e.setYear(o,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(o),r).length>1;case"day":return e.formatByString(e.startOfMonth(o),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(o),r).length>1;case"hours":return e.formatByString(e.setHours(o,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(o,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(o,1),r).length>1;default:throw new Error("Invalid section type")}},LB=(e,t,n)=>{const r=t.some(l=>l.type==="day"),o=[],i=[];for(let l=0;l<t.length;l+=1){const u=t[l];r&&u.type==="weekDay"||(o.push(u.format),i.push(eh(u,"non-input",n)))}const s=o.join(" "),a=i.join(" ");return e.parse(a,s)},_B=e=>e.map(t=>`${t.startSeparator}${t.value||t.placeholder}${t.endSeparator}`).join(""),BB=(e,t,n)=>{const o=e.map(i=>{const s=eh(i,n?"input-rtl":"input-ltr",t);return`${i.startSeparator}${s}${i.endSeparator}`}).join("");return n?`⁦${o}⁩`:o},jB=(e,t,n)=>{const r=e.date(void 0,n),o=e.endOfYear(r),i=e.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=Xp(e,r).reduce((l,u)=>{const d=e.getDaysInMonth(u);return d>l.maxDaysInMonth?{maxDaysInMonth:d,longestMonth:u}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:FB(e,l)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(o)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&e.isValid(l)?e.getDaysInMonth(l):s,longestMonth:a}),weekDay:({format:l,contentType:u})=>{if(u==="digit"){const d=Mc(e,l).map(Number);return{minimum:Math.min(...d),maximum:Math.max(...d)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const u=e.getHours(i);return gi(e.formatByString(e.endOfDay(r),l),t)!==u.toString()?{minimum:1,maximum:Number(gi(e.formatByString(e.startOfDay(r),l),t))}:{minimum:0,maximum:u}},minutes:()=>({minimum:0,maximum:e.getMinutes(i)}),seconds:()=>({minimum:0,maximum:e.getSeconds(i)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},$B=(e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{const o=Mc(e,t.format),i=e.formatByString(n,t.format),s=o.indexOf(i),l=o.indexOf(t.value)-s;return e.addDays(n,l)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const o=e.getHours(n)<12,i=e.getHours(r);return o&&i>=12?e.addHours(r,-12):!o&&i<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}},L1={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},_1=(e,t,n,r,o)=>[...n].sort((i,s)=>L1[i.type]-L1[s.type]).reduce((i,s)=>!o||s.modified?$B(e,s,t,i):i,r),HB=()=>navigator.userAgent.toLowerCase().includes("android"),zB=(e,t)=>{const n={};if(!t)return e.forEach((l,u)=>{const d=u===0?null:u-1,f=u===e.length-1?null:u+1;n[u]={leftIndex:d,rightIndex:f}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},o={};let i=0,s=0,a=e.length-1;for(;a>=0;){s=e.findIndex((l,u)=>u>=i&&l.endSeparator?.includes(" ")&&l.endSeparator!==" / "),s===-1&&(s=e.length-1);for(let l=s;l>=i;l-=1)o[l]=a,r[a]=l,a-=1;i=s+1}return e.forEach((l,u)=>{const d=o[u],f=d===0?null:r[d-1],h=d===e.length-1?null:r[d+1];n[u]={leftIndex:f,rightIndex:h}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},jf=(e,t)=>{if(e==null)return null;if(e==="all")return"all";if(typeof e=="string"){const n=t.findIndex(r=>r.type===e);return n===-1?null:n}return e},UB=(e,t)=>{if(e.value)switch(e.type){case"month":{if(e.contentType==="digit")return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");const n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return e.contentType==="digit"?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;case"weekDay":return;default:return}},VB=(e,t)=>{if(e.value)switch(e.type){case"weekDay":return e.contentType==="letter"?void 0:Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return e.contentType==="digit-with-letter"?parseInt(e.value,10):Number(e.value);case"month":{if(e.contentType==="digit")return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return e.contentType!=="letter"?Number(e.value):void 0}},WB=["value","referenceDate"],Zr={emptyValue:null,getTodayValue:X2,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=Ze(e,WB);return t!=null&&r.utils.isValid(t)?t:n??OB(r)},cleanValue:vB,areValuesEqual:TB,isSameError:(e,t)=>e===t,hasError:e=>e!=null,defaultErrorState:null,getTimezone:(e,t)=>t==null||!e.isValid(t)?null:e.getTimezone(t),setTimezone:(e,t,n)=>n==null?null:e.setTimezone(n,t)},qB={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&!!n?n:r(t),getV7HiddenInputValueFromSections:_B,getV6InputValueFromSections:BB,getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!e.isValid(n)?t.referenceValue:n})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},YB=["localeText"],$f=M.createContext(null),Xu=function(t){const{localeText:n}=t,r=Ze(t,YB),{utils:o,localeText:i}=M.useContext($f)??{utils:void 0,localeText:void 0},s=Kt({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:u,dateLibInstance:d,adapterLocale:f,localeText:h}=s,p=M.useMemo(()=>Y({},h,i,n),[h,i,n]),m=M.useMemo(()=>{if(!l)return o||null;const x=new l({locale:f,formats:u,instance:d});if(!x.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
201
- `));return x},[l,f,u,d,o]),b=M.useMemo(()=>m?{minDate:m.date("1900-01-01T00:00:00.000"),maxDate:m.date("2099-12-31T00:00:00.000")}:null,[m]),y=M.useMemo(()=>({utils:m,defaultDates:b,localeText:p}),[b,m,p]);return c.jsx($f.Provider,{value:y,children:a})},KB=e=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:Y({},e)}}}}),rC=e=>{const{utils:t,formatKey:n,contextTranslation:r,propsTranslation:o}=e;return i=>{const s=i!==null&&t.isValid(i)?t.format(i,n):null;return(o??r)(i,t,s)}},oC={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>e==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,r)=>`Select ${e}. ${!r&&(t===null||!n.isValid(t))?"No time selected":`Selected time is ${r??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>e.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>e.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},GB=oC;KB(oC);const Ti=()=>{const e=M.useContext($f);if(e===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(`
198
+ `),CB=(e,t)=>t?(...n)=>e(...n).locale(t):e;class Bf{constructor({locale:t,formats:n}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=yB,this.setLocaleToValue=r=>{const o=this.getCurrentLocaleCode();return o===r.locale()?r:r.locale(o)},this.hasUTCPlugin=()=>typeof _t.utc<"u",this.hasTimezonePlugin=()=>typeof _t.tz<"u",this.isSame=(r,o,i)=>{const s=this.setTimezone(o,this.getTimezone(r));return r.format(i)===s.format(i)},this.cleanTimezone=r=>{switch(r){case"default":return;case"system":return _t.tz.guess();default:return r}},this.createSystemDate=r=>{if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const o=_t.tz.guess();return o!=="UTC"?_t.tz(r,o):_t(r)}return _t(r)},this.createUTCDate=r=>{if(!this.hasUTCPlugin())throw new Error(zd);return _t.utc(r)},this.createTZDate=(r,o)=>{if(!this.hasUTCPlugin())throw new Error(zd);if(!this.hasTimezonePlugin())throw new Error(O1);const i=r!==void 0&&!r.endsWith("Z");return _t(r).tz(this.cleanTimezone(o),i)},this.getLocaleFormats=()=>{const r=_t.Ls,o=this.locale||"en";let i=r[o];return i===void 0&&(i=r.en),i.formats},this.adjustOffset=r=>{if(!this.hasTimezonePlugin())return r;const o=this.getTimezone(r);if(o!=="UTC"){const i=r.tz(this.cleanTimezone(o),!0);if(i.$offset===(r.$offset??0))return r;r.$offset=i.$offset}return r},this.date=(r,o="default")=>{if(r===null)return null;let i;return o==="UTC"?i=this.createUTCDate(r):o==="system"||o==="default"&&!this.hasTimezonePlugin()?i=this.createSystemDate(r):i=this.createTZDate(r,o),this.locale===void 0?i:i.locale(this.locale)},this.getInvalidDate=()=>_t(new Date("Invalid date")),this.getTimezone=r=>{if(this.hasTimezonePlugin()){const o=r.$x?.$timezone;if(o)return o}return this.hasUTCPlugin()&&r.isUTC()?"UTC":"system"},this.setTimezone=(r,o)=>{if(this.getTimezone(r)===o)return r;if(o==="UTC"){if(!this.hasUTCPlugin())throw new Error(zd);return r.utc()}if(o==="system")return r.local();if(!this.hasTimezonePlugin()){if(o==="default")return r;throw new Error(O1)}return _t.tz(r,this.cleanTimezone(o))},this.toJsDate=r=>r.toDate(),this.parse=(r,o)=>r===""?null:this.dayjs(r,o,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=r=>{const o=this.getLocaleFormats(),i=s=>s.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(a,l,u)=>l||u.slice(1));return r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(s,a,l)=>{const u=l&&l.toUpperCase();return a||o[l]||i(o[u])})},this.isValid=r=>r==null?!1:r.isValid(),this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>this.dayjs(r).format(o),this.formatNumber=r=>r,this.isEqual=(r,o)=>r===null&&o===null?!0:r===null||o===null?!1:r.toDate().getTime()===o.toDate().getTime(),this.isSameYear=(r,o)=>this.isSame(r,o,"YYYY"),this.isSameMonth=(r,o)=>this.isSame(r,o,"YYYY-MM"),this.isSameDay=(r,o)=>this.isSame(r,o,"YYYY-MM-DD"),this.isSameHour=(r,o)=>r.isSame(o,"hour"),this.isAfter=(r,o)=>r>o,this.isAfterYear=(r,o)=>this.hasUTCPlugin()?!this.isSameYear(r,o)&&r.utc()>o.utc():r.isAfter(o,"year"),this.isAfterDay=(r,o)=>this.hasUTCPlugin()?!this.isSameDay(r,o)&&r.utc()>o.utc():r.isAfter(o,"day"),this.isBefore=(r,o)=>r<o,this.isBeforeYear=(r,o)=>this.hasUTCPlugin()?!this.isSameYear(r,o)&&r.utc()<o.utc():r.isBefore(o,"year"),this.isBeforeDay=(r,o)=>this.hasUTCPlugin()?!this.isSameDay(r,o)&&r.utc()<o.utc():r.isBefore(o,"day"),this.isWithinRange=(r,[o,i])=>r>=o&&r<=i,this.startOfYear=r=>this.adjustOffset(r.startOf("year")),this.startOfMonth=r=>this.adjustOffset(r.startOf("month")),this.startOfWeek=r=>this.adjustOffset(this.setLocaleToValue(r).startOf("week")),this.startOfDay=r=>this.adjustOffset(r.startOf("day")),this.endOfYear=r=>this.adjustOffset(r.endOf("year")),this.endOfMonth=r=>this.adjustOffset(r.endOf("month")),this.endOfWeek=r=>this.adjustOffset(this.setLocaleToValue(r).endOf("week")),this.endOfDay=r=>this.adjustOffset(r.endOf("day")),this.addYears=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"year"):r.add(o,"year")),this.addMonths=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"month"):r.add(o,"month")),this.addWeeks=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"week"):r.add(o,"week")),this.addDays=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"day"):r.add(o,"day")),this.addHours=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"hour"):r.add(o,"hour")),this.addMinutes=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"minute"):r.add(o,"minute")),this.addSeconds=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"second"):r.add(o,"second")),this.getYear=r=>r.year(),this.getMonth=r=>r.month(),this.getDate=r=>r.date(),this.getHours=r=>r.hour(),this.getMinutes=r=>r.minute(),this.getSeconds=r=>r.second(),this.getMilliseconds=r=>r.millisecond(),this.setYear=(r,o)=>this.adjustOffset(r.set("year",o)),this.setMonth=(r,o)=>this.adjustOffset(r.set("month",o)),this.setDate=(r,o)=>this.adjustOffset(r.set("date",o)),this.setHours=(r,o)=>this.adjustOffset(r.set("hour",o)),this.setMinutes=(r,o)=>this.adjustOffset(r.set("minute",o)),this.setSeconds=(r,o)=>this.adjustOffset(r.set("second",o)),this.setMilliseconds=(r,o)=>this.adjustOffset(r.set("millisecond",o)),this.getDaysInMonth=r=>r.daysInMonth(),this.getWeekArray=r=>{const o=this.startOfWeek(this.startOfMonth(r)),i=this.endOfWeek(this.endOfMonth(r));let s=0,a=o;const l=[];for(;a<i;){const u=Math.floor(s/7);l[u]=l[u]||[],l[u].push(a),a=this.addDays(a,1),s+=1}return l},this.getWeekNumber=r=>r.week(),this.getYearRange=([r,o])=>{const i=this.startOfYear(r),s=this.endOfYear(o),a=[];let l=i;for(;this.isBefore(l,s);)a.push(l),l=this.addYears(l,1);return a},this.dayjs=CB(_t,t),this.locale=t,this.formats=Y({},xB,n),_t.extend(iB)}getDayOfWeek(t){return t.day()+1}}function EB(e,t,n,r,o){const[i,s]=M.useState(()=>o&&n?n(e).matches:r?r(e).matches:t);return yn(()=>{if(!n)return;const a=n(e),l=()=>{s(a.matches)};return l(),a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[e,n]),i}const vB={...M},X2=vB.useSyncExternalStore;function TB(e,t,n,r,o){const i=M.useCallback(()=>t,[t]),s=M.useMemo(()=>{if(o&&n)return()=>n(e).matches;if(r!==null){const{matches:d}=r(e);return()=>d}return i},[i,e,r,o,n]),[a,l]=M.useMemo(()=>{if(n===null)return[i,()=>()=>{}];const d=n(e);return[()=>d.matches,f=>(d.addEventListener("change",f),()=>{d.removeEventListener("change",f)})]},[i,n,e]);return X2(l,a,s)}function Z2(e={}){const{themeId:t}=e;return function(r,o={}){let i=fb();i&&t&&(i=i[t]||i);const s=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:a=!1,matchMedia:l=s?window.matchMedia:null,ssrMatchMedia:u=null,noSsr:d=!1}=A2({name:"MuiUseMediaQuery",props:o,theme:i});let f=typeof r=="function"?r(i):r;return f=f.replace(/^@media( ?)/m,""),f.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
199
+ `)),(X2!==void 0?TB:EB)(f,a,l,u,d)}}Z2();const J2=Z2({themeId:Cs}),SB={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},ma=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),kB=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let i;if(e!=null)i=e;else if(o.includes(t))i=t;else if(o.length>0)i=o[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:i}},Qu=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},qa=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,utils:s,timezone:a})=>{const l=Qu(s,s.date(void 0,a),e);n&&s.isBefore(o,l)&&(o=l),t&&s.isAfter(r,l)&&(r=l);let u=e,d=e;for(s.isBefore(e,o)&&(u=o,d=null),s.isAfter(e,r)&&(d&&(d=r),u=null);u||d;){if(u&&s.isAfter(u,r)&&(u=null),d&&s.isBefore(d,o)&&(d=null),u){if(!i(u))return u;u=s.addDays(u,1)}if(d){if(!i(d))return d;d=s.addDays(d,-1)}}return null},wB=(e,t)=>t==null||!e.isValid(t)?null:t,vr=(e,t,n)=>t==null||!e.isValid(t)?n:t,DB=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),Xp=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const o=r[r.length-1];r.push(e.addMonths(o,1))}return r},eC=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),IB=["year","month","day"],M1=e=>IB.includes(e),Zp=(e,{format:t,views:n},r)=>{if(t!=null)return t;const o=e.formats;return ma(n,["year"])?o.year:ma(n,["month"])?o.month:ma(n,["day"])?o.dayOfMonth:ma(n,["month","year"])?`${o.month} ${o.year}`:ma(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},AB=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},OB=["hours","minutes","seconds"],MB=e=>OB.includes(e),P1=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),PB=(e,t)=>(n,r)=>e?t.isAfter(n,r):P1(n,t)>P1(r,t),Kr={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},RB=e=>Math.max(...e.map(t=>Kr[t.type]??1)),ga=(e,t,n)=>{if(t===Kr.year)return e.startOfYear(n);if(t===Kr.month)return e.startOfMonth(n);if(t===Kr.day)return e.startOfDay(n);let r=n;return t<Kr.minutes&&(r=e.setMinutes(r,0)),t<Kr.seconds&&(r=e.setSeconds(r,0)),t<Kr.milliseconds&&(r=e.setMilliseconds(r,0)),r},NB=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:o})=>{let i=o?o():ga(t,n,eC(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,i)&&(i=ga(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,i)&&(i=ga(t,n,e.maxDate));const s=PB(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&s(e.minTime,i)&&(i=ga(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:Qu(t,i,e.minTime))),e.maxTime!=null&&s(i,e.maxTime)&&(i=ga(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:Qu(t,i,e.maxTime))),i},tC=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
200
+ `));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},FB=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},Mc=(e,t)=>{const n=[],r=e.date(void 0,"default"),o=e.startOfWeek(r),i=e.endOfWeek(r);let s=o;for(;e.isBefore(s,i);)n.push(s),s=e.addDays(s,1);return n.map(a=>e.formatByString(a,t))},nC=(e,t,n,r)=>{switch(n){case"month":return Xp(e,e.date(void 0,t)).map(o=>e.formatByString(o,r));case"weekDay":return Mc(e,r);case"meridiem":{const o=e.date(void 0,t);return[e.startOfDay(o),e.endOfDay(o)].map(i=>e.formatByString(i,r))}default:return[]}},R1="s",LB=["0","1","2","3","4","5","6","7","8","9"],_B=e=>{const t=e.date(void 0);return e.formatByString(e.setSeconds(t,0),R1)==="0"?LB:Array.from({length:10}).map((r,o)=>e.formatByString(e.setSeconds(t,o),R1))},gi=(e,t)=>{if(t[0]==="0")return e;const n=[];let r="";for(let o=0;o<e.length;o+=1){r+=e[o];const i=t.indexOf(r);i>-1&&(n.push(i.toString()),r="")}return n.join("")},Jp=(e,t)=>t[0]==="0"?e:e.split("").map(n=>t[Number(n)]).join(""),N1=(e,t)=>{const n=gi(e,t);return n!==" "&&!Number.isNaN(Number(n))},rC=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},oC=(e,t,n,r,o)=>{if(o.type==="day"&&o.contentType==="digit-with-letter"){const s=e.setDate(n.longestMonth,t);return e.formatByString(s,o.format)}let i=t.toString();return o.hasLeadingZerosInInput&&(i=rC(i,o.maxLength)),Jp(i,r)},BB=(e,t,n,r,o,i,s,a)=>{const l=FB(r),u=r==="Home",d=r==="End",f=n.value===""||u||d,h=()=>{const m=o[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),b=C=>oC(e,C,m,i,n),y=n.type==="minutes"&&a?.minutesStep?a.minutesStep:1;let x;if(f){if(n.type==="year"&&!d&&!u)return e.formatByString(e.date(void 0,t),n.format);l>0||u?x=m.minimum:x=m.maximum}else x=parseInt(gi(n.value,i),10)+l*y;return x%y!==0&&((l<0||u)&&(x+=y-(y+x)%y),(l>0||d)&&(x-=x%y)),x>m.maximum?b(m.minimum+(x-m.maximum-1)%(m.maximum-m.minimum+1)):x<m.minimum?b(m.maximum-(m.minimum-x-1)%(m.maximum-m.minimum+1)):b(x)},p=()=>{const m=nC(e,t,n.type,n.format);if(m.length===0)return n.value;if(f)return l>0||u?m[0]:m[m.length-1];const x=((m.indexOf(n.value)+l)%m.length+m.length)%m.length;return m[x]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?h():p()},eh=(e,t,n)=>{let r=e.value||e.placeholder;const o=t==="non-input"?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return t==="non-input"&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(gi(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&e.contentType==="digit"&&!o&&r.length===1&&(r=`${r}‎`),t==="input-rtl"&&(r=`⁨${r}⁩`),r},F1=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),jB=(e,t)=>e.formatByString(e.date(void 0,"system"),t).length===4,iC=(e,t,n,r)=>{if(t!=="digit")return!1;const o=e.date(void 0,"default");switch(n){case"year":return e.lib==="dayjs"&&r==="YY"?!0:e.formatByString(e.setYear(o,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(o),r).length>1;case"day":return e.formatByString(e.startOfMonth(o),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(o),r).length>1;case"hours":return e.formatByString(e.setHours(o,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(o,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(o,1),r).length>1;default:throw new Error("Invalid section type")}},$B=(e,t,n)=>{const r=t.some(l=>l.type==="day"),o=[],i=[];for(let l=0;l<t.length;l+=1){const u=t[l];r&&u.type==="weekDay"||(o.push(u.format),i.push(eh(u,"non-input",n)))}const s=o.join(" "),a=i.join(" ");return e.parse(a,s)},HB=e=>e.map(t=>`${t.startSeparator}${t.value||t.placeholder}${t.endSeparator}`).join(""),zB=(e,t,n)=>{const o=e.map(i=>{const s=eh(i,n?"input-rtl":"input-ltr",t);return`${i.startSeparator}${s}${i.endSeparator}`}).join("");return n?`⁦${o}⁩`:o},UB=(e,t,n)=>{const r=e.date(void 0,n),o=e.endOfYear(r),i=e.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=Xp(e,r).reduce((l,u)=>{const d=e.getDaysInMonth(u);return d>l.maxDaysInMonth?{maxDaysInMonth:d,longestMonth:u}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:jB(e,l)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(o)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&e.isValid(l)?e.getDaysInMonth(l):s,longestMonth:a}),weekDay:({format:l,contentType:u})=>{if(u==="digit"){const d=Mc(e,l).map(Number);return{minimum:Math.min(...d),maximum:Math.max(...d)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const u=e.getHours(i);return gi(e.formatByString(e.endOfDay(r),l),t)!==u.toString()?{minimum:1,maximum:Number(gi(e.formatByString(e.startOfDay(r),l),t))}:{minimum:0,maximum:u}},minutes:()=>({minimum:0,maximum:e.getMinutes(i)}),seconds:()=>({minimum:0,maximum:e.getSeconds(i)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},VB=(e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{const o=Mc(e,t.format),i=e.formatByString(n,t.format),s=o.indexOf(i),l=o.indexOf(t.value)-s;return e.addDays(n,l)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const o=e.getHours(n)<12,i=e.getHours(r);return o&&i>=12?e.addHours(r,-12):!o&&i<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}},L1={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},_1=(e,t,n,r,o)=>[...n].sort((i,s)=>L1[i.type]-L1[s.type]).reduce((i,s)=>!o||s.modified?VB(e,s,t,i):i,r),WB=()=>navigator.userAgent.toLowerCase().includes("android"),qB=(e,t)=>{const n={};if(!t)return e.forEach((l,u)=>{const d=u===0?null:u-1,f=u===e.length-1?null:u+1;n[u]={leftIndex:d,rightIndex:f}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},o={};let i=0,s=0,a=e.length-1;for(;a>=0;){s=e.findIndex((l,u)=>u>=i&&l.endSeparator?.includes(" ")&&l.endSeparator!==" / "),s===-1&&(s=e.length-1);for(let l=s;l>=i;l-=1)o[l]=a,r[a]=l,a-=1;i=s+1}return e.forEach((l,u)=>{const d=o[u],f=d===0?null:r[d-1],h=d===e.length-1?null:r[d+1];n[u]={leftIndex:f,rightIndex:h}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},jf=(e,t)=>{if(e==null)return null;if(e==="all")return"all";if(typeof e=="string"){const n=t.findIndex(r=>r.type===e);return n===-1?null:n}return e},YB=(e,t)=>{if(e.value)switch(e.type){case"month":{if(e.contentType==="digit")return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");const n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return e.contentType==="digit"?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;case"weekDay":return;default:return}},KB=(e,t)=>{if(e.value)switch(e.type){case"weekDay":return e.contentType==="letter"?void 0:Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return e.contentType==="digit-with-letter"?parseInt(e.value,10):Number(e.value);case"month":{if(e.contentType==="digit")return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return e.contentType!=="letter"?Number(e.value):void 0}},GB=["value","referenceDate"],Zr={emptyValue:null,getTodayValue:eC,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=Ze(e,GB);return t!=null&&r.utils.isValid(t)?t:n??NB(r)},cleanValue:wB,areValuesEqual:DB,isSameError:(e,t)=>e===t,hasError:e=>e!=null,defaultErrorState:null,getTimezone:(e,t)=>t==null||!e.isValid(t)?null:e.getTimezone(t),setTimezone:(e,t,n)=>n==null?null:e.setTimezone(n,t)},QB={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&!!n?n:r(t),getV7HiddenInputValueFromSections:HB,getV6InputValueFromSections:zB,getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!e.isValid(n)?t.referenceValue:n})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},XB=["localeText"],$f=M.createContext(null),Xu=function(t){const{localeText:n}=t,r=Ze(t,XB),{utils:o,localeText:i}=M.useContext($f)??{utils:void 0,localeText:void 0},s=Kt({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:u,dateLibInstance:d,adapterLocale:f,localeText:h}=s,p=M.useMemo(()=>Y({},h,i,n),[h,i,n]),m=M.useMemo(()=>{if(!l)return o||null;const x=new l({locale:f,formats:u,instance:d});if(!x.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
201
+ `));return x},[l,f,u,d,o]),b=M.useMemo(()=>m?{minDate:m.date("1900-01-01T00:00:00.000"),maxDate:m.date("2099-12-31T00:00:00.000")}:null,[m]),y=M.useMemo(()=>({utils:m,defaultDates:b,localeText:p}),[b,m,p]);return c.jsx($f.Provider,{value:y,children:a})},ZB=e=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:Y({},e)}}}}),sC=e=>{const{utils:t,formatKey:n,contextTranslation:r,propsTranslation:o}=e;return i=>{const s=i!==null&&t.isValid(i)?t.format(i,n):null;return(o??r)(i,t,s)}},aC={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>e==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,r)=>`Select ${e}. ${!r&&(t===null||!n.isValid(t))?"No time selected":`Selected time is ${r??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>e.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>e.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},JB=aC;ZB(aC);const Ti=()=>{const e=M.useContext($f);if(e===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(`
202
202
  `));if(e.utils===null)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(`
203
- `));const t=M.useMemo(()=>Y({},GB,e.localeText),[e.localeText]);return M.useMemo(()=>Y({},e,{localeText:t}),[e,t])},Zt=()=>Ti().utils,kl=()=>Ti().defaultDates,Pc=e=>{const t=Zt(),n=M.useRef(void 0);return n.current===void 0&&(n.current=t.date(void 0,e)),n.current};function QB(e){return Ge("MuiPickersToolbar",e)}We("MuiPickersToolbar",["root","content"]);const XB=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],ZB=e=>{const{classes:t}=e;return Ke({root:["root"],content:["content"]},QB,t)},JB=fe("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),ej=fe("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),tj=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersToolbar"}),{children:o,className:i,toolbarTitle:s,hidden:a,titleId:l}=r,u=Ze(r,XB),d=r,f=ZB(d);return a?null:c.jsxs(JB,Y({ref:n,className:Ue(f.root,i),ownerState:d},u,{children:[c.jsx(Dt,{color:"text.secondary",variant:"overline",id:l,children:s}),c.jsx(ej,{className:f.content,ownerState:d,children:o})]}))}),vo=()=>Ti().localeText;function nj(e){return Ge("MuiDatePickerToolbar",e)}We("MuiDatePickerToolbar",["root","title"]);const rj=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],oj=e=>{const{classes:t}=e;return Ke({root:["root"],title:["title"]},nj,t)},ij=fe(tj,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),sj=fe(Dt,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),aj=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiDatePickerToolbar"}),{value:o,isLandscape:i,toolbarFormat:s,toolbarPlaceholder:a="––",views:l,className:u}=r,d=Ze(r,rj),f=Zt(),h=vo(),p=oj(r),m=M.useMemo(()=>{if(!o)return a;const y=Zp(f,{format:s,views:l},!0);return f.formatByString(o,y)},[o,s,a,f,l]),b=r;return c.jsx(ij,Y({ref:n,toolbarTitle:h.datePickerToolbarTitle,isLandscape:i,className:Ue(p.root,u)},d,{children:c.jsx(sj,{variant:"h4",align:i?"left":"center",ownerState:b,className:p.title,children:m})}))});function iC(e,t){const n=Zt(),r=kl(),o=Kt({props:e,name:t}),i=M.useMemo(()=>o.localeText?.toolbarTitle==null?o.localeText:Y({},o.localeText,{datePickerToolbarTitle:o.localeText.toolbarTitle}),[o.localeText]);return Y({},o,{localeText:i},EB({views:o.views,openTo:o.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:o.disableFuture??!1,disablePast:o.disablePast??!1,minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate),slots:Y({toolbar:aj},o.slots)})}const wl=({props:e,value:t,timezone:n,adapter:r})=>{if(t===null)return null;const{shouldDisableDate:o,shouldDisableMonth:i,shouldDisableYear:s,disablePast:a,disableFuture:l}=e,u=r.utils.date(void 0,n),d=vr(r.utils,e.minDate,r.defaultDates.minDate),f=vr(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(o&&o(t)):return"shouldDisableDate";case!!(i&&i(t)):return"shouldDisableMonth";case!!(s&&s(t)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(t,u)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(t,u)):return"disablePast";case!!(d&&r.utils.isBeforeDay(t,d)):return"minDate";case!!(f&&r.utils.isAfterDay(t,f)):return"maxDate";default:return null}};wl.valueManager=Zr;const sC=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],lj=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],uj=["minDateTime","maxDateTime"],cj=[...sC,...lj,...uj],aC=e=>cj.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{});function lC(e){const{props:t,validator:n,value:r,timezone:o,onError:i}=e,s=Ti(),a=M.useRef(n.valueManager.defaultErrorState),l=n({adapter:s,value:r,timezone:o,props:t}),u=n.valueManager.hasError(l);M.useEffect(()=>{i&&!n.valueManager.isSameError(l,a.current)&&i(l,r),a.current=l},[n,i,l,r]);const d=Ve(f=>n({adapter:s,value:f,timezone:o,props:t}));return{validationError:l,hasValidationError:u,getValidationErrorForNewValue:d}}function dj(e){return Ge("MuiInputAdornment",e)}const B1=We("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var j1;const fj=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Fe(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},pj=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:o,size:i,variant:s}=e,a={root:["root",n&&"disablePointerEvents",o&&`position${Fe(o)}`,s,r&&"hiddenLabel",i&&`size${Fe(i)}`]};return Ke(a,dj,t)},hj=fe("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:fj})(ft(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${B1.positionStart}&:not(.${B1.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),uC=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiInputAdornment"}),{children:o,className:i,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:u,variant:d,...f}=r,h=ar()||{};let p=d;d&&h.variant,h&&!p&&(p=h.variant);const m={...r,hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:a,position:u,variant:p},b=pj(m);return c.jsx(kc.Provider,{value:null,children:c.jsx(hj,{as:s,ownerState:m,className:Ue(b.root,i),ref:n,...f,children:typeof o=="string"&&!l?c.jsx(Dt,{color:"textSecondary",children:o}):c.jsxs(M.Fragment,{children:[u==="start"?j1||(j1=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,o]})})})});function mj(e){return Ge("MuiPickersPopper",e)}We("MuiPickersPopper",["root","paper"]);function gj(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const bj=(e,t)=>n=>{(n.key==="Enter"||n.key===" ")&&(e(n),n.preventDefault(),n.stopPropagation())},Wn=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?Wn(t.shadowRoot):t:null},yj="@media (pointer: fine)",xj="@media (prefers-reduced-motion: reduce)",as=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),$1=as&&as[1]?parseInt(as[1],10):null,H1=as&&as[2]?parseInt(as[2],10):null,Cj=$1&&$1<10||H1&&H1<13||!1,cC=()=>Q2(xj,{defaultMatches:!1})||Cj,Ej=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],vj=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"]},mj,t)},Tj=fe(Qp,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),Sj=fe(Ci,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:e})=>["top","top-start","top-end"].includes(e),style:{transformOrigin:"bottom center"}}]});function kj(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function wj(e,t){const n=M.useRef(!1),r=M.useRef(!1),o=M.useRef(null),i=M.useRef(!1);M.useEffect(()=>{if(!e)return;function l(){i.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),i.current=!1}},[e]);const s=Ve(l=>{if(!i.current)return;const u=r.current;r.current=!1;const d=mn(o.current);if(!o.current||"clientX"in l&&kj(l,d))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(o.current)>-1:f=!d.documentElement.contains(l.target)||o.current.contains(l.target),!f&&!u&&t(l)}),a=()=>{r.current=!0};return M.useEffect(()=>{if(e){const l=mn(o.current),u=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",u),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",u)}}},[e,s]),M.useEffect(()=>{if(e){const l=mn(o.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[e,s]),[o,a,a]}const Dj=M.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:o,children:i,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:u}=e,d=Ze(e,Ej),f=Y({},o,{placement:r}),h=Et({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:a,ownerState:f});return c.jsx(n,Y({},d,h,{onClick:p=>{l(p),h.onClick?.(p)},onTouchStart:p=>{u(p),h.onTouchStart?.(p)},ownerState:f,children:i}))});function Ij(e){const t=Kt({props:e,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:o=null,shouldRestoreFocus:i,onBlur:s,onDismiss:a,open:l,role:u,placement:d,slots:f,slotProps:h,reduceAnimations:p}=t;M.useEffect(()=>{function L($){l&&$.key==="Escape"&&a()}return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L)}},[a,l]);const m=M.useRef(null);M.useEffect(()=>{u==="tooltip"||i&&!i()||(l?m.current=Wn(document):m.current&&m.current instanceof HTMLElement&&setTimeout(()=>{m.current instanceof HTMLElement&&m.current.focus()}))},[l,u,i]);const[b,y,x]=wj(l,s??a),C=M.useRef(null),v=vt(C,o),S=vt(v,b),I=t,T=vj(I),N=cC(),O=p??N,F=L=>{L.key==="Escape"&&(L.stopPropagation(),a())},B=f?.desktopTransition??O?hi:el,j=f?.desktopTrapFocus??d2,D=f?.desktopPaper??Sj,H=f?.popper??Tj,_=Et({elementType:H,externalSlotProps:h?.popper,additionalProps:{transition:!0,role:u,open:l,anchorEl:n,placement:d,onKeyDown:F},className:T.root,ownerState:t});return c.jsx(H,Y({},_,{children:({TransitionProps:L,placement:$})=>c.jsx(j,Y({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:u==="tooltip",isEnabled:()=>!0},h?.desktopTrapFocus,{children:c.jsx(B,Y({},L,h?.desktopTransition,{children:c.jsx(Dj,{PaperComponent:D,ownerState:I,popperPlacement:$,ref:S,onPaperClick:y,onPaperTouchStart:x,paperClasses:T.paper,paperSlotProps:h?.desktopPaper,children:r})}))}))}))}const Aj=({open:e,onOpen:t,onClose:n})=>{const r=M.useRef(typeof e=="boolean").current,[o,i]=M.useState(!1);M.useEffect(()=>{if(r){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(e)}},[r,e]);const s=M.useCallback(a=>{r||i(a),a&&t&&t(),!a&&n&&n()},[r,t,n]);return{isOpen:o,setIsOpen:s}},th=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:o,valueManager:i})=>{const s=Zt(),a=M.useRef(n),l=t??a.current??i.emptyValue,u=M.useMemo(()=>i.getTimezone(s,l),[s,i,l]),d=Ve(m=>u==null?m:i.setTimezone(s,u,m));let f;e?f=e:u?f=u:r?f=s.getTimezone(r):f="default";const h=M.useMemo(()=>i.setTimezone(s,f,l),[i,s,f,l]),p=Ve((m,...b)=>{const y=d(m);o?.(y,...b)});return{value:h,handleValueChange:p,timezone:f}},nh=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:o,onChange:i,valueManager:s})=>{const[a,l]=or({name:e,state:"value",controlled:n,default:r??s.emptyValue}),u=Ve((d,...f)=>{l(d),i?.(d,...f)});return th({timezone:t,value:a,defaultValue:void 0,referenceDate:o,onChange:u,valueManager:s})},Oj=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o}=e,i=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromField"?!0:t.name==="setValueFromAction"?i&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastPublishedValue):t.name==="setValueFromView"&&t.selectionState!=="shallow"||t.name==="setValueFromShortcut"?i?!0:n(r.lastPublishedValue):!1},Mj=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o,closeOnSelect:i}=e,s=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromAction"?s&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastCommittedValue):t.name==="setValueFromView"&&t.selectionState==="finish"&&i?s?!0:n(r.lastCommittedValue):t.name==="setValueFromShortcut"?t.changeImportance==="accept"&&n(r.lastCommittedValue):!1},Pj=e=>{const{action:t,closeOnSelect:n}=e;return t.name==="setValueFromAction"?!0:t.name==="setValueFromView"?t.selectionState==="finish"&&n:t.name==="setValueFromShortcut"?t.changeImportance==="accept":!1},Rj=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o})=>{const{onAccept:i,onChange:s,value:a,defaultValue:l,closeOnSelect:u=r==="desktop",timezone:d,referenceDate:f}=e,{current:h}=M.useRef(l),{current:p}=M.useRef(a!==void 0),[m,b]=M.useState(d),y=Zt(),x=Ti(),{isOpen:C,setIsOpen:v}=Aj(e),{timezone:S,value:I,handleValueChange:T}=th({timezone:d,value:a,defaultValue:h,referenceDate:f,onChange:s,valueManager:t}),[N,O]=M.useState(()=>{let ae;return I!==void 0?ae=I:h!==void 0?ae=h:ae=t.emptyValue,{draft:ae,lastPublishedValue:ae,lastCommittedValue:ae,lastControlledValue:a,hasBeenModifiedSinceMount:!1}}),F=t.getTimezone(y,N.draft);m!==d&&(b(d),d&&F&&d!==F&&O(ae=>Y({},ae,{draft:t.setTimezone(y,d,ae.draft)})));const{getValidationErrorForNewValue:B}=lC({props:e,validator:o,timezone:S,value:N.draft,onError:e.onError}),j=Ve(ae=>{const ie={action:ae,dateState:N,hasChanged:Ce=>!t.areValuesEqual(y,ae.value,Ce),isControlled:p,closeOnSelect:u},Z=Oj(ie),me=Mj(ie),le=Pj(ie);O(Ce=>Y({},Ce,{draft:ae.value,lastPublishedValue:Z?ae.value:Ce.lastPublishedValue,lastCommittedValue:me?ae.value:Ce.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let ue=null;const Ie=()=>(ue||(ue={validationError:ae.name==="setValueFromField"?ae.context.validationError:B(ae.value)},ae.name==="setValueFromShortcut"&&(ue.shortcut=ae.shortcut)),ue);Z&&T(ae.value,Ie()),me&&i&&i(ae.value,Ie()),le&&v(!1)});if(N.lastControlledValue!==a){const ae=t.areValuesEqual(y,N.draft,I);O(ie=>Y({},ie,{lastControlledValue:a},ae?{}:{lastCommittedValue:I,lastPublishedValue:I,draft:I,hasBeenModifiedSinceMount:!0}))}const D=Ve(()=>{j({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),H=Ve(()=>{j({value:N.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),_=Ve(()=>{j({value:N.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),L=Ve(()=>{j({value:N.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),$=Ve(()=>{j({value:t.getTodayValue(y,S,n),name:"setValueFromAction",pickerAction:"today"})}),K=Ve(ae=>{ae.preventDefault(),v(!0)}),G=Ve(ae=>{ae?.preventDefault(),v(!1)}),q=Ve((ae,ie="partial")=>j({name:"setValueFromView",value:ae,selectionState:ie})),R=Ve((ae,ie,Z)=>j({name:"setValueFromShortcut",value:ae,changeImportance:ie,shortcut:Z})),oe=Ve((ae,ie)=>j({name:"setValueFromField",value:ae,context:ie})),se={onClear:D,onAccept:H,onDismiss:_,onCancel:L,onSetToday:$,onOpen:K,onClose:G},z={value:N.draft,onChange:oe},pe=M.useMemo(()=>t.cleanValue(y,N.draft),[y,t,N.draft]),J={value:pe,onChange:q,onClose:G,open:C},re=Y({},se,{value:pe,onChange:q,onSelectShortcut:R,isValid:ae=>{const ie=o({adapter:x,value:ae,timezone:S,props:e});return!t.hasError(ie)}}),ne=M.useMemo(()=>({onOpen:K,onClose:G,open:C}),[C,G,K]);return{open:C,fieldProps:z,viewProps:J,layoutProps:re,actions:se,contextValue:ne}};function dC({onChange:e,onViewChange:t,openTo:n,view:r,views:o,autoFocus:i,focusedView:s,onFocusedViewChange:a}){const l=M.useRef(n),u=M.useRef(o),d=M.useRef(o.includes(n)?n:o[0]),[f,h]=or({name:"useViews",state:"view",controlled:r,default:d.current}),p=M.useRef(i?f:null),[m,b]=or({name:"useViews",state:"focusedView",controlled:s,default:p.current});M.useEffect(()=>{(l.current&&l.current!==n||u.current&&u.current.some(N=>!o.includes(N)))&&(h(o.includes(n)?n:o[0]),u.current=o,l.current=n)},[n,h,f,o]);const y=o.indexOf(f),x=o[y-1]??null,C=o[y+1]??null,v=Ve((N,O)=>{b(O?N:F=>N===F?null:F),a?.(N,O)}),S=Ve(N=>{v(N,!0),N!==f&&(h(N),t&&t(N))}),I=Ve(()=>{C&&S(C)}),T=Ve((N,O,F)=>{const B=O==="finish",j=F?o.indexOf(F)<o.length-1:!!C;if(e(N,B&&j?"partial":O,F),F&&F!==f){const H=o[o.indexOf(F)+1];H&&S(H)}else B&&I()});return{view:f,setView:S,focusedView:m,setFocusedView:v,nextView:C,previousView:x,defaultView:o.includes(n)?n:o[0],goToNextView:I,setValueAndGoToNextView:T}}const Nj=["className","sx"],Fj=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:o,fieldRef:i})=>{const{onChange:s,open:a,onClose:l}=t,{view:u,views:d,openTo:f,onViewChange:h,viewRenderers:p,timezone:m}=e,b=Ze(e,Nj),{view:y,setView:x,defaultView:C,focusedView:v,setFocusedView:S,setValueAndGoToNextView:I}=dC({view:u,views:d,openTo:f,onChange:s,onViewChange:h,autoFocus:r}),{hasUIView:T,viewModeLookup:N}=M.useMemo(()=>d.reduce((_,L)=>{let $;return p[L]!=null?$="UI":$="field",_.viewModeLookup[L]=$,$==="UI"&&(_.hasUIView=!0),_},{hasUIView:!1,viewModeLookup:{}}),[p,d]),O=M.useMemo(()=>d.reduce((_,L)=>p[L]!=null&&DB(L)?_+1:_,0),[p,d]),F=N[y],B=Ve(()=>F==="UI"),[j,D]=M.useState(F==="UI"?y:null);return j!==y&&N[y]==="UI"&&D(y),yn(()=>{F==="field"&&a&&(l(),setTimeout(()=>{i?.current?.setSelectedSections(y),i?.current?.focusField(y)}))},[y]),yn(()=>{if(!a)return;let _=y;F==="field"&&j!=null&&(_=j),_!==C&&N[_]==="UI"&&N[C]==="UI"&&(_=C),_!==y&&x(_),S(_,!0)},[a]),{hasUIView:T,shouldRestoreFocus:B,layoutProps:{views:d,view:j,onViewChange:x},renderCurrentView:()=>{if(j==null)return null;const _=p[j];if(_==null)return null;const L=Y({},b,n,t,{views:d,timezone:m,onChange:I,view:j,onViewChange:x,focusedView:v,onFocusedViewChange:S,showViewSwitcher:O>1,timeViewsCount:O});return o?o(p,j,L):_(L)}}};function z1(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const Lj=(e,t)=>{const[n,r]=M.useState(z1);return yn(()=>{const i=()=>{r(z1())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),gj(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},_j=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:o}=e,i=Lj(n.views,o),s=kr();return{layoutProps:Y({},n,t,{isLandscape:i,isRtl:s,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}};function Bj(e){const{props:t,pickerValueResponse:n}=e;return M.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}const fC=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:o,validator:i,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{const u=Rj({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i}),d=Fj({props:e,additionalViewProps:o,autoFocusView:s,fieldRef:l,propsFromPickerValue:u.viewProps,rendererInterceptor:a}),f=_j({props:e,wrapperVariant:r,propsFromPickerValue:u.layoutProps,propsFromPickerViews:d.layoutProps}),h=Bj({props:e,pickerValueResponse:u});return{open:u.open,actions:u.actions,fieldProps:u.fieldProps,renderCurrentView:d.renderCurrentView,hasUIView:d.hasUIView,shouldRestoreFocus:d.shouldRestoreFocus,layoutProps:f.layoutProps,contextValue:u.contextValue,ownerState:h}};function pC(e){return Ge("MuiPickersLayout",e)}const Xo=We("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),jj=["onAccept","onClear","onCancel","onSetToday","actions"];function $j(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:o,actions:i}=e,s=Ze(e,jj),a=vo();if(i==null||i.length===0)return null;const l=i?.map(u=>{switch(u){case"clear":return c.jsx(tn,{onClick:n,children:a.clearButtonLabel},u);case"cancel":return c.jsx(tn,{onClick:r,children:a.cancelButtonLabel},u);case"accept":return c.jsx(tn,{onClick:t,children:a.okButtonLabel},u);case"today":return c.jsx(tn,{onClick:o,children:a.todayButtonLabel},u);default:return null}});return c.jsx(ro,Y({},s,{children:l}))}function Hj(e){return Ge("MuiListItem",e)}We("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);const zj=We("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function Uj(e){return Ge("MuiListItemSecondaryAction",e)}We("MuiListItemSecondaryAction",["root","disableGutters"]);const Vj=e=>{const{disableGutters:t,classes:n}=e;return Ke({root:["root",t&&"disableGutters"]},Uj,n)},Wj=fe("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),hC=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemSecondaryAction"}),{className:o,...i}=r,s=M.useContext(ho),a={...r,disableGutters:s.disableGutters},l=Vj(a);return c.jsx(Wj,{className:Ue(l.root,o),ownerState:a,ref:n,...i})});hC.muiName="ListItemSecondaryAction";const qj=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},Yj=e=>{const{alignItems:t,classes:n,dense:r,disableGutters:o,disablePadding:i,divider:s,hasSecondaryAction:a}=e;return Ke({root:["root",r&&"dense",!o&&"gutters",!i&&"padding",s&&"divider",t==="flex-start"&&"alignItemsFlexStart",a&&"secondaryAction"],container:["container"]},Hj,n)},Kj=fe("div",{name:"MuiListItem",slot:"Root",overridesResolver:qj})(ft(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${zj.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),Gj=fe("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),Qj=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItem"}),{alignItems:o="center",children:i,className:s,component:a,components:l={},componentsProps:u={},ContainerComponent:d="li",ContainerProps:{className:f,...h}={},dense:p=!1,disableGutters:m=!1,disablePadding:b=!1,divider:y=!1,secondaryAction:x,slotProps:C={},slots:v={},...S}=r,I=M.useContext(ho),T=M.useMemo(()=>({dense:p||I.dense||!1,alignItems:o,disableGutters:m}),[o,I.dense,p,m]),N=M.useRef(null),O=M.Children.toArray(i),F=O.length&&ou(O[O.length-1],["ListItemSecondaryAction"]),B={...r,alignItems:o,dense:T.dense,disableGutters:m,disablePadding:b,divider:y,hasSecondaryAction:F},j=Yj(B),D=vt(N,n),H=v.root||l.Root||Kj,_=C.root||u.root||{},L={className:Ue(j.root,_.className,s),...S};let $=a||"li";return F?($=!L.component&&!a?"div":$,d==="li"&&($==="li"?$="div":L.component==="li"&&(L.component="div")),c.jsx(ho.Provider,{value:T,children:c.jsxs(Gj,{as:d,className:Ue(j.container,f),ref:D,ownerState:B,...h,children:[c.jsx(H,{..._,...!hs(H)&&{as:$,ownerState:{...B,..._.ownerState}},...L,children:O}),O.pop()]})})):c.jsx(ho.Provider,{value:T,children:c.jsxs(H,{..._,as:$,ref:D,...!hs(H)&&{ownerState:{...B,..._.ownerState}},...L,children:[O,x&&c.jsx(hC,{children:x})]})})}),il=36,Rc=2,Nc=320,Xj=280,rh=336,Zj=["items","changeImportance","isLandscape","onChange","isValid"],Jj=["getValue"];function e$(e){const{items:t,changeImportance:n="accept",onChange:r,isValid:o}=e,i=Ze(e,Zj);if(t==null||t.length===0)return null;const s=t.map(a=>{let{getValue:l}=a,u=Ze(a,Jj);const d=l({isValid:o});return Y({},u,{label:u.label,onClick:()=>{r(d,n,u)},disabled:!o(d)})});return c.jsx(I2,Y({dense:!0,sx:[{maxHeight:rh,maxWidth:200,overflow:"auto"},...Array.isArray(i.sx)?i.sx:[i.sx]]},i,{children:s.map(a=>c.jsx(Qj,{children:c.jsx(Y2,Y({},a))},a.id??a.label))}))}function t$(e){return e.view!==null}const n$=e=>{const{classes:t,isLandscape:n}=e;return Ke({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},pC,t)},r$=e=>{const{wrapperVariant:t,onAccept:n,onClear:r,onCancel:o,onSetToday:i,view:s,views:a,onViewChange:l,value:u,onChange:d,onSelectShortcut:f,isValid:h,isLandscape:p,disabled:m,readOnly:b,children:y,slots:x,slotProps:C}=e,v=n$(e),S=x?.actionBar??$j,I=Et({elementType:S,externalSlotProps:C?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:o,onSetToday:i,actions:t==="desktop"?[]:["cancel","accept"]},className:v.actionBar,ownerState:Y({},e,{wrapperVariant:t})}),T=c.jsx(S,Y({},I)),N=x?.toolbar,O=Et({elementType:N,externalSlotProps:C?.toolbar,additionalProps:{isLandscape:p,onChange:d,value:u,view:s,onViewChange:l,views:a,disabled:m,readOnly:b},className:v.toolbar,ownerState:Y({},e,{wrapperVariant:t})}),F=t$(O)&&N?c.jsx(N,Y({},O)):null,B=y,j=x?.tabs,D=s&&j?c.jsx(j,Y({view:s,onViewChange:l,className:v.tabs},C?.tabs)):null,H=x?.shortcuts??e$,_=Et({elementType:H,externalSlotProps:C?.shortcuts,additionalProps:{isValid:h,isLandscape:p,onChange:f},className:v.shortcuts,ownerState:{isValid:h,isLandscape:p,onChange:f,wrapperVariant:t}}),L=s&&H?c.jsx(H,Y({},_)):null;return{toolbar:F,content:B,tabs:D,actionBar:T,shortcuts:L}},o$=e=>{const{isLandscape:t,classes:n}=e;return Ke({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},pC,n)},i$=fe("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${Xo.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${Xo.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${Xo.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${Xo.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${Xo.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${Xo.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${Xo.shortcuts}`]:{gridColumn:3}}}]}),s$=fe("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),mC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersLayout"}),{toolbar:o,content:i,tabs:s,actionBar:a,shortcuts:l}=r$(r),{sx:u,className:d,isLandscape:f,wrapperVariant:h}=r,p=o$(r);return c.jsxs(i$,{ref:n,sx:u,className:Ue(p.root,d),ownerState:r,children:[f?l:o,f?o:l,c.jsx(s$,{className:p.contentWrapper,children:h==="desktop"?c.jsxs(M.Fragment,{children:[i,s]}):c.jsxs(M.Fragment,{children:[s,i]})}),a]})}),a$=M.createContext(null);function gC(e){const{contextValue:t,localeText:n,children:r}=e;return c.jsx(a$.Provider,{value:t,children:c.jsx(Xu,{localeText:n,children:r})})}const l$=["props","getOpenDialogAriaText"],u$=["ownerState"],c$=["ownerState"],d$=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=Ze(e,l$);const{slots:o,slotProps:i,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,name:m,label:b,inputRef:y,readOnly:x,disabled:C,autoFocus:v,localeText:S,reduceAnimations:I}=t,T=M.useRef(null),N=M.useRef(null),O=_r(),F=i?.toolbar?.hidden??!1,{open:B,actions:j,hasUIView:D,layoutProps:H,renderCurrentView:_,shouldRestoreFocus:L,fieldProps:$,contextValue:K,ownerState:G}=fC(Y({},r,{props:t,fieldRef:N,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),q=o.inputAdornment??uC,R=Et({elementType:q,externalSlotProps:i?.inputAdornment,additionalProps:{position:"end"},ownerState:t}),oe=Ze(R,u$),se=o.openPickerButton??Ir,z=Et({elementType:se,externalSlotProps:i?.openPickerButton,additionalProps:{disabled:C||x,onClick:B?j.onClose:j.onOpen,"aria-label":n($.value),edge:oe.position},ownerState:t}),pe=Ze(z,c$),J=o.openPickerIcon,Q=Et({elementType:J,externalSlotProps:i?.openPickerIcon,ownerState:G}),re=o.field,ne=Et({elementType:re,externalSlotProps:i?.field,additionalProps:Y({},$,F&&{id:O},{readOnly:x,disabled:C,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,label:b,name:m,autoFocus:v&&!t.open,focused:B?!0:void 0},y?{inputRef:y}:{}),ownerState:t});D&&(ne.InputProps=Y({},ne.InputProps,{ref:T},!t.disableOpenPicker&&{[`${oe.position}Adornment`]:c.jsx(q,Y({},oe,{children:c.jsx(se,Y({},pe,{children:c.jsx(J,Y({},Q))}))}))}));const ae=Y({textField:o.textField,clearIcon:o.clearIcon,clearButton:o.clearButton},ne.slots),ie=o.layout??mC;let Z=O;F&&(b?Z=`${O}-label`:Z=void 0);const me=Y({},i,{toolbar:Y({},i?.toolbar,{titleId:O}),popper:Y({"aria-labelledby":Z},i?.popper)}),le=vt(N,ne.unstableFieldRef);return{renderPicker:()=>c.jsxs(gC,{contextValue:K,localeText:S,children:[c.jsx(re,Y({},ne,{slots:ae,slotProps:me,unstableFieldRef:le})),c.jsx(Ij,Y({role:"dialog",placement:"bottom-start",anchorEl:T.current},j,{open:B,slots:o,slotProps:me,shouldRestoreFocus:L,reduceAnimations:I,children:c.jsx(ie,Y({},H,me?.layout,{slots:o,slotProps:me,children:_()}))}))]})}},f$=mt(c.jsx("path",{d:"M7 10l5 5 5-5z"})),p$=mt(c.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})),h$=mt(c.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),m$=mt(c.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}));mt(c.jsxs(M.Fragment,{children:[c.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),c.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));mt(c.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}));mt(c.jsxs(M.Fragment,{children:[c.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),c.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));const g$=mt(c.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),b$=({utils:e,format:t})=>{let n=10,r=t,o=e.expandFormat(t);for(;o!==r;)if(r=o,o=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return o},y$=({utils:e,expandedFormat:t})=>{const n=[],{start:r,end:o}=e.escapedCharacters,i=new RegExp(`(\\${r}[^\\${o}]*\\${o})+`,"g");let s=null;for(;s=i.exec(t);)n.push({start:s.index,end:i.lastIndex-1});return n},x$=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},C$=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:o,now:i,token:s,startSeparator:a})=>{if(s==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=Z2(e,s),u=nC(e,l.contentType,l.type,s),d=n?u:l.contentType==="digit",f=t!=null&&e.isValid(t);let h=f?e.formatByString(t,s):"",p=null;if(d)if(u)p=h===""?e.formatByString(i,s).length:h.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);p=l.maxLength,f&&(h=Jp(eC(gi(h,o),p),o))}return Y({},l,{format:s,maxLength:p,value:h,placeholder:x$(e,r,l,s),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:d,startSeparator:a,endSeparator:"",modified:!1})},E$=e=>{const{utils:t,expandedFormat:n,escapedParts:r}=e,o=t.date(void 0),i=[];let s="";const a=Object.keys(t.formatTokenMap).sort((p,m)=>m.length-p.length),l=/^([a-zA-Z]+)/,u=new RegExp(`^(${a.join("|")})*$`),d=new RegExp(`^(${a.join("|")})`),f=p=>r.find(m=>m.start<=p&&m.end>=p);let h=0;for(;h<n.length;){const p=f(h),m=p!=null,b=l.exec(n.slice(h))?.[1];if(!m&&b!=null&&u.test(b)){let y=b;for(;y.length>0;){const x=d.exec(y)[1];y=y.slice(x.length),i.push(C$(Y({},e,{now:o,token:x,startSeparator:s}))),s=""}h+=b.length}else{const y=n[h];m&&p?.start===h||p?.end===h||(i.length===0?s+=y:i[i.length-1].endSeparator+=y),h+=1}}return i.length===0&&s.length>0&&i.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),i},v$=({isRtl:e,formatDensity:t,sections:n})=>n.map(r=>{const o=i=>{let s=i;return e&&s!==null&&s.includes(" ")&&(s=`⁩${s}⁦`),t==="spacious"&&["/",".","-"].includes(s)&&(s=` ${s} `),s};return r.startSeparator=o(r.startSeparator),r.endSeparator=o(r.endSeparator),r}),U1=e=>{let t=b$(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=y$(Y({},e,{expandedFormat:t})),r=E$(Y({},e,{expandedFormat:t,escapedParts:n}));return v$(Y({},e,{sections:r}))},T$=e=>{const t=Zt(),n=vo(),r=Ti(),o=kr(),{valueManager:i,fieldValueManager:s,valueType:a,validator:l,internalProps:u,internalProps:{value:d,defaultValue:f,referenceDate:h,onChange:p,format:m,formatDensity:b="dense",selectedSections:y,onSelectedSectionsChange:x,shouldRespectLeadingZeros:C=!1,timezone:v,enableAccessibleFieldDOMStructure:S=!1}}=e,{timezone:I,value:T,handleValueChange:N}=th({timezone:v,value:d,defaultValue:f,referenceDate:h,onChange:p,valueManager:i}),O=M.useMemo(()=>RB(t),[t]),F=M.useMemo(()=>jB(t,O,I),[t,O,I]),B=M.useCallback((J,Q=null)=>s.getSectionsFromValue(t,J,Q,re=>U1({utils:t,localeText:n,localizedDigits:O,format:m,date:re,formatDensity:b,shouldRespectLeadingZeros:C,enableAccessibleFieldDOMStructure:S,isRtl:o})),[s,m,n,O,o,C,t,b,S]),[j,D]=M.useState(()=>{const J=B(T),Q={sections:J,value:T,referenceValue:i.emptyValue,tempValueStrAndroid:null},re=AB(J),ne=i.getInitialReferenceValue({referenceDate:h,value:T,utils:t,props:u,granularity:re,timezone:I});return Y({},Q,{referenceValue:ne})}),[H,_]=or({controlled:y,default:null,name:"useField",state:"selectedSections"}),L=J=>{_(J),x?.(J)},$=M.useMemo(()=>jf(H,j.sections),[H,j.sections]),K=$==="all"?0:$,G=({value:J,referenceValue:Q,sections:re})=>{if(D(ae=>Y({},ae,{sections:re,value:J,referenceValue:Q,tempValueStrAndroid:null})),i.areValuesEqual(t,j.value,J))return;const ne={validationError:l({adapter:r,value:J,timezone:I,props:u})};N(J,ne)},q=(J,Q)=>{const re=[...j.sections];return re[J]=Y({},re[J],{value:Q,modified:!0}),re},R=()=>{G({value:i.emptyValue,referenceValue:j.referenceValue,sections:B(i.emptyValue)})},oe=()=>{if(K==null)return;const J=j.sections[K],Q=s.getActiveDateManager(t,j,J),ne=Q.getSections(j.sections).filter(me=>me.value!=="").length===(J.value===""?0:1),ae=q(K,""),ie=ne?null:t.getInvalidDate(),Z=Q.getNewValuesFromNewActiveDate(ie);G(Y({},Z,{sections:ae}))},se=J=>{const Q=(ae,ie)=>{const Z=t.parse(ae,m);if(Z==null||!t.isValid(Z))return null;const me=U1({utils:t,localeText:n,localizedDigits:O,format:m,date:Z,formatDensity:b,shouldRespectLeadingZeros:C,enableAccessibleFieldDOMStructure:S,isRtl:o});return _1(t,Z,me,ie,!1)},re=s.parseValueStr(J,j.referenceValue,Q),ne=s.updateReferenceValue(t,re,j.referenceValue);G({value:re,referenceValue:ne,sections:B(re,j.sections)})},z=({activeSection:J,newSectionValue:Q,shouldGoToNextSection:re})=>{re&&K<j.sections.length-1&&L(K+1);const ne=s.getActiveDateManager(t,j,J),ae=q(K,Q),ie=ne.getSections(ae),Z=LB(t,ie,O);let me,le;if(Z!=null&&t.isValid(Z)){const ue=_1(t,Z,ie,ne.referenceDate,!0);me=ne.getNewValuesFromNewActiveDate(ue),le=!0}else me=ne.getNewValuesFromNewActiveDate(Z),le=(Z!=null&&!t.isValid(Z))!=(ne.date!=null&&!t.isValid(ne.date));return le?G(Y({},me,{sections:ae})):D(ue=>Y({},ue,me,{sections:ae,tempValueStrAndroid:null}))},pe=J=>D(Q=>Y({},Q,{tempValueStrAndroid:J}));return M.useEffect(()=>{const J=B(j.value);D(Q=>Y({},Q,{sections:J}))},[m,t.locale,o]),M.useEffect(()=>{let J;i.areValuesEqual(t,j.value,T)?J=i.getTimezone(t,j.value)!==i.getTimezone(t,T):J=!0,J&&D(Q=>Y({},Q,{value:T,referenceValue:s.updateReferenceValue(t,T,Q.referenceValue),sections:B(T)}))},[T]),{state:j,activeSectionIndex:K,parsedSelectedSections:$,setSelectedSections:L,clearValue:R,clearActiveSection:oe,updateSectionValue:z,updateValueFromValueStr:se,setTempAndroidValueStr:pe,getSectionsFromValue:B,sectionsValueBoundaries:F,localizedDigits:O,timezone:I}},S$=5e3,Ki=e=>e.saveQuery!=null,k$=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:o,timezone:i})=>{const s=Zt(),[a,l]=M.useState(null),u=Ve(()=>l(null));M.useEffect(()=>{a!=null&&e[a.sectionIndex]?.type!==a.sectionType&&u()},[e,a,u]),M.useEffect(()=>{if(a!=null){const m=setTimeout(()=>u(),S$);return()=>{clearTimeout(m)}}return()=>{}},[a,u]);const d=({keyPressed:m,sectionIndex:b},y,x)=>{const C=m.toLowerCase(),v=e[b];if(a!=null&&(!x||x(a.value))&&a.sectionIndex===b){const I=`${a.value}${C}`,T=y(I,v);if(!Ki(T))return l({sectionIndex:b,value:I,sectionType:v.type}),T}const S=y(C,v);return Ki(S)&&!S.saveQuery?(u(),null):(l({sectionIndex:b,value:C,sectionType:v.type}),Ki(S)?null:S)},f=m=>{const b=(C,v,S)=>{const I=v.filter(T=>T.toLowerCase().startsWith(S));return I.length===0?{saveQuery:!1}:{sectionValue:I[0],shouldGoToNextSection:I.length===1}},y=(C,v,S,I)=>{const T=N=>J2(s,i,v.type,N);if(v.contentType==="letter")return b(v.format,T(v.format),C);if(S&&I!=null&&Z2(s,S).contentType==="letter"){const N=T(S),O=b(S,N,C);return Ki(O)?{saveQuery:!1}:Y({},O,{sectionValue:I(O.sectionValue,N)})}return{saveQuery:!1}};return d(m,(C,v)=>{switch(v.type){case"month":{const S=I=>F1(s,I,s.formats.month,v.format);return y(C,v,s.formats.month,S)}case"weekDay":{const S=(I,T)=>T.indexOf(I).toString();return y(C,v,s.formats.weekday,S)}case"meridiem":return y(C,v);default:return{saveQuery:!1}}})},h=m=>{const b=(x,C)=>{const v=gi(x,r),S=Number(v),I=n[C.type]({currentDate:null,format:C.format,contentType:C.contentType});if(S>I.maximum)return{saveQuery:!1};if(S<I.minimum)return{saveQuery:!0};const T=S*10>I.maximum||v.length===I.maximum.toString().length;return{sectionValue:tC(s,S,I,r,C),shouldGoToNextSection:T}};return d(m,(x,C)=>{if(C.contentType==="digit"||C.contentType==="digit-with-letter")return b(x,C);if(C.type==="month"){nC(s,"digit","month","MM");const v=b(x,{type:C.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(Ki(v))return v;const S=F1(s,v.sectionValue,"MM",C.format);return Y({},v,{sectionValue:S})}if(C.type==="weekDay"){const v=b(x,C);if(Ki(v))return v;const S=Mc(s,C.format)[Number(v.sectionValue)-1];return Y({},v,{sectionValue:S})}return{saveQuery:!1}},x=>N1(x,r))};return{applyCharacterEditing:Ve(m=>{const b=e[m.sectionIndex],x=N1(m.keyPressed,r)?h(Y({},m,{keyPressed:Jp(m.keyPressed,r)})):f(m);if(x==null){o(null);return}t({activeSection:b,newSectionValue:x.sectionValue,shouldGoToNextSection:x.shouldGoToNextSection})}),resetCharacterQuery:u}},w$=e=>{const{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:o,onClick:i,onFocus:s,onInput:a,onPaste:l,focused:u,autoFocus:d=!1},fieldValueManager:f,applyCharacterEditing:h,resetCharacterQuery:p,setSelectedSections:m,parsedSelectedSections:b,state:y,clearActiveSection:x,clearValue:C,updateSectionValue:v,updateValueFromValueStr:S,sectionOrder:I,areAllSectionsEmpty:T,sectionsValueBoundaries:N}=e,O=M.useRef(null),F=vt(r,O),B=vo(),j=Zt(),D=_r(),[H,_]=M.useState(!1),L=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!O.current)return;const le=document.getSelection();if(!le)return;if(b==null){le.rangeCount>0&&O.current.getRoot().contains(le.getRangeAt(0).startContainer)&&le.removeAllRanges(),H&&O.current.getRoot().blur();return}if(!O.current.getRoot().contains(Wn(document)))return;const ue=new window.Range;let Ie;b==="all"?Ie=O.current.getRoot():y.sections[b].type==="empty"?Ie=O.current.getSectionContainer(b):Ie=O.current.getSectionContent(b),ue.selectNodeContents(Ie),Ie.focus(),le.removeAllRanges(),le.addRange(ue)},getActiveSectionIndexFromDOM:()=>{const le=Wn(document);return!le||!O.current||!O.current.getRoot().contains(le)?null:O.current.getSectionIndexFromDOMElement(le)},focusField:(le=0)=>{if(!O.current||L.getActiveSectionIndexFromDOM()!=null)return;const ue=jf(le,y.sections);_(!0),O.current.getSectionContent(ue).focus()},setSelectedSections:le=>{if(!O.current)return;const ue=jf(le,y.sections);_((ue==="all"?0:ue)!==null),m(le)},isFieldFocused:()=>{const le=Wn(document);return!!O.current&&O.current.getRoot().contains(le)}}),[b,m,y.sections,H]),$=Ve(le=>{if(!O.current)return;const ue=y.sections[le];O.current.getSectionContent(le).innerHTML=ue.value||ue.placeholder,L.syncSelectionToDOM()}),K=Ve((le,...ue)=>{le.isDefaultPrevented()||!O.current||(_(!0),i?.(le,...ue),b==="all"?setTimeout(()=>{const Ie=document.getSelection().getRangeAt(0).startOffset;if(Ie===0){m(I.startIndex);return}let Ce=0,we=0;for(;we<Ie&&Ce<y.sections.length;){const ye=y.sections[Ce];Ce+=1,we+=`${ye.startSeparator}${ye.value||ye.placeholder}${ye.endSeparator}`.length}m(Ce-1)}):H?O.current.getRoot().contains(le.target)||m(I.startIndex):(_(!0),m(I.startIndex)))}),G=Ve(le=>{if(a?.(le),!O.current||b!=="all")return;const Ie=le.target.textContent??"";O.current.getRoot().innerHTML=y.sections.map(Ce=>`${Ce.startSeparator}${Ce.value||Ce.placeholder}${Ce.endSeparator}`).join(""),L.syncSelectionToDOM(),Ie.length===0||Ie.charCodeAt(0)===10?(p(),C(),m("all")):Ie.length>1?S(Ie):(b==="all"&&m(0),h({keyPressed:Ie,sectionIndex:0}))}),q=Ve(le=>{if(l?.(le),n||b!=="all"){le.preventDefault();return}const ue=le.clipboardData.getData("text");le.preventDefault(),p(),S(ue)}),R=Ve((...le)=>{if(s?.(...le),H||!O.current)return;_(!0),O.current.getSectionIndexFromDOMElement(Wn(document))!=null||m(I.startIndex)}),oe=Ve((...le)=>{o?.(...le),setTimeout(()=>{if(!O.current)return;const ue=Wn(document);!O.current.getRoot().contains(ue)&&(_(!1),m(null))})}),se=Ve(le=>ue=>{ue.isDefaultPrevented()||m(le)}),z=Ve(le=>{le.preventDefault()}),pe=Ve(le=>()=>{m(le)}),J=Ve(le=>{if(le.preventDefault(),n||t||typeof b!="number")return;const ue=y.sections[b],Ie=le.clipboardData.getData("text"),Ce=/^[a-zA-Z]+$/.test(Ie),we=/^[0-9]+$/.test(Ie),ye=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Ie);ue.contentType==="letter"&&Ce||ue.contentType==="digit"&&we||ue.contentType==="digit-with-letter"&&ye?(p(),v({activeSection:ue,newSectionValue:Ie,shouldGoToNextSection:!0})):!Ce&&!we&&(p(),S(Ie))}),Q=Ve(le=>{le.preventDefault(),le.dataTransfer.dropEffect="none"}),re=Ve(le=>{if(!O.current)return;const ue=le.target,Ie=ue.textContent??"",Ce=O.current.getSectionIndexFromDOMElement(ue),we=y.sections[Ce];if(n||!O.current){$(Ce);return}if(Ie.length===0){if(we.value===""){$(Ce);return}const ye=le.nativeEvent.inputType;if(ye==="insertParagraph"||ye==="insertLineBreak"){$(Ce);return}p(),x();return}h({keyPressed:Ie,sectionIndex:Ce}),$(Ce)});yn(()=>{if(!(!H||!O.current)){if(b==="all")O.current.getRoot().focus();else if(typeof b=="number"){const le=O.current.getSectionContent(b);le&&le.focus()}}},[b,H]);const ne=M.useMemo(()=>y.sections.reduce((le,ue)=>(le[ue.type]=N[ue.type]({currentDate:null,contentType:ue.contentType,format:ue.format}),le),{}),[N,y.sections]),ae=b==="all",ie=M.useMemo(()=>y.sections.map((le,ue)=>{const Ie=!ae&&!t&&!n;return{container:{"data-sectionindex":ue,onClick:se(ue)},content:{tabIndex:ae||ue>0?-1:0,contentEditable:!ae&&!t&&!n,role:"spinbutton",id:`${D}-${le.type}`,"aria-labelledby":`${D}-${le.type}`,"aria-readonly":n,"aria-valuenow":VB(le,j),"aria-valuemin":ne[le.type].minimum,"aria-valuemax":ne[le.type].maximum,"aria-valuetext":le.value?UB(le,j):B.empty,"aria-label":B[le.type],"aria-disabled":t,spellCheck:Ie?!1:void 0,autoCapitalize:Ie?"off":void 0,autoCorrect:Ie?"off":void 0,[parseInt(M.version,10)>=17?"enterKeyHint":"enterkeyhint"]:Ie?"next":void 0,children:le.value||le.placeholder,onInput:re,onPaste:J,onFocus:pe(ue),onDragOver:Q,onMouseUp:z,inputMode:le.contentType==="letter"?"text":"numeric"},before:{children:le.startSeparator},after:{children:le.endSeparator}}}),[y.sections,pe,J,Q,re,se,z,t,n,ae,B,j,ne,D]),Z=Ve(le=>{S(le.target.value)}),me=M.useMemo(()=>T?"":f.getV7HiddenInputValueFromSections(y.sections),[T,y.sections,f]);return M.useEffect(()=>{if(O.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","<DatePicker slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(`
204
- `));d&&O.current&&O.current.getSectionContent(I.startIndex).focus()},[]),{interactions:L,returnedValue:{autoFocus:d,readOnly:n,focused:u??H,sectionListRef:F,onBlur:oe,onClick:K,onFocus:R,onInput:G,onPaste:q,enableAccessibleFieldDOMStructure:!0,elements:ie,tabIndex:b===0?-1:0,contentEditable:ae,value:me,onChange:Z,areAllSectionsEmpty:T}}},Ji=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),D$=(e,t,n)=>{let r=0,o=n?1:0;const i=[];for(let s=0;s<e.length;s+=1){const a=e[s],l=eh(a,n?"input-rtl":"input-ltr",t),u=`${a.startSeparator}${l}${a.endSeparator}`,d=Ji(u).length,f=u.length,h=Ji(l),p=o+(h===""?0:l.indexOf(h[0]))+a.startSeparator.length,m=p+h.length;i.push(Y({},a,{start:r,end:r+d,startInInput:p,endInInput:m})),r+=d,o+=f}return i},I$=e=>{const t=kr(),n=M.useRef(void 0),r=M.useRef(void 0),{forwardedProps:{onFocus:o,onClick:i,onPaste:s,onBlur:a,inputRef:l,placeholder:u},internalProps:{readOnly:d=!1,disabled:f=!1},parsedSelectedSections:h,activeSectionIndex:p,state:m,fieldValueManager:b,valueManager:y,applyCharacterEditing:x,resetCharacterQuery:C,updateSectionValue:v,updateValueFromValueStr:S,clearActiveSection:I,clearValue:T,setTempAndroidValueStr:N,setSelectedSections:O,getSectionsFromValue:F,areAllSectionsEmpty:B,localizedDigits:j}=e,D=M.useRef(null),H=vt(l,D),_=M.useMemo(()=>D$(m.sections,j,t),[m.sections,j,t]),L=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!D.current)return;if(h==null){D.current.scrollLeft&&(D.current.scrollLeft=0);return}if(D.current!==Wn(document))return;const re=D.current.scrollTop;if(h==="all")D.current.select();else{const ne=_[h],ae=ne.type==="empty"?ne.startInInput-ne.startSeparator.length:ne.startInInput,ie=ne.type==="empty"?ne.endInInput+ne.endSeparator.length:ne.endInInput;(ae!==D.current.selectionStart||ie!==D.current.selectionEnd)&&D.current===Wn(document)&&D.current.setSelectionRange(ae,ie),clearTimeout(r.current),r.current=setTimeout(()=>{D.current&&D.current===Wn(document)&&D.current.selectionStart===D.current.selectionEnd&&(D.current.selectionStart!==ae||D.current.selectionEnd!==ie)&&L.syncSelectionToDOM()})}D.current.scrollTop=re},getActiveSectionIndexFromDOM:()=>{const re=D.current.selectionStart??0,ne=D.current.selectionEnd??0;if(re===0&&ne===0)return null;const ae=re<=_[0].startInInput?1:_.findIndex(ie=>ie.startInInput-ie.startSeparator.length>re);return ae===-1?_.length-1:ae-1},focusField:(re=0)=>{Wn(document)!==D.current&&(D.current?.focus(),O(re))},setSelectedSections:re=>O(re),isFieldFocused:()=>D.current===Wn(document)}),[D,h,_,O]),$=()=>{const re=D.current.selectionStart??0;let ne;re<=_[0].startInInput||re>=_[_.length-1].endInInput?ne=1:ne=_.findIndex(ie=>ie.startInInput-ie.startSeparator.length>re);const ae=ne===-1?_.length-1:ne-1;O(ae)},K=Ve((...re)=>{o?.(...re);const ne=D.current;clearTimeout(n.current),n.current=setTimeout(()=>{!ne||ne!==D.current||p==null&&(ne.value.length&&Number(ne.selectionEnd)-Number(ne.selectionStart)===ne.value.length?O("all"):$())})}),G=Ve((re,...ne)=>{re.isDefaultPrevented()||(i?.(re,...ne),$())}),q=Ve(re=>{if(s?.(re),re.preventDefault(),d||f)return;const ne=re.clipboardData.getData("text");if(typeof h=="number"){const ae=m.sections[h],ie=/^[a-zA-Z]+$/.test(ne),Z=/^[0-9]+$/.test(ne),me=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ne);if(ae.contentType==="letter"&&ie||ae.contentType==="digit"&&Z||ae.contentType==="digit-with-letter"&&me){C(),v({activeSection:ae,newSectionValue:ne,shouldGoToNextSection:!0});return}if(ie||Z)return}C(),S(ne)}),R=Ve((...re)=>{a?.(...re),O(null)}),oe=Ve(re=>{if(d)return;const ne=re.target.value;if(ne===""){C(),T();return}const ae=re.nativeEvent.data,ie=ae&&ae.length>1,Z=ie?ae:ne,me=Ji(Z);if(h==="all"&&O(p),p==null||ie){S(ie?ae:me);return}let le;if(h==="all"&&me.length===1)le=me;else{const ue=Ji(b.getV6InputValueFromSections(_,j,t));let Ie=-1,Ce=-1;for(let Ne=0;Ne<ue.length;Ne+=1)Ie===-1&&ue[Ne]!==me[Ne]&&(Ie=Ne),Ce===-1&&ue[ue.length-Ne-1]!==me[me.length-Ne-1]&&(Ce=Ne);const we=_[p];if(Ie<we.start||ue.length-Ce-1>we.end)return;const ze=me.length-ue.length+we.end-Ji(we.endSeparator||"").length;le=me.slice(we.start+Ji(we.startSeparator||"").length,ze)}if(le.length===0){HB()&&N(Z),C(),I();return}x({keyPressed:le,sectionIndex:p})}),se=M.useMemo(()=>u!==void 0?u:b.getV6InputValueFromSections(F(y.emptyValue),j,t),[u,b,F,y.emptyValue,j,t]),z=M.useMemo(()=>m.tempValueStrAndroid??b.getV6InputValueFromSections(m.sections,j,t),[m.sections,b,m.tempValueStrAndroid,j,t]);M.useEffect(()=>(D.current&&D.current===Wn(document)&&O("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const pe=M.useMemo(()=>p==null||m.sections[p].contentType==="letter"?"text":"numeric",[p,m.sections]),Q=!(D.current&&D.current===Wn(document))&&B;return{interactions:L,returnedValue:{readOnly:d,onBlur:R,onClick:G,onFocus:K,onPaste:q,inputRef:H,enableAccessibleFieldDOMStructure:!1,placeholder:se,inputMode:pe,autoComplete:"off",value:Q?"":z,onChange:oe}}},A$=e=>{const t=Zt(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:o,enableAccessibleFieldDOMStructure:i=!1,disabled:s=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:u,clearable:d,onClear:f},fieldValueManager:h,valueManager:p,validator:m}=e,b=kr(),y=T$(e),{state:x,activeSectionIndex:C,parsedSelectedSections:v,setSelectedSections:S,clearValue:I,clearActiveSection:T,updateSectionValue:N,setTempAndroidValueStr:O,sectionsValueBoundaries:F,localizedDigits:B,timezone:j}=y,D=k$({sections:x.sections,updateSectionValue:N,sectionsValueBoundaries:F,localizedDigits:B,setTempAndroidValueStr:O,timezone:j}),{resetCharacterQuery:H}=D,_=p.areValuesEqual(t,x.value,p.emptyValue),L=i?w$:I$,$=M.useMemo(()=>zB(x.sections,b&&!i),[x.sections,b,i]),{returnedValue:K,interactions:G}=L(Y({},e,y,D,{areAllSectionsEmpty:_,sectionOrder:$})),q=Ve(J=>{if(l?.(J),!s)switch(!0){case((J.ctrlKey||J.metaKey)&&String.fromCharCode(J.keyCode)==="A"&&!J.shiftKey&&!J.altKey):{J.preventDefault(),S("all");break}case J.key==="ArrowRight":{if(J.preventDefault(),v==null)S($.startIndex);else if(v==="all")S($.endIndex);else{const Q=$.neighbors[v].rightIndex;Q!==null&&S(Q)}break}case J.key==="ArrowLeft":{if(J.preventDefault(),v==null)S($.endIndex);else if(v==="all")S($.startIndex);else{const Q=$.neighbors[v].leftIndex;Q!==null&&S(Q)}break}case J.key==="Delete":{if(J.preventDefault(),a)break;v==null||v==="all"?I():T(),H();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(J.key):{if(J.preventDefault(),a||C==null)break;v==="all"&&S(C);const Q=x.sections[C],re=h.getActiveDateManager(t,x,Q),ne=NB(t,j,Q,J.key,F,B,re.date,{minutesStep:o});N({activeSection:Q,newSectionValue:ne,shouldGoToNextSection:!1});break}}});yn(()=>{G.syncSelectionToDOM()});const{hasValidationError:R}=lC({props:n,validator:m,timezone:j,value:x.value,onError:n.onError}),oe=M.useMemo(()=>u!==void 0?u:R,[R,u]);M.useEffect(()=>{!oe&&C==null&&H()},[x.referenceValue,C,oe]),M.useEffect(()=>{x.tempValueStrAndroid!=null&&C!=null&&(H(),T())},[x.sections]),M.useImperativeHandle(r,()=>({getSections:()=>x.sections,getActiveSectionIndex:G.getActiveSectionIndexFromDOM,setSelectedSections:G.setSelectedSections,focusField:G.focusField,isFieldFocused:G.isFieldFocused}));const se=Ve((J,...Q)=>{J.preventDefault(),f?.(J,...Q),I(),G.isFieldFocused()?S($.startIndex):G.focusField(0)}),z={onKeyDown:q,onClear:se,error:oe,clearable:!!(d&&!_&&!a&&!s)},pe={disabled:s,readOnly:a};return Y({},e.forwardedProps,z,pe,K)},O$=["clearable","onClear","InputProps","sx","slots","slotProps"],M$=["ownerState"],P$=e=>{const t=vo(),{clearable:n,onClear:r,InputProps:o,sx:i,slots:s,slotProps:a}=e,l=Ze(e,O$),u=s?.clearButton??Ir,d=Et({elementType:u,externalSlotProps:a?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),f=Ze(d,M$),h=s?.clearIcon??g$,p=Et({elementType:h,externalSlotProps:a?.clearIcon,ownerState:{}});return Y({},l,{InputProps:Y({},o,{endAdornment:c.jsxs(M.Fragment,{children:[n&&c.jsx(uC,{position:"end",sx:{marginRight:o?.endAdornment?-1:-1.5},children:c.jsx(u,Y({},f,{onClick:r,children:c.jsx(h,Y({fontSize:"small"},p))}))}),o?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(i)?i:[i]]})},R$=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],N$=(e,t)=>M.useMemo(()=>{const n=Y({},e),r={},o=i=>{n.hasOwnProperty(i)&&(r[i]=n[i],delete n[i])};return R$.forEach(o),sC.forEach(o),{forwardedProps:n,internalProps:r}},[e,t]),F$=e=>{const t=Zt(),n=kl();return Y({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??t.formats.keyboardDate,minDate:vr(t,e.minDate,n.minDate),maxDate:vr(t,e.maxDate,n.maxDate)})},L$=e=>{const t=F$(e),{forwardedProps:n,internalProps:r}=N$(t,"date");return A$({forwardedProps:n,internalProps:r,valueManager:Zr,fieldValueManager:qB,validator:wl,valueType:"date"})};function _$(e){return Ge("MuiPickersTextField",e)}We("MuiPickersTextField",["root","focused","disabled","error","required"]);function B$(e){return Ge("MuiPickersInputBase",e)}const ls=We("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function j$(e){return Ge("MuiPickersSectionList",e)}const ba=We("MuiPickersSectionList",["root","section","sectionContent"]),$$=["slots","slotProps","elements","sectionListRef"],bC=fe("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),yC=fe("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),xC=fe("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),CC=fe("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),H$=e=>{const{classes:t}=e;return Ke({root:["root"],section:["section"],sectionContent:["sectionContent"]},j$,t)};function z$(e){const{slots:t,slotProps:n,element:r,classes:o}=e,i=t?.section??yC,s=Et({elementType:i,externalSlotProps:n?.section,externalForwardedProps:r.container,className:o.section,ownerState:{}}),a=t?.sectionContent??CC,l=Et({elementType:a,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),u=t?.sectionSeparator??xC,d=Et({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Et({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return c.jsxs(i,Y({},s,{children:[c.jsx(u,Y({},d)),c.jsx(a,Y({},l)),c.jsx(u,Y({},f))]}))}const U$=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersSectionList"}),{slots:o,slotProps:i,elements:s,sectionListRef:a}=r,l=Ze(r,$$),u=H$(r),d=M.useRef(null),f=vt(n,d),h=b=>{if(!d.current)throw new Error(`MUI X: Cannot call sectionListRef.${b} before the mount of the component.`);return d.current};M.useImperativeHandle(a,()=>({getRoot(){return h("getRoot")},getSectionContainer(b){return h("getSectionContainer").querySelector(`.${ba.section}[data-sectionindex="${b}"]`)},getSectionContent(b){return h("getSectionContent").querySelector(`.${ba.section}[data-sectionindex="${b}"] .${ba.sectionContent}`)},getSectionIndexFromDOMElement(b){const y=h("getSectionIndexFromDOMElement");if(b==null||!y.contains(b))return null;let x=null;return b.classList.contains(ba.section)?x=b:b.classList.contains(ba.sectionContent)&&(x=b.parentElement),x==null?null:Number(x.dataset.sectionindex)}}));const p=o?.root??bC,m=Et({elementType:p,externalSlotProps:i?.root,externalForwardedProps:l,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:u.root,ownerState:{}});return c.jsx(p,Y({},m,{children:m.contentEditable?s.map(({content:b,before:y,after:x})=>`${y.children}${b.children}${x.children}`).join(""):c.jsx(M.Fragment,{children:s.map((b,y)=>c.jsx(z$,{slots:o,slotProps:i,element:b,classes:u},y))})}))}),V$=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],W$=e=>Math.round(e*1e5)/1e5,Fc=fe("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>Y({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${W$(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),oh=fe(bC,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:t,focused:n,filled:r,label:o})=>!t&&!n&&!r&&o==null,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:e.palette.mode==="light"?.42:.5}}]})),q$=fe(yC,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),Y$=fe(CC,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),K$=fe(xC,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),G$=fe("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(Y({},CB)),Q$=e=>{const{focused:t,disabled:n,error:r,classes:o,fullWidth:i,readOnly:s,color:a,size:l,endAdornment:u,startAdornment:d}=e,f={root:["root",t&&!n&&"focused",n&&"disabled",s&&"readOnly",r&&"error",i&&"fullWidth",`color${Fe(a)}`,l==="small"&&"inputSizeSmall",!!d&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Ke(f,B$,o)},ih=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersInputBase"}),{elements:o,areAllSectionsEmpty:i,value:s,onChange:a,id:l,endAdornment:u,startAdornment:d,renderSuffix:f,slots:h,slotProps:p,contentEditable:m,tabIndex:b,onInput:y,onPaste:x,onKeyDown:C,name:v,readOnly:S,inputProps:I,inputRef:T,sectionListRef:N}=r,O=Ze(r,V$),F=M.useRef(null),B=vt(n,F),j=vt(I?.ref,T),D=kr(),H=ar();if(!H)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const _=R=>{if(H.disabled){R.stopPropagation();return}H.onFocus?.(R)};M.useEffect(()=>{H&&H.setAdornedStart(!!d)},[H,d]),M.useEffect(()=>{H&&(i?H.onEmpty():H.onFilled())},[H,i]);const L=Y({},r,H,{isRtl:D}),$=Q$(L),K=h?.root||Fc,G=Et({elementType:K,externalSlotProps:p?.root,externalForwardedProps:O,additionalProps:{"aria-invalid":H.error,ref:B},className:$.root,ownerState:L}),q=h?.input||oh;return c.jsxs(K,Y({},G,{children:[d,c.jsx(U$,{sectionListRef:N,elements:o,contentEditable:m,tabIndex:b,className:$.sectionsContainer,onFocus:_,onBlur:H.onBlur,onInput:y,onPaste:x,onKeyDown:C,slots:{root:q,section:q$,sectionContent:Y$,sectionSeparator:K$},slotProps:{root:{ownerState:L},sectionContent:{className:ls.sectionContent},sectionSeparator:({position:R})=>({className:R==="before"?ls.sectionBefore:ls.sectionAfter})}}),u,f?f(Y({},H)):null,c.jsx(G$,Y({name:v,className:$.input,value:s,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:S,required:H.required,disabled:H.disabled},I,{ref:j}))]}))});function X$(e){return Ge("MuiPickersOutlinedInput",e)}const Rr=Y({},ls,We("MuiPickersOutlinedInput",["root","notchedOutline","input"])),Z$=["children","className","label","notched","shrink"],J$=fe("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),V1=fe("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),eH=fe("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function tH(e){const{className:t,label:n}=e,r=Ze(e,Z$),o=n!=null&&n!=="",i=Y({},e,{withLabel:o});return c.jsx(J$,Y({"aria-hidden":!0,className:t},r,{ownerState:i,children:c.jsx(eH,{ownerState:i,children:o?c.jsx(V1,{children:n}):c.jsx(V1,{className:"notranslate",children:"​"})})}))}const nH=["label","autoFocus","ownerState","notched"],rH=fe(Fc,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Rr.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Rr.focused} .${Rr.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Rr.disabled}`]:{[`& .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${Rr.error} .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(n=>(e.vars??e).palette[n]?.main??!1).map(n=>({props:{color:n},style:{[`&.${Rr.focused}:not(.${Rr.error}) .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),oH=fe(oh,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),iH=e=>{const{classes:t}=e,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},X$,t);return Y({},t,r)},EC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersOutlinedInput"}),{label:o,ownerState:i,notched:s}=r,a=Ze(r,nH),l=ar(),u=Y({},r,i,l,{color:l?.color||"primary"}),d=iH(u);return c.jsx(ih,Y({slots:{root:rH,input:oH},renderSuffix:f=>c.jsx(tH,{shrink:!!(s||f.adornedStart||f.focused||f.filled),notched:!!(s||f.adornedStart||f.focused||f.filled),className:d.notchedOutline,label:o!=null&&o!==""&&l?.required?c.jsxs(M.Fragment,{children:[o," ","*"]}):o,ownerState:u})},a,{label:o,classes:d,ref:n}))});EC.muiName="Input";function sH(e){return Ge("MuiPickersFilledInput",e)}const Zo=Y({},ls,We("MuiPickersFilledInput",["root","underline","input"])),aH=["label","autoFocus","disableUnderline","ownerState"],lH=fe(Fc,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Ot.shouldForwardProp(e)&&e!=="disableUnderline"})(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${Zo.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${Zo.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[...Object.keys((e.vars??e).palette).filter(s=>(e.vars??e).palette[s].main).map(s=>({props:{color:s,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Zo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Zo.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Zo.disabled}, .${Zo.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Zo.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:s})=>!!s,style:{paddingLeft:12}},{props:({endAdornment:s})=>!!s,style:{paddingRight:12}}]}}),uH=fe(oh,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),cH=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},sH,t);return Y({},t,o)},vC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersFilledInput"}),{label:o,disableUnderline:i=!1,ownerState:s}=r,a=Ze(r,aH),l=ar(),u=Y({},r,s,l,{color:l?.color||"primary"}),d=cH(u);return c.jsx(ih,Y({slots:{root:lH,input:uH},slotProps:{root:{disableUnderline:i}}},a,{label:o,classes:d,ref:n}))});vC.muiName="Input";function dH(e){return Ge("MuiPickersFilledInput",e)}const ya=Y({},ls,We("MuiPickersInput",["root","input"])),fH=["label","autoFocus","disableUnderline","ownerState"],pH=fe(Fc,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(r=>(e.vars??e).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ya.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ya.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ya.disabled}, .${ya.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${ya.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),hH=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},dH,t);return Y({},t,o)},TC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersInput"}),{label:o,disableUnderline:i=!1,ownerState:s}=r,a=Ze(r,fH),l=ar(),u=Y({},r,s,l,{disableUnderline:i,color:l?.color||"primary"}),d=hH(u);return c.jsx(ih,Y({slots:{root:pH}},a,{label:o,classes:d,ref:n}))});TC.muiName="Input";const mH=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],gH={standard:TC,filled:vC,outlined:EC},bH=fe(Wu,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),yH=e=>{const{focused:t,disabled:n,classes:r,required:o}=e;return Ke({root:["root",t&&!n&&"focused",n&&"disabled",o&&"required"]},_$,r)},xH=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersTextField"}),{onFocus:o,onBlur:i,className:s,color:a="primary",disabled:l=!1,error:u=!1,variant:d="outlined",required:f=!1,InputProps:h,inputProps:p,inputRef:m,sectionListRef:b,elements:y,areAllSectionsEmpty:x,onClick:C,onKeyDown:v,onKeyUp:S,onPaste:I,onInput:T,endAdornment:N,startAdornment:O,tabIndex:F,contentEditable:B,focused:j,value:D,onChange:H,fullWidth:_,id:L,name:$,helperText:K,FormHelperTextProps:G,label:q,InputLabelProps:R}=r,oe=Ze(r,mH),se=M.useRef(null),z=vt(n,se),pe=_r(L),J=K&&pe?`${pe}-helper-text`:void 0,Q=q&&pe?`${pe}-label`:void 0,re=Y({},r,{color:a,disabled:l,error:u,focused:j,required:f,variant:d}),ne=yH(re),ae=gH[d];return c.jsxs(bH,Y({className:Ue(ne.root,s),ref:z,focused:j,onFocus:o,onBlur:i,disabled:l,variant:d,error:u,color:a,fullWidth:_,required:f,ownerState:re},oe,{children:[c.jsx(qu,Y({htmlFor:pe,id:Q},R,{children:q})),c.jsx(ae,Y({elements:y,areAllSectionsEmpty:x,onClick:C,onKeyDown:v,onKeyUp:S,onInput:T,onPaste:I,endAdornment:N,startAdornment:O,tabIndex:F,contentEditable:B,value:D,onChange:H,id:pe,fullWidth:_,inputProps:p,inputRef:m,sectionListRef:b,label:q,name:$,role:"group","aria-labelledby":Q,"aria-describedby":J,"aria-live":J?"polite":void 0},h)),K&&c.jsx(D2,Y({id:J},G,{children:K}))]}))}),CH=["enableAccessibleFieldDOMStructure"],EH=["InputProps","readOnly"],vH=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],TH=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=Ze(e,CH);if(t){const{InputProps:f,readOnly:h}=n,p=Ze(n,EH);return Y({},p,{InputProps:Y({},f??{},{readOnly:h})})}const{onPaste:r,onKeyDown:o,inputMode:i,readOnly:s,InputProps:a,inputProps:l,inputRef:u}=n,d=Ze(n,vH);return Y({},d,{InputProps:Y({},a??{},{readOnly:s}),inputProps:Y({},l??{},{inputMode:i,onPaste:r,onKeyDown:o,ref:u})})},SH=["slots","slotProps","InputProps","inputProps"],SC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiDateField"}),{slots:o,slotProps:i,InputProps:s,inputProps:a}=r,l=Ze(r,SH),u=r,d=o?.textField??(t.enableAccessibleFieldDOMStructure?xH:Ct),f=Et({elementType:d,externalSlotProps:i?.textField,externalForwardedProps:l,additionalProps:{ref:n},ownerState:u});f.inputProps=Y({},a,f.inputProps),f.InputProps=Y({},s,f.InputProps);const h=L$(f),p=TH(h),m=P$(Y({},p,{slots:o,slotProps:i}));return c.jsx(d,Y({},m))}),kC=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:s,timezone:a})=>{const l=Ti();return M.useCallback(u=>wl({adapter:l,value:u,timezone:a,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:s}})!==null,[l,e,t,n,r,o,i,s,a])},kH=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return Y({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{const i=o.newTimezone;if(n.getTimezone(r.currentMonth)===i)return r;let s=n.setTimezone(r.currentMonth,i);return n.getMonth(s)!==n.getMonth(r.currentMonth)&&(s=n.setMonth(s,n.getMonth(r.currentMonth))),Y({},r,{currentMonth:s})}case"finishMonthSwitchingAnimation":return Y({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&n.isSameDay(o.focusedDay,r.focusedDay))return r;const i=o.focusedDay!=null&&!t&&!n.isSameMonth(r.currentMonth,o.focusedDay);return Y({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:i&&!e&&!o.withoutMonthSwitchingAnimation,currentMonth:i?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},wH=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:i=!1,maxDate:s,minDate:a,onMonthChange:l,reduceAnimations:u,shouldDisableDate:d,timezone:f}=e,h=Zt(),p=M.useRef(kH(!!u,i,h)).current,m=M.useMemo(()=>Zr.getInitialReferenceValue({value:t,utils:h,timezone:f,props:e,referenceDate:n,granularity:Kr.day}),[n,f]),[b,y]=M.useReducer(p,{isMonthSwitchingAnimating:!1,focusedDay:m,currentMonth:h.startOfMonth(m),slideDirection:"left"});M.useEffect(()=>{y({type:"changeMonthTimezone",newTimezone:h.getTimezone(m)})},[m,h]);const x=M.useCallback(T=>{y(Y({type:"changeMonth"},T)),l&&l(T.newMonth)},[l]),C=M.useCallback(T=>{const N=T;h.isSameMonth(N,b.currentMonth)||x({newMonth:h.startOfMonth(N),direction:h.isAfterDay(N,b.currentMonth)?"left":"right"})},[b.currentMonth,x,h]),v=kC({shouldDisableDate:d,minDate:a,maxDate:s,disableFuture:r,disablePast:o,timezone:f}),S=M.useCallback(()=>{y({type:"finishMonthSwitchingAnimation"})},[]),I=Ve((T,N)=>{v(T)||y({type:"changeFocusedDay",focusedDay:T,withoutMonthSwitchingAnimation:N})});return{referenceDate:m,calendarState:b,changeMonth:C,changeFocusedDay:I,isDateDisabled:v,onMonthSwitchingAnimationEnd:S,handleChangeMonth:x}},DH=e=>Ge("MuiPickersFadeTransitionGroup",e);We("MuiPickersFadeTransitionGroup",["root"]);const IH=e=>{const{classes:t}=e;return Ke({root:["root"]},DH,t)},AH=fe(El,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function wC(e){const t=Kt({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,s=IH(t),a=Lo();return o?n:c.jsx(AH,{className:Ue(s.root,r),children:c.jsx(hi,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},i)})}function OH(e){return Ge("MuiPickersDay",e)}const Jo=We("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),MH=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],PH=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:o,disabled:i,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=e,u=s&&!a;return Ke({root:["root",t&&!u&&"selected",i&&"disabled",!n&&"dayWithMargin",!r&&o&&"today",s&&a&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},OH,l)},DC=({theme:e})=>Y({},e.typography.caption,{width:il,height:il,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${Jo.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Jo.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Jo.disabled}:not(.${Jo.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${Jo.disabled}&.${Jo.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${Rc}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${Jo.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),IC=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},RH=fe(pi,{name:"MuiPickersDay",slot:"Root",overridesResolver:IC})(DC),NH=fe("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:IC})(({theme:e})=>Y({},DC({theme:e}),{opacity:0,pointerEvents:"none"})),xa=()=>{},FH=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersDay"}),{autoFocus:o=!1,className:i,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:u=!1,isAnimating:d,onClick:f,onDaySelect:h,onFocus:p=xa,onBlur:m=xa,onKeyDown:b=xa,onMouseDown:y=xa,onMouseEnter:x=xa,outsideCurrentMonth:C,selected:v=!1,showDaysOutsideCurrentMonth:S=!1,children:I,today:T=!1}=r,N=Ze(r,MH),O=Y({},r,{autoFocus:o,disabled:a,disableHighlightToday:l,disableMargin:u,selected:v,showDaysOutsideCurrentMonth:S,today:T}),F=PH(O),B=Zt(),j=M.useRef(null),D=vt(j,n);yn(()=>{o&&!a&&!d&&!C&&j.current.focus()},[o,a,d,C]);const H=L=>{y(L),C&&L.preventDefault()},_=L=>{a||h(s),C&&L.currentTarget.focus(),f&&f(L)};return C&&!S?c.jsx(NH,{className:Ue(F.root,F.hiddenDaySpacingFiller,i),ownerState:O,role:N.role}):c.jsx(RH,Y({className:Ue(F.root,i),ref:D,centerRipple:!0,disabled:a,tabIndex:v?0:-1,onKeyDown:L=>b(L,s),onFocus:L=>p(L,s),onBlur:L=>m(L,s),onMouseEnter:L=>x(L,s),onClick:_,onMouseDown:H},N,{ownerState:O,children:I||B.format(s,"dayOfMonth")}))}),LH=M.memo(FH),_H=e=>Ge("MuiPickersSlideTransition",e),dr=We("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),BH=["children","className","reduceAnimations","slideDirection","transKey","classes"],jH=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Ke(r,_H,t)},$H=fe(El,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${dr["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${dr["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${dr.slideEnterActive}`]:t.slideEnterActive},{[`.${dr.slideExit}`]:t.slideExit},{[`.${dr["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${dr["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${dr["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${dr["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${dr.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${dr.slideExit}`]:{transform:"translate(0%)"},[`& .${dr["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${dr["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function HH(e){const t=Kt({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,s=Ze(t,BH),a=jH(t),l=Lo();if(o)return c.jsx("div",{className:Ue(a.root,r),children:n});const u={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return c.jsx($H,{className:Ue(a.root,r),childFactory:d=>M.cloneElement(d,{classNames:u}),role:"presentation",children:c.jsx(Ip,Y({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:u},s,{children:n}),i)})}const zH=e=>Ge("MuiDayCalendar",e);We("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const UH=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],VH=["ownerState"],WH=e=>{const{classes:t}=e;return Ke({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},zH,t)},AC=(il+Rc*2)*6,qH=fe("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),YH=fe("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),KH=fe(Dt,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),GH=fe(Dt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),QH=fe(Dt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>Y({},e.typography.caption,{width:il,height:il,padding:0,margin:`0 ${Rc}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),XH=fe("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:AC}),ZH=fe(HH,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:AC}),JH=fe("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),ez=fe("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${Rc}px 0`,display:"flex",justifyContent:"center"});function tz(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:o,isDateDisabled:i,currentMonthNumber:s,isViewFocused:a}=e,l=Ze(e,UH);const{disabled:u,disableHighlightToday:d,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:h,slots:p,slotProps:m,timezone:b}=t,y=Zt(),x=Pc(b),C=r!==null&&y.isSameDay(n,r),v=o.some(D=>y.isSameDay(D,n)),S=y.isSameDay(n,x),I=p?.day??LH,T=Et({elementType:I,externalSlotProps:m?.day,additionalProps:Y({disableHighlightToday:d,showDaysOutsideCurrentMonth:h,role:"gridcell",isAnimating:f,"data-timestamp":y.toJsDate(n).valueOf()},l),ownerState:Y({},t,{day:n,selected:v})}),N=Ze(T,VH),O=M.useMemo(()=>u||i(n),[u,i,n]),F=M.useMemo(()=>y.getMonth(n)!==s,[y,n,s]),B=M.useMemo(()=>{const D=y.startOfMonth(y.setMonth(n,s));return h?y.isSameDay(n,y.startOfWeek(D)):y.isSameDay(n,D)},[s,n,h,y]),j=M.useMemo(()=>{const D=y.endOfMonth(y.setMonth(n,s));return h?y.isSameDay(n,y.endOfWeek(D)):y.isSameDay(n,D)},[s,n,h,y]);return c.jsx(I,Y({},N,{day:n,disabled:O,autoFocus:a&&C,today:S,outsideCurrentMonth:F,isFirstVisibleCell:B,isLastVisibleCell:j,selected:v,tabIndex:C?0:-1,"aria-selected":v,"aria-current":S?"date":void 0}))}function nz(e){const t=Kt({props:e,name:"MuiDayCalendar"}),n=Zt(),{onFocusedDayChange:r,className:o,currentMonth:i,selectedDays:s,focusedDay:a,loading:l,onSelectedDaysChange:u,onMonthSwitchingAnimationEnd:d,readOnly:f,reduceAnimations:h,renderLoading:p=()=>c.jsx("span",{children:"..."}),slideDirection:m,TransitionProps:b,disablePast:y,disableFuture:x,minDate:C,maxDate:v,shouldDisableDate:S,shouldDisableMonth:I,shouldDisableYear:T,dayOfWeekFormatter:N=Ce=>n.format(Ce,"weekdayShort").charAt(0).toUpperCase(),hasFocus:O,onFocusedViewChange:F,gridLabelId:B,displayWeekNumber:j,fixedWeekNumber:D,autoFocus:H,timezone:_}=t,L=Pc(_),$=WH(t),K=kr(),G=kC({shouldDisableDate:S,shouldDisableMonth:I,shouldDisableYear:T,minDate:C,maxDate:v,disablePast:y,disableFuture:x,timezone:_}),q=vo(),[R,oe]=or({name:"DayCalendar",state:"hasFocus",controlled:O,default:H??!1}),[se,z]=M.useState(()=>a||L),pe=Ve(Ce=>{f||u(Ce)}),J=Ce=>{G(Ce)||(r(Ce),z(Ce),F?.(!0),oe(!0))},Q=Ve((Ce,we)=>{switch(Ce.key){case"ArrowUp":J(n.addDays(we,-7)),Ce.preventDefault();break;case"ArrowDown":J(n.addDays(we,7)),Ce.preventDefault();break;case"ArrowLeft":{const ye=n.addDays(we,K?1:-1),ze=n.addMonths(we,K?1:-1),Ne=qa({utils:n,date:ye,minDate:K?ye:n.startOfMonth(ze),maxDate:K?n.endOfMonth(ze):ye,isDateDisabled:G,timezone:_});J(Ne||ye),Ce.preventDefault();break}case"ArrowRight":{const ye=n.addDays(we,K?-1:1),ze=n.addMonths(we,K?-1:1),Ne=qa({utils:n,date:ye,minDate:K?n.startOfMonth(ze):ye,maxDate:K?ye:n.endOfMonth(ze),isDateDisabled:G,timezone:_});J(Ne||ye),Ce.preventDefault();break}case"Home":J(n.startOfWeek(we)),Ce.preventDefault();break;case"End":J(n.endOfWeek(we)),Ce.preventDefault();break;case"PageUp":J(n.addMonths(we,1)),Ce.preventDefault();break;case"PageDown":J(n.addMonths(we,-1)),Ce.preventDefault();break}}),re=Ve((Ce,we)=>J(we)),ne=Ve((Ce,we)=>{R&&n.isSameDay(se,we)&&F?.(!1)}),ae=n.getMonth(i),ie=n.getYear(i),Z=M.useMemo(()=>s.filter(Ce=>!!Ce).map(Ce=>n.startOfDay(Ce)),[n,s]),me=`${ie}-${ae}`,le=M.useMemo(()=>M.createRef(),[me]),ue=M.useMemo(()=>{const Ce=n.startOfMonth(i),we=n.endOfMonth(i);return G(se)||n.isAfterDay(se,we)||n.isBeforeDay(se,Ce)?qa({utils:n,date:se,minDate:Ce,maxDate:we,disablePast:y,disableFuture:x,isDateDisabled:G,timezone:_}):se},[i,x,y,se,G,n,_]),Ie=M.useMemo(()=>{const Ce=n.getWeekArray(i);let we=n.addMonths(i,1);for(;D&&Ce.length<D;){const ye=n.getWeekArray(we),ze=n.isSameDay(Ce[Ce.length-1][0],ye[0][0]);ye.slice(ze?1:0).forEach(Ne=>{Ce.length<D&&Ce.push(Ne)}),we=n.addMonths(we,1)}return Ce},[i,D,n]);return c.jsxs(qH,{role:"grid","aria-labelledby":B,className:$.root,children:[c.jsxs(YH,{role:"row",className:$.header,children:[j&&c.jsx(GH,{variant:"caption",role:"columnheader","aria-label":q.calendarWeekNumberHeaderLabel,className:$.weekNumberLabel,children:q.calendarWeekNumberHeaderText}),kB(n,L).map((Ce,we)=>c.jsx(KH,{variant:"caption",role:"columnheader","aria-label":n.format(Ce,"weekday"),className:$.weekDayLabel,children:N(Ce)},we.toString()))]}),l?c.jsx(XH,{className:$.loadingContainer,children:p()}):c.jsx(ZH,Y({transKey:me,onExited:d,reduceAnimations:h,slideDirection:m,className:Ue(o,$.slideTransition)},b,{nodeRef:le,children:c.jsx(JH,{ref:le,role:"rowgroup",className:$.monthContainer,children:Ie.map((Ce,we)=>c.jsxs(ez,{role:"row",className:$.weekContainer,"aria-rowindex":we+1,children:[j&&c.jsx(QH,{className:$.weekNumber,role:"rowheader","aria-label":q.calendarWeekNumberAriaLabelText(n.getWeekNumber(Ce[0])),children:q.calendarWeekNumberText(n.getWeekNumber(Ce[0]))}),Ce.map((ye,ze)=>c.jsx(tz,{parentProps:t,day:ye,selectedDays:Z,focusableDay:ue,onKeyDown:Q,onFocus:re,onBlur:ne,onDaySelect:pe,isDateDisabled:G,currentMonthNumber:ae,isViewFocused:R,"aria-colindex":ze+1},ye.toString()))]},`week-${Ce[0]}`))})}))]})}function rz(e){return Ge("MuiPickersMonth",e)}const tu=We("MuiPickersMonth",["root","monthButton","disabled","selected"]),oz=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],iz=e=>{const{disabled:t,selected:n,classes:r}=e;return Ke({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},rz,r)},sz=fe("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),az=fe("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${tu.disabled}`]:t.disabled},{[`&.${tu.selected}`]:t.selected}]})(({theme:e})=>Y({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${tu.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${tu.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),lz=M.memo(function(t){const n=Kt({props:t,name:"MuiPickersMonth"}),{autoFocus:r,className:o,children:i,disabled:s,selected:a,value:l,tabIndex:u,onClick:d,onKeyDown:f,onFocus:h,onBlur:p,"aria-current":m,"aria-label":b,slots:y,slotProps:x}=n,C=Ze(n,oz),v=M.useRef(null),S=iz(n);yn(()=>{r&&v.current?.focus()},[r]);const I=y?.monthButton??az,T=Et({elementType:I,externalSlotProps:x?.monthButton,additionalProps:{children:i,disabled:s,tabIndex:u,ref:v,type:"button",role:"radio","aria-current":m,"aria-checked":a,"aria-label":b,onClick:N=>d(N,l),onKeyDown:N=>f(N,l),onFocus:N=>h(N,l),onBlur:N=>p(N,l)},ownerState:n,className:S.monthButton});return c.jsx(sz,Y({className:Ue(S.root,o),ownerState:n},C,{children:c.jsx(I,Y({},T))}))});function uz(e){return Ge("MuiMonthCalendar",e)}We("MuiMonthCalendar",["root"]);const cz=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],dz=e=>{const{classes:t}=e;return Ke({root:["root"]},uz,t)};function fz(e,t){const n=Zt(),r=kl(),o=Kt({props:e,name:t});return Y({disableFuture:!1,disablePast:!1},o,{minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate)})}const pz=fe("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:Nc,boxSizing:"border-box"}),hz=M.forwardRef(function(t,n){const r=fz(t,"MuiMonthCalendar"),{className:o,value:i,defaultValue:s,referenceDate:a,disabled:l,disableFuture:u,disablePast:d,maxDate:f,minDate:h,onChange:p,shouldDisableMonth:m,readOnly:b,autoFocus:y=!1,onMonthFocus:x,hasFocus:C,onFocusedViewChange:v,monthsPerRow:S=3,timezone:I,gridLabelId:T,slots:N,slotProps:O}=r,F=Ze(r,cz),{value:B,handleValueChange:j,timezone:D}=nh({name:"MonthCalendar",timezone:I,value:i,defaultValue:s,referenceDate:a,onChange:p,valueManager:Zr}),H=Pc(D),_=kr(),L=Zt(),$=M.useMemo(()=>Zr.getInitialReferenceValue({value:B,utils:L,props:r,timezone:D,referenceDate:a,granularity:Kr.month}),[]),K=r,G=dz(K),q=M.useMemo(()=>L.getMonth(H),[L,H]),R=M.useMemo(()=>B!=null?L.getMonth(B):null,[B,L]),[oe,se]=M.useState(()=>R||L.getMonth($)),[z,pe]=or({name:"MonthCalendar",state:"hasFocus",controlled:C,default:y??!1}),J=Ve(me=>{pe(me),v&&v(me)}),Q=M.useCallback(me=>{const le=L.startOfMonth(d&&L.isAfter(H,h)?H:h),ue=L.startOfMonth(u&&L.isBefore(H,f)?H:f),Ie=L.startOfMonth(me);return L.isBefore(Ie,le)||L.isAfter(Ie,ue)?!0:m?m(Ie):!1},[u,d,f,h,H,m,L]),re=Ve((me,le)=>{if(b)return;const ue=L.setMonth(B??$,le);j(ue)}),ne=Ve(me=>{Q(L.setMonth(B??$,me))||(se(me),J(!0),x&&x(me))});M.useEffect(()=>{se(me=>R!==null&&me!==R?R:me)},[R]);const ae=Ve((me,le)=>{switch(me.key){case"ArrowUp":ne((12+le-3)%12),me.preventDefault();break;case"ArrowDown":ne((12+le+3)%12),me.preventDefault();break;case"ArrowLeft":ne((12+le+(_?1:-1))%12),me.preventDefault();break;case"ArrowRight":ne((12+le+(_?-1:1))%12),me.preventDefault();break}}),ie=Ve((me,le)=>{ne(le)}),Z=Ve((me,le)=>{oe===le&&J(!1)});return c.jsx(pz,Y({ref:n,className:Ue(G.root,o),ownerState:K,role:"radiogroup","aria-labelledby":T},F,{children:Xp(L,B??$).map(me=>{const le=L.getMonth(me),ue=L.format(me,"monthShort"),Ie=L.format(me,"month"),Ce=le===R,we=l||Q(me);return c.jsx(lz,{selected:Ce,value:le,onClick:re,onKeyDown:ae,autoFocus:z&&le===oe,disabled:we,tabIndex:le===oe&&!we?0:-1,onFocus:ie,onBlur:Z,"aria-current":q===le?"date":void 0,"aria-label":Ie,monthsPerRow:S,slots:N,slotProps:O,children:ue},ue)})}))});function mz(e){return Ge("MuiPickersYear",e)}const nu=We("MuiPickersYear",["root","yearButton","selected","disabled"]),gz=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],bz=e=>{const{disabled:t,selected:n,classes:r}=e;return Ke({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},mz,r)},yz=fe("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),xz=fe("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${nu.disabled}`]:t.disabled},{[`&.${nu.selected}`]:t.selected}]})(({theme:e})=>Y({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${nu.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${nu.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),Cz=M.memo(function(t){const n=Kt({props:t,name:"MuiPickersYear"}),{autoFocus:r,className:o,children:i,disabled:s,selected:a,value:l,tabIndex:u,onClick:d,onKeyDown:f,onFocus:h,onBlur:p,"aria-current":m,slots:b,slotProps:y}=n,x=Ze(n,gz),C=M.useRef(null),v=bz(n);yn(()=>{r&&C.current?.focus()},[r]);const S=b?.yearButton??xz,I=Et({elementType:S,externalSlotProps:y?.yearButton,additionalProps:{children:i,disabled:s,tabIndex:u,ref:C,type:"button",role:"radio","aria-current":m,"aria-checked":a,onClick:T=>d(T,l),onKeyDown:T=>f(T,l),onFocus:T=>h(T,l),onBlur:T=>p(T,l)},ownerState:n,className:v.yearButton});return c.jsx(yz,Y({className:Ue(v.root,o),ownerState:n},x,{children:c.jsx(S,Y({},I))}))});function Ez(e){return Ge("MuiYearCalendar",e)}We("MuiYearCalendar",["root"]);const vz=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],Tz=e=>{const{classes:t}=e;return Ke({root:["root"]},Ez,t)};function Sz(e,t){const n=Zt(),r=kl(),o=Kt({props:e,name:t});return Y({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate)})}const kz=fe("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:Nc,maxHeight:Xj,boxSizing:"border-box",position:"relative"}),wz=M.forwardRef(function(t,n){const r=Sz(t,"MuiYearCalendar"),{autoFocus:o,className:i,value:s,defaultValue:a,referenceDate:l,disabled:u,disableFuture:d,disablePast:f,maxDate:h,minDate:p,onChange:m,readOnly:b,shouldDisableYear:y,onYearFocus:x,hasFocus:C,onFocusedViewChange:v,yearsOrder:S="asc",yearsPerRow:I,timezone:T,gridLabelId:N,slots:O,slotProps:F}=r,B=Ze(r,vz),{value:j,handleValueChange:D,timezone:H}=nh({name:"YearCalendar",timezone:T,value:s,defaultValue:a,referenceDate:l,onChange:m,valueManager:Zr}),_=Pc(H),L=kr(),$=Zt(),K=M.useMemo(()=>Zr.getInitialReferenceValue({value:j,utils:$,props:r,timezone:H,referenceDate:l,granularity:Kr.year}),[]),G=r,q=Tz(G),R=M.useMemo(()=>$.getYear(_),[$,_]),oe=M.useMemo(()=>j!=null?$.getYear(j):null,[j,$]),[se,z]=M.useState(()=>oe||$.getYear(K)),[pe,J]=or({name:"YearCalendar",state:"hasFocus",controlled:C,default:o??!1}),Q=Ve(ye=>{J(ye),v&&v(ye)}),re=M.useCallback(ye=>{if(f&&$.isBeforeYear(ye,_)||d&&$.isAfterYear(ye,_)||p&&$.isBeforeYear(ye,p)||h&&$.isAfterYear(ye,h))return!0;if(!y)return!1;const ze=$.startOfYear(ye);return y(ze)},[d,f,h,p,_,y,$]),ne=Ve((ye,ze)=>{if(b)return;const Ne=$.setYear(j??K,ze);D(Ne)}),ae=Ve(ye=>{re($.setYear(j??K,ye))||(z(ye),Q(!0),x?.(ye))});M.useEffect(()=>{z(ye=>oe!==null&&ye!==oe?oe:ye)},[oe]);const ie=S!=="desc"?I*1:I*-1,Z=L&&S==="asc"||!L&&S==="desc"?-1:1,me=Ve((ye,ze)=>{switch(ye.key){case"ArrowUp":ae(ze-ie),ye.preventDefault();break;case"ArrowDown":ae(ze+ie),ye.preventDefault();break;case"ArrowLeft":ae(ze-Z),ye.preventDefault();break;case"ArrowRight":ae(ze+Z),ye.preventDefault();break}}),le=Ve((ye,ze)=>{ae(ze)}),ue=Ve((ye,ze)=>{se===ze&&Q(!1)}),Ie=M.useRef(null),Ce=vt(n,Ie);M.useEffect(()=>{if(o||Ie.current===null)return;const ye=Ie.current.querySelector('[tabindex="0"]');if(!ye)return;const ze=ye.offsetHeight,Ne=ye.offsetTop,nt=Ie.current.clientHeight,_e=Ie.current.scrollTop,Bt=Ne+ze;ze>nt||Ne<_e||(Ie.current.scrollTop=Bt-nt/2-ze/2)},[o]);const we=$.getYearRange([p,h]);return S==="desc"&&we.reverse(),c.jsx(kz,Y({ref:Ce,className:Ue(q.root,i),ownerState:G,role:"radiogroup","aria-labelledby":N},B,{children:we.map(ye=>{const ze=$.getYear(ye),Ne=ze===oe,nt=u||re(ye);return c.jsx(Cz,{selected:Ne,value:ze,onClick:ne,onKeyDown:me,autoFocus:pe&&ze===se,disabled:nt,tabIndex:ze===se&&!nt?0:-1,onFocus:le,onBlur:ue,"aria-current":R===ze?"date":void 0,yearsPerRow:I,slots:O,slotProps:F,children:$.format(ye,"year")},$.format(ye,"year"))})}))}),Dz=e=>Ge("MuiPickersCalendarHeader",e),Iz=We("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function Az(e){return Ge("MuiPickersArrowSwitcher",e)}We("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const Oz=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],Mz=["ownerState"],Pz=["ownerState"],Rz=fe("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),Nz=fe("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),W1=fe(Ir,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),Fz=e=>{const{classes:t}=e;return Ke({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},Az,t)},Lz=M.forwardRef(function(t,n){const r=kr(),o=Kt({props:t,name:"MuiPickersArrowSwitcher"}),{children:i,className:s,slots:a,slotProps:l,isNextDisabled:u,isNextHidden:d,onGoToNext:f,nextLabel:h,isPreviousDisabled:p,isPreviousHidden:m,onGoToPrevious:b,previousLabel:y,labelId:x}=o,C=Ze(o,Oz),v=o,S=Fz(v),I={isDisabled:u,isHidden:d,goTo:f,label:h},T={isDisabled:p,isHidden:m,goTo:b,label:y},N=a?.previousIconButton??W1,O=Et({elementType:N,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:T.label,"aria-label":T.label,disabled:T.isDisabled,edge:"end",onClick:T.goTo},ownerState:Y({},v,{hidden:T.isHidden}),className:Ue(S.button,S.previousIconButton)}),F=a?.nextIconButton??W1,B=Et({elementType:F,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:I.label,"aria-label":I.label,disabled:I.isDisabled,edge:"start",onClick:I.goTo},ownerState:Y({},v,{hidden:I.isHidden}),className:Ue(S.button,S.nextIconButton)}),j=a?.leftArrowIcon??p$,D=Et({elementType:j,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:v,className:S.leftArrowIcon}),H=Ze(D,Mz),_=a?.rightArrowIcon??h$,L=Et({elementType:_,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:v,className:S.rightArrowIcon}),$=Ze(L,Pz);return c.jsxs(Rz,Y({ref:n,className:Ue(S.root,s),ownerState:v},C,{children:[c.jsx(N,Y({},O,{children:r?c.jsx(_,Y({},$)):c.jsx(j,Y({},H))})),i?c.jsx(Dt,{variant:"subtitle1",component:"span",id:x,children:i}):c.jsx(Nz,{className:S.spacer,ownerState:v}),c.jsx(F,Y({},B,{children:r?c.jsx(j,Y({},H)):c.jsx(_,Y({},$))}))]}))});function _z(e,{disableFuture:t,maxDate:n,timezone:r}){const o=Zt();return M.useMemo(()=>{const i=o.date(void 0,r),s=o.startOfMonth(t&&o.isBefore(i,n)?i:n);return!o.isAfter(s,e)},[t,n,e,o,r])}function Bz(e,{disablePast:t,minDate:n,timezone:r}){const o=Zt();return M.useMemo(()=>{const i=o.date(void 0,r),s=o.startOfMonth(t&&o.isAfter(i,n)?i:n);return!o.isBefore(s,e)},[t,n,e,o,r])}const jz=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],$z=["ownerState"],Hz=e=>{const{classes:t}=e;return Ke({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},Dz,t)},zz=fe("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),Uz=fe("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>Y({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),Vz=fe("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),Wz=fe(Ir,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${Iz.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),qz=fe(f$,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),Yz=M.forwardRef(function(t,n){const r=vo(),o=Zt(),i=Kt({props:t,name:"MuiPickersCalendarHeader"}),{slots:s,slotProps:a,currentMonth:l,disabled:u,disableFuture:d,disablePast:f,maxDate:h,minDate:p,onMonthChange:m,onViewChange:b,view:y,reduceAnimations:x,views:C,labelId:v,className:S,timezone:I,format:T=`${o.formats.month} ${o.formats.year}`}=i,N=Ze(i,jz),O=i,F=Hz(i),B=s?.switchViewButton??Wz,j=Et({elementType:B,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(y)},ownerState:O,className:F.switchViewButton}),D=s?.switchViewIcon??qz,H=Et({elementType:D,externalSlotProps:a?.switchViewIcon,ownerState:O,className:F.switchViewIcon}),_=Ze(H,$z),L=()=>m(o.addMonths(l,1),"left"),$=()=>m(o.addMonths(l,-1),"right"),K=_z(l,{disableFuture:d,maxDate:h,timezone:I}),G=Bz(l,{disablePast:f,minDate:p,timezone:I}),q=()=>{if(!(C.length===1||!b||u))if(C.length===2)b(C.find(oe=>oe!==y)||C[0]);else{const oe=C.indexOf(y)!==0?0:1;b(C[oe])}};if(C.length===1&&C[0]==="year")return null;const R=o.formatByString(l,T);return c.jsxs(zz,Y({},N,{ownerState:O,className:Ue(F.root,S),ref:n,children:[c.jsxs(Uz,{role:"presentation",onClick:q,ownerState:O,"aria-live":"polite",className:F.labelContainer,children:[c.jsx(wC,{reduceAnimations:x,transKey:R,children:c.jsx(Vz,{id:v,ownerState:O,className:F.label,children:R})}),C.length>1&&!u&&c.jsx(B,Y({},j,{children:c.jsx(D,Y({},_))}))]}),c.jsx(hi,{in:y==="day",appear:!x,enter:!x,children:c.jsx(Lz,{slots:s,slotProps:a,onGoToPrevious:$,isPreviousDisabled:G,previousLabel:r.previousMonth,onGoToNext:L,isNextDisabled:K,nextLabel:r.nextMonth})})]}))}),Kz=fe("div")({overflow:"hidden",width:Nc,maxHeight:rh,display:"flex",flexDirection:"column",margin:"0 auto"}),Gz=e=>Ge("MuiDateCalendar",e);We("MuiDateCalendar",["root","viewTransitionContainer"]);const Qz=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],Xz=e=>{const{classes:t}=e;return Ke({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Gz,t)};function Zz(e,t){const n=Zt(),r=kl(),o=cC(),i=Kt({props:e,name:t});return Y({},i,{loading:i.loading??!1,disablePast:i.disablePast??!1,disableFuture:i.disableFuture??!1,openTo:i.openTo??"day",views:i.views??["year","day"],reduceAnimations:i.reduceAnimations??o,renderLoading:i.renderLoading??(()=>c.jsx("span",{children:"..."})),minDate:vr(n,i.minDate,r.minDate),maxDate:vr(n,i.maxDate,r.maxDate)})}const Jz=fe(Kz,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:rh}),eU=fe(wC,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),tU=M.forwardRef(function(t,n){const r=Zt(),o=_r(),i=Zz(t,"MuiDateCalendar"),{autoFocus:s,onViewChange:a,value:l,defaultValue:u,referenceDate:d,disableFuture:f,disablePast:h,onChange:p,onYearChange:m,onMonthChange:b,reduceAnimations:y,shouldDisableDate:x,shouldDisableMonth:C,shouldDisableYear:v,view:S,views:I,openTo:T,className:N,disabled:O,readOnly:F,minDate:B,maxDate:j,disableHighlightToday:D,focusedView:H,onFocusedViewChange:_,showDaysOutsideCurrentMonth:L,fixedWeekNumber:$,dayOfWeekFormatter:K,slots:G,slotProps:q,loading:R,renderLoading:oe,displayWeekNumber:se,yearsOrder:z,yearsPerRow:pe,monthsPerRow:J,timezone:Q}=i,re=Ze(i,Qz),{value:ne,handleValueChange:ae,timezone:ie}=nh({name:"DateCalendar",timezone:Q,value:l,defaultValue:u,referenceDate:d,onChange:p,valueManager:Zr}),{view:Z,setView:me,focusedView:le,setFocusedView:ue,goToNextView:Ie,setValueAndGoToNextView:Ce}=dC({view:S,views:I,openTo:T,onChange:ae,onViewChange:a,autoFocus:s,focusedView:H,onFocusedViewChange:_}),{referenceDate:we,calendarState:ye,changeFocusedDay:ze,changeMonth:Ne,handleChangeMonth:nt,isDateDisabled:_e,onMonthSwitchingAnimationEnd:Bt}=wH({value:ne,referenceDate:d,reduceAnimations:y,onMonthChange:b,minDate:B,maxDate:j,shouldDisableDate:x,disablePast:h,disableFuture:f,timezone:ie}),yt=O&&ne||B,ot=O&&ne||j,xe=`${o}-grid-label`,Pe=le!==null,qe=G?.calendarHeader??Yz,Je=Et({elementType:qe,externalSlotProps:q?.calendarHeader,additionalProps:{views:I,view:Z,currentMonth:ye.currentMonth,onViewChange:me,onMonthChange:(st,Nt)=>nt({newMonth:st,direction:Nt}),minDate:yt,maxDate:ot,disabled:O,disablePast:h,disableFuture:f,reduceAnimations:y,timezone:ie,labelId:xe},ownerState:i}),Xe=Ve(st=>{const Nt=r.startOfMonth(st),Gt=r.endOfMonth(st),bt=_e(st)?qa({utils:r,date:st,minDate:r.isBefore(B,Nt)?Nt:B,maxDate:r.isAfter(j,Gt)?Gt:j,disablePast:h,disableFuture:f,isDateDisabled:_e,timezone:ie}):st;bt?(Ce(bt,"finish"),b?.(Nt)):(Ie(),Ne(Nt)),ze(bt,!0)}),Re=Ve(st=>{const Nt=r.startOfYear(st),Gt=r.endOfYear(st),bt=_e(st)?qa({utils:r,date:st,minDate:r.isBefore(B,Nt)?Nt:B,maxDate:r.isAfter(j,Gt)?Gt:j,disablePast:h,disableFuture:f,isDateDisabled:_e,timezone:ie}):st;bt?(Ce(bt,"finish"),m?.(bt)):(Ie(),Ne(Nt)),ze(bt,!0)}),ct=Ve(st=>ae(st&&Qu(r,st,ne??we),"finish",Z));M.useEffect(()=>{ne!=null&&r.isValid(ne)&&Ne(ne)},[ne]);const lt=i,Mt=Xz(lt),be={disablePast:h,disableFuture:f,maxDate:j,minDate:B},Ae={disableHighlightToday:D,readOnly:F,disabled:O,timezone:ie,gridLabelId:xe,slots:G,slotProps:q},Oe=M.useRef(Z);M.useEffect(()=>{Oe.current!==Z&&(le===Oe.current&&ue(Z,!0),Oe.current=Z)},[le,ue,Z]);const Qe=M.useMemo(()=>[ne],[ne]);return c.jsxs(Jz,Y({ref:n,className:Ue(Mt.root,N),ownerState:lt},re,{children:[c.jsx(qe,Y({},Je,{slots:G,slotProps:q})),c.jsx(eU,{reduceAnimations:y,className:Mt.viewTransitionContainer,transKey:Z,ownerState:lt,children:c.jsxs("div",{children:[Z==="year"&&c.jsx(wz,Y({},be,Ae,{value:ne,onChange:Re,shouldDisableYear:v,hasFocus:Pe,onFocusedViewChange:st=>ue("year",st),yearsOrder:z,yearsPerRow:pe,referenceDate:we})),Z==="month"&&c.jsx(hz,Y({},be,Ae,{hasFocus:Pe,className:N,value:ne,onChange:Xe,shouldDisableMonth:C,onFocusedViewChange:st=>ue("month",st),monthsPerRow:J,referenceDate:we})),Z==="day"&&c.jsx(nz,Y({},ye,be,Ae,{onMonthSwitchingAnimationEnd:Bt,onFocusedDayChange:ze,reduceAnimations:y,selectedDays:Qe,onSelectedDaysChange:ct,shouldDisableDate:x,shouldDisableMonth:C,shouldDisableYear:v,hasFocus:Pe,onFocusedViewChange:st=>ue("day",st),showDaysOutsideCurrentMonth:L,fixedWeekNumber:$,dayOfWeekFormatter:K,displayWeekNumber:se,loading:R,renderLoading:oe}))]})})]}))}),us=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:i,defaultValue:s,referenceDate:a,onChange:l,className:u,classes:d,disableFuture:f,disablePast:h,minDate:p,maxDate:m,shouldDisableDate:b,shouldDisableMonth:y,shouldDisableYear:x,reduceAnimations:C,onMonthChange:v,monthsPerRow:S,onYearChange:I,yearsOrder:T,yearsPerRow:N,slots:O,slotProps:F,loading:B,renderLoading:j,disableHighlightToday:D,readOnly:H,disabled:_,showDaysOutsideCurrentMonth:L,dayOfWeekFormatter:$,sx:K,autoFocus:G,fixedWeekNumber:q,displayWeekNumber:R,timezone:oe})=>c.jsx(tU,{view:e,onViewChange:t,views:n.filter(M1),focusedView:r&&M1(r)?r:null,onFocusedViewChange:o,value:i,defaultValue:s,referenceDate:a,onChange:l,className:u,classes:d,disableFuture:f,disablePast:h,minDate:p,maxDate:m,shouldDisableDate:b,shouldDisableMonth:y,shouldDisableYear:x,reduceAnimations:C,onMonthChange:v,monthsPerRow:S,onYearChange:I,yearsOrder:T,yearsPerRow:N,slots:O,slotProps:F,loading:B,renderLoading:j,disableHighlightToday:D,readOnly:H,disabled:_,showDaysOutsideCurrentMonth:L,dayOfWeekFormatter:$,sx:K,autoFocus:G,fixedWeekNumber:q,displayWeekNumber:R,timezone:oe}),OC=M.forwardRef(function(t,n){const r=vo(),o=Zt(),i=iC(t,"MuiDesktopDatePicker"),s=Y({day:us,month:us,year:us},i.viewRenderers),a=Y({},i,{viewRenderers:s,format:Zp(o,i,!1),yearsPerRow:i.yearsPerRow??4,slots:Y({openPickerIcon:m$,field:SC},i.slots),slotProps:Y({},i.slotProps,{field:u=>Y({},br(i.slotProps?.field,u),aC(i),{ref:n}),toolbar:Y({hidden:!0},i.slotProps?.toolbar)})}),{renderPicker:l}=d$({props:a,valueManager:Zr,valueType:"date",getOpenDialogAriaText:rC({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:a.localeText?.openDatePickerDialogue}),validator:wl});return l()});OC.propTypes={autoFocus:Ee.bool,className:Ee.string,closeOnSelect:Ee.bool,dayOfWeekFormatter:Ee.func,defaultValue:Ee.object,disabled:Ee.bool,disableFuture:Ee.bool,disableHighlightToday:Ee.bool,disableOpenPicker:Ee.bool,disablePast:Ee.bool,displayWeekNumber:Ee.bool,enableAccessibleFieldDOMStructure:Ee.any,fixedWeekNumber:Ee.number,format:Ee.string,formatDensity:Ee.oneOf(["dense","spacious"]),inputRef:o2,label:Ee.node,loading:Ee.bool,localeText:Ee.object,maxDate:Ee.object,minDate:Ee.object,monthsPerRow:Ee.oneOf([3,4]),name:Ee.string,onAccept:Ee.func,onChange:Ee.func,onClose:Ee.func,onError:Ee.func,onMonthChange:Ee.func,onOpen:Ee.func,onSelectedSectionsChange:Ee.func,onViewChange:Ee.func,onYearChange:Ee.func,open:Ee.bool,openTo:Ee.oneOf(["day","month","year"]),orientation:Ee.oneOf(["landscape","portrait"]),readOnly:Ee.bool,reduceAnimations:Ee.bool,referenceDate:Ee.object,renderLoading:Ee.func,selectedSections:Ee.oneOfType([Ee.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),Ee.number]),shouldDisableDate:Ee.func,shouldDisableMonth:Ee.func,shouldDisableYear:Ee.func,showDaysOutsideCurrentMonth:Ee.bool,slotProps:Ee.object,slots:Ee.object,sx:Ee.oneOfType([Ee.arrayOf(Ee.oneOfType([Ee.func,Ee.object,Ee.bool])),Ee.func,Ee.object]),timezone:Ee.string,value:Ee.object,view:Ee.oneOf(["day","month","year"]),viewRenderers:Ee.shape({day:Ee.func,month:Ee.func,year:Ee.func}),views:Ee.arrayOf(Ee.oneOf(["day","month","year"]).isRequired),yearsOrder:Ee.oneOf(["asc","desc"]),yearsPerRow:Ee.oneOf([3,4])};const nU=fe(no)({[`& .${za.container}`]:{outline:0},[`& .${za.paper}`]:{outline:0,minWidth:Nc}}),rU=fe(oo)({"&:first-of-type":{padding:0}});function oU(e){const{children:t,onDismiss:n,open:r,slots:o,slotProps:i}=e,s=o?.dialog??nU,a=o?.mobileTransition??hi;return c.jsx(s,Y({open:r,onClose:n},i?.dialog,{TransitionComponent:a,TransitionProps:i?.mobileTransition,PaperComponent:o?.mobilePaper,PaperProps:i?.mobilePaper,children:c.jsx(rU,{children:t})}))}const iU=["props","getOpenDialogAriaText"],sU=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=Ze(e,iU);const{slots:o,slotProps:i,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,name:m,label:b,inputRef:y,readOnly:x,disabled:C,localeText:v}=t,S=M.useRef(null),I=_r(),T=i?.toolbar?.hidden??!1,{open:N,actions:O,layoutProps:F,renderCurrentView:B,fieldProps:j,contextValue:D}=fC(Y({},r,{props:t,fieldRef:S,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),H=o.field,_=Et({elementType:H,externalSlotProps:i?.field,additionalProps:Y({},j,T&&{id:I},!(C||x)&&{onClick:O.onOpen,onKeyDown:bj(O.onOpen)},{readOnly:x??!0,disabled:C,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,label:b,name:m},y?{inputRef:y}:{}),ownerState:t});_.inputProps=Y({},_.inputProps,{"aria-label":n(j.value)});const L=Y({textField:o.textField},_.slots),$=o.layout??mC;let K=I;T&&(b?K=`${I}-label`:K=void 0);const G=Y({},i,{toolbar:Y({},i?.toolbar,{titleId:I}),mobilePaper:Y({"aria-labelledby":K},i?.mobilePaper)}),q=vt(S,_.unstableFieldRef);return{renderPicker:()=>c.jsxs(gC,{contextValue:D,localeText:v,children:[c.jsx(H,Y({},_,{slots:L,slotProps:G,unstableFieldRef:q})),c.jsx(oU,Y({},O,{open:N,slots:o,slotProps:G,children:c.jsx($,Y({},F,G?.layout,{slots:o,slotProps:G,children:B()}))}))]})}},MC=M.forwardRef(function(t,n){const r=vo(),o=Zt(),i=iC(t,"MuiMobileDatePicker"),s=Y({day:us,month:us,year:us},i.viewRenderers),a=Y({},i,{viewRenderers:s,format:Zp(o,i,!1),slots:Y({field:SC},i.slots),slotProps:Y({},i.slotProps,{field:u=>Y({},br(i.slotProps?.field,u),aC(i),{ref:n}),toolbar:Y({hidden:!1},i.slotProps?.toolbar)})}),{renderPicker:l}=sU({props:a,valueManager:Zr,valueType:"date",getOpenDialogAriaText:rC({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:a.localeText?.openDatePickerDialogue}),validator:wl});return l()});MC.propTypes={autoFocus:Ee.bool,className:Ee.string,closeOnSelect:Ee.bool,dayOfWeekFormatter:Ee.func,defaultValue:Ee.object,disabled:Ee.bool,disableFuture:Ee.bool,disableHighlightToday:Ee.bool,disableOpenPicker:Ee.bool,disablePast:Ee.bool,displayWeekNumber:Ee.bool,enableAccessibleFieldDOMStructure:Ee.any,fixedWeekNumber:Ee.number,format:Ee.string,formatDensity:Ee.oneOf(["dense","spacious"]),inputRef:o2,label:Ee.node,loading:Ee.bool,localeText:Ee.object,maxDate:Ee.object,minDate:Ee.object,monthsPerRow:Ee.oneOf([3,4]),name:Ee.string,onAccept:Ee.func,onChange:Ee.func,onClose:Ee.func,onError:Ee.func,onMonthChange:Ee.func,onOpen:Ee.func,onSelectedSectionsChange:Ee.func,onViewChange:Ee.func,onYearChange:Ee.func,open:Ee.bool,openTo:Ee.oneOf(["day","month","year"]),orientation:Ee.oneOf(["landscape","portrait"]),readOnly:Ee.bool,reduceAnimations:Ee.bool,referenceDate:Ee.object,renderLoading:Ee.func,selectedSections:Ee.oneOfType([Ee.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),Ee.number]),shouldDisableDate:Ee.func,shouldDisableMonth:Ee.func,shouldDisableYear:Ee.func,showDaysOutsideCurrentMonth:Ee.bool,slotProps:Ee.object,slots:Ee.object,sx:Ee.oneOfType([Ee.arrayOf(Ee.oneOfType([Ee.func,Ee.object,Ee.bool])),Ee.func,Ee.object]),timezone:Ee.string,value:Ee.object,view:Ee.oneOf(["day","month","year"]),viewRenderers:Ee.shape({day:Ee.func,month:Ee.func,year:Ee.func}),views:Ee.arrayOf(Ee.oneOf(["day","month","year"]).isRequired),yearsOrder:Ee.oneOf(["asc","desc"]),yearsPerRow:Ee.oneOf([3,4])};const aU=["desktopModeMediaQuery"],vu=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:o=yj}=r,i=Ze(r,aU);return Q2(o,{defaultMatches:!0})?c.jsx(OC,Y({ref:n},i)):c.jsx(MC,Y({ref:n},i))});var Tu={exports:{}},lU=Tu.exports,q1;function uU(){return q1||(q1=1,(function(e,t){(function(n,r){e.exports=r()})(lU,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(i,s,a){var l=s.prototype;a.utc=function(b){var y={date:b,utc:!0,args:arguments};return new s(y)},l.utc=function(b){var y=a(this.toDate(),{locale:this.$L,utc:!0});return b?y.add(this.utcOffset(),n):y},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=l.parse;l.parse=function(b){b.utc&&(this.$u=!0),this.$utils().u(b.$offset)||(this.$offset=b.$offset),u.call(this,b)};var d=l.init;l.init=function(){if(this.$u){var b=this.$d;this.$y=b.getUTCFullYear(),this.$M=b.getUTCMonth(),this.$D=b.getUTCDate(),this.$W=b.getUTCDay(),this.$H=b.getUTCHours(),this.$m=b.getUTCMinutes(),this.$s=b.getUTCSeconds(),this.$ms=b.getUTCMilliseconds()}else d.call(this)};var f=l.utcOffset;l.utcOffset=function(b,y){var x=this.$utils().u;if(x(b))return this.$u?0:x(this.$offset)?f.call(this):this.$offset;if(typeof b=="string"&&(b=(function(I){I===void 0&&(I="");var T=I.match(r);if(!T)return null;var N=(""+T[0]).match(o)||["-",0,0],O=N[0],F=60*+N[1]+ +N[2];return F===0?0:O==="+"?F:-F})(b),b===null))return this;var C=Math.abs(b)<=16?60*b:b;if(C===0)return this.utc(y);var v=this.clone();if(y)return v.$offset=C,v.$u=!1,v;var S=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(v=this.local().add(C+S,n)).$offset=C,v.$x.$localOffset=S,v};var h=l.format;l.format=function(b){var y=b||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,y)},l.valueOf=function(){var b=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*b},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var p=l.toDate;l.toDate=function(b){return b==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var m=l.diff;l.diff=function(b,y,x){if(b&&this.$u===b.$u)return m.call(this,b,y,x);var C=this.local(),v=a(b).local();return m.call(C,v,y,x)}}}))})(Tu)),Tu.exports}var cU=uU();const PC=Tr(cU);_t.extend(PC);function Ud(e){switch(e){case"Star":return["Equals","Contains"];case"MinMax":return["Equals","Less Than","Greater Than","Between"];case"DateMinMax":return["Equals","Before","After","Between"];case"Retrieval":return["Semantic Search"];case"Boolean":return["Equals"];case"NONE":default:return[]}}function dU(e){return e==="DateMinMax"}function Vd(e){return e==="Between"}function RC({spec:e,values:t,selection:n,onChange:r,retrievalFn:o}){const i=()=>n?.matchType?n.matchType:e.defaultMatchType?e.defaultMatchType:e.filterType==="DateMinMax"?"Between":Ud(e.filterType)[0]||"Equals",[s,a]=W.useState(i()),[l,u]=W.useState(n?.value??""),[d,f]=W.useState(n?.value2??""),[h,p]=W.useState([]),[m,b]=W.useState(!1),[y,x]=W.useState(""),[C,v]=W.useState(!1),[S,I]=W.useState(!1),T=W.useRef(null),N=W.useRef(0),[O,F]=W.useState(!1);W.useEffect(()=>{if(e.filterType!=="Retrieval"||!o)return;const R=y.trim();if(R.length<=2){p([]),v(!1);return}return T.current&&clearTimeout(T.current),T.current=setTimeout(async()=>{N.current+=1;const oe=N.current;b(!0);try{const se=await o(R,e);oe===N.current&&p(se)}catch(se){oe===N.current&&(console.error("Retrieval failed",se),p([]))}finally{oe===N.current&&(b(!1),v(!0))}},500),()=>{T.current&&clearTimeout(T.current)}},[y,e,o]),W.useEffect(()=>{n===null?(u(""),f(""),a(e.defaultMatchType??(e.filterType==="DateMinMax"?"Between":Ud(e.filterType)[0]||"Equals"))):n&&(a(n.matchType),u(n.value??""),f(n.value2??""))},[n,e.filterType,e.defaultMatchType]);const B=Ud(e.filterType),j=dU(e.filterType),D=Vd(s),H=j&&t.length>=2&&t[0].value instanceof Date?_t.utc(t[0].value):void 0,_=j&&t.length>=2&&t[1].value instanceof Date?_t.utc(t[1].value):void 0,L=e.filterType==="MinMax"&&t.length>=2&&typeof t[0].value=="number"?t[0].value:void 0,$=e.filterType==="MinMax"&&t.length>=2&&typeof t[1].value=="number"?t[1].value:void 0;if(B.length===0)return null;const K=R=>{const oe=R.target.value;a(oe),Vd(oe)||f(""),l&&r({dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:oe,value:l,...Vd(oe)&&d&&{value2:d}})},G=(R,oe)=>{u(R??""),oe!==void 0&&f(oe??"");const se=Array.isArray(R)&&R.length===0;r(!se&&R!==""&&R!==null&&R!==void 0?{dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:s,value:R,...D&&oe&&{value2:oe}}:null)},q=()=>{u(""),f(""),r(null)};return c.jsxs(Qt,{sx:{display:"flex",flexDirection:"column",gap:1.5,fontSize:"0.75rem","& .MuiInputBase-root":{fontSize:"0.75rem"},"& .MuiInputBase-input":{padding:"6px 10px"},"& .MuiSelect-select":{padding:"6px 10px !important"},"& .MuiAutocomplete-input":{padding:"0 !important"},"& .MuiAutocomplete-root .MuiInputBase-root":{padding:"5px 10px",minHeight:"29.5px",boxSizing:"border-box",flexWrap:"wrap"},"& .MuiChip-root":{height:"16px",margin:"0 2px 0 0"},"& .MuiChip-label":{fontSize:"0.7rem",padding:"0 6px"},"& .MuiChip-deleteIcon":{fontSize:"14px",margin:"0 2px 0 -4px"},"& .MuiInputLabel-root":{fontSize:"0.75rem",transform:"translate(10px, 6px) scale(1)"},"& .MuiInputLabel-shrink":{fontSize:"0.85rem",transform:"translate(14px, -9px) scale(0.75)"},"& .MuiOutlinedInput-notchedOutline legend":{fontSize:"0.65rem"},"& .MuiFormHelperText-root":{fontSize:"0.65rem",marginTop:"2px"},"& .MuiSvgIcon-root":{fontSize:"1.25rem"}},children:[c.jsxs(Qt,{sx:{fontWeight:600,color:e.required&&!n?"error.main":"text.primary"},children:[e.label??e.dimensionName,e.required&&c.jsx(Qt,{component:"span",sx:{color:n?"text.secondary":"error.main",fontWeight:400,fontSize:"0.7rem",ml:.5},children:"(required)"})]}),e.filterType!=="Boolean"&&!e.defaultMatchType&&B.length>1&&c.jsxs(Wu,{size:"small",fullWidth:!0,children:[c.jsx(qu,{children:"Match Type"}),c.jsx(Yu,{value:s,label:"Match Type",onChange:K,MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:B.map(R=>c.jsx(bn,{value:R,children:R},R))})]}),e.filterType==="Star"&&s==="Equals"&&c.jsx(_f,{multiple:!0,size:"small",options:t,getOptionLabel:R=>typeof R=="string"?R:typeof R=="object"&&R!==null&&"value"in R?String(R.value):String(R),value:Array.isArray(l)?l.map(R=>t.find(oe=>oe.value===R)||R):l?[t.find(R=>R.value===l)||l]:[],onChange:(R,oe)=>{const se=oe.map(z=>typeof z=="string"?z:z&&typeof z=="object"&&"value"in z?z.value:z);G(se)},noOptionsText:"No matches found",renderInput:R=>c.jsx(Ct,{...R,size:"small",label:"Values",placeholder:"Select values..."}),freeSolo:!e.values||e.values.length===0,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="Star"&&s==="Contains"&&c.jsx(Ct,{size:"small",label:"Search Text",value:l,onChange:R=>u(R.target.value),onBlur:()=>G(l),onKeyDown:R=>{R.key==="Enter"&&G(l)},placeholder:"Enter text to search...",fullWidth:!0}),e.filterType==="Boolean"&&c.jsxs(Wu,{size:"small",fullWidth:!0,children:[c.jsx(qu,{children:"Value"}),c.jsxs(Yu,{value:l===!0?"true":l===!1?"false":"",label:"Value",onChange:R=>{const oe=R.target.value;oe==="true"?G(!0):oe==="false"?G(!1):q()},MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:[c.jsx(bn,{value:"",children:c.jsx("em",{children:"Blank"})}),c.jsx(bn,{value:"true",children:"True"}),c.jsx(bn,{value:"false",children:"False"})]})]}),e.filterType==="Retrieval"&&s==="Semantic Search"&&c.jsx(_f,{multiple:!0,size:"small",options:h,loading:m,getOptionLabel:R=>typeof R=="string"?R:typeof R=="object"&&R!==null&&"value"in R?String(R.value):String(R),value:Array.isArray(l)?l.map(R=>h.find(se=>se.value===R)||{value:R}):l?[{value:l}]:[],onInputChange:(R,oe)=>{x(oe)},onChange:(R,oe)=>{const se=oe.map(z=>typeof z=="string"?z:z&&typeof z=="object"&&"value"in z?z.value:z);G(se)},noOptionsText:y.trim().length<=2?"Type at least 3 characters to search":"No matches found",renderInput:R=>c.jsx(Ct,{...R,size:"small",label:"Search Values",placeholder:"Type to search...",onFocus:()=>I(!0),onBlur:()=>I(!1),helperText:S&&!m&&C&&h.length===0?"No matches found":void 0,InputProps:{...R.InputProps,endAdornment:c.jsxs(c.Fragment,{children:[m?c.jsx(Mp,{color:"inherit",size:20}):null,R.InputProps.endAdornment]})}}),freeSolo:!0,filterOptions:R=>R,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="MinMax"&&!D&&c.jsx(Ct,{size:"small",type:"number",label:"Value",value:l,onChange:R=>G(parseFloat(R.target.value)||""),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Enter number...",fullWidth:!0,inputProps:{min:L,max:$},helperText:O&&L!==void 0&&$!==void 0?`Valid range: [${L} - ${$}]`:void 0}),e.filterType==="MinMax"&&D&&c.jsxs(Qt,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.jsxs(Qt,{sx:{display:"flex",gap:1,alignItems:"center"},children:[c.jsx(Ct,{size:"small",type:"number",label:"From",value:l,onChange:R=>G(parseFloat(R.target.value)||"",d),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Min...",fullWidth:!0,inputProps:{min:L,max:d||$}}),c.jsx(Qt,{children:"to"}),c.jsx(Ct,{size:"small",type:"number",label:"To",value:d,onChange:R=>G(l,parseFloat(R.target.value)||""),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Max...",fullWidth:!0,inputProps:{min:l||L,max:$}})]}),O&&L!==void 0&&$!==void 0&&c.jsxs(Dt,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",L," - ",$,"]"]})]}),j&&!D&&c.jsx(Xu,{dateAdapter:Bf,children:c.jsx(vu,{label:"Date",value:l instanceof Date?_t.utc(l):null,onChange:R=>{R===null?G(null):R.isValid()&&G(R.utc().toDate())},timezone:"UTC",minDate:l instanceof Date?void 0:H,maxDate:l instanceof Date?void 0:_,referenceDate:s==="After"&&H?H:void 0,slotProps:{textField:{size:"small",fullWidth:!0,sx:{minWidth:150},onFocus:()=>F(!0),onBlur:()=>F(!1),helperText:O&&H&&_?`Valid range: [${H.format("YYYY-MM-DD")} - ${_.format("YYYY-MM-DD")}]`:void 0},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),j&&D&&c.jsx(Xu,{dateAdapter:Bf,children:c.jsxs(Qt,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.jsxs(Qt,{sx:{display:"flex",gap:1,alignItems:"center"},children:[c.jsx(Qt,{sx:{flex:1,minWidth:0},children:c.jsx(vu,{label:"From",value:l instanceof Date?_t.utc(l):null,onChange:R=>{R===null?G(null,d):R.isValid()&&G(R.utc().toDate(),d)},timezone:"UTC",minDate:l instanceof Date?void 0:H,maxDate:d instanceof Date?_t.utc(d):l instanceof Date?void 0:_,referenceDate:H,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>F(!0),onBlur:()=>F(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),c.jsx(Qt,{children:"to"}),c.jsx(Qt,{sx:{flex:1,minWidth:0},children:c.jsx(vu,{label:"To",value:d instanceof Date?_t.utc(d):null,onChange:R=>{R===null?G(l,null):R.isValid()&&G(l,R.utc().toDate())},timezone:"UTC",minDate:l instanceof Date?_t.utc(l):d instanceof Date?void 0:H,maxDate:d instanceof Date?void 0:_,referenceDate:l instanceof Date?_t.utc(l):H,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>F(!0),onBlur:()=>F(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})})]}),O&&H&&_&&c.jsxs(Dt,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",H.format("YYYY-MM-DD")," -"," ",_.format("YYYY-MM-DD"),"]"]})]})})]})}function fU(e){const t=new Set,n=e.schema?.fields;if(!n)return t;for(const r of n)"kind"in r&&r.kind==="join"&&r.name&&t.add(r.name);return t}function NC(e){if(!e)return null;for(const t of e)if(t.startsWith("##(filters)")){const n=t.slice(11).trim();try{const r=JSON.parse(n);if(Array.isArray(r)){const o=[];for(const i of r)if(typeof i=="string"){const s=i.indexOf(".");s>0&&s<i.length-1&&o.push({source:i.substring(0,s),dimension:i.substring(s+1)})}if(o.length>0)return{filters:o}}}catch(r){console.error(`Failed to parse "${t}" annotation:`,r)}}return null}function FC(e){if(e.startsWith("#(filter)")){const t=e.slice(9).trim();try{const n=JSON.parse(t);if(n.type)return n}catch(n){console.error(`Failed to parse "${e}" annotation:`,n)}}return null}function pU(e){const t=e.match(/^#\s*label\s*=\s*"([^"]+)"/);return t?t[1]:null}function LC(e){const t=new Map;let n="";for(const r of e)if(r.type==="code"){if(!n&&r.text){const o=r.text.match(/import\s+(?:\{[^}]*\}\s+from\s+)?['"]([^'"]+)['"]/);o&&(n=o[1])}if(r.newSources&&r.newSources.length>0)for(const o of r.newSources)try{const i=JSON.parse(o);i.name&&t.set(i.name,i)}catch(i){console.error("Failed to parse SourceInfo:",i)}}return{sourceInfoMap:t,modelPath:n}}function _C(e,t,n){const r=[];for(const{source:o,dimension:i}of t){const s=e.get(o);if(!s){console.warn(`Source "${o}" not found in notebook sources`),r.push({source:o,model:n,dimensionName:i,filterType:"Star"});continue}const a=s.schema?.fields;if(!a){r.push({source:o,model:n,dimensionName:i,filterType:"Star"});continue}const l=a.find(f=>f.name===i);if(!l){console.warn(`Dimension "${i}" not found in source "${o}"`),r.push({source:o,model:n,dimensionName:i,filterType:"Star"});continue}let u="Star",d;if("annotations"in l&&l.annotations){for(const f of l.annotations)if(f.value){const h=FC(f.value);h&&(u=h.type);const p=pU(f.value);p&&(d=p)}}r.push({source:o,model:n,dimensionName:i,filterType:u,label:d})}return r}function hU(e,t,n){return e.length===0?"":e.map(o=>{const{dimensionName:i,source:s,matchType:a,value:l,value2:u}=o,f=s&&s!==n?`\`${s}\`.\`${i}\``:`\`${i}\``,h=l instanceof Date,p=(m,b=!1)=>m==null?"null":b&&m instanceof Date?`@${m.getFullYear()}-${String(m.getMonth()+1).padStart(2,"0")}-${String(m.getDate()).padStart(2,"0")}`:typeof m=="string"?`'${m.replace(/'/g,"\\'")}'`:typeof m=="boolean"?m?"true":"false":String(m);switch(a){case"Equals":case"Semantic Search":return Array.isArray(l)&&l.length>0?`(${l.map(b=>`${f} = ${p(b,h)}`).join(" or ")})`:`${f} = ${p(l,h)}`;case"Contains":return typeof l=="string"?`${f} ~ f'%${l.replace(/'/g,"\\'")}%'`:`${f} = ${p(l)}`;case"After":case"Greater Than":return`${f} > ${p(l,h)}`;case"Before":case"Less Than":return`${f} < ${p(l,h)}`;case"Between":return u!==void 0?`${f} >= ${p(l,h)} and ${f} <= ${p(u,h)}`:`${f} >= ${p(l,h)}`;default:return""}}).filter(o=>o.length>0).join(" and ")}function mU(e){const t=e.match(/run\s*:\s*(\w+)\s*->/);if(t)return t[1];const n=e.match(/^\s*(\w+)\s*->/m);return n?n[1]:null}function gU(e,t){return`${e.trimEnd()} + {where: ${t}}`}const BC=mt(c.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),jC=e=>{if(!e)return"Explore semantic models, run queries, and build dashboards";const t=e.replace(/^#+\s+/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/`([^`]+)`/g,"$1").trim(),r=t.split(/\n\s*\n/)[1]||t;if(r.length<=120)return r;const o=r.substring(0,120).split(" ");return o.pop(),o.join(" ")+"..."},$C=(e,t)=>{const n=(e.readme||void 0)?.split(`
203
+ `));const t=M.useMemo(()=>Y({},JB,e.localeText),[e.localeText]);return M.useMemo(()=>Y({},e,{localeText:t}),[e,t])},Zt=()=>Ti().utils,kl=()=>Ti().defaultDates,Pc=e=>{const t=Zt(),n=M.useRef(void 0);return n.current===void 0&&(n.current=t.date(void 0,e)),n.current};function ej(e){return Ge("MuiPickersToolbar",e)}We("MuiPickersToolbar",["root","content"]);const tj=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],nj=e=>{const{classes:t}=e;return Ke({root:["root"],content:["content"]},ej,t)},rj=fe("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),oj=fe("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),ij=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersToolbar"}),{children:o,className:i,toolbarTitle:s,hidden:a,titleId:l}=r,u=Ze(r,tj),d=r,f=nj(d);return a?null:c.jsxs(rj,Y({ref:n,className:Ue(f.root,i),ownerState:d},u,{children:[c.jsx(Dt,{color:"text.secondary",variant:"overline",id:l,children:s}),c.jsx(oj,{className:f.content,ownerState:d,children:o})]}))}),vo=()=>Ti().localeText;function sj(e){return Ge("MuiDatePickerToolbar",e)}We("MuiDatePickerToolbar",["root","title"]);const aj=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],lj=e=>{const{classes:t}=e;return Ke({root:["root"],title:["title"]},sj,t)},uj=fe(ij,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),cj=fe(Dt,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),dj=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiDatePickerToolbar"}),{value:o,isLandscape:i,toolbarFormat:s,toolbarPlaceholder:a="––",views:l,className:u}=r,d=Ze(r,aj),f=Zt(),h=vo(),p=lj(r),m=M.useMemo(()=>{if(!o)return a;const y=Zp(f,{format:s,views:l},!0);return f.formatByString(o,y)},[o,s,a,f,l]),b=r;return c.jsx(uj,Y({ref:n,toolbarTitle:h.datePickerToolbarTitle,isLandscape:i,className:Ue(p.root,u)},d,{children:c.jsx(cj,{variant:"h4",align:i?"left":"center",ownerState:b,className:p.title,children:m})}))});function lC(e,t){const n=Zt(),r=kl(),o=Kt({props:e,name:t}),i=M.useMemo(()=>o.localeText?.toolbarTitle==null?o.localeText:Y({},o.localeText,{datePickerToolbarTitle:o.localeText.toolbarTitle}),[o.localeText]);return Y({},o,{localeText:i},kB({views:o.views,openTo:o.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:o.disableFuture??!1,disablePast:o.disablePast??!1,minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate),slots:Y({toolbar:dj},o.slots)})}const wl=({props:e,value:t,timezone:n,adapter:r})=>{if(t===null)return null;const{shouldDisableDate:o,shouldDisableMonth:i,shouldDisableYear:s,disablePast:a,disableFuture:l}=e,u=r.utils.date(void 0,n),d=vr(r.utils,e.minDate,r.defaultDates.minDate),f=vr(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(o&&o(t)):return"shouldDisableDate";case!!(i&&i(t)):return"shouldDisableMonth";case!!(s&&s(t)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(t,u)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(t,u)):return"disablePast";case!!(d&&r.utils.isBeforeDay(t,d)):return"minDate";case!!(f&&r.utils.isAfterDay(t,f)):return"maxDate";default:return null}};wl.valueManager=Zr;const uC=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],fj=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],pj=["minDateTime","maxDateTime"],hj=[...uC,...fj,...pj],cC=e=>hj.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{});function dC(e){const{props:t,validator:n,value:r,timezone:o,onError:i}=e,s=Ti(),a=M.useRef(n.valueManager.defaultErrorState),l=n({adapter:s,value:r,timezone:o,props:t}),u=n.valueManager.hasError(l);M.useEffect(()=>{i&&!n.valueManager.isSameError(l,a.current)&&i(l,r),a.current=l},[n,i,l,r]);const d=Ve(f=>n({adapter:s,value:f,timezone:o,props:t}));return{validationError:l,hasValidationError:u,getValidationErrorForNewValue:d}}function mj(e){return Ge("MuiInputAdornment",e)}const B1=We("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var j1;const gj=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Fe(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},bj=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:o,size:i,variant:s}=e,a={root:["root",n&&"disablePointerEvents",o&&`position${Fe(o)}`,s,r&&"hiddenLabel",i&&`size${Fe(i)}`]};return Ke(a,mj,t)},yj=fe("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:gj})(ft(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${B1.positionStart}&:not(.${B1.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),fC=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiInputAdornment"}),{children:o,className:i,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:u,variant:d,...f}=r,h=ar()||{};let p=d;d&&h.variant,h&&!p&&(p=h.variant);const m={...r,hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:a,position:u,variant:p},b=bj(m);return c.jsx(kc.Provider,{value:null,children:c.jsx(yj,{as:s,ownerState:m,className:Ue(b.root,i),ref:n,...f,children:typeof o=="string"&&!l?c.jsx(Dt,{color:"textSecondary",children:o}):c.jsxs(M.Fragment,{children:[u==="start"?j1||(j1=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,o]})})})});function xj(e){return Ge("MuiPickersPopper",e)}We("MuiPickersPopper",["root","paper"]);function Cj(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const Ej=(e,t)=>n=>{(n.key==="Enter"||n.key===" ")&&(e(n),n.preventDefault(),n.stopPropagation())},Wn=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?Wn(t.shadowRoot):t:null},vj="@media (pointer: fine)",Tj="@media (prefers-reduced-motion: reduce)",as=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),$1=as&&as[1]?parseInt(as[1],10):null,H1=as&&as[2]?parseInt(as[2],10):null,Sj=$1&&$1<10||H1&&H1<13||!1,pC=()=>J2(Tj,{defaultMatches:!1})||Sj,kj=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],wj=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"]},xj,t)},Dj=fe(Qp,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),Ij=fe(Ci,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:e})=>["top","top-start","top-end"].includes(e),style:{transformOrigin:"bottom center"}}]});function Aj(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function Oj(e,t){const n=M.useRef(!1),r=M.useRef(!1),o=M.useRef(null),i=M.useRef(!1);M.useEffect(()=>{if(!e)return;function l(){i.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),i.current=!1}},[e]);const s=Ve(l=>{if(!i.current)return;const u=r.current;r.current=!1;const d=mn(o.current);if(!o.current||"clientX"in l&&Aj(l,d))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(o.current)>-1:f=!d.documentElement.contains(l.target)||o.current.contains(l.target),!f&&!u&&t(l)}),a=()=>{r.current=!0};return M.useEffect(()=>{if(e){const l=mn(o.current),u=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",u),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",u)}}},[e,s]),M.useEffect(()=>{if(e){const l=mn(o.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[e,s]),[o,a,a]}const Mj=M.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:o,children:i,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:u}=e,d=Ze(e,kj),f=Y({},o,{placement:r}),h=Et({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:a,ownerState:f});return c.jsx(n,Y({},d,h,{onClick:p=>{l(p),h.onClick?.(p)},onTouchStart:p=>{u(p),h.onTouchStart?.(p)},ownerState:f,children:i}))});function Pj(e){const t=Kt({props:e,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:o=null,shouldRestoreFocus:i,onBlur:s,onDismiss:a,open:l,role:u,placement:d,slots:f,slotProps:h,reduceAnimations:p}=t;M.useEffect(()=>{function L($){l&&$.key==="Escape"&&a()}return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L)}},[a,l]);const m=M.useRef(null);M.useEffect(()=>{u==="tooltip"||i&&!i()||(l?m.current=Wn(document):m.current&&m.current instanceof HTMLElement&&setTimeout(()=>{m.current instanceof HTMLElement&&m.current.focus()}))},[l,u,i]);const[b,y,x]=Oj(l,s??a),C=M.useRef(null),v=vt(C,o),S=vt(v,b),I=t,T=wj(I),N=pC(),O=p??N,F=L=>{L.key==="Escape"&&(L.stopPropagation(),a())},B=f?.desktopTransition??O?hi:el,j=f?.desktopTrapFocus??h2,D=f?.desktopPaper??Ij,H=f?.popper??Dj,_=Et({elementType:H,externalSlotProps:h?.popper,additionalProps:{transition:!0,role:u,open:l,anchorEl:n,placement:d,onKeyDown:F},className:T.root,ownerState:t});return c.jsx(H,Y({},_,{children:({TransitionProps:L,placement:$})=>c.jsx(j,Y({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:u==="tooltip",isEnabled:()=>!0},h?.desktopTrapFocus,{children:c.jsx(B,Y({},L,h?.desktopTransition,{children:c.jsx(Mj,{PaperComponent:D,ownerState:I,popperPlacement:$,ref:S,onPaperClick:y,onPaperTouchStart:x,paperClasses:T.paper,paperSlotProps:h?.desktopPaper,children:r})}))}))}))}const Rj=({open:e,onOpen:t,onClose:n})=>{const r=M.useRef(typeof e=="boolean").current,[o,i]=M.useState(!1);M.useEffect(()=>{if(r){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(e)}},[r,e]);const s=M.useCallback(a=>{r||i(a),a&&t&&t(),!a&&n&&n()},[r,t,n]);return{isOpen:o,setIsOpen:s}},th=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:o,valueManager:i})=>{const s=Zt(),a=M.useRef(n),l=t??a.current??i.emptyValue,u=M.useMemo(()=>i.getTimezone(s,l),[s,i,l]),d=Ve(m=>u==null?m:i.setTimezone(s,u,m));let f;e?f=e:u?f=u:r?f=s.getTimezone(r):f="default";const h=M.useMemo(()=>i.setTimezone(s,f,l),[i,s,f,l]),p=Ve((m,...b)=>{const y=d(m);o?.(y,...b)});return{value:h,handleValueChange:p,timezone:f}},nh=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:o,onChange:i,valueManager:s})=>{const[a,l]=or({name:e,state:"value",controlled:n,default:r??s.emptyValue}),u=Ve((d,...f)=>{l(d),i?.(d,...f)});return th({timezone:t,value:a,defaultValue:void 0,referenceDate:o,onChange:u,valueManager:s})},Nj=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o}=e,i=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromField"?!0:t.name==="setValueFromAction"?i&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastPublishedValue):t.name==="setValueFromView"&&t.selectionState!=="shallow"||t.name==="setValueFromShortcut"?i?!0:n(r.lastPublishedValue):!1},Fj=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o,closeOnSelect:i}=e,s=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromAction"?s&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastCommittedValue):t.name==="setValueFromView"&&t.selectionState==="finish"&&i?s?!0:n(r.lastCommittedValue):t.name==="setValueFromShortcut"?t.changeImportance==="accept"&&n(r.lastCommittedValue):!1},Lj=e=>{const{action:t,closeOnSelect:n}=e;return t.name==="setValueFromAction"?!0:t.name==="setValueFromView"?t.selectionState==="finish"&&n:t.name==="setValueFromShortcut"?t.changeImportance==="accept":!1},_j=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o})=>{const{onAccept:i,onChange:s,value:a,defaultValue:l,closeOnSelect:u=r==="desktop",timezone:d,referenceDate:f}=e,{current:h}=M.useRef(l),{current:p}=M.useRef(a!==void 0),[m,b]=M.useState(d),y=Zt(),x=Ti(),{isOpen:C,setIsOpen:v}=Rj(e),{timezone:S,value:I,handleValueChange:T}=th({timezone:d,value:a,defaultValue:h,referenceDate:f,onChange:s,valueManager:t}),[N,O]=M.useState(()=>{let ae;return I!==void 0?ae=I:h!==void 0?ae=h:ae=t.emptyValue,{draft:ae,lastPublishedValue:ae,lastCommittedValue:ae,lastControlledValue:a,hasBeenModifiedSinceMount:!1}}),F=t.getTimezone(y,N.draft);m!==d&&(b(d),d&&F&&d!==F&&O(ae=>Y({},ae,{draft:t.setTimezone(y,d,ae.draft)})));const{getValidationErrorForNewValue:B}=dC({props:e,validator:o,timezone:S,value:N.draft,onError:e.onError}),j=Ve(ae=>{const ie={action:ae,dateState:N,hasChanged:Ce=>!t.areValuesEqual(y,ae.value,Ce),isControlled:p,closeOnSelect:u},Z=Nj(ie),me=Fj(ie),le=Lj(ie);O(Ce=>Y({},Ce,{draft:ae.value,lastPublishedValue:Z?ae.value:Ce.lastPublishedValue,lastCommittedValue:me?ae.value:Ce.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let ue=null;const Ie=()=>(ue||(ue={validationError:ae.name==="setValueFromField"?ae.context.validationError:B(ae.value)},ae.name==="setValueFromShortcut"&&(ue.shortcut=ae.shortcut)),ue);Z&&T(ae.value,Ie()),me&&i&&i(ae.value,Ie()),le&&v(!1)});if(N.lastControlledValue!==a){const ae=t.areValuesEqual(y,N.draft,I);O(ie=>Y({},ie,{lastControlledValue:a},ae?{}:{lastCommittedValue:I,lastPublishedValue:I,draft:I,hasBeenModifiedSinceMount:!0}))}const D=Ve(()=>{j({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),H=Ve(()=>{j({value:N.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),_=Ve(()=>{j({value:N.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),L=Ve(()=>{j({value:N.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),$=Ve(()=>{j({value:t.getTodayValue(y,S,n),name:"setValueFromAction",pickerAction:"today"})}),K=Ve(ae=>{ae.preventDefault(),v(!0)}),G=Ve(ae=>{ae?.preventDefault(),v(!1)}),q=Ve((ae,ie="partial")=>j({name:"setValueFromView",value:ae,selectionState:ie})),R=Ve((ae,ie,Z)=>j({name:"setValueFromShortcut",value:ae,changeImportance:ie,shortcut:Z})),oe=Ve((ae,ie)=>j({name:"setValueFromField",value:ae,context:ie})),se={onClear:D,onAccept:H,onDismiss:_,onCancel:L,onSetToday:$,onOpen:K,onClose:G},z={value:N.draft,onChange:oe},pe=M.useMemo(()=>t.cleanValue(y,N.draft),[y,t,N.draft]),J={value:pe,onChange:q,onClose:G,open:C},re=Y({},se,{value:pe,onChange:q,onSelectShortcut:R,isValid:ae=>{const ie=o({adapter:x,value:ae,timezone:S,props:e});return!t.hasError(ie)}}),ne=M.useMemo(()=>({onOpen:K,onClose:G,open:C}),[C,G,K]);return{open:C,fieldProps:z,viewProps:J,layoutProps:re,actions:se,contextValue:ne}};function hC({onChange:e,onViewChange:t,openTo:n,view:r,views:o,autoFocus:i,focusedView:s,onFocusedViewChange:a}){const l=M.useRef(n),u=M.useRef(o),d=M.useRef(o.includes(n)?n:o[0]),[f,h]=or({name:"useViews",state:"view",controlled:r,default:d.current}),p=M.useRef(i?f:null),[m,b]=or({name:"useViews",state:"focusedView",controlled:s,default:p.current});M.useEffect(()=>{(l.current&&l.current!==n||u.current&&u.current.some(N=>!o.includes(N)))&&(h(o.includes(n)?n:o[0]),u.current=o,l.current=n)},[n,h,f,o]);const y=o.indexOf(f),x=o[y-1]??null,C=o[y+1]??null,v=Ve((N,O)=>{b(O?N:F=>N===F?null:F),a?.(N,O)}),S=Ve(N=>{v(N,!0),N!==f&&(h(N),t&&t(N))}),I=Ve(()=>{C&&S(C)}),T=Ve((N,O,F)=>{const B=O==="finish",j=F?o.indexOf(F)<o.length-1:!!C;if(e(N,B&&j?"partial":O,F),F&&F!==f){const H=o[o.indexOf(F)+1];H&&S(H)}else B&&I()});return{view:f,setView:S,focusedView:m,setFocusedView:v,nextView:C,previousView:x,defaultView:o.includes(n)?n:o[0],goToNextView:I,setValueAndGoToNextView:T}}const Bj=["className","sx"],jj=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:o,fieldRef:i})=>{const{onChange:s,open:a,onClose:l}=t,{view:u,views:d,openTo:f,onViewChange:h,viewRenderers:p,timezone:m}=e,b=Ze(e,Bj),{view:y,setView:x,defaultView:C,focusedView:v,setFocusedView:S,setValueAndGoToNextView:I}=hC({view:u,views:d,openTo:f,onChange:s,onViewChange:h,autoFocus:r}),{hasUIView:T,viewModeLookup:N}=M.useMemo(()=>d.reduce((_,L)=>{let $;return p[L]!=null?$="UI":$="field",_.viewModeLookup[L]=$,$==="UI"&&(_.hasUIView=!0),_},{hasUIView:!1,viewModeLookup:{}}),[p,d]),O=M.useMemo(()=>d.reduce((_,L)=>p[L]!=null&&MB(L)?_+1:_,0),[p,d]),F=N[y],B=Ve(()=>F==="UI"),[j,D]=M.useState(F==="UI"?y:null);return j!==y&&N[y]==="UI"&&D(y),yn(()=>{F==="field"&&a&&(l(),setTimeout(()=>{i?.current?.setSelectedSections(y),i?.current?.focusField(y)}))},[y]),yn(()=>{if(!a)return;let _=y;F==="field"&&j!=null&&(_=j),_!==C&&N[_]==="UI"&&N[C]==="UI"&&(_=C),_!==y&&x(_),S(_,!0)},[a]),{hasUIView:T,shouldRestoreFocus:B,layoutProps:{views:d,view:j,onViewChange:x},renderCurrentView:()=>{if(j==null)return null;const _=p[j];if(_==null)return null;const L=Y({},b,n,t,{views:d,timezone:m,onChange:I,view:j,onViewChange:x,focusedView:v,onFocusedViewChange:S,showViewSwitcher:O>1,timeViewsCount:O});return o?o(p,j,L):_(L)}}};function z1(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const $j=(e,t)=>{const[n,r]=M.useState(z1);return yn(()=>{const i=()=>{r(z1())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),Cj(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},Hj=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:o}=e,i=$j(n.views,o),s=kr();return{layoutProps:Y({},n,t,{isLandscape:i,isRtl:s,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}};function zj(e){const{props:t,pickerValueResponse:n}=e;return M.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}const mC=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:o,validator:i,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{const u=_j({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i}),d=jj({props:e,additionalViewProps:o,autoFocusView:s,fieldRef:l,propsFromPickerValue:u.viewProps,rendererInterceptor:a}),f=Hj({props:e,wrapperVariant:r,propsFromPickerValue:u.layoutProps,propsFromPickerViews:d.layoutProps}),h=zj({props:e,pickerValueResponse:u});return{open:u.open,actions:u.actions,fieldProps:u.fieldProps,renderCurrentView:d.renderCurrentView,hasUIView:d.hasUIView,shouldRestoreFocus:d.shouldRestoreFocus,layoutProps:f.layoutProps,contextValue:u.contextValue,ownerState:h}};function gC(e){return Ge("MuiPickersLayout",e)}const Xo=We("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),Uj=["onAccept","onClear","onCancel","onSetToday","actions"];function Vj(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:o,actions:i}=e,s=Ze(e,Uj),a=vo();if(i==null||i.length===0)return null;const l=i?.map(u=>{switch(u){case"clear":return c.jsx(tn,{onClick:n,children:a.clearButtonLabel},u);case"cancel":return c.jsx(tn,{onClick:r,children:a.cancelButtonLabel},u);case"accept":return c.jsx(tn,{onClick:t,children:a.okButtonLabel},u);case"today":return c.jsx(tn,{onClick:o,children:a.todayButtonLabel},u);default:return null}});return c.jsx(ro,Y({},s,{children:l}))}function Wj(e){return Ge("MuiListItem",e)}We("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);const qj=We("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function Yj(e){return Ge("MuiListItemSecondaryAction",e)}We("MuiListItemSecondaryAction",["root","disableGutters"]);const Kj=e=>{const{disableGutters:t,classes:n}=e;return Ke({root:["root",t&&"disableGutters"]},Yj,n)},Gj=fe("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),bC=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemSecondaryAction"}),{className:o,...i}=r,s=M.useContext(ho),a={...r,disableGutters:s.disableGutters},l=Kj(a);return c.jsx(Gj,{className:Ue(l.root,o),ownerState:a,ref:n,...i})});bC.muiName="ListItemSecondaryAction";const Qj=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},Xj=e=>{const{alignItems:t,classes:n,dense:r,disableGutters:o,disablePadding:i,divider:s,hasSecondaryAction:a}=e;return Ke({root:["root",r&&"dense",!o&&"gutters",!i&&"padding",s&&"divider",t==="flex-start"&&"alignItemsFlexStart",a&&"secondaryAction"],container:["container"]},Wj,n)},Zj=fe("div",{name:"MuiListItem",slot:"Root",overridesResolver:Qj})(ft(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${qj.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),Jj=fe("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),e$=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItem"}),{alignItems:o="center",children:i,className:s,component:a,components:l={},componentsProps:u={},ContainerComponent:d="li",ContainerProps:{className:f,...h}={},dense:p=!1,disableGutters:m=!1,disablePadding:b=!1,divider:y=!1,secondaryAction:x,slotProps:C={},slots:v={},...S}=r,I=M.useContext(ho),T=M.useMemo(()=>({dense:p||I.dense||!1,alignItems:o,disableGutters:m}),[o,I.dense,p,m]),N=M.useRef(null),O=M.Children.toArray(i),F=O.length&&ou(O[O.length-1],["ListItemSecondaryAction"]),B={...r,alignItems:o,dense:T.dense,disableGutters:m,disablePadding:b,divider:y,hasSecondaryAction:F},j=Xj(B),D=vt(N,n),H=v.root||l.Root||Zj,_=C.root||u.root||{},L={className:Ue(j.root,_.className,s),...S};let $=a||"li";return F?($=!L.component&&!a?"div":$,d==="li"&&($==="li"?$="div":L.component==="li"&&(L.component="div")),c.jsx(ho.Provider,{value:T,children:c.jsxs(Jj,{as:d,className:Ue(j.container,f),ref:D,ownerState:B,...h,children:[c.jsx(H,{..._,...!hs(H)&&{as:$,ownerState:{...B,..._.ownerState}},...L,children:O}),O.pop()]})})):c.jsx(ho.Provider,{value:T,children:c.jsxs(H,{..._,as:$,ref:D,...!hs(H)&&{ownerState:{...B,..._.ownerState}},...L,children:[O,x&&c.jsx(bC,{children:x})]})})}),il=36,Rc=2,Nc=320,t$=280,rh=336,n$=["items","changeImportance","isLandscape","onChange","isValid"],r$=["getValue"];function o$(e){const{items:t,changeImportance:n="accept",onChange:r,isValid:o}=e,i=Ze(e,n$);if(t==null||t.length===0)return null;const s=t.map(a=>{let{getValue:l}=a,u=Ze(a,r$);const d=l({isValid:o});return Y({},u,{label:u.label,onClick:()=>{r(d,n,u)},disabled:!o(d)})});return c.jsx(M2,Y({dense:!0,sx:[{maxHeight:rh,maxWidth:200,overflow:"auto"},...Array.isArray(i.sx)?i.sx:[i.sx]]},i,{children:s.map(a=>c.jsx(e$,{children:c.jsx(Q2,Y({},a))},a.id??a.label))}))}function i$(e){return e.view!==null}const s$=e=>{const{classes:t,isLandscape:n}=e;return Ke({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},gC,t)},a$=e=>{const{wrapperVariant:t,onAccept:n,onClear:r,onCancel:o,onSetToday:i,view:s,views:a,onViewChange:l,value:u,onChange:d,onSelectShortcut:f,isValid:h,isLandscape:p,disabled:m,readOnly:b,children:y,slots:x,slotProps:C}=e,v=s$(e),S=x?.actionBar??Vj,I=Et({elementType:S,externalSlotProps:C?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:o,onSetToday:i,actions:t==="desktop"?[]:["cancel","accept"]},className:v.actionBar,ownerState:Y({},e,{wrapperVariant:t})}),T=c.jsx(S,Y({},I)),N=x?.toolbar,O=Et({elementType:N,externalSlotProps:C?.toolbar,additionalProps:{isLandscape:p,onChange:d,value:u,view:s,onViewChange:l,views:a,disabled:m,readOnly:b},className:v.toolbar,ownerState:Y({},e,{wrapperVariant:t})}),F=i$(O)&&N?c.jsx(N,Y({},O)):null,B=y,j=x?.tabs,D=s&&j?c.jsx(j,Y({view:s,onViewChange:l,className:v.tabs},C?.tabs)):null,H=x?.shortcuts??o$,_=Et({elementType:H,externalSlotProps:C?.shortcuts,additionalProps:{isValid:h,isLandscape:p,onChange:f},className:v.shortcuts,ownerState:{isValid:h,isLandscape:p,onChange:f,wrapperVariant:t}}),L=s&&H?c.jsx(H,Y({},_)):null;return{toolbar:F,content:B,tabs:D,actionBar:T,shortcuts:L}},l$=e=>{const{isLandscape:t,classes:n}=e;return Ke({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},gC,n)},u$=fe("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${Xo.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${Xo.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${Xo.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${Xo.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${Xo.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${Xo.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${Xo.shortcuts}`]:{gridColumn:3}}}]}),c$=fe("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),yC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersLayout"}),{toolbar:o,content:i,tabs:s,actionBar:a,shortcuts:l}=a$(r),{sx:u,className:d,isLandscape:f,wrapperVariant:h}=r,p=l$(r);return c.jsxs(u$,{ref:n,sx:u,className:Ue(p.root,d),ownerState:r,children:[f?l:o,f?o:l,c.jsx(c$,{className:p.contentWrapper,children:h==="desktop"?c.jsxs(M.Fragment,{children:[i,s]}):c.jsxs(M.Fragment,{children:[s,i]})}),a]})}),d$=M.createContext(null);function xC(e){const{contextValue:t,localeText:n,children:r}=e;return c.jsx(d$.Provider,{value:t,children:c.jsx(Xu,{localeText:n,children:r})})}const f$=["props","getOpenDialogAriaText"],p$=["ownerState"],h$=["ownerState"],m$=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=Ze(e,f$);const{slots:o,slotProps:i,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,name:m,label:b,inputRef:y,readOnly:x,disabled:C,autoFocus:v,localeText:S,reduceAnimations:I}=t,T=M.useRef(null),N=M.useRef(null),O=_r(),F=i?.toolbar?.hidden??!1,{open:B,actions:j,hasUIView:D,layoutProps:H,renderCurrentView:_,shouldRestoreFocus:L,fieldProps:$,contextValue:K,ownerState:G}=mC(Y({},r,{props:t,fieldRef:N,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),q=o.inputAdornment??fC,R=Et({elementType:q,externalSlotProps:i?.inputAdornment,additionalProps:{position:"end"},ownerState:t}),oe=Ze(R,p$),se=o.openPickerButton??Ir,z=Et({elementType:se,externalSlotProps:i?.openPickerButton,additionalProps:{disabled:C||x,onClick:B?j.onClose:j.onOpen,"aria-label":n($.value),edge:oe.position},ownerState:t}),pe=Ze(z,h$),J=o.openPickerIcon,Q=Et({elementType:J,externalSlotProps:i?.openPickerIcon,ownerState:G}),re=o.field,ne=Et({elementType:re,externalSlotProps:i?.field,additionalProps:Y({},$,F&&{id:O},{readOnly:x,disabled:C,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,label:b,name:m,autoFocus:v&&!t.open,focused:B?!0:void 0},y?{inputRef:y}:{}),ownerState:t});D&&(ne.InputProps=Y({},ne.InputProps,{ref:T},!t.disableOpenPicker&&{[`${oe.position}Adornment`]:c.jsx(q,Y({},oe,{children:c.jsx(se,Y({},pe,{children:c.jsx(J,Y({},Q))}))}))}));const ae=Y({textField:o.textField,clearIcon:o.clearIcon,clearButton:o.clearButton},ne.slots),ie=o.layout??yC;let Z=O;F&&(b?Z=`${O}-label`:Z=void 0);const me=Y({},i,{toolbar:Y({},i?.toolbar,{titleId:O}),popper:Y({"aria-labelledby":Z},i?.popper)}),le=vt(N,ne.unstableFieldRef);return{renderPicker:()=>c.jsxs(xC,{contextValue:K,localeText:S,children:[c.jsx(re,Y({},ne,{slots:ae,slotProps:me,unstableFieldRef:le})),c.jsx(Pj,Y({role:"dialog",placement:"bottom-start",anchorEl:T.current},j,{open:B,slots:o,slotProps:me,shouldRestoreFocus:L,reduceAnimations:I,children:c.jsx(ie,Y({},H,me?.layout,{slots:o,slotProps:me,children:_()}))}))]})}},g$=mt(c.jsx("path",{d:"M7 10l5 5 5-5z"})),b$=mt(c.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})),y$=mt(c.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),x$=mt(c.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}));mt(c.jsxs(M.Fragment,{children:[c.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),c.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));mt(c.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}));mt(c.jsxs(M.Fragment,{children:[c.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),c.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));const C$=mt(c.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),E$=({utils:e,format:t})=>{let n=10,r=t,o=e.expandFormat(t);for(;o!==r;)if(r=o,o=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return o},v$=({utils:e,expandedFormat:t})=>{const n=[],{start:r,end:o}=e.escapedCharacters,i=new RegExp(`(\\${r}[^\\${o}]*\\${o})+`,"g");let s=null;for(;s=i.exec(t);)n.push({start:s.index,end:i.lastIndex-1});return n},T$=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},S$=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:o,now:i,token:s,startSeparator:a})=>{if(s==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=tC(e,s),u=iC(e,l.contentType,l.type,s),d=n?u:l.contentType==="digit",f=t!=null&&e.isValid(t);let h=f?e.formatByString(t,s):"",p=null;if(d)if(u)p=h===""?e.formatByString(i,s).length:h.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);p=l.maxLength,f&&(h=Jp(rC(gi(h,o),p),o))}return Y({},l,{format:s,maxLength:p,value:h,placeholder:T$(e,r,l,s),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:d,startSeparator:a,endSeparator:"",modified:!1})},k$=e=>{const{utils:t,expandedFormat:n,escapedParts:r}=e,o=t.date(void 0),i=[];let s="";const a=Object.keys(t.formatTokenMap).sort((p,m)=>m.length-p.length),l=/^([a-zA-Z]+)/,u=new RegExp(`^(${a.join("|")})*$`),d=new RegExp(`^(${a.join("|")})`),f=p=>r.find(m=>m.start<=p&&m.end>=p);let h=0;for(;h<n.length;){const p=f(h),m=p!=null,b=l.exec(n.slice(h))?.[1];if(!m&&b!=null&&u.test(b)){let y=b;for(;y.length>0;){const x=d.exec(y)[1];y=y.slice(x.length),i.push(S$(Y({},e,{now:o,token:x,startSeparator:s}))),s=""}h+=b.length}else{const y=n[h];m&&p?.start===h||p?.end===h||(i.length===0?s+=y:i[i.length-1].endSeparator+=y),h+=1}}return i.length===0&&s.length>0&&i.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),i},w$=({isRtl:e,formatDensity:t,sections:n})=>n.map(r=>{const o=i=>{let s=i;return e&&s!==null&&s.includes(" ")&&(s=`⁩${s}⁦`),t==="spacious"&&["/",".","-"].includes(s)&&(s=` ${s} `),s};return r.startSeparator=o(r.startSeparator),r.endSeparator=o(r.endSeparator),r}),U1=e=>{let t=E$(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=v$(Y({},e,{expandedFormat:t})),r=k$(Y({},e,{expandedFormat:t,escapedParts:n}));return w$(Y({},e,{sections:r}))},D$=e=>{const t=Zt(),n=vo(),r=Ti(),o=kr(),{valueManager:i,fieldValueManager:s,valueType:a,validator:l,internalProps:u,internalProps:{value:d,defaultValue:f,referenceDate:h,onChange:p,format:m,formatDensity:b="dense",selectedSections:y,onSelectedSectionsChange:x,shouldRespectLeadingZeros:C=!1,timezone:v,enableAccessibleFieldDOMStructure:S=!1}}=e,{timezone:I,value:T,handleValueChange:N}=th({timezone:v,value:d,defaultValue:f,referenceDate:h,onChange:p,valueManager:i}),O=M.useMemo(()=>_B(t),[t]),F=M.useMemo(()=>UB(t,O,I),[t,O,I]),B=M.useCallback((J,Q=null)=>s.getSectionsFromValue(t,J,Q,re=>U1({utils:t,localeText:n,localizedDigits:O,format:m,date:re,formatDensity:b,shouldRespectLeadingZeros:C,enableAccessibleFieldDOMStructure:S,isRtl:o})),[s,m,n,O,o,C,t,b,S]),[j,D]=M.useState(()=>{const J=B(T),Q={sections:J,value:T,referenceValue:i.emptyValue,tempValueStrAndroid:null},re=RB(J),ne=i.getInitialReferenceValue({referenceDate:h,value:T,utils:t,props:u,granularity:re,timezone:I});return Y({},Q,{referenceValue:ne})}),[H,_]=or({controlled:y,default:null,name:"useField",state:"selectedSections"}),L=J=>{_(J),x?.(J)},$=M.useMemo(()=>jf(H,j.sections),[H,j.sections]),K=$==="all"?0:$,G=({value:J,referenceValue:Q,sections:re})=>{if(D(ae=>Y({},ae,{sections:re,value:J,referenceValue:Q,tempValueStrAndroid:null})),i.areValuesEqual(t,j.value,J))return;const ne={validationError:l({adapter:r,value:J,timezone:I,props:u})};N(J,ne)},q=(J,Q)=>{const re=[...j.sections];return re[J]=Y({},re[J],{value:Q,modified:!0}),re},R=()=>{G({value:i.emptyValue,referenceValue:j.referenceValue,sections:B(i.emptyValue)})},oe=()=>{if(K==null)return;const J=j.sections[K],Q=s.getActiveDateManager(t,j,J),ne=Q.getSections(j.sections).filter(me=>me.value!=="").length===(J.value===""?0:1),ae=q(K,""),ie=ne?null:t.getInvalidDate(),Z=Q.getNewValuesFromNewActiveDate(ie);G(Y({},Z,{sections:ae}))},se=J=>{const Q=(ae,ie)=>{const Z=t.parse(ae,m);if(Z==null||!t.isValid(Z))return null;const me=U1({utils:t,localeText:n,localizedDigits:O,format:m,date:Z,formatDensity:b,shouldRespectLeadingZeros:C,enableAccessibleFieldDOMStructure:S,isRtl:o});return _1(t,Z,me,ie,!1)},re=s.parseValueStr(J,j.referenceValue,Q),ne=s.updateReferenceValue(t,re,j.referenceValue);G({value:re,referenceValue:ne,sections:B(re,j.sections)})},z=({activeSection:J,newSectionValue:Q,shouldGoToNextSection:re})=>{re&&K<j.sections.length-1&&L(K+1);const ne=s.getActiveDateManager(t,j,J),ae=q(K,Q),ie=ne.getSections(ae),Z=$B(t,ie,O);let me,le;if(Z!=null&&t.isValid(Z)){const ue=_1(t,Z,ie,ne.referenceDate,!0);me=ne.getNewValuesFromNewActiveDate(ue),le=!0}else me=ne.getNewValuesFromNewActiveDate(Z),le=(Z!=null&&!t.isValid(Z))!=(ne.date!=null&&!t.isValid(ne.date));return le?G(Y({},me,{sections:ae})):D(ue=>Y({},ue,me,{sections:ae,tempValueStrAndroid:null}))},pe=J=>D(Q=>Y({},Q,{tempValueStrAndroid:J}));return M.useEffect(()=>{const J=B(j.value);D(Q=>Y({},Q,{sections:J}))},[m,t.locale,o]),M.useEffect(()=>{let J;i.areValuesEqual(t,j.value,T)?J=i.getTimezone(t,j.value)!==i.getTimezone(t,T):J=!0,J&&D(Q=>Y({},Q,{value:T,referenceValue:s.updateReferenceValue(t,T,Q.referenceValue),sections:B(T)}))},[T]),{state:j,activeSectionIndex:K,parsedSelectedSections:$,setSelectedSections:L,clearValue:R,clearActiveSection:oe,updateSectionValue:z,updateValueFromValueStr:se,setTempAndroidValueStr:pe,getSectionsFromValue:B,sectionsValueBoundaries:F,localizedDigits:O,timezone:I}},I$=5e3,Ki=e=>e.saveQuery!=null,A$=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:o,timezone:i})=>{const s=Zt(),[a,l]=M.useState(null),u=Ve(()=>l(null));M.useEffect(()=>{a!=null&&e[a.sectionIndex]?.type!==a.sectionType&&u()},[e,a,u]),M.useEffect(()=>{if(a!=null){const m=setTimeout(()=>u(),I$);return()=>{clearTimeout(m)}}return()=>{}},[a,u]);const d=({keyPressed:m,sectionIndex:b},y,x)=>{const C=m.toLowerCase(),v=e[b];if(a!=null&&(!x||x(a.value))&&a.sectionIndex===b){const I=`${a.value}${C}`,T=y(I,v);if(!Ki(T))return l({sectionIndex:b,value:I,sectionType:v.type}),T}const S=y(C,v);return Ki(S)&&!S.saveQuery?(u(),null):(l({sectionIndex:b,value:C,sectionType:v.type}),Ki(S)?null:S)},f=m=>{const b=(C,v,S)=>{const I=v.filter(T=>T.toLowerCase().startsWith(S));return I.length===0?{saveQuery:!1}:{sectionValue:I[0],shouldGoToNextSection:I.length===1}},y=(C,v,S,I)=>{const T=N=>nC(s,i,v.type,N);if(v.contentType==="letter")return b(v.format,T(v.format),C);if(S&&I!=null&&tC(s,S).contentType==="letter"){const N=T(S),O=b(S,N,C);return Ki(O)?{saveQuery:!1}:Y({},O,{sectionValue:I(O.sectionValue,N)})}return{saveQuery:!1}};return d(m,(C,v)=>{switch(v.type){case"month":{const S=I=>F1(s,I,s.formats.month,v.format);return y(C,v,s.formats.month,S)}case"weekDay":{const S=(I,T)=>T.indexOf(I).toString();return y(C,v,s.formats.weekday,S)}case"meridiem":return y(C,v);default:return{saveQuery:!1}}})},h=m=>{const b=(x,C)=>{const v=gi(x,r),S=Number(v),I=n[C.type]({currentDate:null,format:C.format,contentType:C.contentType});if(S>I.maximum)return{saveQuery:!1};if(S<I.minimum)return{saveQuery:!0};const T=S*10>I.maximum||v.length===I.maximum.toString().length;return{sectionValue:oC(s,S,I,r,C),shouldGoToNextSection:T}};return d(m,(x,C)=>{if(C.contentType==="digit"||C.contentType==="digit-with-letter")return b(x,C);if(C.type==="month"){iC(s,"digit","month","MM");const v=b(x,{type:C.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(Ki(v))return v;const S=F1(s,v.sectionValue,"MM",C.format);return Y({},v,{sectionValue:S})}if(C.type==="weekDay"){const v=b(x,C);if(Ki(v))return v;const S=Mc(s,C.format)[Number(v.sectionValue)-1];return Y({},v,{sectionValue:S})}return{saveQuery:!1}},x=>N1(x,r))};return{applyCharacterEditing:Ve(m=>{const b=e[m.sectionIndex],x=N1(m.keyPressed,r)?h(Y({},m,{keyPressed:Jp(m.keyPressed,r)})):f(m);if(x==null){o(null);return}t({activeSection:b,newSectionValue:x.sectionValue,shouldGoToNextSection:x.shouldGoToNextSection})}),resetCharacterQuery:u}},O$=e=>{const{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:o,onClick:i,onFocus:s,onInput:a,onPaste:l,focused:u,autoFocus:d=!1},fieldValueManager:f,applyCharacterEditing:h,resetCharacterQuery:p,setSelectedSections:m,parsedSelectedSections:b,state:y,clearActiveSection:x,clearValue:C,updateSectionValue:v,updateValueFromValueStr:S,sectionOrder:I,areAllSectionsEmpty:T,sectionsValueBoundaries:N}=e,O=M.useRef(null),F=vt(r,O),B=vo(),j=Zt(),D=_r(),[H,_]=M.useState(!1),L=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!O.current)return;const le=document.getSelection();if(!le)return;if(b==null){le.rangeCount>0&&O.current.getRoot().contains(le.getRangeAt(0).startContainer)&&le.removeAllRanges(),H&&O.current.getRoot().blur();return}if(!O.current.getRoot().contains(Wn(document)))return;const ue=new window.Range;let Ie;b==="all"?Ie=O.current.getRoot():y.sections[b].type==="empty"?Ie=O.current.getSectionContainer(b):Ie=O.current.getSectionContent(b),ue.selectNodeContents(Ie),Ie.focus(),le.removeAllRanges(),le.addRange(ue)},getActiveSectionIndexFromDOM:()=>{const le=Wn(document);return!le||!O.current||!O.current.getRoot().contains(le)?null:O.current.getSectionIndexFromDOMElement(le)},focusField:(le=0)=>{if(!O.current||L.getActiveSectionIndexFromDOM()!=null)return;const ue=jf(le,y.sections);_(!0),O.current.getSectionContent(ue).focus()},setSelectedSections:le=>{if(!O.current)return;const ue=jf(le,y.sections);_((ue==="all"?0:ue)!==null),m(le)},isFieldFocused:()=>{const le=Wn(document);return!!O.current&&O.current.getRoot().contains(le)}}),[b,m,y.sections,H]),$=Ve(le=>{if(!O.current)return;const ue=y.sections[le];O.current.getSectionContent(le).innerHTML=ue.value||ue.placeholder,L.syncSelectionToDOM()}),K=Ve((le,...ue)=>{le.isDefaultPrevented()||!O.current||(_(!0),i?.(le,...ue),b==="all"?setTimeout(()=>{const Ie=document.getSelection().getRangeAt(0).startOffset;if(Ie===0){m(I.startIndex);return}let Ce=0,we=0;for(;we<Ie&&Ce<y.sections.length;){const ye=y.sections[Ce];Ce+=1,we+=`${ye.startSeparator}${ye.value||ye.placeholder}${ye.endSeparator}`.length}m(Ce-1)}):H?O.current.getRoot().contains(le.target)||m(I.startIndex):(_(!0),m(I.startIndex)))}),G=Ve(le=>{if(a?.(le),!O.current||b!=="all")return;const Ie=le.target.textContent??"";O.current.getRoot().innerHTML=y.sections.map(Ce=>`${Ce.startSeparator}${Ce.value||Ce.placeholder}${Ce.endSeparator}`).join(""),L.syncSelectionToDOM(),Ie.length===0||Ie.charCodeAt(0)===10?(p(),C(),m("all")):Ie.length>1?S(Ie):(b==="all"&&m(0),h({keyPressed:Ie,sectionIndex:0}))}),q=Ve(le=>{if(l?.(le),n||b!=="all"){le.preventDefault();return}const ue=le.clipboardData.getData("text");le.preventDefault(),p(),S(ue)}),R=Ve((...le)=>{if(s?.(...le),H||!O.current)return;_(!0),O.current.getSectionIndexFromDOMElement(Wn(document))!=null||m(I.startIndex)}),oe=Ve((...le)=>{o?.(...le),setTimeout(()=>{if(!O.current)return;const ue=Wn(document);!O.current.getRoot().contains(ue)&&(_(!1),m(null))})}),se=Ve(le=>ue=>{ue.isDefaultPrevented()||m(le)}),z=Ve(le=>{le.preventDefault()}),pe=Ve(le=>()=>{m(le)}),J=Ve(le=>{if(le.preventDefault(),n||t||typeof b!="number")return;const ue=y.sections[b],Ie=le.clipboardData.getData("text"),Ce=/^[a-zA-Z]+$/.test(Ie),we=/^[0-9]+$/.test(Ie),ye=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Ie);ue.contentType==="letter"&&Ce||ue.contentType==="digit"&&we||ue.contentType==="digit-with-letter"&&ye?(p(),v({activeSection:ue,newSectionValue:Ie,shouldGoToNextSection:!0})):!Ce&&!we&&(p(),S(Ie))}),Q=Ve(le=>{le.preventDefault(),le.dataTransfer.dropEffect="none"}),re=Ve(le=>{if(!O.current)return;const ue=le.target,Ie=ue.textContent??"",Ce=O.current.getSectionIndexFromDOMElement(ue),we=y.sections[Ce];if(n||!O.current){$(Ce);return}if(Ie.length===0){if(we.value===""){$(Ce);return}const ye=le.nativeEvent.inputType;if(ye==="insertParagraph"||ye==="insertLineBreak"){$(Ce);return}p(),x();return}h({keyPressed:Ie,sectionIndex:Ce}),$(Ce)});yn(()=>{if(!(!H||!O.current)){if(b==="all")O.current.getRoot().focus();else if(typeof b=="number"){const le=O.current.getSectionContent(b);le&&le.focus()}}},[b,H]);const ne=M.useMemo(()=>y.sections.reduce((le,ue)=>(le[ue.type]=N[ue.type]({currentDate:null,contentType:ue.contentType,format:ue.format}),le),{}),[N,y.sections]),ae=b==="all",ie=M.useMemo(()=>y.sections.map((le,ue)=>{const Ie=!ae&&!t&&!n;return{container:{"data-sectionindex":ue,onClick:se(ue)},content:{tabIndex:ae||ue>0?-1:0,contentEditable:!ae&&!t&&!n,role:"spinbutton",id:`${D}-${le.type}`,"aria-labelledby":`${D}-${le.type}`,"aria-readonly":n,"aria-valuenow":KB(le,j),"aria-valuemin":ne[le.type].minimum,"aria-valuemax":ne[le.type].maximum,"aria-valuetext":le.value?YB(le,j):B.empty,"aria-label":B[le.type],"aria-disabled":t,spellCheck:Ie?!1:void 0,autoCapitalize:Ie?"off":void 0,autoCorrect:Ie?"off":void 0,[parseInt(M.version,10)>=17?"enterKeyHint":"enterkeyhint"]:Ie?"next":void 0,children:le.value||le.placeholder,onInput:re,onPaste:J,onFocus:pe(ue),onDragOver:Q,onMouseUp:z,inputMode:le.contentType==="letter"?"text":"numeric"},before:{children:le.startSeparator},after:{children:le.endSeparator}}}),[y.sections,pe,J,Q,re,se,z,t,n,ae,B,j,ne,D]),Z=Ve(le=>{S(le.target.value)}),me=M.useMemo(()=>T?"":f.getV7HiddenInputValueFromSections(y.sections),[T,y.sections,f]);return M.useEffect(()=>{if(O.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","<DatePicker slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(`
204
+ `));d&&O.current&&O.current.getSectionContent(I.startIndex).focus()},[]),{interactions:L,returnedValue:{autoFocus:d,readOnly:n,focused:u??H,sectionListRef:F,onBlur:oe,onClick:K,onFocus:R,onInput:G,onPaste:q,enableAccessibleFieldDOMStructure:!0,elements:ie,tabIndex:b===0?-1:0,contentEditable:ae,value:me,onChange:Z,areAllSectionsEmpty:T}}},Ji=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),M$=(e,t,n)=>{let r=0,o=n?1:0;const i=[];for(let s=0;s<e.length;s+=1){const a=e[s],l=eh(a,n?"input-rtl":"input-ltr",t),u=`${a.startSeparator}${l}${a.endSeparator}`,d=Ji(u).length,f=u.length,h=Ji(l),p=o+(h===""?0:l.indexOf(h[0]))+a.startSeparator.length,m=p+h.length;i.push(Y({},a,{start:r,end:r+d,startInInput:p,endInInput:m})),r+=d,o+=f}return i},P$=e=>{const t=kr(),n=M.useRef(void 0),r=M.useRef(void 0),{forwardedProps:{onFocus:o,onClick:i,onPaste:s,onBlur:a,inputRef:l,placeholder:u},internalProps:{readOnly:d=!1,disabled:f=!1},parsedSelectedSections:h,activeSectionIndex:p,state:m,fieldValueManager:b,valueManager:y,applyCharacterEditing:x,resetCharacterQuery:C,updateSectionValue:v,updateValueFromValueStr:S,clearActiveSection:I,clearValue:T,setTempAndroidValueStr:N,setSelectedSections:O,getSectionsFromValue:F,areAllSectionsEmpty:B,localizedDigits:j}=e,D=M.useRef(null),H=vt(l,D),_=M.useMemo(()=>M$(m.sections,j,t),[m.sections,j,t]),L=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!D.current)return;if(h==null){D.current.scrollLeft&&(D.current.scrollLeft=0);return}if(D.current!==Wn(document))return;const re=D.current.scrollTop;if(h==="all")D.current.select();else{const ne=_[h],ae=ne.type==="empty"?ne.startInInput-ne.startSeparator.length:ne.startInInput,ie=ne.type==="empty"?ne.endInInput+ne.endSeparator.length:ne.endInInput;(ae!==D.current.selectionStart||ie!==D.current.selectionEnd)&&D.current===Wn(document)&&D.current.setSelectionRange(ae,ie),clearTimeout(r.current),r.current=setTimeout(()=>{D.current&&D.current===Wn(document)&&D.current.selectionStart===D.current.selectionEnd&&(D.current.selectionStart!==ae||D.current.selectionEnd!==ie)&&L.syncSelectionToDOM()})}D.current.scrollTop=re},getActiveSectionIndexFromDOM:()=>{const re=D.current.selectionStart??0,ne=D.current.selectionEnd??0;if(re===0&&ne===0)return null;const ae=re<=_[0].startInInput?1:_.findIndex(ie=>ie.startInInput-ie.startSeparator.length>re);return ae===-1?_.length-1:ae-1},focusField:(re=0)=>{Wn(document)!==D.current&&(D.current?.focus(),O(re))},setSelectedSections:re=>O(re),isFieldFocused:()=>D.current===Wn(document)}),[D,h,_,O]),$=()=>{const re=D.current.selectionStart??0;let ne;re<=_[0].startInInput||re>=_[_.length-1].endInInput?ne=1:ne=_.findIndex(ie=>ie.startInInput-ie.startSeparator.length>re);const ae=ne===-1?_.length-1:ne-1;O(ae)},K=Ve((...re)=>{o?.(...re);const ne=D.current;clearTimeout(n.current),n.current=setTimeout(()=>{!ne||ne!==D.current||p==null&&(ne.value.length&&Number(ne.selectionEnd)-Number(ne.selectionStart)===ne.value.length?O("all"):$())})}),G=Ve((re,...ne)=>{re.isDefaultPrevented()||(i?.(re,...ne),$())}),q=Ve(re=>{if(s?.(re),re.preventDefault(),d||f)return;const ne=re.clipboardData.getData("text");if(typeof h=="number"){const ae=m.sections[h],ie=/^[a-zA-Z]+$/.test(ne),Z=/^[0-9]+$/.test(ne),me=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ne);if(ae.contentType==="letter"&&ie||ae.contentType==="digit"&&Z||ae.contentType==="digit-with-letter"&&me){C(),v({activeSection:ae,newSectionValue:ne,shouldGoToNextSection:!0});return}if(ie||Z)return}C(),S(ne)}),R=Ve((...re)=>{a?.(...re),O(null)}),oe=Ve(re=>{if(d)return;const ne=re.target.value;if(ne===""){C(),T();return}const ae=re.nativeEvent.data,ie=ae&&ae.length>1,Z=ie?ae:ne,me=Ji(Z);if(h==="all"&&O(p),p==null||ie){S(ie?ae:me);return}let le;if(h==="all"&&me.length===1)le=me;else{const ue=Ji(b.getV6InputValueFromSections(_,j,t));let Ie=-1,Ce=-1;for(let Ne=0;Ne<ue.length;Ne+=1)Ie===-1&&ue[Ne]!==me[Ne]&&(Ie=Ne),Ce===-1&&ue[ue.length-Ne-1]!==me[me.length-Ne-1]&&(Ce=Ne);const we=_[p];if(Ie<we.start||ue.length-Ce-1>we.end)return;const ze=me.length-ue.length+we.end-Ji(we.endSeparator||"").length;le=me.slice(we.start+Ji(we.startSeparator||"").length,ze)}if(le.length===0){WB()&&N(Z),C(),I();return}x({keyPressed:le,sectionIndex:p})}),se=M.useMemo(()=>u!==void 0?u:b.getV6InputValueFromSections(F(y.emptyValue),j,t),[u,b,F,y.emptyValue,j,t]),z=M.useMemo(()=>m.tempValueStrAndroid??b.getV6InputValueFromSections(m.sections,j,t),[m.sections,b,m.tempValueStrAndroid,j,t]);M.useEffect(()=>(D.current&&D.current===Wn(document)&&O("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const pe=M.useMemo(()=>p==null||m.sections[p].contentType==="letter"?"text":"numeric",[p,m.sections]),Q=!(D.current&&D.current===Wn(document))&&B;return{interactions:L,returnedValue:{readOnly:d,onBlur:R,onClick:G,onFocus:K,onPaste:q,inputRef:H,enableAccessibleFieldDOMStructure:!1,placeholder:se,inputMode:pe,autoComplete:"off",value:Q?"":z,onChange:oe}}},R$=e=>{const t=Zt(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:o,enableAccessibleFieldDOMStructure:i=!1,disabled:s=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:u,clearable:d,onClear:f},fieldValueManager:h,valueManager:p,validator:m}=e,b=kr(),y=D$(e),{state:x,activeSectionIndex:C,parsedSelectedSections:v,setSelectedSections:S,clearValue:I,clearActiveSection:T,updateSectionValue:N,setTempAndroidValueStr:O,sectionsValueBoundaries:F,localizedDigits:B,timezone:j}=y,D=A$({sections:x.sections,updateSectionValue:N,sectionsValueBoundaries:F,localizedDigits:B,setTempAndroidValueStr:O,timezone:j}),{resetCharacterQuery:H}=D,_=p.areValuesEqual(t,x.value,p.emptyValue),L=i?O$:P$,$=M.useMemo(()=>qB(x.sections,b&&!i),[x.sections,b,i]),{returnedValue:K,interactions:G}=L(Y({},e,y,D,{areAllSectionsEmpty:_,sectionOrder:$})),q=Ve(J=>{if(l?.(J),!s)switch(!0){case((J.ctrlKey||J.metaKey)&&String.fromCharCode(J.keyCode)==="A"&&!J.shiftKey&&!J.altKey):{J.preventDefault(),S("all");break}case J.key==="ArrowRight":{if(J.preventDefault(),v==null)S($.startIndex);else if(v==="all")S($.endIndex);else{const Q=$.neighbors[v].rightIndex;Q!==null&&S(Q)}break}case J.key==="ArrowLeft":{if(J.preventDefault(),v==null)S($.endIndex);else if(v==="all")S($.startIndex);else{const Q=$.neighbors[v].leftIndex;Q!==null&&S(Q)}break}case J.key==="Delete":{if(J.preventDefault(),a)break;v==null||v==="all"?I():T(),H();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(J.key):{if(J.preventDefault(),a||C==null)break;v==="all"&&S(C);const Q=x.sections[C],re=h.getActiveDateManager(t,x,Q),ne=BB(t,j,Q,J.key,F,B,re.date,{minutesStep:o});N({activeSection:Q,newSectionValue:ne,shouldGoToNextSection:!1});break}}});yn(()=>{G.syncSelectionToDOM()});const{hasValidationError:R}=dC({props:n,validator:m,timezone:j,value:x.value,onError:n.onError}),oe=M.useMemo(()=>u!==void 0?u:R,[R,u]);M.useEffect(()=>{!oe&&C==null&&H()},[x.referenceValue,C,oe]),M.useEffect(()=>{x.tempValueStrAndroid!=null&&C!=null&&(H(),T())},[x.sections]),M.useImperativeHandle(r,()=>({getSections:()=>x.sections,getActiveSectionIndex:G.getActiveSectionIndexFromDOM,setSelectedSections:G.setSelectedSections,focusField:G.focusField,isFieldFocused:G.isFieldFocused}));const se=Ve((J,...Q)=>{J.preventDefault(),f?.(J,...Q),I(),G.isFieldFocused()?S($.startIndex):G.focusField(0)}),z={onKeyDown:q,onClear:se,error:oe,clearable:!!(d&&!_&&!a&&!s)},pe={disabled:s,readOnly:a};return Y({},e.forwardedProps,z,pe,K)},N$=["clearable","onClear","InputProps","sx","slots","slotProps"],F$=["ownerState"],L$=e=>{const t=vo(),{clearable:n,onClear:r,InputProps:o,sx:i,slots:s,slotProps:a}=e,l=Ze(e,N$),u=s?.clearButton??Ir,d=Et({elementType:u,externalSlotProps:a?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),f=Ze(d,F$),h=s?.clearIcon??C$,p=Et({elementType:h,externalSlotProps:a?.clearIcon,ownerState:{}});return Y({},l,{InputProps:Y({},o,{endAdornment:c.jsxs(M.Fragment,{children:[n&&c.jsx(fC,{position:"end",sx:{marginRight:o?.endAdornment?-1:-1.5},children:c.jsx(u,Y({},f,{onClick:r,children:c.jsx(h,Y({fontSize:"small"},p))}))}),o?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(i)?i:[i]]})},_$=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],B$=(e,t)=>M.useMemo(()=>{const n=Y({},e),r={},o=i=>{n.hasOwnProperty(i)&&(r[i]=n[i],delete n[i])};return _$.forEach(o),uC.forEach(o),{forwardedProps:n,internalProps:r}},[e,t]),j$=e=>{const t=Zt(),n=kl();return Y({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??t.formats.keyboardDate,minDate:vr(t,e.minDate,n.minDate),maxDate:vr(t,e.maxDate,n.maxDate)})},$$=e=>{const t=j$(e),{forwardedProps:n,internalProps:r}=B$(t,"date");return R$({forwardedProps:n,internalProps:r,valueManager:Zr,fieldValueManager:QB,validator:wl,valueType:"date"})};function H$(e){return Ge("MuiPickersTextField",e)}We("MuiPickersTextField",["root","focused","disabled","error","required"]);function z$(e){return Ge("MuiPickersInputBase",e)}const ls=We("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function U$(e){return Ge("MuiPickersSectionList",e)}const ba=We("MuiPickersSectionList",["root","section","sectionContent"]),V$=["slots","slotProps","elements","sectionListRef"],CC=fe("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),EC=fe("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),vC=fe("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),TC=fe("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),W$=e=>{const{classes:t}=e;return Ke({root:["root"],section:["section"],sectionContent:["sectionContent"]},U$,t)};function q$(e){const{slots:t,slotProps:n,element:r,classes:o}=e,i=t?.section??EC,s=Et({elementType:i,externalSlotProps:n?.section,externalForwardedProps:r.container,className:o.section,ownerState:{}}),a=t?.sectionContent??TC,l=Et({elementType:a,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),u=t?.sectionSeparator??vC,d=Et({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Et({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return c.jsxs(i,Y({},s,{children:[c.jsx(u,Y({},d)),c.jsx(a,Y({},l)),c.jsx(u,Y({},f))]}))}const Y$=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersSectionList"}),{slots:o,slotProps:i,elements:s,sectionListRef:a}=r,l=Ze(r,V$),u=W$(r),d=M.useRef(null),f=vt(n,d),h=b=>{if(!d.current)throw new Error(`MUI X: Cannot call sectionListRef.${b} before the mount of the component.`);return d.current};M.useImperativeHandle(a,()=>({getRoot(){return h("getRoot")},getSectionContainer(b){return h("getSectionContainer").querySelector(`.${ba.section}[data-sectionindex="${b}"]`)},getSectionContent(b){return h("getSectionContent").querySelector(`.${ba.section}[data-sectionindex="${b}"] .${ba.sectionContent}`)},getSectionIndexFromDOMElement(b){const y=h("getSectionIndexFromDOMElement");if(b==null||!y.contains(b))return null;let x=null;return b.classList.contains(ba.section)?x=b:b.classList.contains(ba.sectionContent)&&(x=b.parentElement),x==null?null:Number(x.dataset.sectionindex)}}));const p=o?.root??CC,m=Et({elementType:p,externalSlotProps:i?.root,externalForwardedProps:l,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:u.root,ownerState:{}});return c.jsx(p,Y({},m,{children:m.contentEditable?s.map(({content:b,before:y,after:x})=>`${y.children}${b.children}${x.children}`).join(""):c.jsx(M.Fragment,{children:s.map((b,y)=>c.jsx(q$,{slots:o,slotProps:i,element:b,classes:u},y))})}))}),K$=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],G$=e=>Math.round(e*1e5)/1e5,Fc=fe("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>Y({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${G$(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),oh=fe(CC,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:t,focused:n,filled:r,label:o})=>!t&&!n&&!r&&o==null,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:e.palette.mode==="light"?.42:.5}}]})),Q$=fe(EC,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),X$=fe(TC,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),Z$=fe(vC,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),J$=fe("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(Y({},SB)),eH=e=>{const{focused:t,disabled:n,error:r,classes:o,fullWidth:i,readOnly:s,color:a,size:l,endAdornment:u,startAdornment:d}=e,f={root:["root",t&&!n&&"focused",n&&"disabled",s&&"readOnly",r&&"error",i&&"fullWidth",`color${Fe(a)}`,l==="small"&&"inputSizeSmall",!!d&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Ke(f,z$,o)},ih=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersInputBase"}),{elements:o,areAllSectionsEmpty:i,value:s,onChange:a,id:l,endAdornment:u,startAdornment:d,renderSuffix:f,slots:h,slotProps:p,contentEditable:m,tabIndex:b,onInput:y,onPaste:x,onKeyDown:C,name:v,readOnly:S,inputProps:I,inputRef:T,sectionListRef:N}=r,O=Ze(r,K$),F=M.useRef(null),B=vt(n,F),j=vt(I?.ref,T),D=kr(),H=ar();if(!H)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const _=R=>{if(H.disabled){R.stopPropagation();return}H.onFocus?.(R)};M.useEffect(()=>{H&&H.setAdornedStart(!!d)},[H,d]),M.useEffect(()=>{H&&(i?H.onEmpty():H.onFilled())},[H,i]);const L=Y({},r,H,{isRtl:D}),$=eH(L),K=h?.root||Fc,G=Et({elementType:K,externalSlotProps:p?.root,externalForwardedProps:O,additionalProps:{"aria-invalid":H.error,ref:B},className:$.root,ownerState:L}),q=h?.input||oh;return c.jsxs(K,Y({},G,{children:[d,c.jsx(Y$,{sectionListRef:N,elements:o,contentEditable:m,tabIndex:b,className:$.sectionsContainer,onFocus:_,onBlur:H.onBlur,onInput:y,onPaste:x,onKeyDown:C,slots:{root:q,section:Q$,sectionContent:X$,sectionSeparator:Z$},slotProps:{root:{ownerState:L},sectionContent:{className:ls.sectionContent},sectionSeparator:({position:R})=>({className:R==="before"?ls.sectionBefore:ls.sectionAfter})}}),u,f?f(Y({},H)):null,c.jsx(J$,Y({name:v,className:$.input,value:s,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:S,required:H.required,disabled:H.disabled},I,{ref:j}))]}))});function tH(e){return Ge("MuiPickersOutlinedInput",e)}const Rr=Y({},ls,We("MuiPickersOutlinedInput",["root","notchedOutline","input"])),nH=["children","className","label","notched","shrink"],rH=fe("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),V1=fe("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),oH=fe("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function iH(e){const{className:t,label:n}=e,r=Ze(e,nH),o=n!=null&&n!=="",i=Y({},e,{withLabel:o});return c.jsx(rH,Y({"aria-hidden":!0,className:t},r,{ownerState:i,children:c.jsx(oH,{ownerState:i,children:o?c.jsx(V1,{children:n}):c.jsx(V1,{className:"notranslate",children:"​"})})}))}const sH=["label","autoFocus","ownerState","notched"],aH=fe(Fc,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Rr.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Rr.focused} .${Rr.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Rr.disabled}`]:{[`& .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${Rr.error} .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(n=>(e.vars??e).palette[n]?.main??!1).map(n=>({props:{color:n},style:{[`&.${Rr.focused}:not(.${Rr.error}) .${Rr.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),lH=fe(oh,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),uH=e=>{const{classes:t}=e,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},tH,t);return Y({},t,r)},SC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersOutlinedInput"}),{label:o,ownerState:i,notched:s}=r,a=Ze(r,sH),l=ar(),u=Y({},r,i,l,{color:l?.color||"primary"}),d=uH(u);return c.jsx(ih,Y({slots:{root:aH,input:lH},renderSuffix:f=>c.jsx(iH,{shrink:!!(s||f.adornedStart||f.focused||f.filled),notched:!!(s||f.adornedStart||f.focused||f.filled),className:d.notchedOutline,label:o!=null&&o!==""&&l?.required?c.jsxs(M.Fragment,{children:[o," ","*"]}):o,ownerState:u})},a,{label:o,classes:d,ref:n}))});SC.muiName="Input";function cH(e){return Ge("MuiPickersFilledInput",e)}const Zo=Y({},ls,We("MuiPickersFilledInput",["root","underline","input"])),dH=["label","autoFocus","disableUnderline","ownerState"],fH=fe(Fc,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Ot.shouldForwardProp(e)&&e!=="disableUnderline"})(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${Zo.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${Zo.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[...Object.keys((e.vars??e).palette).filter(s=>(e.vars??e).palette[s].main).map(s=>({props:{color:s,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[s]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Zo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Zo.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Zo.disabled}, .${Zo.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Zo.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:s})=>!!s,style:{paddingLeft:12}},{props:({endAdornment:s})=>!!s,style:{paddingRight:12}}]}}),pH=fe(oh,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),hH=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},cH,t);return Y({},t,o)},kC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersFilledInput"}),{label:o,disableUnderline:i=!1,ownerState:s}=r,a=Ze(r,dH),l=ar(),u=Y({},r,s,l,{color:l?.color||"primary"}),d=hH(u);return c.jsx(ih,Y({slots:{root:fH,input:pH},slotProps:{root:{disableUnderline:i}}},a,{label:o,classes:d,ref:n}))});kC.muiName="Input";function mH(e){return Ge("MuiPickersFilledInput",e)}const ya=Y({},ls,We("MuiPickersInput",["root","input"])),gH=["label","autoFocus","disableUnderline","ownerState"],bH=fe(Fc,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(r=>(e.vars??e).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ya.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ya.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ya.disabled}, .${ya.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${ya.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),yH=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},mH,t);return Y({},t,o)},wC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersInput"}),{label:o,disableUnderline:i=!1,ownerState:s}=r,a=Ze(r,gH),l=ar(),u=Y({},r,s,l,{disableUnderline:i,color:l?.color||"primary"}),d=yH(u);return c.jsx(ih,Y({slots:{root:bH}},a,{label:o,classes:d,ref:n}))});wC.muiName="Input";const xH=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],CH={standard:wC,filled:kC,outlined:SC},EH=fe(Wu,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),vH=e=>{const{focused:t,disabled:n,classes:r,required:o}=e;return Ke({root:["root",t&&!n&&"focused",n&&"disabled",o&&"required"]},H$,r)},TH=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersTextField"}),{onFocus:o,onBlur:i,className:s,color:a="primary",disabled:l=!1,error:u=!1,variant:d="outlined",required:f=!1,InputProps:h,inputProps:p,inputRef:m,sectionListRef:b,elements:y,areAllSectionsEmpty:x,onClick:C,onKeyDown:v,onKeyUp:S,onPaste:I,onInput:T,endAdornment:N,startAdornment:O,tabIndex:F,contentEditable:B,focused:j,value:D,onChange:H,fullWidth:_,id:L,name:$,helperText:K,FormHelperTextProps:G,label:q,InputLabelProps:R}=r,oe=Ze(r,xH),se=M.useRef(null),z=vt(n,se),pe=_r(L),J=K&&pe?`${pe}-helper-text`:void 0,Q=q&&pe?`${pe}-label`:void 0,re=Y({},r,{color:a,disabled:l,error:u,focused:j,required:f,variant:d}),ne=vH(re),ae=CH[d];return c.jsxs(EH,Y({className:Ue(ne.root,s),ref:z,focused:j,onFocus:o,onBlur:i,disabled:l,variant:d,error:u,color:a,fullWidth:_,required:f,ownerState:re},oe,{children:[c.jsx(qu,Y({htmlFor:pe,id:Q},R,{children:q})),c.jsx(ae,Y({elements:y,areAllSectionsEmpty:x,onClick:C,onKeyDown:v,onKeyUp:S,onInput:T,onPaste:I,endAdornment:N,startAdornment:O,tabIndex:F,contentEditable:B,value:D,onChange:H,id:pe,fullWidth:_,inputProps:p,inputRef:m,sectionListRef:b,label:q,name:$,role:"group","aria-labelledby":Q,"aria-describedby":J,"aria-live":J?"polite":void 0},h)),K&&c.jsx(O2,Y({id:J},G,{children:K}))]}))}),SH=["enableAccessibleFieldDOMStructure"],kH=["InputProps","readOnly"],wH=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],DH=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=Ze(e,SH);if(t){const{InputProps:f,readOnly:h}=n,p=Ze(n,kH);return Y({},p,{InputProps:Y({},f??{},{readOnly:h})})}const{onPaste:r,onKeyDown:o,inputMode:i,readOnly:s,InputProps:a,inputProps:l,inputRef:u}=n,d=Ze(n,wH);return Y({},d,{InputProps:Y({},a??{},{readOnly:s}),inputProps:Y({},l??{},{inputMode:i,onPaste:r,onKeyDown:o,ref:u})})},IH=["slots","slotProps","InputProps","inputProps"],DC=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiDateField"}),{slots:o,slotProps:i,InputProps:s,inputProps:a}=r,l=Ze(r,IH),u=r,d=o?.textField??(t.enableAccessibleFieldDOMStructure?TH:Ct),f=Et({elementType:d,externalSlotProps:i?.textField,externalForwardedProps:l,additionalProps:{ref:n},ownerState:u});f.inputProps=Y({},a,f.inputProps),f.InputProps=Y({},s,f.InputProps);const h=$$(f),p=DH(h),m=L$(Y({},p,{slots:o,slotProps:i}));return c.jsx(d,Y({},m))}),IC=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:s,timezone:a})=>{const l=Ti();return M.useCallback(u=>wl({adapter:l,value:u,timezone:a,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:s}})!==null,[l,e,t,n,r,o,i,s,a])},AH=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return Y({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{const i=o.newTimezone;if(n.getTimezone(r.currentMonth)===i)return r;let s=n.setTimezone(r.currentMonth,i);return n.getMonth(s)!==n.getMonth(r.currentMonth)&&(s=n.setMonth(s,n.getMonth(r.currentMonth))),Y({},r,{currentMonth:s})}case"finishMonthSwitchingAnimation":return Y({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&n.isSameDay(o.focusedDay,r.focusedDay))return r;const i=o.focusedDay!=null&&!t&&!n.isSameMonth(r.currentMonth,o.focusedDay);return Y({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:i&&!e&&!o.withoutMonthSwitchingAnimation,currentMonth:i?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},OH=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:i=!1,maxDate:s,minDate:a,onMonthChange:l,reduceAnimations:u,shouldDisableDate:d,timezone:f}=e,h=Zt(),p=M.useRef(AH(!!u,i,h)).current,m=M.useMemo(()=>Zr.getInitialReferenceValue({value:t,utils:h,timezone:f,props:e,referenceDate:n,granularity:Kr.day}),[n,f]),[b,y]=M.useReducer(p,{isMonthSwitchingAnimating:!1,focusedDay:m,currentMonth:h.startOfMonth(m),slideDirection:"left"});M.useEffect(()=>{y({type:"changeMonthTimezone",newTimezone:h.getTimezone(m)})},[m,h]);const x=M.useCallback(T=>{y(Y({type:"changeMonth"},T)),l&&l(T.newMonth)},[l]),C=M.useCallback(T=>{const N=T;h.isSameMonth(N,b.currentMonth)||x({newMonth:h.startOfMonth(N),direction:h.isAfterDay(N,b.currentMonth)?"left":"right"})},[b.currentMonth,x,h]),v=IC({shouldDisableDate:d,minDate:a,maxDate:s,disableFuture:r,disablePast:o,timezone:f}),S=M.useCallback(()=>{y({type:"finishMonthSwitchingAnimation"})},[]),I=Ve((T,N)=>{v(T)||y({type:"changeFocusedDay",focusedDay:T,withoutMonthSwitchingAnimation:N})});return{referenceDate:m,calendarState:b,changeMonth:C,changeFocusedDay:I,isDateDisabled:v,onMonthSwitchingAnimationEnd:S,handleChangeMonth:x}},MH=e=>Ge("MuiPickersFadeTransitionGroup",e);We("MuiPickersFadeTransitionGroup",["root"]);const PH=e=>{const{classes:t}=e;return Ke({root:["root"]},MH,t)},RH=fe(El,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function AC(e){const t=Kt({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,s=PH(t),a=Lo();return o?n:c.jsx(RH,{className:Ue(s.root,r),children:c.jsx(hi,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},i)})}function NH(e){return Ge("MuiPickersDay",e)}const Jo=We("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),FH=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],LH=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:o,disabled:i,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=e,u=s&&!a;return Ke({root:["root",t&&!u&&"selected",i&&"disabled",!n&&"dayWithMargin",!r&&o&&"today",s&&a&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},NH,l)},OC=({theme:e})=>Y({},e.typography.caption,{width:il,height:il,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${Jo.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Jo.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Jo.disabled}:not(.${Jo.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${Jo.disabled}&.${Jo.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${Rc}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${Jo.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),MC=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},_H=fe(pi,{name:"MuiPickersDay",slot:"Root",overridesResolver:MC})(OC),BH=fe("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:MC})(({theme:e})=>Y({},OC({theme:e}),{opacity:0,pointerEvents:"none"})),xa=()=>{},jH=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiPickersDay"}),{autoFocus:o=!1,className:i,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:u=!1,isAnimating:d,onClick:f,onDaySelect:h,onFocus:p=xa,onBlur:m=xa,onKeyDown:b=xa,onMouseDown:y=xa,onMouseEnter:x=xa,outsideCurrentMonth:C,selected:v=!1,showDaysOutsideCurrentMonth:S=!1,children:I,today:T=!1}=r,N=Ze(r,FH),O=Y({},r,{autoFocus:o,disabled:a,disableHighlightToday:l,disableMargin:u,selected:v,showDaysOutsideCurrentMonth:S,today:T}),F=LH(O),B=Zt(),j=M.useRef(null),D=vt(j,n);yn(()=>{o&&!a&&!d&&!C&&j.current.focus()},[o,a,d,C]);const H=L=>{y(L),C&&L.preventDefault()},_=L=>{a||h(s),C&&L.currentTarget.focus(),f&&f(L)};return C&&!S?c.jsx(BH,{className:Ue(F.root,F.hiddenDaySpacingFiller,i),ownerState:O,role:N.role}):c.jsx(_H,Y({className:Ue(F.root,i),ref:D,centerRipple:!0,disabled:a,tabIndex:v?0:-1,onKeyDown:L=>b(L,s),onFocus:L=>p(L,s),onBlur:L=>m(L,s),onMouseEnter:L=>x(L,s),onClick:_,onMouseDown:H},N,{ownerState:O,children:I||B.format(s,"dayOfMonth")}))}),$H=M.memo(jH),HH=e=>Ge("MuiPickersSlideTransition",e),dr=We("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),zH=["children","className","reduceAnimations","slideDirection","transKey","classes"],UH=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Ke(r,HH,t)},VH=fe(El,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${dr["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${dr["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${dr.slideEnterActive}`]:t.slideEnterActive},{[`.${dr.slideExit}`]:t.slideExit},{[`.${dr["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${dr["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${dr["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${dr["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${dr.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${dr.slideExit}`]:{transform:"translate(0%)"},[`& .${dr["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${dr["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function WH(e){const t=Kt({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,s=Ze(t,zH),a=UH(t),l=Lo();if(o)return c.jsx("div",{className:Ue(a.root,r),children:n});const u={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return c.jsx(VH,{className:Ue(a.root,r),childFactory:d=>M.cloneElement(d,{classNames:u}),role:"presentation",children:c.jsx(Ip,Y({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:u},s,{children:n}),i)})}const qH=e=>Ge("MuiDayCalendar",e);We("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const YH=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],KH=["ownerState"],GH=e=>{const{classes:t}=e;return Ke({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},qH,t)},PC=(il+Rc*2)*6,QH=fe("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),XH=fe("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),ZH=fe(Dt,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),JH=fe(Dt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),ez=fe(Dt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>Y({},e.typography.caption,{width:il,height:il,padding:0,margin:`0 ${Rc}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),tz=fe("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:PC}),nz=fe(WH,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:PC}),rz=fe("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),oz=fe("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${Rc}px 0`,display:"flex",justifyContent:"center"});function iz(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:o,isDateDisabled:i,currentMonthNumber:s,isViewFocused:a}=e,l=Ze(e,YH);const{disabled:u,disableHighlightToday:d,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:h,slots:p,slotProps:m,timezone:b}=t,y=Zt(),x=Pc(b),C=r!==null&&y.isSameDay(n,r),v=o.some(D=>y.isSameDay(D,n)),S=y.isSameDay(n,x),I=p?.day??$H,T=Et({elementType:I,externalSlotProps:m?.day,additionalProps:Y({disableHighlightToday:d,showDaysOutsideCurrentMonth:h,role:"gridcell",isAnimating:f,"data-timestamp":y.toJsDate(n).valueOf()},l),ownerState:Y({},t,{day:n,selected:v})}),N=Ze(T,KH),O=M.useMemo(()=>u||i(n),[u,i,n]),F=M.useMemo(()=>y.getMonth(n)!==s,[y,n,s]),B=M.useMemo(()=>{const D=y.startOfMonth(y.setMonth(n,s));return h?y.isSameDay(n,y.startOfWeek(D)):y.isSameDay(n,D)},[s,n,h,y]),j=M.useMemo(()=>{const D=y.endOfMonth(y.setMonth(n,s));return h?y.isSameDay(n,y.endOfWeek(D)):y.isSameDay(n,D)},[s,n,h,y]);return c.jsx(I,Y({},N,{day:n,disabled:O,autoFocus:a&&C,today:S,outsideCurrentMonth:F,isFirstVisibleCell:B,isLastVisibleCell:j,selected:v,tabIndex:C?0:-1,"aria-selected":v,"aria-current":S?"date":void 0}))}function sz(e){const t=Kt({props:e,name:"MuiDayCalendar"}),n=Zt(),{onFocusedDayChange:r,className:o,currentMonth:i,selectedDays:s,focusedDay:a,loading:l,onSelectedDaysChange:u,onMonthSwitchingAnimationEnd:d,readOnly:f,reduceAnimations:h,renderLoading:p=()=>c.jsx("span",{children:"..."}),slideDirection:m,TransitionProps:b,disablePast:y,disableFuture:x,minDate:C,maxDate:v,shouldDisableDate:S,shouldDisableMonth:I,shouldDisableYear:T,dayOfWeekFormatter:N=Ce=>n.format(Ce,"weekdayShort").charAt(0).toUpperCase(),hasFocus:O,onFocusedViewChange:F,gridLabelId:B,displayWeekNumber:j,fixedWeekNumber:D,autoFocus:H,timezone:_}=t,L=Pc(_),$=GH(t),K=kr(),G=IC({shouldDisableDate:S,shouldDisableMonth:I,shouldDisableYear:T,minDate:C,maxDate:v,disablePast:y,disableFuture:x,timezone:_}),q=vo(),[R,oe]=or({name:"DayCalendar",state:"hasFocus",controlled:O,default:H??!1}),[se,z]=M.useState(()=>a||L),pe=Ve(Ce=>{f||u(Ce)}),J=Ce=>{G(Ce)||(r(Ce),z(Ce),F?.(!0),oe(!0))},Q=Ve((Ce,we)=>{switch(Ce.key){case"ArrowUp":J(n.addDays(we,-7)),Ce.preventDefault();break;case"ArrowDown":J(n.addDays(we,7)),Ce.preventDefault();break;case"ArrowLeft":{const ye=n.addDays(we,K?1:-1),ze=n.addMonths(we,K?1:-1),Ne=qa({utils:n,date:ye,minDate:K?ye:n.startOfMonth(ze),maxDate:K?n.endOfMonth(ze):ye,isDateDisabled:G,timezone:_});J(Ne||ye),Ce.preventDefault();break}case"ArrowRight":{const ye=n.addDays(we,K?-1:1),ze=n.addMonths(we,K?-1:1),Ne=qa({utils:n,date:ye,minDate:K?n.startOfMonth(ze):ye,maxDate:K?ye:n.endOfMonth(ze),isDateDisabled:G,timezone:_});J(Ne||ye),Ce.preventDefault();break}case"Home":J(n.startOfWeek(we)),Ce.preventDefault();break;case"End":J(n.endOfWeek(we)),Ce.preventDefault();break;case"PageUp":J(n.addMonths(we,1)),Ce.preventDefault();break;case"PageDown":J(n.addMonths(we,-1)),Ce.preventDefault();break}}),re=Ve((Ce,we)=>J(we)),ne=Ve((Ce,we)=>{R&&n.isSameDay(se,we)&&F?.(!1)}),ae=n.getMonth(i),ie=n.getYear(i),Z=M.useMemo(()=>s.filter(Ce=>!!Ce).map(Ce=>n.startOfDay(Ce)),[n,s]),me=`${ie}-${ae}`,le=M.useMemo(()=>M.createRef(),[me]),ue=M.useMemo(()=>{const Ce=n.startOfMonth(i),we=n.endOfMonth(i);return G(se)||n.isAfterDay(se,we)||n.isBeforeDay(se,Ce)?qa({utils:n,date:se,minDate:Ce,maxDate:we,disablePast:y,disableFuture:x,isDateDisabled:G,timezone:_}):se},[i,x,y,se,G,n,_]),Ie=M.useMemo(()=>{const Ce=n.getWeekArray(i);let we=n.addMonths(i,1);for(;D&&Ce.length<D;){const ye=n.getWeekArray(we),ze=n.isSameDay(Ce[Ce.length-1][0],ye[0][0]);ye.slice(ze?1:0).forEach(Ne=>{Ce.length<D&&Ce.push(Ne)}),we=n.addMonths(we,1)}return Ce},[i,D,n]);return c.jsxs(QH,{role:"grid","aria-labelledby":B,className:$.root,children:[c.jsxs(XH,{role:"row",className:$.header,children:[j&&c.jsx(JH,{variant:"caption",role:"columnheader","aria-label":q.calendarWeekNumberHeaderLabel,className:$.weekNumberLabel,children:q.calendarWeekNumberHeaderText}),AB(n,L).map((Ce,we)=>c.jsx(ZH,{variant:"caption",role:"columnheader","aria-label":n.format(Ce,"weekday"),className:$.weekDayLabel,children:N(Ce)},we.toString()))]}),l?c.jsx(tz,{className:$.loadingContainer,children:p()}):c.jsx(nz,Y({transKey:me,onExited:d,reduceAnimations:h,slideDirection:m,className:Ue(o,$.slideTransition)},b,{nodeRef:le,children:c.jsx(rz,{ref:le,role:"rowgroup",className:$.monthContainer,children:Ie.map((Ce,we)=>c.jsxs(oz,{role:"row",className:$.weekContainer,"aria-rowindex":we+1,children:[j&&c.jsx(ez,{className:$.weekNumber,role:"rowheader","aria-label":q.calendarWeekNumberAriaLabelText(n.getWeekNumber(Ce[0])),children:q.calendarWeekNumberText(n.getWeekNumber(Ce[0]))}),Ce.map((ye,ze)=>c.jsx(iz,{parentProps:t,day:ye,selectedDays:Z,focusableDay:ue,onKeyDown:Q,onFocus:re,onBlur:ne,onDaySelect:pe,isDateDisabled:G,currentMonthNumber:ae,isViewFocused:R,"aria-colindex":ze+1},ye.toString()))]},`week-${Ce[0]}`))})}))]})}function az(e){return Ge("MuiPickersMonth",e)}const tu=We("MuiPickersMonth",["root","monthButton","disabled","selected"]),lz=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],uz=e=>{const{disabled:t,selected:n,classes:r}=e;return Ke({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},az,r)},cz=fe("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),dz=fe("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${tu.disabled}`]:t.disabled},{[`&.${tu.selected}`]:t.selected}]})(({theme:e})=>Y({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${tu.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${tu.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),fz=M.memo(function(t){const n=Kt({props:t,name:"MuiPickersMonth"}),{autoFocus:r,className:o,children:i,disabled:s,selected:a,value:l,tabIndex:u,onClick:d,onKeyDown:f,onFocus:h,onBlur:p,"aria-current":m,"aria-label":b,slots:y,slotProps:x}=n,C=Ze(n,lz),v=M.useRef(null),S=uz(n);yn(()=>{r&&v.current?.focus()},[r]);const I=y?.monthButton??dz,T=Et({elementType:I,externalSlotProps:x?.monthButton,additionalProps:{children:i,disabled:s,tabIndex:u,ref:v,type:"button",role:"radio","aria-current":m,"aria-checked":a,"aria-label":b,onClick:N=>d(N,l),onKeyDown:N=>f(N,l),onFocus:N=>h(N,l),onBlur:N=>p(N,l)},ownerState:n,className:S.monthButton});return c.jsx(cz,Y({className:Ue(S.root,o),ownerState:n},C,{children:c.jsx(I,Y({},T))}))});function pz(e){return Ge("MuiMonthCalendar",e)}We("MuiMonthCalendar",["root"]);const hz=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],mz=e=>{const{classes:t}=e;return Ke({root:["root"]},pz,t)};function gz(e,t){const n=Zt(),r=kl(),o=Kt({props:e,name:t});return Y({disableFuture:!1,disablePast:!1},o,{minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate)})}const bz=fe("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:Nc,boxSizing:"border-box"}),yz=M.forwardRef(function(t,n){const r=gz(t,"MuiMonthCalendar"),{className:o,value:i,defaultValue:s,referenceDate:a,disabled:l,disableFuture:u,disablePast:d,maxDate:f,minDate:h,onChange:p,shouldDisableMonth:m,readOnly:b,autoFocus:y=!1,onMonthFocus:x,hasFocus:C,onFocusedViewChange:v,monthsPerRow:S=3,timezone:I,gridLabelId:T,slots:N,slotProps:O}=r,F=Ze(r,hz),{value:B,handleValueChange:j,timezone:D}=nh({name:"MonthCalendar",timezone:I,value:i,defaultValue:s,referenceDate:a,onChange:p,valueManager:Zr}),H=Pc(D),_=kr(),L=Zt(),$=M.useMemo(()=>Zr.getInitialReferenceValue({value:B,utils:L,props:r,timezone:D,referenceDate:a,granularity:Kr.month}),[]),K=r,G=mz(K),q=M.useMemo(()=>L.getMonth(H),[L,H]),R=M.useMemo(()=>B!=null?L.getMonth(B):null,[B,L]),[oe,se]=M.useState(()=>R||L.getMonth($)),[z,pe]=or({name:"MonthCalendar",state:"hasFocus",controlled:C,default:y??!1}),J=Ve(me=>{pe(me),v&&v(me)}),Q=M.useCallback(me=>{const le=L.startOfMonth(d&&L.isAfter(H,h)?H:h),ue=L.startOfMonth(u&&L.isBefore(H,f)?H:f),Ie=L.startOfMonth(me);return L.isBefore(Ie,le)||L.isAfter(Ie,ue)?!0:m?m(Ie):!1},[u,d,f,h,H,m,L]),re=Ve((me,le)=>{if(b)return;const ue=L.setMonth(B??$,le);j(ue)}),ne=Ve(me=>{Q(L.setMonth(B??$,me))||(se(me),J(!0),x&&x(me))});M.useEffect(()=>{se(me=>R!==null&&me!==R?R:me)},[R]);const ae=Ve((me,le)=>{switch(me.key){case"ArrowUp":ne((12+le-3)%12),me.preventDefault();break;case"ArrowDown":ne((12+le+3)%12),me.preventDefault();break;case"ArrowLeft":ne((12+le+(_?1:-1))%12),me.preventDefault();break;case"ArrowRight":ne((12+le+(_?-1:1))%12),me.preventDefault();break}}),ie=Ve((me,le)=>{ne(le)}),Z=Ve((me,le)=>{oe===le&&J(!1)});return c.jsx(bz,Y({ref:n,className:Ue(G.root,o),ownerState:K,role:"radiogroup","aria-labelledby":T},F,{children:Xp(L,B??$).map(me=>{const le=L.getMonth(me),ue=L.format(me,"monthShort"),Ie=L.format(me,"month"),Ce=le===R,we=l||Q(me);return c.jsx(fz,{selected:Ce,value:le,onClick:re,onKeyDown:ae,autoFocus:z&&le===oe,disabled:we,tabIndex:le===oe&&!we?0:-1,onFocus:ie,onBlur:Z,"aria-current":q===le?"date":void 0,"aria-label":Ie,monthsPerRow:S,slots:N,slotProps:O,children:ue},ue)})}))});function xz(e){return Ge("MuiPickersYear",e)}const nu=We("MuiPickersYear",["root","yearButton","selected","disabled"]),Cz=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],Ez=e=>{const{disabled:t,selected:n,classes:r}=e;return Ke({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},xz,r)},vz=fe("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),Tz=fe("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${nu.disabled}`]:t.disabled},{[`&.${nu.selected}`]:t.selected}]})(({theme:e})=>Y({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ot.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${nu.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${nu.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),Sz=M.memo(function(t){const n=Kt({props:t,name:"MuiPickersYear"}),{autoFocus:r,className:o,children:i,disabled:s,selected:a,value:l,tabIndex:u,onClick:d,onKeyDown:f,onFocus:h,onBlur:p,"aria-current":m,slots:b,slotProps:y}=n,x=Ze(n,Cz),C=M.useRef(null),v=Ez(n);yn(()=>{r&&C.current?.focus()},[r]);const S=b?.yearButton??Tz,I=Et({elementType:S,externalSlotProps:y?.yearButton,additionalProps:{children:i,disabled:s,tabIndex:u,ref:C,type:"button",role:"radio","aria-current":m,"aria-checked":a,onClick:T=>d(T,l),onKeyDown:T=>f(T,l),onFocus:T=>h(T,l),onBlur:T=>p(T,l)},ownerState:n,className:v.yearButton});return c.jsx(vz,Y({className:Ue(v.root,o),ownerState:n},x,{children:c.jsx(S,Y({},I))}))});function kz(e){return Ge("MuiYearCalendar",e)}We("MuiYearCalendar",["root"]);const wz=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],Dz=e=>{const{classes:t}=e;return Ke({root:["root"]},kz,t)};function Iz(e,t){const n=Zt(),r=kl(),o=Kt({props:e,name:t});return Y({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate)})}const Az=fe("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:Nc,maxHeight:t$,boxSizing:"border-box",position:"relative"}),Oz=M.forwardRef(function(t,n){const r=Iz(t,"MuiYearCalendar"),{autoFocus:o,className:i,value:s,defaultValue:a,referenceDate:l,disabled:u,disableFuture:d,disablePast:f,maxDate:h,minDate:p,onChange:m,readOnly:b,shouldDisableYear:y,onYearFocus:x,hasFocus:C,onFocusedViewChange:v,yearsOrder:S="asc",yearsPerRow:I,timezone:T,gridLabelId:N,slots:O,slotProps:F}=r,B=Ze(r,wz),{value:j,handleValueChange:D,timezone:H}=nh({name:"YearCalendar",timezone:T,value:s,defaultValue:a,referenceDate:l,onChange:m,valueManager:Zr}),_=Pc(H),L=kr(),$=Zt(),K=M.useMemo(()=>Zr.getInitialReferenceValue({value:j,utils:$,props:r,timezone:H,referenceDate:l,granularity:Kr.year}),[]),G=r,q=Dz(G),R=M.useMemo(()=>$.getYear(_),[$,_]),oe=M.useMemo(()=>j!=null?$.getYear(j):null,[j,$]),[se,z]=M.useState(()=>oe||$.getYear(K)),[pe,J]=or({name:"YearCalendar",state:"hasFocus",controlled:C,default:o??!1}),Q=Ve(ye=>{J(ye),v&&v(ye)}),re=M.useCallback(ye=>{if(f&&$.isBeforeYear(ye,_)||d&&$.isAfterYear(ye,_)||p&&$.isBeforeYear(ye,p)||h&&$.isAfterYear(ye,h))return!0;if(!y)return!1;const ze=$.startOfYear(ye);return y(ze)},[d,f,h,p,_,y,$]),ne=Ve((ye,ze)=>{if(b)return;const Ne=$.setYear(j??K,ze);D(Ne)}),ae=Ve(ye=>{re($.setYear(j??K,ye))||(z(ye),Q(!0),x?.(ye))});M.useEffect(()=>{z(ye=>oe!==null&&ye!==oe?oe:ye)},[oe]);const ie=S!=="desc"?I*1:I*-1,Z=L&&S==="asc"||!L&&S==="desc"?-1:1,me=Ve((ye,ze)=>{switch(ye.key){case"ArrowUp":ae(ze-ie),ye.preventDefault();break;case"ArrowDown":ae(ze+ie),ye.preventDefault();break;case"ArrowLeft":ae(ze-Z),ye.preventDefault();break;case"ArrowRight":ae(ze+Z),ye.preventDefault();break}}),le=Ve((ye,ze)=>{ae(ze)}),ue=Ve((ye,ze)=>{se===ze&&Q(!1)}),Ie=M.useRef(null),Ce=vt(n,Ie);M.useEffect(()=>{if(o||Ie.current===null)return;const ye=Ie.current.querySelector('[tabindex="0"]');if(!ye)return;const ze=ye.offsetHeight,Ne=ye.offsetTop,nt=Ie.current.clientHeight,_e=Ie.current.scrollTop,Bt=Ne+ze;ze>nt||Ne<_e||(Ie.current.scrollTop=Bt-nt/2-ze/2)},[o]);const we=$.getYearRange([p,h]);return S==="desc"&&we.reverse(),c.jsx(Az,Y({ref:Ce,className:Ue(q.root,i),ownerState:G,role:"radiogroup","aria-labelledby":N},B,{children:we.map(ye=>{const ze=$.getYear(ye),Ne=ze===oe,nt=u||re(ye);return c.jsx(Sz,{selected:Ne,value:ze,onClick:ne,onKeyDown:me,autoFocus:pe&&ze===se,disabled:nt,tabIndex:ze===se&&!nt?0:-1,onFocus:le,onBlur:ue,"aria-current":R===ze?"date":void 0,yearsPerRow:I,slots:O,slotProps:F,children:$.format(ye,"year")},$.format(ye,"year"))})}))}),Mz=e=>Ge("MuiPickersCalendarHeader",e),Pz=We("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function Rz(e){return Ge("MuiPickersArrowSwitcher",e)}We("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const Nz=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],Fz=["ownerState"],Lz=["ownerState"],_z=fe("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),Bz=fe("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),W1=fe(Ir,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),jz=e=>{const{classes:t}=e;return Ke({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},Rz,t)},$z=M.forwardRef(function(t,n){const r=kr(),o=Kt({props:t,name:"MuiPickersArrowSwitcher"}),{children:i,className:s,slots:a,slotProps:l,isNextDisabled:u,isNextHidden:d,onGoToNext:f,nextLabel:h,isPreviousDisabled:p,isPreviousHidden:m,onGoToPrevious:b,previousLabel:y,labelId:x}=o,C=Ze(o,Nz),v=o,S=jz(v),I={isDisabled:u,isHidden:d,goTo:f,label:h},T={isDisabled:p,isHidden:m,goTo:b,label:y},N=a?.previousIconButton??W1,O=Et({elementType:N,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:T.label,"aria-label":T.label,disabled:T.isDisabled,edge:"end",onClick:T.goTo},ownerState:Y({},v,{hidden:T.isHidden}),className:Ue(S.button,S.previousIconButton)}),F=a?.nextIconButton??W1,B=Et({elementType:F,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:I.label,"aria-label":I.label,disabled:I.isDisabled,edge:"start",onClick:I.goTo},ownerState:Y({},v,{hidden:I.isHidden}),className:Ue(S.button,S.nextIconButton)}),j=a?.leftArrowIcon??b$,D=Et({elementType:j,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:v,className:S.leftArrowIcon}),H=Ze(D,Fz),_=a?.rightArrowIcon??y$,L=Et({elementType:_,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:v,className:S.rightArrowIcon}),$=Ze(L,Lz);return c.jsxs(_z,Y({ref:n,className:Ue(S.root,s),ownerState:v},C,{children:[c.jsx(N,Y({},O,{children:r?c.jsx(_,Y({},$)):c.jsx(j,Y({},H))})),i?c.jsx(Dt,{variant:"subtitle1",component:"span",id:x,children:i}):c.jsx(Bz,{className:S.spacer,ownerState:v}),c.jsx(F,Y({},B,{children:r?c.jsx(j,Y({},H)):c.jsx(_,Y({},$))}))]}))});function Hz(e,{disableFuture:t,maxDate:n,timezone:r}){const o=Zt();return M.useMemo(()=>{const i=o.date(void 0,r),s=o.startOfMonth(t&&o.isBefore(i,n)?i:n);return!o.isAfter(s,e)},[t,n,e,o,r])}function zz(e,{disablePast:t,minDate:n,timezone:r}){const o=Zt();return M.useMemo(()=>{const i=o.date(void 0,r),s=o.startOfMonth(t&&o.isAfter(i,n)?i:n);return!o.isBefore(s,e)},[t,n,e,o,r])}const Uz=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],Vz=["ownerState"],Wz=e=>{const{classes:t}=e;return Ke({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},Mz,t)},qz=fe("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),Yz=fe("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>Y({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),Kz=fe("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),Gz=fe(Ir,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${Pz.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),Qz=fe(g$,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),Xz=M.forwardRef(function(t,n){const r=vo(),o=Zt(),i=Kt({props:t,name:"MuiPickersCalendarHeader"}),{slots:s,slotProps:a,currentMonth:l,disabled:u,disableFuture:d,disablePast:f,maxDate:h,minDate:p,onMonthChange:m,onViewChange:b,view:y,reduceAnimations:x,views:C,labelId:v,className:S,timezone:I,format:T=`${o.formats.month} ${o.formats.year}`}=i,N=Ze(i,Uz),O=i,F=Wz(i),B=s?.switchViewButton??Gz,j=Et({elementType:B,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(y)},ownerState:O,className:F.switchViewButton}),D=s?.switchViewIcon??Qz,H=Et({elementType:D,externalSlotProps:a?.switchViewIcon,ownerState:O,className:F.switchViewIcon}),_=Ze(H,Vz),L=()=>m(o.addMonths(l,1),"left"),$=()=>m(o.addMonths(l,-1),"right"),K=Hz(l,{disableFuture:d,maxDate:h,timezone:I}),G=zz(l,{disablePast:f,minDate:p,timezone:I}),q=()=>{if(!(C.length===1||!b||u))if(C.length===2)b(C.find(oe=>oe!==y)||C[0]);else{const oe=C.indexOf(y)!==0?0:1;b(C[oe])}};if(C.length===1&&C[0]==="year")return null;const R=o.formatByString(l,T);return c.jsxs(qz,Y({},N,{ownerState:O,className:Ue(F.root,S),ref:n,children:[c.jsxs(Yz,{role:"presentation",onClick:q,ownerState:O,"aria-live":"polite",className:F.labelContainer,children:[c.jsx(AC,{reduceAnimations:x,transKey:R,children:c.jsx(Kz,{id:v,ownerState:O,className:F.label,children:R})}),C.length>1&&!u&&c.jsx(B,Y({},j,{children:c.jsx(D,Y({},_))}))]}),c.jsx(hi,{in:y==="day",appear:!x,enter:!x,children:c.jsx($z,{slots:s,slotProps:a,onGoToPrevious:$,isPreviousDisabled:G,previousLabel:r.previousMonth,onGoToNext:L,isNextDisabled:K,nextLabel:r.nextMonth})})]}))}),Zz=fe("div")({overflow:"hidden",width:Nc,maxHeight:rh,display:"flex",flexDirection:"column",margin:"0 auto"}),Jz=e=>Ge("MuiDateCalendar",e);We("MuiDateCalendar",["root","viewTransitionContainer"]);const eU=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],tU=e=>{const{classes:t}=e;return Ke({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Jz,t)};function nU(e,t){const n=Zt(),r=kl(),o=pC(),i=Kt({props:e,name:t});return Y({},i,{loading:i.loading??!1,disablePast:i.disablePast??!1,disableFuture:i.disableFuture??!1,openTo:i.openTo??"day",views:i.views??["year","day"],reduceAnimations:i.reduceAnimations??o,renderLoading:i.renderLoading??(()=>c.jsx("span",{children:"..."})),minDate:vr(n,i.minDate,r.minDate),maxDate:vr(n,i.maxDate,r.maxDate)})}const rU=fe(Zz,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:rh}),oU=fe(AC,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),iU=M.forwardRef(function(t,n){const r=Zt(),o=_r(),i=nU(t,"MuiDateCalendar"),{autoFocus:s,onViewChange:a,value:l,defaultValue:u,referenceDate:d,disableFuture:f,disablePast:h,onChange:p,onYearChange:m,onMonthChange:b,reduceAnimations:y,shouldDisableDate:x,shouldDisableMonth:C,shouldDisableYear:v,view:S,views:I,openTo:T,className:N,disabled:O,readOnly:F,minDate:B,maxDate:j,disableHighlightToday:D,focusedView:H,onFocusedViewChange:_,showDaysOutsideCurrentMonth:L,fixedWeekNumber:$,dayOfWeekFormatter:K,slots:G,slotProps:q,loading:R,renderLoading:oe,displayWeekNumber:se,yearsOrder:z,yearsPerRow:pe,monthsPerRow:J,timezone:Q}=i,re=Ze(i,eU),{value:ne,handleValueChange:ae,timezone:ie}=nh({name:"DateCalendar",timezone:Q,value:l,defaultValue:u,referenceDate:d,onChange:p,valueManager:Zr}),{view:Z,setView:me,focusedView:le,setFocusedView:ue,goToNextView:Ie,setValueAndGoToNextView:Ce}=hC({view:S,views:I,openTo:T,onChange:ae,onViewChange:a,autoFocus:s,focusedView:H,onFocusedViewChange:_}),{referenceDate:we,calendarState:ye,changeFocusedDay:ze,changeMonth:Ne,handleChangeMonth:nt,isDateDisabled:_e,onMonthSwitchingAnimationEnd:Bt}=OH({value:ne,referenceDate:d,reduceAnimations:y,onMonthChange:b,minDate:B,maxDate:j,shouldDisableDate:x,disablePast:h,disableFuture:f,timezone:ie}),yt=O&&ne||B,ot=O&&ne||j,xe=`${o}-grid-label`,Pe=le!==null,qe=G?.calendarHeader??Xz,Je=Et({elementType:qe,externalSlotProps:q?.calendarHeader,additionalProps:{views:I,view:Z,currentMonth:ye.currentMonth,onViewChange:me,onMonthChange:(st,Nt)=>nt({newMonth:st,direction:Nt}),minDate:yt,maxDate:ot,disabled:O,disablePast:h,disableFuture:f,reduceAnimations:y,timezone:ie,labelId:xe},ownerState:i}),Xe=Ve(st=>{const Nt=r.startOfMonth(st),Gt=r.endOfMonth(st),bt=_e(st)?qa({utils:r,date:st,minDate:r.isBefore(B,Nt)?Nt:B,maxDate:r.isAfter(j,Gt)?Gt:j,disablePast:h,disableFuture:f,isDateDisabled:_e,timezone:ie}):st;bt?(Ce(bt,"finish"),b?.(Nt)):(Ie(),Ne(Nt)),ze(bt,!0)}),Re=Ve(st=>{const Nt=r.startOfYear(st),Gt=r.endOfYear(st),bt=_e(st)?qa({utils:r,date:st,minDate:r.isBefore(B,Nt)?Nt:B,maxDate:r.isAfter(j,Gt)?Gt:j,disablePast:h,disableFuture:f,isDateDisabled:_e,timezone:ie}):st;bt?(Ce(bt,"finish"),m?.(bt)):(Ie(),Ne(Nt)),ze(bt,!0)}),ct=Ve(st=>ae(st&&Qu(r,st,ne??we),"finish",Z));M.useEffect(()=>{ne!=null&&r.isValid(ne)&&Ne(ne)},[ne]);const lt=i,Mt=tU(lt),be={disablePast:h,disableFuture:f,maxDate:j,minDate:B},Ae={disableHighlightToday:D,readOnly:F,disabled:O,timezone:ie,gridLabelId:xe,slots:G,slotProps:q},Oe=M.useRef(Z);M.useEffect(()=>{Oe.current!==Z&&(le===Oe.current&&ue(Z,!0),Oe.current=Z)},[le,ue,Z]);const Qe=M.useMemo(()=>[ne],[ne]);return c.jsxs(rU,Y({ref:n,className:Ue(Mt.root,N),ownerState:lt},re,{children:[c.jsx(qe,Y({},Je,{slots:G,slotProps:q})),c.jsx(oU,{reduceAnimations:y,className:Mt.viewTransitionContainer,transKey:Z,ownerState:lt,children:c.jsxs("div",{children:[Z==="year"&&c.jsx(Oz,Y({},be,Ae,{value:ne,onChange:Re,shouldDisableYear:v,hasFocus:Pe,onFocusedViewChange:st=>ue("year",st),yearsOrder:z,yearsPerRow:pe,referenceDate:we})),Z==="month"&&c.jsx(yz,Y({},be,Ae,{hasFocus:Pe,className:N,value:ne,onChange:Xe,shouldDisableMonth:C,onFocusedViewChange:st=>ue("month",st),monthsPerRow:J,referenceDate:we})),Z==="day"&&c.jsx(sz,Y({},ye,be,Ae,{onMonthSwitchingAnimationEnd:Bt,onFocusedDayChange:ze,reduceAnimations:y,selectedDays:Qe,onSelectedDaysChange:ct,shouldDisableDate:x,shouldDisableMonth:C,shouldDisableYear:v,hasFocus:Pe,onFocusedViewChange:st=>ue("day",st),showDaysOutsideCurrentMonth:L,fixedWeekNumber:$,dayOfWeekFormatter:K,displayWeekNumber:se,loading:R,renderLoading:oe}))]})})]}))}),us=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:i,defaultValue:s,referenceDate:a,onChange:l,className:u,classes:d,disableFuture:f,disablePast:h,minDate:p,maxDate:m,shouldDisableDate:b,shouldDisableMonth:y,shouldDisableYear:x,reduceAnimations:C,onMonthChange:v,monthsPerRow:S,onYearChange:I,yearsOrder:T,yearsPerRow:N,slots:O,slotProps:F,loading:B,renderLoading:j,disableHighlightToday:D,readOnly:H,disabled:_,showDaysOutsideCurrentMonth:L,dayOfWeekFormatter:$,sx:K,autoFocus:G,fixedWeekNumber:q,displayWeekNumber:R,timezone:oe})=>c.jsx(iU,{view:e,onViewChange:t,views:n.filter(M1),focusedView:r&&M1(r)?r:null,onFocusedViewChange:o,value:i,defaultValue:s,referenceDate:a,onChange:l,className:u,classes:d,disableFuture:f,disablePast:h,minDate:p,maxDate:m,shouldDisableDate:b,shouldDisableMonth:y,shouldDisableYear:x,reduceAnimations:C,onMonthChange:v,monthsPerRow:S,onYearChange:I,yearsOrder:T,yearsPerRow:N,slots:O,slotProps:F,loading:B,renderLoading:j,disableHighlightToday:D,readOnly:H,disabled:_,showDaysOutsideCurrentMonth:L,dayOfWeekFormatter:$,sx:K,autoFocus:G,fixedWeekNumber:q,displayWeekNumber:R,timezone:oe}),RC=M.forwardRef(function(t,n){const r=vo(),o=Zt(),i=lC(t,"MuiDesktopDatePicker"),s=Y({day:us,month:us,year:us},i.viewRenderers),a=Y({},i,{viewRenderers:s,format:Zp(o,i,!1),yearsPerRow:i.yearsPerRow??4,slots:Y({openPickerIcon:x$,field:DC},i.slots),slotProps:Y({},i.slotProps,{field:u=>Y({},br(i.slotProps?.field,u),cC(i),{ref:n}),toolbar:Y({hidden:!0},i.slotProps?.toolbar)})}),{renderPicker:l}=m$({props:a,valueManager:Zr,valueType:"date",getOpenDialogAriaText:sC({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:a.localeText?.openDatePickerDialogue}),validator:wl});return l()});RC.propTypes={autoFocus:Ee.bool,className:Ee.string,closeOnSelect:Ee.bool,dayOfWeekFormatter:Ee.func,defaultValue:Ee.object,disabled:Ee.bool,disableFuture:Ee.bool,disableHighlightToday:Ee.bool,disableOpenPicker:Ee.bool,disablePast:Ee.bool,displayWeekNumber:Ee.bool,enableAccessibleFieldDOMStructure:Ee.any,fixedWeekNumber:Ee.number,format:Ee.string,formatDensity:Ee.oneOf(["dense","spacious"]),inputRef:a2,label:Ee.node,loading:Ee.bool,localeText:Ee.object,maxDate:Ee.object,minDate:Ee.object,monthsPerRow:Ee.oneOf([3,4]),name:Ee.string,onAccept:Ee.func,onChange:Ee.func,onClose:Ee.func,onError:Ee.func,onMonthChange:Ee.func,onOpen:Ee.func,onSelectedSectionsChange:Ee.func,onViewChange:Ee.func,onYearChange:Ee.func,open:Ee.bool,openTo:Ee.oneOf(["day","month","year"]),orientation:Ee.oneOf(["landscape","portrait"]),readOnly:Ee.bool,reduceAnimations:Ee.bool,referenceDate:Ee.object,renderLoading:Ee.func,selectedSections:Ee.oneOfType([Ee.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),Ee.number]),shouldDisableDate:Ee.func,shouldDisableMonth:Ee.func,shouldDisableYear:Ee.func,showDaysOutsideCurrentMonth:Ee.bool,slotProps:Ee.object,slots:Ee.object,sx:Ee.oneOfType([Ee.arrayOf(Ee.oneOfType([Ee.func,Ee.object,Ee.bool])),Ee.func,Ee.object]),timezone:Ee.string,value:Ee.object,view:Ee.oneOf(["day","month","year"]),viewRenderers:Ee.shape({day:Ee.func,month:Ee.func,year:Ee.func}),views:Ee.arrayOf(Ee.oneOf(["day","month","year"]).isRequired),yearsOrder:Ee.oneOf(["asc","desc"]),yearsPerRow:Ee.oneOf([3,4])};const sU=fe(no)({[`& .${za.container}`]:{outline:0},[`& .${za.paper}`]:{outline:0,minWidth:Nc}}),aU=fe(oo)({"&:first-of-type":{padding:0}});function lU(e){const{children:t,onDismiss:n,open:r,slots:o,slotProps:i}=e,s=o?.dialog??sU,a=o?.mobileTransition??hi;return c.jsx(s,Y({open:r,onClose:n},i?.dialog,{TransitionComponent:a,TransitionProps:i?.mobileTransition,PaperComponent:o?.mobilePaper,PaperProps:i?.mobilePaper,children:c.jsx(aU,{children:t})}))}const uU=["props","getOpenDialogAriaText"],cU=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=Ze(e,uU);const{slots:o,slotProps:i,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,name:m,label:b,inputRef:y,readOnly:x,disabled:C,localeText:v}=t,S=M.useRef(null),I=_r(),T=i?.toolbar?.hidden??!1,{open:N,actions:O,layoutProps:F,renderCurrentView:B,fieldProps:j,contextValue:D}=mC(Y({},r,{props:t,fieldRef:S,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),H=o.field,_=Et({elementType:H,externalSlotProps:i?.field,additionalProps:Y({},j,T&&{id:I},!(C||x)&&{onClick:O.onOpen,onKeyDown:Ej(O.onOpen)},{readOnly:x??!0,disabled:C,className:s,sx:a,format:l,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:h,timezone:p,label:b,name:m},y?{inputRef:y}:{}),ownerState:t});_.inputProps=Y({},_.inputProps,{"aria-label":n(j.value)});const L=Y({textField:o.textField},_.slots),$=o.layout??yC;let K=I;T&&(b?K=`${I}-label`:K=void 0);const G=Y({},i,{toolbar:Y({},i?.toolbar,{titleId:I}),mobilePaper:Y({"aria-labelledby":K},i?.mobilePaper)}),q=vt(S,_.unstableFieldRef);return{renderPicker:()=>c.jsxs(xC,{contextValue:D,localeText:v,children:[c.jsx(H,Y({},_,{slots:L,slotProps:G,unstableFieldRef:q})),c.jsx(lU,Y({},O,{open:N,slots:o,slotProps:G,children:c.jsx($,Y({},F,G?.layout,{slots:o,slotProps:G,children:B()}))}))]})}},NC=M.forwardRef(function(t,n){const r=vo(),o=Zt(),i=lC(t,"MuiMobileDatePicker"),s=Y({day:us,month:us,year:us},i.viewRenderers),a=Y({},i,{viewRenderers:s,format:Zp(o,i,!1),slots:Y({field:DC},i.slots),slotProps:Y({},i.slotProps,{field:u=>Y({},br(i.slotProps?.field,u),cC(i),{ref:n}),toolbar:Y({hidden:!1},i.slotProps?.toolbar)})}),{renderPicker:l}=cU({props:a,valueManager:Zr,valueType:"date",getOpenDialogAriaText:sC({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:a.localeText?.openDatePickerDialogue}),validator:wl});return l()});NC.propTypes={autoFocus:Ee.bool,className:Ee.string,closeOnSelect:Ee.bool,dayOfWeekFormatter:Ee.func,defaultValue:Ee.object,disabled:Ee.bool,disableFuture:Ee.bool,disableHighlightToday:Ee.bool,disableOpenPicker:Ee.bool,disablePast:Ee.bool,displayWeekNumber:Ee.bool,enableAccessibleFieldDOMStructure:Ee.any,fixedWeekNumber:Ee.number,format:Ee.string,formatDensity:Ee.oneOf(["dense","spacious"]),inputRef:a2,label:Ee.node,loading:Ee.bool,localeText:Ee.object,maxDate:Ee.object,minDate:Ee.object,monthsPerRow:Ee.oneOf([3,4]),name:Ee.string,onAccept:Ee.func,onChange:Ee.func,onClose:Ee.func,onError:Ee.func,onMonthChange:Ee.func,onOpen:Ee.func,onSelectedSectionsChange:Ee.func,onViewChange:Ee.func,onYearChange:Ee.func,open:Ee.bool,openTo:Ee.oneOf(["day","month","year"]),orientation:Ee.oneOf(["landscape","portrait"]),readOnly:Ee.bool,reduceAnimations:Ee.bool,referenceDate:Ee.object,renderLoading:Ee.func,selectedSections:Ee.oneOfType([Ee.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),Ee.number]),shouldDisableDate:Ee.func,shouldDisableMonth:Ee.func,shouldDisableYear:Ee.func,showDaysOutsideCurrentMonth:Ee.bool,slotProps:Ee.object,slots:Ee.object,sx:Ee.oneOfType([Ee.arrayOf(Ee.oneOfType([Ee.func,Ee.object,Ee.bool])),Ee.func,Ee.object]),timezone:Ee.string,value:Ee.object,view:Ee.oneOf(["day","month","year"]),viewRenderers:Ee.shape({day:Ee.func,month:Ee.func,year:Ee.func}),views:Ee.arrayOf(Ee.oneOf(["day","month","year"]).isRequired),yearsOrder:Ee.oneOf(["asc","desc"]),yearsPerRow:Ee.oneOf([3,4])};const dU=["desktopModeMediaQuery"],vu=M.forwardRef(function(t,n){const r=Kt({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:o=vj}=r,i=Ze(r,dU);return J2(o,{defaultMatches:!0})?c.jsx(RC,Y({ref:n},i)):c.jsx(NC,Y({ref:n},i))});var Tu={exports:{}},fU=Tu.exports,q1;function pU(){return q1||(q1=1,(function(e,t){(function(n,r){e.exports=r()})(fU,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(i,s,a){var l=s.prototype;a.utc=function(b){var y={date:b,utc:!0,args:arguments};return new s(y)},l.utc=function(b){var y=a(this.toDate(),{locale:this.$L,utc:!0});return b?y.add(this.utcOffset(),n):y},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=l.parse;l.parse=function(b){b.utc&&(this.$u=!0),this.$utils().u(b.$offset)||(this.$offset=b.$offset),u.call(this,b)};var d=l.init;l.init=function(){if(this.$u){var b=this.$d;this.$y=b.getUTCFullYear(),this.$M=b.getUTCMonth(),this.$D=b.getUTCDate(),this.$W=b.getUTCDay(),this.$H=b.getUTCHours(),this.$m=b.getUTCMinutes(),this.$s=b.getUTCSeconds(),this.$ms=b.getUTCMilliseconds()}else d.call(this)};var f=l.utcOffset;l.utcOffset=function(b,y){var x=this.$utils().u;if(x(b))return this.$u?0:x(this.$offset)?f.call(this):this.$offset;if(typeof b=="string"&&(b=(function(I){I===void 0&&(I="");var T=I.match(r);if(!T)return null;var N=(""+T[0]).match(o)||["-",0,0],O=N[0],F=60*+N[1]+ +N[2];return F===0?0:O==="+"?F:-F})(b),b===null))return this;var C=Math.abs(b)<=16?60*b:b;if(C===0)return this.utc(y);var v=this.clone();if(y)return v.$offset=C,v.$u=!1,v;var S=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(v=this.local().add(C+S,n)).$offset=C,v.$x.$localOffset=S,v};var h=l.format;l.format=function(b){var y=b||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,y)},l.valueOf=function(){var b=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*b},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var p=l.toDate;l.toDate=function(b){return b==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var m=l.diff;l.diff=function(b,y,x){if(b&&this.$u===b.$u)return m.call(this,b,y,x);var C=this.local(),v=a(b).local();return m.call(C,v,y,x)}}}))})(Tu)),Tu.exports}var hU=pU();const FC=Tr(hU);_t.extend(FC);function Ud(e){switch(e){case"Star":return["Equals","Contains"];case"MinMax":return["Equals","Less Than","Greater Than","Between"];case"DateMinMax":return["Equals","Before","After","Between"];case"Retrieval":return["Semantic Search"];case"Boolean":return["Equals"];case"NONE":default:return[]}}function mU(e){return e==="DateMinMax"}function Vd(e){return e==="Between"}function LC({spec:e,values:t,selection:n,onChange:r,retrievalFn:o}){const i=()=>n?.matchType?n.matchType:e.defaultMatchType?e.defaultMatchType:e.filterType==="DateMinMax"?"Between":Ud(e.filterType)[0]||"Equals",[s,a]=W.useState(i()),[l,u]=W.useState(n?.value??""),[d,f]=W.useState(n?.value2??""),[h,p]=W.useState([]),[m,b]=W.useState(!1),[y,x]=W.useState(""),[C,v]=W.useState(!1),[S,I]=W.useState(!1),T=W.useRef(null),N=W.useRef(0),[O,F]=W.useState(!1);W.useEffect(()=>{if(e.filterType!=="Retrieval"||!o)return;const R=y.trim();if(R.length<=2){p([]),v(!1);return}return T.current&&clearTimeout(T.current),T.current=setTimeout(async()=>{N.current+=1;const oe=N.current;b(!0);try{const se=await o(R,e);oe===N.current&&p(se)}catch(se){oe===N.current&&(console.error("Retrieval failed",se),p([]))}finally{oe===N.current&&(b(!1),v(!0))}},500),()=>{T.current&&clearTimeout(T.current)}},[y,e,o]),W.useEffect(()=>{n===null?(u(""),f(""),a(e.defaultMatchType??(e.filterType==="DateMinMax"?"Between":Ud(e.filterType)[0]||"Equals"))):n&&(a(n.matchType),u(n.value??""),f(n.value2??""))},[n,e.filterType,e.defaultMatchType]);const B=Ud(e.filterType),j=mU(e.filterType),D=Vd(s),H=j&&t.length>=2&&t[0].value instanceof Date?_t.utc(t[0].value):void 0,_=j&&t.length>=2&&t[1].value instanceof Date?_t.utc(t[1].value):void 0,L=e.filterType==="MinMax"&&t.length>=2&&typeof t[0].value=="number"?t[0].value:void 0,$=e.filterType==="MinMax"&&t.length>=2&&typeof t[1].value=="number"?t[1].value:void 0;if(B.length===0)return null;const K=R=>{const oe=R.target.value;a(oe),Vd(oe)||f(""),l&&r({dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:oe,value:l,...Vd(oe)&&d&&{value2:d}})},G=(R,oe)=>{u(R??""),oe!==void 0&&f(oe??"");const se=Array.isArray(R)&&R.length===0;r(!se&&R!==""&&R!==null&&R!==void 0?{dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:s,value:R,...D&&oe&&{value2:oe}}:null)},q=()=>{u(""),f(""),r(null)};return c.jsxs(Qt,{sx:{display:"flex",flexDirection:"column",gap:1.5,fontSize:"0.75rem","& .MuiInputBase-root":{fontSize:"0.75rem"},"& .MuiInputBase-input":{padding:"6px 10px"},"& .MuiSelect-select":{padding:"6px 10px !important"},"& .MuiAutocomplete-input":{padding:"0 !important"},"& .MuiAutocomplete-root .MuiInputBase-root":{padding:"5px 10px",minHeight:"29.5px",boxSizing:"border-box",flexWrap:"wrap"},"& .MuiChip-root":{height:"16px",margin:"0 2px 0 0"},"& .MuiChip-label":{fontSize:"0.7rem",padding:"0 6px"},"& .MuiChip-deleteIcon":{fontSize:"14px",margin:"0 2px 0 -4px"},"& .MuiInputLabel-root":{fontSize:"0.75rem",transform:"translate(10px, 6px) scale(1)"},"& .MuiInputLabel-shrink":{fontSize:"0.85rem",transform:"translate(14px, -9px) scale(0.75)"},"& .MuiOutlinedInput-notchedOutline legend":{fontSize:"0.65rem"},"& .MuiFormHelperText-root":{fontSize:"0.65rem",marginTop:"2px"},"& .MuiSvgIcon-root":{fontSize:"1.25rem"}},children:[c.jsxs(Qt,{sx:{fontWeight:600,color:e.required&&!n?"error.main":"text.primary"},children:[e.label??e.dimensionName,e.required&&c.jsx(Qt,{component:"span",sx:{color:n?"text.secondary":"error.main",fontWeight:400,fontSize:"0.7rem",ml:.5},children:"(required)"})]}),e.filterType!=="Boolean"&&!e.defaultMatchType&&B.length>1&&c.jsxs(Wu,{size:"small",fullWidth:!0,children:[c.jsx(qu,{children:"Match Type"}),c.jsx(Yu,{value:s,label:"Match Type",onChange:K,MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:B.map(R=>c.jsx(bn,{value:R,children:R},R))})]}),e.filterType==="Star"&&s==="Equals"&&c.jsx(_f,{multiple:!0,size:"small",options:t,getOptionLabel:R=>typeof R=="string"?R:typeof R=="object"&&R!==null&&"value"in R?String(R.value):String(R),value:Array.isArray(l)?l.map(R=>t.find(oe=>oe.value===R)||R):l?[t.find(R=>R.value===l)||l]:[],onChange:(R,oe)=>{const se=oe.map(z=>typeof z=="string"?z:z&&typeof z=="object"&&"value"in z?z.value:z);G(se)},noOptionsText:"No matches found",renderInput:R=>c.jsx(Ct,{...R,size:"small",label:"Values",placeholder:"Select values..."}),freeSolo:!e.values||e.values.length===0,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="Star"&&s==="Contains"&&c.jsx(Ct,{size:"small",label:"Search Text",value:l,onChange:R=>u(R.target.value),onBlur:()=>G(l),onKeyDown:R=>{R.key==="Enter"&&G(l)},placeholder:"Enter text to search...",fullWidth:!0}),e.filterType==="Boolean"&&c.jsxs(Wu,{size:"small",fullWidth:!0,children:[c.jsx(qu,{children:"Value"}),c.jsxs(Yu,{value:l===!0?"true":l===!1?"false":"",label:"Value",onChange:R=>{const oe=R.target.value;oe==="true"?G(!0):oe==="false"?G(!1):q()},MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:[c.jsx(bn,{value:"",children:c.jsx("em",{children:"Blank"})}),c.jsx(bn,{value:"true",children:"True"}),c.jsx(bn,{value:"false",children:"False"})]})]}),e.filterType==="Retrieval"&&s==="Semantic Search"&&c.jsx(_f,{multiple:!0,size:"small",options:h,loading:m,getOptionLabel:R=>typeof R=="string"?R:typeof R=="object"&&R!==null&&"value"in R?String(R.value):String(R),value:Array.isArray(l)?l.map(R=>h.find(se=>se.value===R)||{value:R}):l?[{value:l}]:[],onInputChange:(R,oe)=>{x(oe)},onChange:(R,oe)=>{const se=oe.map(z=>typeof z=="string"?z:z&&typeof z=="object"&&"value"in z?z.value:z);G(se)},noOptionsText:y.trim().length<=2?"Type at least 3 characters to search":"No matches found",renderInput:R=>c.jsx(Ct,{...R,size:"small",label:"Search Values",placeholder:"Type to search...",onFocus:()=>I(!0),onBlur:()=>I(!1),helperText:S&&!m&&C&&h.length===0?"No matches found":void 0,InputProps:{...R.InputProps,endAdornment:c.jsxs(c.Fragment,{children:[m?c.jsx(Mp,{color:"inherit",size:20}):null,R.InputProps.endAdornment]})}}),freeSolo:!0,filterOptions:R=>R,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="MinMax"&&!D&&c.jsx(Ct,{size:"small",type:"number",label:"Value",value:l,onChange:R=>G(parseFloat(R.target.value)||""),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Enter number...",fullWidth:!0,inputProps:{min:L,max:$},helperText:O&&L!==void 0&&$!==void 0?`Valid range: [${L} - ${$}]`:void 0}),e.filterType==="MinMax"&&D&&c.jsxs(Qt,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.jsxs(Qt,{sx:{display:"flex",gap:1,alignItems:"center"},children:[c.jsx(Ct,{size:"small",type:"number",label:"From",value:l,onChange:R=>G(parseFloat(R.target.value)||"",d),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Min...",fullWidth:!0,inputProps:{min:L,max:d||$}}),c.jsx(Qt,{children:"to"}),c.jsx(Ct,{size:"small",type:"number",label:"To",value:d,onChange:R=>G(l,parseFloat(R.target.value)||""),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Max...",fullWidth:!0,inputProps:{min:l||L,max:$}})]}),O&&L!==void 0&&$!==void 0&&c.jsxs(Dt,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",L," - ",$,"]"]})]}),j&&!D&&c.jsx(Xu,{dateAdapter:Bf,children:c.jsx(vu,{label:"Date",value:l instanceof Date?_t.utc(l):null,onChange:R=>{R===null?G(null):R.isValid()&&G(R.utc().toDate())},timezone:"UTC",minDate:l instanceof Date?void 0:H,maxDate:l instanceof Date?void 0:_,referenceDate:s==="After"&&H?H:void 0,slotProps:{textField:{size:"small",fullWidth:!0,sx:{minWidth:150},onFocus:()=>F(!0),onBlur:()=>F(!1),helperText:O&&H&&_?`Valid range: [${H.format("YYYY-MM-DD")} - ${_.format("YYYY-MM-DD")}]`:void 0},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),j&&D&&c.jsx(Xu,{dateAdapter:Bf,children:c.jsxs(Qt,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.jsxs(Qt,{sx:{display:"flex",gap:1,alignItems:"center"},children:[c.jsx(Qt,{sx:{flex:1,minWidth:0},children:c.jsx(vu,{label:"From",value:l instanceof Date?_t.utc(l):null,onChange:R=>{R===null?G(null,d):R.isValid()&&G(R.utc().toDate(),d)},timezone:"UTC",minDate:l instanceof Date?void 0:H,maxDate:d instanceof Date?_t.utc(d):l instanceof Date?void 0:_,referenceDate:H,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>F(!0),onBlur:()=>F(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),c.jsx(Qt,{children:"to"}),c.jsx(Qt,{sx:{flex:1,minWidth:0},children:c.jsx(vu,{label:"To",value:d instanceof Date?_t.utc(d):null,onChange:R=>{R===null?G(l,null):R.isValid()&&G(l,R.utc().toDate())},timezone:"UTC",minDate:l instanceof Date?_t.utc(l):d instanceof Date?void 0:H,maxDate:d instanceof Date?void 0:_,referenceDate:l instanceof Date?_t.utc(l):H,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>F(!0),onBlur:()=>F(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})})]}),O&&H&&_&&c.jsxs(Dt,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",H.format("YYYY-MM-DD")," -"," ",_.format("YYYY-MM-DD"),"]"]})]})})]})}function gU(e){const t=new Set,n=e.schema?.fields;if(!n)return t;for(const r of n)"kind"in r&&r.kind==="join"&&r.name&&t.add(r.name);return t}function _C(e){if(!e)return null;for(const t of e)if(t.startsWith("##(filters)")){const n=t.slice(11).trim();try{const r=JSON.parse(n);if(Array.isArray(r)){const o=[];for(const i of r)if(typeof i=="string"){const s=i.indexOf(".");s>0&&s<i.length-1&&o.push({source:i.substring(0,s),dimension:i.substring(s+1)})}if(o.length>0)return{filters:o}}}catch(r){console.error(`Failed to parse "${t}" annotation:`,r)}}return null}function BC(e){if(e.startsWith("#(filter)")){const t=e.slice(9).trim();try{const n=JSON.parse(t);if(n.type)return n}catch(n){console.error(`Failed to parse "${e}" annotation:`,n)}}return null}function bU(e){const t=e.match(/^#\s*label\s*=\s*"([^"]+)"/);return t?t[1]:null}function jC(e){const t=new Map;let n="";for(const r of e)if(r.type==="code"){if(!n&&r.text){const o=r.text.match(/import\s+(?:\{[^}]*\}\s+from\s+)?['"]([^'"]+)['"]/);o&&(n=o[1])}if(r.newSources&&r.newSources.length>0)for(const o of r.newSources)try{const i=JSON.parse(o);i.name&&t.set(i.name,i)}catch(i){console.error("Failed to parse SourceInfo:",i)}}return{sourceInfoMap:t,modelPath:n}}function $C(e,t,n){const r=[];for(const{source:o,dimension:i}of t){const s=e.get(o);if(!s){console.warn(`Source "${o}" not found in notebook sources`),r.push({source:o,model:n,dimensionName:i,filterType:"Star"});continue}const a=s.schema?.fields;if(!a){r.push({source:o,model:n,dimensionName:i,filterType:"Star"});continue}const l=a.find(f=>f.name===i);if(!l){console.warn(`Dimension "${i}" not found in source "${o}"`),r.push({source:o,model:n,dimensionName:i,filterType:"Star"});continue}let u="Star",d;if("annotations"in l&&l.annotations){for(const f of l.annotations)if(f.value){const h=BC(f.value);h&&(u=h.type);const p=bU(f.value);p&&(d=p)}}r.push({source:o,model:n,dimensionName:i,filterType:u,label:d})}return r}function yU(e,t,n){return e.length===0?"":e.map(o=>{const{dimensionName:i,source:s,matchType:a,value:l,value2:u}=o,f=s&&s!==n?`\`${s}\`.\`${i}\``:`\`${i}\``,h=l instanceof Date,p=(m,b=!1)=>m==null?"null":b&&m instanceof Date?`@${m.getFullYear()}-${String(m.getMonth()+1).padStart(2,"0")}-${String(m.getDate()).padStart(2,"0")}`:typeof m=="string"?`'${m.replace(/'/g,"\\'")}'`:typeof m=="boolean"?m?"true":"false":String(m);switch(a){case"Equals":case"Semantic Search":return Array.isArray(l)&&l.length>0?`(${l.map(b=>`${f} = ${p(b,h)}`).join(" or ")})`:`${f} = ${p(l,h)}`;case"Contains":return typeof l=="string"?`${f} ~ f'%${l.replace(/'/g,"\\'")}%'`:`${f} = ${p(l)}`;case"After":case"Greater Than":return`${f} > ${p(l,h)}`;case"Before":case"Less Than":return`${f} < ${p(l,h)}`;case"Between":return u!==void 0?`${f} >= ${p(l,h)} and ${f} <= ${p(u,h)}`:`${f} >= ${p(l,h)}`;default:return""}}).filter(o=>o.length>0).join(" and ")}function xU(e){const t=e.match(/run\s*:\s*(\w+)\s*->/);if(t)return t[1];const n=e.match(/^\s*(\w+)\s*->/m);return n?n[1]:null}function CU(e,t){return`${e.trimEnd()} + {where: ${t}}`}const HC=mt(c.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),zC=e=>{if(!e)return"Explore semantic models, run queries, and build dashboards";const t=e.replace(/^#+\s+/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/`([^`]+)`/g,"$1").trim(),r=t.split(/\n\s*\n/)[1]||t;if(r.length<=120)return r;const o=r.substring(0,120).split(" ");return o.pop(),o.join(" ")+"..."},UC=(e,t)=>{const n=(e.readme||void 0)?.split(`
205
205
  `)??[];return n.length===0&&(n.push(`# ${e.name}`),n.push("")),(e.readme?.length??0)>0&&t?n.splice(2,1,t):t&&n.push(t),n.join(`
206
- `)};function bU(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:i}=e,s=Sc();M.useEffect(()=>{if(!o)return;function x(C){C.defaultPrevented||C.key==="Escape"&&r?.(C,"escapeKeyDown")}return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[o,r]);const a=Ve((x,C)=>{r?.(x,C)}),l=Ve(x=>{!r||x==null||s.start(x,()=>{a(null,"timeout")})});M.useEffect(()=>(o&&l(t),s.clear),[o,t,l,s]);const u=x=>{r?.(x,"clickaway")},d=s.clear,f=M.useCallback(()=>{t!=null&&l(i??t*.5)},[t,i,l]),h=x=>C=>{const v=x.onBlur;v?.(C),f()},p=x=>C=>{const v=x.onFocus;v?.(C),d()},m=x=>C=>{const v=x.onMouseEnter;v?.(C),d()},b=x=>C=>{const v=x.onMouseLeave;v?.(C),f()};return M.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",f),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",d)}},[n,o,f,d]),{getRootProps:(x={})=>{const C={...Ln(e),...Ln(x)};return{role:"presentation",...x,...C,onBlur:h(C),onFocus:p(C),onMouseEnter:m(C),onMouseLeave:b(C)}},onClickAway:u}}function Y1(e){return e.substring(2).toLowerCase()}function yU(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function xU(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:i="onTouchEnd"}=e,s=M.useRef(!1),a=M.useRef(null),l=M.useRef(!1),u=M.useRef(!1);M.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const d=vt(Ms(t),a),f=Ve(m=>{const b=u.current;u.current=!1;const y=mn(a.current);if(!l.current||!a.current||"clientX"in m&&yU(m,y))return;if(s.current){s.current=!1;return}let x;m.composedPath?x=m.composedPath().includes(a.current):x=!y.documentElement.contains(m.target)||a.current.contains(m.target),!x&&(n||!b)&&o(m)}),h=m=>b=>{u.current=!0;const y=t.props[m];y&&y(b)},p={ref:d};return i!==!1&&(p[i]=h(i)),M.useEffect(()=>{if(i!==!1){const m=Y1(i),b=mn(a.current),y=()=>{s.current=!0};return b.addEventListener(m,f),b.addEventListener("touchmove",y),()=>{b.removeEventListener(m,f),b.removeEventListener("touchmove",y)}}},[f,i]),r!==!1&&(p[r]=h(r)),M.useEffect(()=>{if(r!==!1){const m=Y1(r),b=mn(a.current);return b.addEventListener(m,f),()=>{b.removeEventListener(m,f)}}},[f,r]),M.cloneElement(t,p)}function CU(e){return Ge("MuiSnackbarContent",e)}We("MuiSnackbarContent",["root","message","action"]);const EU=e=>{const{classes:t}=e;return Ke({root:["root"],action:["action"],message:["message"]},CU,t)},vU=fe(Ci,{name:"MuiSnackbarContent",slot:"Root"})(ft(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(Kd(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:Kd(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),TU=fe("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),SU=fe("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),kU=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiSnackbarContent"}),{action:o,className:i,message:s,role:a="alert",...l}=r,u=r,d=EU(u);return c.jsxs(vU,{role:a,elevation:6,className:Ue(d.root,i),ownerState:u,ref:n,...l,children:[c.jsx(TU,{className:d.message,ownerState:u,children:s}),o?c.jsx(SU,{className:d.action,ownerState:u,children:o}):null]})});function wU(e){return Ge("MuiSnackbar",e)}We("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const DU=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${Fe(n.vertical)}${Fe(n.horizontal)}`]};return Ke(r,wU,t)},IU=fe("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${Fe(n.anchorOrigin.vertical)}${Fe(n.anchorOrigin.horizontal)}`]]}})(ft(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),AU=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiSnackbar"}),o=Lo(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:u=null,children:d,className:f,ClickAwayListenerProps:h,ContentProps:p,disableWindowBlurListener:m=!1,message:b,onBlur:y,onClose:x,onFocus:C,onMouseEnter:v,onMouseLeave:S,open:I,resumeHideDuration:T,slots:N={},slotProps:O={},TransitionComponent:F,transitionDuration:B=i,TransitionProps:{onEnter:j,onExited:D,...H}={},..._}=r,L={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:u,disableWindowBlurListener:m,TransitionComponent:F,transitionDuration:B},$=DU(L),{getRootProps:K,onClickAway:G}=bU({...L}),[q,R]=M.useState(!0),oe=le=>{R(!0),D&&D(le)},se=(le,ue)=>{R(!1),j&&j(le,ue)},z={slots:{transition:F,...N},slotProps:{content:p,clickAwayListener:h,transition:H,...O}},[pe,J]=kt("root",{ref:n,className:[$.root,f],elementType:IU,getSlotProps:K,externalForwardedProps:{...z,..._},ownerState:L}),[Q,{ownerState:re,...ne}]=kt("clickAwayListener",{elementType:xU,externalForwardedProps:z,getSlotProps:le=>({onClickAway:(...ue)=>{const Ie=ue[0];le.onClickAway?.(...ue),!Ie?.defaultMuiPrevented&&G(...ue)}}),ownerState:L}),[ae,ie]=kt("content",{elementType:kU,shouldForwardComponentProp:!0,externalForwardedProps:z,additionalProps:{message:b,action:s},ownerState:L}),[Z,me]=kt("transition",{elementType:el,externalForwardedProps:z,getSlotProps:le=>({onEnter:(...ue)=>{le.onEnter?.(...ue),se(...ue)},onExited:(...ue)=>{le.onExited?.(...ue),oe(...ue)}}),additionalProps:{appear:!0,in:I,timeout:B,direction:a==="top"?"down":"up"},ownerState:L});return!I&&q?null:c.jsx(Q,{...ne,...N.clickAwayListener&&{ownerState:re},children:c.jsx(pe,{...J,children:c.jsx(Z,{...me,children:d||c.jsx(ae,{...ie})})})})});function K1(){const[e,t]=W.useState(!1),{apiClients:n}=De.useServer(),[r,o]=W.useState(""),i=()=>{t(!0)},s=()=>{t(!1)},a=Lr.useQueryClient(),l=vn({async mutationFn(d){return n.environments.createEnvironment({name:d.name,readme:$C({name:d.name,readme:""},d.description)})},onSuccess(){s(),a.invalidateQueries({queryKey:["environments"]}),o("Environment created successfully")},onError(d){o(d instanceof Error?d.message:"An unknown error occurred")}}),u=async d=>{d.preventDefault();const f=new FormData(d.currentTarget),h=f.get("name")?.toString(),p=f.get("description")?.toString();if(!h)throw new Error("Name is required");l.mutate({name:h,description:p})};return c.jsxs(W.Fragment,{children:[c.jsx(tn,{variant:"contained",onClick:i,startIcon:c.jsx(On.AddCircleRounded,{}),sx:{mt:2},children:"Create New Environment"}),c.jsxs(no,{open:e,onClose:s,children:[c.jsx(Eo,{children:"Create New Environment"}),c.jsxs(oo,{children:[c.jsx(vl,{children:"Add a new environment to start exploring semantic models and analyzing data."}),c.jsxs("form",{onSubmit:u,id:"environment-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",type:"text",fullWidth:!0,variant:"standard"}),c.jsx(Ct,{margin:"dense",id:"description",name:"description",label:"Environment Description",placeholder:"Explore semantic models, run queries, and build dashboards",type:"text",fullWidth:!0,variant:"standard"})]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:l.isPending,onClick:s,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"environment-form",loading:l.isPending,children:"Create Environment"})]})]}),c.jsx(AU,{open:r!=="",autoHideDuration:6e3,onClose:()=>o(""),message:r})]})}function OU({environment:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=De.useServer(),i=Lr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},d=vn({mutationFn:()=>o.environments.deleteEnvironment(e.name),onSuccess(){u(),i.invalidateQueries({queryKey:["environments"]}),a("Environment deleted successfully")},onError(f){a(f instanceof Error?f.message:"An unknown error occurred")}});return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:l,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Delete"})]}),c.jsxs(no,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[c.jsx(Eo,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Environment"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:f=>({position:"absolute",right:8,top:8,color:f.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsx(oo,{dividers:!0,children:c.jsxs(Dt,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),c.jsxs(ro,{children:[c.jsx(tn,{variant:"outlined",onClick:u,style:{borderColor:De.MALLOY_BRAND.teal,color:De.MALLOY_BRAND.teal},children:"Cancel"}),c.jsx(tn,{loading:d.isPending,variant:"contained",autoFocus:!0,onClick:()=>d.mutate(),color:"error",children:"Delete"})]}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function MU({environment:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=De.useServer(),i=Lr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},d=vn({async mutationFn(h){return o.environments.updateEnvironment(e.name,{name:e.name,readme:$C({name:e.name,readme:e.readme},h.description)})},onSuccess(){u(),i.invalidateQueries({queryKey:["environments"]}),a("Environment updated successfully")},onError(h){a(h instanceof Error?h.message:"An unknown error occurred")}}),f=h=>{h.preventDefault();const m=new FormData(h.currentTarget).get("description")?.toString();d.mutate({description:m})};return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:l,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Edit"})]}),c.jsxs(no,{open:n,onClose:u,children:[c.jsx(Eo,{children:"Edit Environment"}),c.jsxs(oo,{children:[c.jsx(vl,{children:"Edit this environment's description."}),c.jsxs("form",{onSubmit:f,id:"environment-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),c.jsx(Ct,{margin:"dense",id:"description",name:"description",label:"Environment Description",type:"text",fullWidth:!0,variant:"standard",defaultValue:jC(e.readme)})]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:d.isPending,onClick:u,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"environment-form",loading:d.isPending,children:"Save Changes"})]})]}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})}const PU=[{title:"Ad-hoc analysis",body:"Browse semantic sources, build queries, and run nested logic in Explorer — no code.",href:ss.explorer},{title:"Notebook dashboards",body:"Code-first dashboards using Malloy notebooks. Versioned alongside your models.",href:ss.publishing},{title:"AI data agents",body:"Expose models via MCP so agents can discover sources and ask well-formed questions.",href:ss.mcpAgents}];function RU({onClickEnvironment:e}){const{apiClients:t,mutable:n}=De.useServer(),{data:r,isSuccess:o,isError:i,error:s}=Xt({queryKey:["environments"],queryFn:()=>t.environments.listEnvironments()});if(i)return c.jsx(kn,{error:s,context:"Environments List"});if(!o)return c.jsx(Sn,{text:"Loading environments..."});const a=r.data??[];return c.jsxs(w.Container,{maxWidth:"md",sx:{py:6},children:[c.jsxs(w.Box,{sx:{mb:5},children:[c.jsx(w.Typography,{variant:"h3",component:"h1",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Publisher"}),c.jsx(w.Typography,{variant:"body1",color:"text.secondary",sx:{mb:3},children:"The open-source semantic model server for the Malloy data language."}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6},children:"Define semantic models once — and use them everywhere. Publisher serves Malloy models through clean APIs, enabling consistent, interpretable, and AI-ready data access for tools, applications, and agents."})]}),c.jsx(w.Grid,{container:!0,spacing:4,sx:{mb:5},children:PU.map(l=>c.jsx(w.Grid,{size:{xs:12,md:4},children:c.jsxs(w.Stack,{spacing:1,children:[c.jsx(w.Typography,{variant:"body2",component:"a",href:l.href,target:"_blank",rel:"noopener noreferrer",sx:{fontWeight:500,color:"text.primary",textDecoration:"none","&:hover":{textDecoration:"underline"}},children:l.title}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6},children:l.body})]})},l.title))}),c.jsx(w.Divider,{sx:{my:4}}),a.length>0?c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:.5},children:"Environments"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Published environments available on this server"})]}),n&&c.jsx(K1,{})]}),c.jsx(w.Grid,{container:!0,spacing:2,children:a.map(l=>c.jsx(w.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(NU,{environment:l,onClickEnvironment:e})},l.name))})]}):c.jsxs(w.Box,{sx:{mb:4},children:[c.jsx(w.Typography,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Get started"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{mb:3,maxWidth:600},children:"Create your first Malloy environment to start exploring semantic models and building data experiences."}),n?c.jsx(K1,{}):c.jsx(w.Button,{variant:"contained",color:"primary",href:ss.publishing,target:"_blank",rel:"noopener noreferrer",children:"Learn how to create models"})]}),c.jsx(w.Divider,{sx:{my:4}}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Publisher is built on fully open infrastructure and designed for the AI era. Join the"," ",c.jsx(w.Box,{component:"a",href:"https://join.slack.com/t/malloy-community/shared_invite/zt-1kgfwgi5g-CrsdaRqs81QY67QW0~t_uw",target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Slack community"})," ","to ask questions, share ideas, and contribute."]})]})}function NU({environment:e,onClickEnvironment:t}){const{mutable:n}=De.useServer(),[r,o]=W.useState(null),i=!!r,s=jC(e.readme),a=d=>{e.name&&t&&t(`/${e.name}/`,d)},l=d=>{d.stopPropagation(),o(d.currentTarget)},u=()=>{o(null)};return c.jsx(w.Card,{variant:"outlined",onClick:a,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:c.jsx(w.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(w.Box,{sx:d=>({width:36,height:36,borderRadius:1.5,bgcolor:d.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:c.jsx(BC,{sx:{fontSize:20}})}),c.jsxs(w.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(w.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(w.Tooltip,{title:s,followCursor:!0,enterDelay:1e3,children:c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:s})})]}),n&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small",onClick:l,"aria-label":`Environment actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:r,open:i,onClose:u,onClick:d=>d.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(MU,{environment:e,onCloseDialog:u}),c.jsx(OU,{environment:e,onCloseDialog:u})]})]})]})})})}const Zu=mt(c.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"})),FU=mt(c.jsx("path",{d:"M8 5v14l11-7z"}));function HC({open:e,onClose:t,result:n,title:r="Results",renderLogs:o}){return c.jsxs(w.Dialog,{open:e,onClose:t,maxWidth:!1,fullWidth:!0,sx:{"& .MuiDialog-paper":{width:"95vw",height:"95vh",maxWidth:"none"}},children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r,c.jsx(w.IconButton,{onClick:t,sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{sx:{height:"calc(95vh - 120px)",overflow:"auto",padding:"0 16px"},children:c.jsx(Os,{result:n,maxHeight:800,maxResultSize:1e6,renderLogs:o})})]})}function LU({queryName:e,annotations:t,resourceUri:n,runOnDemand:r=!1,maxResultSize:o=0}){const[i,s]=W.useState(),[a,l]=W.useState(!1),[u,d]=W.useState(!1),{packageName:f,environmentName:h,versionId:p,modelPath:m}=Ht(n),{apiClients:b}=De.useServer(),{data:y,isSuccess:x,isLoading:C}=Xt({queryKey:["namedQueryResult",n,e],queryFn:()=>b.models.executeQueryModel(h,f,m,{query:void 0,sourceName:void 0,queryName:e,versionId:p}),enabled:r?u:!0,...De.CHART_RESULT_QUERY_OPTIONS}),{mode:v}=De.usePublisherTheme();return W.useEffect(()=>{if(t&&t.length>0){const S=t.map(I=>`// ${I}`).join(`
207
- `);$u(S,"typescript",v).then(I=>{s(I)})}},[t,v]),c.jsxs(De.CleanNotebookCell,{children:[i&&c.jsx(w.Box,{sx:{marginBottom:"16px"},children:c.jsx(w.Typography,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:c.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:i}})})}),c.jsxs(w.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[c.jsx(w.Typography,{variant:"body2",sx:{fontSize:"15px",fontWeight:"600",color:"#495057",padding:"8px 16px",backgroundColor:"#f8f9fa",borderRadius:"6px",border:"1px solid #e9ecef"},children:e}),c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>l(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"text.secondary"}})})]}),c.jsxs(De.CleanMetricCard,{sx:{position:"relative"},children:[r&&!u&&c.jsxs(w.Box,{sx:{padding:"40px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Click Run to execute the query"}),c.jsx(w.Button,{variant:"contained",startIcon:c.jsx(FU,{}),onClick:()=>d(!0),sx:{backgroundColor:"#1976d2","&:hover":{backgroundColor:"#1565c0"},textTransform:"none",fontSize:"14px",fontWeight:600,padding:"8px 24px"},children:"Run Query"})]}),(!r||u)&&C&&c.jsx(w.Box,{sx:{padding:"20px",textAlign:"center"},children:c.jsx(w.Typography,{children:"Loading results..."})}),(!r||u)&&x&&y?.data?.result&&c.jsx(Os,{result:y.data.result,maxHeight:600,maxResultSize:o,renderLogs:y.data.renderLogs})]}),c.jsx(HC,{open:a,onClose:()=>l(!1),result:y?.data?.result||"",renderLogs:y?.data?.renderLogs,title:`Query: ${e}`})]})}function sh(e,t=!0){const{modelPath:n,environmentName:r,packageName:o,versionId:i}=Ht(e),{apiClients:s}=De.useServer();return Xt({queryKey:["package",r,o,n,i],queryFn:async()=>(await s.models.getModel(r,o,n,i)).data,enabled:t})}function ah({data:e,onChange:t,existingQuery:n,initialSelectedSourceIndex:r=0,onSourceChange:o,resourceUri:i}){const[s,a]=W.useState(r);W.useEffect(()=>{a(r)},[r]);const{data:l,isError:u,isLoading:d,error:f}=sh(i,!e),{modelPath:h}=Ht(i),p=e||l;if(d&&!e)return c.jsx(Sn,{text:"Fetching Model..."});if(u&&!e)return console.log("error",f),c.jsx(kn,{error:f,context:`ModelExplorer > ${h}`});if(!p)return c.jsx(Sn,{text:"Loading..."});const m=(p?.sourceInfos||[]).map((y,x)=>{try{return JSON.parse(y)?.name||`Source ${x+1}`}catch{return`Source ${x+1}`}}),b=m[s]||"";return c.jsxs(De.StyledCard,{variant:"outlined",children:[c.jsx(De.StyledCardContent,{children:c.jsx(w.Stack,{sx:{flexDirection:"row"},children:c.jsx(_f,{size:"small",id:"size-small-standard",disablePortal:!0,options:m,value:b,onChange:(y,x)=>{if(!x)return;const C=m.indexOf(x);C>=0&&(a(C),o?.(C))},renderInput:y=>c.jsx(Ct,{...y}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),c.jsx(De.StyledCardMedia,{children:c.jsxs(w.Stack,{spacing:2,component:"section",children:[Array.isArray(p.sourceInfos)&&p.sourceInfos.length>0&&c.jsx(kp,{sourceAndPaths:p.sourceInfos.map(y=>({sourceInfo:JSON.parse(y),modelPath:h})),selectedSourceIndex:s,existingQuery:n,onQueryChange:t,resourceUri:i}),c.jsx(w.Box,{height:"5px"})]})})]})}function lh({open:e,onClose:t,resourceUri:n,data:r,title:o="Data Sources",hasValidImport:i=!0,existingQuery:s,initialSelectedSourceIndex:a,onChange:l,onSourceChange:u}){return c.jsxs(w.Dialog,{open:e,onClose:t,fullScreen:!0,children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,c.jsx(w.IconButton,{onClick:t,sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{children:i?c.jsx(ah,{resourceUri:n,data:r,existingQuery:s,initialSelectedSourceIndex:a,onChange:l,onSourceChange:u}):c.jsx("div",{children:"No valid import statement found in cell"})})]})}function _U({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0}){const{modelPath:o}=Ht(t),{data:i,isError:s,isLoading:a,error:l}=sh(t),[u,d]=W.useState(!1),[f,h]=W.useState(),[p,m]=W.useState(0),[b,y]=W.useState(""),x=i?.modelDef,C=W.useMemo(()=>{if(!x)return!1;try{const T=JSON.parse(x);return Array.isArray(T.imports)&&T.imports.length>0}catch{return!1}},[x]);if(a)return c.jsx(Sn,{text:"Fetching Model..."});if(s)return console.log("error",l),c.jsx(kn,{error:l,context:`Model > ${o}`});const v=T=>{h(T),e&&e(T)},S=T=>{m(T)},I=()=>{const T=window.location.href;navigator.clipboard.writeText(T).then(()=>y("URL copied to clipboard!")).catch(()=>y("Failed to copy URL"))};return c.jsxs(c.Fragment,{children:[c.jsxs(w.Box,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(i?.sourceInfos)&&i.sourceInfos.length>0&&c.jsxs(w.Stack,{spacing:2,component:"section",children:[c.jsxs(w.Box,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx(w.Typography,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),c.jsx(w.Tooltip,{title:"Click to copy link",children:c.jsx(Kf,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer"},onClick:I})})]}),c.jsx(ah,{data:i,onChange:v,onSourceChange:S,existingQuery:f,initialSelectedSourceIndex:p,resourceUri:t}),c.jsx(w.IconButton,{sx:{position:"absolute",top:"90px",right:"4px",backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",zIndex:2},onClick:()=>d(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"text.secondary",marginBottom:"5px"}})})]}),i?.queries?.length>0&&c.jsxs(w.Stack,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[c.jsx(w.Box,{sx:{padding:"0 0 16px 0"},children:c.jsx(w.Typography,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),i.queries.map(T=>c.jsx(LU,{queryName:T.name,annotations:T.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},T.name))]}),(!Array.isArray(i?.sourceInfos)||i.sourceInfos.length===0)&&!(i?.queries&&i.queries.length>0)&&c.jsxs(w.Box,{sx:{textAlign:"center",py:6},children:[c.jsx(w.Typography,{variant:"body1",sx:{color:"text.secondary",marginBottom:"8px"},children:"This model exposes no sources or queries."}),C&&c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["It imports other files but re-exports nothing. Add"," ",c.jsxs("code",{children:["export ","{ source_name }"]})," to surface imported sources here."]})]}),c.jsx(lh,{open:u,onClose:()=>d(!1),resourceUri:t,data:i,title:`Model: ${o.split("/").pop()}`,existingQuery:f,initialSelectedSourceIndex:p,onChange:v,onSourceChange:S})]}),c.jsx(w.Snackbar,{open:b!=="",autoHideDuration:6e3,onClose:()=>y(""),message:b})]})}function zC(e,t){return`${e}:${t}`}function xo(e){return zC(e.source,e.filterName??e.dimensionName)}function UC(e){return e.replace(/'/g,"\\'").replace(/\\/g,"\\\\")}function Ur(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${UC(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function BU(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,i=`\`${t}\``,s=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(l=>`${i} = ${Ur(l,s)}`).join(" or ")})`:Array.isArray(r)?"":`${i} = ${Ur(r,s)}`;case"Contains":return typeof r=="string"?`${i} ~ f'%${UC(r)}%'`:Array.isArray(r)?"":`${i} = ${Ur(r)}`;case"After":return Array.isArray(r)?"":`${i} > ${Ur(r,s)}`;case"Before":return Array.isArray(r)?"":`${i} < ${Ur(r,s)}`;case"Greater Than":return Array.isArray(r)?"":`${i} > ${Ur(r)}`;case"Less Than":return Array.isArray(r)?"":`${i} < ${Ur(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${i} >= ${Ur(r,s)} and ${i} <= ${Ur(o,s)}`:`${i} >= ${Ur(r,s)}`;default:return""}}function jU(e){const t=new Map;for(const n of e){const r=`${n.source}|${n.model}`,o=t.get(r)||[];o.push(n),t.set(r,o)}return t}function $U(e,t,n,r){const o=t.filter(u=>(u.filterType==="Star"||u.filterType==="MinMax"||u.filterType==="DateMinMax")&&!u.values);if(o.length===0)return"";const s=[...new Set(o.map(u=>u.dimensionName))].map(u=>`\`${u}\``).join(", "),a=r?.filter(u=>u.source===e)||[],l=a.length>0?a.map(u=>BU(u)).filter(u=>u.length>0).join(" and "):"";return`
206
+ `)};function EU(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:i}=e,s=Sc();M.useEffect(()=>{if(!o)return;function x(C){C.defaultPrevented||C.key==="Escape"&&r?.(C,"escapeKeyDown")}return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[o,r]);const a=Ve((x,C)=>{r?.(x,C)}),l=Ve(x=>{!r||x==null||s.start(x,()=>{a(null,"timeout")})});M.useEffect(()=>(o&&l(t),s.clear),[o,t,l,s]);const u=x=>{r?.(x,"clickaway")},d=s.clear,f=M.useCallback(()=>{t!=null&&l(i??t*.5)},[t,i,l]),h=x=>C=>{const v=x.onBlur;v?.(C),f()},p=x=>C=>{const v=x.onFocus;v?.(C),d()},m=x=>C=>{const v=x.onMouseEnter;v?.(C),d()},b=x=>C=>{const v=x.onMouseLeave;v?.(C),f()};return M.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",f),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",d)}},[n,o,f,d]),{getRootProps:(x={})=>{const C={...Ln(e),...Ln(x)};return{role:"presentation",...x,...C,onBlur:h(C),onFocus:p(C),onMouseEnter:m(C),onMouseLeave:b(C)}},onClickAway:u}}function Y1(e){return e.substring(2).toLowerCase()}function vU(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function TU(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:i="onTouchEnd"}=e,s=M.useRef(!1),a=M.useRef(null),l=M.useRef(!1),u=M.useRef(!1);M.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const d=vt(Ms(t),a),f=Ve(m=>{const b=u.current;u.current=!1;const y=mn(a.current);if(!l.current||!a.current||"clientX"in m&&vU(m,y))return;if(s.current){s.current=!1;return}let x;m.composedPath?x=m.composedPath().includes(a.current):x=!y.documentElement.contains(m.target)||a.current.contains(m.target),!x&&(n||!b)&&o(m)}),h=m=>b=>{u.current=!0;const y=t.props[m];y&&y(b)},p={ref:d};return i!==!1&&(p[i]=h(i)),M.useEffect(()=>{if(i!==!1){const m=Y1(i),b=mn(a.current),y=()=>{s.current=!0};return b.addEventListener(m,f),b.addEventListener("touchmove",y),()=>{b.removeEventListener(m,f),b.removeEventListener("touchmove",y)}}},[f,i]),r!==!1&&(p[r]=h(r)),M.useEffect(()=>{if(r!==!1){const m=Y1(r),b=mn(a.current);return b.addEventListener(m,f),()=>{b.removeEventListener(m,f)}}},[f,r]),M.cloneElement(t,p)}function SU(e){return Ge("MuiSnackbarContent",e)}We("MuiSnackbarContent",["root","message","action"]);const kU=e=>{const{classes:t}=e;return Ke({root:["root"],action:["action"],message:["message"]},SU,t)},wU=fe(Ci,{name:"MuiSnackbarContent",slot:"Root"})(ft(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(Kd(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:Kd(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),DU=fe("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),IU=fe("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),AU=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiSnackbarContent"}),{action:o,className:i,message:s,role:a="alert",...l}=r,u=r,d=kU(u);return c.jsxs(wU,{role:a,elevation:6,className:Ue(d.root,i),ownerState:u,ref:n,...l,children:[c.jsx(DU,{className:d.message,ownerState:u,children:s}),o?c.jsx(IU,{className:d.action,ownerState:u,children:o}):null]})});function OU(e){return Ge("MuiSnackbar",e)}We("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const MU=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${Fe(n.vertical)}${Fe(n.horizontal)}`]};return Ke(r,OU,t)},PU=fe("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${Fe(n.anchorOrigin.vertical)}${Fe(n.anchorOrigin.horizontal)}`]]}})(ft(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),RU=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiSnackbar"}),o=Lo(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:u=null,children:d,className:f,ClickAwayListenerProps:h,ContentProps:p,disableWindowBlurListener:m=!1,message:b,onBlur:y,onClose:x,onFocus:C,onMouseEnter:v,onMouseLeave:S,open:I,resumeHideDuration:T,slots:N={},slotProps:O={},TransitionComponent:F,transitionDuration:B=i,TransitionProps:{onEnter:j,onExited:D,...H}={},..._}=r,L={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:u,disableWindowBlurListener:m,TransitionComponent:F,transitionDuration:B},$=MU(L),{getRootProps:K,onClickAway:G}=EU({...L}),[q,R]=M.useState(!0),oe=le=>{R(!0),D&&D(le)},se=(le,ue)=>{R(!1),j&&j(le,ue)},z={slots:{transition:F,...N},slotProps:{content:p,clickAwayListener:h,transition:H,...O}},[pe,J]=kt("root",{ref:n,className:[$.root,f],elementType:PU,getSlotProps:K,externalForwardedProps:{...z,..._},ownerState:L}),[Q,{ownerState:re,...ne}]=kt("clickAwayListener",{elementType:TU,externalForwardedProps:z,getSlotProps:le=>({onClickAway:(...ue)=>{const Ie=ue[0];le.onClickAway?.(...ue),!Ie?.defaultMuiPrevented&&G(...ue)}}),ownerState:L}),[ae,ie]=kt("content",{elementType:AU,shouldForwardComponentProp:!0,externalForwardedProps:z,additionalProps:{message:b,action:s},ownerState:L}),[Z,me]=kt("transition",{elementType:el,externalForwardedProps:z,getSlotProps:le=>({onEnter:(...ue)=>{le.onEnter?.(...ue),se(...ue)},onExited:(...ue)=>{le.onExited?.(...ue),oe(...ue)}}),additionalProps:{appear:!0,in:I,timeout:B,direction:a==="top"?"down":"up"},ownerState:L});return!I&&q?null:c.jsx(Q,{...ne,...N.clickAwayListener&&{ownerState:re},children:c.jsx(pe,{...J,children:c.jsx(Z,{...me,children:d||c.jsx(ae,{...ie})})})})});function K1(){const[e,t]=W.useState(!1),{apiClients:n}=De.useServer(),[r,o]=W.useState(""),i=()=>{t(!0)},s=()=>{t(!1)},a=Lr.useQueryClient(),l=vn({async mutationFn(d){return n.environments.createEnvironment({name:d.name,readme:UC({name:d.name,readme:""},d.description)})},onSuccess(){s(),a.invalidateQueries({queryKey:["environments"]}),o("Environment created successfully")},onError(d){o(d instanceof Error?d.message:"An unknown error occurred")}}),u=async d=>{d.preventDefault();const f=new FormData(d.currentTarget),h=f.get("name")?.toString(),p=f.get("description")?.toString();if(!h)throw new Error("Name is required");l.mutate({name:h,description:p})};return c.jsxs(W.Fragment,{children:[c.jsx(tn,{variant:"contained",onClick:i,startIcon:c.jsx(On.AddCircleRounded,{}),sx:{mt:2},children:"Create New Environment"}),c.jsxs(no,{open:e,onClose:s,children:[c.jsx(Eo,{children:"Create New Environment"}),c.jsxs(oo,{children:[c.jsx(vl,{children:"Add a new environment to start exploring semantic models and analyzing data."}),c.jsxs("form",{onSubmit:u,id:"environment-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",type:"text",fullWidth:!0,variant:"standard"}),c.jsx(Ct,{margin:"dense",id:"description",name:"description",label:"Environment Description",placeholder:"Explore semantic models, run queries, and build dashboards",type:"text",fullWidth:!0,variant:"standard"})]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:l.isPending,onClick:s,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"environment-form",loading:l.isPending,children:"Create Environment"})]})]}),c.jsx(RU,{open:r!=="",autoHideDuration:6e3,onClose:()=>o(""),message:r})]})}function NU({environment:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=De.useServer(),i=Lr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},d=vn({mutationFn:()=>o.environments.deleteEnvironment(e.name),onSuccess(){u(),i.invalidateQueries({queryKey:["environments"]}),a("Environment deleted successfully")},onError(f){a(f instanceof Error?f.message:"An unknown error occurred")}});return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:l,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Delete"})]}),c.jsxs(no,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[c.jsx(Eo,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Environment"}),c.jsx(Ir,{"aria-label":"close",onClick:u,sx:f=>({position:"absolute",right:8,top:8,color:f.palette.grey[500]}),children:c.jsx(Fr,{})}),c.jsx(oo,{dividers:!0,children:c.jsxs(Dt,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),c.jsxs(ro,{children:[c.jsx(tn,{variant:"outlined",onClick:u,style:{borderColor:De.MALLOY_BRAND.teal,color:De.MALLOY_BRAND.teal},children:"Cancel"}),c.jsx(tn,{loading:d.isPending,variant:"contained",autoFocus:!0,onClick:()=>d.mutate(),color:"error",children:"Delete"})]}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function FU({environment:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=De.useServer(),i=Lr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},d=vn({async mutationFn(h){return o.environments.updateEnvironment(e.name,{name:e.name,readme:UC({name:e.name,readme:e.readme},h.description)})},onSuccess(){u(),i.invalidateQueries({queryKey:["environments"]}),a("Environment updated successfully")},onError(h){a(h instanceof Error?h.message:"An unknown error occurred")}}),f=h=>{h.preventDefault();const m=new FormData(h.currentTarget).get("description")?.toString();d.mutate({description:m})};return c.jsxs(W.Fragment,{children:[c.jsxs(w.MenuItem,{onClick:l,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(w.ListItemText,{children:"Edit"})]}),c.jsxs(no,{open:n,onClose:u,children:[c.jsx(Eo,{children:"Edit Environment"}),c.jsxs(oo,{children:[c.jsx(vl,{children:"Edit this environment's description."}),c.jsxs("form",{onSubmit:f,id:"environment-form",children:[c.jsx(Ct,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),c.jsx(Ct,{margin:"dense",id:"description",name:"description",label:"Environment Description",type:"text",fullWidth:!0,variant:"standard",defaultValue:zC(e.readme)})]})]}),c.jsxs(ro,{children:[c.jsx(tn,{disabled:d.isPending,onClick:u,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"environment-form",loading:d.isPending,children:"Save Changes"})]})]}),c.jsx(w.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})}const LU=[{title:"Ad-hoc analysis",body:"Browse semantic sources, build queries, and run nested logic in Explorer — no code.",href:ss.explorer},{title:"Notebook dashboards",body:"Code-first dashboards using Malloy notebooks. Versioned alongside your models.",href:ss.publishing},{title:"AI data agents",body:"Expose models via MCP so agents can discover sources and ask well-formed questions.",href:ss.mcpAgents}];function _U({onClickEnvironment:e}){const{apiClients:t,mutable:n}=De.useServer(),{data:r,isSuccess:o,isError:i,error:s}=Xt({queryKey:["environments"],queryFn:()=>t.environments.listEnvironments()});if(i)return c.jsx(kn,{error:s,context:"Environments List"});if(!o)return c.jsx(Sn,{text:"Loading environments..."});const a=r.data??[];return c.jsxs(w.Container,{maxWidth:"md",sx:{py:6},children:[c.jsxs(w.Box,{sx:{mb:5},children:[c.jsx(w.Typography,{variant:"h3",component:"h1",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Publisher"}),c.jsx(w.Typography,{variant:"body1",color:"text.secondary",sx:{mb:3},children:"The open-source semantic model server for the Malloy data language."}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6},children:"Define semantic models once — and use them everywhere. Publisher serves Malloy models through clean APIs, enabling consistent, interpretable, and AI-ready data access for tools, applications, and agents."})]}),c.jsx(w.Grid,{container:!0,spacing:4,sx:{mb:5},children:LU.map(l=>c.jsx(w.Grid,{size:{xs:12,md:4},children:c.jsxs(w.Stack,{spacing:1,children:[c.jsx(w.Typography,{variant:"body2",component:"a",href:l.href,target:"_blank",rel:"noopener noreferrer",sx:{fontWeight:500,color:"text.primary",textDecoration:"none","&:hover":{textDecoration:"underline"}},children:l.title}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6},children:l.body})]})},l.title))}),c.jsx(w.Divider,{sx:{my:4}}),a.length>0?c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:.5},children:"Environments"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Published environments available on this server"})]}),n&&c.jsx(K1,{})]}),c.jsx(w.Grid,{container:!0,spacing:2,children:a.map(l=>c.jsx(w.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(BU,{environment:l,onClickEnvironment:e})},l.name))})]}):c.jsxs(w.Box,{sx:{mb:4},children:[c.jsx(w.Typography,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Get started"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{mb:3,maxWidth:600},children:"Create your first Malloy environment to start exploring semantic models and building data experiences."}),n?c.jsx(K1,{}):c.jsx(w.Button,{variant:"contained",color:"primary",href:ss.publishing,target:"_blank",rel:"noopener noreferrer",children:"Learn how to create models"})]}),c.jsx(w.Divider,{sx:{my:4}}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["Publisher is built on fully open infrastructure and designed for the AI era. Join the"," ",c.jsx(w.Box,{component:"a",href:"https://join.slack.com/t/malloy-community/shared_invite/zt-1kgfwgi5g-CrsdaRqs81QY67QW0~t_uw",target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Slack community"})," ","to ask questions, share ideas, and contribute."]})]})}function BU({environment:e,onClickEnvironment:t}){const{mutable:n}=De.useServer(),[r,o]=W.useState(null),i=!!r,s=zC(e.readme),a=d=>{e.name&&t&&t(`/${e.name}/`,d)},l=d=>{d.stopPropagation(),o(d.currentTarget)},u=()=>{o(null)};return c.jsx(w.Card,{variant:"outlined",onClick:a,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:c.jsx(w.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(w.Box,{sx:d=>({width:36,height:36,borderRadius:1.5,bgcolor:d.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:c.jsx(HC,{sx:{fontSize:20}})}),c.jsxs(w.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(w.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(w.Tooltip,{title:s,followCursor:!0,enterDelay:1e3,children:c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:s})})]}),n&&c.jsxs(c.Fragment,{children:[c.jsx(w.IconButton,{size:"small",onClick:l,"aria-label":`Environment actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:c.jsx(On.MoreVert,{fontSize:"small"})}),c.jsxs(w.Menu,{anchorEl:r,open:i,onClose:u,onClick:d=>d.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(FU,{environment:e,onCloseDialog:u}),c.jsx(NU,{environment:e,onCloseDialog:u})]})]})]})})})}const Zu=mt(c.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"})),jU=mt(c.jsx("path",{d:"M8 5v14l11-7z"}));function VC({open:e,onClose:t,result:n,title:r="Results",renderLogs:o}){return c.jsxs(w.Dialog,{open:e,onClose:t,maxWidth:!1,fullWidth:!0,sx:{"& .MuiDialog-paper":{width:"95vw",height:"95vh",maxWidth:"none"}},children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r,c.jsx(w.IconButton,{onClick:t,sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{sx:{height:"calc(95vh - 120px)",overflow:"auto",padding:"0 16px"},children:c.jsx(Os,{result:n,maxHeight:800,maxResultSize:1e6,renderLogs:o})})]})}function $U({queryName:e,annotations:t,resourceUri:n,runOnDemand:r=!1,maxResultSize:o=0}){const[i,s]=W.useState(),[a,l]=W.useState(!1),[u,d]=W.useState(!1),{packageName:f,environmentName:h,versionId:p,modelPath:m}=Ht(n),{apiClients:b}=De.useServer(),{data:y,isSuccess:x,isLoading:C}=Xt({queryKey:["namedQueryResult",n,e],queryFn:()=>b.models.executeQueryModel(h,f,m,{query:void 0,sourceName:void 0,queryName:e,versionId:p}),enabled:r?u:!0,...De.CHART_RESULT_QUERY_OPTIONS}),{mode:v}=De.usePublisherTheme();return W.useEffect(()=>{if(t&&t.length>0){const S=t.map(I=>`// ${I}`).join(`
207
+ `);$u(S,"typescript",v).then(I=>{s(I)})}},[t,v]),c.jsxs(De.CleanNotebookCell,{children:[i&&c.jsx(w.Box,{sx:{marginBottom:"16px"},children:c.jsx(w.Typography,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:c.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:i}})})}),c.jsxs(w.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[c.jsx(w.Typography,{variant:"body2",sx:{fontSize:"15px",fontWeight:"600",color:"#495057",padding:"8px 16px",backgroundColor:"#f8f9fa",borderRadius:"6px",border:"1px solid #e9ecef"},children:e}),c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>l(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"text.secondary"}})})]}),c.jsxs(De.CleanMetricCard,{sx:{position:"relative"},children:[r&&!u&&c.jsxs(w.Box,{sx:{padding:"40px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Click Run to execute the query"}),c.jsx(w.Button,{variant:"contained",startIcon:c.jsx(jU,{}),onClick:()=>d(!0),sx:{backgroundColor:"#1976d2","&:hover":{backgroundColor:"#1565c0"},textTransform:"none",fontSize:"14px",fontWeight:600,padding:"8px 24px"},children:"Run Query"})]}),(!r||u)&&C&&c.jsx(w.Box,{sx:{padding:"20px",textAlign:"center"},children:c.jsx(w.Typography,{children:"Loading results..."})}),(!r||u)&&x&&y?.data?.result&&c.jsx(Os,{result:y.data.result,maxHeight:600,maxResultSize:o,renderLogs:y.data.renderLogs})]}),c.jsx(VC,{open:a,onClose:()=>l(!1),result:y?.data?.result||"",renderLogs:y?.data?.renderLogs,title:`Query: ${e}`})]})}function sh(e,t=!0){const{modelPath:n,environmentName:r,packageName:o,versionId:i}=Ht(e),{apiClients:s}=De.useServer();return Xt({queryKey:["package",r,o,n,i],queryFn:async()=>(await s.models.getModel(r,o,n,i)).data,enabled:t})}function ah({data:e,onChange:t,existingQuery:n,initialSelectedSourceIndex:r=0,onSourceChange:o,resourceUri:i}){const[s,a]=W.useState(r);W.useEffect(()=>{a(r)},[r]);const{data:l,isError:u,isLoading:d,error:f}=sh(i,!e),{modelPath:h}=Ht(i),p=e||l;if(d&&!e)return c.jsx(Sn,{text:"Fetching Model..."});if(u&&!e)return console.log("error",f),c.jsx(kn,{error:f,context:`ModelExplorer > ${h}`});if(!p)return c.jsx(Sn,{text:"Loading..."});const m=(p?.sourceInfos||[]).map((y,x)=>{try{return JSON.parse(y)?.name||`Source ${x+1}`}catch{return`Source ${x+1}`}}),b=m[s]||"";return c.jsxs(De.StyledCard,{variant:"outlined",children:[c.jsx(De.StyledCardContent,{children:c.jsx(w.Stack,{sx:{flexDirection:"row"},children:c.jsx(_f,{size:"small",id:"size-small-standard",disablePortal:!0,options:m,value:b,onChange:(y,x)=>{if(!x)return;const C=m.indexOf(x);C>=0&&(a(C),o?.(C))},renderInput:y=>c.jsx(Ct,{...y}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),c.jsx(De.StyledCardMedia,{children:c.jsxs(w.Stack,{spacing:2,component:"section",children:[Array.isArray(p.sourceInfos)&&p.sourceInfos.length>0&&c.jsx(kp,{sourceAndPaths:p.sourceInfos.map(y=>({sourceInfo:JSON.parse(y),modelPath:h})),selectedSourceIndex:s,existingQuery:n,onQueryChange:t,resourceUri:i}),c.jsx(w.Box,{height:"5px"})]})})]})}function lh({open:e,onClose:t,resourceUri:n,data:r,title:o="Data Sources",hasValidImport:i=!0,existingQuery:s,initialSelectedSourceIndex:a,onChange:l,onSourceChange:u}){return c.jsxs(w.Dialog,{open:e,onClose:t,fullScreen:!0,children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,c.jsx(w.IconButton,{onClick:t,sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{children:i?c.jsx(ah,{resourceUri:n,data:r,existingQuery:s,initialSelectedSourceIndex:a,onChange:l,onSourceChange:u}):c.jsx("div",{children:"No valid import statement found in cell"})})]})}function HU({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0}){const{modelPath:o}=Ht(t),{data:i,isError:s,isLoading:a,error:l}=sh(t),[u,d]=W.useState(!1),[f,h]=W.useState(),[p,m]=W.useState(0),[b,y]=W.useState(""),x=i?.modelDef,C=W.useMemo(()=>{if(!x)return!1;try{const T=JSON.parse(x);return Array.isArray(T.imports)&&T.imports.length>0}catch{return!1}},[x]);if(a)return c.jsx(Sn,{text:"Fetching Model..."});if(s)return console.log("error",l),c.jsx(kn,{error:l,context:`Model > ${o}`});const v=T=>{h(T),e&&e(T)},S=T=>{m(T)},I=()=>{const T=window.location.href;navigator.clipboard.writeText(T).then(()=>y("URL copied to clipboard!")).catch(()=>y("Failed to copy URL"))};return c.jsxs(c.Fragment,{children:[c.jsxs(w.Box,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(i?.sourceInfos)&&i.sourceInfos.length>0&&c.jsxs(w.Stack,{spacing:2,component:"section",children:[c.jsxs(w.Box,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx(w.Typography,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),c.jsx(w.Tooltip,{title:"Click to copy link",children:c.jsx(Kf,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer"},onClick:I})})]}),c.jsx(ah,{data:i,onChange:v,onSourceChange:S,existingQuery:f,initialSelectedSourceIndex:p,resourceUri:t}),c.jsx(w.IconButton,{sx:{position:"absolute",top:"90px",right:"4px",backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",zIndex:2},onClick:()=>d(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"text.secondary",marginBottom:"5px"}})})]}),i?.queries?.length>0&&c.jsxs(w.Stack,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[c.jsx(w.Box,{sx:{padding:"0 0 16px 0"},children:c.jsx(w.Typography,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),i.queries.map(T=>c.jsx($U,{queryName:T.name,annotations:T.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},T.name))]}),(!Array.isArray(i?.sourceInfos)||i.sourceInfos.length===0)&&!(i?.queries&&i.queries.length>0)&&c.jsxs(w.Box,{sx:{textAlign:"center",py:6},children:[c.jsx(w.Typography,{variant:"body1",sx:{color:"text.secondary",marginBottom:"8px"},children:"This model exposes no sources or queries."}),C&&c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",children:["It imports other files but re-exports nothing. Add"," ",c.jsxs("code",{children:["export ","{ source_name }"]})," to surface imported sources here."]})]}),c.jsx(lh,{open:u,onClose:()=>d(!1),resourceUri:t,data:i,title:`Model: ${o.split("/").pop()}`,existingQuery:f,initialSelectedSourceIndex:p,onChange:v,onSourceChange:S})]}),c.jsx(w.Snackbar,{open:b!=="",autoHideDuration:6e3,onClose:()=>y(""),message:b})]})}function WC(e,t){return`${e}:${t}`}function xo(e){return WC(e.source,e.filterName??e.dimensionName)}function qC(e){return e.replace(/'/g,"\\'").replace(/\\/g,"\\\\")}function Ur(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${qC(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function zU(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,i=`\`${t}\``,s=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(l=>`${i} = ${Ur(l,s)}`).join(" or ")})`:Array.isArray(r)?"":`${i} = ${Ur(r,s)}`;case"Contains":return typeof r=="string"?`${i} ~ f'%${qC(r)}%'`:Array.isArray(r)?"":`${i} = ${Ur(r)}`;case"After":return Array.isArray(r)?"":`${i} > ${Ur(r,s)}`;case"Before":return Array.isArray(r)?"":`${i} < ${Ur(r,s)}`;case"Greater Than":return Array.isArray(r)?"":`${i} > ${Ur(r)}`;case"Less Than":return Array.isArray(r)?"":`${i} < ${Ur(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${i} >= ${Ur(r,s)} and ${i} <= ${Ur(o,s)}`:`${i} >= ${Ur(r,s)}`;default:return""}}function UU(e){const t=new Map;for(const n of e){const r=`${n.source}|${n.model}`,o=t.get(r)||[];o.push(n),t.set(r,o)}return t}function VU(e,t,n,r){const o=t.filter(u=>(u.filterType==="Star"||u.filterType==="MinMax"||u.filterType==="DateMinMax")&&!u.values);if(o.length===0)return"";const s=[...new Set(o.map(u=>u.dimensionName))].map(u=>`\`${u}\``).join(", "),a=r?.filter(u=>u.source===e)||[],l=a.length>0?a.map(u=>zU(u)).filter(u=>u.length>0).join(" and "):"";return`
208
208
  run: ${e} -> {
209
209
  ${l?`where: ${l}`:""}
210
210
  index: ${s}
@@ -214,16 +214,16 @@ import {${t.sourceName}}" from '${t.modelPath}'"
214
214
 
215
215
  limit: ${n}
216
216
  }
217
- `}function HU(e,t){const n=new Map;for(const d of t){const f=xo(d);n.set(f,[])}const r=JSON.parse(e),o=r.schema.fields,i=new Map;o.forEach((d,f)=>{i.set(d.name,f)});const s=d=>{if(!d)return null;switch(d.kind){case"string_cell":return d.string_value??null;case"number_cell":return d.number_value??null;case"boolean_cell":return d.boolean_value??null;case"null_cell":return null;default:return console.log("Unknown cell kind: "+d.kind),null}},l=(r.data?.array_value||[]).map(d=>{const f={};return d.kind==="record_cell"&&d.record_value&&d.record_value.forEach((h,p)=>{const m=o[p]?.name;if(m){const b=s(h);m==="fieldName"&&typeof b=="string"?f.fieldName=b:m==="fieldPath"&&typeof b=="string"?f.fieldPath=b:m==="fieldType"&&typeof b=="string"?f.fieldType=b:m==="fieldValue"&&typeof b=="string"?f.fieldValue=b:m==="weight"&&typeof b=="number"&&(f.weight=b)}}),f}),u=l.length===0||l.every(d=>!d.fieldName);for(const d of t){if(d.filterType==="NONE"||d.filterType==="Retrieval")continue;const f=l.filter(p=>{const m=p.fieldName||"",b=p.fieldPath||"";if(m===d.dimensionName||b===d.dimensionName||m.toLowerCase()===d.dimensionName.toLowerCase()||b.toLowerCase()===d.dimensionName.toLowerCase())return!0;const y=b.split(".").pop()||"";return y===d.dimensionName||y.toLowerCase()===d.dimensionName.toLowerCase()});if(f.length===0)continue;const h=xo(d);if(d.filterType==="Star"){const p=f.filter(m=>m.fieldType==="string").map(m=>({value:m.fieldValue??"",count:m.weight})).sort((m,b)=>(b.count??0)-(m.count??0));n.set(h,p)}else if(d.filterType==="MinMax"){console.log("MinMax dimensionEntries: "+JSON.stringify(f,null,2)),console.log("All MinMax dimension entries fieldTypes:",f.map(m=>m.fieldType));const p=f.find(m=>m.fieldType==="number");if(console.log("numericEntry: "+JSON.stringify(p,null,2)),p?.fieldValue){const m=p.fieldValue,b=m.split(" to ");if(console.log("rangeParts: "+b),b.length===2){const y=[{value:parseFloat(b[0])},{value:parseFloat(b[1])}];n.set(h,y)}else console.warn(`Could not parse numeric range for ${d.dimensionName}: ${m}`)}else console.warn(`No numeric entry found for ${d.dimensionName}. Available entries:`,f)}else if(d.filterType==="DateMinMax"){const p=f.find(m=>m.fieldType==="date"||m.fieldType==="timestamp"||m.fieldType==="string");if(console.log("dateEntry: "+JSON.stringify(p,null,2)),console.log("All date dimension entries fieldTypes:",f.map(m=>m.fieldType)),p?.fieldValue){const m=p.fieldValue,b=m.split(" to ");if(console.log("date rangeParts: "+b),b.length===2){const y=[{value:new Date(b[0].trim())},{value:new Date(b[1].trim())}];n.set(h,y)}else console.warn(`Could not parse date range for ${d.dimensionName}: ${m}`)}else console.warn(`No date entry found for ${d.dimensionName}. Available entries:`,f)}}return{values:n,noRowsMatchedFilter:u}}function uh(e){const{environment:t,package:n,dimensionSpecs:r,versionId:o,enabled:i=!0,indexLimit:s=1e4,activeFilters:a=[]}=e,l=W.useMemo(()=>jU(r),[r]),u=W.useMemo(()=>{const b=[];for(const[y,x]of l){const[C,v]=y.split("|"),S=$U(C,x,s,a);S?b.push({key:y,source:C,model:v,query:S,specs:x}):console.log("No query for source: ",C,"model: ",v)}return b},[l,s,a]),d=W.useMemo(()=>i&&u.length>0&&r.some(b=>b.filterType==="Star"||b.filterType==="MinMax"||b.filterType==="DateMinMax"),[i,u,r]),{apiClients:f}=De.useServer(),h=Xt({queryKey:["dimensionalFilter",t,n,r,o,a],queryFn:async()=>{if(!d){const C=new Map;for(const v of r){const S=xo(v);C.set(S,[])}return{values:C,noRowsMatchedFilter:!1}}const b=await Promise.all(u.map(async C=>{const v=await f.models.executeQueryModel(t,n,C.model,{query:C.query,versionId:o,bypassFilters:!0});return{config:C,result:HU(v.data.result,C.specs)}})),y=new Map;let x=!1;for(const{result:C}of b){for(const[v,S]of C.values)y.set(v,S);C.noRowsMatchedFilter&&(x=!0)}return{values:y,noRowsMatchedFilter:x}},enabled:d,staleTime:300*1e3,placeholderData:b=>b}),p=h.data?.values;return{data:W.useMemo(()=>{const b=new Map;for(const y of r){const x=xo(y);y.values?b.set(x,y.values.map(C=>({value:C}))):b.set(x,[])}if(p)for(const[y,x]of p)x.length>0&&b.set(y,x);return b},[r,p]),noRowsMatchedFilter:h.data?.noRowsMatchedFilter??!1,isLoading:d?h.isPending:!1,isError:d?h.isError:!1,error:d?h.error:null,refetch:h.refetch}}function VC(e){return e.replace(/'/g,"\\'").replace(/\\/g,"\\\\")}function Vr(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${VC(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function zU(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,i=`\`${t}\``,s=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(l=>`${i} = ${Vr(l,s)}`).join(" or ")})`:Array.isArray(r)?"":`${i} = ${Vr(r,s)}`;case"Contains":return typeof r=="string"?`${i} ~ f'%${VC(r)}%'`:Array.isArray(r)?"":`${i} = ${Vr(r)}`;case"After":return Array.isArray(r)?"":`${i} > ${Vr(r,s)}`;case"Before":return Array.isArray(r)?"":`${i} < ${Vr(r,s)}`;case"Greater Than":return Array.isArray(r)?"":`${i} > ${Vr(r)}`;case"Less Than":return Array.isArray(r)?"":`${i} < ${Vr(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${i} >= ${Vr(r,s)} and ${i} <= ${Vr(o,s)}`:`${i} >= ${Vr(r,s)}`;default:return""}}function ch(e){const{dimensionSpecs:t}=e,[n,r]=W.useState(()=>{const u=new Map;return t.forEach(d=>{const f=xo(d);u.set(f,{spec:d,selection:null})}),u});W.useEffect(()=>{r(u=>{const d=new Map;return t.forEach(f=>{const h=xo(f),p=u.get(h);d.set(h,{spec:f,selection:p?.selection??null})}),d})},[t]);const o=W.useCallback((u,d)=>{r(f=>{const h=new Map(f),p=h.get(u);return p&&h.set(u,{...p,selection:d}),h})},[]),i=W.useCallback(u=>{o(u,null)},[o]),s=W.useCallback(()=>{r(u=>{const d=new Map(u);return d.forEach((f,h)=>{d.set(h,{...f,selection:null})}),d})},[]),a=W.useCallback(()=>{const u=[];return n.forEach(d=>{d.selection&&u.push(d.selection)}),u},[n]),l=W.useCallback(()=>{const u=a();if(u.length===0)return"";const d=u.map(f=>zU(f)).filter(f=>f.length>0);return d.length===0?"":`where ${d.join(" and ")}`},[a]);return{filterStates:n,updateFilter:o,clearFilter:i,clearAllFilters:s,getActiveFilters:a,generateWhereClause:l}}function WC(e){const[t,n]=W.useState(()=>new Map);W.useEffect(()=>{n(s=>{const a=new Set(e.map(u=>u.name).filter(u=>!!u)),l=new Map;return s.forEach((u,d)=>{a.has(d)&&l.set(d,u)}),l})},[e]);const r=W.useCallback((s,a)=>{n(l=>{const u=new Map(l);return a===null?u.delete(s):u.set(s,a),u})},[]),o=W.useCallback(()=>{n(s=>s.size===0?s:new Map)},[]),i=W.useCallback(()=>{const s=new Map;return t.forEach((a,l)=>{a!=null&&s.set(l,a)}),s},[t]);return{givenValues:t,updateGiven:r,clearAll:o,getActiveGivens:i}}function qC(e){return W.useMemo(()=>{if(!e?.sources?.length)return[];const t=new Map;for(const n of e.sources)if(n.givens?.length)for(const r of n.givens)r.name&&!t.has(r.name)&&t.set(r.name,r);return Array.from(t.values())},[e])}const YC=mt(c.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function UU(e,t){if(!t)return;const n=t.trim();if(!n)return;const r=e??"string";if(r==="date"||r==="timestamp"||r==="timestamptz")return n.replace(/^@/,"");if(r.startsWith("filter<")){const o=n.replace(/^f/,""),i=o.match(/^'([^'\\]*)'$/)??o.match(/^"([^"\\]*)"$/);return i?i[1]:o}return r==="string"?VU(n):n}function VU(e){const t=e[0];return e.length>=2&&(t==="'"||t==='"')&&e[e.length-1]===t?e.slice(1,-1).replace(/\\(["'\\ntr])/g,(n,r)=>r==="n"?`
218
- `:r==="t"?" ":r==="r"?"\r":r):e}_t.extend(PC);function WU(e){const t=(e.annotations??[]).filter(r=>r.trim().startsWith("#("));if(t.length===0)return;const n=[];for(const r of t){const o=r.trim(),i=o.match(/description="([^"]*)"/);if(i){n.push(i[1]);continue}const s=o.replace(/^#\(/,"").replace(/\)\s*$/,"").trim();s&&n.push(s)}return n.length>0?n.join(`
219
- `):void 0}function qU({given:e,value:t,onChange:n}){const r=e.name??"",o=e.type??"string",i=WU(e),s=UU(o,e.default),a=s!==void 0?`Default: ${s===""?"(empty)":s}`:void 0,l=i||a?c.jsxs(c.Fragment,{children:[i,i&&a?c.jsx("br",{}):null,a]}):void 0;if(o==="boolean"){const f=typeof t=="boolean",h=e.default?.trim()==="true",p=f?t:h;return c.jsxs(w.FormControl,{children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",children:[c.jsx(w.FormControlLabel,{control:c.jsx(w.Checkbox,{checked:p,onChange:m=>n(m.target.checked)}),label:r}),f&&c.jsx(w.IconButton,{size:"small","aria-label":"clear value",onClick:()=>n(null),edge:"end",children:c.jsx(YC,{fontSize:"small"})})]}),l&&c.jsx(w.FormHelperText,{children:l})]})}if(o==="number"){const f=typeof t=="number"?t:"";return c.jsx(w.TextField,{label:r,type:"number",value:f,onChange:h=>{const p=h.target.value;n(p===""?null:Number(p))},placeholder:s,helperText:l,slotProps:{input:{endAdornment:f!==""&&c.jsx(G1,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}if(o==="date"||o==="timestamp"||o==="timestamptz"){const f=t instanceof Date?_t.utc(t):null;return c.jsx(Xu,{dateAdapter:Bf,children:c.jsx(vu,{label:r,value:f,onChange:h=>n(h?h.toDate():null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:l},field:{clearable:!0,onClear:()=>n(null)}}})})}if(o.startsWith("array<")){const f=Array.isArray(t)?t.map(String):[];return c.jsx(w.Autocomplete,{multiple:!0,freeSolo:!0,options:[],value:f,onChange:(h,p)=>n(p.length===0?null:p),renderInput:h=>c.jsx(w.TextField,{...h,label:r,size:"small",placeholder:f.length===0?s:void 0,helperText:l}),fullWidth:!0})}const u=typeof t=="string"?t:"",d=t!=null;return c.jsx(w.TextField,{label:r,value:u,onChange:f=>n(f.target.value),placeholder:d?void 0:s??(o.startsWith("filter<")?o:void 0),helperText:l,slotProps:{input:{endAdornment:d&&c.jsx(G1,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}function G1({onClear:e}){return c.jsx(w.InputAdornment,{position:"end",children:c.jsx(w.IconButton,{size:"small","aria-label":"clear value",onClick:e,edge:"end",children:c.jsx(YC,{fontSize:"small"})})})}function YU({givens:e,values:t,onChange:n,onClearAll:r}){if(e.length===0)return null;const o=t.size>0;return c.jsxs(w.Paper,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[c.jsx(w.Typography,{variant:"subtitle2",sx:{fontWeight:600,color:"#333"},children:"Parameters"}),o&&c.jsx(w.Button,{variant:"text",size:"small",onClick:r,sx:{textTransform:"none"},children:"Reset"})]}),c.jsx(w.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:3},children:e.map(i=>c.jsx(w.Box,{children:c.jsx(qU,{given:i,value:i.name?t.get(i.name):void 0,onChange:s=>i.name&&n(i.name,s)})},i.name))})]})}const KU=mt(c.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}));function dh(e){const{environmentName:t,packageName:n}=Ht(e.resourceUri);if(!t||!n)throw new Error("Environment and Package name must be provided for query embedding.");return JSON.stringify({...e})}function GU({embeddedQueryResult:e}){const{query:t,sourceName:n,queryName:r,resourceUri:o,height:i}=JSON.parse(e),{modelPath:s}=Ht(o);if(!s||!t&&(!r||!n)||typeof s!="string")throw new Error("Invalid embedded query result: "+e);return c.jsx(KC,{query:t,sourceName:n,queryName:r,resourceUri:o,height:i})}function KC({query:e,sourceName:t,queryName:n,resourceUri:r,height:o=400}){const{modelPath:i,environmentName:s,packageName:a,versionId:l}=Ht(r),{apiClients:u}=De.useServer();if(!s||!a)throw new Error("No environment or package name provided. A resource URI must be provided.");const{data:d,isSuccess:f,isError:h,error:p}=Xt({queryKey:[r,e,t,n],queryFn:()=>u.models.executeQueryModel(s,a,i,{query:e,sourceName:t,queryName:n,versionId:l}),...De.CHART_RESULT_QUERY_OPTIONS});return c.jsxs(c.Fragment,{children:[!f&&!h&&c.jsx(Sn,{text:"Fetching Query Results..."}),f&&c.jsx(W.Suspense,{fallback:c.jsx("div",{children:"Loading..."}),children:c.jsx(Os,{result:d.data.result,maxHeight:o,renderLogs:d.data.renderLogs})}),h&&c.jsx(kn,{context:`${s} > ${a} > ${i}`,error:p})]})}function QU({href:e,title:t,children:n,envName:r,pkgName:o,sourceDir:i,onNavigate:s}){const a=!!e&&/^[a-z][a-z0-9+.-]*:/i.test(e);if(!(!!e&&!a&&!e.startsWith("/")&&!e.startsWith("#"))||!e){const h=a&&!/^(https?|mailto|tel):/i.test(e??"");return c.jsx("a",{href:h?void 0:e,title:t,...a?{target:"_blank",rel:"noopener noreferrer"}:{},children:n})}const u=new URL(e,`https://malloy.invalid/${i}`),d=u.pathname.slice(1)+u.search+u.hash,f=`/${r}/${o}/${d}`;return c.jsx("a",{href:f,title:t,onClick:s?h=>{h.preventDefault(),s(f,h)}:void 0,children:n})}function XU({cell:e,hideCodeCellIcon:t,hideEmbeddingIcon:n,resourceUri:r,index:o,maxResultSize:i,isExecuting:s,onNavigate:a}){const[l,u]=W.useState(!1),[d,f]=W.useState(!1),[h,p]=W.useState(!1),[m,b]=W.useState(),[y,x]=W.useState(),[C,v]=W.useState(!1),[S,I]=W.useState(""),{environmentName:T,packageName:N,modelPath:O}=Ht(r),F=O&&O.includes("/")?O.slice(0,O.lastIndexOf("/")+1):"",B={overrides:{a:{component:QU,props:{envName:T,pkgName:N,sourceDir:F,onNavigate:a}}}},j=/import\s*\{([^}]+)\}\s*from\s*['"`][^'"`]+['"`]/,D=/import\s*(?:\{[^}]*\}\s*from\s*)?['"`]([^'"`]+)['"`]/,H=R=>R.split(`
217
+ `}function WU(e,t){const n=new Map;for(const d of t){const f=xo(d);n.set(f,[])}const r=JSON.parse(e),o=r.schema.fields,i=new Map;o.forEach((d,f)=>{i.set(d.name,f)});const s=d=>{if(!d)return null;switch(d.kind){case"string_cell":return d.string_value??null;case"number_cell":return d.number_value??null;case"boolean_cell":return d.boolean_value??null;case"null_cell":return null;default:return console.log("Unknown cell kind: "+d.kind),null}},l=(r.data?.array_value||[]).map(d=>{const f={};return d.kind==="record_cell"&&d.record_value&&d.record_value.forEach((h,p)=>{const m=o[p]?.name;if(m){const b=s(h);m==="fieldName"&&typeof b=="string"?f.fieldName=b:m==="fieldPath"&&typeof b=="string"?f.fieldPath=b:m==="fieldType"&&typeof b=="string"?f.fieldType=b:m==="fieldValue"&&typeof b=="string"?f.fieldValue=b:m==="weight"&&typeof b=="number"&&(f.weight=b)}}),f}),u=l.length===0||l.every(d=>!d.fieldName);for(const d of t){if(d.filterType==="NONE"||d.filterType==="Retrieval")continue;const f=l.filter(p=>{const m=p.fieldName||"",b=p.fieldPath||"";if(m===d.dimensionName||b===d.dimensionName||m.toLowerCase()===d.dimensionName.toLowerCase()||b.toLowerCase()===d.dimensionName.toLowerCase())return!0;const y=b.split(".").pop()||"";return y===d.dimensionName||y.toLowerCase()===d.dimensionName.toLowerCase()});if(f.length===0)continue;const h=xo(d);if(d.filterType==="Star"){const p=f.filter(m=>m.fieldType==="string").map(m=>({value:m.fieldValue??"",count:m.weight})).sort((m,b)=>(b.count??0)-(m.count??0));n.set(h,p)}else if(d.filterType==="MinMax"){console.log("MinMax dimensionEntries: "+JSON.stringify(f,null,2)),console.log("All MinMax dimension entries fieldTypes:",f.map(m=>m.fieldType));const p=f.find(m=>m.fieldType==="number");if(console.log("numericEntry: "+JSON.stringify(p,null,2)),p?.fieldValue){const m=p.fieldValue,b=m.split(" to ");if(console.log("rangeParts: "+b),b.length===2){const y=[{value:parseFloat(b[0])},{value:parseFloat(b[1])}];n.set(h,y)}else console.warn(`Could not parse numeric range for ${d.dimensionName}: ${m}`)}else console.warn(`No numeric entry found for ${d.dimensionName}. Available entries:`,f)}else if(d.filterType==="DateMinMax"){const p=f.find(m=>m.fieldType==="date"||m.fieldType==="timestamp"||m.fieldType==="string");if(console.log("dateEntry: "+JSON.stringify(p,null,2)),console.log("All date dimension entries fieldTypes:",f.map(m=>m.fieldType)),p?.fieldValue){const m=p.fieldValue,b=m.split(" to ");if(console.log("date rangeParts: "+b),b.length===2){const y=[{value:new Date(b[0].trim())},{value:new Date(b[1].trim())}];n.set(h,y)}else console.warn(`Could not parse date range for ${d.dimensionName}: ${m}`)}else console.warn(`No date entry found for ${d.dimensionName}. Available entries:`,f)}}return{values:n,noRowsMatchedFilter:u}}function uh(e){const{environment:t,package:n,dimensionSpecs:r,versionId:o,enabled:i=!0,indexLimit:s=1e4,activeFilters:a=[]}=e,l=W.useMemo(()=>UU(r),[r]),u=W.useMemo(()=>{const b=[];for(const[y,x]of l){const[C,v]=y.split("|"),S=VU(C,x,s,a);S?b.push({key:y,source:C,model:v,query:S,specs:x}):console.log("No query for source: ",C,"model: ",v)}return b},[l,s,a]),d=W.useMemo(()=>i&&u.length>0&&r.some(b=>b.filterType==="Star"||b.filterType==="MinMax"||b.filterType==="DateMinMax"),[i,u,r]),{apiClients:f}=De.useServer(),h=Xt({queryKey:["dimensionalFilter",t,n,r,o,a],queryFn:async()=>{if(!d){const C=new Map;for(const v of r){const S=xo(v);C.set(S,[])}return{values:C,noRowsMatchedFilter:!1}}const b=await Promise.all(u.map(async C=>{const v=await f.models.executeQueryModel(t,n,C.model,{query:C.query,versionId:o,bypassFilters:!0});return{config:C,result:WU(v.data.result,C.specs)}})),y=new Map;let x=!1;for(const{result:C}of b){for(const[v,S]of C.values)y.set(v,S);C.noRowsMatchedFilter&&(x=!0)}return{values:y,noRowsMatchedFilter:x}},enabled:d,staleTime:300*1e3,placeholderData:b=>b}),p=h.data?.values;return{data:W.useMemo(()=>{const b=new Map;for(const y of r){const x=xo(y);y.values?b.set(x,y.values.map(C=>({value:C}))):b.set(x,[])}if(p)for(const[y,x]of p)x.length>0&&b.set(y,x);return b},[r,p]),noRowsMatchedFilter:h.data?.noRowsMatchedFilter??!1,isLoading:d?h.isPending:!1,isError:d?h.isError:!1,error:d?h.error:null,refetch:h.refetch}}function YC(e){return e.replace(/'/g,"\\'").replace(/\\/g,"\\\\")}function Vr(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${YC(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function qU(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,i=`\`${t}\``,s=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(l=>`${i} = ${Vr(l,s)}`).join(" or ")})`:Array.isArray(r)?"":`${i} = ${Vr(r,s)}`;case"Contains":return typeof r=="string"?`${i} ~ f'%${YC(r)}%'`:Array.isArray(r)?"":`${i} = ${Vr(r)}`;case"After":return Array.isArray(r)?"":`${i} > ${Vr(r,s)}`;case"Before":return Array.isArray(r)?"":`${i} < ${Vr(r,s)}`;case"Greater Than":return Array.isArray(r)?"":`${i} > ${Vr(r)}`;case"Less Than":return Array.isArray(r)?"":`${i} < ${Vr(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${i} >= ${Vr(r,s)} and ${i} <= ${Vr(o,s)}`:`${i} >= ${Vr(r,s)}`;default:return""}}function ch(e){const{dimensionSpecs:t}=e,[n,r]=W.useState(()=>{const u=new Map;return t.forEach(d=>{const f=xo(d);u.set(f,{spec:d,selection:null})}),u});W.useEffect(()=>{r(u=>{const d=new Map;return t.forEach(f=>{const h=xo(f),p=u.get(h);d.set(h,{spec:f,selection:p?.selection??null})}),d})},[t]);const o=W.useCallback((u,d)=>{r(f=>{const h=new Map(f),p=h.get(u);return p&&h.set(u,{...p,selection:d}),h})},[]),i=W.useCallback(u=>{o(u,null)},[o]),s=W.useCallback(()=>{r(u=>{const d=new Map(u);return d.forEach((f,h)=>{d.set(h,{...f,selection:null})}),d})},[]),a=W.useCallback(()=>{const u=[];return n.forEach(d=>{d.selection&&u.push(d.selection)}),u},[n]),l=W.useCallback(()=>{const u=a();if(u.length===0)return"";const d=u.map(f=>qU(f)).filter(f=>f.length>0);return d.length===0?"":`where ${d.join(" and ")}`},[a]);return{filterStates:n,updateFilter:o,clearFilter:i,clearAllFilters:s,getActiveFilters:a,generateWhereClause:l}}function KC(e){const[t,n]=W.useState(()=>new Map);W.useEffect(()=>{n(s=>{const a=new Set(e.map(u=>u.name).filter(u=>!!u)),l=new Map;return s.forEach((u,d)=>{a.has(d)&&l.set(d,u)}),l.size===s.size?s:l})},[e]);const r=W.useCallback((s,a)=>{n(l=>{const u=new Map(l);return a===null?u.delete(s):u.set(s,a),u})},[]),o=W.useCallback(()=>{n(s=>s.size===0?s:new Map)},[]),i=W.useCallback(()=>{const s=new Map;return t.forEach((a,l)=>{a!=null&&s.set(l,a)}),s},[t]);return{givenValues:t,updateGiven:r,clearAll:o,getActiveGivens:i}}function GC(e){return W.useMemo(()=>{if(!e?.sources?.length)return[];const t=new Map;for(const n of e.sources)if(n.givens?.length)for(const r of n.givens)r.name&&!t.has(r.name)&&t.set(r.name,r);return Array.from(t.values())},[e])}const QC=mt(c.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function YU(e,t){if(!t)return;const n=t.trim();if(!n)return;const r=e??"string";if(r==="date"||r==="timestamp"||r==="timestamptz")return n.replace(/^@/,"");if(r.startsWith("filter<")){const o=n.replace(/^f/,""),i=o.match(/^'([^'\\]*)'$/)??o.match(/^"([^"\\]*)"$/);return i?i[1]:o}return r==="string"?KU(n):n}function KU(e){const t=e[0];return e.length>=2&&(t==="'"||t==='"')&&e[e.length-1]===t?e.slice(1,-1).replace(/\\(["'\\ntr])/g,(n,r)=>r==="n"?`
218
+ `:r==="t"?" ":r==="r"?"\r":r):e}_t.extend(FC);function GU(e){const t=(e.annotations??[]).filter(r=>r.trim().startsWith("#("));if(t.length===0)return;const n=[];for(const r of t){const o=r.trim(),i=o.match(/description="([^"]*)"/);if(i){n.push(i[1]);continue}const s=o.replace(/^#\(/,"").replace(/\)\s*$/,"").trim();s&&n.push(s)}return n.length>0?n.join(`
219
+ `):void 0}function QU({given:e,value:t,onChange:n}){const r=e.name??"",o=e.type??"string",i=GU(e),s=YU(o,e.default),a=s!==void 0?`Default: ${s===""?"(empty)":s}`:void 0,l=i||a?c.jsxs(c.Fragment,{children:[i,i&&a?c.jsx("br",{}):null,a]}):void 0;if(o==="boolean"){const f=typeof t=="boolean",h=e.default?.trim()==="true",p=f?t:h;return c.jsxs(w.FormControl,{children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",children:[c.jsx(w.FormControlLabel,{control:c.jsx(w.Checkbox,{checked:p,onChange:m=>n(m.target.checked)}),label:r}),f&&c.jsx(w.IconButton,{size:"small","aria-label":"clear value",onClick:()=>n(null),edge:"end",children:c.jsx(QC,{fontSize:"small"})})]}),l&&c.jsx(w.FormHelperText,{children:l})]})}if(o==="number"){const f=typeof t=="number"?t:"",h=t!=null;return c.jsx(w.TextField,{label:r,type:"number",value:f,onChange:p=>{const m=p.target.value;n(m===""?null:Number(m))},placeholder:s,helperText:l,slotProps:{input:{endAdornment:h&&c.jsx(G1,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}if(o==="date"||o==="timestamp"||o==="timestamptz"){const f=t instanceof Date?_t.utc(t):null;return c.jsx(Xu,{dateAdapter:Bf,children:c.jsx(vu,{label:r,value:f,onChange:h=>n(h?h.toDate():null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:l},field:{clearable:!0,onClear:()=>n(null)}}})})}if(o.startsWith("array<")){const f=Array.isArray(t)?t.map(String):[];return c.jsx(w.Autocomplete,{multiple:!0,freeSolo:!0,options:[],value:f,onChange:(h,p)=>n(p.length===0?null:p),renderInput:h=>c.jsx(w.TextField,{...h,label:r,size:"small",placeholder:f.length===0?s:void 0,helperText:l}),fullWidth:!0})}const u=typeof t=="string"?t:"",d=t!=null;return c.jsx(w.TextField,{label:r,value:u,onChange:f=>n(f.target.value),placeholder:d?void 0:s??(o.startsWith("filter<")?o:void 0),helperText:l,slotProps:{input:{endAdornment:d&&c.jsx(G1,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}function G1({onClear:e}){return c.jsx(w.InputAdornment,{position:"end",children:c.jsx(w.IconButton,{size:"small","aria-label":"clear value",onClick:e,edge:"end",children:c.jsx(QC,{fontSize:"small"})})})}function XU({givens:e,values:t,onChange:n,onClearAll:r}){if(e.length===0)return null;const o=t.size>0;return c.jsxs(w.Paper,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[c.jsx(w.Typography,{variant:"subtitle2",sx:{fontWeight:600,color:"#333"},children:"Parameters"}),o&&c.jsx(w.Button,{variant:"text",size:"small",onClick:r,sx:{textTransform:"none"},children:"Reset"})]}),c.jsx(w.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:3},children:e.map(i=>c.jsx(w.Box,{children:c.jsx(QU,{given:i,value:i.name?t.get(i.name):void 0,onChange:s=>i.name&&n(i.name,s)})},i.name))})]})}const ZU=mt(c.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}));function dh(e){const{environmentName:t,packageName:n}=Ht(e.resourceUri);if(!t||!n)throw new Error("Environment and Package name must be provided for query embedding.");return JSON.stringify({...e})}function JU({embeddedQueryResult:e}){const{query:t,sourceName:n,queryName:r,resourceUri:o,height:i}=JSON.parse(e),{modelPath:s}=Ht(o);if(!s||!t&&(!r||!n)||typeof s!="string")throw new Error("Invalid embedded query result: "+e);return c.jsx(XC,{query:t,sourceName:n,queryName:r,resourceUri:o,height:i})}function XC({query:e,sourceName:t,queryName:n,resourceUri:r,height:o=400}){const{modelPath:i,environmentName:s,packageName:a,versionId:l}=Ht(r),{apiClients:u}=De.useServer();if(!s||!a)throw new Error("No environment or package name provided. A resource URI must be provided.");const{data:d,isSuccess:f,isError:h,error:p}=Xt({queryKey:[r,e,t,n],queryFn:()=>u.models.executeQueryModel(s,a,i,{query:e,sourceName:t,queryName:n,versionId:l}),...De.CHART_RESULT_QUERY_OPTIONS});return c.jsxs(c.Fragment,{children:[!f&&!h&&c.jsx(Sn,{text:"Fetching Query Results..."}),f&&c.jsx(W.Suspense,{fallback:c.jsx("div",{children:"Loading..."}),children:c.jsx(Os,{result:d.data.result,maxHeight:o,renderLogs:d.data.renderLogs})}),h&&c.jsx(kn,{context:`${s} > ${a} > ${i}`,error:p})]})}function eV({href:e,title:t,children:n,envName:r,pkgName:o,sourceDir:i,onNavigate:s}){const a=!!e&&/^[a-z][a-z0-9+.-]*:/i.test(e);if(!(!!e&&!a&&!e.startsWith("/")&&!e.startsWith("#"))||!e){const h=a&&!/^(https?|mailto|tel):/i.test(e??"");return c.jsx("a",{href:h?void 0:e,title:t,...a?{target:"_blank",rel:"noopener noreferrer"}:{},children:n})}const u=new URL(e,`https://malloy.invalid/${i}`),d=u.pathname.slice(1)+u.search+u.hash,f=`/${r}/${o}/${d}`;return c.jsx("a",{href:f,title:t,onClick:s?h=>{h.preventDefault(),s(f,h)}:void 0,children:n})}function tV({cell:e,hideCodeCellIcon:t,hideEmbeddingIcon:n,resourceUri:r,index:o,maxResultSize:i,isExecuting:s,onNavigate:a}){const[l,u]=W.useState(!1),[d,f]=W.useState(!1),[h,p]=W.useState(!1),[m,b]=W.useState(),[y,x]=W.useState(),[C,v]=W.useState(!1),[S,I]=W.useState(""),{environmentName:T,packageName:N,modelPath:O}=Ht(r),F=O&&O.includes("/")?O.slice(0,O.lastIndexOf("/")+1):"",B={overrides:{a:{component:eV,props:{envName:T,pkgName:N,sourceDir:F,onNavigate:a}}}},j=/import\s*\{([^}]+)\}\s*from\s*['"`][^'"`]+['"`]/,D=/import\s*(?:\{[^}]*\}\s*from\s*)?['"`]([^'"`]+)['"`]/,H=R=>R.split(`
220
220
  `).filter(oe=>!oe.trimStart().startsWith("##")).join(`
221
- `),_=!!e.text&&(j.test(e.text)||D.test(e.text)),L=()=>{if(!e.newSources||e.newSources.length===0)return 0;let R=[],oe="";if(e.text){const se=e.text.match(j);se&&(R=se[1].split(",").map(pe=>pe.trim()));const z=e.text.match(D);z&&(oe=z[1].trim())}for(let se=0;se<e.newSources.length;se++)try{const z=JSON.parse(e.newSources[se]);if(R.length>0&&R.includes(z.name)||oe&&oe===z.path)return se}catch{continue}return 0},$=e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:r}:void 0,K=dh({query:e.text,resourceUri:r}),{mode:G}=De.usePublisherTheme();W.useEffect(()=>{e.type==="code"&&$u(H(e.text),"malloy",G).then(R=>{b(R)})},[e,G]),W.useEffect(()=>{$u(K,"typescript",G).then(R=>{x(R)})},[K,G]);const q=()=>{const R=window.location.href;navigator.clipboard.writeText(R).then(()=>I("URL copied to clipboard!")).catch(()=>I("Failed to copy URL"))};return e.type==="markdown"&&c.jsx(De.CleanNotebookCell,{children:c.jsxs(w.Box,{sx:R=>({"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"600",color:R.palette.text.primary,marginBottom:"8px",marginTop:"16px"},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p":{color:R.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& ul, & ol":{color:R.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& li":{marginBottom:"4px"}}),children:[o===0?c.jsxs(w.Stack,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[c.jsx(wu,{options:B,children:e.text}),c.jsx(w.Tooltip,{title:"Click to copy link",children:c.jsx(Kf,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer",marginTop:"26px"},onClick:q})})]}):c.jsx(wu,{options:B,children:e.text}),c.jsx(w.Snackbar,{open:S!=="",autoHideDuration:6e3,onClose:()=>I(""),message:S})]})})||e.type==="code"&&c.jsxs(De.CleanNotebookCell,{children:[(!t||!n&&e.result||e.newSources&&e.newSources.length>0)&&c.jsx(w.Stack,{sx:{flexDirection:"column",gap:"8px",marginBottom:"2px"},children:e.newSources&&e.newSources.length>0&&c.jsx(De.CleanMetricCard,{sx:{position:"relative",padding:"0"},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[m&&c.jsx("span",{dangerouslySetInnerHTML:{__html:m},style:{fontFamily:"monospace",fontSize:"14px",flex:1,marginRight:"8px"}}),_&&c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",flexShrink:0},onClick:()=>v(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"grey.700"}})})]})})}),c.jsx(lh,{open:C,onClose:()=>v(!1),title:"Data Sources",hasValidImport:_,resourceUri:r,data:$,initialSelectedSourceIndex:L()}),c.jsxs(w.Dialog,{open:l,onClose:()=>u(!1),maxWidth:"lg",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Malloy Code",c.jsx(w.IconButton,{onClick:()=>u(!1),sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{children:c.jsx(w.Box,{sx:R=>({border:`1px solid ${R.palette.divider}`,borderRadius:"8px",padding:"16px",fontFamily:"monospace",fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:R.palette.background.paper,color:R.palette.text.primary}),children:c.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:m}})})})]}),c.jsxs(w.Dialog,{open:d,onClose:()=>f(!1),maxWidth:"lg",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Embeddable Code",c.jsx(w.IconButton,{onClick:()=>f(!1),sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{children:c.jsxs(w.Stack,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},children:[c.jsx(w.Typography,{component:"div",sx:{fontSize:"12px",fontFamily:"monospace","& .line":{textWrap:"wrap"},flex:1},dangerouslySetInnerHTML:{__html:y}}),c.jsx(w.Tooltip,{title:"Copy Embeddable Code",children:c.jsx(w.IconButton,{sx:{width:"24px",height:"24px",marginLeft:"8px",color:"text.secondary"},onClick:()=>{navigator.clipboard.writeText(K)},children:c.jsx(KU,{})})})]})})]}),c.jsx(HC,{open:h,onClose:()=>p(!1),result:e.result||"",title:"Results"}),s&&!e.result&&!_&&!(e.newSources&&e.newSources.length>0)&&c.jsx(De.CleanMetricCard,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:200},children:c.jsx(w.CircularProgress,{size:32})}),e.result&&c.jsxs(De.CleanMetricCard,{sx:{position:"relative"},children:[c.jsx(w.Box,{sx:{paddingTop:"24px"},children:c.jsx(Os,{result:e.result,maxHeight:700,maxResultSize:i})}),c.jsxs(w.Stack,{sx:{position:"absolute",top:"-12px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[!t&&c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:R=>{R.stopPropagation(),u(!0)},children:c.jsx(vb,{sx:{fontSize:"18px",color:"grey.700"}})}),c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>p(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"grey.700"}})})]})]})]})}const ZU=4;function GC({resourceUri:e,maxResultSize:t=0,retrievalFn:n,onNavigate:r}){const{apiClients:o}=De.useServer(),{environmentName:i,packageName:s,versionId:a,modelPath:l}=Ht(e),{data:u,isSuccess:d,isError:f,error:h}=Xt({queryKey:[e],queryFn:async()=>(await o.notebooks.getNotebook(i,s,l,a)).data}),[p,m]=W.useState([]),[b,y]=W.useState(!1),[x,C]=W.useState(null),v=W.useMemo(()=>u?NC(u.annotations):null,[u]),S=W.useMemo(()=>u?.notebookCells?LC(u.notebookCells):null,[u]),I=W.useMemo(()=>S?.sourceInfoMap??new Map,[S]),T=S?.modelPath??null,N=W.useMemo(()=>{const pe=new Map;if(!u?.sources)return pe;for(const J of u.sources)if(J.name&&J.filters&&J.filters.length>0){const Q=J.filters.filter(re=>!re.implicit);Q.length>0&&pe.set(J.name,Q)}return pe},[u]),O=N.size>0,F=W.useMemo(()=>{if(O&&T){const pe=[];for(const[J,Q]of N)for(const re of Q??[]){if(!re.dimension||!re.type)continue;let ne;const ae=re.dimensionType;ae==="boolean"?ne="Boolean":ae==="date"||ae==="timestamp"||ae==="timestamptz"?ne="DateMinMax":ae==="number"?ne=re.type==="equal"||re.type==="in"?"Star":"MinMax":ne={equal:"Star",in:"Star",like:"Star",greater_than:"MinMax",less_than:"MinMax"}[re.type]??"Star";const Z={equal:"Equals",in:"Equals",like:"Contains",greater_than:ne==="DateMinMax"?"After":"Greater Than",less_than:ne==="DateMinMax"?"Before":"Less Than"}[re.type],me=re.name!==re.dimension?re.name:void 0;pe.push({source:J,model:T,dimensionName:re.dimension,filterType:ne,label:me,filterName:re.name??re.dimension,defaultMatchType:Z,required:re.required??!1})}return pe}return!v||I.size===0||!T?[]:_C(I,v.filters,T)},[O,N,v,I,T]),{filterStates:B,updateFilter:j,getActiveFilters:D}=ch({dimensionSpecs:F}),H=W.useMemo(()=>D(),[B,D]),_=qC(u),{givenValues:L,updateGiven:$,clearAll:K}=WC(_);W.useMemo(()=>{const pe=new Map;for(const J of F){const Q=xo(J);pe.set(Q,J.source)}return pe},[F]);const{data:G}=uh({environment:i,package:s,dimensionSpecs:F,versionId:a,enabled:F.length>0}),q=W.useCallback(pe=>{if(pe.length===0)return;const J=re=>re instanceof Date?re.toISOString().slice(0,10):String(re),Q={};for(const re of pe){const ne=re.filterName??re.dimensionName,ae=re.value;Array.isArray(ae)?Q[ne]=ae.map(J):ae!=null&&(Q[ne]=J(ae))}return Object.keys(Q).length>0?JSON.stringify(Q):void 0},[]),R=W.useCallback(pe=>{if(pe.size===0)return;const J=re=>re instanceof Date?re.toISOString().slice(0,10):Array.isArray(re)?re.map(ne=>J(ne)):re,Q={};return pe.forEach((re,ne)=>{re!=null&&(Q[ne]=J(re))}),Object.keys(Q).length>0?JSON.stringify(Q):void 0},[]),oe=W.useCallback(async(pe=[],J=new Map)=>{if(!d||!u?.notebookCells)return;m(ne=>ne.length===0?u.notebookCells.map(ae=>({...ae})):ne.map(ae=>({...ae,result:void 0}))),y(!0),C(null);const Q=O?q(pe):void 0,re=R(J);try{const ne=[];for(let ie=0;ie<u.notebookCells.length;ie++){const Z=u.notebookCells[ie];if(Z.type==="markdown")continue;const me=ie,le=async()=>{try{const Ie=(await o.notebooks.executeNotebookCell(i,s,l,me,a,Q,void 0,re)).data,Ce=Ie.result,we=Z.newSources||Ie.newSources;m(ye=>{const ze=[...ye];return ze[me]||(ze[me]={...Z}),ze[me]={...ze[me],result:Ce,newSources:we},ze})}catch(ue){console.error(`Error executing cell ${me}:`,ue)}};ne.push(le)}const ae=[];for(const ie of ne){const Z=ie().then(()=>{ae.splice(ae.indexOf(Z),1)});ae.push(Z),ae.length>=ZU&&await Promise.race(ae)}await Promise.all(ae)}catch(ne){console.error("Error executing notebook cells:",ne),C(ne)}finally{y(!1)}},[d,u,O,q,R,i,s,l,a,o.notebooks]);W.useEffect(()=>{!d||!u?.notebookCells||oe([],new Map)},[d,u,oe]);const se=W.useRef("");W.useEffect(()=>{const pe=JSON.stringify({filters:H.map(J=>({dim:J.dimensionName,type:J.matchType,val:J.value,val2:J.value2})),givens:Array.from(L.entries()).sort(([J],[Q])=>J.localeCompare(Q)).map(([J,Q])=>[J,Q instanceof Date?Q.toISOString().slice(0,10):Q])});if(pe!==se.current){if(se.current===""&&H.length===0&&L.size===0){se.current=pe;return}b||(se.current=pe,oe(H,L))}},[H,L,b,oe]);const z=W.useCallback(pe=>J=>{j(pe,J)},[j]);return F.some(pe=>pe.filterType==="Retrieval"),c.jsx(De.CleanNotebookContainer,{children:c.jsx(De.CleanNotebookSection,{children:c.jsxs(w.Stack,{spacing:3,component:"section",children:[c.jsx(YU,{givens:_,values:L,onChange:$,onClearAll:K}),F.length>0&&G&&c.jsxs(w.Paper,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[c.jsx(w.Typography,{variant:"subtitle2",sx:{fontWeight:600,mb:2,color:"#333"},children:"Filters"}),c.jsx(w.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:3},children:F.map(pe=>{const J=xo(pe),Q=G.get(J)||[],re=B.get(J);return pe.filterType==="Retrieval"&&!n?null:c.jsx(w.Box,{children:c.jsx(RC,{spec:pe,values:Q,selection:re?.selection,onChange:z(J),retrievalFn:n})},J)})})]}),!d&&!f&&c.jsx(Sn,{text:"Fetching Notebook..."}),d&&(p.length>0?p:u?.notebookCells||[]).map((pe,J)=>c.jsx(XU,{cell:pe,index:J,resourceUri:e,maxResultSize:t,isExecuting:b,onNavigate:r},J)),f&&h.status===404&&c.jsxs(w.Typography,{variant:"body2",sx:{color:"text.secondary"},children:[c.jsx("code",{children:`${i} > ${s} > ${l}`})," ","not found."]}),f&&h.status!==404&&c.jsx(kn,{error:h,context:`${i} > ${s} > ${l}`}),x&&c.jsx(kn,{error:{message:x.message,status:500,name:"ExecutionError"},context:"Notebook Execution"})]})})})}const QC=mt(c.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),JU="publisher:resize";function eV(e){return typeof e=="object"&&e!==null&&e.type===JU&&typeof e.height=="number"}function XC(e){return e.replace(/\/api\/v0\/?$/,"")}function ZC({server:e,environmentName:t,packageName:n,path:r}){const o=r.startsWith("public/")?r.slice(7):r;return`${XC(e)}/environments/${encodeURIComponent(t)}/packages/${encodeURIComponent(n)}/`+o}function Ca({type:e,size:t=18,sx:n,...r}){return c.jsxs(Ou,{...r,viewBox:"0 0 24 24",sx:{width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...n},children:[e==="report"&&c.jsx(tV,{}),e==="model"&&c.jsx(nV,{}),e==="data"&&c.jsx(rV,{}),e==="materialization"&&c.jsx(oV,{}),e==="page"&&c.jsx(iV,{})]})}function tV(){return c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14 3 H6 a2 2 0 0 0 -2 2 v14 a2 2 0 0 0 2 2 h12 a2 2 0 0 0 2 -2 V9 z"}),c.jsx("path",{d:"M14 3 v4 a2 2 0 0 0 2 2 h4"}),c.jsx("path",{d:"M8 17 v-3"}),c.jsx("path",{d:"M12 17 v-6"}),c.jsx("path",{d:"M16 17 v-4"})]})}function nV(){return c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3 L4 7 v10 l8 4 l8 -4 V7 z"}),c.jsx("path",{d:"M4 7 l8 4 l8 -4"}),c.jsx("path",{d:"M12 11 v10"})]})}function rV(){return c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),c.jsx("path",{d:"M3.5 9.5 H20.5"}),c.jsx("path",{d:"M9.5 3.5 V20.5"})]})}function oV(){return c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3 L21 7.5 L12 12 L3 7.5 Z"}),c.jsx("path",{d:"M3 12 L12 16.5 L21 12"}),c.jsx("path",{d:"M3 16.5 L12 21 L21 16.5"})]})}function iV(){return c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),c.jsx("path",{d:"M3.5 9.5 H20.5"}),c.jsx("path",{d:"M7 13.5 H17"}),c.jsx("path",{d:"M7 16.5 H13"})]})}const Q1="README.malloynb";function sV({onClickPackageFile:e,resourceUri:t,retrievalFn:n}){const{apiClients:r,server:o}=De.useServer(),i=e??(O=>{window.location.href=O}),{environmentName:s,packageName:a,versionId:l}=Ht(t),[u,d]=W.useState(null),f=Xt({queryKey:["package",s,a,l],queryFn:()=>r.packages.getPackage(s,a,l,!1)}),h=Xt({queryKey:["notebooks",s,a,l],queryFn:()=>r.notebooks.listNotebooks(s,a,l)}),p=Xt({queryKey:["models",s,a,l],queryFn:()=>r.models.listModels(s,a,l)}),m=Xt({queryKey:["databases",s,a,l],queryFn:()=>r.databases.listDatabases(s,a,l)}),y=Xt({queryKey:["pages",s,a],queryFn:async()=>{try{return await r.pages.listPages(s,a)}catch(O){const F=O?.response?.status;if(F===404||F===void 0)return{data:[]};throw O}}}).data?.data??[],x=(h.data?.data??[]).slice().sort((O,F)=>O.path.localeCompare(F.path)),C=(p.data?.data??[]).slice().sort((O,F)=>O.path.localeCompare(F.path)),v=(m.data?.data??[]).slice().sort((O,F)=>O.path.localeCompare(F.path)),S=f.data?.data?.description??"",I=x.some(O=>O.path===Q1),T=Cl({environmentName:s,packageName:a,versionId:l,modelPath:Q1}),N=!h.isSuccess&&!h.isError;return f.isError?c.jsx(kn,{error:f.error,context:`${s} > ${a}`}):c.jsxs(w.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Link,{onClick:O=>i(`/${s}/`,O),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[c.jsx(Xx,{sx:{fontSize:18}}),"Back to ",s]}),c.jsx(w.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:a}),S&&c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:S})]}),N&&c.jsx(Sn,{text:"Loading package..."}),!N&&c.jsxs(c.Fragment,{children:[c.jsxs(Ea,{title:"Governed Reports",count:x.length,children:[x.map(O=>c.jsx(va,{icon:c.jsx(Ca,{type:"report"}),tint:De.MALLOY_BRAND.teal,label:O.path,onClick:F=>i(`/${s}/${a}/${O.path}`,F)},O.path)),x.length===0&&c.jsx(Wd,{label:"No notebooks"})]}),y.length>0&&c.jsx(Ea,{title:"Pages",count:y.length,children:y.map(O=>{const F=!!O.title&&O.title!==O.path,B=`${XC(o)}${O.resource}`;return c.jsx(va,{icon:c.jsx(Ca,{type:"page"}),tint:De.MALLOY_BRAND.teal,label:F?O.title:O.path,rightLabel:F?O.path:void 0,onClick:j=>{e?e(`/${s}/${a}/pages/${O.path}`,j):j&&(j.metaKey||j.ctrlKey)?window.open(B,"_blank"):window.location.href=B},trailingAction:c.jsx(w.Tooltip,{title:"Open standalone in new tab",children:c.jsx(w.IconButton,{size:"small",href:B,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",onClick:j=>j.stopPropagation(),sx:{color:"text.secondary"},children:c.jsx(QC,{fontSize:"small"})})})},O.path)})}),c.jsxs(Ea,{title:"Semantic Models",count:C.length,children:[C.map(O=>c.jsx(va,{icon:c.jsx(Ca,{type:"model"}),tint:De.MALLOY_BRAND.orange,label:O.path,onClick:F=>i(`/${s}/${a}/${O.path}`,F)},O.path)),C.length===0&&c.jsx(Wd,{label:"No models"})]}),c.jsxs(Ea,{title:"Package Data",count:v.length,children:[v.map(O=>c.jsx(va,{icon:c.jsx(Ca,{type:"data"}),tint:De.MALLOY_BRAND.darkBlue,label:O.path,rightLabel:O.info?aV(O.info.rowCount):"Unreadable",onClick:()=>d(O)},O.path)),v.length===0&&c.jsx(Wd,{label:"No data files"})]}),c.jsx(Ea,{title:"Materializations",children:c.jsx(va,{icon:c.jsx(Ca,{type:"materialization"}),tint:De.MALLOY_BRAND.teal,label:"Materializations",onClick:O=>i(`/${s}/${a}/materializations`,O)})}),I&&c.jsx(w.Box,{sx:{mt:6},children:c.jsx(GC,{resourceUri:T,retrievalFn:n,onNavigate:i})})]}),c.jsxs(w.Dialog,{open:u!==null,onClose:()=>d(null),maxWidth:"sm",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pr:6},children:[u?.path,c.jsx(w.IconButton,{"aria-label":"close",onClick:()=>d(null),sx:{position:"absolute",right:8,top:8},children:c.jsx(Fr,{fontSize:"small"})})]}),c.jsxs(w.DialogContent,{children:[u?.error&&c.jsx(w.Typography,{variant:"body2",color:"error",children:u.error}),u?.info?.columns&&c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"Column"}),c.jsx(w.TableCell,{children:"Type"})]})}),c.jsx(w.TableBody,{children:u.info.columns.map(O=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{component:"th",scope:"row",children:O.name}),c.jsx(w.TableCell,{children:O.type})]},O.name))})]})]})]})]})}function Ea({title:e,count:t,children:n}){return c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:e}),t!==void 0&&c.jsxs(w.Typography,{variant:"caption",color:"text.secondary",children:["(",t,")"]})]}),c.jsx(w.Box,{children:n})]})}function va({icon:e,tint:t,label:n,rightLabel:r,onClick:o,trailingAction:i}){const s=!!o,a=l=>{o&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),o(l))};return c.jsxs(w.Box,{onClick:o,onKeyDown:s?a:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,sx:l=>({display:"flex",alignItems:"center",gap:1.5,py:1,px:1,mx:-1,cursor:s?"pointer":"default",borderRadius:1.5,transition:"background-color 0.1s","&:hover":s?{backgroundColor:l.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}:void 0,"&:focus-visible":s?{outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}:void 0}),children:[c.jsx(w.Box,{sx:{width:32,height:32,borderRadius:1,bgcolor:t,color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e}),c.jsx(w.Typography,{variant:"body2",sx:{fontFamily:De.MONO_FONT_FAMILY,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),r&&c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{flexShrink:0},children:r}),i&&c.jsx(w.Box,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:i})]})}function Wd({label:e}){return c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:e})}function aV(e){return e>=1e9?`${(e/1e9).toFixed(1)} B rows`:e>=1e6?`${(e/1e6).toFixed(1)} M rows`:e>=1e3?`${(e/1e3).toFixed(1)} K rows`:`${e} rows`}function lV(e){return Ge("MuiCollapse",e)}We("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const uV=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Ke(r,lV,n)},cV=fe("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(ft(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),dV=fe("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),fV=fe("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),sl=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiCollapse"}),{addEndListener:o,children:i,className:s,collapsedSize:a="0px",component:l,easing:u,in:d,onEnter:f,onEntered:h,onEntering:p,onExit:m,onExited:b,onExiting:y,orientation:x="vertical",style:C,timeout:v=pb.standard,TransitionComponent:S=Dr,...I}=r,T={...r,orientation:x,collapsedSize:a},N=uV(T),O=Lo(),F=Sc(),B=M.useRef(null),j=M.useRef(),D=typeof a=="number"?`${a}px`:a,H=x==="horizontal",_=H?"width":"height",L=M.useRef(null),$=vt(n,L),K=Q=>re=>{if(Q){const ne=L.current;re===void 0?Q(ne):Q(ne,re)}},G=()=>B.current?B.current[H?"clientWidth":"clientHeight"]:0,q=K((Q,re)=>{B.current&&H&&(B.current.style.position="absolute"),Q.style[_]=D,f&&f(Q,re)}),R=K((Q,re)=>{const ne=G();B.current&&H&&(B.current.style.position="");const{duration:ae,easing:ie}=ms({style:C,timeout:v,easing:u},{mode:"enter"});if(v==="auto"){const Z=O.transitions.getAutoHeightDuration(ne);Q.style.transitionDuration=`${Z}ms`,j.current=Z}else Q.style.transitionDuration=typeof ae=="string"?ae:`${ae}ms`;Q.style[_]=`${ne}px`,Q.style.transitionTimingFunction=ie,p&&p(Q,re)}),oe=K((Q,re)=>{Q.style[_]="auto",h&&h(Q,re)}),se=K(Q=>{Q.style[_]=`${G()}px`,m&&m(Q)}),z=K(b),pe=K(Q=>{const re=G(),{duration:ne,easing:ae}=ms({style:C,timeout:v,easing:u},{mode:"exit"});if(v==="auto"){const ie=O.transitions.getAutoHeightDuration(re);Q.style.transitionDuration=`${ie}ms`,j.current=ie}else Q.style.transitionDuration=typeof ne=="string"?ne:`${ne}ms`;Q.style[_]=D,Q.style.transitionTimingFunction=ae,y&&y(Q)}),J=Q=>{v==="auto"&&F.start(j.current||0,Q),o&&o(L.current,Q)};return c.jsx(S,{in:d,onEnter:q,onEntered:oe,onEntering:R,onExit:se,onExited:z,onExiting:pe,addEndListener:J,nodeRef:L,timeout:v==="auto"?null:v,...I,children:(Q,{ownerState:re,...ne})=>c.jsx(cV,{as:l,className:Ue(N.root,s,{entered:N.entered,exited:!d&&D==="0px"&&N.hidden}[Q]),style:{[H?"minWidth":"minHeight"]:D,...C},ref:$,ownerState:{...T,state:Q},...ne,children:c.jsx(dV,{ownerState:{...T,state:Q},className:N.wrapper,ref:B,children:c.jsx(fV,{ownerState:{...T,state:Q},className:N.wrapperInner,children:i})})})})});sl&&(sl.muiSupportAuto=!0);function JC(e){return Kt}const eE=M.createContext(null);function pV(e){const{value:t,children:n}=e;return c.jsx(eE.Provider,{value:t,children:t.wrapRoot({children:n,instance:t.instance})})}const Si=()=>{const e=M.useContext(eE);if(e==null)throw new Error(["MUI X: Could not find the Tree View context.","It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.","This can also happen if you are bundling multiple versions of the Tree View."].join(`
222
- `));return e},hV=({props:e})=>{const{instance:t}=Si(),{label:n,itemId:r}=e,[o,i]=M.useState(n),s=t.isItemBeingEdited(r);return M.useEffect(()=>{s||i(n)},[s,n]),{propsEnhancers:{labelInput:({externalEventHandlers:a,interactions:l})=>t.isItemEditable(r)?{value:o??"","data-element":"labelInput",onChange:p=>{a.onChange?.(p),i(p.target.value)},onKeyDown:p=>{if(a.onKeyDown?.(p),p.defaultMuiPrevented)return;const m=p.target;p.key==="Enter"&&m.value?l.handleSaveItemLabel(p,m.value):p.key==="Escape"&&l.handleCancelItemLabelEditing(p)},onBlur:p=>{a.onBlur?.(p),!p.defaultMuiPrevented&&p.target.value&&l.handleSaveItemLabel(p,p.target.value)},autoFocus:!0,type:"text"}:{}}}},xr=({instance:e,state:t,setState:n,params:r})=>{const o=M.useRef(t.editedItemId),i=f=>o.current===f,s=f=>{n(h=>Y({},h,{editedItemId:f})),o.current=f},a=f=>f===t.editedItemId,l=!!r.isItemEditable,u=f=>{if(f==null||!l)return!1;const h=e.getItem(f);return h?typeof r.isItemEditable=="function"?r.isItemEditable(h):!!r.isItemEditable:!1},d=(f,h)=>{if(!h)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","The label of an item cannot be empty.",f].join(`
223
- `));n(p=>{const m=p.items.itemMetaMap[f];return m.label!==h?Y({},p,{items:Y({},p.items,{itemMetaMap:Y({},p.items.itemMetaMap,{[f]:Y({},m,{label:h})})})}):p}),r.onItemLabelChange&&r.onItemLabelChange(f,h)};return{instance:{setEditedItemId:s,isItemBeingEdited:a,updateItemLabel:d,isItemEditable:u,isTreeViewEditable:l,isItemBeingEditedRef:i},publicAPI:{updateItemLabel:d}}};xr.itemPlugin=hV;xr.getDefaultizedParams=({params:e,experimentalFeatures:t})=>{const n=t?.labelEditing;return Y({},e,{isItemEditable:n?e.isItemEditable??!1:!1})};xr.getInitialState=()=>({editedItemId:null});xr.params={onItemLabelChange:!0,isItemEditable:!0};const ui=(e,t)=>e.getAvailablePlugins().has(t),tE=e=>Array.isArray(e)?e.length>0&&e.some(tE):!!e,mV=({itemId:e,children:t})=>{const{instance:n,selection:{multiSelect:r},publicAPI:o}=Si(),i={expandable:tE(t),expanded:n.isItemExpanded(e),focused:n.isItemFocused(e),selected:n.isItemSelected(e),disabled:n.isItemDisabled(e),editing:n?.isItemBeingEdited?n?.isItemBeingEdited(e):!1,editable:n.isItemEditable?n.isItemEditable(e):!1},s=p=>{if(i.disabled)return;i.focused||n.focusItem(p,e);const m=r&&(p.shiftKey||p.ctrlKey||p.metaKey);i.expandable&&!(m&&n.isItemExpanded(e))&&n.toggleItemExpansion(p,e)},a=p=>{if(i.disabled)return;!i.focused&&!i.editing&&n.focusItem(p,e),r&&(p.shiftKey||p.ctrlKey||p.metaKey)?p.shiftKey?n.expandSelectionRange(p,e):n.selectItem({event:p,itemId:e,keepExistingSelection:!0}):n.selectItem({event:p,itemId:e,shouldBeSelected:!0})},l=p=>{const m=p.nativeEvent.shiftKey;r&&m?n.expandSelectionRange(p,e):n.selectItem({event:p,itemId:e,keepExistingSelection:r,shouldBeSelected:p.target.checked})},u=()=>{ui(n,xr)&&n.isItemEditable(e)&&(n.isItemBeingEdited(e)?n.setEditedItemId(null):n.setEditedItemId(e))};return{interactions:{handleExpansion:s,handleSelection:a,handleCheckboxSelection:l,toggleItemEditing:u,handleSaveItemLabel:(p,m)=>{ui(n,xr)&&n.isItemBeingEditedRef(e)&&(n.updateItemLabel(e,m),u(),n.focusItem(p,e))},handleCancelItemLabelEditing:p=>{ui(n,xr)&&n.isItemBeingEditedRef(e)&&(u(),n.focusItem(p,e))}},status:i,publicAPI:o}},fh=M.createContext(()=>-1),nE=(e,t)=>{let n=t.length-1;for(;n>=0&&!e.isItemNavigable(t[n]);)n-=1;if(n!==-1)return t[n]},rE=(e,t)=>{const n=e.getItemMeta(t),r=e.getItemOrderedChildrenIds(n.parentId),o=e.getItemIndex(t);if(o===0)return n.parentId;let i=o-1;for(;!e.isItemNavigable(r[i])&&i>=0;)i-=1;if(i===-1)return n.parentId==null?null:rE(e,n.parentId);let s=r[i],a=nE(e,e.getItemOrderedChildrenIds(s));for(;e.isItemExpanded(s)&&a!=null;)s=a,a=e.getItemOrderedChildrenIds(s).find(e.isItemNavigable);return s},Su=(e,t)=>{if(e.isItemExpanded(t)){const r=e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);if(r!=null)return r}let n=e.getItemMeta(t);for(;n!=null;){const r=e.getItemOrderedChildrenIds(n.parentId),o=e.getItemIndex(n.id);if(o<r.length-1){let i=o+1;for(;!e.isItemNavigable(r[i])&&i<r.length-1;)i+=1;if(e.isItemNavigable(r[i]))return r[i]}n=e.getItemMeta(n.parentId)}return null},oE=e=>{let t=null;for(;t==null||e.isItemExpanded(t);){const n=e.getItemOrderedChildrenIds(t),r=nE(e,n);if(r==null)return t;t=r}return t},al=e=>e.getItemOrderedChildrenIds(null).find(e.isItemNavigable),iE=(e,t,n)=>{if(t===n)return[t,n];const r=e.getItemMeta(t),o=e.getItemMeta(n);if(r.parentId===o.id||o.parentId===r.id)return o.parentId===r.id?[r.id,o.id]:[o.id,r.id];const i=[r.id],s=[o.id];let a=r.parentId,l=o.parentId,u=s.indexOf(a)!==-1,d=i.indexOf(l)!==-1,f=!0,h=!0;for(;!d&&!u;)f&&(i.push(a),u=s.indexOf(a)!==-1,f=a!==null,!u&&f&&(a=e.getItemMeta(a).parentId)),h&&!u&&(s.push(l),d=i.indexOf(l)!==-1,h=l!==null,!d&&h&&(l=e.getItemMeta(l).parentId));const p=u?a:l,m=e.getItemOrderedChildrenIds(p),b=i[i.indexOf(p)-1],y=s[s.indexOf(p)-1];return m.indexOf(b)<m.indexOf(y)?[t,n]:[n,t]},gV=(e,t,n)=>{const r=l=>{if(e.isItemExpandable(l)&&e.isItemExpanded(l))return e.getItemOrderedChildrenIds(l)[0];let u=e.getItemMeta(l);for(;u!=null;){const d=e.getItemOrderedChildrenIds(u.parentId),f=e.getItemIndex(u.id);if(f<d.length-1)return d[f+1];u=e.getItemMeta(u.parentId)}throw new Error("Invalid range")},[o,i]=iE(e,t,n),s=[o];let a=o;for(;a!==i;)a=r(a),e.isItemDisabled(a)||s.push(a);return s},bV=e=>{let t=al(e);const n=[];for(;t!=null;)n.push(t),t=Su(e,t);return n},ll=(e,t)=>t!==e.closest('*[role="treeitem"]');let X1=0;const yV=()=>(X1+=1,`mui-tree-view-${X1}`),ph=({id:e,treeId:t="",itemId:n})=>e??`${t}-${n}`,xV=e=>{const{runItemPlugins:t,items:{onItemClick:n,disabledItemsFocusable:r,indentationAtItemLevel:o},selection:{disableSelection:i,checkboxSelection:s},expansion:{expansionTrigger:a},treeId:l,instance:u,publicAPI:d}=Si(),f=M.useContext(fh),{id:h,itemId:p,label:m,children:b,rootRef:y}=e,{rootRef:x,contentRef:C,propsEnhancers:v}=t(e),{interactions:S,status:I}=mV({itemId:p,children:b}),T=M.useRef(null),N=M.useRef(null),O=vt(y,x,T),F=vt(C,N),B=M.useRef(null),j=ph({itemId:p,treeId:l,id:h}),D=u.canItemBeTabbed(p)?0:-1,H={rootRefObject:T,contentRefObject:N,interactions:S},_=ie=>Z=>{if(ie.onFocus?.(Z),Z.defaultMuiPrevented)return;const me=!I.disabled||r;!I.focused&&me&&Z.currentTarget===Z.target&&u.focusItem(Z,p)},L=ie=>Z=>{if(ie.onBlur?.(Z),Z.defaultMuiPrevented)return;const me=u.getItemDOMElement(p);I.editing||Z.relatedTarget&&ll(Z.relatedTarget,me)&&(Z.target&&Z.target?.dataset?.element==="labelInput"&&ll(Z.target,me)||Z.relatedTarget?.dataset?.element==="labelInput")||u.removeFocusedItem()},$=ie=>Z=>{ie.onKeyDown?.(Z),!(Z.defaultMuiPrevented||Z.target?.dataset?.element==="labelInput")&&u.handleItemKeyDown(Z,p)},K=ie=>Z=>{ie.onDoubleClick?.(Z),!Z.defaultMuiPrevented&&S.toggleItemEditing()},G=ie=>Z=>{ie.onClick?.(Z),n?.(Z,p),!(Z.defaultMuiPrevented||B.current?.contains(Z.target))&&(a==="content"&&S.handleExpansion(Z),s||S.handleSelection(Z))},q=ie=>Z=>{ie.onMouseDown?.(Z),!Z.defaultMuiPrevented&&(Z.shiftKey||Z.ctrlKey||Z.metaKey||I.disabled)&&Z.preventDefault()},R=ie=>Z=>{ie.onChange?.(Z),!Z.defaultMuiPrevented&&(i||I.disabled||S.handleCheckboxSelection(Z))},oe=ie=>Z=>{ie.onClick?.(Z),!Z.defaultMuiPrevented&&a==="iconContainer"&&S.handleExpansion(Z)};return{getRootProps:(ie={})=>{const Z=Y({},Ln(e),Ln(ie));let me;I.selected?me=!0:i||I.disabled?me=void 0:me=!1;const le=Y({},Z,{ref:O,role:"treeitem",tabIndex:D,id:j,"aria-expanded":I.expandable?I.expanded:void 0,"aria-selected":me,"aria-disabled":I.disabled||void 0},ie,{onFocus:_(Z),onBlur:L(Z),onKeyDown:$(Z)});o&&(le.style={"--TreeView-itemDepth":typeof f=="function"?f(p):f});const ue=v.root?.(Y({},H,{externalEventHandlers:Z}))??{};return Y({},le,ue)},getContentProps:(ie={})=>{const Z=Ln(ie),me=Y({},Z,ie,{ref:F,onClick:G(Z),onMouseDown:q(Z),status:I});o&&(me.indentationAtItemLevel=!0);const le=v.content?.(Y({},H,{externalEventHandlers:Z}))??{};return Y({},me,le)},getGroupTransitionProps:(ie={})=>{const Z=Ln(ie),me=Y({},Z,{unmountOnExit:!0,component:"ul",role:"group",in:I.expanded,children:b},ie);return o&&(me.indentationAtItemLevel=!0),me},getIconContainerProps:(ie={})=>{const Z=Ln(ie);return Y({},Z,ie,{onClick:oe(Z)})},getCheckboxProps:(ie={})=>{const Z=Ln(ie);return Y({},Z,{visible:s,ref:B,checked:I.selected,disabled:i||I.disabled,tabIndex:-1},ie,{onChange:R(Z)})},getLabelProps:(ie={})=>{const Z=Y({},Ln(ie)),me=Y({},Z,{children:m},ie,{onDoubleClick:K(Z)});return u.isTreeViewEditable&&(me.editable=I.editable),me},getLabelInputProps:(ie={})=>{const Z=Ln(ie),me=v.labelInput?.({rootRefObject:T,contentRefObject:N,externalEventHandlers:Z,interactions:S})??{};return Y({},ie,me)},getDragAndDropOverlayProps:(ie={})=>{const Z=Ln(ie),me=v.dragAndDropOverlay?.(Y({},H,{externalEventHandlers:Z}))??{};return Y({},ie,me)},rootRef:O,status:I,publicAPI:d}},CV=xV;function sE(e){const{instance:t,items:{onItemClick:n},selection:{multiSelect:r,checkboxSelection:o,disableSelection:i},expansion:{expansionTrigger:s}}=Si(),a=t.isItemExpandable(e),l=t.isItemExpanded(e),u=t.isItemFocused(e),d=t.isItemSelected(e),f=t.isItemDisabled(e),h=t?.isItemBeingEdited?t?.isItemBeingEdited(e):!1,p=t.isItemEditable?t.isItemEditable(e):!1,m=I=>{if(!f){u||t.focusItem(I,e);const T=r&&(I.shiftKey||I.ctrlKey||I.metaKey);a&&!(T&&t.isItemExpanded(e))&&t.toggleItemExpansion(I,e)}},b=I=>{f||(!u&&!h&&t.focusItem(I,e),r&&(I.shiftKey||I.ctrlKey||I.metaKey)?I.shiftKey?t.expandSelectionRange(I,e):t.selectItem({event:I,itemId:e,keepExistingSelection:!0}):t.selectItem({event:I,itemId:e,shouldBeSelected:!0}))},y=I=>{if(i||f)return;const T=I.nativeEvent.shiftKey;r&&T?t.expandSelectionRange(I,e):t.selectItem({event:I,itemId:e,keepExistingSelection:r,shouldBeSelected:I.target.checked})},x=I=>{(I.shiftKey||I.ctrlKey||I.metaKey||f)&&I.preventDefault()},C=()=>{ui(t,xr)&&t.isItemEditable(e)&&(t.isItemBeingEdited(e)?t.setEditedItemId(null):t.setEditedItemId(e))};return{disabled:f,expanded:l,selected:d,focused:u,editable:p,editing:h,disableSelection:i,checkboxSelection:o,handleExpansion:m,handleSelection:b,handleCheckboxSelection:y,handleContentClick:n,preventSelection:x,expansionTrigger:s,toggleItemEditing:C,handleSaveItemLabel:(I,T)=>{ui(t,xr)&&t.isItemBeingEditedRef(e)&&(t.updateItemLabel(e,T),C(),t.focusItem(I,e))},handleCancelItemLabelEditing:I=>{ui(t,xr)&&t.isItemBeingEditedRef(e)&&(C(),t.focusItem(I,e))}}}const EV=fe("div",{name:"MuiTreeItem2DragAndDropOverlay",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Ot.shouldForwardProp(e)&&e!=="action"})(({theme:e})=>({position:"absolute",left:0,display:"flex",top:0,bottom:0,right:0,pointerEvents:"none",variants:[{props:{action:"make-child"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderRadius:e.shape.borderRadius,backgroundColor:e.vars?`rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})`:Ot.alpha(e.palette.primary.dark,e.palette.action.focusOpacity)}},{props:{action:"reorder-above"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderTop:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"reorder-below"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"move-to-parent"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}}]}));function vV(e){return e.action==null?null:c.jsx(EV,Y({},e))}const TV=fe("input",{name:"MuiTreeItem2",slot:"LabelInput",overridesResolver:(e,t)=>t.labelInput})(({theme:e})=>Y({},e.typography.body1,{width:"100%",backgroundColor:e.palette.background.paper,borderRadius:e.shape.borderRadius,border:"none",padding:"0 2px",boxSizing:"border-box","&:focus":{outline:`1px solid ${e.palette.primary.main}`}})),SV=["classes","className","displayIcon","expansionIcon","icon","label","itemId","onClick","onMouseDown","dragAndDropOverlayProps","labelInputProps"],aE=M.forwardRef(function(t,n){const{classes:r,className:o,displayIcon:i,expansionIcon:s,icon:a,label:l,itemId:u,onClick:d,onMouseDown:f,dragAndDropOverlayProps:h,labelInputProps:p}=t,m=Ze(t,SV),{disabled:b,expanded:y,selected:x,focused:C,editing:v,editable:S,disableSelection:I,checkboxSelection:T,handleExpansion:N,handleSelection:O,handleCheckboxSelection:F,handleContentClick:B,preventSelection:j,expansionTrigger:D,toggleItemEditing:H}=sE(u),_=a||s||i,L=M.useRef(null),$=q=>{j(q),f&&f(q)},K=q=>{B?.(q,u),!L.current?.contains(q.target)&&(D==="content"&&N(q),T||O(q),d&&d(q))},G=q=>{q.defaultMuiPrevented||H()};return c.jsxs("div",Y({},m,{className:Ue(r.root,o,y&&r.expanded,x&&r.selected,C&&r.focused,b&&r.disabled,v&&r.editing,S&&r.editable),onClick:K,onMouseDown:$,ref:n,children:[c.jsx("div",{className:r.iconContainer,children:_}),T&&c.jsx(Pp,{className:r.checkbox,checked:x,onChange:F,disabled:b||I,ref:L,tabIndex:-1}),v?c.jsx(TV,Y({},p,{className:r.labelInput})):c.jsx("div",Y({className:r.label},S&&{onDoubleClick:G},{children:l})),h&&c.jsx(vV,Y({},h))]}))});function kV(e){return Ge("MuiTreeItem",e)}const co=We("MuiTreeItem",["root","groupTransition","content","expanded","selected","focused","disabled","iconContainer","label","checkbox","labelInput","editable","editing","dragAndDropOverlay"]),lE=mt(c.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),uE=mt(c.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}));function hh(e){const{children:t,itemId:n}=e,{wrapItem:r,instance:o}=Si();return r({children:t,itemId:n,instance:o})}hh.propTypes={children:Ee.node,itemId:Ee.string.isRequired};const wV=["children","className","slots","slotProps","ContentComponent","ContentProps","itemId","id","label","onClick","onMouseDown","onFocus","onBlur","onKeyDown"],DV=["ownerState"],IV=["ownerState"],AV=["ownerState"],OV=JC(),MV=e=>{const{classes:t}=e;return Ke({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],checkbox:["checkbox"],label:["label"],labelInput:["labelInput"],editing:["editing"],editable:["editable"],groupTransition:["groupTransition"]},kV,t)},PV=fe("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),RV=fe(aE,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${co.iconContainer}`]:t.iconContainer},t.label&&{[`& .${co.label}`]:t.label}],shouldForwardProp:e=>No(e)&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${co.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${co.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${co.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${co.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${co.iconContainer}`]:{width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${co.label}`]:Y({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1),[`& .${co.checkbox}`]:{padding:0},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}}]})),NV=fe(sl,{name:"MuiTreeItem",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>No(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]}),FV=M.forwardRef(function(t,n){const{icons:r,runItemPlugins:o,items:{disabledItemsFocusable:i,indentationAtItemLevel:s},selection:{disableSelection:a},expansion:{expansionTrigger:l},treeId:u,instance:d}=Si(),f=M.useContext(fh),h=OV({props:t,name:"MuiTreeItem"}),{children:p,className:m,slots:b,slotProps:y,ContentComponent:x=aE,ContentProps:C,itemId:v,id:S,label:I,onClick:T,onMouseDown:N,onBlur:O,onKeyDown:F}=h,B=Ze(h,wV),{expanded:j,focused:D,selected:H,disabled:_,editing:L,handleExpansion:$,handleCancelItemLabelEditing:K,handleSaveItemLabel:G}=sE(v),{contentRef:q,rootRef:R,propsEnhancers:oe}=o(h),se=M.useRef(null),z=M.useRef(null),pe=vt(n,R,se),J=vt(C?.ref,q,z),Q={expandIcon:b?.expandIcon??r.slots.expandIcon??lE,collapseIcon:b?.collapseIcon??r.slots.collapseIcon??uE,endIcon:b?.endIcon??r.slots.endIcon,icon:b?.icon,groupTransition:b?.groupTransition},re=Oe=>Array.isArray(Oe)?Oe.length>0&&Oe.some(re):!!Oe,ne=re(p),ae=Y({},h,{expanded:j,focused:D,selected:H,disabled:_,indentationAtItemLevel:s}),ie=MV(ae),Z=Q.groupTransition??void 0,me=Et({elementType:Z,ownerState:{},externalSlotProps:y?.groupTransition,additionalProps:Y({unmountOnExit:!0,in:j,component:"ul",role:"group"},s?{indentationAtItemLevel:!0}:{}),className:ie.groupTransition}),le=Oe=>{l==="iconContainer"&&$(Oe)},ue=j?Q.collapseIcon:Q.expandIcon,Ie=Et({elementType:ue,ownerState:{},externalSlotProps:Oe=>j?Y({},br(r.slotProps.collapseIcon,Oe),br(y?.collapseIcon,Oe)):Y({},br(r.slotProps.expandIcon,Oe),br(y?.expandIcon,Oe)),additionalProps:{onClick:le}}),Ce=Ze(Ie,DV),we=ne&&ue?c.jsx(ue,Y({},Ce)):null,ye=ne?void 0:Q.endIcon,ze=Et({elementType:ye,ownerState:{},externalSlotProps:Oe=>ne?{}:Y({},br(r.slotProps.endIcon,Oe),br(y?.endIcon,Oe))}),Ne=Ze(ze,IV),nt=ye?c.jsx(ye,Y({},Ne)):null,_e=Q.icon,Bt=Et({elementType:_e,ownerState:{},externalSlotProps:y?.icon}),yt=Ze(Bt,AV),ot=_e?c.jsx(_e,Y({},yt)):null;let xe;H?xe=!0:a||_?xe=void 0:xe=!1;function Pe(Oe){!D&&(!_||i)&&Oe.currentTarget===Oe.target&&d.focusItem(Oe,v)}function qe(Oe){O?.(Oe),!(L||Oe.relatedTarget&&ll(Oe.relatedTarget,se.current)&&(Oe.target&&Oe.target?.dataset?.element==="labelInput"&&ll(Oe.target,se.current)||Oe.relatedTarget?.dataset?.element==="labelInput"))&&d.removeFocusedItem()}const Je=Oe=>{F?.(Oe),Oe.target?.dataset?.element!=="labelInput"&&d.handleItemKeyDown(Oe,v)},Xe=ph({itemId:v,treeId:u,id:S}),Re=d.canItemBeTabbed(v)?0:-1,ct={rootRefObject:se,contentRefObject:z,interactions:{handleSaveItemLabel:G,handleCancelItemLabelEditing:K}},lt=oe.root?.(Y({},ct,{externalEventHandlers:Ln(B)}))??{},Mt=oe.content?.(Y({},ct,{externalEventHandlers:Ln(C)}))??{},be=oe.dragAndDropOverlay?.(Y({},ct,{externalEventHandlers:{}}))??{},Ae=oe.labelInput?.(Y({},ct,{externalEventHandlers:{}}))??{};return c.jsx(hh,{itemId:v,children:c.jsxs(PV,Y({className:Ue(ie.root,m),role:"treeitem","aria-expanded":ne?j:void 0,"aria-selected":xe,"aria-disabled":_||void 0,id:Xe,tabIndex:Re},B,{ownerState:ae,onFocus:Pe,onBlur:qe,onKeyDown:Je,ref:pe,style:s?Y({},B.style,{"--TreeView-itemDepth":typeof f=="function"?f(v):f}):B.style},lt,{children:[c.jsx(RV,Y({as:x,classes:{root:ie.content,expanded:ie.expanded,selected:ie.selected,focused:ie.focused,disabled:ie.disabled,editable:ie.editable,editing:ie.editing,iconContainer:ie.iconContainer,label:ie.label,labelInput:ie.labelInput,checkbox:ie.checkbox},label:I,itemId:v,onClick:T,onMouseDown:N,icon:ot,expansionIcon:we,displayIcon:nt,ownerState:ae},C,Mt,be.action==null?{}:{dragAndDropOverlayProps:be},Ae.value==null?{}:{labelInputProps:Ae},{ref:J})),p&&c.jsx(NV,Y({as:Z},me,{children:p}))]}))})});function LV(e){const{slots:t,slotProps:n,status:r}=e,o=Si(),i=Y({},o.icons.slots,{expandIcon:o.icons.slots.expandIcon??lE,collapseIcon:o.icons.slots.collapseIcon??uE}),s=o.icons.slotProps;let a;t?.icon?a="icon":r.expandable?r.expanded?a="collapseIcon":a="expandIcon":a="endIcon";const l=t?.[a]??i[a],u=Et({elementType:l,externalSlotProps:d=>Y({},br(s[a],d),br(n?.[a],d)),ownerState:{}});return l?c.jsx(l,Y({},u)):null}const _V=["visible"],BV=fe("li",{name:"MuiTreeItem2",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),jV=fe("div",{name:"MuiTreeItem2",slot:"Content",overridesResolver:(e,t)=>t.content,shouldForwardProp:e=>No(e)&&e!=="status"&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}},{props:({status:t})=>t.disabled,style:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"}},{props:({status:t})=>t.focused,style:{backgroundColor:(e.vars||e).palette.action.focus}},{props:({status:t})=>t.selected,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},{props:({status:t})=>t.selected&&t.focused,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}]})),$V=fe("div",{name:"MuiTreeItem2",slot:"Label",overridesResolver:(e,t)=>t.label,shouldForwardProp:e=>No(e)&&e!=="editable"})(({theme:e})=>Y({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative",overflow:"hidden"},e.typography.body1,{variants:[{props:({editable:t})=>t,style:{paddingLeft:"2px"}}]})),HV=fe("div",{name:"MuiTreeItem2",slot:"IconContainer",overridesResolver:(e,t)=>t.iconContainer})({width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}});fe(sl,{name:"MuiTreeItem2",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>No(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]});fe(M.forwardRef((e,t)=>{const{visible:n}=e,r=Ze(e,_V);return n?c.jsx(Pp,Y({},r,{ref:t})):null}),{name:"MuiTreeItem2",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})({padding:0});function zV(e){return Ge("MuiRichTreeView",e)}We("MuiRichTreeView",["root"]);const UV=(e,t)=>{const n=M.useRef({}),[r,o]=M.useState(()=>{const s={};return e.forEach(a=>{a.models&&Object.entries(a.models).forEach(([l,u])=>{n.current[l]={isControlled:t[l]!==void 0,getDefaultValue:u.getDefaultValue},s[l]=u.getDefaultValue(t)})}),s});return Object.fromEntries(Object.entries(n.current).map(([s,a])=>{const l=t[s]??r[s];return[s,{value:l,setControlledValue:u=>{a.isControlled||o(d=>Y({},d,{[s]:u}))}}]}))};class VV{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),i=Array.from(r.regular.keys());for(let s=o.length-1;s>=0;s-=1){const a=o[s];r.highPriority.has(a)&&a.apply(this,n)}for(let s=0;s<i.length;s+=1){const a=i[s];r.regular.has(a)&&a.apply(this,n)}}once(t,n){const r=this;this.on(t,function o(...i){r.removeListener(t,o),n.apply(r,i)})}}const WV=e=>e.isPropagationStopped!==void 0,cE=()=>{const[e]=M.useState(()=>new VV),t=M.useCallback((...r)=>{const[o,i,s={}]=r;s.defaultMuiPrevented=!1,!(WV(s)&&s.isPropagationStopped())&&e.emit(o,i,s)},[e]),n=M.useCallback((r,o)=>(e.on(r,o),()=>{e.removeListener(r,o)}),[e]);return{instance:{$$publishEvent:t,$$subscribeEvent:n}}};cE.params={};const dE=({plugins:e})=>{const t=new Set(e);return{instance:{getAvailablePlugins:()=>t}}};dE.params={};const mh=({params:e,state:t,setState:n})=>{M.useEffect(()=>{n(o=>o.id.treeId===e.id&&o.id.treeId!==void 0?o:Y({},o,{id:Y({},o.id,{treeId:e.id??yV()})}))},[n,e.id]);const r=e.id??t.id.treeId;return{getRootProps:()=>({id:r}),contextValue:{treeId:r}}};mh.params={id:!0};mh.getInitialState=({id:e})=>({id:{treeId:e??void 0}});const qV=[cE,dE,mh],YV=["slots","slotProps","apiRef","experimentalFeatures"],KV=e=>{let{props:{slots:t,slotProps:n,apiRef:r,experimentalFeatures:o},plugins:i}=e,s=Ze(e.props,YV);const a={};i.forEach(h=>{Object.assign(a,h.params)});const l={},u={};Object.keys(s).forEach(h=>{const p=s[h];a[h]?l[h]=p:u[h]=p});const d=o??{},f=i.reduce((h,p)=>p.getDefaultizedParams?p.getDefaultizedParams({params:h,experimentalFeatures:d}):h,l);return{apiRef:r,forwardedProps:u,pluginParams:f,slots:t??{},slotProps:n??{},experimentalFeatures:d}},GV=({plugins:e,instance:t,publicAPI:n,rootRef:r})=>({runItemPlugins:a=>{let l=null,u=null;const d=[],f={};e.forEach(m=>{if(!m.itemPlugin)return;const b=m.itemPlugin({props:a,rootRef:l,contentRef:u});b?.rootRef&&(l=b.rootRef),b?.contentRef&&(u=b.contentRef),b?.propsEnhancers&&(d.push(b.propsEnhancers),Object.keys(b.propsEnhancers).forEach(y=>{f[y]=!0}))});const h=m=>b=>{const y={};return d.forEach(x=>{const C=x[m];C!=null&&Object.assign(y,C(b))}),y},p=Object.fromEntries(Object.keys(f).map(m=>[m,h(m)]));return{contentRef:u,rootRef:l,propsEnhancers:p}},wrapItem:({itemId:a,children:l})=>{let u=l;for(let d=e.length-1;d>=0;d-=1){const f=e[d];f.wrapItem&&(u=f.wrapItem({itemId:a,children:u,instance:t}))}return u},wrapRoot:({children:a})=>{let l=a;for(let u=e.length-1;u>=0;u-=1){const d=e[u];d.wrapRoot&&(l=d.wrapRoot({children:l,instance:t}))}return l},instance:t,rootRef:r,publicAPI:n});function QV(e){const t=M.useRef({});return e?(e.current==null&&(e.current={}),e.current):t.current}const XV=({plugins:e,rootRef:t,props:n})=>{const r=[...qV,...e],{pluginParams:o,forwardedProps:i,apiRef:s,experimentalFeatures:a,slots:l,slotProps:u}=KV({plugins:r,props:n}),d=UV(r,o),h=M.useRef({}).current,p=QV(s),m=M.useRef(null),b=vt(m,t),y=GV({plugins:r,instance:h,publicAPI:p,rootRef:m}),[x,C]=M.useState(()=>{const T={};return r.forEach(N=>{N.getInitialState&&Object.assign(T,N.getInitialState(o))}),T}),v=[],S=T=>{const N=T({instance:h,params:o,slots:l,slotProps:u,experimentalFeatures:a,state:x,setState:C,rootRef:m,models:d,plugins:r});N.getRootProps&&v.push(N.getRootProps),N.publicAPI&&Object.assign(p,N.publicAPI),N.instance&&Object.assign(h,N.instance),N.contextValue&&Object.assign(y,N.contextValue)};return r.forEach(S),{getRootProps:(T={})=>{const N=Y({role:"tree"},i,T,{ref:b});return v.forEach(O=>{Object.assign(N,O(T))}),N},rootRef:b,contextValue:y,instance:h}},ZV=(e,t,n)=>{e.$$publishEvent(t,n)},es="__TREE_VIEW_ROOT_PARENT_ID__",JV=e=>{const t={};return e.forEach((n,r)=>{t[n]=r}),t},eW=["children"],fE=({items:e,isItemDisabled:t,getItemLabel:n,getItemId:r})=>{const o={},i={},s={[es]:[]},a=(u,d,f)=>{const h=r?r(u):u.id;if(h==null)throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.","Alternatively, you can use the `getItemId` prop to specify a custom id for each item.","An item was provided without id in the `items` prop:",JSON.stringify(u)].join(`
221
+ `),_=!!e.text&&(j.test(e.text)||D.test(e.text)),L=()=>{if(!e.newSources||e.newSources.length===0)return 0;let R=[],oe="";if(e.text){const se=e.text.match(j);se&&(R=se[1].split(",").map(pe=>pe.trim()));const z=e.text.match(D);z&&(oe=z[1].trim())}for(let se=0;se<e.newSources.length;se++)try{const z=JSON.parse(e.newSources[se]);if(R.length>0&&R.includes(z.name)||oe&&oe===z.path)return se}catch{continue}return 0},$=e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:r}:void 0,K=dh({query:e.text,resourceUri:r}),{mode:G}=De.usePublisherTheme();W.useEffect(()=>{e.type==="code"&&$u(H(e.text),"malloy",G).then(R=>{b(R)})},[e,G]),W.useEffect(()=>{$u(K,"typescript",G).then(R=>{x(R)})},[K,G]);const q=()=>{const R=window.location.href;navigator.clipboard.writeText(R).then(()=>I("URL copied to clipboard!")).catch(()=>I("Failed to copy URL"))};return e.type==="markdown"&&c.jsx(De.CleanNotebookCell,{children:c.jsxs(w.Box,{sx:R=>({"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"600",color:R.palette.text.primary,marginBottom:"8px",marginTop:"16px"},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p":{color:R.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& ul, & ol":{color:R.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& li":{marginBottom:"4px"}}),children:[o===0?c.jsxs(w.Stack,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[c.jsx(wu,{options:B,children:e.text}),c.jsx(w.Tooltip,{title:"Click to copy link",children:c.jsx(Kf,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer",marginTop:"26px"},onClick:q})})]}):c.jsx(wu,{options:B,children:e.text}),c.jsx(w.Snackbar,{open:S!=="",autoHideDuration:6e3,onClose:()=>I(""),message:S})]})})||e.type==="code"&&c.jsxs(De.CleanNotebookCell,{children:[(!t||!n&&e.result||e.newSources&&e.newSources.length>0)&&c.jsx(w.Stack,{sx:{flexDirection:"column",gap:"8px",marginBottom:"2px"},children:e.newSources&&e.newSources.length>0&&c.jsx(De.CleanMetricCard,{sx:{position:"relative",padding:"0"},children:c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[m&&c.jsx("span",{dangerouslySetInnerHTML:{__html:m},style:{fontFamily:"monospace",fontSize:"14px",flex:1,marginRight:"8px"}}),_&&c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",flexShrink:0},onClick:()=>v(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"grey.700"}})})]})})}),c.jsx(lh,{open:C,onClose:()=>v(!1),title:"Data Sources",hasValidImport:_,resourceUri:r,data:$,initialSelectedSourceIndex:L()}),c.jsxs(w.Dialog,{open:l,onClose:()=>u(!1),maxWidth:"lg",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Malloy Code",c.jsx(w.IconButton,{onClick:()=>u(!1),sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{children:c.jsx(w.Box,{sx:R=>({border:`1px solid ${R.palette.divider}`,borderRadius:"8px",padding:"16px",fontFamily:"monospace",fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:R.palette.background.paper,color:R.palette.text.primary}),children:c.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:m}})})})]}),c.jsxs(w.Dialog,{open:d,onClose:()=>f(!1),maxWidth:"lg",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Embeddable Code",c.jsx(w.IconButton,{onClick:()=>f(!1),sx:{color:"text.secondary"},children:c.jsx(Fr,{})})]}),c.jsx(w.DialogContent,{children:c.jsxs(w.Stack,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},children:[c.jsx(w.Typography,{component:"div",sx:{fontSize:"12px",fontFamily:"monospace","& .line":{textWrap:"wrap"},flex:1},dangerouslySetInnerHTML:{__html:y}}),c.jsx(w.Tooltip,{title:"Copy Embeddable Code",children:c.jsx(w.IconButton,{sx:{width:"24px",height:"24px",marginLeft:"8px",color:"text.secondary"},onClick:()=>{navigator.clipboard.writeText(K)},children:c.jsx(ZU,{})})})]})})]}),c.jsx(VC,{open:h,onClose:()=>p(!1),result:e.result||"",title:"Results"}),s&&!e.result&&!_&&!(e.newSources&&e.newSources.length>0)&&c.jsx(De.CleanMetricCard,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:200},children:c.jsx(w.CircularProgress,{size:32})}),e.result&&c.jsxs(De.CleanMetricCard,{sx:{position:"relative"},children:[c.jsx(w.Box,{sx:{paddingTop:"24px"},children:c.jsx(Os,{result:e.result,maxHeight:700,maxResultSize:i})}),c.jsxs(w.Stack,{sx:{position:"absolute",top:"-12px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[!t&&c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:R=>{R.stopPropagation(),u(!0)},children:c.jsx(vb,{sx:{fontSize:"18px",color:"grey.700"}})}),c.jsx(w.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>p(!0),children:c.jsx(Zu,{sx:{fontSize:"18px",color:"grey.700"}})})]})]})]})}const nV=4;function ZC({resourceUri:e,maxResultSize:t=0,retrievalFn:n,onNavigate:r}){const{apiClients:o}=De.useServer(),{environmentName:i,packageName:s,versionId:a,modelPath:l}=Ht(e),{data:u,isSuccess:d,isError:f,error:h}=Xt({queryKey:[e],queryFn:async()=>(await o.notebooks.getNotebook(i,s,l,a)).data}),[p,m]=W.useState([]),[b,y]=W.useState(!1),[x,C]=W.useState(null),v=W.useMemo(()=>u?_C(u.annotations):null,[u]),S=W.useMemo(()=>u?.notebookCells?jC(u.notebookCells):null,[u]),I=W.useMemo(()=>S?.sourceInfoMap??new Map,[S]),T=S?.modelPath??null,N=W.useMemo(()=>{const pe=new Map;if(!u?.sources)return pe;for(const J of u.sources)if(J.name&&J.filters&&J.filters.length>0){const Q=J.filters.filter(re=>!re.implicit);Q.length>0&&pe.set(J.name,Q)}return pe},[u]),O=N.size>0,F=W.useMemo(()=>{if(O&&T){const pe=[];for(const[J,Q]of N)for(const re of Q??[]){if(!re.dimension||!re.type)continue;let ne;const ae=re.dimensionType;ae==="boolean"?ne="Boolean":ae==="date"||ae==="timestamp"||ae==="timestamptz"?ne="DateMinMax":ae==="number"?ne=re.type==="equal"||re.type==="in"?"Star":"MinMax":ne={equal:"Star",in:"Star",like:"Star",greater_than:"MinMax",less_than:"MinMax"}[re.type]??"Star";const Z={equal:"Equals",in:"Equals",like:"Contains",greater_than:ne==="DateMinMax"?"After":"Greater Than",less_than:ne==="DateMinMax"?"Before":"Less Than"}[re.type],me=re.name!==re.dimension?re.name:void 0;pe.push({source:J,model:T,dimensionName:re.dimension,filterType:ne,label:me,filterName:re.name??re.dimension,defaultMatchType:Z,required:re.required??!1})}return pe}return!v||I.size===0||!T?[]:$C(I,v.filters,T)},[O,N,v,I,T]),{filterStates:B,updateFilter:j,getActiveFilters:D}=ch({dimensionSpecs:F}),H=W.useMemo(()=>D(),[B,D]),_=GC(u),{givenValues:L,updateGiven:$,clearAll:K}=KC(_);W.useMemo(()=>{const pe=new Map;for(const J of F){const Q=xo(J);pe.set(Q,J.source)}return pe},[F]);const{data:G}=uh({environment:i,package:s,dimensionSpecs:F,versionId:a,enabled:F.length>0}),q=W.useCallback(pe=>{if(pe.length===0)return;const J=re=>re instanceof Date?re.toISOString().slice(0,10):String(re),Q={};for(const re of pe){const ne=re.filterName??re.dimensionName,ae=re.value;Array.isArray(ae)?Q[ne]=ae.map(J):ae!=null&&(Q[ne]=J(ae))}return Object.keys(Q).length>0?JSON.stringify(Q):void 0},[]),R=W.useCallback(pe=>{if(pe.size===0)return;const J=re=>re instanceof Date?re.toISOString().slice(0,10):Array.isArray(re)?re.map(ne=>J(ne)):re,Q={};return pe.forEach((re,ne)=>{re!=null&&(Q[ne]=J(re))}),Object.keys(Q).length>0?JSON.stringify(Q):void 0},[]),oe=W.useCallback(async(pe=[],J=new Map)=>{if(!d||!u?.notebookCells)return;m(ne=>ne.length===0?u.notebookCells.map(ae=>({...ae})):ne.map(ae=>({...ae,result:void 0}))),y(!0),C(null);const Q=O?q(pe):void 0,re=R(J);try{const ne=[];for(let ie=0;ie<u.notebookCells.length;ie++){const Z=u.notebookCells[ie];if(Z.type==="markdown")continue;const me=ie,le=async()=>{try{const Ie=(await o.notebooks.executeNotebookCell(i,s,l,me,a,Q,void 0,re)).data,Ce=Ie.result,we=Z.newSources||Ie.newSources;m(ye=>{const ze=[...ye];return ze[me]||(ze[me]={...Z}),ze[me]={...ze[me],result:Ce,newSources:we},ze})}catch(ue){console.error(`Error executing cell ${me}:`,ue)}};ne.push(le)}const ae=[];for(const ie of ne){const Z=ie().then(()=>{ae.splice(ae.indexOf(Z),1)});ae.push(Z),ae.length>=nV&&await Promise.race(ae)}await Promise.all(ae)}catch(ne){console.error("Error executing notebook cells:",ne),C(ne)}finally{y(!1)}},[d,u,O,q,R,i,s,l,a,o.notebooks]);W.useEffect(()=>{!d||!u?.notebookCells||oe([],new Map)},[d,u,oe]);const se=W.useRef("");W.useEffect(()=>{const pe=JSON.stringify({filters:H.map(J=>({dim:J.dimensionName,type:J.matchType,val:J.value,val2:J.value2})),givens:Array.from(L.entries()).sort(([J],[Q])=>J.localeCompare(Q)).map(([J,Q])=>[J,Q instanceof Date?Q.toISOString().slice(0,10):Q])});if(pe!==se.current){if(se.current===""&&H.length===0&&L.size===0){se.current=pe;return}b||(se.current=pe,oe(H,L))}},[H,L,b,oe]);const z=W.useCallback(pe=>J=>{j(pe,J)},[j]);return F.some(pe=>pe.filterType==="Retrieval"),c.jsx(De.CleanNotebookContainer,{children:c.jsx(De.CleanNotebookSection,{children:c.jsxs(w.Stack,{spacing:3,component:"section",children:[c.jsx(XU,{givens:_,values:L,onChange:$,onClearAll:K}),F.length>0&&G&&c.jsxs(w.Paper,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[c.jsx(w.Typography,{variant:"subtitle2",sx:{fontWeight:600,mb:2,color:"#333"},children:"Filters"}),c.jsx(w.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:3},children:F.map(pe=>{const J=xo(pe),Q=G.get(J)||[],re=B.get(J);return pe.filterType==="Retrieval"&&!n?null:c.jsx(w.Box,{children:c.jsx(LC,{spec:pe,values:Q,selection:re?.selection,onChange:z(J),retrievalFn:n})},J)})})]}),!d&&!f&&c.jsx(Sn,{text:"Fetching Notebook..."}),d&&(p.length>0?p:u?.notebookCells||[]).map((pe,J)=>c.jsx(tV,{cell:pe,index:J,resourceUri:e,maxResultSize:t,isExecuting:b,onNavigate:r},J)),f&&h.status===404&&c.jsxs(w.Typography,{variant:"body2",sx:{color:"text.secondary"},children:[c.jsx("code",{children:`${i} > ${s} > ${l}`})," ","not found."]}),f&&h.status!==404&&c.jsx(kn,{error:h,context:`${i} > ${s} > ${l}`}),x&&c.jsx(kn,{error:{message:x.message,status:500,name:"ExecutionError"},context:"Notebook Execution"})]})})})}function Ca({type:e,size:t=18,sx:n,...r}){return c.jsxs(Ou,{...r,viewBox:"0 0 24 24",sx:{width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...n},children:[e==="report"&&c.jsx(rV,{}),e==="model"&&c.jsx(oV,{}),e==="data"&&c.jsx(iV,{}),e==="materialization"&&c.jsx(sV,{}),e==="dataApp"&&c.jsx(aV,{})]})}function rV(){return c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14 3 H6 a2 2 0 0 0 -2 2 v14 a2 2 0 0 0 2 2 h12 a2 2 0 0 0 2 -2 V9 z"}),c.jsx("path",{d:"M14 3 v4 a2 2 0 0 0 2 2 h4"}),c.jsx("path",{d:"M8 17 v-3"}),c.jsx("path",{d:"M12 17 v-6"}),c.jsx("path",{d:"M16 17 v-4"})]})}function oV(){return c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3 L4 7 v10 l8 4 l8 -4 V7 z"}),c.jsx("path",{d:"M4 7 l8 4 l8 -4"}),c.jsx("path",{d:"M12 11 v10"})]})}function iV(){return c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),c.jsx("path",{d:"M3.5 9.5 H20.5"}),c.jsx("path",{d:"M9.5 3.5 V20.5"})]})}function sV(){return c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3 L21 7.5 L12 12 L3 7.5 Z"}),c.jsx("path",{d:"M3 12 L12 16.5 L21 12"}),c.jsx("path",{d:"M3 16.5 L12 21 L21 16.5"})]})}function aV(){return c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),c.jsx("path",{d:"M3.5 9.5 H20.5"}),c.jsx("path",{d:"M7 13.5 H17"}),c.jsx("path",{d:"M7 16.5 H13"})]})}const Q1="README.malloynb";function lV({onClickPackageFile:e,resourceUri:t,retrievalFn:n}){const{apiClients:r,server:o}=De.useServer(),i=e??(O=>{window.location.href=O}),{environmentName:s,packageName:a,versionId:l}=Ht(t),[u,d]=W.useState(null),f=Xt({queryKey:["package",s,a,l],queryFn:()=>r.packages.getPackage(s,a,l,!1)}),h=Xt({queryKey:["notebooks",s,a,l],queryFn:()=>r.notebooks.listNotebooks(s,a,l)}),p=Xt({queryKey:["models",s,a,l],queryFn:()=>r.models.listModels(s,a,l)}),m=Xt({queryKey:["databases",s,a,l],queryFn:()=>r.databases.listDatabases(s,a,l)}),y=Xt({queryKey:["data-apps",s,a],queryFn:async()=>{try{return await r.dataApps.listDataApps(s,a)}catch(O){const F=O?.response?.status;if(F===404||F===void 0)return{data:[]};throw O}}}).data?.data??[],x=(h.data?.data??[]).slice().sort((O,F)=>O.path.localeCompare(F.path)),C=(p.data?.data??[]).slice().sort((O,F)=>O.path.localeCompare(F.path)),v=(m.data?.data??[]).slice().sort((O,F)=>O.path.localeCompare(F.path)),S=f.data?.data?.description??"",I=x.some(O=>O.path===Q1),T=Cl({environmentName:s,packageName:a,versionId:l,modelPath:Q1}),N=!h.isSuccess&&!h.isError;return f.isError?c.jsx(kn,{error:f.error,context:`${s} > ${a}`}):c.jsxs(w.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Link,{onClick:O=>i(`/${s}/`,O),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[c.jsx(e2,{sx:{fontSize:18}}),"Back to ",s]}),c.jsx(w.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:a}),S&&c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:S})]}),N&&c.jsx(Sn,{text:"Loading package..."}),!N&&c.jsxs(c.Fragment,{children:[c.jsxs(Ea,{title:"Notebooks",count:x.length,children:[x.map(O=>c.jsx(va,{icon:c.jsx(Ca,{type:"report"}),tint:De.MALLOY_BRAND.teal,label:O.path,onClick:F=>i(`/${s}/${a}/${O.path}`,F)},O.path)),x.length===0&&c.jsx(Wd,{label:"No notebooks"})]}),y.length>0&&c.jsx(Ea,{title:"Data Apps",count:y.length,children:y.map(O=>{const F=!!O.title&&O.title!==O.path,B=`${Zx(o)}${O.resource}`;return c.jsx(va,{icon:c.jsx(Ca,{type:"dataApp"}),tint:De.MALLOY_BRAND.teal,label:F?O.title:O.path,rightLabel:F?O.path:void 0,onClick:j=>{e?e(`/${s}/${a}/data-apps/${O.path}`,j):j&&(j.metaKey||j.ctrlKey)?window.open(B,"_blank"):window.location.href=B},trailingAction:c.jsx(w.Tooltip,{title:"Open standalone in new tab",children:c.jsx(w.IconButton,{size:"small",href:B,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",onClick:j=>j.stopPropagation(),sx:{color:"text.secondary"},children:c.jsx(Xx,{fontSize:"small"})})})},O.path)})}),c.jsxs(Ea,{title:"Semantic Models",count:C.length,children:[C.map(O=>c.jsx(va,{icon:c.jsx(Ca,{type:"model"}),tint:De.MALLOY_BRAND.orange,label:O.path,onClick:F=>i(`/${s}/${a}/${O.path}`,F)},O.path)),C.length===0&&c.jsx(Wd,{label:"No models"})]}),c.jsxs(Ea,{title:"Package Data",count:v.length,children:[v.map(O=>c.jsx(va,{icon:c.jsx(Ca,{type:"data"}),tint:De.MALLOY_BRAND.darkBlue,label:O.path,rightLabel:O.info?uV(O.info.rowCount):"Unreadable",onClick:()=>d(O)},O.path)),v.length===0&&c.jsx(Wd,{label:"No data files"})]}),c.jsx(Ea,{title:"Materializations",children:c.jsx(va,{icon:c.jsx(Ca,{type:"materialization"}),tint:De.MALLOY_BRAND.teal,label:"Materializations",onClick:O=>i(`/${s}/${a}/materializations`,O)})}),I&&c.jsx(w.Box,{sx:{mt:6},children:c.jsx(ZC,{resourceUri:T,retrievalFn:n,onNavigate:i})})]}),c.jsxs(w.Dialog,{open:u!==null,onClose:()=>d(null),maxWidth:"sm",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pr:6},children:[u?.path,c.jsx(w.IconButton,{"aria-label":"close",onClick:()=>d(null),sx:{position:"absolute",right:8,top:8},children:c.jsx(Fr,{fontSize:"small"})})]}),c.jsxs(w.DialogContent,{children:[u?.error&&c.jsx(w.Typography,{variant:"body2",color:"error",children:u.error}),u?.info?.columns&&c.jsxs(w.Table,{size:"small",children:[c.jsx(w.TableHead,{children:c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{children:"Column"}),c.jsx(w.TableCell,{children:"Type"})]})}),c.jsx(w.TableBody,{children:u.info.columns.map(O=>c.jsxs(w.TableRow,{children:[c.jsx(w.TableCell,{component:"th",scope:"row",children:O.name}),c.jsx(w.TableCell,{children:O.type})]},O.name))})]})]})]})]})}function Ea({title:e,count:t,children:n}){return c.jsxs(w.Box,{sx:{mb:4},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:e}),t!==void 0&&c.jsxs(w.Typography,{variant:"caption",color:"text.secondary",children:["(",t,")"]})]}),c.jsx(w.Box,{children:n})]})}function va({icon:e,tint:t,label:n,rightLabel:r,onClick:o,trailingAction:i}){const s=!!o,a=l=>{o&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),o(l))};return c.jsxs(w.Box,{onClick:o,onKeyDown:s?a:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,sx:l=>({display:"flex",alignItems:"center",gap:1.5,py:1,px:1,mx:-1,cursor:s?"pointer":"default",borderRadius:1.5,transition:"background-color 0.1s","&:hover":s?{backgroundColor:l.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}:void 0,"&:focus-visible":s?{outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}:void 0}),children:[c.jsx(w.Box,{sx:{width:32,height:32,borderRadius:1,bgcolor:t,color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e}),c.jsx(w.Typography,{variant:"body2",sx:{fontFamily:De.MONO_FONT_FAMILY,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),r&&c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{flexShrink:0},children:r}),i&&c.jsx(w.Box,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:i})]})}function Wd({label:e}){return c.jsx(w.Typography,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:e})}function uV(e){return e>=1e9?`${(e/1e9).toFixed(1)} B rows`:e>=1e6?`${(e/1e6).toFixed(1)} M rows`:e>=1e3?`${(e/1e3).toFixed(1)} K rows`:`${e} rows`}function cV(e){return Ge("MuiCollapse",e)}We("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const dV=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Ke(r,cV,n)},fV=fe("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(ft(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),pV=fe("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),hV=fe("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),sl=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiCollapse"}),{addEndListener:o,children:i,className:s,collapsedSize:a="0px",component:l,easing:u,in:d,onEnter:f,onEntered:h,onEntering:p,onExit:m,onExited:b,onExiting:y,orientation:x="vertical",style:C,timeout:v=pb.standard,TransitionComponent:S=Dr,...I}=r,T={...r,orientation:x,collapsedSize:a},N=dV(T),O=Lo(),F=Sc(),B=M.useRef(null),j=M.useRef(),D=typeof a=="number"?`${a}px`:a,H=x==="horizontal",_=H?"width":"height",L=M.useRef(null),$=vt(n,L),K=Q=>re=>{if(Q){const ne=L.current;re===void 0?Q(ne):Q(ne,re)}},G=()=>B.current?B.current[H?"clientWidth":"clientHeight"]:0,q=K((Q,re)=>{B.current&&H&&(B.current.style.position="absolute"),Q.style[_]=D,f&&f(Q,re)}),R=K((Q,re)=>{const ne=G();B.current&&H&&(B.current.style.position="");const{duration:ae,easing:ie}=ms({style:C,timeout:v,easing:u},{mode:"enter"});if(v==="auto"){const Z=O.transitions.getAutoHeightDuration(ne);Q.style.transitionDuration=`${Z}ms`,j.current=Z}else Q.style.transitionDuration=typeof ae=="string"?ae:`${ae}ms`;Q.style[_]=`${ne}px`,Q.style.transitionTimingFunction=ie,p&&p(Q,re)}),oe=K((Q,re)=>{Q.style[_]="auto",h&&h(Q,re)}),se=K(Q=>{Q.style[_]=`${G()}px`,m&&m(Q)}),z=K(b),pe=K(Q=>{const re=G(),{duration:ne,easing:ae}=ms({style:C,timeout:v,easing:u},{mode:"exit"});if(v==="auto"){const ie=O.transitions.getAutoHeightDuration(re);Q.style.transitionDuration=`${ie}ms`,j.current=ie}else Q.style.transitionDuration=typeof ne=="string"?ne:`${ne}ms`;Q.style[_]=D,Q.style.transitionTimingFunction=ae,y&&y(Q)}),J=Q=>{v==="auto"&&F.start(j.current||0,Q),o&&o(L.current,Q)};return c.jsx(S,{in:d,onEnter:q,onEntered:oe,onEntering:R,onExit:se,onExited:z,onExiting:pe,addEndListener:J,nodeRef:L,timeout:v==="auto"?null:v,...I,children:(Q,{ownerState:re,...ne})=>c.jsx(fV,{as:l,className:Ue(N.root,s,{entered:N.entered,exited:!d&&D==="0px"&&N.hidden}[Q]),style:{[H?"minWidth":"minHeight"]:D,...C},ref:$,ownerState:{...T,state:Q},...ne,children:c.jsx(pV,{ownerState:{...T,state:Q},className:N.wrapper,ref:B,children:c.jsx(hV,{ownerState:{...T,state:Q},className:N.wrapperInner,children:i})})})})});sl&&(sl.muiSupportAuto=!0);function JC(e){return Kt}const eE=M.createContext(null);function mV(e){const{value:t,children:n}=e;return c.jsx(eE.Provider,{value:t,children:t.wrapRoot({children:n,instance:t.instance})})}const Si=()=>{const e=M.useContext(eE);if(e==null)throw new Error(["MUI X: Could not find the Tree View context.","It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.","This can also happen if you are bundling multiple versions of the Tree View."].join(`
222
+ `));return e},gV=({props:e})=>{const{instance:t}=Si(),{label:n,itemId:r}=e,[o,i]=M.useState(n),s=t.isItemBeingEdited(r);return M.useEffect(()=>{s||i(n)},[s,n]),{propsEnhancers:{labelInput:({externalEventHandlers:a,interactions:l})=>t.isItemEditable(r)?{value:o??"","data-element":"labelInput",onChange:p=>{a.onChange?.(p),i(p.target.value)},onKeyDown:p=>{if(a.onKeyDown?.(p),p.defaultMuiPrevented)return;const m=p.target;p.key==="Enter"&&m.value?l.handleSaveItemLabel(p,m.value):p.key==="Escape"&&l.handleCancelItemLabelEditing(p)},onBlur:p=>{a.onBlur?.(p),!p.defaultMuiPrevented&&p.target.value&&l.handleSaveItemLabel(p,p.target.value)},autoFocus:!0,type:"text"}:{}}}},xr=({instance:e,state:t,setState:n,params:r})=>{const o=M.useRef(t.editedItemId),i=f=>o.current===f,s=f=>{n(h=>Y({},h,{editedItemId:f})),o.current=f},a=f=>f===t.editedItemId,l=!!r.isItemEditable,u=f=>{if(f==null||!l)return!1;const h=e.getItem(f);return h?typeof r.isItemEditable=="function"?r.isItemEditable(h):!!r.isItemEditable:!1},d=(f,h)=>{if(!h)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","The label of an item cannot be empty.",f].join(`
223
+ `));n(p=>{const m=p.items.itemMetaMap[f];return m.label!==h?Y({},p,{items:Y({},p.items,{itemMetaMap:Y({},p.items.itemMetaMap,{[f]:Y({},m,{label:h})})})}):p}),r.onItemLabelChange&&r.onItemLabelChange(f,h)};return{instance:{setEditedItemId:s,isItemBeingEdited:a,updateItemLabel:d,isItemEditable:u,isTreeViewEditable:l,isItemBeingEditedRef:i},publicAPI:{updateItemLabel:d}}};xr.itemPlugin=gV;xr.getDefaultizedParams=({params:e,experimentalFeatures:t})=>{const n=t?.labelEditing;return Y({},e,{isItemEditable:n?e.isItemEditable??!1:!1})};xr.getInitialState=()=>({editedItemId:null});xr.params={onItemLabelChange:!0,isItemEditable:!0};const ui=(e,t)=>e.getAvailablePlugins().has(t),tE=e=>Array.isArray(e)?e.length>0&&e.some(tE):!!e,bV=({itemId:e,children:t})=>{const{instance:n,selection:{multiSelect:r},publicAPI:o}=Si(),i={expandable:tE(t),expanded:n.isItemExpanded(e),focused:n.isItemFocused(e),selected:n.isItemSelected(e),disabled:n.isItemDisabled(e),editing:n?.isItemBeingEdited?n?.isItemBeingEdited(e):!1,editable:n.isItemEditable?n.isItemEditable(e):!1},s=p=>{if(i.disabled)return;i.focused||n.focusItem(p,e);const m=r&&(p.shiftKey||p.ctrlKey||p.metaKey);i.expandable&&!(m&&n.isItemExpanded(e))&&n.toggleItemExpansion(p,e)},a=p=>{if(i.disabled)return;!i.focused&&!i.editing&&n.focusItem(p,e),r&&(p.shiftKey||p.ctrlKey||p.metaKey)?p.shiftKey?n.expandSelectionRange(p,e):n.selectItem({event:p,itemId:e,keepExistingSelection:!0}):n.selectItem({event:p,itemId:e,shouldBeSelected:!0})},l=p=>{const m=p.nativeEvent.shiftKey;r&&m?n.expandSelectionRange(p,e):n.selectItem({event:p,itemId:e,keepExistingSelection:r,shouldBeSelected:p.target.checked})},u=()=>{ui(n,xr)&&n.isItemEditable(e)&&(n.isItemBeingEdited(e)?n.setEditedItemId(null):n.setEditedItemId(e))};return{interactions:{handleExpansion:s,handleSelection:a,handleCheckboxSelection:l,toggleItemEditing:u,handleSaveItemLabel:(p,m)=>{ui(n,xr)&&n.isItemBeingEditedRef(e)&&(n.updateItemLabel(e,m),u(),n.focusItem(p,e))},handleCancelItemLabelEditing:p=>{ui(n,xr)&&n.isItemBeingEditedRef(e)&&(u(),n.focusItem(p,e))}},status:i,publicAPI:o}},fh=M.createContext(()=>-1),nE=(e,t)=>{let n=t.length-1;for(;n>=0&&!e.isItemNavigable(t[n]);)n-=1;if(n!==-1)return t[n]},rE=(e,t)=>{const n=e.getItemMeta(t),r=e.getItemOrderedChildrenIds(n.parentId),o=e.getItemIndex(t);if(o===0)return n.parentId;let i=o-1;for(;!e.isItemNavigable(r[i])&&i>=0;)i-=1;if(i===-1)return n.parentId==null?null:rE(e,n.parentId);let s=r[i],a=nE(e,e.getItemOrderedChildrenIds(s));for(;e.isItemExpanded(s)&&a!=null;)s=a,a=e.getItemOrderedChildrenIds(s).find(e.isItemNavigable);return s},Su=(e,t)=>{if(e.isItemExpanded(t)){const r=e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);if(r!=null)return r}let n=e.getItemMeta(t);for(;n!=null;){const r=e.getItemOrderedChildrenIds(n.parentId),o=e.getItemIndex(n.id);if(o<r.length-1){let i=o+1;for(;!e.isItemNavigable(r[i])&&i<r.length-1;)i+=1;if(e.isItemNavigable(r[i]))return r[i]}n=e.getItemMeta(n.parentId)}return null},oE=e=>{let t=null;for(;t==null||e.isItemExpanded(t);){const n=e.getItemOrderedChildrenIds(t),r=nE(e,n);if(r==null)return t;t=r}return t},al=e=>e.getItemOrderedChildrenIds(null).find(e.isItemNavigable),iE=(e,t,n)=>{if(t===n)return[t,n];const r=e.getItemMeta(t),o=e.getItemMeta(n);if(r.parentId===o.id||o.parentId===r.id)return o.parentId===r.id?[r.id,o.id]:[o.id,r.id];const i=[r.id],s=[o.id];let a=r.parentId,l=o.parentId,u=s.indexOf(a)!==-1,d=i.indexOf(l)!==-1,f=!0,h=!0;for(;!d&&!u;)f&&(i.push(a),u=s.indexOf(a)!==-1,f=a!==null,!u&&f&&(a=e.getItemMeta(a).parentId)),h&&!u&&(s.push(l),d=i.indexOf(l)!==-1,h=l!==null,!d&&h&&(l=e.getItemMeta(l).parentId));const p=u?a:l,m=e.getItemOrderedChildrenIds(p),b=i[i.indexOf(p)-1],y=s[s.indexOf(p)-1];return m.indexOf(b)<m.indexOf(y)?[t,n]:[n,t]},yV=(e,t,n)=>{const r=l=>{if(e.isItemExpandable(l)&&e.isItemExpanded(l))return e.getItemOrderedChildrenIds(l)[0];let u=e.getItemMeta(l);for(;u!=null;){const d=e.getItemOrderedChildrenIds(u.parentId),f=e.getItemIndex(u.id);if(f<d.length-1)return d[f+1];u=e.getItemMeta(u.parentId)}throw new Error("Invalid range")},[o,i]=iE(e,t,n),s=[o];let a=o;for(;a!==i;)a=r(a),e.isItemDisabled(a)||s.push(a);return s},xV=e=>{let t=al(e);const n=[];for(;t!=null;)n.push(t),t=Su(e,t);return n},ll=(e,t)=>t!==e.closest('*[role="treeitem"]');let X1=0;const CV=()=>(X1+=1,`mui-tree-view-${X1}`),ph=({id:e,treeId:t="",itemId:n})=>e??`${t}-${n}`,EV=e=>{const{runItemPlugins:t,items:{onItemClick:n,disabledItemsFocusable:r,indentationAtItemLevel:o},selection:{disableSelection:i,checkboxSelection:s},expansion:{expansionTrigger:a},treeId:l,instance:u,publicAPI:d}=Si(),f=M.useContext(fh),{id:h,itemId:p,label:m,children:b,rootRef:y}=e,{rootRef:x,contentRef:C,propsEnhancers:v}=t(e),{interactions:S,status:I}=bV({itemId:p,children:b}),T=M.useRef(null),N=M.useRef(null),O=vt(y,x,T),F=vt(C,N),B=M.useRef(null),j=ph({itemId:p,treeId:l,id:h}),D=u.canItemBeTabbed(p)?0:-1,H={rootRefObject:T,contentRefObject:N,interactions:S},_=ie=>Z=>{if(ie.onFocus?.(Z),Z.defaultMuiPrevented)return;const me=!I.disabled||r;!I.focused&&me&&Z.currentTarget===Z.target&&u.focusItem(Z,p)},L=ie=>Z=>{if(ie.onBlur?.(Z),Z.defaultMuiPrevented)return;const me=u.getItemDOMElement(p);I.editing||Z.relatedTarget&&ll(Z.relatedTarget,me)&&(Z.target&&Z.target?.dataset?.element==="labelInput"&&ll(Z.target,me)||Z.relatedTarget?.dataset?.element==="labelInput")||u.removeFocusedItem()},$=ie=>Z=>{ie.onKeyDown?.(Z),!(Z.defaultMuiPrevented||Z.target?.dataset?.element==="labelInput")&&u.handleItemKeyDown(Z,p)},K=ie=>Z=>{ie.onDoubleClick?.(Z),!Z.defaultMuiPrevented&&S.toggleItemEditing()},G=ie=>Z=>{ie.onClick?.(Z),n?.(Z,p),!(Z.defaultMuiPrevented||B.current?.contains(Z.target))&&(a==="content"&&S.handleExpansion(Z),s||S.handleSelection(Z))},q=ie=>Z=>{ie.onMouseDown?.(Z),!Z.defaultMuiPrevented&&(Z.shiftKey||Z.ctrlKey||Z.metaKey||I.disabled)&&Z.preventDefault()},R=ie=>Z=>{ie.onChange?.(Z),!Z.defaultMuiPrevented&&(i||I.disabled||S.handleCheckboxSelection(Z))},oe=ie=>Z=>{ie.onClick?.(Z),!Z.defaultMuiPrevented&&a==="iconContainer"&&S.handleExpansion(Z)};return{getRootProps:(ie={})=>{const Z=Y({},Ln(e),Ln(ie));let me;I.selected?me=!0:i||I.disabled?me=void 0:me=!1;const le=Y({},Z,{ref:O,role:"treeitem",tabIndex:D,id:j,"aria-expanded":I.expandable?I.expanded:void 0,"aria-selected":me,"aria-disabled":I.disabled||void 0},ie,{onFocus:_(Z),onBlur:L(Z),onKeyDown:$(Z)});o&&(le.style={"--TreeView-itemDepth":typeof f=="function"?f(p):f});const ue=v.root?.(Y({},H,{externalEventHandlers:Z}))??{};return Y({},le,ue)},getContentProps:(ie={})=>{const Z=Ln(ie),me=Y({},Z,ie,{ref:F,onClick:G(Z),onMouseDown:q(Z),status:I});o&&(me.indentationAtItemLevel=!0);const le=v.content?.(Y({},H,{externalEventHandlers:Z}))??{};return Y({},me,le)},getGroupTransitionProps:(ie={})=>{const Z=Ln(ie),me=Y({},Z,{unmountOnExit:!0,component:"ul",role:"group",in:I.expanded,children:b},ie);return o&&(me.indentationAtItemLevel=!0),me},getIconContainerProps:(ie={})=>{const Z=Ln(ie);return Y({},Z,ie,{onClick:oe(Z)})},getCheckboxProps:(ie={})=>{const Z=Ln(ie);return Y({},Z,{visible:s,ref:B,checked:I.selected,disabled:i||I.disabled,tabIndex:-1},ie,{onChange:R(Z)})},getLabelProps:(ie={})=>{const Z=Y({},Ln(ie)),me=Y({},Z,{children:m},ie,{onDoubleClick:K(Z)});return u.isTreeViewEditable&&(me.editable=I.editable),me},getLabelInputProps:(ie={})=>{const Z=Ln(ie),me=v.labelInput?.({rootRefObject:T,contentRefObject:N,externalEventHandlers:Z,interactions:S})??{};return Y({},ie,me)},getDragAndDropOverlayProps:(ie={})=>{const Z=Ln(ie),me=v.dragAndDropOverlay?.(Y({},H,{externalEventHandlers:Z}))??{};return Y({},ie,me)},rootRef:O,status:I,publicAPI:d}},vV=EV;function sE(e){const{instance:t,items:{onItemClick:n},selection:{multiSelect:r,checkboxSelection:o,disableSelection:i},expansion:{expansionTrigger:s}}=Si(),a=t.isItemExpandable(e),l=t.isItemExpanded(e),u=t.isItemFocused(e),d=t.isItemSelected(e),f=t.isItemDisabled(e),h=t?.isItemBeingEdited?t?.isItemBeingEdited(e):!1,p=t.isItemEditable?t.isItemEditable(e):!1,m=I=>{if(!f){u||t.focusItem(I,e);const T=r&&(I.shiftKey||I.ctrlKey||I.metaKey);a&&!(T&&t.isItemExpanded(e))&&t.toggleItemExpansion(I,e)}},b=I=>{f||(!u&&!h&&t.focusItem(I,e),r&&(I.shiftKey||I.ctrlKey||I.metaKey)?I.shiftKey?t.expandSelectionRange(I,e):t.selectItem({event:I,itemId:e,keepExistingSelection:!0}):t.selectItem({event:I,itemId:e,shouldBeSelected:!0}))},y=I=>{if(i||f)return;const T=I.nativeEvent.shiftKey;r&&T?t.expandSelectionRange(I,e):t.selectItem({event:I,itemId:e,keepExistingSelection:r,shouldBeSelected:I.target.checked})},x=I=>{(I.shiftKey||I.ctrlKey||I.metaKey||f)&&I.preventDefault()},C=()=>{ui(t,xr)&&t.isItemEditable(e)&&(t.isItemBeingEdited(e)?t.setEditedItemId(null):t.setEditedItemId(e))};return{disabled:f,expanded:l,selected:d,focused:u,editable:p,editing:h,disableSelection:i,checkboxSelection:o,handleExpansion:m,handleSelection:b,handleCheckboxSelection:y,handleContentClick:n,preventSelection:x,expansionTrigger:s,toggleItemEditing:C,handleSaveItemLabel:(I,T)=>{ui(t,xr)&&t.isItemBeingEditedRef(e)&&(t.updateItemLabel(e,T),C(),t.focusItem(I,e))},handleCancelItemLabelEditing:I=>{ui(t,xr)&&t.isItemBeingEditedRef(e)&&(C(),t.focusItem(I,e))}}}const TV=fe("div",{name:"MuiTreeItem2DragAndDropOverlay",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Ot.shouldForwardProp(e)&&e!=="action"})(({theme:e})=>({position:"absolute",left:0,display:"flex",top:0,bottom:0,right:0,pointerEvents:"none",variants:[{props:{action:"make-child"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderRadius:e.shape.borderRadius,backgroundColor:e.vars?`rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})`:Ot.alpha(e.palette.primary.dark,e.palette.action.focusOpacity)}},{props:{action:"reorder-above"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderTop:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"reorder-below"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"move-to-parent"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}}]}));function SV(e){return e.action==null?null:c.jsx(TV,Y({},e))}const kV=fe("input",{name:"MuiTreeItem2",slot:"LabelInput",overridesResolver:(e,t)=>t.labelInput})(({theme:e})=>Y({},e.typography.body1,{width:"100%",backgroundColor:e.palette.background.paper,borderRadius:e.shape.borderRadius,border:"none",padding:"0 2px",boxSizing:"border-box","&:focus":{outline:`1px solid ${e.palette.primary.main}`}})),wV=["classes","className","displayIcon","expansionIcon","icon","label","itemId","onClick","onMouseDown","dragAndDropOverlayProps","labelInputProps"],aE=M.forwardRef(function(t,n){const{classes:r,className:o,displayIcon:i,expansionIcon:s,icon:a,label:l,itemId:u,onClick:d,onMouseDown:f,dragAndDropOverlayProps:h,labelInputProps:p}=t,m=Ze(t,wV),{disabled:b,expanded:y,selected:x,focused:C,editing:v,editable:S,disableSelection:I,checkboxSelection:T,handleExpansion:N,handleSelection:O,handleCheckboxSelection:F,handleContentClick:B,preventSelection:j,expansionTrigger:D,toggleItemEditing:H}=sE(u),_=a||s||i,L=M.useRef(null),$=q=>{j(q),f&&f(q)},K=q=>{B?.(q,u),!L.current?.contains(q.target)&&(D==="content"&&N(q),T||O(q),d&&d(q))},G=q=>{q.defaultMuiPrevented||H()};return c.jsxs("div",Y({},m,{className:Ue(r.root,o,y&&r.expanded,x&&r.selected,C&&r.focused,b&&r.disabled,v&&r.editing,S&&r.editable),onClick:K,onMouseDown:$,ref:n,children:[c.jsx("div",{className:r.iconContainer,children:_}),T&&c.jsx(Pp,{className:r.checkbox,checked:x,onChange:F,disabled:b||I,ref:L,tabIndex:-1}),v?c.jsx(kV,Y({},p,{className:r.labelInput})):c.jsx("div",Y({className:r.label},S&&{onDoubleClick:G},{children:l})),h&&c.jsx(SV,Y({},h))]}))});function DV(e){return Ge("MuiTreeItem",e)}const co=We("MuiTreeItem",["root","groupTransition","content","expanded","selected","focused","disabled","iconContainer","label","checkbox","labelInput","editable","editing","dragAndDropOverlay"]),lE=mt(c.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),uE=mt(c.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}));function hh(e){const{children:t,itemId:n}=e,{wrapItem:r,instance:o}=Si();return r({children:t,itemId:n,instance:o})}hh.propTypes={children:Ee.node,itemId:Ee.string.isRequired};const IV=["children","className","slots","slotProps","ContentComponent","ContentProps","itemId","id","label","onClick","onMouseDown","onFocus","onBlur","onKeyDown"],AV=["ownerState"],OV=["ownerState"],MV=["ownerState"],PV=JC(),RV=e=>{const{classes:t}=e;return Ke({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],checkbox:["checkbox"],label:["label"],labelInput:["labelInput"],editing:["editing"],editable:["editable"],groupTransition:["groupTransition"]},DV,t)},NV=fe("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),FV=fe(aE,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${co.iconContainer}`]:t.iconContainer},t.label&&{[`& .${co.label}`]:t.label}],shouldForwardProp:e=>No(e)&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${co.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${co.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${co.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${co.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${co.iconContainer}`]:{width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${co.label}`]:Y({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1),[`& .${co.checkbox}`]:{padding:0},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}}]})),LV=fe(sl,{name:"MuiTreeItem",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>No(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]}),_V=M.forwardRef(function(t,n){const{icons:r,runItemPlugins:o,items:{disabledItemsFocusable:i,indentationAtItemLevel:s},selection:{disableSelection:a},expansion:{expansionTrigger:l},treeId:u,instance:d}=Si(),f=M.useContext(fh),h=PV({props:t,name:"MuiTreeItem"}),{children:p,className:m,slots:b,slotProps:y,ContentComponent:x=aE,ContentProps:C,itemId:v,id:S,label:I,onClick:T,onMouseDown:N,onBlur:O,onKeyDown:F}=h,B=Ze(h,IV),{expanded:j,focused:D,selected:H,disabled:_,editing:L,handleExpansion:$,handleCancelItemLabelEditing:K,handleSaveItemLabel:G}=sE(v),{contentRef:q,rootRef:R,propsEnhancers:oe}=o(h),se=M.useRef(null),z=M.useRef(null),pe=vt(n,R,se),J=vt(C?.ref,q,z),Q={expandIcon:b?.expandIcon??r.slots.expandIcon??lE,collapseIcon:b?.collapseIcon??r.slots.collapseIcon??uE,endIcon:b?.endIcon??r.slots.endIcon,icon:b?.icon,groupTransition:b?.groupTransition},re=Oe=>Array.isArray(Oe)?Oe.length>0&&Oe.some(re):!!Oe,ne=re(p),ae=Y({},h,{expanded:j,focused:D,selected:H,disabled:_,indentationAtItemLevel:s}),ie=RV(ae),Z=Q.groupTransition??void 0,me=Et({elementType:Z,ownerState:{},externalSlotProps:y?.groupTransition,additionalProps:Y({unmountOnExit:!0,in:j,component:"ul",role:"group"},s?{indentationAtItemLevel:!0}:{}),className:ie.groupTransition}),le=Oe=>{l==="iconContainer"&&$(Oe)},ue=j?Q.collapseIcon:Q.expandIcon,Ie=Et({elementType:ue,ownerState:{},externalSlotProps:Oe=>j?Y({},br(r.slotProps.collapseIcon,Oe),br(y?.collapseIcon,Oe)):Y({},br(r.slotProps.expandIcon,Oe),br(y?.expandIcon,Oe)),additionalProps:{onClick:le}}),Ce=Ze(Ie,AV),we=ne&&ue?c.jsx(ue,Y({},Ce)):null,ye=ne?void 0:Q.endIcon,ze=Et({elementType:ye,ownerState:{},externalSlotProps:Oe=>ne?{}:Y({},br(r.slotProps.endIcon,Oe),br(y?.endIcon,Oe))}),Ne=Ze(ze,OV),nt=ye?c.jsx(ye,Y({},Ne)):null,_e=Q.icon,Bt=Et({elementType:_e,ownerState:{},externalSlotProps:y?.icon}),yt=Ze(Bt,MV),ot=_e?c.jsx(_e,Y({},yt)):null;let xe;H?xe=!0:a||_?xe=void 0:xe=!1;function Pe(Oe){!D&&(!_||i)&&Oe.currentTarget===Oe.target&&d.focusItem(Oe,v)}function qe(Oe){O?.(Oe),!(L||Oe.relatedTarget&&ll(Oe.relatedTarget,se.current)&&(Oe.target&&Oe.target?.dataset?.element==="labelInput"&&ll(Oe.target,se.current)||Oe.relatedTarget?.dataset?.element==="labelInput"))&&d.removeFocusedItem()}const Je=Oe=>{F?.(Oe),Oe.target?.dataset?.element!=="labelInput"&&d.handleItemKeyDown(Oe,v)},Xe=ph({itemId:v,treeId:u,id:S}),Re=d.canItemBeTabbed(v)?0:-1,ct={rootRefObject:se,contentRefObject:z,interactions:{handleSaveItemLabel:G,handleCancelItemLabelEditing:K}},lt=oe.root?.(Y({},ct,{externalEventHandlers:Ln(B)}))??{},Mt=oe.content?.(Y({},ct,{externalEventHandlers:Ln(C)}))??{},be=oe.dragAndDropOverlay?.(Y({},ct,{externalEventHandlers:{}}))??{},Ae=oe.labelInput?.(Y({},ct,{externalEventHandlers:{}}))??{};return c.jsx(hh,{itemId:v,children:c.jsxs(NV,Y({className:Ue(ie.root,m),role:"treeitem","aria-expanded":ne?j:void 0,"aria-selected":xe,"aria-disabled":_||void 0,id:Xe,tabIndex:Re},B,{ownerState:ae,onFocus:Pe,onBlur:qe,onKeyDown:Je,ref:pe,style:s?Y({},B.style,{"--TreeView-itemDepth":typeof f=="function"?f(v):f}):B.style},lt,{children:[c.jsx(FV,Y({as:x,classes:{root:ie.content,expanded:ie.expanded,selected:ie.selected,focused:ie.focused,disabled:ie.disabled,editable:ie.editable,editing:ie.editing,iconContainer:ie.iconContainer,label:ie.label,labelInput:ie.labelInput,checkbox:ie.checkbox},label:I,itemId:v,onClick:T,onMouseDown:N,icon:ot,expansionIcon:we,displayIcon:nt,ownerState:ae},C,Mt,be.action==null?{}:{dragAndDropOverlayProps:be},Ae.value==null?{}:{labelInputProps:Ae},{ref:J})),p&&c.jsx(LV,Y({as:Z},me,{children:p}))]}))})});function BV(e){const{slots:t,slotProps:n,status:r}=e,o=Si(),i=Y({},o.icons.slots,{expandIcon:o.icons.slots.expandIcon??lE,collapseIcon:o.icons.slots.collapseIcon??uE}),s=o.icons.slotProps;let a;t?.icon?a="icon":r.expandable?r.expanded?a="collapseIcon":a="expandIcon":a="endIcon";const l=t?.[a]??i[a],u=Et({elementType:l,externalSlotProps:d=>Y({},br(s[a],d),br(n?.[a],d)),ownerState:{}});return l?c.jsx(l,Y({},u)):null}const jV=["visible"],$V=fe("li",{name:"MuiTreeItem2",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),HV=fe("div",{name:"MuiTreeItem2",slot:"Content",overridesResolver:(e,t)=>t.content,shouldForwardProp:e=>No(e)&&e!=="status"&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}},{props:({status:t})=>t.disabled,style:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"}},{props:({status:t})=>t.focused,style:{backgroundColor:(e.vars||e).palette.action.focus}},{props:({status:t})=>t.selected,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},{props:({status:t})=>t.selected&&t.focused,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ot.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}]})),zV=fe("div",{name:"MuiTreeItem2",slot:"Label",overridesResolver:(e,t)=>t.label,shouldForwardProp:e=>No(e)&&e!=="editable"})(({theme:e})=>Y({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative",overflow:"hidden"},e.typography.body1,{variants:[{props:({editable:t})=>t,style:{paddingLeft:"2px"}}]})),UV=fe("div",{name:"MuiTreeItem2",slot:"IconContainer",overridesResolver:(e,t)=>t.iconContainer})({width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}});fe(sl,{name:"MuiTreeItem2",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>No(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]});fe(M.forwardRef((e,t)=>{const{visible:n}=e,r=Ze(e,jV);return n?c.jsx(Pp,Y({},r,{ref:t})):null}),{name:"MuiTreeItem2",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})({padding:0});function VV(e){return Ge("MuiRichTreeView",e)}We("MuiRichTreeView",["root"]);const WV=(e,t)=>{const n=M.useRef({}),[r,o]=M.useState(()=>{const s={};return e.forEach(a=>{a.models&&Object.entries(a.models).forEach(([l,u])=>{n.current[l]={isControlled:t[l]!==void 0,getDefaultValue:u.getDefaultValue},s[l]=u.getDefaultValue(t)})}),s});return Object.fromEntries(Object.entries(n.current).map(([s,a])=>{const l=t[s]??r[s];return[s,{value:l,setControlledValue:u=>{a.isControlled||o(d=>Y({},d,{[s]:u}))}}]}))};class qV{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),i=Array.from(r.regular.keys());for(let s=o.length-1;s>=0;s-=1){const a=o[s];r.highPriority.has(a)&&a.apply(this,n)}for(let s=0;s<i.length;s+=1){const a=i[s];r.regular.has(a)&&a.apply(this,n)}}once(t,n){const r=this;this.on(t,function o(...i){r.removeListener(t,o),n.apply(r,i)})}}const YV=e=>e.isPropagationStopped!==void 0,cE=()=>{const[e]=M.useState(()=>new qV),t=M.useCallback((...r)=>{const[o,i,s={}]=r;s.defaultMuiPrevented=!1,!(YV(s)&&s.isPropagationStopped())&&e.emit(o,i,s)},[e]),n=M.useCallback((r,o)=>(e.on(r,o),()=>{e.removeListener(r,o)}),[e]);return{instance:{$$publishEvent:t,$$subscribeEvent:n}}};cE.params={};const dE=({plugins:e})=>{const t=new Set(e);return{instance:{getAvailablePlugins:()=>t}}};dE.params={};const mh=({params:e,state:t,setState:n})=>{M.useEffect(()=>{n(o=>o.id.treeId===e.id&&o.id.treeId!==void 0?o:Y({},o,{id:Y({},o.id,{treeId:e.id??CV()})}))},[n,e.id]);const r=e.id??t.id.treeId;return{getRootProps:()=>({id:r}),contextValue:{treeId:r}}};mh.params={id:!0};mh.getInitialState=({id:e})=>({id:{treeId:e??void 0}});const KV=[cE,dE,mh],GV=["slots","slotProps","apiRef","experimentalFeatures"],QV=e=>{let{props:{slots:t,slotProps:n,apiRef:r,experimentalFeatures:o},plugins:i}=e,s=Ze(e.props,GV);const a={};i.forEach(h=>{Object.assign(a,h.params)});const l={},u={};Object.keys(s).forEach(h=>{const p=s[h];a[h]?l[h]=p:u[h]=p});const d=o??{},f=i.reduce((h,p)=>p.getDefaultizedParams?p.getDefaultizedParams({params:h,experimentalFeatures:d}):h,l);return{apiRef:r,forwardedProps:u,pluginParams:f,slots:t??{},slotProps:n??{},experimentalFeatures:d}},XV=({plugins:e,instance:t,publicAPI:n,rootRef:r})=>({runItemPlugins:a=>{let l=null,u=null;const d=[],f={};e.forEach(m=>{if(!m.itemPlugin)return;const b=m.itemPlugin({props:a,rootRef:l,contentRef:u});b?.rootRef&&(l=b.rootRef),b?.contentRef&&(u=b.contentRef),b?.propsEnhancers&&(d.push(b.propsEnhancers),Object.keys(b.propsEnhancers).forEach(y=>{f[y]=!0}))});const h=m=>b=>{const y={};return d.forEach(x=>{const C=x[m];C!=null&&Object.assign(y,C(b))}),y},p=Object.fromEntries(Object.keys(f).map(m=>[m,h(m)]));return{contentRef:u,rootRef:l,propsEnhancers:p}},wrapItem:({itemId:a,children:l})=>{let u=l;for(let d=e.length-1;d>=0;d-=1){const f=e[d];f.wrapItem&&(u=f.wrapItem({itemId:a,children:u,instance:t}))}return u},wrapRoot:({children:a})=>{let l=a;for(let u=e.length-1;u>=0;u-=1){const d=e[u];d.wrapRoot&&(l=d.wrapRoot({children:l,instance:t}))}return l},instance:t,rootRef:r,publicAPI:n});function ZV(e){const t=M.useRef({});return e?(e.current==null&&(e.current={}),e.current):t.current}const JV=({plugins:e,rootRef:t,props:n})=>{const r=[...KV,...e],{pluginParams:o,forwardedProps:i,apiRef:s,experimentalFeatures:a,slots:l,slotProps:u}=QV({plugins:r,props:n}),d=WV(r,o),h=M.useRef({}).current,p=ZV(s),m=M.useRef(null),b=vt(m,t),y=XV({plugins:r,instance:h,publicAPI:p,rootRef:m}),[x,C]=M.useState(()=>{const T={};return r.forEach(N=>{N.getInitialState&&Object.assign(T,N.getInitialState(o))}),T}),v=[],S=T=>{const N=T({instance:h,params:o,slots:l,slotProps:u,experimentalFeatures:a,state:x,setState:C,rootRef:m,models:d,plugins:r});N.getRootProps&&v.push(N.getRootProps),N.publicAPI&&Object.assign(p,N.publicAPI),N.instance&&Object.assign(h,N.instance),N.contextValue&&Object.assign(y,N.contextValue)};return r.forEach(S),{getRootProps:(T={})=>{const N=Y({role:"tree"},i,T,{ref:b});return v.forEach(O=>{Object.assign(N,O(T))}),N},rootRef:b,contextValue:y,instance:h}},eW=(e,t,n)=>{e.$$publishEvent(t,n)},es="__TREE_VIEW_ROOT_PARENT_ID__",tW=e=>{const t={};return e.forEach((n,r)=>{t[n]=r}),t},nW=["children"],fE=({items:e,isItemDisabled:t,getItemLabel:n,getItemId:r})=>{const o={},i={},s={[es]:[]},a=(u,d,f)=>{const h=r?r(u):u.id;if(h==null)throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.","Alternatively, you can use the `getItemId` prop to specify a custom id for each item.","An item was provided without id in the `items` prop:",JSON.stringify(u)].join(`
224
224
  `));if(o[h]!=null)throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.","Alternatively, you can use the `getItemId` prop to specify a custom id for each item.",`Two items were provided with the same id in the \`items\` prop: "${h}"`].join(`
225
225
  `));const p=n?n(u):u.label;if(p==null)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.","An item was provided without label in the `items` prop:",JSON.stringify(u)].join(`
226
- `));o[h]={id:h,label:p,parentId:f,idAttribute:void 0,expandable:!!u.children?.length,disabled:t?t(u):!1,depth:d},i[h]=u;const m=f??es;s[m]||(s[m]=[]),s[m].push(h),u.children?.forEach(b=>a(b,d+1,h))};e.forEach(u=>a(u,0,null));const l={};return Object.keys(s).forEach(u=>{l[u]=JV(s[u])}),{itemMetaMap:o,itemMap:i,itemOrderedChildrenIds:s,itemChildrenIndexes:l}},Dl=({instance:e,params:t,state:n,setState:r,experimentalFeatures:o})=>{const i=M.useCallback(x=>n.items.itemMetaMap[x],[n.items.itemMetaMap]),s=M.useCallback(x=>n.items.itemMap[x],[n.items.itemMap]),a=M.useCallback(()=>{const x=C=>{const v=n.items.itemMap[C],S=Ze(v,eW),I=n.items.itemOrderedChildrenIds[C];return I&&(S.children=I.map(x)),S};return n.items.itemOrderedChildrenIds[es].map(x)},[n.items.itemMap,n.items.itemOrderedChildrenIds]),l=M.useCallback(x=>{if(x==null)return!1;let C=e.getItemMeta(x);if(!C)return!1;if(C.disabled)return!0;for(;C.parentId!=null;)if(C=e.getItemMeta(C.parentId),C.disabled)return!0;return!1},[e]),u=M.useCallback(x=>{const C=e.getItemMeta(x).parentId??es;return n.items.itemChildrenIndexes[C][x]},[e,n.items.itemChildrenIndexes]),d=M.useCallback(x=>n.items.itemOrderedChildrenIds[x??es]??[],[n.items.itemOrderedChildrenIds]),f=x=>{const C=e.getItemMeta(x);return C==null?null:document.getElementById(ph({treeId:n.id.treeId,itemId:x,id:C.idAttribute}))},h=x=>t.disabledItemsFocusable?!0:!e.isItemDisabled(x),p=M.useRef(!1),m=M.useCallback(()=>{p.current=!0},[]),b=M.useCallback(()=>p.current,[]);return M.useEffect(()=>{e.areItemUpdatesPrevented()||r(x=>{const C=fE({items:t.items,isItemDisabled:t.isItemDisabled,getItemId:t.getItemId,getItemLabel:t.getItemLabel});return Object.values(x.items.itemMetaMap).forEach(v=>{C.itemMetaMap[v.id]||ZV(e,"removeItem",{id:v.id})}),Y({},x,{items:C})})},[e,r,t.items,t.isItemDisabled,t.getItemId,t.getItemLabel]),{getRootProps:()=>({style:{"--TreeView-itemChildrenIndentation":typeof t.itemChildrenIndentation=="number"?`${t.itemChildrenIndentation}px`:t.itemChildrenIndentation}}),publicAPI:{getItem:s,getItemDOMElement:f,getItemTree:a,getItemOrderedChildrenIds:d},instance:{getItemMeta:i,getItem:s,getItemTree:a,getItemsToRender:()=>{const x=C=>{const v=n.items.itemMetaMap[C];return{label:v.label,itemId:v.id,id:v.idAttribute,children:n.items.itemOrderedChildrenIds[C]?.map(x)}};return n.items.itemOrderedChildrenIds[es].map(x)},getItemIndex:u,getItemDOMElement:f,getItemOrderedChildrenIds:d,isItemDisabled:l,isItemNavigable:h,preventItemUpdates:m,areItemUpdatesPrevented:b},contextValue:{items:{onItemClick:t.onItemClick,disabledItemsFocusable:t.disabledItemsFocusable,indentationAtItemLevel:o.indentationAtItemLevel??!1}}}};Dl.getInitialState=e=>({items:fE({items:e.items,isItemDisabled:e.isItemDisabled,getItemId:e.getItemId,getItemLabel:e.getItemLabel})});Dl.getDefaultizedParams=({params:e})=>Y({},e,{disabledItemsFocusable:e.disabledItemsFocusable??!1,itemChildrenIndentation:e.itemChildrenIndentation??"12px"});Dl.wrapRoot=({children:e,instance:t})=>c.jsx(fh.Provider,{value:n=>t.getItemMeta(n)?.depth??0,children:e});Dl.params={disabledItemsFocusable:!0,items:!0,isItemDisabled:!0,getItemLabel:!0,getItemId:!0,onItemClick:!0,itemChildrenIndentation:!0};const Lc=({instance:e,params:t,models:n})=>{const r=M.useMemo(()=>{const f=new Map;return n.expandedItems.value.forEach(h=>{f.set(h,!0)}),f},[n.expandedItems.value]),o=(f,h)=>{t.onExpandedItemsChange?.(f,h),n.expandedItems.setControlledValue(h)},i=M.useCallback(f=>r.has(f),[r]),s=M.useCallback(f=>!!e.getItemMeta(f)?.expandable,[e]),a=Ve((f,h)=>{const p=e.isItemExpanded(h);e.setItemExpansion(f,h,!p)}),l=Ve((f,h,p)=>{if(e.isItemExpanded(h)===p)return;let b;p?b=[h].concat(n.expandedItems.value):b=n.expandedItems.value.filter(y=>y!==h),t.onItemExpansionToggle&&t.onItemExpansionToggle(f,h,p),o(f,b)}),u=(f,h)=>{const p=e.getItemMeta(h),b=e.getItemOrderedChildrenIds(p.parentId).filter(x=>e.isItemExpandable(x)&&!e.isItemExpanded(x)),y=n.expandedItems.value.concat(b);b.length>0&&(t.onItemExpansionToggle&&b.forEach(x=>{t.onItemExpansionToggle(f,x,!0)}),o(f,y))},d=M.useMemo(()=>t.expansionTrigger?t.expansionTrigger:e.isTreeViewEditable?"iconContainer":"content",[t.expansionTrigger,e.isTreeViewEditable]);return{publicAPI:{setItemExpansion:l},instance:{isItemExpanded:i,isItemExpandable:s,setItemExpansion:l,toggleItemExpansion:a,expandAllSiblings:u},contextValue:{expansion:{expansionTrigger:d}}}};Lc.models={expandedItems:{getDefaultValue:e=>e.defaultExpandedItems}};const tW=[];Lc.getDefaultizedParams=({params:e})=>Y({},e,{defaultExpandedItems:e.defaultExpandedItems??tW});Lc.params={expandedItems:!0,defaultExpandedItems:!0,onExpandedItemsChange:!0,onItemExpansionToggle:!0,expansionTrigger:!0};const ku=e=>Array.isArray(e)?e:e!=null?[e]:[],qd=e=>{const t={};return e.forEach(n=>{t[n]=!0}),t},_c=({instance:e,params:t,models:n})=>{const r=M.useRef(null),o=M.useRef({}),i=M.useMemo(()=>{const b=new Map;return Array.isArray(n.selectedItems.value)?n.selectedItems.value.forEach(y=>{b.set(y,!0)}):n.selectedItems.value!=null&&b.set(n.selectedItems.value,!0),b},[n.selectedItems.value]),s=(b,y)=>{if(t.onItemSelectionToggle)if(t.multiSelect){const x=y.filter(v=>!e.isItemSelected(v)),C=n.selectedItems.value.filter(v=>!y.includes(v));x.forEach(v=>{t.onItemSelectionToggle(b,v,!0)}),C.forEach(v=>{t.onItemSelectionToggle(b,v,!1)})}else y!==n.selectedItems.value&&(n.selectedItems.value!=null&&t.onItemSelectionToggle(b,n.selectedItems.value,!1),y!=null&&t.onItemSelectionToggle(b,y,!0));t.onSelectedItemsChange&&t.onSelectedItemsChange(b,y),n.selectedItems.setControlledValue(y)},a=b=>i.has(b),l=({event:b,itemId:y,keepExistingSelection:x=!1,shouldBeSelected:C})=>{if(t.disableSelection)return;let v;if(x){const S=ku(n.selectedItems.value),I=e.isItemSelected(y);I&&(C===!1||C==null)?v=S.filter(T=>T!==y):!I&&(C===!0||C==null)?v=[y].concat(S):v=S}else C===!1||C==null&&e.isItemSelected(y)?v=t.multiSelect?[]:null:v=t.multiSelect?[y]:y;s(b,v),r.current=y,o.current={}},u=(b,[y,x])=>{if(t.disableSelection||!t.multiSelect)return;let C=ku(n.selectedItems.value).slice();Object.keys(o.current).length>0&&(C=C.filter(T=>!o.current[T]));const v=qd(C),S=gV(e,y,x),I=S.filter(T=>!v[T]);C=C.concat(I),s(b,C),o.current=qd(S)};return{getRootProps:()=>({"aria-multiselectable":t.multiSelect}),publicAPI:{selectItem:l},instance:{isItemSelected:a,selectItem:l,selectAllNavigableItems:b=>{if(t.disableSelection||!t.multiSelect)return;const y=bV(e);s(b,y),o.current=qd(y)},expandSelectionRange:(b,y)=>{if(r.current!=null){const[x,C]=iE(e,y,r.current);u(b,[x,C])}},selectRangeFromStartToItem:(b,y)=>{u(b,[al(e),y])},selectRangeFromItemToEnd:(b,y)=>{u(b,[y,oE(e)])},selectItemFromArrowNavigation:(b,y,x)=>{if(t.disableSelection||!t.multiSelect)return;let C=ku(n.selectedItems.value).slice();Object.keys(o.current).length===0?(C.push(x),o.current={[y]:!0,[x]:!0}):(o.current[y]||(o.current={}),o.current[x]?(C=C.filter(v=>v!==y),delete o.current[y]):(C.push(x),o.current[x]=!0)),s(b,C)}},contextValue:{selection:{multiSelect:t.multiSelect,checkboxSelection:t.checkboxSelection,disableSelection:t.disableSelection}}}};_c.models={selectedItems:{getDefaultValue:e=>e.defaultSelectedItems}};const nW=[];_c.getDefaultizedParams=({params:e})=>Y({},e,{disableSelection:e.disableSelection??!1,multiSelect:e.multiSelect??!1,checkboxSelection:e.checkboxSelection??!1,defaultSelectedItems:e.defaultSelectedItems??(e.multiSelect?nW:null)});_c.params={disableSelection:!0,multiSelect:!0,checkboxSelection:!0,defaultSelectedItems:!0,selectedItems:!0,onSelectedItemsChange:!0,onItemSelectionToggle:!0};const Z1=1e3;class rW{constructor(t=Z1){this.timeouts=new Map,this.cleanupTimeout=Z1,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const o=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,o)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class oW{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}class iW{}function sW(e){let t=0;return function(r,o,i){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new oW:new rW);const[s]=M.useState(new iW),a=M.useRef(null),l=M.useRef(void 0);l.current=i;const u=M.useRef(null);if(!a.current&&l.current){const d=(f,h)=>{h.defaultMuiPrevented||l.current?.(f,h)};a.current=r.$$subscribeEvent(o,d),t+=1,u.current={cleanupToken:t},e.registry.register(s,()=>{a.current?.(),a.current=null,u.current=null},u.current)}else!l.current&&a.current&&(a.current(),a.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));M.useEffect(()=>{if(!a.current&&l.current){const d=(f,h)=>{h.defaultMuiPrevented||l.current?.(f,h)};a.current=r.$$subscribeEvent(o,d)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{a.current?.(),a.current=null}},[r,o])}}const aW={registry:null},lW=sW(aW),pE=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?pE(t.shadowRoot):t:null},uW=(e,t)=>{let n=ku(t).find(r=>{if(!e.isItemNavigable(r))return!1;const o=e.getItemMeta(r);return o&&(o.parentId==null||e.isItemExpanded(o.parentId))});return n==null&&(n=al(e)),n},gh=({instance:e,params:t,state:n,setState:r,models:o,rootRef:i})=>{const s=uW(e,o.selectedItems.value),a=Ve(y=>{const x=typeof y=="function"?y(n.focusedItemId):y;n.focusedItemId!==x&&r(C=>Y({},C,{focusedItemId:x}))}),l=M.useCallback(()=>!!i.current&&i.current.contains(pE(mn(i.current))),[i]),u=M.useCallback(y=>n.focusedItemId===y&&l(),[n.focusedItemId,l]),d=y=>{const x=e.getItemMeta(y);return x&&(x.parentId==null||e.isItemExpanded(x.parentId))},f=(y,x)=>{const C=e.getItemDOMElement(x);C&&C.focus(),a(x),t.onItemFocus&&t.onItemFocus(y,x)},h=Ve((y,x)=>{d(x)&&f(y,x)}),p=Ve(()=>{if(n.focusedItemId==null)return;if(e.getItemMeta(n.focusedItemId)){const x=e.getItemDOMElement(n.focusedItemId);x&&x.blur()}a(null)}),m=y=>y===s;lW(e,"removeItem",({id:y})=>{n.focusedItemId===y&&f(null,s)});const b=y=>x=>{y.onFocus?.(x),!x.defaultMuiPrevented&&x.target===x.currentTarget&&f(x,s)};return{getRootProps:y=>({onFocus:b(y)}),publicAPI:{focusItem:h},instance:{isItemFocused:u,canItemBeTabbed:m,focusItem:h,removeFocusedItem:p}}};gh.getInitialState=()=>({focusedItemId:null});gh.params={onItemFocus:!0};function cW(e){return!!e&&e.length===1&&!!e.match(/\S/)}const hE=({instance:e,params:t,state:n})=>{const r=kr(),o=M.useRef({}),i=Ve(d=>{o.current=d(o.current)});M.useEffect(()=>{if(e.areItemUpdatesPrevented())return;const d={},f=h=>{d[h.id]=h.label.substring(0,1).toLowerCase()};Object.values(n.items.itemMetaMap).forEach(f),o.current=d},[n.items.itemMetaMap,t.getItemId,e]);const s=(d,f)=>{const h=f.toLowerCase(),p=x=>{const C=Su(e,x);return C===null?al(e):C};let m=null,b=p(d);const y={};for(;m==null&&!y[b];)o.current[b]===h?m=b:(y[b]=!0,b=p(b));return m},a=d=>!t.disableSelection&&!e.isItemDisabled(d),l=d=>!e.isItemDisabled(d)&&e.isItemExpandable(d);return{instance:{updateFirstCharMap:i,handleItemKeyDown:(d,f)=>{if(d.defaultMuiPrevented||d.altKey||ll(d.target,d.currentTarget))return;const h=d.ctrlKey||d.metaKey,p=d.key;switch(!0){case(p===" "&&a(f)):{d.preventDefault(),t.multiSelect&&d.shiftKey?e.expandSelectionRange(d,f):e.selectItem({event:d,itemId:f,keepExistingSelection:t.multiSelect,shouldBeSelected:t.multiSelect?void 0:!0});break}case p==="Enter":{ui(e,xr)&&e.isItemEditable(f)&&!e.isItemBeingEdited(f)?e.setEditedItemId(f):l(f)?(e.toggleItemExpansion(d,f),d.preventDefault()):a(f)&&(t.multiSelect?(d.preventDefault(),e.selectItem({event:d,itemId:f,keepExistingSelection:!0})):e.isItemSelected(f)||(e.selectItem({event:d,itemId:f}),d.preventDefault()));break}case p==="ArrowDown":{const m=Su(e,f);m&&(d.preventDefault(),e.focusItem(d,m),t.multiSelect&&d.shiftKey&&a(m)&&e.selectItemFromArrowNavigation(d,f,m));break}case p==="ArrowUp":{const m=rE(e,f);m&&(d.preventDefault(),e.focusItem(d,m),t.multiSelect&&d.shiftKey&&a(m)&&e.selectItemFromArrowNavigation(d,f,m));break}case(p==="ArrowRight"&&!r||p==="ArrowLeft"&&r):{if(h)return;if(e.isItemExpanded(f)){const m=Su(e,f);m&&(e.focusItem(d,m),d.preventDefault())}else l(f)&&(e.toggleItemExpansion(d,f),d.preventDefault());break}case(p==="ArrowLeft"&&!r||p==="ArrowRight"&&r):{if(h)return;if(l(f)&&e.isItemExpanded(f))e.toggleItemExpansion(d,f),d.preventDefault();else{const m=e.getItemMeta(f).parentId;m&&(e.focusItem(d,m),d.preventDefault())}break}case p==="Home":{a(f)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromStartToItem(d,f):e.focusItem(d,al(e)),d.preventDefault();break}case p==="End":{a(f)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromItemToEnd(d,f):e.focusItem(d,oE(e)),d.preventDefault();break}case p==="*":{e.expandAllSiblings(d,f),d.preventDefault();break}case(String.fromCharCode(d.keyCode)==="A"&&h&&t.multiSelect&&!t.disableSelection):{e.selectAllNavigableItems(d),d.preventDefault();break}case(!h&&!d.shiftKey&&cW(p)):{const m=s(f,p);m!=null&&(e.focusItem(d,m),d.preventDefault());break}}}}}};hE.params={};const mE=({slots:e,slotProps:t})=>({contextValue:{icons:{slots:{collapseIcon:e.collapseIcon,expandIcon:e.expandIcon,endIcon:e.endIcon},slotProps:{collapseIcon:t.collapseIcon,expandIcon:t.expandIcon,endIcon:t.endIcon}}}});mE.params={};const dW=[Dl,Lc,_c,gh,hE,mE,xr],fW=["ownerState"];function pW({slots:e,slotProps:t,label:n,id:r,itemId:o,itemsToRender:i}){const s=e?.item??FV,a=Et({elementType:s,externalSlotProps:t?.item,additionalProps:{itemId:o,id:r,label:n},ownerState:{itemId:o,label:n}}),l=Ze(a,fW),u=M.useMemo(()=>i?c.jsx(gE,{itemsToRender:i,slots:e,slotProps:t}):null,[i,e,t]);return c.jsx(s,Y({},l,{children:u}))}function gE(e){const{itemsToRender:t,slots:n,slotProps:r}=e;return c.jsx(M.Fragment,{children:t.map(o=>c.jsx(pW,{slots:n,slotProps:r,label:o.label,id:o.id,itemId:o.itemId,itemsToRender:o.children},o.itemId))})}const hW=JC(),mW=e=>{const{classes:t}=e;return Ke({root:["root"]},zV,t)},gW=fe("ul",{name:"MuiRichTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0,position:"relative"}),bW=M.forwardRef(function(t,n){const r=hW({props:t,name:"MuiRichTreeView"}),{getRootProps:o,contextValue:i,instance:s}=XV({plugins:dW,rootRef:n,props:r}),{slots:a,slotProps:l}=r,u=mW(r),d=a?.root??gW,f=Et({elementType:d,externalSlotProps:l?.root,className:u.root,getSlotProps:o,ownerState:r});return c.jsx(pV,{value:i,children:c.jsx(d,Y({},f,{children:c.jsx(gE,{slots:a,slotProps:l,itemsToRender:s.getItemsToRender()})}))})}),yW=mt([c.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),c.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),xW=mt(c.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),CW=mt(c.jsx("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"})),EW=mt(c.jsx("path",{d:"M15 4v2h3v12h-3v2h5V4zM4 20h5v-2H6V6h3V4H4z"}));function vW({items:e,defaultExpandedItems:t,onClickTreeNode:n}){return c.jsx(bW,{items:DW(e,n),defaultExpandedItems:t,slots:{item:wW}})}const TW=eb.animated(sl);function SW(e){const t=eb.useSpring({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return c.jsx(TW,{style:t,...e})}function kW({item:e,...t}){const n=c.jsxs($V,{...t,sx:{display:"flex",alignItems:"center",color:e.error?"error.main":"grey.600"},children:[e.fileType==="directory"&&c.jsx(BC,{})||e.fileType==="notebook"&&c.jsx(yW,{})||e.fileType==="model"&&c.jsx(EW,{})||e.fileType=="database"&&c.jsx(CW,{})||c.jsx(xW,{}),c.jsx(w.Typography,{variant:"body2",sx:{marginLeft:"5px"},color:e.error?"error.main":e.link?"primary.main":"grey.600",children:e.label})]});return e.error?c.jsx(w.Tooltip,{title:e.error,placement:"right",children:n}):n}const wW=M.forwardRef(function(t,n){const{id:r,itemId:o,label:i,children:s,disabled:a,...l}=t,{getRootProps:u,getContentProps:d,getLabelProps:f,getIconContainerProps:h,getGroupTransitionProps:p,status:m,publicAPI:b}=CV({id:r,itemId:o,children:s,label:i,disabled:a,rootRef:n}),y=b.getItem(o);return m.selected=!1,m.focused=!1,c.jsx(hh,{itemId:o,children:c.jsxs(BV,{...u(l),children:[c.jsxs(jV,{...d(),...y.link&&{onClick:x=>y.link(x)},sx:{pointerEvents:!y.selectable&&"none"},children:[c.jsx(HV,{...h(),children:c.jsx(LV,{status:m})}),c.jsx(kW,{...f({item:y})})]}),s&&c.jsx(SW,{...p()})]})})});function DW(e,t){const n=new Map;return e.map(r=>{let o=n;const i=r.path.split("/");i.forEach((s,a)=>{a===i.length-1?o.set(s,r):(o.has(s)||o.set(s,new Map),o=o.get(s))})}),bE(n,"",t)}function bE(e,t,n){const r=[];return e.forEach((o,i)=>{const s=i.endsWith(".malloy")&&"model"||i.endsWith(".malloynb")&&"notebook"||i.endsWith(".parquet")&&"database"||"unknown";if(s!=="unknown"){const a=o;r.push({id:t+i,label:i,fileType:s,link:s==="model"||s==="notebook"?l=>n(t+i,l):void 0,selectable:s==="model"||s==="notebook",error:"error"in a?a.error:void 0})}else{const a=t+i+"/";r.push({id:a,label:i,fileType:"directory",selectable:!0,link:void 0,children:bE(o,a,n)})}}),r}const IW=["notebooks/","models/"];function AW({onClickModelFile:e,resourceUri:t}){const{environmentName:n,packageName:r,versionId:o}=Ht(t),{apiClients:i}=De.useServer(),{data:s,isError:a,error:l,isSuccess:u}=Xt({queryKey:["models",n,r,o],queryFn:()=>i.models.listModels(n,r,o)});return c.jsx(De.PackageCard,{children:c.jsxs(De.PackageCardContent,{children:[c.jsx(De.PackageSectionTitle,{children:"Semantic Models"}),c.jsxs(w.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!u&&!a&&c.jsx(Sn,{text:"Fetching Models..."}),a&&c.jsx(kn,{error:l,context:`${n} > ${r} > Models`}),u&&s.data.length>0&&c.jsx(vW,{items:s.data.sort((d,f)=>d.path.localeCompare(f.path)),onClickTreeNode:e,defaultExpandedItems:IW}),u&&s.data.length===0&&c.jsx(w.Typography,{variant:"body2",children:"No models found"})]})]})})}function OW(e){try{const{environmentName:t,packageName:n,modelPath:r}=Ht(e);return!t||!n||!r?null:{environmentName:t,packageName:n,pagePath:r}}catch{return null}}function MW({resourceUri:e}){const{server:t,apiClients:n}=De.useServer(),r=OW(e),o=r?.environmentName??"",i=r?.packageName??"",s=r?.pagePath??"",a=W.useMemo(()=>ZC({server:t,environmentName:o,packageName:i,path:s}),[t,o,i,s]),u=Xt({queryKey:["pages",o,i],queryFn:()=>n.pages.listPages(o,i),enabled:!!r}).data?.data?.find(b=>b.path===s),d=u?.title??s,f=u?.fit==="viewport",h=W.useRef(null),[p,m]=W.useState(120);return W.useEffect(()=>{if(f)return;function b(y){eV(y.data)&&y.source===h.current?.contentWindow&&y.data.height>0&&m(Math.ceil(y.data.height))}return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[f]),r?c.jsxs(w.Box,{sx:{p:3,...f?{height:"100%",display:"flex",flexDirection:"column"}:{maxWidth:1200,mx:"auto"}},children:[c.jsxs(w.Stack,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1,flexShrink:0},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:d}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",sx:{fontFamily:De.MONO_FONT_FAMILY},children:s}),c.jsx(w.Box,{sx:{flex:1}}),c.jsx(w.Tooltip,{title:"Open standalone in new tab",children:c.jsx(w.IconButton,{size:"small",href:a,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",sx:{color:"text.secondary"},children:c.jsx(QC,{fontSize:"small"})})})]}),c.jsx(w.Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",backgroundColor:"background.paper",...f?{flex:1,minHeight:0}:{}},children:c.jsx("iframe",{ref:h,src:a,title:d,sandbox:"allow-scripts allow-same-origin allow-forms",style:{display:"block",width:"100%",height:f?"100%":p,border:0}})})]}):c.jsxs(w.Box,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[c.jsx(w.Typography,{variant:"h6",sx:{fontWeight:600},children:"Can't open page"}),c.jsxs(w.Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["This page link is missing an environment, package, or path:",c.jsx(w.Box,{component:"span",sx:{fontFamily:De.MONO_FONT_FAMILY,ml:1},children:e})]})]})}function yE(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function xE(e){return{"--malloy-render--font-family":e.font.family,"--malloy-render--table-font-size":`${e.font.size}px`,"--malloy-render--table-header-color":e.tableHeader,"--malloy-render--table-body-color":e.tableBody,"--malloy-render--table-border":e.border,"--malloy-render--table-pinned-border":e.pinnedBorder,"--malloy-render--tile-background":e.tile,"--publisher-dashboard-root":e.dashboardRoot,"--malloy-render--label-color":e.tileTitle,"--malloy-render--value-color":e.valueColor}}function CE(e){const{foreground:t,axisFaint:n,font:r}=e,o={background:e.background,font:r.family,title:{color:t,font:r.family},axis:{labelColor:t,titleColor:t,domainColor:n,tickColor:n,gridColor:n,labelFont:r.family,titleFont:r.family},legend:{labelColor:t,titleColor:t,labelFont:r.family,titleFont:r.family},header:{labelColor:t,titleColor:t},range:{category:e.series}};return i=>o}function EE(e){if(!e)return;const t=e.tag("theme");if(!t)return;const n={},r=t.tag("palette");if(r){const i={},s=r.textArray("series");s&&s.length>0&&(i.series=s);for(const a of De.PER_MODE_COLOR_KEYS){const l=r.tag(a);if(!l)continue;const u={},d=l.text("light"),f=l.text("dark");d&&(u.light=d),f&&(u.dark=f),Object.keys(u).length>0&&(i[a]=u)}Object.keys(i).length>0&&(n.palette=i)}const o=t.tag("font");if(o){const i={},s=o.text("family");s&&(i.family=s);const a=o.numeric("size");typeof a=="number"&&Number.isFinite(a)&&(i.size=a),Object.keys(i).length>0&&(n.font=i)}return Object.keys(n).length>0?n:void 0}const PW=async(e,t)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:n}=await import("@malloydata/render");return new n({onClick:t,vegaConfigOverride:CE(e),theme:yE(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};typeof window<"u"&&import("@malloydata/render");async function RW(e){if(!e||typeof e!="object")return;const t=e,n=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(n.length===0)return;let r;try{({parseAnnotation:r}=await import("@malloydata/malloy-tag"))}catch{return}try{const{tag:o}=r(n);return EE(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:n});return}}function NW(e,t){const n=xE(t);for(const[r,o]of Object.entries(n))e.style.setProperty(r,o)}const FW=`
226
+ `));o[h]={id:h,label:p,parentId:f,idAttribute:void 0,expandable:!!u.children?.length,disabled:t?t(u):!1,depth:d},i[h]=u;const m=f??es;s[m]||(s[m]=[]),s[m].push(h),u.children?.forEach(b=>a(b,d+1,h))};e.forEach(u=>a(u,0,null));const l={};return Object.keys(s).forEach(u=>{l[u]=tW(s[u])}),{itemMetaMap:o,itemMap:i,itemOrderedChildrenIds:s,itemChildrenIndexes:l}},Dl=({instance:e,params:t,state:n,setState:r,experimentalFeatures:o})=>{const i=M.useCallback(x=>n.items.itemMetaMap[x],[n.items.itemMetaMap]),s=M.useCallback(x=>n.items.itemMap[x],[n.items.itemMap]),a=M.useCallback(()=>{const x=C=>{const v=n.items.itemMap[C],S=Ze(v,nW),I=n.items.itemOrderedChildrenIds[C];return I&&(S.children=I.map(x)),S};return n.items.itemOrderedChildrenIds[es].map(x)},[n.items.itemMap,n.items.itemOrderedChildrenIds]),l=M.useCallback(x=>{if(x==null)return!1;let C=e.getItemMeta(x);if(!C)return!1;if(C.disabled)return!0;for(;C.parentId!=null;)if(C=e.getItemMeta(C.parentId),C.disabled)return!0;return!1},[e]),u=M.useCallback(x=>{const C=e.getItemMeta(x).parentId??es;return n.items.itemChildrenIndexes[C][x]},[e,n.items.itemChildrenIndexes]),d=M.useCallback(x=>n.items.itemOrderedChildrenIds[x??es]??[],[n.items.itemOrderedChildrenIds]),f=x=>{const C=e.getItemMeta(x);return C==null?null:document.getElementById(ph({treeId:n.id.treeId,itemId:x,id:C.idAttribute}))},h=x=>t.disabledItemsFocusable?!0:!e.isItemDisabled(x),p=M.useRef(!1),m=M.useCallback(()=>{p.current=!0},[]),b=M.useCallback(()=>p.current,[]);return M.useEffect(()=>{e.areItemUpdatesPrevented()||r(x=>{const C=fE({items:t.items,isItemDisabled:t.isItemDisabled,getItemId:t.getItemId,getItemLabel:t.getItemLabel});return Object.values(x.items.itemMetaMap).forEach(v=>{C.itemMetaMap[v.id]||eW(e,"removeItem",{id:v.id})}),Y({},x,{items:C})})},[e,r,t.items,t.isItemDisabled,t.getItemId,t.getItemLabel]),{getRootProps:()=>({style:{"--TreeView-itemChildrenIndentation":typeof t.itemChildrenIndentation=="number"?`${t.itemChildrenIndentation}px`:t.itemChildrenIndentation}}),publicAPI:{getItem:s,getItemDOMElement:f,getItemTree:a,getItemOrderedChildrenIds:d},instance:{getItemMeta:i,getItem:s,getItemTree:a,getItemsToRender:()=>{const x=C=>{const v=n.items.itemMetaMap[C];return{label:v.label,itemId:v.id,id:v.idAttribute,children:n.items.itemOrderedChildrenIds[C]?.map(x)}};return n.items.itemOrderedChildrenIds[es].map(x)},getItemIndex:u,getItemDOMElement:f,getItemOrderedChildrenIds:d,isItemDisabled:l,isItemNavigable:h,preventItemUpdates:m,areItemUpdatesPrevented:b},contextValue:{items:{onItemClick:t.onItemClick,disabledItemsFocusable:t.disabledItemsFocusable,indentationAtItemLevel:o.indentationAtItemLevel??!1}}}};Dl.getInitialState=e=>({items:fE({items:e.items,isItemDisabled:e.isItemDisabled,getItemId:e.getItemId,getItemLabel:e.getItemLabel})});Dl.getDefaultizedParams=({params:e})=>Y({},e,{disabledItemsFocusable:e.disabledItemsFocusable??!1,itemChildrenIndentation:e.itemChildrenIndentation??"12px"});Dl.wrapRoot=({children:e,instance:t})=>c.jsx(fh.Provider,{value:n=>t.getItemMeta(n)?.depth??0,children:e});Dl.params={disabledItemsFocusable:!0,items:!0,isItemDisabled:!0,getItemLabel:!0,getItemId:!0,onItemClick:!0,itemChildrenIndentation:!0};const Lc=({instance:e,params:t,models:n})=>{const r=M.useMemo(()=>{const f=new Map;return n.expandedItems.value.forEach(h=>{f.set(h,!0)}),f},[n.expandedItems.value]),o=(f,h)=>{t.onExpandedItemsChange?.(f,h),n.expandedItems.setControlledValue(h)},i=M.useCallback(f=>r.has(f),[r]),s=M.useCallback(f=>!!e.getItemMeta(f)?.expandable,[e]),a=Ve((f,h)=>{const p=e.isItemExpanded(h);e.setItemExpansion(f,h,!p)}),l=Ve((f,h,p)=>{if(e.isItemExpanded(h)===p)return;let b;p?b=[h].concat(n.expandedItems.value):b=n.expandedItems.value.filter(y=>y!==h),t.onItemExpansionToggle&&t.onItemExpansionToggle(f,h,p),o(f,b)}),u=(f,h)=>{const p=e.getItemMeta(h),b=e.getItemOrderedChildrenIds(p.parentId).filter(x=>e.isItemExpandable(x)&&!e.isItemExpanded(x)),y=n.expandedItems.value.concat(b);b.length>0&&(t.onItemExpansionToggle&&b.forEach(x=>{t.onItemExpansionToggle(f,x,!0)}),o(f,y))},d=M.useMemo(()=>t.expansionTrigger?t.expansionTrigger:e.isTreeViewEditable?"iconContainer":"content",[t.expansionTrigger,e.isTreeViewEditable]);return{publicAPI:{setItemExpansion:l},instance:{isItemExpanded:i,isItemExpandable:s,setItemExpansion:l,toggleItemExpansion:a,expandAllSiblings:u},contextValue:{expansion:{expansionTrigger:d}}}};Lc.models={expandedItems:{getDefaultValue:e=>e.defaultExpandedItems}};const rW=[];Lc.getDefaultizedParams=({params:e})=>Y({},e,{defaultExpandedItems:e.defaultExpandedItems??rW});Lc.params={expandedItems:!0,defaultExpandedItems:!0,onExpandedItemsChange:!0,onItemExpansionToggle:!0,expansionTrigger:!0};const ku=e=>Array.isArray(e)?e:e!=null?[e]:[],qd=e=>{const t={};return e.forEach(n=>{t[n]=!0}),t},_c=({instance:e,params:t,models:n})=>{const r=M.useRef(null),o=M.useRef({}),i=M.useMemo(()=>{const b=new Map;return Array.isArray(n.selectedItems.value)?n.selectedItems.value.forEach(y=>{b.set(y,!0)}):n.selectedItems.value!=null&&b.set(n.selectedItems.value,!0),b},[n.selectedItems.value]),s=(b,y)=>{if(t.onItemSelectionToggle)if(t.multiSelect){const x=y.filter(v=>!e.isItemSelected(v)),C=n.selectedItems.value.filter(v=>!y.includes(v));x.forEach(v=>{t.onItemSelectionToggle(b,v,!0)}),C.forEach(v=>{t.onItemSelectionToggle(b,v,!1)})}else y!==n.selectedItems.value&&(n.selectedItems.value!=null&&t.onItemSelectionToggle(b,n.selectedItems.value,!1),y!=null&&t.onItemSelectionToggle(b,y,!0));t.onSelectedItemsChange&&t.onSelectedItemsChange(b,y),n.selectedItems.setControlledValue(y)},a=b=>i.has(b),l=({event:b,itemId:y,keepExistingSelection:x=!1,shouldBeSelected:C})=>{if(t.disableSelection)return;let v;if(x){const S=ku(n.selectedItems.value),I=e.isItemSelected(y);I&&(C===!1||C==null)?v=S.filter(T=>T!==y):!I&&(C===!0||C==null)?v=[y].concat(S):v=S}else C===!1||C==null&&e.isItemSelected(y)?v=t.multiSelect?[]:null:v=t.multiSelect?[y]:y;s(b,v),r.current=y,o.current={}},u=(b,[y,x])=>{if(t.disableSelection||!t.multiSelect)return;let C=ku(n.selectedItems.value).slice();Object.keys(o.current).length>0&&(C=C.filter(T=>!o.current[T]));const v=qd(C),S=yV(e,y,x),I=S.filter(T=>!v[T]);C=C.concat(I),s(b,C),o.current=qd(S)};return{getRootProps:()=>({"aria-multiselectable":t.multiSelect}),publicAPI:{selectItem:l},instance:{isItemSelected:a,selectItem:l,selectAllNavigableItems:b=>{if(t.disableSelection||!t.multiSelect)return;const y=xV(e);s(b,y),o.current=qd(y)},expandSelectionRange:(b,y)=>{if(r.current!=null){const[x,C]=iE(e,y,r.current);u(b,[x,C])}},selectRangeFromStartToItem:(b,y)=>{u(b,[al(e),y])},selectRangeFromItemToEnd:(b,y)=>{u(b,[y,oE(e)])},selectItemFromArrowNavigation:(b,y,x)=>{if(t.disableSelection||!t.multiSelect)return;let C=ku(n.selectedItems.value).slice();Object.keys(o.current).length===0?(C.push(x),o.current={[y]:!0,[x]:!0}):(o.current[y]||(o.current={}),o.current[x]?(C=C.filter(v=>v!==y),delete o.current[y]):(C.push(x),o.current[x]=!0)),s(b,C)}},contextValue:{selection:{multiSelect:t.multiSelect,checkboxSelection:t.checkboxSelection,disableSelection:t.disableSelection}}}};_c.models={selectedItems:{getDefaultValue:e=>e.defaultSelectedItems}};const oW=[];_c.getDefaultizedParams=({params:e})=>Y({},e,{disableSelection:e.disableSelection??!1,multiSelect:e.multiSelect??!1,checkboxSelection:e.checkboxSelection??!1,defaultSelectedItems:e.defaultSelectedItems??(e.multiSelect?oW:null)});_c.params={disableSelection:!0,multiSelect:!0,checkboxSelection:!0,defaultSelectedItems:!0,selectedItems:!0,onSelectedItemsChange:!0,onItemSelectionToggle:!0};const Z1=1e3;class iW{constructor(t=Z1){this.timeouts=new Map,this.cleanupTimeout=Z1,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const o=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,o)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class sW{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}class aW{}function lW(e){let t=0;return function(r,o,i){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new sW:new iW);const[s]=M.useState(new aW),a=M.useRef(null),l=M.useRef(void 0);l.current=i;const u=M.useRef(null);if(!a.current&&l.current){const d=(f,h)=>{h.defaultMuiPrevented||l.current?.(f,h)};a.current=r.$$subscribeEvent(o,d),t+=1,u.current={cleanupToken:t},e.registry.register(s,()=>{a.current?.(),a.current=null,u.current=null},u.current)}else!l.current&&a.current&&(a.current(),a.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));M.useEffect(()=>{if(!a.current&&l.current){const d=(f,h)=>{h.defaultMuiPrevented||l.current?.(f,h)};a.current=r.$$subscribeEvent(o,d)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{a.current?.(),a.current=null}},[r,o])}}const uW={registry:null},cW=lW(uW),pE=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?pE(t.shadowRoot):t:null},dW=(e,t)=>{let n=ku(t).find(r=>{if(!e.isItemNavigable(r))return!1;const o=e.getItemMeta(r);return o&&(o.parentId==null||e.isItemExpanded(o.parentId))});return n==null&&(n=al(e)),n},gh=({instance:e,params:t,state:n,setState:r,models:o,rootRef:i})=>{const s=dW(e,o.selectedItems.value),a=Ve(y=>{const x=typeof y=="function"?y(n.focusedItemId):y;n.focusedItemId!==x&&r(C=>Y({},C,{focusedItemId:x}))}),l=M.useCallback(()=>!!i.current&&i.current.contains(pE(mn(i.current))),[i]),u=M.useCallback(y=>n.focusedItemId===y&&l(),[n.focusedItemId,l]),d=y=>{const x=e.getItemMeta(y);return x&&(x.parentId==null||e.isItemExpanded(x.parentId))},f=(y,x)=>{const C=e.getItemDOMElement(x);C&&C.focus(),a(x),t.onItemFocus&&t.onItemFocus(y,x)},h=Ve((y,x)=>{d(x)&&f(y,x)}),p=Ve(()=>{if(n.focusedItemId==null)return;if(e.getItemMeta(n.focusedItemId)){const x=e.getItemDOMElement(n.focusedItemId);x&&x.blur()}a(null)}),m=y=>y===s;cW(e,"removeItem",({id:y})=>{n.focusedItemId===y&&f(null,s)});const b=y=>x=>{y.onFocus?.(x),!x.defaultMuiPrevented&&x.target===x.currentTarget&&f(x,s)};return{getRootProps:y=>({onFocus:b(y)}),publicAPI:{focusItem:h},instance:{isItemFocused:u,canItemBeTabbed:m,focusItem:h,removeFocusedItem:p}}};gh.getInitialState=()=>({focusedItemId:null});gh.params={onItemFocus:!0};function fW(e){return!!e&&e.length===1&&!!e.match(/\S/)}const hE=({instance:e,params:t,state:n})=>{const r=kr(),o=M.useRef({}),i=Ve(d=>{o.current=d(o.current)});M.useEffect(()=>{if(e.areItemUpdatesPrevented())return;const d={},f=h=>{d[h.id]=h.label.substring(0,1).toLowerCase()};Object.values(n.items.itemMetaMap).forEach(f),o.current=d},[n.items.itemMetaMap,t.getItemId,e]);const s=(d,f)=>{const h=f.toLowerCase(),p=x=>{const C=Su(e,x);return C===null?al(e):C};let m=null,b=p(d);const y={};for(;m==null&&!y[b];)o.current[b]===h?m=b:(y[b]=!0,b=p(b));return m},a=d=>!t.disableSelection&&!e.isItemDisabled(d),l=d=>!e.isItemDisabled(d)&&e.isItemExpandable(d);return{instance:{updateFirstCharMap:i,handleItemKeyDown:(d,f)=>{if(d.defaultMuiPrevented||d.altKey||ll(d.target,d.currentTarget))return;const h=d.ctrlKey||d.metaKey,p=d.key;switch(!0){case(p===" "&&a(f)):{d.preventDefault(),t.multiSelect&&d.shiftKey?e.expandSelectionRange(d,f):e.selectItem({event:d,itemId:f,keepExistingSelection:t.multiSelect,shouldBeSelected:t.multiSelect?void 0:!0});break}case p==="Enter":{ui(e,xr)&&e.isItemEditable(f)&&!e.isItemBeingEdited(f)?e.setEditedItemId(f):l(f)?(e.toggleItemExpansion(d,f),d.preventDefault()):a(f)&&(t.multiSelect?(d.preventDefault(),e.selectItem({event:d,itemId:f,keepExistingSelection:!0})):e.isItemSelected(f)||(e.selectItem({event:d,itemId:f}),d.preventDefault()));break}case p==="ArrowDown":{const m=Su(e,f);m&&(d.preventDefault(),e.focusItem(d,m),t.multiSelect&&d.shiftKey&&a(m)&&e.selectItemFromArrowNavigation(d,f,m));break}case p==="ArrowUp":{const m=rE(e,f);m&&(d.preventDefault(),e.focusItem(d,m),t.multiSelect&&d.shiftKey&&a(m)&&e.selectItemFromArrowNavigation(d,f,m));break}case(p==="ArrowRight"&&!r||p==="ArrowLeft"&&r):{if(h)return;if(e.isItemExpanded(f)){const m=Su(e,f);m&&(e.focusItem(d,m),d.preventDefault())}else l(f)&&(e.toggleItemExpansion(d,f),d.preventDefault());break}case(p==="ArrowLeft"&&!r||p==="ArrowRight"&&r):{if(h)return;if(l(f)&&e.isItemExpanded(f))e.toggleItemExpansion(d,f),d.preventDefault();else{const m=e.getItemMeta(f).parentId;m&&(e.focusItem(d,m),d.preventDefault())}break}case p==="Home":{a(f)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromStartToItem(d,f):e.focusItem(d,al(e)),d.preventDefault();break}case p==="End":{a(f)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromItemToEnd(d,f):e.focusItem(d,oE(e)),d.preventDefault();break}case p==="*":{e.expandAllSiblings(d,f),d.preventDefault();break}case(String.fromCharCode(d.keyCode)==="A"&&h&&t.multiSelect&&!t.disableSelection):{e.selectAllNavigableItems(d),d.preventDefault();break}case(!h&&!d.shiftKey&&fW(p)):{const m=s(f,p);m!=null&&(e.focusItem(d,m),d.preventDefault());break}}}}}};hE.params={};const mE=({slots:e,slotProps:t})=>({contextValue:{icons:{slots:{collapseIcon:e.collapseIcon,expandIcon:e.expandIcon,endIcon:e.endIcon},slotProps:{collapseIcon:t.collapseIcon,expandIcon:t.expandIcon,endIcon:t.endIcon}}}});mE.params={};const pW=[Dl,Lc,_c,gh,hE,mE,xr],hW=["ownerState"];function mW({slots:e,slotProps:t,label:n,id:r,itemId:o,itemsToRender:i}){const s=e?.item??_V,a=Et({elementType:s,externalSlotProps:t?.item,additionalProps:{itemId:o,id:r,label:n},ownerState:{itemId:o,label:n}}),l=Ze(a,hW),u=M.useMemo(()=>i?c.jsx(gE,{itemsToRender:i,slots:e,slotProps:t}):null,[i,e,t]);return c.jsx(s,Y({},l,{children:u}))}function gE(e){const{itemsToRender:t,slots:n,slotProps:r}=e;return c.jsx(M.Fragment,{children:t.map(o=>c.jsx(mW,{slots:n,slotProps:r,label:o.label,id:o.id,itemId:o.itemId,itemsToRender:o.children},o.itemId))})}const gW=JC(),bW=e=>{const{classes:t}=e;return Ke({root:["root"]},VV,t)},yW=fe("ul",{name:"MuiRichTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0,position:"relative"}),xW=M.forwardRef(function(t,n){const r=gW({props:t,name:"MuiRichTreeView"}),{getRootProps:o,contextValue:i,instance:s}=JV({plugins:pW,rootRef:n,props:r}),{slots:a,slotProps:l}=r,u=bW(r),d=a?.root??yW,f=Et({elementType:d,externalSlotProps:l?.root,className:u.root,getSlotProps:o,ownerState:r});return c.jsx(mV,{value:i,children:c.jsx(d,Y({},f,{children:c.jsx(gE,{slots:a,slotProps:l,itemsToRender:s.getItemsToRender()})}))})}),CW=mt([c.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),c.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),EW=mt(c.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),vW=mt(c.jsx("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"})),TW=mt(c.jsx("path",{d:"M15 4v2h3v12h-3v2h5V4zM4 20h5v-2H6V6h3V4H4z"}));function SW({items:e,defaultExpandedItems:t,onClickTreeNode:n}){return c.jsx(xW,{items:AW(e,n),defaultExpandedItems:t,slots:{item:IW}})}const kW=eb.animated(sl);function wW(e){const t=eb.useSpring({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return c.jsx(kW,{style:t,...e})}function DW({item:e,...t}){const n=c.jsxs(zV,{...t,sx:{display:"flex",alignItems:"center",color:e.error?"error.main":"grey.600"},children:[e.fileType==="directory"&&c.jsx(HC,{})||e.fileType==="notebook"&&c.jsx(CW,{})||e.fileType==="model"&&c.jsx(TW,{})||e.fileType=="database"&&c.jsx(vW,{})||c.jsx(EW,{}),c.jsx(w.Typography,{variant:"body2",sx:{marginLeft:"5px"},color:e.error?"error.main":e.link?"primary.main":"grey.600",children:e.label})]});return e.error?c.jsx(w.Tooltip,{title:e.error,placement:"right",children:n}):n}const IW=M.forwardRef(function(t,n){const{id:r,itemId:o,label:i,children:s,disabled:a,...l}=t,{getRootProps:u,getContentProps:d,getLabelProps:f,getIconContainerProps:h,getGroupTransitionProps:p,status:m,publicAPI:b}=vV({id:r,itemId:o,children:s,label:i,disabled:a,rootRef:n}),y=b.getItem(o);return m.selected=!1,m.focused=!1,c.jsx(hh,{itemId:o,children:c.jsxs($V,{...u(l),children:[c.jsxs(HV,{...d(),...y.link&&{onClick:x=>y.link(x)},sx:{pointerEvents:!y.selectable&&"none"},children:[c.jsx(UV,{...h(),children:c.jsx(BV,{status:m})}),c.jsx(DW,{...f({item:y})})]}),s&&c.jsx(wW,{...p()})]})})});function AW(e,t){const n=new Map;return e.map(r=>{let o=n;const i=r.path.split("/");i.forEach((s,a)=>{a===i.length-1?o.set(s,r):(o.has(s)||o.set(s,new Map),o=o.get(s))})}),bE(n,"",t)}function bE(e,t,n){const r=[];return e.forEach((o,i)=>{const s=i.endsWith(".malloy")&&"model"||i.endsWith(".malloynb")&&"notebook"||i.endsWith(".parquet")&&"database"||"unknown";if(s!=="unknown"){const a=o;r.push({id:t+i,label:i,fileType:s,link:s==="model"||s==="notebook"?l=>n(t+i,l):void 0,selectable:s==="model"||s==="notebook",error:"error"in a?a.error:void 0})}else{const a=t+i+"/";r.push({id:a,label:i,fileType:"directory",selectable:!0,link:void 0,children:bE(o,a,n)})}}),r}const OW=["notebooks/","models/"];function MW({onClickModelFile:e,resourceUri:t}){const{environmentName:n,packageName:r,versionId:o}=Ht(t),{apiClients:i}=De.useServer(),{data:s,isError:a,error:l,isSuccess:u}=Xt({queryKey:["models",n,r,o],queryFn:()=>i.models.listModels(n,r,o)});return c.jsx(De.PackageCard,{children:c.jsxs(De.PackageCardContent,{children:[c.jsx(De.PackageSectionTitle,{children:"Semantic Models"}),c.jsxs(w.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!u&&!a&&c.jsx(Sn,{text:"Fetching Models..."}),a&&c.jsx(kn,{error:l,context:`${n} > ${r} > Models`}),u&&s.data.length>0&&c.jsx(SW,{items:s.data.sort((d,f)=>d.path.localeCompare(f.path)),onClickTreeNode:e,defaultExpandedItems:OW}),u&&s.data.length===0&&c.jsx(w.Typography,{variant:"body2",children:"No models found"})]})]})})}function yE(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function xE(e){return{"--malloy-render--font-family":e.font.family,"--malloy-render--table-font-size":`${e.font.size}px`,"--malloy-render--table-header-color":e.tableHeader,"--malloy-render--table-body-color":e.tableBody,"--malloy-render--table-border":e.border,"--malloy-render--table-pinned-border":e.pinnedBorder,"--malloy-render--tile-background":e.tile,"--publisher-dashboard-root":e.dashboardRoot,"--malloy-render--label-color":e.tileTitle,"--malloy-render--value-color":e.valueColor}}function CE(e){const{foreground:t,axisFaint:n,font:r}=e,o={background:e.background,font:r.family,title:{color:t,font:r.family},axis:{labelColor:t,titleColor:t,domainColor:n,tickColor:n,gridColor:n,labelFont:r.family,titleFont:r.family},legend:{labelColor:t,titleColor:t,labelFont:r.family,titleFont:r.family},header:{labelColor:t,titleColor:t},range:{category:e.series}};return i=>o}function EE(e){if(!e)return;const t=e.tag("theme");if(!t)return;const n={},r=t.tag("palette");if(r){const i={},s=r.textArray("series");s&&s.length>0&&(i.series=s);for(const a of De.PER_MODE_COLOR_KEYS){const l=r.tag(a);if(!l)continue;const u={},d=l.text("light"),f=l.text("dark");d&&(u.light=d),f&&(u.dark=f),Object.keys(u).length>0&&(i[a]=u)}Object.keys(i).length>0&&(n.palette=i)}const o=t.tag("font");if(o){const i={},s=o.text("family");s&&(i.family=s);const a=o.numeric("size");typeof a=="number"&&Number.isFinite(a)&&(i.size=a),Object.keys(i).length>0&&(n.font=i)}return Object.keys(n).length>0?n:void 0}const PW=async(e,t)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:n}=await import("@malloydata/render");return new n({onClick:t,vegaConfigOverride:CE(e),theme:yE(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};typeof window<"u"&&import("@malloydata/render");async function RW(e){if(!e||typeof e!="object")return;const t=e,n=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(n.length===0)return;let r;try{({parseAnnotation:r}=await import("@malloydata/malloy-tag"))}catch{return}try{const{tag:o}=r(n);return EE(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:n});return}}function NW(e,t){const n=xE(t);for(const[r,o]of Object.entries(n))e.style.setProperty(r,o)}const FW=`
227
227
  /* dashboard.css hardcodes background: #f7f9fc on .malloy-dashboard
228
228
  and .dashboard-row-header, which would paint light grey in dark
229
229
  mode and also bleed an operator-picked palette.background across
@@ -306,4 +306,4 @@ div.malloy-render .malloy-dashboard .dashboard-row-header {
306
306
  ${s}
307
307
  limit: ${r}
308
308
  }
309
- `}function SE(e){const{environment:t,package:n,model:r,source:o,filterSelections:i,fields:s,limit:a=1e3}=e,[l,u]=W.useState(null),d=W.useMemo(()=>HW(o,i,s,a),[o,i,s,a]),f=W.useMemo(()=>Cl({environmentName:t,packageName:n,modelPath:r}),[t,n,r]),h=i.length>0,p=W.useCallback(()=>{if(!h){u(null);return}const m=dh({resourceUri:f,query:d});u(m)},[h,f,d]);return{embeddedQueryResult:l,queryString:d,resourceUri:f,executeQuery:p,canExecute:h}}function zW(e,t=5e3){const n=e.dimensionSpecs[0]?.source??"",r=e.dimensionSpecs[0]?.model??"",{filterStates:o,updateFilter:i,clearAllFilters:s,getActiveFilters:a}=ch({dimensionSpecs:e.dimensionSpecs}),l=W.useMemo(()=>a(),[o,a]),{data:u,noRowsMatchedFilter:d,isLoading:f,isError:h,error:p,refetch:m}=uh({environment:e.environment,package:e.package,indexLimit:e.indexLimit,dimensionSpecs:e.dimensionSpecs,versionId:e.versionId,activeFilters:l}),b=f&&!u,{embeddedQueryResult:y,queryString:x,executeQuery:C,canExecute:v}=SE({environment:e.environment,package:e.package,model:r,source:n,filterSelections:l,limit:t,fields:e.selectFields});return{filterStates:o,updateFilter:i,clearAllFilters:s,activeFilters:l,data:u,noRowsMatchedFilter:d,isLoading:f,isInitialLoading:b,isError:h,error:p,refetch:m,embeddedQueryResult:y,queryString:x,executeQuery:C,canExecute:v}}function UW({modelPath:e,query:t,sourceName:n,queryName:r,enabled:o=!0,resourceUri:i}){const{environmentName:s,packageName:a,versionId:l}=Ht(i),{apiClients:u}=De.useServer(),{data:d,isSuccess:f,isError:h,error:p,isLoading:m}=Xt({queryKey:["rawQueryData",s,a,e,l,t,n,r],queryFn:()=>u.models.executeQueryModel(s,a,e,{query:t,sourceName:n,queryName:r,versionId:l}),enabled:o});return{data:f&&d?.data?.result?(()=>{try{return JSON.parse(d.data.result).data?.array_value||[]}catch(y){return console.error("Failed to parse query result:",y),[]}})():[],isSuccess:f,isError:h,error:p,isLoading:m}}exports.AnalyzePackageButton=bN;exports.BrowserWorkbookStorage=gN;exports.ConnectionExplorer=L2;exports.DOC_LINKS=ss;exports.DimensionFilter=RC;exports.EmbeddedQueryResult=GU;exports.Environment=n7;exports.EnvironmentMaterializations=T2;exports.Home=RU;exports.Loading=Sn;exports.Materializations=hL;exports.Model=_U;exports.ModelExplorer=ah;exports.ModelExplorerDialog=lh;exports.Models=AW;exports.Notebook=GC;exports.Package=sV;exports.Packages=_2;exports.PageViewer=MW;exports.QueryResult=KC;exports.RenderedResult=vE;exports.ResultContainer=Os;exports.SourceExplorerComponent=qx;exports.SourcesExplorer=kp;exports.Workbook=hN;exports.WorkbookList=Qx;exports.WorkbookManager=ns;exports.WorkbookStorageProvider=dN;exports.buildMalloyExplicitTheme=yE;exports.buildTableCssVars=xE;exports.buildVegaThemeOverride=CE;exports.ccount=cf;exports.createEmbeddedQueryResult=dh;exports.encodeResourceUri=Cl;exports.extractDimensionSpecs=_C;exports.extractSourceFromQuery=mU;exports.find=hl;exports.generateFilterClause=hU;exports.getDimensionKey=xo;exports.getJoinedSources=fU;exports.html=vs;exports.htmlVoidElements=jy;exports.injectWhereClause=gU;exports.makeDimensionKey=zC;exports.packageFileUrl=ZC;exports.parseAllSourceInfos=LC;exports.parseDimensionFilterAnnotation=FC;exports.parseNotebookFilterAnnotation=NC;exports.parseResourceUri=Ht;exports.readChartAnnotations=EE;exports.stringify=cc;exports.stringify$1=dc;exports.svg=_o;exports.useDimensionFilters=ch;exports.useDimensionFiltersFromSpec=zW;exports.useDimensionFiltersQuery=SE;exports.useDimensionalFilterRangeData=uh;exports.useGivensForm=WC;exports.useModelData=sh;exports.useModelGivens=qC;exports.useRawQueryData=UW;exports.useRouterClickHandler=Gx;exports.whitespace=Gf;exports.zwitch=yc;
309
+ `}function SE(e){const{environment:t,package:n,model:r,source:o,filterSelections:i,fields:s,limit:a=1e3}=e,[l,u]=W.useState(null),d=W.useMemo(()=>HW(o,i,s,a),[o,i,s,a]),f=W.useMemo(()=>Cl({environmentName:t,packageName:n,modelPath:r}),[t,n,r]),h=i.length>0,p=W.useCallback(()=>{if(!h){u(null);return}const m=dh({resourceUri:f,query:d});u(m)},[h,f,d]);return{embeddedQueryResult:l,queryString:d,resourceUri:f,executeQuery:p,canExecute:h}}function zW(e,t=5e3){const n=e.dimensionSpecs[0]?.source??"",r=e.dimensionSpecs[0]?.model??"",{filterStates:o,updateFilter:i,clearAllFilters:s,getActiveFilters:a}=ch({dimensionSpecs:e.dimensionSpecs}),l=W.useMemo(()=>a(),[o,a]),{data:u,noRowsMatchedFilter:d,isLoading:f,isError:h,error:p,refetch:m}=uh({environment:e.environment,package:e.package,indexLimit:e.indexLimit,dimensionSpecs:e.dimensionSpecs,versionId:e.versionId,activeFilters:l}),b=f&&!u,{embeddedQueryResult:y,queryString:x,executeQuery:C,canExecute:v}=SE({environment:e.environment,package:e.package,model:r,source:n,filterSelections:l,limit:t,fields:e.selectFields});return{filterStates:o,updateFilter:i,clearAllFilters:s,activeFilters:l,data:u,noRowsMatchedFilter:d,isLoading:f,isInitialLoading:b,isError:h,error:p,refetch:m,embeddedQueryResult:y,queryString:x,executeQuery:C,canExecute:v}}function UW({modelPath:e,query:t,sourceName:n,queryName:r,enabled:o=!0,resourceUri:i}){const{environmentName:s,packageName:a,versionId:l}=Ht(i),{apiClients:u}=De.useServer(),{data:d,isSuccess:f,isError:h,error:p,isLoading:m}=Xt({queryKey:["rawQueryData",s,a,e,l,t,n,r],queryFn:()=>u.models.executeQueryModel(s,a,e,{query:t,sourceName:n,queryName:r,versionId:l}),enabled:o});return{data:f&&d?.data?.result?(()=>{try{return JSON.parse(d.data.result).data?.array_value||[]}catch(y){return console.error("Failed to parse query result:",y),[]}})():[],isSuccess:f,isError:h,error:p,isLoading:m}}exports.AnalyzePackageButton=bN;exports.BrowserWorkbookStorage=gN;exports.ConnectionExplorer=j2;exports.DOC_LINKS=ss;exports.DataAppViewer=EN;exports.DimensionFilter=LC;exports.EmbeddedQueryResult=JU;exports.Environment=s7;exports.EnvironmentMaterializations=w2;exports.Home=_U;exports.Loading=Sn;exports.Materializations=yL;exports.Model=HU;exports.ModelExplorer=ah;exports.ModelExplorerDialog=lh;exports.Models=MW;exports.Notebook=ZC;exports.Package=lV;exports.Packages=$2;exports.QueryResult=XC;exports.RenderedResult=vE;exports.ResultContainer=Os;exports.SourceExplorerComponent=qx;exports.SourcesExplorer=kp;exports.Workbook=hN;exports.WorkbookList=Qx;exports.WorkbookManager=ns;exports.WorkbookStorageProvider=dN;exports.buildMalloyExplicitTheme=yE;exports.buildTableCssVars=xE;exports.buildVegaThemeOverride=CE;exports.ccount=cf;exports.createEmbeddedQueryResult=dh;exports.encodeResourceUri=Cl;exports.extractDimensionSpecs=$C;exports.extractSourceFromQuery=xU;exports.find=hl;exports.generateFilterClause=yU;exports.getDimensionKey=xo;exports.getJoinedSources=gU;exports.html=vs;exports.htmlVoidElements=jy;exports.injectWhereClause=CU;exports.makeDimensionKey=WC;exports.packageFileUrl=Jx;exports.parseAllSourceInfos=jC;exports.parseDimensionFilterAnnotation=BC;exports.parseNotebookFilterAnnotation=_C;exports.parseResourceUri=Ht;exports.readChartAnnotations=EE;exports.stringify=cc;exports.stringify$1=dc;exports.svg=_o;exports.useDimensionFilters=ch;exports.useDimensionFiltersFromSpec=zW;exports.useDimensionFiltersQuery=SE;exports.useDimensionalFilterRangeData=uh;exports.useGivensForm=KC;exports.useModelData=sh;exports.useModelGivens=GC;exports.useRawQueryData=UW;exports.useRouterClickHandler=Gx;exports.whitespace=Gf;exports.zwitch=yc;