@malloy-publisher/sdk 0.2.7 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +180 -204
- package/dist/DocumentStorageProvider-BeBD0uWc.cjs.js +134 -0
- package/dist/DocumentStorageProvider-tGvodI8f.es.js +24268 -0
- package/dist/RenderedResult-CPi6uQWq.cjs.js +115 -0
- package/dist/RenderedResult-mDE-4u8S.es.js +542 -0
- package/dist/{ServerProvider-xXW1HJOJ.cjs.js → ServerProvider-CH71GsoL.cjs.js} +1 -1
- package/dist/{ServerProvider-ksC5Su_x.es.js → ServerProvider-X2Ma0HRs.es.js} +324 -359
- package/dist/builder/index.cjs.js +105 -0
- package/dist/builder/index.d.ts +2 -0
- package/dist/builder/index.es.js +9561 -0
- package/dist/builder-entry.d.ts +8 -0
- package/dist/client/api.d.ts +13 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/ApiErrorDisplay.d.ts +1 -2
- package/dist/components/Dashboard/Dashboard.d.ts +23 -16
- package/dist/components/Dashboard/DashboardGrid.d.ts +67 -0
- package/dist/components/Dashboard/DashboardTile.d.ts +6 -1
- package/dist/components/Dashboard/ExploreDialog.d.ts +18 -0
- package/dist/components/Dashboard/RowsDialog.d.ts +47 -0
- package/dist/components/Dashboard/TileCard.d.ts +44 -0
- package/dist/components/Dashboard/index.d.ts +2 -0
- package/dist/components/Dashboard/promoteMeasureRow.d.ts +40 -0
- package/dist/components/Dashboard/telemetry.d.ts +43 -0
- package/dist/components/DashboardBuilder/AddTileDialog.d.ts +35 -0
- package/dist/components/DashboardBuilder/BuilderToolbar.d.ts +29 -0
- package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +112 -0
- package/dist/components/DashboardBuilder/DashboardEditor.d.ts +32 -0
- package/dist/components/DashboardBuilder/DiffDialog.d.ts +15 -0
- package/dist/components/DashboardBuilder/DrillDialog.d.ts +15 -0
- package/dist/components/DashboardBuilder/FilterDialog.d.ts +54 -0
- package/dist/components/DashboardBuilder/FilterStrip.d.ts +17 -0
- package/dist/components/DashboardBuilder/SettingsPopover.d.ts +20 -0
- package/dist/components/DashboardBuilder/TileFrame.d.ts +42 -0
- package/dist/components/DashboardBuilder/TileMenu.d.ts +24 -0
- package/dist/components/DashboardBuilder/catalog.d.ts +62 -0
- package/dist/components/DashboardBuilder/controls.d.ts +157 -0
- package/dist/components/DashboardBuilder/diff.d.ts +35 -0
- package/dist/components/DashboardBuilder/document.d.ts +218 -0
- package/dist/components/DashboardBuilder/layout.d.ts +71 -0
- package/dist/components/DashboardBuilder/malloyText.d.ts +45 -0
- package/dist/components/DashboardBuilder/preview.d.ts +60 -0
- package/dist/components/DashboardBuilder/readDocument.d.ts +106 -0
- package/dist/components/DashboardBuilder/sortable.d.ts +51 -0
- package/dist/components/DashboardBuilder/spliceDocument.d.ts +44 -0
- package/dist/components/DashboardBuilder/testing/fixtures.d.ts +10 -0
- package/dist/components/DashboardBuilder/useBuilderShortcuts.d.ts +22 -0
- package/dist/components/DashboardBuilder/useDashboardEditor.d.ts +63 -0
- package/dist/components/DashboardBuilder/useDraft.d.ts +13 -0
- package/dist/components/DashboardBuilder/useFilterForm.d.ts +65 -0
- package/dist/components/DashboardBuilder/useTileReorder.d.ts +22 -0
- package/dist/components/DashboardBuilder/useTileResize.d.ts +29 -0
- package/dist/components/DocumentStorage/BrowserDocumentStorage.d.ts +14 -0
- package/dist/components/DocumentStorage/DocumentStorage.d.ts +58 -0
- package/dist/components/DocumentStorage/DocumentStorageProvider.d.ts +25 -0
- package/dist/components/DocumentStorage/index.d.ts +3 -0
- package/dist/components/FloatingIconButton.d.ts +16 -0
- package/dist/components/Model/index.d.ts +0 -1
- package/dist/components/Prose.d.ts +46 -0
- package/dist/components/RenderedResult/RenderedResult.d.ts +12 -0
- package/dist/components/RenderedResult/ResultContainer.d.ts +7 -1
- package/dist/components/RenderedResult/ResultPanel.d.ts +30 -0
- package/dist/components/RenderedResult/index.d.ts +2 -0
- package/dist/components/RenderedResult/resultSizing.d.ts +183 -0
- package/dist/components/drill/index.d.ts +2 -1
- package/dist/components/drill/resolveDrill.d.ts +22 -0
- package/dist/components/drill/useDrill.d.ts +11 -2
- package/dist/components/drill/useDrillSelf.d.ts +46 -0
- package/dist/components/given/filterValue.d.ts +63 -0
- package/dist/components/given/index.d.ts +1 -0
- package/dist/components/given/useGivenUrlParams.d.ts +39 -0
- package/dist/components/index.d.ts +3 -3
- package/dist/components/styles.d.ts +3 -7
- package/dist/core-8NVBCLZh.cjs.js +148 -0
- package/dist/{core-BY7vB5gN.es.js → core-B8oMW4sm.es.js} +3540 -2335
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/useDocumentControls.d.ts +70 -0
- package/dist/hooks/useQueryResult.d.ts +40 -0
- package/dist/hooks/useSuggestOptions.d.ts +28 -12
- package/dist/index.cjs.js +34 -1
- package/dist/index.es.js +21487 -79
- package/dist/sdk.css +1 -1
- package/dist/styles.css +0 -1
- package/dist/utils/malloyLiteral.d.ts +11 -0
- package/package.json +25 -14
- package/src/builder-entry.ts +55 -0
- package/src/components/ApiErrorDisplay.tsx +1 -1
- package/src/components/Connections/EditConnectionDialog.tsx +96 -86
- package/src/components/Dashboard/Dashboard.spec.tsx +7 -10
- package/src/components/Dashboard/Dashboard.tsx +184 -229
- package/src/components/Dashboard/DashboardGrid.tsx +124 -0
- package/src/components/Dashboard/DashboardTile.spec.tsx +30 -6
- package/src/components/Dashboard/DashboardTile.tsx +67 -101
- package/src/components/Dashboard/ExploreDialog.tsx +84 -0
- package/src/components/Dashboard/RowsDialog.spec.ts +42 -0
- package/src/components/Dashboard/RowsDialog.tsx +234 -0
- package/src/components/Dashboard/TileCard.tsx +120 -0
- package/src/components/Dashboard/index.ts +2 -0
- package/src/components/Dashboard/promoteMeasureRow.spec.ts +207 -0
- package/src/components/Dashboard/promoteMeasureRow.ts +160 -0
- package/src/components/Dashboard/telemetry.ts +44 -0
- package/src/components/Dashboard/tileGridColumn.spec.ts +1 -1
- package/src/components/DashboardBuilder/AddTileDialog.tsx +249 -0
- package/src/components/DashboardBuilder/BuilderToolbar.tsx +270 -0
- package/src/components/DashboardBuilder/DashboardBuilder.spec.tsx +858 -0
- package/src/components/DashboardBuilder/DashboardBuilder.tsx +653 -0
- package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +211 -0
- package/src/components/DashboardBuilder/DashboardEditor.tsx +493 -0
- package/src/components/DashboardBuilder/DiffDialog.tsx +129 -0
- package/src/components/DashboardBuilder/DrillDialog.tsx +281 -0
- package/src/components/DashboardBuilder/FilterDialog.tsx +581 -0
- package/src/components/DashboardBuilder/FilterStrip.tsx +125 -0
- package/src/components/DashboardBuilder/SettingsPopover.tsx +168 -0
- package/src/components/DashboardBuilder/TileFrame.tsx +380 -0
- package/src/components/DashboardBuilder/TileMenu.tsx +188 -0
- package/src/components/DashboardBuilder/catalog.spec.ts +215 -0
- package/src/components/DashboardBuilder/catalog.ts +225 -0
- package/src/components/DashboardBuilder/controls.spec.ts +243 -0
- package/src/components/DashboardBuilder/controls.ts +398 -0
- package/src/components/DashboardBuilder/diff.spec.ts +44 -0
- package/src/components/DashboardBuilder/diff.ts +93 -0
- package/src/components/DashboardBuilder/document.ts +209 -0
- package/src/components/DashboardBuilder/keepRowStructure.spec.ts +84 -0
- package/src/components/DashboardBuilder/layout.ts +143 -0
- package/src/components/DashboardBuilder/malloyText.spec.ts +84 -0
- package/src/components/DashboardBuilder/malloyText.ts +151 -0
- package/src/components/DashboardBuilder/moveIntoGap.spec.ts +90 -0
- package/src/components/DashboardBuilder/preview.spec.ts +149 -0
- package/src/components/DashboardBuilder/preview.ts +172 -0
- package/src/components/DashboardBuilder/readDocument.spec.ts +375 -0
- package/src/components/DashboardBuilder/readDocument.ts +467 -0
- package/src/components/DashboardBuilder/sortable.tsx +151 -0
- package/src/components/DashboardBuilder/spliceDocument.spec.ts +1108 -0
- package/src/components/DashboardBuilder/spliceDocument.ts +1098 -0
- package/src/components/DashboardBuilder/testing/fixtures.ts +48 -0
- package/src/components/DashboardBuilder/useBuilderShortcuts.ts +88 -0
- package/src/components/DashboardBuilder/useDashboardEditor.spec.ts +255 -0
- package/src/components/DashboardBuilder/useDashboardEditor.ts +193 -0
- package/src/components/DashboardBuilder/useDraft.ts +43 -0
- package/src/components/DashboardBuilder/useFilterForm.spec.tsx +144 -0
- package/src/components/DashboardBuilder/useFilterForm.ts +352 -0
- package/src/components/DashboardBuilder/useTileReorder.spec.tsx +97 -0
- package/src/components/DashboardBuilder/useTileReorder.ts +115 -0
- package/src/components/DashboardBuilder/useTileResize.spec.tsx +121 -0
- package/src/components/DashboardBuilder/useTileResize.ts +110 -0
- package/src/components/DashboardBuilder/withGaps.spec.ts +96 -0
- package/src/components/DocumentStorage/BrowserDocumentStorage.spec.ts +81 -0
- package/src/components/DocumentStorage/BrowserDocumentStorage.ts +105 -0
- package/src/components/DocumentStorage/DocumentStorage.ts +73 -0
- package/src/components/DocumentStorage/DocumentStorageProvider.tsx +58 -0
- package/src/components/DocumentStorage/index.ts +16 -0
- package/src/components/Environment/About.tsx +4 -36
- package/src/components/FloatingIconButton.tsx +41 -0
- package/src/components/Model/Model.tsx +6 -23
- package/src/components/Model/ModelCell.tsx +34 -72
- package/src/components/Model/index.ts +0 -1
- package/src/components/Notebook/Notebook.tsx +27 -156
- package/src/components/Notebook/NotebookCell.tsx +37 -191
- package/src/components/Prose.spec.tsx +85 -0
- package/src/components/Prose.tsx +179 -0
- package/src/components/QueryResult/QueryResult.tsx +15 -43
- package/src/components/RenderedResult/RenderedResult.tsx +86 -76
- package/src/components/RenderedResult/ResultContainer.tsx +25 -36
- package/src/components/RenderedResult/ResultPanel.spec.tsx +49 -0
- package/src/components/RenderedResult/ResultPanel.tsx +73 -0
- package/src/components/RenderedResult/index.ts +16 -0
- package/src/components/RenderedResult/resultSizing.spec.ts +249 -0
- package/src/components/RenderedResult/resultSizing.ts +308 -0
- package/src/components/ResultsDialog.tsx +2 -1
- package/src/components/drill/index.ts +6 -0
- package/src/components/drill/resolveDrill.ts +22 -1
- package/src/components/drill/useDrill.spec.tsx +94 -0
- package/src/components/drill/useDrill.tsx +52 -12
- package/src/components/drill/useDrillSelf.spec.tsx +64 -0
- package/src/components/drill/useDrillSelf.ts +110 -0
- package/src/components/given/GivenInput.spec.tsx +196 -2
- package/src/components/given/GivenInput.tsx +300 -25
- package/src/components/given/GivensPanel.tsx +1 -1
- package/src/components/given/filterValue.spec.ts +112 -0
- package/src/components/given/filterValue.ts +188 -0
- package/src/components/given/index.ts +4 -0
- package/src/components/given/useGivenUrlParams.spec.tsx +74 -0
- package/src/components/given/useGivenUrlParams.ts +87 -0
- package/src/components/index.ts +11 -3
- package/src/components/styles.ts +0 -37
- package/src/hooks/index.ts +13 -1
- package/src/hooks/useDocumentControls.ts +170 -0
- package/src/hooks/useGivensState.spec.ts +158 -0
- package/src/hooks/useGivensState.ts +114 -23
- package/src/hooks/useQueryResult.ts +82 -0
- package/src/hooks/useSuggestOptions.dom.spec.ts +60 -1
- package/src/hooks/useSuggestOptions.ts +94 -51
- package/src/utils/malloyLiteral.spec.ts +43 -0
- package/src/utils/malloyLiteral.ts +76 -0
- package/vite.config.ts +5 -1
- package/dist/components/AnalyzePackageButton.d.ts +0 -6
- package/dist/components/Workbook/BrowserWorkbookStorage.d.ts +0 -9
- package/dist/components/Workbook/EditableMalloyCell.d.ts +0 -11
- package/dist/components/Workbook/ModelPicker.d.ts +0 -11
- package/dist/components/Workbook/MutableCell.d.ts +0 -17
- package/dist/components/Workbook/Workbook.d.ts +0 -7
- package/dist/components/Workbook/WorkbookList.d.ts +0 -7
- package/dist/components/Workbook/WorkbookManager.d.ts +0 -84
- package/dist/components/Workbook/WorkbookStorage.d.ts +0 -17
- package/dist/components/Workbook/WorkbookStorageProvider.d.ts +0 -12
- package/dist/components/Workbook/index.d.ts +0 -7
- package/dist/core-CWKmWEg2.cjs.js +0 -148
- package/dist/index-B0WyZAUA.es.js +0 -66412
- package/dist/index-kxVD1RjY.cjs.js +0 -356
- package/dist/markdown-editor.css +0 -341
- package/src/components/AnalyzePackageButton.tsx +0 -319
- package/src/components/Workbook/BrowserWorkbookStorage.ts +0 -64
- package/src/components/Workbook/EditableMalloyCell.tsx +0 -49
- package/src/components/Workbook/ModelPicker.tsx +0 -134
- package/src/components/Workbook/MutableCell.tsx +0 -458
- package/src/components/Workbook/Workbook.tsx +0 -501
- package/src/components/Workbook/WorkbookList.tsx +0 -110
- package/src/components/Workbook/WorkbookManager.ts +0 -214
- package/src/components/Workbook/WorkbookStorage.ts +0 -35
- package/src/components/Workbook/WorkbookStorageProvider.tsx +0 -40
- package/src/components/Workbook/index.ts +0 -10
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
"use strict";var wT=Object.create;var wm=Object.defineProperty;var DT=Object.getOwnPropertyDescriptor;var IT=Object.getOwnPropertyNames;var AT=Object.getPrototypeOf,OT=Object.prototype.hasOwnProperty;var MT=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of IT(t))!OT.call(e,o)&&o!==n&&wm(e,o,{get:()=>t[o],enumerable:!(r=DT(t,o))||r.enumerable});return e};var ea=(e,t,n)=>(n=e!=null?wT(AT(e)):{},MT(t||!e||!e.__esModule?wm(n,"default",{value:e,enumerable:!0}):n,e));const c=require("react/jsx-runtime"),k=require("@mui/material"),W=require("react"),Tr=require("@tanstack/react-query"),Ie=require("./ServerProvider-xXW1HJOJ.cjs.js"),Ot=require("@mui/system"),PT=require("@emotion/styled"),RT=require("@emotion/react"),Fu=require("markdown-to-jsx"),On=require("@mui/icons-material"),Ia=require("react-dom"),Is=require("@malloydata/malloy-filter"),Db=require("@react-spring/web"),NT=require("react-router-dom");function Ib(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=Ib(W),FT=Ib(Ia),Dm=e=>e,LT=()=>{let e=Dm;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Dm}}},Ab=LT();function bo(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 Le(e){if(typeof e!="string")throw new Error(bo(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Im(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function Sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _T(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 sd={exports:{}},ad,Am;function BT(){if(Am)return ad;Am=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ad=e,ad}var ld,Om;function jT(){if(Om)return ld;Om=1;var e=BT();function t(){}function n(){}return n.resetWarningCache=t,ld=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},ld}var Mm;function $T(){return Mm||(Mm=1,sd.exports=jT()()),sd.exports}var HT=$T();const Ee=Sr(HT);function Ob(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=Ob(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=Ob(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 ud={exports:{}},Ht={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-is.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Pm;function zT(){if(Pm)return Ht;Pm=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function m(b){if(typeof b=="object"&&b!==null){var y=b.$$typeof;switch(y){case e:switch(b=b.type,b){case n:case o:case r:case l:case u:case h:return b;default:switch(b=b&&b.$$typeof,b){case s:case a:case f:case d:return b;case i:return b;default:return y}}case t:return y}}}return Ht.ContextConsumer=i,Ht.ContextProvider=s,Ht.Element=e,Ht.ForwardRef=a,Ht.Fragment=n,Ht.Lazy=f,Ht.Memo=d,Ht.Portal=t,Ht.Profiler=o,Ht.StrictMode=r,Ht.Suspense=l,Ht.SuspenseList=u,Ht.isContextConsumer=function(b){return m(b)===i},Ht.isContextProvider=function(b){return m(b)===s},Ht.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Ht.isForwardRef=function(b){return m(b)===a},Ht.isFragment=function(b){return m(b)===n},Ht.isLazy=function(b){return m(b)===f},Ht.isMemo=function(b){return m(b)===d},Ht.isPortal=function(b){return m(b)===t},Ht.isProfiler=function(b){return m(b)===o},Ht.isStrictMode=function(b){return m(b)===r},Ht.isSuspense=function(b){return m(b)===l},Ht.isSuspenseList=function(b){return m(b)===u},Ht.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===o||b===r||b===l||b===u||typeof b=="object"&&b!==null&&(b.$$typeof===f||b.$$typeof===d||b.$$typeof===s||b.$$typeof===i||b.$$typeof===a||b.$$typeof===p||b.getModuleId!==void 0)},Ht.typeOf=m,Ht}var Rm;function UT(){return Rm||(Rm=1,ud.exports=zT()),ud.exports}var Mb=UT();function Qr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Pb(e){if(M.isValidElement(e)||Mb.isValidElementType(e)||!Qr(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Pb(e[n])}),t}function An(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return Qr(e)&&Qr(t)&&Object.keys(t).forEach(o=>{M.isValidElement(t[o])||Mb.isValidElementType(t[o])?r[o]=t[o]:Qr(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&Qr(e[o])?r[o]=An(e[o],t[o],n):n.clone?r[o]=Qr(t[o])?Pb(t[o]):t[o]:r[o]=t[o]}),r}function Fa(e,t){return t?An(e,t,{clone:!1}):e}function Nm(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,o)=>{const i=/min-width:\s*([0-9.]+)/;return+(r.match(i)?.[1]||0)-+(o.match(i)?.[1]||0)});return n.length?n.reduce((r,o)=>{const i=t[o];return delete r[o],r[o]=i,r},{...t}):t}function VT(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function WT(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,o]=n,i=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(i)}function qT(e){const t=(i,s)=>i.replace("@media",s?`@container ${s}`:"@container");function n(i,s){i.up=(...a)=>t(e.breakpoints.up(...a),s),i.down=(...a)=>t(e.breakpoints.down(...a),s),i.between=(...a)=>t(e.breakpoints.between(...a),s),i.only=(...a)=>t(e.breakpoints.only(...a),s),i.not=(...a)=>{const l=t(e.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},o=i=>(n(r,i),r);return n(o),{...e,containerQueries:o}}const lc={xs:0,sm:600,md:900,lg:1200,xl:1536},Fm={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${lc[e]}px)`},YT={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:lc[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function yo(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const i=r.breakpoints||Fm;return t.reduce((s,a,l)=>(s[i.up(i.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const i=r.breakpoints||Fm;return Object.keys(t).reduce((s,a)=>{if(VT(i.keys,a)){const l=WT(r.containerQueries?r:YT,a);l&&(s[l]=n(t[a],a))}else if(Object.keys(i.values||lc).includes(a)){const l=i.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function KT(e={}){return e.keys?.reduce((n,r)=>{const o=e.up(r);return n[o]={},n},{})||{}}function Lm(e,t){return e.reduce((n,r)=>{const o=n[r];return(!o||Object.keys(o).length===0)&&delete n[r],n},t)}function uc(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(r!=null)return r}return t.split(".").reduce((r,o)=>r&&r[o]!=null?r[o]:null,e)}function Lu(e,t,n,r=n){let o;return typeof e=="function"?o=e(n):Array.isArray(e)?o=e[n]||r:o=uc(e,n)||r,t&&(o=t(o,r,e)),o}function dn(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,i=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,u=uc(l,r)||{};return yo(s,a,f=>{let h=Lu(u,o,f);return f===h&&typeof f=="string"&&(h=Lu(u,o,`${t}${f==="default"?"":Le(f)}`,f)),n===!1?h:{[n]:h}})};return i.propTypes={},i.filterProps=[t],i}function GT(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const QT={m:"margin",p:"padding"},XT={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},_m={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},ZT=GT(e=>{if(e.length>2)if(_m[e])e=_m[e];else return[e];const[t,n]=e.split(""),r=QT[t],o=XT[n]||"";return Array.isArray(o)?o.map(i=>r+i):[r+o]}),Jf=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],ep=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Jf,...ep];function yl(e,t,n,r){const o=uc(e,t,!0)??n;return typeof o=="number"||typeof o=="string"?i=>typeof i=="string"?i:typeof o=="string"?o.startsWith("var(")&&i===0?0:o.startsWith("var(")&&i===1?o:`calc(${i} * ${o})`:o*i:Array.isArray(o)?i=>{if(typeof i=="string")return i;const s=Math.abs(i),a=o[s];return i>=0?a:typeof a=="number"?-a:typeof a=="string"&&a.startsWith("var(")?`calc(-1 * ${a})`:`-${a}`}:typeof o=="function"?o:()=>{}}function tp(e){return yl(e,"spacing",8)}function xl(e,t){return typeof t=="string"||t==null?t:e(t)}function JT(e,t){return n=>e.reduce((r,o)=>(r[o]=xl(t,n),r),{})}function eS(e,t,n,r){if(!t.includes(n))return null;const o=ZT(n),i=JT(o,r),s=e[n];return yo(e,s,i)}function Rb(e,t){const n=tp(e.theme);return Object.keys(e).map(r=>eS(e,t,r,n)).reduce(Fa,{})}function an(e){return Rb(e,Jf)}an.propTypes={};an.filterProps=Jf;function ln(e){return Rb(e,ep)}ln.propTypes={};ln.filterProps=ep;function cc(...e){const t=e.reduce((r,o)=>(o.filterProps.forEach(i=>{r[i]=o}),r),{}),n=r=>Object.keys(r).reduce((o,i)=>t[i]?Fa(o,t[i](r)):o,{});return n.propTypes={},n.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),n}function hr(e){return typeof e!="number"?e:`${e}px solid`}function kr(e,t){return dn({prop:e,themeKey:"borders",transform:t})}const tS=kr("border",hr),nS=kr("borderTop",hr),rS=kr("borderRight",hr),oS=kr("borderBottom",hr),iS=kr("borderLeft",hr),sS=kr("borderColor"),aS=kr("borderTopColor"),lS=kr("borderRightColor"),uS=kr("borderBottomColor"),cS=kr("borderLeftColor"),dS=kr("outline",hr),fS=kr("outlineColor"),dc=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=yl(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:xl(t,r)});return yo(e,e.borderRadius,n)}return null};dc.propTypes={};dc.filterProps=["borderRadius"];cc(tS,nS,rS,oS,iS,sS,aS,lS,uS,cS,dc,dS,fS);const fc=e=>{if(e.gap!==void 0&&e.gap!==null){const t=yl(e.theme,"spacing",8),n=r=>({gap:xl(t,r)});return yo(e,e.gap,n)}return null};fc.propTypes={};fc.filterProps=["gap"];const pc=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=yl(e.theme,"spacing",8),n=r=>({columnGap:xl(t,r)});return yo(e,e.columnGap,n)}return null};pc.propTypes={};pc.filterProps=["columnGap"];const hc=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=yl(e.theme,"spacing",8),n=r=>({rowGap:xl(t,r)});return yo(e,e.rowGap,n)}return null};hc.propTypes={};hc.filterProps=["rowGap"];const pS=dn({prop:"gridColumn"}),hS=dn({prop:"gridRow"}),mS=dn({prop:"gridAutoFlow"}),gS=dn({prop:"gridAutoColumns"}),bS=dn({prop:"gridAutoRows"}),yS=dn({prop:"gridTemplateColumns"}),xS=dn({prop:"gridTemplateRows"}),vS=dn({prop:"gridTemplateAreas"}),CS=dn({prop:"gridArea"});cc(fc,pc,hc,pS,hS,mS,gS,bS,yS,xS,vS,CS);function us(e,t){return t==="grey"?t:e}const ES=dn({prop:"color",themeKey:"palette",transform:us}),TS=dn({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:us}),SS=dn({prop:"backgroundColor",themeKey:"palette",transform:us});cc(ES,TS,SS);function rr(e){return e<=1&&e!==0?`${e*100}%`:e}const kS=dn({prop:"width",transform:rr}),np=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||lc[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:rr(n)}};return yo(e,e.maxWidth,t)}return null};np.filterProps=["maxWidth"];const wS=dn({prop:"minWidth",transform:rr}),DS=dn({prop:"height",transform:rr}),IS=dn({prop:"maxHeight",transform:rr}),AS=dn({prop:"minHeight",transform:rr});dn({prop:"size",cssProperty:"width",transform:rr});dn({prop:"size",cssProperty:"height",transform:rr});const OS=dn({prop:"boxSizing"});cc(kS,np,wS,DS,IS,AS,OS);const vl={border:{themeKey:"borders",transform:hr},borderTop:{themeKey:"borders",transform:hr},borderRight:{themeKey:"borders",transform:hr},borderBottom:{themeKey:"borders",transform:hr},borderLeft:{themeKey:"borders",transform:hr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:hr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:dc},color:{themeKey:"palette",transform:us},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:us},backgroundColor:{themeKey:"palette",transform:us},p:{style:ln},pt:{style:ln},pr:{style:ln},pb:{style:ln},pl:{style:ln},px:{style:ln},py:{style:ln},padding:{style:ln},paddingTop:{style:ln},paddingRight:{style:ln},paddingBottom:{style:ln},paddingLeft:{style:ln},paddingX:{style:ln},paddingY:{style:ln},paddingInline:{style:ln},paddingInlineStart:{style:ln},paddingInlineEnd:{style:ln},paddingBlock:{style:ln},paddingBlockStart:{style:ln},paddingBlockEnd:{style:ln},m:{style:an},mt:{style:an},mr:{style:an},mb:{style:an},ml:{style:an},mx:{style:an},my:{style:an},margin:{style:an},marginTop:{style:an},marginRight:{style:an},marginBottom:{style:an},marginLeft:{style:an},marginX:{style:an},marginY:{style:an},marginInline:{style:an},marginInlineStart:{style:an},marginInlineEnd:{style:an},marginBlock:{style:an},marginBlockStart:{style:an},marginBlockEnd:{style:an},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:fc},rowGap:{style:hc},columnGap:{style:pc},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:rr},maxWidth:{style:np},minWidth:{transform:rr},height:{transform:rr},maxHeight:{transform:rr},minHeight:{transform:rr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function MS(...e){const t=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function PS(e,t){return typeof e=="function"?e(t):e}function RS(){function e(n,r,o,i){const s={[n]:r,theme:o},a=i[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:u,transform:d,style:f}=a;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const h=uc(o,u)||{};return f?f(s):yo(s,r,m=>{let b=Lu(h,d,m);return m===b&&typeof m=="string"&&(b=Lu(h,d,`${n}${m==="default"?"":Le(m)}`,m)),l===!1?b:{[l]:b}})}function t(n){const{sx:r,theme:o={},nested:i}=n||{};if(!r)return null;const s=o.unstable_sxConfig??vl;function a(l){let u=l;if(typeof l=="function")u=l(o);else if(typeof l!="object")return l;if(!u)return null;const d=KT(o.breakpoints),f=Object.keys(d);let h=d;return Object.keys(u).forEach(p=>{const m=PS(u[p],o);if(m!=null)if(typeof m=="object")if(s[p])h=Fa(h,e(p,m,o,s));else{const b=yo({theme:o},m,y=>({[p]:y}));MS(b,m)?h[p]=t({sx:m,theme:o,nested:!0}):h=Fa(h,b)}else h=Fa(h,e(p,m,o,s))}),!i&&o.modularCssLayers?{"@layer sx":Nm(o,Lm(f,h))}:Nm(o,Lm(f,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const bs=RS();bs.filterProps=["sx"];const NS=e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??vl;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t};function FS(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=NS(n);let i;return Array.isArray(t)?i=[r,...t]:typeof t=="function"?i=(...s)=>{const a=t(...s);return Qr(a)?{...r,...a}:r}:i={...r,...t},{...o,sx:i}}function LS(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function rp(e,t=0,n=1){return LS(e,t,n)}function _S(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Lo(e){if(e.type)return e;if(e.charAt(0)==="#")return Lo(_S(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(bo(9,e));let r=e.substring(t+1,e.length-1),o;if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(bo(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const BS=e=>{const t=Lo(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},Aa=(e,t)=>{try{return BS(e)}catch{return e}};function mc(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((o,i)=>i<3?parseInt(o,10):o):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function Nb(e){e=Lo(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,i=r*Math.min(o,1-o),s=(u,d=(u+n/30)%12)=>o-i*Math.max(Math.min(d-3,9-d,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),mc({type:a,values:l})}function of(e){e=Lo(e);let t=e.type==="hsl"||e.type==="hsla"?Lo(Nb(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function jS(e,t){const n=of(e),r=of(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function _u(e,t){return e=Lo(e),t=rp(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,mc(e)}function Ko(e,t,n){try{return _u(e,t)}catch{return e}}function gc(e,t){if(e=Lo(e),t=rp(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return mc(e)}function _t(e,t,n){try{return gc(e,t)}catch{return e}}function bc(e,t){if(e=Lo(e),t=rp(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return mc(e)}function Bt(e,t,n){try{return bc(e,t)}catch{return e}}function sf(e,t=.15){return of(e)>.5?gc(e,t):bc(e,t)}function Kl(e,t,n){try{return sf(e,t)}catch{return e}}const tl={black:"#000",white:"#fff"},$S={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Ui={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Vi={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},ta={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Wi={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},qi={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Yi={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function Fb(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:tl.white,default:tl.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Lb=Fb();function _b(){return{text:{primary:tl.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:tl.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const af=_b();function Bm(e,t,n,r){const o=r.light||r,i=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=bc(e.main,o):t==="dark"&&(e.dark=gc(e.main,i)))}function jm(e,t,n,r,o){const i=o.light||o,s=o.dark||o*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(i*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(s*100).toFixed(0)}%)`))}function HS(e="light"){return e==="dark"?{main:Wi[200],light:Wi[50],dark:Wi[400]}:{main:Wi[700],light:Wi[400],dark:Wi[800]}}function zS(e="light"){return e==="dark"?{main:Ui[200],light:Ui[50],dark:Ui[400]}:{main:Ui[500],light:Ui[300],dark:Ui[700]}}function US(e="light"){return e==="dark"?{main:Vi[500],light:Vi[300],dark:Vi[700]}:{main:Vi[700],light:Vi[400],dark:Vi[800]}}function VS(e="light"){return e==="dark"?{main:qi[400],light:qi[300],dark:qi[700]}:{main:qi[700],light:qi[500],dark:qi[900]}}function WS(e="light"){return e==="dark"?{main:Yi[400],light:Yi[300],dark:Yi[700]}:{main:Yi[800],light:Yi[500],dark:Yi[900]}}function qS(e="light"){return e==="dark"?{main:ta[400],light:ta[300],dark:ta[700]}:{main:"#ed6c02",light:ta[500],dark:ta[900]}}function YS(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function op(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:o,...i}=e,s=e.primary||HS(t),a=e.secondary||zS(t),l=e.error||US(t),u=e.info||VS(t),d=e.success||WS(t),f=e.warning||qS(t);function h(y){return o?YS(y):jS(y,af.text.primary)>=n?af.text.primary:Lb.text.primary}const p=({color:y,name:x,mainShade:C=500,lightShade:E=300,darkShade:T=700})=>{if(y={...y},!y.main&&y[C]&&(y.main=y[C]),!y.hasOwnProperty("main"))throw new Error(bo(11,x?` (${x})`:"",C));if(typeof y.main!="string")throw new Error(bo(12,x?` (${x})`:"",JSON.stringify(y.main)));return o?(jm(o,y,"light",E,r),jm(o,y,"dark",T,r)):(Bm(y,"light",E,r),Bm(y,"dark",T,r)),y.contrastText||(y.contrastText=h(y.main)),y};let m;return t==="light"?m=Fb():t==="dark"&&(m=_b()),An({common:{...tl},mode:t,primary:p({color:s,name:"primary"}),secondary:p({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:l,name:"error"}),warning:p({color:f,name:"warning"}),info:p({color:u,name:"info"}),success:p({color:d,name:"success"}),grey:$S,contrastThreshold:n,getContrastText:h,augmentColor:p,tonalOffset:r,...m},i)}function KS(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var GS={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function QS(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var XS=/[A-Z]|^ms/g,ZS=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Bb=function(t){return t.charCodeAt(1)===45},$m=function(t){return t!=null&&typeof t!="boolean"},cd=QS(function(e){return Bb(e)?e:e.replace(XS,"-$&").toLowerCase()}),Hm=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(ZS,function(r,o,i){return Ro={name:o,styles:i,next:Ro},o})}return GS[t]!==1&&!Bb(t)&&typeof n=="number"&&n!==0?n+"px":n};function Bu(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return Ro={name:o.name,styles:o.styles,next:Ro},o.name;var i=n;if(i.styles!==void 0){var s=i.next;if(s!==void 0)for(;s!==void 0;)Ro={name:s.name,styles:s.styles,next:Ro},s=s.next;var a=i.styles+";";return a}return JS(e,t,n)}}var l=n;return l}function JS(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Bu(e,t,n[o])+";";else for(var i in n){var s=n[i];if(typeof s!="object"){var a=s;$m(a)&&(r+=cd(i)+":"+Hm(i,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var l=0;l<s.length;l++)$m(s[l])&&(r+=cd(i)+":"+Hm(i,s[l])+";");else{var u=Bu(e,t,s);switch(i){case"animation":case"animationName":{r+=cd(i)+":"+u+";";break}default:r+=i+"{"+u+"}"}}}return r}var zm=/label:\s*([^\s;{]+)\s*(;|$)/g,Ro;function ek(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";Ro=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,o+=Bu(n,t,i);else{var s=i;o+=s[0]}for(var a=1;a<e.length;a++)if(o+=Bu(n,t,e[a]),r){var l=i;o+=l[a]}zm.lastIndex=0;for(var u="",d;(d=zm.exec(o))!==null;)u+="-"+d[1];var f=KS(o)+u;return{name:f,styles:o,next:Ro}}function tk(e,t){return PT(e,t)}function nk(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Um=[];function li(e){return Um[0]=e,ek(Um)}const yn=typeof window<"u"?M.useLayoutEffect:M.useEffect;function rk(e){return Object.keys(e).length===0}function jb(e=null){const t=M.useContext(RT.ThemeContext);return!t||rk(t)?e:t}const ok=M.createContext(),wr=()=>M.useContext(ok)??!1;function nl(e,t,n=!1){const r={...t};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const i=o;if(i==="components"||i==="slots")r[i]={...e[i],...r[i]};else if(i==="componentsProps"||i==="slotProps"){const s=e[i],a=t[i];if(!a)r[i]=s||{};else if(!s)r[i]=a;else{r[i]={...a};for(const l in s)if(Object.prototype.hasOwnProperty.call(s,l)){const u=l;r[i][u]=nl(s[u],a[u],n)}}}else i==="className"&&n&&t.className?r.className=Ue(e?.className,t?.className):i==="style"&&n&&t.style?r.style={...e?.style,...t?.style}:r[i]===void 0&&(r[i]=e[i])}return r}const ik=M.createContext(void 0);function sk(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const o=t.components[n];return o.defaultProps?nl(o.defaultProps,r,t.components.mergeClassNameAndStyle):!o.styleOverrides&&!o.variants?nl(o,r,t.components.mergeClassNameAndStyle):r}function ak({props:e,name:t}){const n=M.useContext(ik);return sk({props:e,name:t,theme:{components:n}})}let Vm=0;function lk(e){const[t,n]=M.useState(e),r=e||t;return M.useEffect(()=>{t==null&&(Vm+=1,n(`mui-${Vm}`))},[t]),r}const uk={...M},Wm=uk.useId;function Br(e){if(Wm!==void 0){const t=Wm();return e??t}return lk(e)}const ck=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function dk(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,i=ck(t),s=Object.keys(i);function a(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function u(h,p){const m=s.indexOf(p);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(m!==-1&&typeof t[s[m]]=="number"?t[s[m]]:p)-r/100}${n})`}function d(h){return s.indexOf(h)+1<s.length?u(h,s[s.indexOf(h)+1]):a(h)}function f(h){const p=s.indexOf(h);return p===0?a(s[1]):p===s.length-1?l(s[p]):u(h,s[s.indexOf(h)+1]).replace("@media","@media not all and")}return{keys:s,values:i,up:a,down:l,between:u,only:d,not:f,unit:n,...o}}const fk={borderRadius:4};function pk(e=8,t=tp({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function hk(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function ip(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:i={},...s}=e,a=dk(n),l=pk(o);let u=An({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...fk,...i}},s);return u=qT(u),u.applyStyles=hk,u=t.reduce((d,f)=>An(d,f),u),u.unstable_sxConfig={...vl,...s?.unstable_sxConfig},u.unstable_sx=function(f){return bs({sx:f,theme:this})},u}const mk=ip();function gk(e=mk){return jb(e)}const qm=(e,t,n,r=[])=>{let o=e;t.forEach((i,s)=>{s===t.length-1?Array.isArray(o)?o[Number(i)]=n:o&&typeof o=="object"&&(o[i]=n):o&&typeof o=="object"&&(o[i]||(o[i]=r.includes(i)?[]:{}),o=o[i])})},bk=(e,t,n)=>{function r(o,i=[],s=[]){Object.entries(o).forEach(([a,l])=>{(!n||n&&!n([...i,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...i,a],Array.isArray(l)?[...s,a]:s):t([...i,a],l,s))})}r(e)},yk=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function dd(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},o={},i={},s={};return bk(e,(a,l,u)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const d=`--${n?`${n}-`:""}${a.join("-")}`,f=yk(a,l);Object.assign(o,{[d]:f}),qm(i,a,`var(${d})`,u),qm(s,a,`var(${d}, ${f})`,u)}},a=>a[0]==="vars"),{css:o,vars:i,varsWithDefaults:s}}function xk(e,t={}){const{getSelector:n=x,disableCssColorScheme:r,colorSchemeSelector:o,enableContrastVars:i}=t,{colorSchemes:s={},components:a,defaultColorScheme:l="light",...u}=e,{vars:d,css:f,varsWithDefaults:h}=dd(u,t);let p=h;const m={},{[l]:b,...y}=s;if(Object.entries(y||{}).forEach(([T,I])=>{const{vars:D,css:_,varsWithDefaults:O}=dd(I,t);p=An(p,O),m[T]={css:_,vars:D}}),b){const{css:T,vars:I,varsWithDefaults:D}=dd(b,t);p=An(p,D),m[l]={css:T,vars:I}}function x(T,I){let D=o;if(o==="class"&&(D=".%s"),o==="data"&&(D="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(D=`[${o}="%s"]`),T){if(D==="media")return e.defaultColorScheme===T?":root":{[`@media (prefers-color-scheme: ${s[T]?.palette?.mode||T})`]:{":root":I}};if(D)return e.defaultColorScheme===T?`:root, ${D.replace("%s",String(T))}`:D.replace("%s",String(T))}return":root"}return{vars:p,generateThemeVars:()=>{let T={...d};return Object.entries(m).forEach(([,{vars:I}])=>{T=An(T,I)}),T},generateStyleSheets:()=>{const T=[],I=e.defaultColorScheme||"light";function D(B,L){Object.keys(L).length&&T.push(typeof B=="string"?{[B]:{...L}}:B)}D(n(void 0,{...f}),f);const{[I]:_,...O}=m;if(_){const{css:B}=_,L=s[I]?.palette?.mode,j=!r&&L?{colorScheme:L,...B}:{...B};D(n(I,{...j}),j)}return Object.entries(O).forEach(([B,{css:L}])=>{const j=s[B]?.palette?.mode,S=!r&&j?{colorScheme:j,...L}:{...L};D(n(B,{...S}),S)}),i&&T.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),T}}}function vk(e){const t={};return Object.entries(e).forEach(r=>{const[o,i]=r;typeof i=="object"&&(t[o]=`${i.fontStyle?`${i.fontStyle} `:""}${i.fontVariant?`${i.fontVariant} `:""}${i.fontWeight?`${i.fontWeight} `:""}${i.fontStretch?`${i.fontStretch} `:""}${i.fontSize||""}${i.lineHeight?`/${i.lineHeight} `:""}${i.fontFamily||""}`)}),t}function Ck(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const Ek={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ge(e,t,n="Mui"){const r=Ek[t];return r?`${n}-${r}`:`${Ab.generate(e)}-${t}`}function Tk(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function Sk(e){return Math.round(e*1e5)/1e5}const Ym={textTransform:"uppercase"},Km='"Roboto", "Helvetica", "Arial", sans-serif';function kk(e,t){const{fontFamily:n=Km,fontSize:r=14,fontWeightLight:o=300,fontWeightRegular:i=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:u,pxToRem:d,...f}=typeof t=="function"?t(e):t,h=r/14,p=d||(y=>`${y/l*h}rem`),m=(y,x,C,E,T)=>({fontFamily:n,fontWeight:y,fontSize:p(x),lineHeight:C,...n===Km?{letterSpacing:`${Sk(E/x)}em`}:{},...T,...u}),b={h1:m(o,96,1.167,-1.5),h2:m(o,60,1.2,-.5),h3:m(i,48,1.167,0),h4:m(i,34,1.235,.25),h5:m(i,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(i,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(i,16,1.5,.15),body2:m(i,14,1.43,.15),button:m(s,14,1.75,.4,Ym),caption:m(i,12,1.66,.4),overline:m(i,12,2.66,1,Ym),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return An({htmlFontSize:l,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:o,fontWeightRegular:i,fontWeightMedium:s,fontWeightBold:a,...b},f,{clone:!1})}const wk=.2,Dk=.14,Ik=.12;function Jt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${wk})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Dk})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Ik})`].join(",")}const Ak=["none",Jt(0,2,1,-1,0,1,1,0,0,1,3,0),Jt(0,3,1,-2,0,2,2,0,0,1,5,0),Jt(0,3,3,-2,0,3,4,0,0,1,8,0),Jt(0,2,4,-1,0,4,5,0,0,1,10,0),Jt(0,3,5,-1,0,5,8,0,0,1,14,0),Jt(0,3,5,-1,0,6,10,0,0,1,18,0),Jt(0,4,5,-2,0,7,10,1,0,2,16,1),Jt(0,5,5,-3,0,8,10,1,0,3,14,2),Jt(0,5,6,-3,0,9,12,1,0,3,16,2),Jt(0,6,6,-3,0,10,14,1,0,4,18,3),Jt(0,6,7,-4,0,11,15,1,0,4,20,3),Jt(0,7,8,-4,0,12,17,2,0,5,22,4),Jt(0,7,8,-4,0,13,19,2,0,5,24,4),Jt(0,7,9,-4,0,14,21,2,0,5,26,4),Jt(0,8,9,-5,0,15,22,2,0,6,28,5),Jt(0,8,10,-5,0,16,24,2,0,6,30,5),Jt(0,8,11,-5,0,17,26,2,0,6,32,5),Jt(0,9,11,-5,0,18,28,2,0,7,34,6),Jt(0,9,12,-6,0,19,29,2,0,7,36,6),Jt(0,10,13,-6,0,20,31,3,0,8,38,7),Jt(0,10,13,-6,0,21,33,3,0,8,40,7),Jt(0,10,14,-6,0,22,35,3,0,8,42,7),Jt(0,11,14,-7,0,23,36,3,0,9,44,8),Jt(0,11,15,-7,0,24,38,3,0,9,46,8)],Ok={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},$b={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Gm(e){return`${Math.round(e)}ms`}function Mk(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Pk(e){const t={...Ok,...e.easing},n={...$b,...e.duration};return{getAutoHeightDuration:Mk,create:(o=["all"],i={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0,...u}=i;return(Array.isArray(o)?o:[o]).map(d=>`${d} ${typeof s=="string"?s:Gm(s)} ${a} ${typeof l=="string"?l:Gm(l)}`).join(",")},...e,easing:t,duration:n}}const Rk={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Nk(e){return Qr(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Hb(e={}){const t={...e};function n(r){const o=Object.entries(r);for(let i=0;i<o.length;i++){const[s,a]=o[i];!Nk(a)||s.startsWith("unstable_")?delete r[s]:Qr(a)&&(r[s]={...a},n(r[s]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
10
|
-
|
|
11
|
-
const theme = ${JSON.stringify(t,null,2)};
|
|
12
|
-
|
|
13
|
-
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
14
|
-
theme.transitions = createTransitions(theme.transitions || {});
|
|
15
|
-
|
|
16
|
-
export default theme;`}function Qm(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const Fk=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function Lk(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:_u(t,Fk(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${Qm(n)})`:bc(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${Qm(n)})`:gc(t,n)}})}function lf(e={},...t){const{breakpoints:n,mixins:r={},spacing:o,palette:i={},transitions:s={},typography:a={},shape:l,colorSpace:u,...d}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(bo(20));const f=op({...i,colorSpace:u}),h=ip(e);let p=An(h,{mixins:Tk(h.breakpoints,r),palette:f,shadows:Ak.slice(),typography:kk(f,a),transitions:Pk(s),zIndex:{...Rk}});return p=An(p,d),p=t.reduce((m,b)=>An(m,b),p),p.unstable_sxConfig={...vl,...d?.unstable_sxConfig},p.unstable_sx=function(b){return bs({sx:b,theme:this})},p.toRuntimeSource=Hb,Lk(p),p}function uf(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const _k=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=uf(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function zb(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Ub(e){return e==="dark"?_k:[]}function Bk(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:o,...i}=e,s=op({...t,colorSpace:o});return{palette:s,opacity:{...zb(s.mode),...n},overlays:r||Ub(s.mode),...i}}function jk(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const $k=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Hk=e=>(t,n)=>{const r=e.rootSelector||":root",o=e.colorSchemeSelector;let i=o;if(o==="class"&&(i=".%s"),o==="data"&&(i="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return $k(e.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),i==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:i?{[i.replace("%s",t)]:s,[`${r}, ${i.replace("%s",t)}`]:n}:{[r]:{...n,...s}}}if(i&&i!=="media")return`${r}, ${i.replace("%s",String(t))}`}else if(t){if(i==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(i)return i.replace("%s",String(t))}return r};function zk(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function we(e,t,n){!e[t]&&n&&(e[t]=n)}function Oa(e){return typeof e!="string"||!e.startsWith("hsl")?e:Nb(e)}function uo(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Aa(Oa(e[t])))}function Uk(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Ur=e=>{try{return e()}catch{}},Vk=(e="mui")=>Ot.unstable_createGetCssVar(e);function fd(e,t,n,r,o){if(!n)return;n=n===!0?{}:n;const i=o==="dark"?"dark":"light";if(!r){t[o]=Bk({...n,palette:{mode:i,...n?.palette},colorSpace:e});return}const{palette:s,...a}=lf({...r,palette:{mode:i,...n?.palette},colorSpace:e});return t[o]={...n,palette:s,opacity:{...zb(i),...n?.opacity},overlays:n?.overlays||Ub(i)},a}function Wk(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",nativeColor:s=!1,shouldSkipGeneratingVar:a=jk,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:u=":root",...d}=e,f=Object.keys(n)[0],h=r||(n.light&&f!=="light"?"light":f),p=Vk(i),{[h]:m,light:b,dark:y,...x}=n,C={...x};let E=m;if((h==="dark"&&!("dark"in n)||h==="light"&&!("light"in n))&&(E=!0),!E)throw new Error(bo(21,h));let T;s&&(T="oklch");const I=fd(T,C,E,d,h);b&&!C.light&&fd(T,C,b,void 0,"light"),y&&!C.dark&&fd(T,C,y,void 0,"dark");let D={defaultColorScheme:h,...I,cssVarPrefix:i,colorSchemeSelector:l,rootSelector:u,getCssVar:p,colorSchemes:C,font:{...vk(I.typography),...I.font},spacing:Uk(d.spacing)};Object.keys(D.colorSchemes).forEach(j=>{const S=D.colorSchemes[j].palette,$=R=>{const H=R.split("-"),V=H[1],Y=H[2];return p(R,S[V][Y])};S.mode==="light"&&(we(S.common,"background","#fff"),we(S.common,"onBackground","#000")),S.mode==="dark"&&(we(S.common,"background","#000"),we(S.common,"onBackground","#fff"));function F(R,H,V){if(T){let Y;return R===Ko&&(Y=`transparent ${((1-V)*100).toFixed(0)}%`),R===_t&&(Y=`#000 ${(V*100).toFixed(0)}%`),R===Bt&&(Y=`#fff ${(V*100).toFixed(0)}%`),`color-mix(in ${T}, ${H}, ${Y})`}return R(H,V)}if(zk(S,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),S.mode==="light"){we(S.Alert,"errorColor",F(_t,S.error.light,.6)),we(S.Alert,"infoColor",F(_t,S.info.light,.6)),we(S.Alert,"successColor",F(_t,S.success.light,.6)),we(S.Alert,"warningColor",F(_t,S.warning.light,.6)),we(S.Alert,"errorFilledBg",$("palette-error-main")),we(S.Alert,"infoFilledBg",$("palette-info-main")),we(S.Alert,"successFilledBg",$("palette-success-main")),we(S.Alert,"warningFilledBg",$("palette-warning-main")),we(S.Alert,"errorFilledColor",Ur(()=>S.getContrastText(S.error.main))),we(S.Alert,"infoFilledColor",Ur(()=>S.getContrastText(S.info.main))),we(S.Alert,"successFilledColor",Ur(()=>S.getContrastText(S.success.main))),we(S.Alert,"warningFilledColor",Ur(()=>S.getContrastText(S.warning.main))),we(S.Alert,"errorStandardBg",F(Bt,S.error.light,.9)),we(S.Alert,"infoStandardBg",F(Bt,S.info.light,.9)),we(S.Alert,"successStandardBg",F(Bt,S.success.light,.9)),we(S.Alert,"warningStandardBg",F(Bt,S.warning.light,.9)),we(S.Alert,"errorIconColor",$("palette-error-main")),we(S.Alert,"infoIconColor",$("palette-info-main")),we(S.Alert,"successIconColor",$("palette-success-main")),we(S.Alert,"warningIconColor",$("palette-warning-main")),we(S.AppBar,"defaultBg",$("palette-grey-100")),we(S.Avatar,"defaultBg",$("palette-grey-400")),we(S.Button,"inheritContainedBg",$("palette-grey-300")),we(S.Button,"inheritContainedHoverBg",$("palette-grey-A100")),we(S.Chip,"defaultBorder",$("palette-grey-400")),we(S.Chip,"defaultAvatarColor",$("palette-grey-700")),we(S.Chip,"defaultIconColor",$("palette-grey-700")),we(S.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),we(S.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),we(S.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),we(S.LinearProgress,"primaryBg",F(Bt,S.primary.main,.62)),we(S.LinearProgress,"secondaryBg",F(Bt,S.secondary.main,.62)),we(S.LinearProgress,"errorBg",F(Bt,S.error.main,.62)),we(S.LinearProgress,"infoBg",F(Bt,S.info.main,.62)),we(S.LinearProgress,"successBg",F(Bt,S.success.main,.62)),we(S.LinearProgress,"warningBg",F(Bt,S.warning.main,.62)),we(S.Skeleton,"bg",T?F(Ko,S.text.primary,.11):`rgba(${$("palette-text-primaryChannel")} / 0.11)`),we(S.Slider,"primaryTrack",F(Bt,S.primary.main,.62)),we(S.Slider,"secondaryTrack",F(Bt,S.secondary.main,.62)),we(S.Slider,"errorTrack",F(Bt,S.error.main,.62)),we(S.Slider,"infoTrack",F(Bt,S.info.main,.62)),we(S.Slider,"successTrack",F(Bt,S.success.main,.62)),we(S.Slider,"warningTrack",F(Bt,S.warning.main,.62));const R=T?F(_t,S.background.default,.6825):Kl(S.background.default,.8);we(S.SnackbarContent,"bg",R),we(S.SnackbarContent,"color",Ur(()=>T?af.text.primary:S.getContrastText(R))),we(S.SpeedDialAction,"fabHoverBg",Kl(S.background.paper,.15)),we(S.StepConnector,"border",$("palette-grey-400")),we(S.StepContent,"border",$("palette-grey-400")),we(S.Switch,"defaultColor",$("palette-common-white")),we(S.Switch,"defaultDisabledColor",$("palette-grey-100")),we(S.Switch,"primaryDisabledColor",F(Bt,S.primary.main,.62)),we(S.Switch,"secondaryDisabledColor",F(Bt,S.secondary.main,.62)),we(S.Switch,"errorDisabledColor",F(Bt,S.error.main,.62)),we(S.Switch,"infoDisabledColor",F(Bt,S.info.main,.62)),we(S.Switch,"successDisabledColor",F(Bt,S.success.main,.62)),we(S.Switch,"warningDisabledColor",F(Bt,S.warning.main,.62)),we(S.TableCell,"border",F(Bt,F(Ko,S.divider,1),.88)),we(S.Tooltip,"bg",F(Ko,S.grey[700],.92))}if(S.mode==="dark"){we(S.Alert,"errorColor",F(Bt,S.error.light,.6)),we(S.Alert,"infoColor",F(Bt,S.info.light,.6)),we(S.Alert,"successColor",F(Bt,S.success.light,.6)),we(S.Alert,"warningColor",F(Bt,S.warning.light,.6)),we(S.Alert,"errorFilledBg",$("palette-error-dark")),we(S.Alert,"infoFilledBg",$("palette-info-dark")),we(S.Alert,"successFilledBg",$("palette-success-dark")),we(S.Alert,"warningFilledBg",$("palette-warning-dark")),we(S.Alert,"errorFilledColor",Ur(()=>S.getContrastText(S.error.dark))),we(S.Alert,"infoFilledColor",Ur(()=>S.getContrastText(S.info.dark))),we(S.Alert,"successFilledColor",Ur(()=>S.getContrastText(S.success.dark))),we(S.Alert,"warningFilledColor",Ur(()=>S.getContrastText(S.warning.dark))),we(S.Alert,"errorStandardBg",F(_t,S.error.light,.9)),we(S.Alert,"infoStandardBg",F(_t,S.info.light,.9)),we(S.Alert,"successStandardBg",F(_t,S.success.light,.9)),we(S.Alert,"warningStandardBg",F(_t,S.warning.light,.9)),we(S.Alert,"errorIconColor",$("palette-error-main")),we(S.Alert,"infoIconColor",$("palette-info-main")),we(S.Alert,"successIconColor",$("palette-success-main")),we(S.Alert,"warningIconColor",$("palette-warning-main")),we(S.AppBar,"defaultBg",$("palette-grey-900")),we(S.AppBar,"darkBg",$("palette-background-paper")),we(S.AppBar,"darkColor",$("palette-text-primary")),we(S.Avatar,"defaultBg",$("palette-grey-600")),we(S.Button,"inheritContainedBg",$("palette-grey-800")),we(S.Button,"inheritContainedHoverBg",$("palette-grey-700")),we(S.Chip,"defaultBorder",$("palette-grey-700")),we(S.Chip,"defaultAvatarColor",$("palette-grey-300")),we(S.Chip,"defaultIconColor",$("palette-grey-300")),we(S.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),we(S.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),we(S.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),we(S.LinearProgress,"primaryBg",F(_t,S.primary.main,.5)),we(S.LinearProgress,"secondaryBg",F(_t,S.secondary.main,.5)),we(S.LinearProgress,"errorBg",F(_t,S.error.main,.5)),we(S.LinearProgress,"infoBg",F(_t,S.info.main,.5)),we(S.LinearProgress,"successBg",F(_t,S.success.main,.5)),we(S.LinearProgress,"warningBg",F(_t,S.warning.main,.5)),we(S.Skeleton,"bg",T?F(Ko,S.text.primary,.13):`rgba(${$("palette-text-primaryChannel")} / 0.13)`),we(S.Slider,"primaryTrack",F(_t,S.primary.main,.5)),we(S.Slider,"secondaryTrack",F(_t,S.secondary.main,.5)),we(S.Slider,"errorTrack",F(_t,S.error.main,.5)),we(S.Slider,"infoTrack",F(_t,S.info.main,.5)),we(S.Slider,"successTrack",F(_t,S.success.main,.5)),we(S.Slider,"warningTrack",F(_t,S.warning.main,.5));const R=T?F(Bt,S.background.default,.985):Kl(S.background.default,.98);we(S.SnackbarContent,"bg",R),we(S.SnackbarContent,"color",Ur(()=>T?Lb.text.primary:S.getContrastText(R))),we(S.SpeedDialAction,"fabHoverBg",Kl(S.background.paper,.15)),we(S.StepConnector,"border",$("palette-grey-600")),we(S.StepContent,"border",$("palette-grey-600")),we(S.Switch,"defaultColor",$("palette-grey-300")),we(S.Switch,"defaultDisabledColor",$("palette-grey-600")),we(S.Switch,"primaryDisabledColor",F(_t,S.primary.main,.55)),we(S.Switch,"secondaryDisabledColor",F(_t,S.secondary.main,.55)),we(S.Switch,"errorDisabledColor",F(_t,S.error.main,.55)),we(S.Switch,"infoDisabledColor",F(_t,S.info.main,.55)),we(S.Switch,"successDisabledColor",F(_t,S.success.main,.55)),we(S.Switch,"warningDisabledColor",F(_t,S.warning.main,.55)),we(S.TableCell,"border",F(_t,F(Ko,S.divider,1),.68)),we(S.Tooltip,"bg",F(Ko,S.grey[700],.92))}uo(S.background,"default"),uo(S.background,"paper"),uo(S.common,"background"),uo(S.common,"onBackground"),uo(S,"divider"),Object.keys(S).forEach(R=>{const H=S[R];R!=="tonalOffset"&&H&&typeof H=="object"&&(H.main&&we(S[R],"mainChannel",Aa(Oa(H.main))),H.light&&we(S[R],"lightChannel",Aa(Oa(H.light))),H.dark&&we(S[R],"darkChannel",Aa(Oa(H.dark))),H.contrastText&&we(S[R],"contrastTextChannel",Aa(Oa(H.contrastText))),R==="text"&&(uo(S[R],"primary"),uo(S[R],"secondary")),R==="action"&&(H.active&&uo(S[R],"active"),H.selected&&uo(S[R],"selected")))})}),D=t.reduce((j,S)=>An(j,S),D);const _={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:a,getSelector:Hk(D),enableContrastVars:s},{vars:O,generateThemeVars:B,generateStyleSheets:L}=xk(D,_);return D.vars=O,Object.entries(D.colorSchemes[D.defaultColorScheme]).forEach(([j,S])=>{D[j]=S}),D.generateThemeVars=B,D.generateStyleSheets=L,D.generateSpacing=function(){return Ot.createSpacing(d.spacing,tp(this))},D.getColorSchemeSelector=Ck(l),D.spacing=D.generateSpacing(),D.shouldSkipGeneratingVar=a,D.unstable_sxConfig={...vl,...d?.unstable_sxConfig},D.unstable_sx=function(S){return bs({sx:S,theme:this})},D.toRuntimeSource=Hb,D}function Xm(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:op({...n===!0?{}:n.palette,mode:t})})}function Vb(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:i=n?.mode,...s}=e,a=i||"light",l=o?.[a],u={...o,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return lf(e,...t);let d=n;"palette"in e||u[a]&&(u[a]!==!0?d=u[a].palette:a==="dark"&&(d={mode:"dark"}));const f=lf({...e,palette:d},...t);return f.defaultColorScheme=a,f.colorSchemes=u,f.palette.mode==="light"&&(f.colorSchemes.light={...u.light!==!0&&u.light,palette:f.palette},Xm(f,"dark",u.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:f.palette},Xm(f,"light",u.light)),f}return!n&&!("light"in u)&&a==="light"&&(u.light=!0),Wk({...s,colorSchemes:u,defaultColorScheme:a,...typeof r!="boolean"&&r},...t)}const yc=Vb(),As="$$material";function Bo(){const e=Ot.useTheme(yc);return e[As]||e}function qk(e){return c.jsx(Ot.GlobalStyles,{...e,defaultTheme:yc,themeId:As})}function Yk(e){const{variants:t,...n}=e,r={variants:t,style:li(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=li(o.style))}),r}const Kk=ip();function Fo(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function ii(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Gk(e){return e?(t,n)=>n[e]:null}function Qk(e,t,n){e.theme=Jk(e.theme)?n:e.theme[t]||e.theme}function fu(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(o=>fu(e,o,n));if(Array.isArray(r?.variants)){let o;if(r.isProcessed)o=n?ii(r.style,n):r.style;else{const{variants:i,...s}=r;o=n?ii(li(s),n):s}return Wb(e,r.variants,[o],n)}return r?.isProcessed?n?ii(li(r.style),n):r.style:n?ii(li(r),n):r}function Wb(e,t,n=[],r=void 0){let o;e:for(let i=0;i<t.length;i+=1){const s=t[i];if(typeof s.props=="function"){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!s.props(o))continue}else for(const a in s.props)if(e[a]!==s.props[a]&&e.ownerState?.[a]!==s.props[a])continue e;typeof s.style=="function"?(o??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?ii(li(s.style(o)),r):s.style(o))):n.push(r?ii(li(s.style),r):s.style)}return n}function Xk(e={}){const{themeId:t,defaultTheme:n=Kk,rootShouldForwardProp:r=Fo,slotShouldForwardProp:o=Fo}=e;function i(a){Qk(a,t,n)}return(a,l={})=>{nk(a,D=>D.filter(_=>_!==bs));const{name:u,slot:d,skipVariantsResolver:f,skipSx:h,overridesResolver:p=Gk(tw(d)),...m}=l,b=u&&u.startsWith("Mui")||d?"components":"custom",y=f!==void 0?f:d&&d!=="Root"&&d!=="root"||!1,x=h||!1;let C=Fo;d==="Root"||d==="root"?C=r:d?C=o:ew(a)&&(C=void 0);const E=tk(a,{shouldForwardProp:C,label:Zk(),...m}),T=D=>{if(D.__emotion_real===D)return D;if(typeof D=="function")return function(O){return fu(O,D,O.theme.modularCssLayers?b:void 0)};if(Qr(D)){const _=Yk(D);return function(B){return _.variants?fu(B,_,B.theme.modularCssLayers?b:void 0):B.theme.modularCssLayers?ii(_.style,b):_.style}}return D},I=(...D)=>{const _=[],O=D.map(T),B=[];if(_.push(i),u&&p&&B.push(function($){const R=$.theme.components?.[u]?.styleOverrides;if(!R)return null;const H={};for(const V in R)H[V]=fu($,R[V],$.theme.modularCssLayers?"theme":void 0);return p($,H)}),u&&!y&&B.push(function($){const R=$.theme?.components?.[u]?.variants;return R?Wb($,R,[],$.theme.modularCssLayers?"theme":void 0):null}),x||B.push(bs),Array.isArray(O[0])){const S=O.shift(),$=new Array(_.length).fill(""),F=new Array(B.length).fill("");let R;R=[...$,...S,...F],R.raw=[...$,...S.raw,...F],_.unshift(R)}const L=[..._,...O,...B],j=E(...L);return a.muiName&&(j.muiName=a.muiName),j};return E.withConfig&&(I.withConfig=E.withConfig),I}}function Zk(e,t){return void 0}function Jk(e){for(const t in e)return!1;return!0}function ew(e){return typeof e=="string"&&e.charCodeAt(0)>96}function tw(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function qb(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const $n=e=>qb(e)&&e!=="classes",pe=Xk({themeId:As,defaultTheme:yc,rootShouldForwardProp:$n});function nw(e){return function(n){return c.jsx(qk,{styles:typeof e=="function"?r=>e({theme:r,...n}):e})}}function rw(){return FS}const pt=Ot.unstable_memoTheme;function ut(e){return ak(e)}function qe(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=Ge(e,o,n)}),r}function ow(e){return Ge("MuiSvgIcon",e)}qe("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const iw=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${Le(t)}`,`fontSize${Le(n)}`]};return Ke(o,ow,r)},sw=pe("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Le(n.color)}`],t[`fontSize${Le(n.fontSize)}`]]}})(pt(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),ju=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:d=!1,titleAccess:f,viewBox:h="0 0 24 24",...p}=r,m=M.isValidElement(o)&&o.type==="svg",b={...r,color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:d,viewBox:h,hasSvgAsChild:m},y={};d||(y.viewBox=h);const x=iw(b);return c.jsxs(sw,{as:a,className:Ue(x.root,i),focusable:"false",color:u,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...y,...p,...m&&o.props,ownerState:b,children:[m?o.props.children:o,f?c.jsx("title",{children:f}):null]})});ju.muiName="SvgIcon";function gt(e,t){function n(r,o){return c.jsx(ju,{"data-testid":void 0,ref:o,...r,children:e})}return n.muiName=ju.muiName,M.memo(M.forwardRef(n))}function Yb(e,t=166){let n;function r(...o){const i=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(i,t)}return r.clear=()=>{clearTimeout(n)},r}function pu(e,t){return M.isValidElement(e)&&t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)!==-1}function gn(e){return e&&e.ownerDocument||document}function xo(e){return gn(e).defaultView||window}function cf(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function or(e){const{controlled:t,default:n,name:r,state:o="value"}=e,{current:i}=M.useRef(t!==void 0),[s,a]=M.useState(n),l=i?t:s,u=M.useCallback(d=>{i||a(d)},[]);return[l,u]}function Ve(e){const t=M.useRef(e);return yn(()=>{t.current=e}),M.useRef((...n)=>(0,t.current)(...n)).current}function Et(...e){const t=M.useRef(void 0),n=M.useCallback(r=>{const o=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}});return()=>{o.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function aw(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function Kb(e,t){if(!e)return t;function n(s,a){const l={};return Object.keys(a).forEach(u=>{aw(u,a[u])&&typeof s[u]=="function"&&(l[u]=(...d)=>{s[u](...d),a[u](...d)})}),l}if(typeof e=="function"||typeof t=="function")return s=>{const a=typeof t=="function"?t(s):t,l=typeof e=="function"?e({...s,...a}):e,u=Ue(s?.className,a?.className,l?.className),d=n(l,a);return{...a,...l,...d,...!!u&&{className:u},...a?.style&&l?.style&&{style:{...a.style,...l.style}},...a?.sx&&l?.sx&&{sx:[...Array.isArray(a.sx)?a.sx:[a.sx],...Array.isArray(l.sx)?l.sx:[l.sx]]}}};const r=t,o=n(e,r),i=Ue(r?.className,e?.className);return{...t,...e,...o,...!!i&&{className:i},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}const ys=gt(c.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),Ki=Ot.createStack({createStyledComponent:pe("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>ut({props:e,name:"MuiStack"})});class cs{constructor(t,n){this.workbookData=n,this.workbookStorage=t,this.workbookData?this.isSaved=!0:(this.workbookData={models:[],cells:[],workbookPath:void 0},this.isSaved=!1)}isSaved;workbookStorage;getWorkbookData(){return this.workbookData}getWorkbookPath(){return this.workbookData.workbookPath}async renameWorkbook(t){if(this.workbookData.workbookPath.path!==t)try{await this.workbookStorage.moveWorkbook(this.workbookData.workbookPath,{path:t,workspace:this.workbookData.workbookPath.workspace})}catch{}return this.workbookData.workbookPath.path=t,this.isSaved=!1,await this.saveWorkbook()}getCells(){return this.workbookData.cells}deleteCell(t){return this.workbookData.cells=[...this.workbookData.cells.slice(0,t),...this.workbookData.cells.slice(t+1)],this.isSaved=!1,this}insertCell(t,n){return this.workbookData.cells=[...this.workbookData.cells.slice(0,t),n,...this.workbookData.cells.slice(t)],this.isSaved=!1,this}setCell(t,n){return this.workbookData.cells[t]=n,this.isSaved=!1,this}setModels(t){return this.workbookData.models=t,this.isSaved=!1,this}getModels(){return this.workbookData.models}updateWorkbookData(t){return this.workbookData=t,this.isSaved=!1,this}async saveWorkbook(){if(!this.isSaved){if(!this.workbookData.workbookPath)throw new Error("Workbook path is not set");await this.workbookStorage.saveWorkbook(this.workbookData.workbookPath,JSON.stringify(this.workbookData)),this.isSaved=!0}return new cs(this.workbookStorage,this.workbookData)}toMalloyWorkbook(){return this.workbookData.cells.map(t=>t.isMarkdown?`>>>markdown
|
|
17
|
-
`+t.value:`>>>malloy
|
|
18
|
-
import {${t.sourceName}}" from '${t.modelPath}'"
|
|
19
|
-
`+t.value+`
|
|
20
|
-
`).join(`
|
|
21
|
-
`)}static newWorkbook(t){return new cs(t,void 0)}static async loadWorkbook(t,n){let r;try{const o=await t.getWorkbook(n);o&&(r=JSON.parse(o))}catch{r={models:[],cells:[],workbookPath:n}}return new cs(t,r)}}const Gl=gt(c.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),Gb=gt(c.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),Zm=gt(c.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),sp=gt(c.jsx("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"}));function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q.apply(null,arguments)}function et(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function df(e){const t=[],n=String(e||"");let r=n.indexOf(","),o=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const s=n.slice(o,r).trim();(s||!i)&&t.push(s),o=r+1,r=n.indexOf(",",o)}return t}function xc(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const lw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cw={};function Jm(e,t){return(cw.jsx?uw:lw).test(e)}const dw=/[ \t\n\f\r]/g;function ap(e){return typeof e=="object"?e.type==="text"?e0(e.value):!1:e0(e)}function e0(e){return e.replace(dw,"")===""}let Cl=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Cl.prototype.normal={};Cl.prototype.property={};Cl.prototype.space=void 0;function Qb(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Cl(n,r,t)}function rl(e){return e.toLowerCase()}let Gn=class{constructor(t,n){this.attribute=n,this.property=t}};Gn.prototype.attribute="";Gn.prototype.booleanish=!1;Gn.prototype.boolean=!1;Gn.prototype.commaOrSpaceSeparated=!1;Gn.prototype.commaSeparated=!1;Gn.prototype.defined=!1;Gn.prototype.mustUseProperty=!1;Gn.prototype.number=!1;Gn.prototype.overloadedBoolean=!1;Gn.prototype.property="";Gn.prototype.spaceSeparated=!1;Gn.prototype.space=void 0;let fw=0;const mt=Ci(),hn=Ci(),ff=Ci(),He=Ci(),Yt=Ci(),ds=Ci(),Zn=Ci();function Ci(){return 2**++fw}const pf=Object.freeze(Object.defineProperty({__proto__:null,boolean:mt,booleanish:hn,commaOrSpaceSeparated:Zn,commaSeparated:ds,number:He,overloadedBoolean:ff,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),pd=Object.keys(pf);let lp=class extends Gn{constructor(t,n,r,o){let i=-1;if(super(t,n),t0(this,"space",o),typeof r=="number")for(;++i<pd.length;){const s=pd[i];t0(this,pd[i],(r&pf[s])===pf[s])}}};lp.prototype.defined=!0;function t0(e,t,n){n&&(e[t]=n)}function Os(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new lp(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[rl(r)]=r,n[rl(i.attribute)]=r}return new Cl(t,n,e.space)}const Xb=Os({properties:{ariaActiveDescendant:null,ariaAtomic:hn,ariaAutoComplete:null,ariaBusy:hn,ariaChecked:hn,ariaColCount:He,ariaColIndex:He,ariaColSpan:He,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:hn,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:hn,ariaFlowTo:Yt,ariaGrabbed:hn,ariaHasPopup:null,ariaHidden:hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:He,ariaLive:null,ariaModal:hn,ariaMultiLine:hn,ariaMultiSelectable:hn,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:He,ariaPressed:hn,ariaReadOnly:hn,ariaRelevant:null,ariaRequired:hn,ariaRoleDescription:Yt,ariaRowCount:He,ariaRowIndex:He,ariaRowSpan:He,ariaSelected:hn,ariaSetSize:He,ariaSort:null,ariaValueMax:He,ariaValueMin:He,ariaValueNow:He,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Zb(e,t){return t in e?e[t]:t}function Jb(e,t){return Zb(e,t.toLowerCase())}const pw=Os({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ds,acceptCharset:Yt,accessKey:Yt,action:null,allow:null,allowFullScreen:mt,allowPaymentRequest:mt,allowUserMedia:mt,alt:null,as:null,async:mt,autoCapitalize:null,autoComplete:Yt,autoFocus:mt,autoPlay:mt,blocking:Yt,capture:null,charSet:null,checked:mt,cite:null,className:Yt,cols:He,colSpan:null,content:null,contentEditable:hn,controls:mt,controlsList:Yt,coords:He|ds,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mt,defer:mt,dir:null,dirName:null,disabled:mt,download:ff,draggable:hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mt,formTarget:null,headers:Yt,height:He,hidden:ff,high:He,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:mt,inputMode:null,integrity:null,is:null,isMap:mt,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:mt,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mt,low:He,manifest:null,max:null,maxLength:He,media:null,method:null,min:null,minLength:He,multiple:mt,muted:mt,name:null,nonce:null,noModule:mt,noValidate:mt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:mt,optimum:He,pattern:null,ping:Yt,placeholder:null,playsInline:mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mt,referrerPolicy:null,rel:Yt,required:mt,reversed:mt,rows:He,rowSpan:He,sandbox:Yt,scope:null,scoped:mt,seamless:mt,selected:mt,shadowRootClonable:mt,shadowRootDelegatesFocus:mt,shadowRootMode:null,shape:null,size:He,sizes:null,slot:null,span:He,spellCheck:hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:He,step:null,style:null,tabIndex:He,target:null,title:null,translate:null,type:null,typeMustMatch:mt,useMap:null,value:hn,width:He,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:He,borderColor:null,bottomMargin:He,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:mt,declare:mt,event:null,face:null,frame:null,frameBorder:null,hSpace:He,leftMargin:He,link:null,longDesc:null,lowSrc:null,marginHeight:He,marginWidth:He,noResize:mt,noHref:mt,noShade:mt,noWrap:mt,object:null,profile:null,prompt:null,rev:null,rightMargin:He,rules:null,scheme:null,scrolling:hn,standby:null,summary:null,text:null,topMargin:He,valueType:null,version:null,vAlign:null,vLink:null,vSpace:He,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:mt,disableRemotePlayback:mt,prefix:null,property:null,results:He,security:null,unselectable:null},space:"html",transform:Jb}),hw=Os({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Zn,accentHeight:He,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:He,amplitude:He,arabicForm:null,ascent:He,attributeName:null,attributeType:null,azimuth:He,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:He,by:null,calcMode:null,capHeight:He,className:Yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:He,diffuseConstant:He,direction:null,display:null,dur:null,divisor:He,dominantBaseline:null,download:mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:He,enableBackground:null,end:null,event:null,exponent:He,externalResourcesRequired:null,fill:null,fillOpacity:He,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ds,g2:ds,glyphName:ds,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:He,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:He,horizOriginX:He,horizOriginY:He,id:null,ideographic:He,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:He,k:He,k1:He,k2:He,k3:He,k4:He,kernelMatrix:Zn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:He,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:He,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:He,overlineThickness:He,paintOrder:null,panose1:null,path:null,pathLength:He,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:He,pointsAtY:He,pointsAtZ:He,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zn,rev:Zn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zn,requiredFeatures:Zn,requiredFonts:Zn,requiredFormats:Zn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:He,specularExponent:He,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:He,strikethroughThickness:He,string:null,stroke:null,strokeDashArray:Zn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:He,strokeOpacity:He,strokeWidth:null,style:null,surfaceScale:He,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zn,tabIndex:He,tableValues:null,target:null,targetX:He,targetY:He,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:He,underlineThickness:He,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:He,values:null,vAlphabetic:He,vMathematical:He,vectorEffect:null,vHanging:He,vIdeographic:He,version:null,vertAdvY:He,vertOriginX:He,vertOriginY:He,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:He,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Zb}),ey=Os({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ty=Os({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Jb}),ny=Os({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),mw={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},gw=/[A-Z]/g,n0=/-[a-z]/g,bw=/^data[-\w.:]+$/i;function El(e,t){const n=rl(t);let r=t,o=Gn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&bw.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(n0,xw);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!n0.test(i)){let s=i.replace(gw,yw);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=lp}return new o(r,t)}function yw(e){return"-"+e.toLowerCase()}function xw(e){return e.charAt(1).toUpperCase()}const Ms=Qb([Xb,pw,ey,ty,ny],"html"),jo=Qb([Xb,hw,ey,ty,ny],"svg");function hf(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function vc(e){return e.join(" ").trim()}var Gi={},hd,r0;function vw(){if(r0)return hd;r0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
|
|
22
|
-
`,u="/",d="*",f="",h="comment",p="declaration";hd=function(b,y){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];y=y||{};var x=1,C=1;function E($){var F=$.match(t);F&&(x+=F.length);var R=$.lastIndexOf(l);C=~R?$.length-R:C+$.length}function T(){var $={line:x,column:C};return function(F){return F.position=new I($),O(),F}}function I($){this.start=$,this.end={line:x,column:C},this.source=y.source}I.prototype.content=b;function D($){var F=new Error(y.source+":"+x+":"+C+": "+$);if(F.reason=$,F.filename=y.source,F.line=x,F.column=C,F.source=b,!y.silent)throw F}function _($){var F=$.exec(b);if(F){var R=F[0];return E(R),b=b.slice(R.length),F}}function O(){_(n)}function B($){var F;for($=$||[];F=L();)F!==!1&&$.push(F);return $}function L(){var $=T();if(!(u!=b.charAt(0)||d!=b.charAt(1))){for(var F=2;f!=b.charAt(F)&&(d!=b.charAt(F)||u!=b.charAt(F+1));)++F;if(F+=2,f===b.charAt(F-1))return D("End of comment missing");var R=b.slice(2,F-2);return C+=2,E(R),b=b.slice(F),C+=2,$({type:h,comment:R})}}function j(){var $=T(),F=_(r);if(F){if(L(),!_(o))return D("property missing ':'");var R=_(i),H=$({type:p,property:m(F[0].replace(e,f)),value:R?m(R[0].replace(e,f)):f});return _(s),H}}function S(){var $=[];B($);for(var F;F=j();)F!==!1&&($.push(F),B($));return $}return O(),S()};function m(b){return b?b.replace(a,f):f}return hd}var o0;function Cw(){if(o0)return Gi;o0=1;var e=Gi&&Gi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=n;var t=e(vw());function n(r,o){var i=null;if(!r||typeof r!="string")return i;var s=(0,t.default)(r),a=typeof o=="function";return s.forEach(function(l){if(l.type==="declaration"){var u=l.property,d=l.value;a?o(u,d,l):d&&(i=i||{},i[u]=d)}}),i}return Gi}var na={},i0;function Ew(){if(i0)return na;i0=1,Object.defineProperty(na,"__esModule",{value:!0}),na.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(u){return!u||n.test(u)||e.test(u)},s=function(u,d){return d.toUpperCase()},a=function(u,d){return"".concat(d,"-")},l=function(u,d){return d===void 0&&(d={}),i(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(o,a):u=u.replace(r,a),u.replace(t,s))};return na.camelCase=l,na}var ra,s0;function Tw(){if(s0)return ra;s0=1;var e=ra&&ra.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Cw()),n=Ew();function r(o,i){var s={};return!o||typeof o!="string"||(0,t.default)(o,function(a,l){a&&l&&(s[(0,n.camelCase)(a,i)]=l)}),s}return r.default=r,ra=r,ra}var Sw=Tw();const kw=Sr(Sw),Cc=ry("end"),to=ry("start");function ry(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ww(e){const t=to(e),n=Cc(e);if(t&&n)return{start:t,end:n}}function La(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?a0(e.position):"start"in e||"end"in e?a0(e):"line"in e||"column"in e?mf(e):""}function mf(e){return l0(e&&e.line)+":"+l0(e&&e.column)}function a0(e){return mf(e&&e.start)+"-"+mf(e&&e.end)}function l0(e){return e&&typeof e=="number"?e:1}class Mn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=La(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Mn.prototype.file="";Mn.prototype.name="";Mn.prototype.reason="";Mn.prototype.message="";Mn.prototype.stack="";Mn.prototype.column=void 0;Mn.prototype.line=void 0;Mn.prototype.ancestors=void 0;Mn.prototype.cause=void 0;Mn.prototype.fatal=void 0;Mn.prototype.place=void 0;Mn.prototype.ruleId=void 0;Mn.prototype.source=void 0;const up={}.hasOwnProperty,Dw=new Map,Iw=/[A-Z]/g,Aw=new Set(["table","tbody","thead","tfoot","tr"]),Ow=new Set(["td","th"]),oy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Mw(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=jw(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Bw(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?jo:Ms,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=iy(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function iy(e,t,n){if(t.type==="element")return Pw(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Rw(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Fw(e,t,n);if(t.type==="mdxjsEsm")return Nw(e,t);if(t.type==="root")return Lw(e,t,n);if(t.type==="text")return _w(e,t)}function Pw(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=jo,e.schema=o),e.ancestors.push(t);const i=ay(e,t.tagName,!1),s=$w(e,t);let a=dp(e,t);return Aw.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!ap(l):!0})),sy(e,s,i,t),cp(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Rw(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ol(e,t.position)}function Nw(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ol(e,t.position)}function Fw(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=jo,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:ay(e,t.name,!0),s=Hw(e,t),a=dp(e,t);return sy(e,s,i,t),cp(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Lw(e,t,n){const r={};return cp(r,dp(e,t)),e.create(t,e.Fragment,r,n)}function _w(e,t){return t.value}function sy(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Bw(e,t,n){return r;function r(o,i,s,a){const u=Array.isArray(s.children)?n:t;return a?u(i,s,a):u(i,s)}}function jw(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=to(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function $w(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&up.call(t.properties,o)){const i=zw(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Ow.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Hw(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ol(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else ol(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function dp(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Dw;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const u=o.get(l)||0;s=l+"-"+u,o.set(l,u+1)}}const a=iy(e,i,s);a!==void 0&&n.push(a)}return n}function zw(e,t,n){const r=El(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?xc(n):vc(n)),r.property==="style"){let o=typeof n=="object"?n:Uw(e,String(n));return e.stylePropertyNameCase==="css"&&(o=Vw(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?mw[r.property]||r.property:r.attribute,n]}}function Uw(e,t){try{return kw(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=oy+"#cannot-parse-style-attribute",o}}function ay(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=Jm(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=Jm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return up.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);ol(e)}function ol(e,t){const n=new Mn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=oy+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Vw(e){const t={};let n;for(n in e)up.call(e,n)&&(t[Ww(n)]=e[n]);return t}function Ww(e){let t=e.replace(Iw,qw);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function qw(e){return"-"+e.toLowerCase()}const md={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Yw={};function fp(e,t){const n=Yw,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ly(e,r,o)}function ly(e,t,n){if(Kw(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return u0(e.children,t,n)}return Array.isArray(e)?u0(e,t,n):""}function u0(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ly(e[o],t,n);return r.join("")}function Kw(e){return!!(e&&typeof e=="object")}const c0=document.createElement("i");function pp(e){const t="&"+e+";";c0.innerHTML=t;const n=c0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ir(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function mr(e,t){return e.length>0?(ir(e,e.length,0,t),e):t}const d0={}.hasOwnProperty;function uy(e){const t={};let n=-1;for(;++n<e.length;)Gw(t,e[n]);return t}function Gw(e,t){let n;for(n in t){const o=(d0.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){d0.call(o,s)||(o[s]=[]);const a=i[s];Qw(o[s],Array.isArray(a)?a:a?[a]:[])}}}function Qw(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ir(e,0,0,r)}function cy(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Lr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _n=$o(/[A-Za-z]/),In=$o(/[\dA-Za-z]/),Xw=$o(/[#-'*+\--9=?A-Z^-~]/);function $u(e){return e!==null&&(e<32||e===127)}const gf=$o(/\d/),Zw=$o(/[\dA-Fa-f]/),Jw=$o(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function Wt(e){return e!==null&&(e<0||e===32)}function St(e){return e===-2||e===-1||e===32}const Ec=$o(/\p{P}|\p{S}/u),pi=$o(/\s/);function $o(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ps(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&In(e.charCodeAt(n+1))&&In(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function At(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return St(l)?(e.enter(n),a(l)):t(l)}function a(l){return St(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const eD={tokenize:tD};function tD(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),At(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return rt(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const nD={tokenize:rD},f0={tokenize:oD};function rD(e){const t=this,n=[];let r=0,o,i,s;return a;function a(E){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,l,u)(E)}return u(E)}function l(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&C();const T=t.events.length;let I=T,D;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){D=t.events[I][1].end;break}x(r);let _=T;for(;_<t.events.length;)t.events[_][1].end={...D},_++;return ir(t.events,I+1,0,t.events.slice(T)),t.events.length=_,u(E)}return a(E)}function u(E){if(r===n.length){if(!o)return h(E);if(o.currentConstruct&&o.currentConstruct.concrete)return m(E);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(f0,d,f)(E)}function d(E){return o&&C(),x(r),h(E)}function f(E){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(E)}function h(E){return t.containerState={},e.attempt(f0,p,m)(E)}function p(E){return r++,n.push([t.currentConstruct,t.containerState]),h(E)}function m(E){if(E===null){o&&C(),x(0),e.consume(E);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),b(E)}function b(E){if(E===null){y(e.exit("chunkFlow"),!0),x(0),e.consume(E);return}return rt(E)?(e.consume(E),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(E),b)}function y(E,T){const I=t.sliceStream(E);if(T&&I.push(null),E.previous=i,i&&(i.next=E),i=E,o.defineSkip(E.start),o.write(I),t.parser.lazy[E.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<s&&(!o.events[D][1].end||o.events[D][1].end.offset>s))return;const _=t.events.length;let O=_,B,L;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(B){L=t.events[O][1].end;break}B=!0}for(x(r),D=_;D<t.events.length;)t.events[D][1].end={...L},D++;ir(t.events,O+1,0,t.events.slice(_)),t.events.length=D}}function x(E){let T=n.length;for(;T-- >E;){const I=n[T];t.containerState=I[1],I[0].exit.call(t,e)}n.length=E}function C(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function oD(e,t,n){return At(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function xs(e){if(e===null||Wt(e)||pi(e))return 1;if(Ec(e))return 2}function Tc(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const bf={name:"attention",resolveAll:iD,tokenize:sD};function iD(e,t){let n=-1,r,o,i,s,a,l,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};p0(f,-l),p0(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=mr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=mr(u,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=mr(u,Tc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=mr(u,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=mr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ir(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function sD(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=xs(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const u=e.exit("attentionSequence"),d=xs(l),f=!d||d===2&&o||n.includes(l),h=!o||o===2&&d||n.includes(r);return u._open=!!(i===42?f:f&&(o||!h)),u._close=!!(i===42?h:h&&(d||!f)),t(l)}}function p0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const aD={name:"autolink",tokenize:lD};function lD(e,t,n){let r=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return _n(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||In(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||In(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||$u(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),d):Xw(p)?(e.consume(p),u):n(p)}function d(p){return In(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||In(p))&&r++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const Tl={partial:!0,tokenize:uD};function uD(e,t,n){return r;function r(i){return St(i)?At(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||rt(i)?t(i):n(i)}}const dy={continuation:{tokenize:dD},exit:fD,name:"blockQuote",tokenize:cD};function cD(e,t,n){const r=this;return o;function o(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return St(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function dD(e,t,n){const r=this;return o;function o(s){return St(s)?At(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(dy,t,n)(s)}}function fD(e){e.exit("blockQuote")}const fy={name:"characterEscape",tokenize:pD};function pD(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return Jw(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const py={name:"characterReference",tokenize:hD};function hD(e,t,n){const r=this;let o=0,i,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,s=In,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=Zw,d):(e.enter("characterReferenceValue"),i=7,s=gf,d(f))}function d(f){if(f===59&&o){const h=e.exit("characterReferenceValue");return s===In&&!pp(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&o++<i?(e.consume(f),d):n(f)}}const h0={partial:!0,tokenize:gD},m0={concrete:!0,name:"codeFenced",tokenize:mD};function mD(e,t,n){const r=this,o={partial:!0,tokenize:I};let i=0,s=0,a;return l;function l(D){return u(D)}function u(D){const _=r.events[r.events.length-1];return i=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(D)}function d(D){return D===a?(s++,e.consume(D),d):s<3?n(D):(e.exit("codeFencedFenceSequence"),St(D)?At(e,f,"whitespace")(D):f(D))}function f(D){return D===null||rt(D)?(e.exit("codeFencedFence"),r.interrupt?t(D):e.check(h0,b,T)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(D))}function h(D){return D===null||rt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(D)):St(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),At(e,p,"whitespace")(D)):D===96&&D===a?n(D):(e.consume(D),h)}function p(D){return D===null||rt(D)?f(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(D))}function m(D){return D===null||rt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(D)):D===96&&D===a?n(D):(e.consume(D),m)}function b(D){return e.attempt(o,T,y)(D)}function y(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),x}function x(D){return i>0&&St(D)?At(e,C,"linePrefix",i+1)(D):C(D)}function C(D){return D===null||rt(D)?e.check(h0,b,T)(D):(e.enter("codeFlowValue"),E(D))}function E(D){return D===null||rt(D)?(e.exit("codeFlowValue"),C(D)):(e.consume(D),E)}function T(D){return e.exit("codeFenced"),t(D)}function I(D,_,O){let B=0;return L;function L(R){return D.enter("lineEnding"),D.consume(R),D.exit("lineEnding"),j}function j(R){return D.enter("codeFencedFence"),St(R)?At(D,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):S(R)}function S(R){return R===a?(D.enter("codeFencedFenceSequence"),$(R)):O(R)}function $(R){return R===a?(B++,D.consume(R),$):B>=s?(D.exit("codeFencedFenceSequence"),St(R)?At(D,F,"whitespace")(R):F(R)):O(R)}function F(R){return R===null||rt(R)?(D.exit("codeFencedFence"),_(R)):O(R)}}}function gD(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const gd={name:"codeIndented",tokenize:yD},bD={partial:!0,tokenize:xD};function yD(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),At(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):rt(u)?e.attempt(bD,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||rt(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function xD(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):rt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):At(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):rt(s)?o(s):n(s)}}const vD={name:"codeText",previous:ED,resolve:CD,tokenize:TD};function CD(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function ED(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function TD(e,t,n){let r=0,o,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),o=0,d(f)):rt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||rt(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",u(f))}}class SD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&oa(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),oa(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),oa(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);oa(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);oa(this.left,n.reverse())}}}function oa(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function hy(e){const t={};let n=-1,r,o,i,s,a,l,u;const d=new SD(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,kD(d,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(d.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...d.get(o)[1].start},a=d.slice(o,n),a.unshift(r),d.splice(o,n-o+1,a))}}return ir(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function kD(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let d,f,h=-1,p=n,m=0,b=0;const y=[b];for(;p;){for(;e.get(++o)[1]!==p;);i.push(o),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(b=h+1,y.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),h=y.length;h--;){const x=a.slice(y[h],y[h+1]),C=i.pop();l.push([C,C+x.length-1]),e.splice(C,2,x)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const wD={resolve:ID,tokenize:AD},DD={partial:!0,tokenize:OD};function ID(e){return hy(e),e}function AD(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):rt(a)?e.check(DD,s,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function OD(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),At(e,i,"linePrefix")}function i(s){if(s===null||rt(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function my(e,t,n,r,o,i,s,a,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(x){return x===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(x),e.exit(i),h):x===null||x===32||x===41||$u(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function h(x){return x===62?(e.enter(i),e.consume(x),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||rt(x)?n(x):(e.consume(x),x===92?m:p)}function m(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function b(x){return!d&&(x===null||x===41||Wt(x))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(x)):d<u&&x===40?(e.consume(x),d++,b):x===41?(e.consume(x),d--,b):x===null||x===32||x===40||$u(x)?n(x):(e.consume(x),x===92?y:b)}function y(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function gy(e,t,n,r,o,i){const s=this;let a=0,l;return u;function u(p){return e.enter(r),e.enter(o),e.consume(p),e.exit(o),e.enter(i),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(i),e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):rt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||rt(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!St(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function by(e,t,n,r,o,i){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(o),e.consume(h),e.exit(o),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):(e.enter(i),u(h))}function u(h){return h===s?(e.exit(i),l(s)):h===null?n(h):rt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),At(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||rt(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===s||h===92?(e.consume(h),d):d(h)}}function _a(e,t){let n;return r;function r(o){return rt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):St(o)?At(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const MD={name:"definition",tokenize:RD},PD={partial:!0,tokenize:ND};function RD(e,t,n){const r=this;let o;return i;function i(p){return e.enter("definition"),s(p)}function s(p){return gy.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return o=Lr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Wt(p)?_a(e,u)(p):u(p)}function u(p){return my(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(PD,f,f)(p)}function f(p){return St(p)?At(e,h,"whitespace")(p):h(p)}function h(p){return p===null||rt(p)?(e.exit("definition"),r.parser.defined.push(o),t(p)):n(p)}}function ND(e,t,n){return r;function r(a){return Wt(a)?_a(e,o)(a):n(a)}function o(a){return by(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return St(a)?At(e,s,"whitespace")(a):s(a)}function s(a){return a===null||rt(a)?t(a):n(a)}}const FD={name:"hardBreakEscape",tokenize:LD};function LD(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return rt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const _D={name:"headingAtx",resolve:BD,tokenize:jD};function BD(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ir(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function jD(e,t,n){let r=0;return o;function o(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||Wt(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||rt(d)?(e.exit("atxHeading"),t(d)):St(d)?At(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||Wt(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const $D=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],g0=["pre","script","style","textarea"],HD={concrete:!0,name:"htmlFlow",resolveTo:VD,tokenize:WD},zD={partial:!0,tokenize:YD},UD={partial:!0,tokenize:qD};function VD(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function WD(e,t,n){const r=this;let o,i,s,a,l;return u;function u(z){return d(z)}function d(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),f}function f(z){return z===33?(e.consume(z),h):z===47?(e.consume(z),i=!0,b):z===63?(e.consume(z),o=3,r.interrupt?t:P):_n(z)?(e.consume(z),s=String.fromCharCode(z),y):n(z)}function h(z){return z===45?(e.consume(z),o=2,p):z===91?(e.consume(z),o=5,a=0,m):_n(z)?(e.consume(z),o=4,r.interrupt?t:P):n(z)}function p(z){return z===45?(e.consume(z),r.interrupt?t:P):n(z)}function m(z){const ye="CDATA[";return z===ye.charCodeAt(a++)?(e.consume(z),a===ye.length?r.interrupt?t:S:m):n(z)}function b(z){return _n(z)?(e.consume(z),s=String.fromCharCode(z),y):n(z)}function y(z){if(z===null||z===47||z===62||Wt(z)){const ye=z===47,se=s.toLowerCase();return!ye&&!i&&g0.includes(se)?(o=1,r.interrupt?t(z):S(z)):$D.includes(s.toLowerCase())?(o=6,ye?(e.consume(z),x):r.interrupt?t(z):S(z)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(z):i?C(z):E(z))}return z===45||In(z)?(e.consume(z),s+=String.fromCharCode(z),y):n(z)}function x(z){return z===62?(e.consume(z),r.interrupt?t:S):n(z)}function C(z){return St(z)?(e.consume(z),C):L(z)}function E(z){return z===47?(e.consume(z),L):z===58||z===95||_n(z)?(e.consume(z),T):St(z)?(e.consume(z),E):L(z)}function T(z){return z===45||z===46||z===58||z===95||In(z)?(e.consume(z),T):I(z)}function I(z){return z===61?(e.consume(z),D):St(z)?(e.consume(z),I):E(z)}function D(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),l=z,_):St(z)?(e.consume(z),D):O(z)}function _(z){return z===l?(e.consume(z),l=null,B):z===null||rt(z)?n(z):(e.consume(z),_)}function O(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Wt(z)?I(z):(e.consume(z),O)}function B(z){return z===47||z===62||St(z)?E(z):n(z)}function L(z){return z===62?(e.consume(z),j):n(z)}function j(z){return z===null||rt(z)?S(z):St(z)?(e.consume(z),j):n(z)}function S(z){return z===45&&o===2?(e.consume(z),H):z===60&&o===1?(e.consume(z),V):z===62&&o===4?(e.consume(z),J):z===63&&o===3?(e.consume(z),P):z===93&&o===5?(e.consume(z),q):rt(z)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(zD,re,$)(z)):z===null||rt(z)?(e.exit("htmlFlowData"),$(z)):(e.consume(z),S)}function $(z){return e.check(UD,F,re)(z)}function F(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),R}function R(z){return z===null||rt(z)?$(z):(e.enter("htmlFlowData"),S(z))}function H(z){return z===45?(e.consume(z),P):S(z)}function V(z){return z===47?(e.consume(z),s="",Y):S(z)}function Y(z){if(z===62){const ye=s.toLowerCase();return g0.includes(ye)?(e.consume(z),J):S(z)}return _n(z)&&s.length<8?(e.consume(z),s+=String.fromCharCode(z),Y):S(z)}function q(z){return z===93?(e.consume(z),P):S(z)}function P(z){return z===62?(e.consume(z),J):z===45&&o===2?(e.consume(z),P):S(z)}function J(z){return z===null||rt(z)?(e.exit("htmlFlowData"),re(z)):(e.consume(z),J)}function re(z){return e.exit("htmlFlow"),t(z)}}function qD(e,t,n){const r=this;return o;function o(s){return rt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function YD(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Tl,t,n)}}const KD={name:"htmlText",tokenize:GD};function GD(e,t,n){const r=this;let o,i,s;return a;function a(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),l}function l(P){return P===33?(e.consume(P),u):P===47?(e.consume(P),I):P===63?(e.consume(P),E):_n(P)?(e.consume(P),O):n(P)}function u(P){return P===45?(e.consume(P),d):P===91?(e.consume(P),i=0,m):_n(P)?(e.consume(P),C):n(P)}function d(P){return P===45?(e.consume(P),p):n(P)}function f(P){return P===null?n(P):P===45?(e.consume(P),h):rt(P)?(s=f,V(P)):(e.consume(P),f)}function h(P){return P===45?(e.consume(P),p):f(P)}function p(P){return P===62?H(P):P===45?h(P):f(P)}function m(P){const J="CDATA[";return P===J.charCodeAt(i++)?(e.consume(P),i===J.length?b:m):n(P)}function b(P){return P===null?n(P):P===93?(e.consume(P),y):rt(P)?(s=b,V(P)):(e.consume(P),b)}function y(P){return P===93?(e.consume(P),x):b(P)}function x(P){return P===62?H(P):P===93?(e.consume(P),x):b(P)}function C(P){return P===null||P===62?H(P):rt(P)?(s=C,V(P)):(e.consume(P),C)}function E(P){return P===null?n(P):P===63?(e.consume(P),T):rt(P)?(s=E,V(P)):(e.consume(P),E)}function T(P){return P===62?H(P):E(P)}function I(P){return _n(P)?(e.consume(P),D):n(P)}function D(P){return P===45||In(P)?(e.consume(P),D):_(P)}function _(P){return rt(P)?(s=_,V(P)):St(P)?(e.consume(P),_):H(P)}function O(P){return P===45||In(P)?(e.consume(P),O):P===47||P===62||Wt(P)?B(P):n(P)}function B(P){return P===47?(e.consume(P),H):P===58||P===95||_n(P)?(e.consume(P),L):rt(P)?(s=B,V(P)):St(P)?(e.consume(P),B):H(P)}function L(P){return P===45||P===46||P===58||P===95||In(P)?(e.consume(P),L):j(P)}function j(P){return P===61?(e.consume(P),S):rt(P)?(s=j,V(P)):St(P)?(e.consume(P),j):B(P)}function S(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),o=P,$):rt(P)?(s=S,V(P)):St(P)?(e.consume(P),S):(e.consume(P),F)}function $(P){return P===o?(e.consume(P),o=void 0,R):P===null?n(P):rt(P)?(s=$,V(P)):(e.consume(P),$)}function F(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||Wt(P)?B(P):(e.consume(P),F)}function R(P){return P===47||P===62||Wt(P)?B(P):n(P)}function H(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function V(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),Y}function Y(P){return St(P)?At(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):q(P)}function q(P){return e.enter("htmlTextData"),s(P)}}const hp={name:"labelEnd",resolveAll:JD,resolveTo:e3,tokenize:t3},QD={tokenize:n3},XD={tokenize:r3},ZD={tokenize:o3};function JD(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&ir(e,0,e.length,n),e}function e3(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=mr(a,e.slice(i+1,i+r+3)),a=mr(a,[["enter",d,t]]),a=mr(a,Tc(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=mr(a,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),a=mr(a,e.slice(s+1)),a=mr(a,[["exit",l,t]]),ir(e,i,e.length,a),e}function t3(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(h){return i?i._inactive?f(h):(s=r.parser.defined.includes(Lr(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(QD,d,s?d:f)(h):h===91?e.attempt(XD,d,s?u:f)(h):s?d(h):f(h)}function u(h){return e.attempt(ZD,d,f)(h)}function d(h){return t(h)}function f(h){return i._balanced=!0,n(h)}}function n3(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return Wt(f)?_a(e,i)(f):i(f)}function i(f){return f===41?d(f):my(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Wt(f)?_a(e,l)(f):d(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?by(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return Wt(f)?_a(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function r3(e,t,n){const r=this;return o;function o(a){return gy.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Lr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function o3(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const i3={name:"labelStartImage",resolveAll:hp.resolveAll,tokenize:s3};function s3(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const a3={name:"labelStartLink",resolveAll:hp.resolveAll,tokenize:l3};function l3(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const bd={name:"lineEnding",tokenize:u3};function u3(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),At(e,t,"linePrefix")}}const hu={name:"thematicBreak",tokenize:c3};function c3(e,t,n){let r=0,o;return i;function i(u){return e.enter("thematicBreak"),s(u)}function s(u){return o=u,a(u)}function a(u){return u===o?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||rt(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===o?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),St(u)?At(e,a,"whitespace")(u):a(u))}}const Vn={continuation:{tokenize:h3},exit:g3,name:"list",tokenize:p3},d3={partial:!0,tokenize:b3},f3={partial:!0,tokenize:m3};function p3(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:gf(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(hu,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return gf(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Tl,r.interrupt?n:d,e.attempt(d3,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return St(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function h3(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Tl,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,At(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!St(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(f3,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,At(e,e.attempt(Vn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function m3(e,t,n){const r=this;return At(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function g3(e){e.exit(this.containerState.type)}function b3(e,t,n){const r=this;return At(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!St(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const b0={name:"setextUnderline",resolveTo:y3,tokenize:x3};function y3(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function x3(e,t,n){const r=this;let o;return i;function i(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),o=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===o?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),St(u)?At(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||rt(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const v3={tokenize:C3};function C3(e){const t=this,n=e.attempt(Tl,r,e.attempt(this.parser.constructs.flowInitial,o,At(e,e.attempt(this.parser.constructs.flow,o,e.attempt(wD,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const E3={resolveAll:xy()},T3=yy("string"),S3=yy("text");function yy(e){return{resolveAll:xy(e==="text"?k3:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(d){return u(d)?i(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const f=o[d];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function xy(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function k3(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const u=o[i];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const w3={42:Vn,43:Vn,45:Vn,48:Vn,49:Vn,50:Vn,51:Vn,52:Vn,53:Vn,54:Vn,55:Vn,56:Vn,57:Vn,62:dy},D3={91:MD},I3={[-2]:gd,[-1]:gd,32:gd},A3={35:_D,42:hu,45:[b0,hu],60:HD,61:b0,95:hu,96:m0,126:m0},O3={38:py,92:fy},M3={[-5]:bd,[-4]:bd,[-3]:bd,33:i3,38:py,42:bf,60:[aD,KD],91:a3,92:[FD,fy],93:hp,95:bf,96:vD},P3={null:[bf,E3]},R3={null:[42,95]},N3={null:[]},F3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:R3,contentInitial:D3,disable:N3,document:w3,flow:A3,flowInitial:I3,insideSpan:P3,string:O3,text:M3},Symbol.toStringTag,{value:"Module"}));function L3(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let s=[],a=[];const l={attempt:_(I),check:_(D),consume:C,enter:E,exit:T,interrupt:_(D,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function f(j){return s=mr(s,j),y(),s[s.length-1]!==null?[]:(O(t,0),u.events=Tc(i,u.events,u),u.events)}function h(j,S){return B3(p(j),S)}function p(j){return _3(s,j)}function m(){const{_bufferIndex:j,_index:S,line:$,column:F,offset:R}=r;return{_bufferIndex:j,_index:S,line:$,column:F,offset:R}}function b(j){o[j.line]=j.column,L()}function y(){let j;for(;r._index<s.length;){const S=s[r._index];if(typeof S=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<S.length;)x(S.charCodeAt(r._bufferIndex));else x(S)}}function x(j){d=d(j)}function C(j){rt(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,L()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=j}function E(j,S){const $=S||{};return $.type=j,$.start=m(),u.events.push(["enter",$,u]),a.push($),$}function T(j){const S=a.pop();return S.end=m(),u.events.push(["exit",S,u]),S}function I(j,S){O(j,S.from)}function D(j,S){S.restore()}function _(j,S){return $;function $(F,R,H){let V,Y,q,P;return Array.isArray(F)?re(F):"tokenize"in F?re([F]):J(F);function J(G){return le;function le(oe){const ue=oe!==null&&G[oe],ie=oe!==null&&G.null,Z=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return re(Z)(oe)}}function re(G){return V=G,Y=0,G.length===0?H:z(G[Y])}function z(G){return le;function le(oe){return P=B(),q=G,G.partial||(u.currentConstruct=G),G.name&&u.parser.constructs.disable.null.includes(G.name)?se():G.tokenize.call(S?Object.assign(Object.create(u),S):u,l,ye,se)(oe)}}function ye(G){return j(q,P),R}function se(G){return P.restore(),++Y<V.length?z(V[Y]):H}}}function O(j,S){j.resolveAll&&!i.includes(j)&&i.push(j),j.resolve&&ir(u.events,S,u.events.length-S,j.resolve(u.events.slice(S),u)),j.resolveTo&&(u.events=j.resolveTo(u.events,u))}function B(){const j=m(),S=u.previous,$=u.currentConstruct,F=u.events.length,R=Array.from(a);return{from:F,restore:H};function H(){r=j,u.previous=S,u.currentConstruct=$,u.events.length=F,a=R,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function _3(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function B3(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
23
|
-
`;break}case-3:{s=`\r
|
|
24
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}function j3(e){const r={constructs:uy([F3,...(e||{}).extensions||[]]),content:o(eD),defined:[],document:o(nD),flow:o(v3),lazy:{},string:o(T3),text:o(S3)};return r;function o(i){return s;function s(a){return L3(r,i,a)}}}function $3(e){for(;!hy(e););return e}const y0=/[\0\t\n\r]/g;function H3(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let u,d,f,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(y0.lastIndex=f,u=y0.exec(i),h=u&&u.index!==void 0?u.index:i.length,p=i.charCodeAt(h),!u){t=i.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(i.slice(f,h)),e+=h-f),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const z3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function U3(e){return e.replace(z3,V3)}function V3(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return cy(n.slice(i?2:1),i?16:10)}return pp(n)||e}const vy={}.hasOwnProperty;function W3(e,t,n){return typeof t!="string"&&(n=t,t=void 0),q3(n)($3(j3(n).document().write(H3()(e,t,!0))))}function q3(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i($e),autolinkProtocol:B,autolinkEmail:B,atxHeading:i(Ce),blockQuote:i(ie),characterEscape:B,characterReference:B,codeFenced:i(Z),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Z,s),codeText:i(de,s),codeTextData:B,data:B,codeFlowValue:B,definition:i(ae),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ne),hardBreakEscape:i(ve),hardBreakTrailing:i(ve),htmlFlow:i(Se,s),htmlFlowData:B,htmlText:i(Se,s),htmlTextData:B,image:i(he),label:s,link:i($e),listItem:i(Je),listItemValue:h,listOrdered:i(Pe,f),listUnordered:i(Pe),paragraph:i(Me),reference:z,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Ce),strong:i(Nt),thematicBreak:i(tt)},exit:{atxHeading:l(),atxHeadingSequence:I,autolink:l(),autolinkEmail:ue,autolinkProtocol:oe,blockQuote:l(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:G,characterReference:le,codeFenced:l(y),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:l(x),codeText:l(R),codeTextData:L,data:L,definition:l(),definitionDestinationString:T,definitionLabelString:C,definitionTitleString:E,emphasis:l(),hardBreakEscape:l(S),hardBreakTrailing:l(S),htmlFlow:l($),htmlFlowData:L,htmlText:l(F),htmlTextData:L,image:l(V),label:q,labelText:Y,lineEnding:j,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ye,resourceDestinationString:P,resourceTitleString:J,resource:re,setextHeading:l(O),setextHeadingLineSequence:_,setextHeadingText:D,strong:l(),thematicBreak:l()}};Cy(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(xe){let Oe={type:"root",children:[]};const We={stack:[Oe],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:d,data:n},Xe=[];let Ze=-1;for(;++Ze<xe.length;)if(xe[Ze][1].type==="listOrdered"||xe[Ze][1].type==="listUnordered")if(xe[Ze][0]==="enter")Xe.push(Ze);else{const Fe=Xe.pop();Ze=o(xe,Fe,Ze)}for(Ze=-1;++Ze<xe.length;){const Fe=t[xe[Ze][0]];vy.call(Fe,xe[Ze][1].type)&&Fe[xe[Ze][1].type].call(Object.assign({sliceSerialize:xe[Ze][2].sliceSerialize},We),xe[Ze][1])}if(We.tokenStack.length>0){const Fe=We.tokenStack[We.tokenStack.length-1];(Fe[1]||x0).call(We,void 0,Fe[0])}for(Oe.position={start:Io(xe.length>0?xe[0][1].start:{line:1,column:1,offset:0}),end:Io(xe.length>0?xe[xe.length-2][1].end:{line:1,column:1,offset:0})},Ze=-1;++Ze<t.transforms.length;)Oe=t.transforms[Ze](Oe)||Oe;return Oe}function o(xe,Oe,We){let Xe=Oe-1,Ze=-1,Fe=!1,dt,lt,Mt,be;for(;++Xe<=We;){const Ae=xe[Xe];switch(Ae[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ae[0]==="enter"?Ze++:Ze--,be=void 0;break}case"lineEndingBlank":{Ae[0]==="enter"&&(dt&&!be&&!Ze&&!Mt&&(Mt=Xe),be=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:be=void 0}if(!Ze&&Ae[0]==="enter"&&Ae[1].type==="listItemPrefix"||Ze===-1&&Ae[0]==="exit"&&(Ae[1].type==="listUnordered"||Ae[1].type==="listOrdered")){if(dt){let Re=Xe;for(lt=void 0;Re--;){const Qe=xe[Re];if(Qe[1].type==="lineEnding"||Qe[1].type==="lineEndingBlank"){if(Qe[0]==="exit")continue;lt&&(xe[lt][1].type="lineEndingBlank",Fe=!0),Qe[1].type="lineEnding",lt=Re}else if(!(Qe[1].type==="linePrefix"||Qe[1].type==="blockQuotePrefix"||Qe[1].type==="blockQuotePrefixWhitespace"||Qe[1].type==="blockQuoteMarker"||Qe[1].type==="listItemIndent"))break}Mt&&(!lt||Mt<lt)&&(dt._spread=!0),dt.end=Object.assign({},lt?xe[lt][1].start:Ae[1].end),xe.splice(lt||Xe,0,["exit",dt,Ae[2]]),Xe++,We++}if(Ae[1].type==="listItemPrefix"){const Re={type:"listItem",_spread:!1,start:Object.assign({},Ae[1].start),end:void 0};dt=Re,xe.splice(Xe,0,["enter",Re,Ae[2]]),Xe++,We++,Mt=void 0,be=!0}}}return xe[Oe][1]._spread=Fe,We}function i(xe,Oe){return We;function We(Xe){a.call(this,xe(Xe),Xe),Oe&&Oe.call(this,Xe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(xe,Oe,We){this.stack[this.stack.length-1].children.push(xe),this.stack.push(xe),this.tokenStack.push([Oe,We||void 0]),xe.position={start:Io(Oe.start),end:void 0}}function l(xe){return Oe;function Oe(We){xe&&xe.call(this,We),u.call(this,We)}}function u(xe,Oe){const We=this.stack.pop(),Xe=this.tokenStack.pop();if(Xe)Xe[0].type!==xe.type&&(Oe?Oe.call(this,xe,Xe[0]):(Xe[1]||x0).call(this,xe,Xe[0]));else throw new Error("Cannot close `"+xe.type+"` ("+La({start:xe.start,end:xe.end})+"): it’s not open");We.position.end=Io(xe.end)}function d(){return fp(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(xe){if(this.data.expectingFirstListItemValue){const Oe=this.stack[this.stack.length-2];Oe.start=Number.parseInt(this.sliceSerialize(xe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.lang=xe}function m(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.meta=xe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=xe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=xe.replace(/(\r?\n|\r)$/g,"")}function C(xe){const Oe=this.resume(),We=this.stack[this.stack.length-1];We.label=Oe,We.identifier=Lr(this.sliceSerialize(xe)).toLowerCase()}function E(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.title=xe}function T(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.url=xe}function I(xe){const Oe=this.stack[this.stack.length-1];if(!Oe.depth){const We=this.sliceSerialize(xe).length;Oe.depth=We}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function _(xe){const Oe=this.stack[this.stack.length-1];Oe.depth=this.sliceSerialize(xe).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function B(xe){const We=this.stack[this.stack.length-1].children;let Xe=We[We.length-1];(!Xe||Xe.type!=="text")&&(Xe=ct(),Xe.position={start:Io(xe.start),end:void 0},We.push(Xe)),this.stack.push(Xe)}function L(xe){const Oe=this.stack.pop();Oe.value+=this.sliceSerialize(xe),Oe.position.end=Io(xe.end)}function j(xe){const Oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const We=Oe.children[Oe.children.length-1];We.position.end=Io(xe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Oe.type)&&(B.call(this,xe),L.call(this,xe))}function S(){this.data.atHardBreak=!0}function $(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=xe}function F(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=xe}function R(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=xe}function H(){const xe=this.stack[this.stack.length-1];if(this.data.inReference){const Oe=this.data.referenceType||"shortcut";xe.type+="Reference",xe.referenceType=Oe,delete xe.url,delete xe.title}else delete xe.identifier,delete xe.label;this.data.referenceType=void 0}function V(){const xe=this.stack[this.stack.length-1];if(this.data.inReference){const Oe=this.data.referenceType||"shortcut";xe.type+="Reference",xe.referenceType=Oe,delete xe.url,delete xe.title}else delete xe.identifier,delete xe.label;this.data.referenceType=void 0}function Y(xe){const Oe=this.sliceSerialize(xe),We=this.stack[this.stack.length-2];We.label=U3(Oe),We.identifier=Lr(Oe).toLowerCase()}function q(){const xe=this.stack[this.stack.length-1],Oe=this.resume(),We=this.stack[this.stack.length-1];if(this.data.inReference=!0,We.type==="link"){const Xe=xe.children;We.children=Xe}else We.alt=Oe}function P(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.url=xe}function J(){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.title=xe}function re(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function ye(xe){const Oe=this.resume(),We=this.stack[this.stack.length-1];We.label=Oe,We.identifier=Lr(this.sliceSerialize(xe)).toLowerCase(),this.data.referenceType="full"}function se(xe){this.data.characterReferenceType=xe.type}function G(xe){const Oe=this.sliceSerialize(xe),We=this.data.characterReferenceType;let Xe;We?(Xe=cy(Oe,We==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Xe=pp(Oe);const Ze=this.stack[this.stack.length-1];Ze.value+=Xe}function le(xe){const Oe=this.stack.pop();Oe.position.end=Io(xe.end)}function oe(xe){L.call(this,xe);const Oe=this.stack[this.stack.length-1];Oe.url=this.sliceSerialize(xe)}function ue(xe){L.call(this,xe);const Oe=this.stack[this.stack.length-1];Oe.url="mailto:"+this.sliceSerialize(xe)}function ie(){return{type:"blockquote",children:[]}}function Z(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function ae(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ne(){return{type:"emphasis",children:[]}}function Ce(){return{type:"heading",depth:0,children:[]}}function ve(){return{type:"break"}}function Se(){return{type:"html",value:""}}function he(){return{type:"image",title:null,url:"",alt:null}}function $e(){return{type:"link",title:null,url:"",children:[]}}function Pe(xe){return{type:"list",ordered:xe.type==="listOrdered",start:null,spread:xe._spread,children:[]}}function Je(xe){return{type:"listItem",spread:xe._spread,checked:null,children:[]}}function Me(){return{type:"paragraph",children:[]}}function Nt(){return{type:"strong",children:[]}}function ct(){return{type:"text",value:""}}function tt(){return{type:"thematicBreak"}}}function Io(e){return{line:e.line,column:e.column,offset:e.offset}}function Cy(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Cy(e,r):Y3(e,r)}}function Y3(e,t){let n;for(n in t)if(vy.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function x0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+La({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+La({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+La({start:t.start,end:t.end})+") is still open")}function K3(e){const t=this;t.parser=n;function n(r){return W3(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function G3(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Q3(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
25
|
-
`}]}function X3(e,t){const n=t.value?t.value+`
|
|
26
|
-
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Z3(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function J3(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eI(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Ps(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function tI(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nI(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ey(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function rI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ey(e,t);const o={src:Ps(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function oI(e,t){const n={src:Ps(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function iI(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function sI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ey(e,t);const o={href:Ps(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function aI(e,t){const n={href:Ps(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lI(e,t,n){const r=e.all(t),o=n?uI(n):Ty(t),i={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const d=r[a];(o||a!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
|
|
27
|
-
`}),d.type==="element"&&d.tagName==="p"&&!o?s.push(...d.children):s.push(d)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
28
|
-
`});const u={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,u),e.applyData(t,u)}function uI(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Ty(n[r])}return t}function Ty(e){const t=e.spread;return t??e.children.length>1}function cI(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function dI(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fI(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function pI(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hI(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=to(t.children[1]),l=Cc(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function mI(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const f=t.children[l],h={},p=s?s[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),u.push(m)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function gI(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const v0=9,C0=32;function bI(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(E0(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(E0(t.slice(o),o>0,!1)),i.join("")}function E0(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===v0||i===C0;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===v0||i===C0;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function yI(e,t){const n={type:"text",value:bI(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function xI(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const vI={blockquote:G3,break:Q3,code:X3,delete:Z3,emphasis:J3,footnoteReference:eI,heading:tI,html:nI,imageReference:rI,image:oI,inlineCode:iI,linkReference:sI,link:aI,listItem:lI,list:cI,paragraph:dI,root:fI,strong:pI,table:hI,tableCell:gI,tableRow:mI,text:yI,thematicBreak:xI,toml:Ql,yaml:Ql,definition:Ql,footnoteDefinition:Ql};function Ql(){}const Sy=-1,Sc=0,Ba=1,Hu=2,mp=3,gp=4,bp=5,yp=6,ky=7,wy=8,T0=typeof self=="object"?self:globalThis,CI=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case Sc:case Sy:return n(s,o);case Ba:{const a=n([],o);for(const l of s)a.push(r(l));return a}case Hu:{const a=n({},o);for(const[l,u]of s)a[r(l)]=r(u);return a}case mp:return n(new Date(s),o);case gp:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case bp:{const a=n(new Map,o);for(const[l,u]of s)a.set(r(l),r(u));return a}case yp:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case ky:{const{name:a,message:l}=s;return n(new T0[a](l),o)}case wy:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new T0[i](s),o)};return r},S0=e=>CI(new Map,e)(0),Qi="",{toString:EI}={},{keys:TI}=Object,ia=e=>{const t=typeof e;if(t!=="object"||!e)return[Sc,t];const n=EI.call(e).slice(8,-1);switch(n){case"Array":return[Ba,Qi];case"Object":return[Hu,Qi];case"Date":return[mp,Qi];case"RegExp":return[gp,Qi];case"Map":return[bp,Qi];case"Set":return[yp,Qi];case"DataView":return[Ba,n]}return n.includes("Array")?[Ba,n]:n.includes("Error")?[ky,n]:[Hu,n]},Xl=([e,t])=>e===Sc&&(t==="function"||t==="symbol"),SI=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=ia(s);switch(a){case Sc:{let d=s;switch(l){case"bigint":a=wy,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return o([Sy],s)}return o([a,d],s)}case Ba:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),o([l,[...h]],s)}const d=[],f=o([a,d],s);for(const h of s)d.push(i(h));return f}case Hu:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const d=[],f=o([a,d],s);for(const h of TI(s))(e||!Xl(ia(s[h])))&&d.push([i(h),i(s[h])]);return f}case mp:return o([a,s.toISOString()],s);case gp:{const{source:d,flags:f}=s;return o([a,{source:d,flags:f}],s)}case bp:{const d=[],f=o([a,d],s);for(const[h,p]of s)(e||!(Xl(ia(h))||Xl(ia(p))))&&d.push([i(h),i(p)]);return f}case yp:{const d=[],f=o([a,d],s);for(const h of s)(e||!Xl(ia(h)))&&d.push(i(h));return f}}const{message:u}=s;return o([a,{name:l,message:u}],s)};return i},k0=(e,{json:t,lossy:n}={})=>{const r=[];return SI(!(t||n),!!t,new Map,r)(e),r},hi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?S0(k0(e,t)):structuredClone(e):(e,t)=>S0(k0(e,t));function kI(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function wI(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function DI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||kI,r=e.options.footnoteBackLabel||wI,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),h=Ps(f.toLowerCase());let p=0;const m=[],b=e.footnoteCounts.get(f);for(;b!==void 0&&++p<=b;){m.length>0&&m.push({type:"text",value:" "});let C=typeof n=="string"?n:n(l,p);typeof C=="string"&&(C={type:"text",value:C}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const C=y.children[y.children.length-1];C&&C.type==="text"?C.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else d.push(...m);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...hi(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
29
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
30
|
-
`}]}}const kc=(function(e){if(e==null)return MI;if(typeof e=="function")return wc(e);if(typeof e=="object")return Array.isArray(e)?II(e):AI(e);if(typeof e=="string")return OI(e);throw new Error("Expected function, string, or object as test")});function II(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=kc(e[n]);return wc(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function AI(e){const t=e;return wc(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function OI(e){return wc(t);function t(n){return n&&n.type===e}}function wc(e){return t;function t(n,r,o){return!!(PI(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function MI(){return!0}function PI(e){return e!==null&&typeof e=="object"&&"type"in e}const Dy=[],RI=!0,zu=!1,ja="skip";function Iy(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=kc(o),s=r?-1:1;a(e,void 0,[])();function a(l,u,d){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Dy,m,b,y;if((!t||i(l,u,d[d.length-1]||void 0))&&(p=NI(n(l,d)),p[0]===zu))return p;if("children"in l&&l.children){const x=l;if(x.children&&p[0]!==ja)for(b=(r?x.children.length:-1)+s,y=d.concat(x);b>-1&&b<x.children.length;){const C=x.children[b];if(m=a(C,b,y)(),m[0]===zu)return m;b=typeof m[1]=="number"?m[1]:b+s}}return p}}}function NI(e){return Array.isArray(e)?e:typeof e=="number"?[RI,e]:e==null?Dy:[e]}function Kn(e,t,n,r){let o,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),Iy(e,i,a,o);function a(l,u){const d=u[u.length-1],f=d?d.children.indexOf(l):void 0;return s(l,f,d)}}const yf={}.hasOwnProperty,FI={};function LI(e,t){const n=t||FI,r=new Map,o=new Map,i=new Map,s={...vI,...n.handlers},a={all:u,applyData:BI,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:_I,wrap:$I};return Kn(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:o,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),a;function l(d,f){const h=d.type,p=a.handlers[h];if(yf.call(a.handlers,h)&&p)return p(a,d,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in d){const{children:b,...y}=d,x=hi(y);return x.children=a.all(d),x}return hi(d)}return(a.options.unknownHandler||jI)(a,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const m=a.one(h[p],d);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=w0(m.value)),!Array.isArray(m)&&m.type==="element")){const b=m.children[0];b&&b.type==="text"&&(b.value=w0(b.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function _I(e,t){e.position&&(t.position=ww(e))}function BI(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,hi(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function jI(e,t){const n=t.data||{},r="value"in t&&!(yf.call(n,"hProperties")||yf.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function $I(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
31
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
32
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
33
|
-
`}),n}function w0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function D0(e,t){const n=LI(e,t),r=n.one(e,void 0),o=DI(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
|
|
34
|
-
`},o),i}function HI(e,t){return e&&"run"in e?async function(n,r){const o=D0(n,{file:r,...t});await e.run(o,r)}:function(n,r){return D0(n,{file:r,...e||t})}}function I0(e){if(e)throw e}var yd,A0;function zI(){if(A0)return yd;A0=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},i=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var d=e.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!f)return!1;var h;for(h in u);return typeof h>"u"||e.call(u,h)},s=function(u,d){n&&d.name==="__proto__"?n(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},a=function(u,d){if(d==="__proto__")if(e.call(u,d)){if(r)return r(u,d).value}else return;return u[d]};return yd=function l(){var u,d,f,h,p,m,b=arguments[0],y=1,x=arguments.length,C=!1;for(typeof b=="boolean"&&(C=b,b=arguments[1]||{},y=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});y<x;++y)if(u=arguments[y],u!=null)for(d in u)f=a(b,d),h=a(u,d),b!==h&&(C&&h&&(i(h)||(p=o(h)))?(p?(p=!1,m=f&&o(f)?f:[]):m=f&&i(f)?f:{},s(b,{name:d,newValue:l(C,m,h)})):typeof h<"u"&&s(b,{name:d,newValue:h}));return b},yd}var UI=zI();const xd=Sr(UI);function xf(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function VI(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...u){const d=e[++i];let f=-1;if(l){s(l);return}for(;++f<o.length;)(u[f]===null||u[f]===void 0)&&(u[f]=o[f]);o=u,d?WI(d,a)(...u):s(null,...u)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function WI(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(u){const d=u;if(a&&n)throw d;return o(d)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const Yr={basename:qI,dirname:YI,extname:KI,join:GI,sep:"/"};function qI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Sl(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function YI(e){if(Sl(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function KI(e){Sl(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function GI(...e){let t=-1,n;for(;++t<e.length;)Sl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":QI(n)}function QI(e){Sl(e);const t=e.codePointAt(0)===47;let n=XI(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function XI(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function Sl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ZI={cwd:JI};function JI(){return"/"}function vf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function e6(e){if(typeof e=="string")e=new URL(e);else if(!vf(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return t6(e)}function t6(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const vd=["history","path","basename","stem","extname","dirname"];class Ay{constructor(t){let n;t?vf(t)?n={path:t}:typeof t=="string"||n6(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":ZI.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<vd.length;){const i=vd[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)vd.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Yr.basename(this.path):void 0}set basename(t){Ed(t,"basename"),Cd(t,"basename"),this.path=Yr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yr.dirname(this.path):void 0}set dirname(t){O0(this.basename,"dirname"),this.path=Yr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yr.extname(this.path):void 0}set extname(t){if(Cd(t,"extname"),O0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){vf(t)&&(t=e6(t)),Ed(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yr.basename(this.path,this.extname):void 0}set stem(t){Ed(t,"stem"),Cd(t,"stem"),this.path=Yr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Mn(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Cd(e,t){if(e&&e.includes(Yr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yr.sep+"`")}function Ed(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function O0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function n6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const r6=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),o6={}.hasOwnProperty;class xp extends r6{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=VI()}copy(){const t=new xp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(xd(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(kd("data",this.frozen),this.namespace[t]=n,this):o6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(kd("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Zl(t),r=this.parser||this.Parser;return Td("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Td("process",this.parser||this.Parser),Sd("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Zl(t),l=r.parse(a);r.run(l,a,function(d,f,h){if(d||!f||!h)return u(d);const p=f,m=r.stringify(p,h);a6(m)?h.value=m:h.result=m,u(d,h)});function u(d,f){d||!f?s(d):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Td("processSync",this.parser||this.Parser),Sd("processSync",this.compiler||this.Compiler),this.process(t,o),P0("processSync","process",n),r;function o(i,s){n=!0,I0(i),r=s}}run(t,n,r){M0(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Zl(n);o.run(t,l,u);function u(d,f,h){const p=f||t;d?a(d):s?s(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),P0("runSync","run",r),o;function i(s,a){I0(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Zl(n),o=this.compiler||this.Compiler;return Sd("stringify",o),M0(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(kd("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;l(d,f)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(o.settings=xd(!0,o.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];i(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[p,...m]=d;const b=r[h][1];xf(b)&&xf(p)&&(p=xd(!0,b,p)),r[h]=[u,p,...m]}}}}const i6=new xp().freeze();function Td(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Sd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function kd(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function M0(e){if(!xf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function P0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zl(e){return s6(e)?e:new Ay(e)}function s6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function a6(e){return typeof e=="string"||l6(e)}function l6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const u6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",R0=[],N0={allowDangerousHtml:!0},c6=/^(https?|ircs?|mailto|xmpp)$/i,d6=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function f6(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||R0,l=e.remarkPlugins||R0,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...N0}:N0,d=e.skipHtml,f=e.unwrapDisallowed,h=e.urlTransform||p6,p=i6().use(K3).use(l).use(HI,u).use(a),m=new Ay;typeof r=="string"&&(m.value=r);for(const C of d6)Object.hasOwn(e,C.from)&&(""+C.from+(C.to?"use `"+C.to+"` instead":"remove it")+u6+C.id,void 0);const b=p.parse(m);let y=p.runSync(b,m);return o&&(y={type:"element",tagName:"div",properties:{className:o},children:y.type==="root"?y.children:[y]}),Kn(y,x),Mw(y,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function x(C,E,T){if(C.type==="raw"&&T&&typeof E=="number")return d?T.children.splice(E,1):T.children[E]={type:"text",value:C.value},E;if(C.type==="element"){let I;for(I in md)if(Object.hasOwn(md,I)&&Object.hasOwn(C.properties,I)){const D=C.properties[I],_=md[I];(_===null||_.includes(C.tagName))&&(C.properties[I]=h(String(D||""),I,C))}}if(C.type==="element"){let I=t?!t.includes(C.tagName):s?s.includes(C.tagName):!1;if(!I&&n&&typeof E=="number"&&(I=!n(C,E,T)),I&&T&&typeof E=="number")return f&&C.children?T.children.splice(E,1,...C.children):T.children.splice(E,1),E}}}function p6(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||c6.test(e.slice(0,t))?e:""}function Cf(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function h6(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function m6(e,t,n){const o=kc((n||{}).ignore||[]),i=g6(t);let s=-1;for(;++s<i.length;)Iy(e,"text",a);function a(u,d){let f=-1,h;for(;++f<d.length;){const p=d[f],m=h?h.children:void 0;if(o(p,m?m.indexOf(p):void 0,h))return;h=p}if(h)return l(u,d)}function l(u,d){const f=d[d.length-1],h=i[s][0],p=i[s][1];let m=0;const y=f.children.indexOf(u);let x=!1,C=[];h.lastIndex=0;let E=h.exec(u.value);for(;E;){const T=E.index,I={index:E.index,input:E.input,stack:[...d,u]};let D=p(...E,I);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?h.lastIndex=T+1:(m!==T&&C.push({type:"text",value:u.value.slice(m,T)}),Array.isArray(D)?C.push(...D):D&&C.push(D),m=T+E[0].length,x=!0),!h.global)break;E=h.exec(u.value)}return x?(m<u.value.length&&C.push({type:"text",value:u.value.slice(m)}),f.children.splice(y,1,...C)):C=[u],y+C.length}}function g6(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const o=n[r];t.push([b6(o[0]),y6(o[1])])}return t}function b6(e){return typeof e=="string"?new RegExp(h6(e),"g"):e}function y6(e){return typeof e=="function"?e:function(){return e}}const wd="phrasing",Dd=["autolink","link","image","label"];function x6(){return{transforms:[w6],enter:{literalAutolink:C6,literalAutolinkEmail:Id,literalAutolinkHttp:Id,literalAutolinkWww:Id},exit:{literalAutolink:k6,literalAutolinkEmail:S6,literalAutolinkHttp:E6,literalAutolinkWww:T6}}}function v6(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:wd,notInConstruct:Dd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:wd,notInConstruct:Dd},{character:":",before:"[ps]",after:"\\/",inConstruct:wd,notInConstruct:Dd}]}}function C6(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Id(e){this.config.enter.autolinkProtocol.call(this,e)}function E6(e){this.config.exit.autolinkProtocol.call(this,e)}function T6(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function S6(e){this.config.exit.autolinkEmail.call(this,e)}function k6(e){this.exit(e)}function w6(e){m6(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,D6],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,I6]],{ignore:["link","linkReference"]})}function D6(e,t,n,r,o){let i="";if(!Oy(o)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!A6(n)))return!1;const s=O6(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function I6(e,t,n,r){return!Oy(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function A6(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function O6(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=Cf(e,"(");let i=Cf(e,")");for(;r!==-1&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function Oy(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||pi(n)||Ec(n))&&(!t||n!==47)}My.peek=j6;function M6(){this.buffer()}function P6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function R6(){this.buffer()}function N6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function F6(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function L6(e){this.exit(e)}function _6(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function B6(e){this.exit(e)}function j6(){return"["}function My(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),a(),s(),i+=o.move("]"),i}function $6(){return{enter:{gfmFootnoteCallString:M6,gfmFootnoteCall:P6,gfmFootnoteDefinitionLabelString:R6,gfmFootnoteDefinition:N6},exit:{gfmFootnoteCallString:F6,gfmFootnoteCall:L6,gfmFootnoteDefinitionLabelString:_6,gfmFootnoteDefinition:B6}}}function H6(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:My},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,i,s){const a=i.createTracker(s);let l=a.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return l+=a.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
|
|
35
|
-
`:" ")+i.indentLines(i.containerFlow(r,a.current()),t?Py:z6))),u(),l}}function z6(e,t,n){return t===0?e:Py(e,t,n)}function Py(e,t,n){return(n?"":" ")+e}const U6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ry.peek=K6;function V6(){return{canContainEols:["delete"],enter:{strikethrough:q6},exit:{strikethrough:Y6}}}function W6(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:U6}],handlers:{delete:Ry}}}function q6(e){this.enter({type:"delete",children:[]},e)}function Y6(e){this.exit(e)}function Ry(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let s=o.move("~~");return s+=n.containerPhrasing(e,{...o.current(),before:s,after:"~"}),s+=o.move("~~"),i(),s}function K6(){return"~"}function G6(e){return e.length}function Q6(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||G6,i=[],s=[],a=[],l=[];let u=0,d=-1;for(;++d<e.length;){const b=[],y=[];let x=-1;for(e[d].length>u&&(u=e[d].length);++x<e[d].length;){const C=X6(e[d][x]);if(n.alignDelimiters!==!1){const E=o(C);y[x]=E,(l[x]===void 0||E>l[x])&&(l[x]=E)}b.push(C)}s[d]=b,a[d]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)i[f]=F0(r[f]);else{const b=F0(r);for(;++f<u;)i[f]=b}f=-1;const h=[],p=[];for(;++f<u;){const b=i[f];let y="",x="";b===99?(y=":",x=":"):b===108?y=":":b===114&&(x=":");let C=n.alignDelimiters===!1?1:Math.max(1,l[f]-y.length-x.length);const E=y+"-".repeat(C)+x;n.alignDelimiters!==!1&&(C=y.length+C+x.length,C>l[f]&&(l[f]=C),p[f]=C),h[f]=E}s.splice(1,0,h),a.splice(1,0,p),d=-1;const m=[];for(;++d<s.length;){const b=s[d],y=a[d];f=-1;const x=[];for(;++f<u;){const C=b[f]||"";let E="",T="";if(n.alignDelimiters!==!1){const I=l[f]-(y[f]||0),D=i[f];D===114?E=" ".repeat(I):D===99?I%2?(E=" ".repeat(I/2+.5),T=" ".repeat(I/2-.5)):(E=" ".repeat(I/2),T=E):T=" ".repeat(I)}n.delimiterStart!==!1&&!f&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||f)&&x.push(" "),n.alignDelimiters!==!1&&x.push(E),x.push(C),n.alignDelimiters!==!1&&x.push(T),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&x.push("|")}m.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return m.join(`
|
|
36
|
-
`)}function X6(e){return e==null?"":String(e)}function F0(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const L0={}.hasOwnProperty;function Dc(e,t){const n=t||{};function r(o,...i){let s=r.invalid;const a=r.handlers;if(o&&L0.call(o,e)){const l=String(o[e]);s=L0.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,o,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function Z6(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const s=n.indentLines(n.containerFlow(e,i.current()),J6);return o(),s}function J6(e,t,n){return">"+(n?"":" ")+e}function eA(e,t){return _0(e,t.inConstruct,!0)&&!_0(e,t.notInConstruct,!1)}function _0(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function B0(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
|
37
|
-
`&&eA(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
38
|
-
`}function tA(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++i>s&&(s=i):i=1,o=r+t.length,r=n.indexOf(t,o);return s}function nA(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function rA(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function oA(e,t,n,r){const o=rA(n),i=e.value||"",s=o==="`"?"GraveAccent":"Tilde";if(nA(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,iA);return f(),h}const a=n.createTracker(r),l=o.repeat(Math.max(tA(i,o)+1,3)),u=n.enter("codeFenced");let d=a.move(l);if(e.lang){const f=n.enter(`codeFencedLang${s}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${s}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
|
|
39
|
-
`,encode:["`"],...a.current()})),f()}return d+=a.move(`
|
|
40
|
-
`),i&&(d+=a.move(i+`
|
|
41
|
-
`)),d+=a.move(l),u(),d}function iA(e,t,n){return(n?"":" ")+e}function vp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function sA(e,t,n,r){const o=vp(n),i=o==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
42
|
-
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${i}`),u+=l.move(" "+o),u+=l.move(n.safe(e.title,{before:u,after:o,...l.current()})),u+=l.move(o),a()),s(),u}function aA(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function il(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Uu(e,t,n){const r=xs(e),o=xs(t);return r===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ny.peek=lA;function Ny(e,t,n,r){const o=aA(n),i=n.enter("emphasis"),s=n.createTracker(r),a=s.move(o);let l=s.move(n.containerPhrasing(e,{after:o,before:a,...s.current()}));const u=l.charCodeAt(0),d=Uu(r.before.charCodeAt(r.before.length-1),u,o);d.inside&&(l=il(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Uu(r.after.charCodeAt(0),f,o);h.inside&&(l=l.slice(0,-1)+il(f));const p=s.move(o);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},a+l+p}function lA(e,t,n){return n.options.emphasis||"*"}function uA(e,t){let n=!1;return Kn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,zu}),!!((!e.depth||e.depth<3)&&fp(e)&&(t.options.setext||n))}function cA(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(uA(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...i.current(),before:`
|
|
43
|
-
`,after:`
|
|
44
|
-
`});return f(),d(),h+`
|
|
45
|
-
`+(o===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
46
|
-
`))+1))}const s="#".repeat(o),a=n.enter("headingAtx"),l=n.enter("phrasing");i.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
47
|
-
`,...i.current()});return/^[\t ]/.test(u)&&(u=il(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}Fy.peek=dA;function Fy(e){return e.value||""}function dA(){return"<"}Ly.peek=fA;function Ly(e,t,n,r){const o=vp(n),i=o==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${i}`),u+=l.move(" "+o),u+=l.move(n.safe(e.title,{before:u,after:o,...l.current()})),u+=l.move(o),a()),u+=l.move(")"),s(),u}function fA(){return"!"}_y.peek=pA;function _y(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=d,i(),o==="full"||!u||u!==f?l+=a.move(f+"]"):o==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function pA(){return"!"}By.peek=hA;function By(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const s=n.unsafe[i],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return o+r+o}function hA(){return"`"}function jy(e,t){const n=fp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}$y.peek=mA;function $y(e,t,n,r){const o=vp(n),i=o==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(jy(e,n)){const d=n.stack;n.stack=[],a=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),n.stack=d,f}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=s.move(" "+o),u+=s.move(n.safe(e.title,{before:u,after:o,...s.current()})),u+=s.move(o),l()),u+=s.move(")"),a(),u}function mA(e,t,n){return jy(e,n)?"<":"["}Hy.peek=gA;function Hy(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=d,i(),o==="full"||!u||u!==f?l+=a.move(f+"]"):o==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function gA(){return"["}function Cp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function bA(e){const t=Cp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function yA(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function zy(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function xA(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let s=e.ordered?yA(n):Cp(n);const a=e.ordered?s==="."?")":".":bA(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),zy(n)===s&&d){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=i,o(),u}function vA(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function CA(e,t,n,r){const o=vA(n);let i=n.bulletCurrent||Cp(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let s=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(i+" ".repeat(s-i.length)),a.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),d);return l(),u;function d(f,h,p){return h?(p?"":" ".repeat(s))+f:(p?i:i+" ".repeat(s-i.length))+f}}function EA(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),s=n.containerPhrasing(e,r);return i(),o(),s}const TA=kc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SA(e,t,n,r){return(e.children.some(function(s){return TA(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function kA(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Uy.peek=wA;function Uy(e,t,n,r){const o=kA(n),i=n.enter("strong"),s=n.createTracker(r),a=s.move(o+o);let l=s.move(n.containerPhrasing(e,{after:o,before:a,...s.current()}));const u=l.charCodeAt(0),d=Uu(r.before.charCodeAt(r.before.length-1),u,o);d.inside&&(l=il(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Uu(r.after.charCodeAt(0),f,o);h.inside&&(l=l.slice(0,-1)+il(f));const p=s.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},a+l+p}function wA(e,t,n){return n.options.strong||"*"}function DA(e,t,n,r){return n.safe(e.value,r)}function IA(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function AA(e,t,n){const r=(zy(n)+(n.options.ruleSpaces?" ":"")).repeat(IA(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Vy={blockquote:Z6,break:B0,code:oA,definition:sA,emphasis:Ny,hardBreak:B0,heading:cA,html:Fy,image:Ly,imageReference:_y,inlineCode:By,link:$y,linkReference:Hy,list:xA,listItem:CA,paragraph:EA,root:SA,strong:Uy,text:DA,thematicBreak:AA};function OA(){return{enter:{table:MA,tableData:j0,tableHeader:j0,tableRow:RA},exit:{codeText:NA,table:PA,tableData:Ad,tableHeader:Ad,tableRow:Ad}}}function MA(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function PA(e){this.exit(e),this.data.inTable=void 0}function RA(e){this.enter({type:"tableRow",children:[]},e)}function Ad(e){this.exit(e)}function j0(e){this.enter({type:"tableCell",children:[]},e)}function NA(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FA));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FA(e,t){return t==="|"?t:e}function LA(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
48
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:a}};function s(p,m,b,y){return u(d(p,b,y),p.align)}function a(p,m,b,y){const x=f(p,b,y),C=u([x]);return C.slice(0,C.indexOf(`
|
|
49
|
-
`))}function l(p,m,b,y){const x=b.enter("tableCell"),C=b.enter("phrasing"),E=b.containerPhrasing(p,{...y,before:i,after:i});return C(),x(),E}function u(p,m){return Q6(p,{align:m,alignDelimiters:r,padding:n,stringLength:o})}function d(p,m,b){const y=p.children;let x=-1;const C=[],E=m.enter("table");for(;++x<y.length;)C[x]=f(y[x],m,b);return E(),C}function f(p,m,b){const y=p.children;let x=-1;const C=[],E=m.enter("tableRow");for(;++x<y.length;)C[x]=l(y[x],p,m,b);return E(),C}function h(p,m,b){let y=Vy.inlineCode(p,m,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function _A(){return{exit:{taskListCheckValueChecked:$0,taskListCheckValueUnchecked:$0,paragraph:jA}}}function BA(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:$A}}}function $0(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function jA(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let i=-1,s;for(;++i<o.length;){const a=o[i];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function $A(e,t,n,r){const o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);i&&a.move(s);let l=Vy.listItem(e,t,n,{...r,...a.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+s}}function HA(){return[x6(),$6(),V6(),OA(),_A()]}function zA(e){return{extensions:[v6(),H6(e),W6(),LA(e),BA()]}}const UA={tokenize:GA,partial:!0},Wy={tokenize:QA,partial:!0},qy={tokenize:XA,partial:!0},Yy={tokenize:ZA,partial:!0},VA={tokenize:JA,partial:!0},Ky={name:"wwwAutolink",tokenize:YA,previous:Qy},Gy={name:"protocolAutolink",tokenize:KA,previous:Xy},Co={name:"emailAutolink",tokenize:qA,previous:Zy},no={};function WA(){return{text:no}}let Go=48;for(;Go<123;)no[Go]=Co,Go++,Go===58?Go=65:Go===91&&(Go=97);no[43]=Co;no[45]=Co;no[46]=Co;no[95]=Co;no[72]=[Co,Gy];no[104]=[Co,Gy];no[87]=[Co,Ky];no[119]=[Co,Ky];function qA(e,t,n){const r=this;let o,i;return s;function s(f){return!Ef(f)||!Zy.call(r,r.previous)||Ep(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Ef(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(VA,d,u)(f):f===45||f===95||In(f)?(i=!0,e.consume(f),l):d(f)}function u(f){return e.consume(f),o=!0,l}function d(f){return i&&o&&_n(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function YA(e,t,n){const r=this;return o;function o(s){return s!==87&&s!==119||!Qy.call(r,r.previous)||Ep(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(UA,e.attempt(Wy,e.attempt(qy,i),n),n)(s))}function i(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function KA(e,t,n){const r=this;let o="",i=!1;return s;function s(f){return(f===72||f===104)&&Xy.call(r,r.previous)&&!Ep(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(_n(f)&&o.length<5)return o+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const h=o.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),i?u:(i=!0,l)):n(f)}function u(f){return f===null||$u(f)||Wt(f)||pi(f)||Ec(f)?n(f):e.attempt(Wy,e.attempt(qy,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function GA(e,t,n){let r=0;return o;function o(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),o):s===46&&r===3?(e.consume(s),i):n(s)}function i(s){return s===null?n(s):t(s)}}function QA(e,t,n){let r,o,i;return s;function s(u){return u===46||u===95?e.check(Yy,l,a)(u):u===null||Wt(u)||pi(u)||u!==45&&Ec(u)?l(u):(i=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(o=r,r=void 0),e.consume(u),s}function l(u){return o||r||!i?n(u):t(u)}}function XA(e,t){let n=0,r=0;return o;function o(s){return s===40?(n++,e.consume(s),o):s===41&&r<n?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Yy,t,i)(s):s===null||Wt(s)||pi(s)?t(s):(e.consume(s),o)}function i(s){return s===41&&r++,e.consume(s),o}}function ZA(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),i):a===93?(e.consume(a),o):a===60||a===null||Wt(a)||pi(a)?t(a):n(a)}function o(a){return a===null||a===40||a===91||Wt(a)||pi(a)?t(a):r(a)}function i(a){return _n(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):_n(a)?(e.consume(a),s):n(a)}}function JA(e,t,n){return r;function r(i){return e.consume(i),o}function o(i){return In(i)?n(i):t(i)}}function Qy(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Wt(e)}function Xy(e){return!_n(e)}function Zy(e){return!(e===47||Ef(e))}function Ef(e){return e===43||e===45||e===46||e===95||In(e)}function Ep(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const e5={tokenize:l5,partial:!0};function t5(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:i5,continuation:{tokenize:s5},exit:a5}},text:{91:{name:"gfmFootnoteCall",tokenize:o5},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:n5,resolveTo:r5}}}}function n5(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;o--;){const l=r.events[o][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);const u=Lr(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function r5(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function o5(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,s;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!s||f===null||f===91||Wt(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return o.includes(Lr(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Wt(f)||(s=!0),i++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),i++,u):u(f)}}function i5(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,s=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(s>999||m===93&&!a||m===null||m===91||Wt(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return i=Lr(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Wt(m)||(a=!0),s++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),o.includes(i)||o.push(i),At(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function s5(e,t,n){return e.check(Tl,t,e.attempt(e5,t,n))}function a5(e){e.exit("gfmFootnoteDefinition")}function l5(e,t,n){const r=this;return At(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(i):n(i)}}function u5(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},f={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",d,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&ir(h,h.length,0,Tc(p,s.slice(u+1,l),a)),ir(h,h.length,0,[["exit",f,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",d,a]]),ir(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function i(s,a,l){const u=this.previous,d=this.events;let f=0;return h;function h(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(m):(s.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const b=xs(u);if(m===126)return f>1?l(m):(s.consume(m),f++,p);if(f<2&&!n)return l(m);const y=s.exit("strikethroughSequenceTemporary"),x=xs(m);return y._open=!x||x===2&&!!b,y._close=!b||b===2&&!!x,a(m)}}}class c5{constructor(){this.map=[]}add(t,n,r){d5(this,t,n,r)}consume(t){if(this.map.sort(function(i,s){return i[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const i of o)t.push(i);o=r.pop()}this.map.length=0}}function d5(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function f5(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function p5(){return{flow:{null:{name:"table",tokenize:h5,resolveAll:m5}}}}function h5(e,t,n){const r=this;let o=0,i=0,s;return a;function a(L){let j=r.events.length-1;for(;j>-1;){const F=r.events[j][1].type;if(F==="lineEnding"||F==="linePrefix")j--;else break}const S=j>-1?r.events[j][1].type:null,$=S==="tableHead"||S==="tableRow"?D:l;return $===D&&r.parser.lazy[r.now().line]?n(L):$(L)}function l(L){return e.enter("tableHead"),e.enter("tableRow"),u(L)}function u(L){return L===124||(s=!0,i+=1),d(L)}function d(L){return L===null?n(L):rt(L)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),p):n(L):St(L)?At(e,d,"whitespace")(L):(i+=1,s&&(s=!1,o+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),f(L)))}function f(L){return L===null||L===124||Wt(L)?(e.exit("data"),d(L)):(e.consume(L),L===92?h:f)}function h(L){return L===92||L===124?(e.consume(L),f):f(L)}function p(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(e.enter("tableDelimiterRow"),s=!1,St(L)?At(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):m(L))}function m(L){return L===45||L===58?y(L):L===124?(s=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),b):I(L)}function b(L){return St(L)?At(e,y,"whitespace")(L):y(L)}function y(L){return L===58?(i+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),x):L===45?(i+=1,x(L)):L===null||rt(L)?T(L):I(L)}function x(L){return L===45?(e.enter("tableDelimiterFiller"),C(L)):I(L)}function C(L){return L===45?(e.consume(L),C):L===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(L))}function E(L){return St(L)?At(e,T,"whitespace")(L):T(L)}function T(L){return L===124?m(L):L===null||rt(L)?!s||o!==i?I(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):I(L)}function I(L){return n(L)}function D(L){return e.enter("tableRow"),_(L)}function _(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),_):L===null||rt(L)?(e.exit("tableRow"),t(L)):St(L)?At(e,_,"whitespace")(L):(e.enter("data"),O(L))}function O(L){return L===null||L===124||Wt(L)?(e.exit("data"),_(L)):(e.consume(L),L===92?B:O)}function B(L){return L===92||L===124?(e.consume(L),O):O(L)}}function m5(e,t){let n=-1,r=!0,o=0,i=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,d,f;const h=new c5;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(H0(h,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",d,t]])),o=m.type==="tableDelimiterRow"?2:d?3:1):o&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(i[1]!==0&&(s[0]=s[1],f=Jl(h,t,i,o,void 0,f),i=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(s[0]=s[1],f=Jl(h,t,i,o,void 0,f)),i=s,s=[i[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,i[1]!==0?(s[0]=s[1],f=Jl(h,t,i,o,n,f)):s[1]!==0&&(f=Jl(h,t,s,o,n,f)),o=0):o&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&H0(h,t,l,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=f5(t.events,n))}return e}function Jl(e,t,n,r,o,i){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(i.end=Object.assign({},rs(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const l=rs(t.events,n[1]);if(i={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const u=rs(t.events,n[2]),d=rs(t.events,n[3]),f={type:a,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,b=n[3]-n[2]-1;e.add(m,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return o!==void 0&&(i.end=Object.assign({},rs(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function H0(e,t,n,r,o){const i=[],s=rs(t.events,n);o&&(o.end=Object.assign({},s),i.push(["exit",o,t])),r.end=Object.assign({},s),i.push(["exit",r,t]),e.add(n+1,0,i)}function rs(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const g5={name:"tasklistCheck",tokenize:y5};function b5(){return{text:{91:g5}}}function y5(e,t,n){const r=this;return o;function o(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return Wt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return rt(l)?t(l):St(l)?e.check({tokenize:x5},t,n)(l):n(l)}}function x5(e,t,n){return At(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function v5(e){return uy([WA(),t5(),u5(e),p5(),b5()])}const C5={};function E5(e){const t=this,n=e||C5,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(v5(n)),i.push(HA()),s.push(zA(n))}const z0=/[#.]/g;function T5(e,t){const n=e||"",r={};let o=0,i,s;for(;o<n.length;){z0.lastIndex=o;const a=z0.exec(n),l=n.slice(o,a?a.index:n.length);l&&(i?i==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:s=l,o+=l.length),a&&(i=a[0],o++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function Jy(e,t,n){const r=n?D5(n):void 0;function o(i,s,...a){let l;if(i==null){l={type:"root",children:[]};const u=s;a.unshift(u)}else{l=T5(i,t);const u=l.tagName.toLowerCase(),d=r?r.get(u):void 0;if(l.tagName=d||u,S5(s))a.unshift(s);else for(const[f,h]of Object.entries(s))k5(e,l.properties,f,h)}for(const u of a)Tf(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return o}function S5(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const o=t[r];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const i=o;for(const s of i)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function k5(e,t,n,r){const o=El(e,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?o.spaceSeparated?i=hf(r):o.commaSeparated?i=df(r):o.commaOrSpaceSeparated?i=hf(df(r).join(" ")):i=U0(o,o.property,r):Array.isArray(r)?i=[...r]:i=o.property==="style"?w5(r):String(r);if(Array.isArray(i)){const s=[];for(const a of i)s.push(U0(o,o.property,a));i=s}o.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[o.property]=i}}function Tf(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Tf(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Tf(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function U0(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||rl(n)===rl(t)))return!0}return n}function w5(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function D5(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const I5=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],A5=Jy(Ms,"div"),O5=Jy(jo,"g",I5);function M5(e){const t=String(e),n=[];return{toOffset:o,toPoint:r};function r(i){if(typeof i=="number"&&i>-1&&i<=t.length){let s=0;for(;;){let a=n[s];if(a===void 0){const l=V0(t,n[s-1]);a=l===-1?t.length+1:l+1,n[s]=a}if(a>i)return{line:s+1,column:i-(s>0?n[s-1]:0)+1,offset:i};s++}}}function o(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length<i.line;){const a=n[n.length-1],l=V0(t,a),u=l===-1?t.length+1:l+1;if(a===u)break;n.push(u)}const s=(i.line>1?n[i.line-2]:0)+i.column-1;if(s<n[i.line-1])return s}}}function V0(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
50
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const si={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},ex={}.hasOwnProperty,P5=Object.prototype;function R5(e,t){const n=t||{};return Tp({file:n.file||void 0,location:!1,schema:n.space==="svg"?jo:Ms,verbose:n.verbose||!1},e)}function Tp(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},mu(e,r,n),n}case"#document":case"#document-fragment":{const r=t,o="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:tx(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const i=String(e.file),s=M5(i),a=s.toPoint(0),l=s.toPoint(i.length);n.position={start:a,end:l}}return n}case"#documentType":{const r=t;return n={type:"doctype"},mu(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},mu(e,r,n),n}default:return n=N5(e,t),n}}function tx(e,t){let n=-1;const r=[];for(;++n<t.length;){const o=Tp(e,t[n]);r.push(o)}return r}function N5(e,t){const n=e.schema;e.schema=t.namespaceURI===si.svg?jo:Ms;let r=-1;const o={};for(;++r<t.attrs.length;){const a=t.attrs[r],l=(a.prefix?a.prefix+":":"")+a.name;ex.call(P5,l)||(o[l]=a.value)}const s=(e.schema.space==="svg"?O5:A5)(t.tagName,o,tx(e,t.childNodes));if(mu(e,t,s),s.tagName==="template"){const a=t,l=a.sourceCodeLocation,u=l&&l.startTag&&is(l.startTag),d=l&&l.endTag&&is(l.endTag),f=Tp(e,a.content);u&&d&&e.file&&(f.position={start:u.end,end:d.start}),s.content=f}return e.schema=n,s}function mu(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=F5(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function F5(e,t,n){const r=is(n);if(t.type==="element"){const o=t.children[t.children.length-1];if(r&&!n.endTag&&o&&o.position&&o.position.end&&(r.end=Object.assign({},o.position.end)),e.verbose){const i={};let s;if(n.attrs)for(s in n.attrs)ex.call(n.attrs,s)&&(i[El(e.schema,s).property]=is(n.attrs[s]));n.startTag;const a=is(n.startTag),l=n.endTag?is(n.endTag):void 0,u={opening:a};l&&(u.closing=l),u.properties=i,t.data={position:u}}}return r}function is(e){const t=W0({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=W0({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function W0(e){return e.line&&e.column?e:void 0}class kl{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}kl.prototype.property={};kl.prototype.normal={};kl.prototype.space=null;function nx(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new kl(n,r,t)}function Sf(e){return e.toLowerCase()}class Dr{constructor(t,n){this.property=t,this.attribute=n}}Dr.prototype.space=null;Dr.prototype.boolean=!1;Dr.prototype.booleanish=!1;Dr.prototype.overloadedBoolean=!1;Dr.prototype.number=!1;Dr.prototype.commaSeparated=!1;Dr.prototype.spaceSeparated=!1;Dr.prototype.commaOrSpaceSeparated=!1;Dr.prototype.mustUseProperty=!1;Dr.prototype.defined=!1;let L5=0;const ft=Ei(),mn=Ei(),rx=Ei(),ze=Ei(),Kt=Ei(),fs=Ei(),Jn=Ei();function Ei(){return 2**++L5}const kf=Object.freeze(Object.defineProperty({__proto__:null,boolean:ft,booleanish:mn,commaOrSpaceSeparated:Jn,commaSeparated:fs,number:ze,overloadedBoolean:rx,spaceSeparated:Kt},Symbol.toStringTag,{value:"Module"})),Od=Object.keys(kf);class Sp extends Dr{constructor(t,n,r,o){let i=-1;if(super(t,n),q0(this,"space",o),typeof r=="number")for(;++i<Od.length;){const s=Od[i];q0(this,Od[i],(r&kf[s])===kf[s])}}}Sp.prototype.defined=!0;function q0(e,t,n){n&&(e[t]=n)}const _5={}.hasOwnProperty;function Rs(e){const t={},n={};let r;for(r in e.properties)if(_5.call(e.properties,r)){const o=e.properties[r],i=new Sp(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Sf(r)]=r,n[Sf(i.attribute)]=r}return new kl(t,n,e.space)}const ox=Rs({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),ix=Rs({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function sx(e,t){return t in e?e[t]:t}function ax(e,t){return sx(e,t.toLowerCase())}const lx=Rs({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:ax,properties:{xmlns:null,xmlnsXLink:null}}),ux=Rs({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:mn,ariaAutoComplete:null,ariaBusy:mn,ariaChecked:mn,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:Kt,ariaCurrent:null,ariaDescribedBy:Kt,ariaDetails:null,ariaDisabled:mn,ariaDropEffect:Kt,ariaErrorMessage:null,ariaExpanded:mn,ariaFlowTo:Kt,ariaGrabbed:mn,ariaHasPopup:null,ariaHidden:mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Kt,ariaLevel:ze,ariaLive:null,ariaModal:mn,ariaMultiLine:mn,ariaMultiSelectable:mn,ariaOrientation:null,ariaOwns:Kt,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:mn,ariaReadOnly:mn,ariaRelevant:null,ariaRequired:mn,ariaRoleDescription:Kt,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:mn,ariaSetSize:ze,ariaSort:null,ariaValueMax:ze,ariaValueMin:ze,ariaValueNow:ze,ariaValueText:null,role:null}}),B5=Rs({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:ax,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fs,acceptCharset:Kt,accessKey:Kt,action:null,allow:null,allowFullScreen:ft,allowPaymentRequest:ft,allowUserMedia:ft,alt:null,as:null,async:ft,autoCapitalize:null,autoComplete:Kt,autoFocus:ft,autoPlay:ft,blocking:Kt,capture:null,charSet:null,checked:ft,cite:null,className:Kt,cols:ze,colSpan:null,content:null,contentEditable:mn,controls:ft,controlsList:Kt,coords:ze|fs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ft,defer:ft,dir:null,dirName:null,disabled:ft,download:rx,draggable:mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ft,formTarget:null,headers:Kt,height:ze,hidden:ft,high:ze,href:null,hrefLang:null,htmlFor:Kt,httpEquiv:Kt,id:null,imageSizes:null,imageSrcSet:null,inert:ft,inputMode:null,integrity:null,is:null,isMap:ft,itemId:null,itemProp:Kt,itemRef:Kt,itemScope:ft,itemType:Kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ft,low:ze,manifest:null,max:null,maxLength:ze,media:null,method:null,min:null,minLength:ze,multiple:ft,muted:ft,name:null,nonce:null,noModule:ft,noValidate:ft,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ft,optimum:ze,pattern:null,ping:Kt,placeholder:null,playsInline:ft,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ft,referrerPolicy:null,rel:Kt,required:ft,reversed:ft,rows:ze,rowSpan:ze,sandbox:Kt,scope:null,scoped:ft,seamless:ft,selected:ft,shadowRootClonable:ft,shadowRootDelegatesFocus:ft,shadowRootMode:null,shape:null,size:ze,sizes:null,slot:null,span:ze,spellCheck:mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ze,step:null,style:null,tabIndex:ze,target:null,title:null,translate:null,type:null,typeMustMatch:ft,useMap:null,value:mn,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Kt,axis:null,background:null,bgColor:null,border:ze,borderColor:null,bottomMargin:ze,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ft,declare:ft,event:null,face:null,frame:null,frameBorder:null,hSpace:ze,leftMargin:ze,link:null,longDesc:null,lowSrc:null,marginHeight:ze,marginWidth:ze,noResize:ft,noHref:ft,noShade:ft,noWrap:ft,object:null,profile:null,prompt:null,rev:null,rightMargin:ze,rules:null,scheme:null,scrolling:mn,standby:null,summary:null,text:null,topMargin:ze,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ze,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ft,disableRemotePlayback:ft,prefix:null,property:null,results:ze,security:null,unselectable:null}}),j5=Rs({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:sx,properties:{about:Jn,accentHeight:ze,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ze,amplitude:ze,arabicForm:null,ascent:ze,attributeName:null,attributeType:null,azimuth:ze,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ze,by:null,calcMode:null,capHeight:ze,className:Kt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ze,diffuseConstant:ze,direction:null,display:null,dur:null,divisor:ze,dominantBaseline:null,download:ft,dx:null,dy:null,edgeMode:null,editable:null,elevation:ze,enableBackground:null,end:null,event:null,exponent:ze,externalResourcesRequired:null,fill:null,fillOpacity:ze,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fs,g2:fs,glyphName:fs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ze,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ze,horizOriginX:ze,horizOriginY:ze,id:null,ideographic:ze,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ze,k:ze,k1:ze,k2:ze,k3:ze,k4:ze,kernelMatrix:Jn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ze,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ze,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ze,overlineThickness:ze,paintOrder:null,panose1:null,path:null,pathLength:ze,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jn,rev:Jn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jn,requiredFeatures:Jn,requiredFonts:Jn,requiredFormats:Jn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ze,specularExponent:ze,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ze,strikethroughThickness:ze,string:null,stroke:null,strokeDashArray:Jn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ze,strokeOpacity:ze,strokeWidth:null,style:null,surfaceScale:ze,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jn,tabIndex:ze,tableValues:null,target:null,targetX:ze,targetY:ze,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ze,underlineThickness:ze,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ze,values:null,vAlphabetic:ze,vMathematical:ze,vectorEffect:null,vHanging:ze,vIdeographic:ze,version:null,vertAdvY:ze,vertOriginX:ze,vertOriginY:ze,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ze,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),$5=/^data[-\w.:]+$/i,Y0=/-[a-z]/g,H5=/[A-Z]/g;function z5(e,t){const n=Sf(t);let r=t,o=Dr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$5.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Y0,V5);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Y0.test(i)){let s=i.replace(H5,U5);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=Sp}return new o(r,t)}function U5(e){return"-"+e.toLowerCase()}function V5(e){return e.charAt(1).toUpperCase()}const W5=nx([ix,ox,lx,ux,B5],"html"),cx=nx([ix,ox,lx,ux,j5],"svg"),q5={},Y5={}.hasOwnProperty,dx=Dc("type",{handlers:{root:G5,element:e4,text:Z5,comment:J5,doctype:X5}});function K5(e,t){const r=(t||q5).space;return dx(e,r==="svg"?cx:W5)}function G5(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=kp(e.children,n,t),Ns(e,n),n}function Q5(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=kp(e.children,n,t),Ns(e,n),n}function X5(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ns(e,t),t}function Z5(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ns(e,t),t}function J5(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ns(e,t),t}function e4(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=cx);const o=[];let i;if(e.properties){for(i in e.properties)if(i!=="children"&&Y5.call(e.properties,i)){const l=t4(r,i,e.properties[i]);l&&o.push(l)}}const s=r.space,a={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:si[s],childNodes:[],parentNode:null};return a.childNodes=kp(e.children,a,r),Ns(e,a),e.tagName==="template"&&e.content&&(a.content=Q5(e.content,r)),a}function t4(e,t,n){const r=z5(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?xc(n):vc(n));const o={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const i=o.name.indexOf(":");i<0?o.prefix="":(o.name=o.name.slice(i+1),o.prefix=r.attribute.slice(0,i)),o.namespace=si[r.space]}return o}function kp(e,t,n){let r=-1;const o=[];if(e)for(;++r<e.length;){const i=dx(e[r],n);i.parentNode=t,o.push(i)}return o}function Ns(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const fx=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],n4=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),en="�";var K;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(K||(K={}));const zn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function px(e){return e>=55296&&e<=57343}function r4(e){return e>=56320&&e<=57343}function o4(e,t){return(e-55296)*1024+9216+t}function hx(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function mx(e){return e>=64976&&e<=65007||n4.has(e)}var Te;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Te||(Te={}));const i4=65536;class s4{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=i4,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:o,offset:i}=this,s=o+n,a=i+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:a,endOffset:a}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(r4(n))return this.pos++,this._addGap(),o4(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,K.EOF;return this._err(Te.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,K.EOF;const r=this.html.charCodeAt(n);return r===K.CARRIAGE_RETURN?K.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,K.EOF;let t=this.html.charCodeAt(this.pos);return t===K.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,K.LINE_FEED):t===K.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,px(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===K.LINE_FEED||t===K.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){hx(t)?this._err(Te.controlCharacterInInputStream):mx(t)&&this._err(Te.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var xt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(xt||(xt={}));function gx(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const a4=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),l4=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function u4(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=l4.get(e))!==null&&t!==void 0?t:e}var Tn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Tn||(Tn={}));const c4=32;var No;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(No||(No={}));function wf(e){return e>=Tn.ZERO&&e<=Tn.NINE}function d4(e){return e>=Tn.UPPER_A&&e<=Tn.UPPER_F||e>=Tn.LOWER_A&&e<=Tn.LOWER_F}function f4(e){return e>=Tn.UPPER_A&&e<=Tn.UPPER_Z||e>=Tn.LOWER_A&&e<=Tn.LOWER_Z||wf(e)}function p4(e){return e===Tn.EQUALS||f4(e)}var En;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(En||(En={}));var ho;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ho||(ho={}));class h4{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=En.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ho.Strict}startEntity(t){this.decodeMode=t,this.state=En.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case En.EntityStart:return t.charCodeAt(n)===Tn.NUM?(this.state=En.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=En.NamedEntity,this.stateNamedEntity(t,n));case En.NumericStart:return this.stateNumericStart(t,n);case En.NumericDecimal:return this.stateNumericDecimal(t,n);case En.NumericHex:return this.stateNumericHex(t,n);case En.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|c4)===Tn.LOWER_X?(this.state=En.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=En.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,o){if(n!==r){const i=r-n;this.result=this.result*Math.pow(o,i)+Number.parseInt(t.substr(n,i),o),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(wf(o)||d4(o))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(wf(o))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Tn.SEMI)this.consumed+=1;else if(this.decodeMode===ho.Strict)return 0;return this.emitCodePoint(u4(this.result),this.consumed),this.errors&&(t!==Tn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let o=r[this.treeIndex],i=(o&No.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=m4(r,o,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return this.result===0||this.decodeMode===ho.Attribute&&(i===0||p4(s))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],i=(o&No.VALUE_LENGTH)>>14,i!==0){if(s===Tn.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ho.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,o=(r[n]&No.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~No.VALUE_LENGTH:o[t+1],r),n===3&&this.emitCodePoint(o[t+2],r),r}end(){var t;switch(this.state){case En.NamedEntity:return this.result!==0&&(this.decodeMode!==ho.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case En.NumericDecimal:return this.emitNumericEntity(0,2);case En.NumericHex:return this.emitNumericEntity(0,3);case En.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case En.EntityStart:return 0}}}function m4(e,t,n,r){const o=(t&No.BRANCH_LENGTH)>>7,i=t&No.JUMP_TABLE;if(o===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=o?-1:e[n+l]-1}let s=n,a=s+o-1;for(;s<=a;){const l=s+a>>>1,u=e[l];if(u<r)s=l+1;else if(u>r)a=l-1;else return e[l+o]}return-1}var Ne;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Ne||(Ne={}));var ui;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(ui||(ui={}));var gr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(gr||(gr={}));var me;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(me||(me={}));var v;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(v||(v={}));const g4=new Map([[me.A,v.A],[me.ADDRESS,v.ADDRESS],[me.ANNOTATION_XML,v.ANNOTATION_XML],[me.APPLET,v.APPLET],[me.AREA,v.AREA],[me.ARTICLE,v.ARTICLE],[me.ASIDE,v.ASIDE],[me.B,v.B],[me.BASE,v.BASE],[me.BASEFONT,v.BASEFONT],[me.BGSOUND,v.BGSOUND],[me.BIG,v.BIG],[me.BLOCKQUOTE,v.BLOCKQUOTE],[me.BODY,v.BODY],[me.BR,v.BR],[me.BUTTON,v.BUTTON],[me.CAPTION,v.CAPTION],[me.CENTER,v.CENTER],[me.CODE,v.CODE],[me.COL,v.COL],[me.COLGROUP,v.COLGROUP],[me.DD,v.DD],[me.DESC,v.DESC],[me.DETAILS,v.DETAILS],[me.DIALOG,v.DIALOG],[me.DIR,v.DIR],[me.DIV,v.DIV],[me.DL,v.DL],[me.DT,v.DT],[me.EM,v.EM],[me.EMBED,v.EMBED],[me.FIELDSET,v.FIELDSET],[me.FIGCAPTION,v.FIGCAPTION],[me.FIGURE,v.FIGURE],[me.FONT,v.FONT],[me.FOOTER,v.FOOTER],[me.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[me.FORM,v.FORM],[me.FRAME,v.FRAME],[me.FRAMESET,v.FRAMESET],[me.H1,v.H1],[me.H2,v.H2],[me.H3,v.H3],[me.H4,v.H4],[me.H5,v.H5],[me.H6,v.H6],[me.HEAD,v.HEAD],[me.HEADER,v.HEADER],[me.HGROUP,v.HGROUP],[me.HR,v.HR],[me.HTML,v.HTML],[me.I,v.I],[me.IMG,v.IMG],[me.IMAGE,v.IMAGE],[me.INPUT,v.INPUT],[me.IFRAME,v.IFRAME],[me.KEYGEN,v.KEYGEN],[me.LABEL,v.LABEL],[me.LI,v.LI],[me.LINK,v.LINK],[me.LISTING,v.LISTING],[me.MAIN,v.MAIN],[me.MALIGNMARK,v.MALIGNMARK],[me.MARQUEE,v.MARQUEE],[me.MATH,v.MATH],[me.MENU,v.MENU],[me.META,v.META],[me.MGLYPH,v.MGLYPH],[me.MI,v.MI],[me.MO,v.MO],[me.MN,v.MN],[me.MS,v.MS],[me.MTEXT,v.MTEXT],[me.NAV,v.NAV],[me.NOBR,v.NOBR],[me.NOFRAMES,v.NOFRAMES],[me.NOEMBED,v.NOEMBED],[me.NOSCRIPT,v.NOSCRIPT],[me.OBJECT,v.OBJECT],[me.OL,v.OL],[me.OPTGROUP,v.OPTGROUP],[me.OPTION,v.OPTION],[me.P,v.P],[me.PARAM,v.PARAM],[me.PLAINTEXT,v.PLAINTEXT],[me.PRE,v.PRE],[me.RB,v.RB],[me.RP,v.RP],[me.RT,v.RT],[me.RTC,v.RTC],[me.RUBY,v.RUBY],[me.S,v.S],[me.SCRIPT,v.SCRIPT],[me.SEARCH,v.SEARCH],[me.SECTION,v.SECTION],[me.SELECT,v.SELECT],[me.SOURCE,v.SOURCE],[me.SMALL,v.SMALL],[me.SPAN,v.SPAN],[me.STRIKE,v.STRIKE],[me.STRONG,v.STRONG],[me.STYLE,v.STYLE],[me.SUB,v.SUB],[me.SUMMARY,v.SUMMARY],[me.SUP,v.SUP],[me.TABLE,v.TABLE],[me.TBODY,v.TBODY],[me.TEMPLATE,v.TEMPLATE],[me.TEXTAREA,v.TEXTAREA],[me.TFOOT,v.TFOOT],[me.TD,v.TD],[me.TH,v.TH],[me.THEAD,v.THEAD],[me.TITLE,v.TITLE],[me.TR,v.TR],[me.TRACK,v.TRACK],[me.TT,v.TT],[me.U,v.U],[me.UL,v.UL],[me.SVG,v.SVG],[me.VAR,v.VAR],[me.WBR,v.WBR],[me.XMP,v.XMP]]);function Fs(e){var t;return(t=g4.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const _e=v,b4={[Ne.HTML]:new Set([_e.ADDRESS,_e.APPLET,_e.AREA,_e.ARTICLE,_e.ASIDE,_e.BASE,_e.BASEFONT,_e.BGSOUND,_e.BLOCKQUOTE,_e.BODY,_e.BR,_e.BUTTON,_e.CAPTION,_e.CENTER,_e.COL,_e.COLGROUP,_e.DD,_e.DETAILS,_e.DIR,_e.DIV,_e.DL,_e.DT,_e.EMBED,_e.FIELDSET,_e.FIGCAPTION,_e.FIGURE,_e.FOOTER,_e.FORM,_e.FRAME,_e.FRAMESET,_e.H1,_e.H2,_e.H3,_e.H4,_e.H5,_e.H6,_e.HEAD,_e.HEADER,_e.HGROUP,_e.HR,_e.HTML,_e.IFRAME,_e.IMG,_e.INPUT,_e.LI,_e.LINK,_e.LISTING,_e.MAIN,_e.MARQUEE,_e.MENU,_e.META,_e.NAV,_e.NOEMBED,_e.NOFRAMES,_e.NOSCRIPT,_e.OBJECT,_e.OL,_e.P,_e.PARAM,_e.PLAINTEXT,_e.PRE,_e.SCRIPT,_e.SECTION,_e.SELECT,_e.SOURCE,_e.STYLE,_e.SUMMARY,_e.TABLE,_e.TBODY,_e.TD,_e.TEMPLATE,_e.TEXTAREA,_e.TFOOT,_e.TH,_e.THEAD,_e.TITLE,_e.TR,_e.TRACK,_e.UL,_e.WBR,_e.XMP]),[Ne.MATHML]:new Set([_e.MI,_e.MO,_e.MN,_e.MS,_e.MTEXT,_e.ANNOTATION_XML]),[Ne.SVG]:new Set([_e.TITLE,_e.FOREIGN_OBJECT,_e.DESC]),[Ne.XLINK]:new Set,[Ne.XML]:new Set,[Ne.XMLNS]:new Set},Df=new Set([_e.H1,_e.H2,_e.H3,_e.H4,_e.H5,_e.H6]);me.STYLE,me.SCRIPT,me.XMP,me.IFRAME,me.NOEMBED,me.NOFRAMES,me.PLAINTEXT;var X;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(X||(X={}));const cn={DATA:X.DATA,RCDATA:X.RCDATA,RAWTEXT:X.RAWTEXT,SCRIPT_DATA:X.SCRIPT_DATA,PLAINTEXT:X.PLAINTEXT,CDATA_SECTION:X.CDATA_SECTION};function y4(e){return e>=K.DIGIT_0&&e<=K.DIGIT_9}function Ma(e){return e>=K.LATIN_CAPITAL_A&&e<=K.LATIN_CAPITAL_Z}function x4(e){return e>=K.LATIN_SMALL_A&&e<=K.LATIN_SMALL_Z}function Oo(e){return x4(e)||Ma(e)}function K0(e){return Oo(e)||y4(e)}function eu(e){return e+32}function bx(e){return e===K.SPACE||e===K.LINE_FEED||e===K.TABULATION||e===K.FORM_FEED}function G0(e){return bx(e)||e===K.SOLIDUS||e===K.GREATER_THAN_SIGN}function v4(e){return e===K.NULL?Te.nullCharacterReference:e>1114111?Te.characterReferenceOutsideUnicodeRange:px(e)?Te.surrogateCharacterReference:mx(e)?Te.noncharacterCharacterReference:hx(e)||e===K.CARRIAGE_RETURN?Te.controlCharacterReference:null}class C4{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=X.DATA,this.returnState=X.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new s4(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new h4(a4,(r,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Te.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(Te.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const o=v4(r);o&&this._err(o,1)}}:void 0)}_err(t,n=0){var r,o;(o=(r=this.handler).onParseError)===null||o===void 0||o.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:xt.START_TAG,tagName:"",tagID:v.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:xt.END_TAG,tagName:"",tagID:v.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:xt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:xt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(gx(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const o=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);o[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Te.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Fs(t.tagName),t.type===xt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(Te.endTagWithAttributes),t.selfClosing&&this._err(Te.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case xt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case xt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case xt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:xt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=bx(t)?xt.WHITESPACE_CHARACTER:t===K.NULL?xt.NULL_CHARACTER:xt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(xt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=X.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ho.Attribute:ho.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===X.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case X.DATA:{this._stateData(t);break}case X.RCDATA:{this._stateRcdata(t);break}case X.RAWTEXT:{this._stateRawtext(t);break}case X.SCRIPT_DATA:{this._stateScriptData(t);break}case X.PLAINTEXT:{this._statePlaintext(t);break}case X.TAG_OPEN:{this._stateTagOpen(t);break}case X.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case X.TAG_NAME:{this._stateTagName(t);break}case X.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case X.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case X.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case X.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case X.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case X.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case X.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case X.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case X.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case X.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case X.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case X.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case X.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case X.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case X.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case X.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case X.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case X.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case X.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case X.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case X.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case X.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case X.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case X.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case X.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case X.BOGUS_COMMENT:{this._stateBogusComment(t);break}case X.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case X.COMMENT_START:{this._stateCommentStart(t);break}case X.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case X.COMMENT:{this._stateComment(t);break}case X.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case X.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case X.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case X.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case X.COMMENT_END:{this._stateCommentEnd(t);break}case X.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case X.DOCTYPE:{this._stateDoctype(t);break}case X.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case X.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case X.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case X.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case X.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case X.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case X.CDATA_SECTION:{this._stateCdataSection(t);break}case X.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case X.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case X.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case X.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case K.LESS_THAN_SIGN:{this.state=X.TAG_OPEN;break}case K.AMPERSAND:{this._startCharacterReference();break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this._emitCodePoint(t);break}case K.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case K.AMPERSAND:{this._startCharacterReference();break}case K.LESS_THAN_SIGN:{this.state=X.RCDATA_LESS_THAN_SIGN;break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this._emitChars(en);break}case K.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case K.LESS_THAN_SIGN:{this.state=X.RAWTEXT_LESS_THAN_SIGN;break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this._emitChars(en);break}case K.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case K.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_LESS_THAN_SIGN;break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this._emitChars(en);break}case K.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case K.NULL:{this._err(Te.unexpectedNullCharacter),this._emitChars(en);break}case K.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Oo(t))this._createStartTagToken(),this.state=X.TAG_NAME,this._stateTagName(t);else switch(t){case K.EXCLAMATION_MARK:{this.state=X.MARKUP_DECLARATION_OPEN;break}case K.SOLIDUS:{this.state=X.END_TAG_OPEN;break}case K.QUESTION_MARK:{this._err(Te.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=X.BOGUS_COMMENT,this._stateBogusComment(t);break}case K.EOF:{this._err(Te.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Te.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=X.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Oo(t))this._createEndTagToken(),this.state=X.TAG_NAME,this._stateTagName(t);else switch(t){case K.GREATER_THAN_SIGN:{this._err(Te.missingEndTagName),this.state=X.DATA;break}case K.EOF:{this._err(Te.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Te.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:{this.state=X.BEFORE_ATTRIBUTE_NAME;break}case K.SOLIDUS:{this.state=X.SELF_CLOSING_START_TAG;break}case K.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentTagToken();break}case K.NULL:{this._err(Te.unexpectedNullCharacter),n.tagName+=en;break}case K.EOF:{this._err(Te.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Ma(t)?eu(t):t)}}_stateRcdataLessThanSign(t){t===K.SOLIDUS?this.state=X.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=X.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Oo(t)?(this.state=X.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=X.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=X.BEFORE_ATTRIBUTE_NAME,!1;case K.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=X.SELF_CLOSING_START_TAG,!1;case K.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=X.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===K.SOLIDUS?this.state=X.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=X.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Oo(t)?(this.state=X.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=X.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case K.SOLIDUS:{this.state=X.SCRIPT_DATA_END_TAG_OPEN;break}case K.EXCLAMATION_MARK:{this.state=X.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=X.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Oo(t)?(this.state=X.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===K.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===K.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=X.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case K.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case K.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this._emitChars(en);break}case K.EOF:{this._err(Te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case K.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case K.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(en);break}case K.EOF:{this._err(Te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case K.HYPHEN_MINUS:{this._emitChars("-");break}case K.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case K.GREATER_THAN_SIGN:{this.state=X.SCRIPT_DATA,this._emitChars(">");break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(en);break}case K.EOF:{this._err(Te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===K.SOLIDUS?this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Oo(t)?(this._emitChars("<"),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Oo(t)?(this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(zn.SCRIPT,!1)&&G0(this.preprocessor.peek(zn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<zn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case K.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case K.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this._emitChars(en);break}case K.EOF:{this._err(Te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case K.HYPHEN_MINUS:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case K.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(en);break}case K.EOF:{this._err(Te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case K.HYPHEN_MINUS:{this._emitChars("-");break}case K.LESS_THAN_SIGN:{this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case K.GREATER_THAN_SIGN:{this.state=X.SCRIPT_DATA,this._emitChars(">");break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(en);break}case K.EOF:{this._err(Te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===K.SOLIDUS?(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(zn.SCRIPT,!1)&&G0(this.preprocessor.peek(zn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<zn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.SOLIDUS:case K.GREATER_THAN_SIGN:case K.EOF:{this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case K.EQUALS_SIGN:{this._err(Te.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=X.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:case K.SOLIDUS:case K.GREATER_THAN_SIGN:case K.EOF:{this._leaveAttrName(),this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case K.EQUALS_SIGN:{this._leaveAttrName(),this.state=X.BEFORE_ATTRIBUTE_VALUE;break}case K.QUOTATION_MARK:case K.APOSTROPHE:case K.LESS_THAN_SIGN:{this._err(Te.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this.currentAttr.name+=en;break}default:this.currentAttr.name+=String.fromCodePoint(Ma(t)?eu(t):t)}}_stateAfterAttributeName(t){switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.SOLIDUS:{this.state=X.SELF_CLOSING_START_TAG;break}case K.EQUALS_SIGN:{this.state=X.BEFORE_ATTRIBUTE_VALUE;break}case K.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentTagToken();break}case K.EOF:{this._err(Te.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:{this.state=X.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case K.APOSTROPHE:{this.state=X.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case K.GREATER_THAN_SIGN:{this._err(Te.missingAttributeValue),this.state=X.DATA,this.emitCurrentTagToken();break}default:this.state=X.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case K.QUOTATION_MARK:{this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case K.AMPERSAND:{this._startCharacterReference();break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this.currentAttr.value+=en;break}case K.EOF:{this._err(Te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case K.APOSTROPHE:{this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case K.AMPERSAND:{this._startCharacterReference();break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this.currentAttr.value+=en;break}case K.EOF:{this._err(Te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:{this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break}case K.AMPERSAND:{this._startCharacterReference();break}case K.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break}case K.NULL:{this._err(Te.unexpectedNullCharacter),this.currentAttr.value+=en;break}case K.QUOTATION_MARK:case K.APOSTROPHE:case K.LESS_THAN_SIGN:case K.EQUALS_SIGN:case K.GRAVE_ACCENT:{this._err(Te.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case K.EOF:{this._err(Te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:{this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break}case K.SOLIDUS:{this._leaveAttrValue(),this.state=X.SELF_CLOSING_START_TAG;break}case K.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break}case K.EOF:{this._err(Te.eofInTag),this._emitEOFToken();break}default:this._err(Te.missingWhitespaceBetweenAttributes),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case K.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=X.DATA,this.emitCurrentTagToken();break}case K.EOF:{this._err(Te.eofInTag),this._emitEOFToken();break}default:this._err(Te.unexpectedSolidusInTag),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case K.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentComment(n);break}case K.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case K.NULL:{this._err(Te.unexpectedNullCharacter),n.data+=en;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(zn.DASH_DASH,!0)?(this._createCommentToken(zn.DASH_DASH.length+1),this.state=X.COMMENT_START):this._consumeSequenceIfMatch(zn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(zn.DOCTYPE.length+1),this.state=X.DOCTYPE):this._consumeSequenceIfMatch(zn.CDATA_START,!0)?this.inForeignNode?this.state=X.CDATA_SECTION:(this._err(Te.cdataInHtmlContent),this._createCommentToken(zn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=X.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Te.incorrectlyOpenedComment),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case K.HYPHEN_MINUS:{this.state=X.COMMENT_START_DASH;break}case K.GREATER_THAN_SIGN:{this._err(Te.abruptClosingOfEmptyComment),this.state=X.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=X.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case K.HYPHEN_MINUS:{this.state=X.COMMENT_END;break}case K.GREATER_THAN_SIGN:{this._err(Te.abruptClosingOfEmptyComment),this.state=X.DATA,this.emitCurrentComment(n);break}case K.EOF:{this._err(Te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=X.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case K.HYPHEN_MINUS:{this.state=X.COMMENT_END_DASH;break}case K.LESS_THAN_SIGN:{n.data+="<",this.state=X.COMMENT_LESS_THAN_SIGN;break}case K.NULL:{this._err(Te.unexpectedNullCharacter),n.data+=en;break}case K.EOF:{this._err(Te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case K.EXCLAMATION_MARK:{n.data+="!",this.state=X.COMMENT_LESS_THAN_SIGN_BANG;break}case K.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=X.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===K.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=X.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===K.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=X.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==K.GREATER_THAN_SIGN&&t!==K.EOF&&this._err(Te.nestedComment),this.state=X.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case K.HYPHEN_MINUS:{this.state=X.COMMENT_END;break}case K.EOF:{this._err(Te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=X.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case K.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentComment(n);break}case K.EXCLAMATION_MARK:{this.state=X.COMMENT_END_BANG;break}case K.HYPHEN_MINUS:{n.data+="-";break}case K.EOF:{this._err(Te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=X.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case K.HYPHEN_MINUS:{n.data+="--!",this.state=X.COMMENT_END_DASH;break}case K.GREATER_THAN_SIGN:{this._err(Te.incorrectlyClosedComment),this.state=X.DATA,this.emitCurrentComment(n);break}case K.EOF:{this._err(Te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=X.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:{this.state=X.BEFORE_DOCTYPE_NAME;break}case K.GREATER_THAN_SIGN:{this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case K.EOF:{this._err(Te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Te.missingWhitespaceBeforeDoctypeName),this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Ma(t))this._createDoctypeToken(String.fromCharCode(eu(t))),this.state=X.DOCTYPE_NAME;else switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.NULL:{this._err(Te.unexpectedNullCharacter),this._createDoctypeToken(en),this.state=X.DOCTYPE_NAME;break}case K.GREATER_THAN_SIGN:{this._err(Te.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case K.EOF:{this._err(Te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=X.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:{this.state=X.AFTER_DOCTYPE_NAME;break}case K.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentDoctype(n);break}case K.NULL:{this._err(Te.unexpectedNullCharacter),n.name+=en;break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Ma(t)?eu(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentDoctype(n);break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(zn.PUBLIC,!1)?this.state=X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(zn.SYSTEM,!1)?this.state=X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Te.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:{this.state=X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case K.QUOTATION_MARK:{this._err(Te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case K.APOSTROPHE:{this._err(Te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case K.GREATER_THAN_SIGN:{this._err(Te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:{n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case K.APOSTROPHE:{n.publicId="",this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case K.GREATER_THAN_SIGN:{this._err(Te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case K.QUOTATION_MARK:{this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case K.NULL:{this._err(Te.unexpectedNullCharacter),n.publicId+=en;break}case K.GREATER_THAN_SIGN:{this._err(Te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case K.APOSTROPHE:{this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case K.NULL:{this._err(Te.unexpectedNullCharacter),n.publicId+=en;break}case K.GREATER_THAN_SIGN:{this._err(Te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:{this.state=X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case K.GREATER_THAN_SIGN:{this.state=X.DATA,this.emitCurrentDoctype(n);break}case K.QUOTATION_MARK:{this._err(Te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case K.APOSTROPHE:{this._err(Te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=X.DATA;break}case K.QUOTATION_MARK:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case K.APOSTROPHE:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:{this.state=X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case K.QUOTATION_MARK:{this._err(Te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case K.APOSTROPHE:{this._err(Te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case K.GREATER_THAN_SIGN:{this._err(Te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case K.APOSTROPHE:{n.systemId="",this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case K.GREATER_THAN_SIGN:{this._err(Te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(n);break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case K.QUOTATION_MARK:{this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case K.NULL:{this._err(Te.unexpectedNullCharacter),n.systemId+=en;break}case K.GREATER_THAN_SIGN:{this._err(Te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case K.APOSTROPHE:{this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case K.NULL:{this._err(Te.unexpectedNullCharacter),n.systemId+=en;break}case K.GREATER_THAN_SIGN:{this._err(Te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=X.DATA;break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=X.DATA;break}case K.EOF:{this._err(Te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Te.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case K.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=X.DATA;break}case K.NULL:{this._err(Te.unexpectedNullCharacter);break}case K.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case K.RIGHT_SQUARE_BRACKET:{this.state=X.CDATA_SECTION_BRACKET;break}case K.EOF:{this._err(Te.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===K.RIGHT_SQUARE_BRACKET?this.state=X.CDATA_SECTION_END:(this._emitChars("]"),this.state=X.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case K.GREATER_THAN_SIGN:{this.state=X.DATA;break}case K.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=X.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(K.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&K0(this.preprocessor.peek(1))?X.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){K0(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===K.SEMICOLON&&this._err(Te.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const yx=new Set([v.DD,v.DT,v.LI,v.OPTGROUP,v.OPTION,v.P,v.RB,v.RP,v.RT,v.RTC]),Q0=new Set([...yx,v.CAPTION,v.COLGROUP,v.TBODY,v.TD,v.TFOOT,v.TH,v.THEAD,v.TR]),Vu=new Set([v.APPLET,v.CAPTION,v.HTML,v.MARQUEE,v.OBJECT,v.TABLE,v.TD,v.TEMPLATE,v.TH]),E4=new Set([...Vu,v.OL,v.UL]),T4=new Set([...Vu,v.BUTTON]),X0=new Set([v.ANNOTATION_XML,v.MI,v.MN,v.MO,v.MS,v.MTEXT]),Z0=new Set([v.DESC,v.FOREIGN_OBJECT,v.TITLE]),S4=new Set([v.TR,v.TEMPLATE,v.HTML]),k4=new Set([v.TBODY,v.TFOOT,v.THEAD,v.TEMPLATE,v.HTML]),w4=new Set([v.TABLE,v.TEMPLATE,v.HTML]),D4=new Set([v.TD,v.TH]);class I4{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=v.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===v.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ne.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const o=this._indexOf(t)+1;this.items.splice(o,0,n),this.tagIDs.splice(o,0,r),this.stackTop++,o===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,o===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ne.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Df,Ne.HTML)}popUntilTableCellPopped(){this.popUntilPopped(D4,Ne.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(w4,Ne.HTML)}clearBackToTableBodyContext(){this.clearBackTo(k4,Ne.HTML)}clearBackToTableRowContext(){this.clearBackTo(S4,Ne.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===v.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===v.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const o=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Ne.HTML:{if(o===t)return!0;if(n.has(o))return!1;break}case Ne.SVG:{if(Z0.has(o))return!1;break}case Ne.MATHML:{if(X0.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Vu)}hasInListItemScope(t){return this.hasInDynamicScope(t,E4)}hasInButtonScope(t){return this.hasInDynamicScope(t,T4)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Ne.HTML:{if(Df.has(n))return!0;if(Vu.has(n))return!1;break}case Ne.SVG:{if(Z0.has(n))return!1;break}case Ne.MATHML:{if(X0.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ne.HTML)switch(this.tagIDs[n]){case t:return!0;case v.TABLE:case v.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Ne.HTML)switch(this.tagIDs[t]){case v.TBODY:case v.THEAD:case v.TFOOT:return!0;case v.TABLE:case v.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ne.HTML)switch(this.tagIDs[n]){case t:return!0;case v.OPTION:case v.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&yx.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Q0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Q0.has(this.currentTagId);)this.pop()}}const Md=3;var Kr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Kr||(Kr={}));const J0={type:Kr.Marker};class A4{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],o=n.length,i=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let a=0;a<this.entries.length;a++){const l=this.entries[a];if(l.type===Kr.Marker)break;const{element:u}=l;if(this.treeAdapter.getTagName(u)===i&&this.treeAdapter.getNamespaceURI(u)===s){const d=this.treeAdapter.getAttrList(u);d.length===o&&r.push({idx:a,attrs:d})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Md)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Md)return;const o=new Map(n.map(s=>[s.name,s.value]));let i=0;for(let s=0;s<r.length;s++){const a=r[s];a.attrs.every(l=>o.get(l.name)===l.value)&&(i+=1,i>=Md&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(J0)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Kr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Kr.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(J0);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Kr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Kr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Kr.Element&&n.element===t)}}const Mo={createDocument(){return{nodeName:"#document",mode:gr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const o=e.childNodes.find(i=>i.nodeName==="#documentType");if(o)o.name=t,o.publicId=n,o.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Mo.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Mo.isTextNode(n)){n.value+=t;return}}Mo.appendChild(e,Mo.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Mo.isTextNode(r)?r.value+=t:Mo.insertBefore(e,Mo.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},xx="html",O4="about:legacy-compat",M4="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",vx=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],P4=[...vx,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],R4=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Cx=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],N4=[...Cx,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function eg(e,t){return t.some(n=>e.startsWith(n))}function F4(e){return e.name===xx&&e.publicId===null&&(e.systemId===null||e.systemId===O4)}function L4(e){if(e.name!==xx)return gr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===M4)return gr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),R4.has(n))return gr.QUIRKS;let r=t===null?P4:vx;if(eg(n,r))return gr.QUIRKS;if(r=t===null?Cx:N4,eg(n,r))return gr.LIMITED_QUIRKS}return gr.NO_QUIRKS}const tg={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},_4="definitionurl",B4="definitionURL",j4=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),$4=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ne.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ne.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ne.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ne.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ne.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ne.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ne.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ne.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ne.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ne.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ne.XMLNS}]]),H4=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),z4=new Set([v.B,v.BIG,v.BLOCKQUOTE,v.BODY,v.BR,v.CENTER,v.CODE,v.DD,v.DIV,v.DL,v.DT,v.EM,v.EMBED,v.H1,v.H2,v.H3,v.H4,v.H5,v.H6,v.HEAD,v.HR,v.I,v.IMG,v.LI,v.LISTING,v.MENU,v.META,v.NOBR,v.OL,v.P,v.PRE,v.RUBY,v.S,v.SMALL,v.SPAN,v.STRONG,v.STRIKE,v.SUB,v.SUP,v.TABLE,v.TT,v.U,v.UL,v.VAR]);function U4(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===ui.COLOR||r===ui.SIZE||r===ui.FACE)||z4.has(t)}function Ex(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===_4){e.attrs[t].name=B4;break}}function Tx(e){for(let t=0;t<e.attrs.length;t++){const n=j4.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function wp(e){for(let t=0;t<e.attrs.length;t++){const n=$4.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function V4(e){const t=H4.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Fs(e.tagName))}function W4(e,t){return t===Ne.MATHML&&(e===v.MI||e===v.MO||e===v.MN||e===v.MS||e===v.MTEXT)}function q4(e,t,n){if(t===Ne.MATHML&&e===v.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===ui.ENCODING){const o=n[r].value.toLowerCase();return o===tg.TEXT_HTML||o===tg.APPLICATION_XML}}return t===Ne.SVG&&(e===v.FOREIGN_OBJECT||e===v.DESC||e===v.TITLE)}function Y4(e,t,n,r){return(!r||r===Ne.HTML)&&q4(e,t,n)||(!r||r===Ne.MATHML)&&W4(e,t)}const K4="hidden",G4=8,Q4=3;var te;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(te||(te={}));const X4={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Sx=new Set([v.TABLE,v.TBODY,v.TFOOT,v.THEAD,v.TR]),ng={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Mo,onParseError:null};class rg{constructor(t,n,r=null,o=null){this.fragmentContext=r,this.scriptHandler=o,this.currentToken=null,this.stopped=!1,this.insertionMode=te.INITIAL,this.originalInsertionMode=te.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...ng,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new C4(this.options,this),this.activeFormattingElements=new A4(this.treeAdapter),this.fragmentContextID=r?Fs(this.treeAdapter.getTagName(r)):v.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new I4(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...ng,...n};t??(t=r.treeAdapter.createElement(me.TEMPLATE,Ne.HTML,[]));const o=r.treeAdapter.createElement("documentmock",Ne.HTML,[]),i=new this(r,o,t);return i.fragmentContextID===v.TEMPLATE&&i.tmplInsertionModeStack.unshift(te.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var o;if(!this.onParseError)return;const i=(o=t.location)!==null&&o!==void 0?o:X4,s={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:r?i.startLine:i.endLine,endCol:r?i.startCol:i.endCol,endOffset:r?i.startOffset:i.endOffset};this.onParseError(s)}onItemPush(t,n,r){var o,i;(i=(o=this.treeAdapter).onItemPush)===null||i===void 0||i.call(o,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,o;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(o=(r=this.treeAdapter).onItemPop)===null||o===void 0||o.call(r,t,this.openElements.current),n){let i,s;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,s=this.fragmentContextID):{current:i,currentTagId:s}=this.openElements,this._setContextModes(i,s)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Ne.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Ne.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=te.TEXT}switchToPlaintextParsing(){this.insertionMode=te.TEXT,this.originalInsertionMode=te.IN_BODY,this.tokenizer.state=cn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===me.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ne.HTML))switch(this.fragmentContextID){case v.TITLE:case v.TEXTAREA:{this.tokenizer.state=cn.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=cn.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=cn.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=cn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",o=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,o),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Ne.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Ne.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(me.HTML,Ne.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,v.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const o=this.treeAdapter.getChildNodes(n),i=r?o.lastIndexOf(r):o.length,s=o[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:l,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,o=this.treeAdapter.getTagName(t),i=n.type===xt.END_TAG&&o===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===v.SVG&&this.treeAdapter.getTagName(n)===me.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ne.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Ne.HTML)}_processToken(t){switch(t.type){case xt.CHARACTER:{this.onCharacter(t);break}case xt.NULL_CHARACTER:{this.onNullCharacter(t);break}case xt.COMMENT:{this.onComment(t);break}case xt.DOCTYPE:{this.onDoctype(t);break}case xt.START_TAG:{this._processStartTag(t);break}case xt.END_TAG:{this.onEndTag(t);break}case xt.EOF:{this.onEof(t);break}case xt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const o=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return Y4(t,o,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(o=>o.type===Kr.Marker||this.openElements.contains(o.element)),r=n===-1?t-1:n-1;for(let o=r;o>=0;o--){const i=this.activeFormattingElements.entries[o];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=te.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(v.P),this.openElements.popUntilTagNamePopped(v.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case v.TR:{this.insertionMode=te.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=te.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=te.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=te.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=te.IN_TABLE;return}case v.BODY:{this.insertionMode=te.IN_BODY;return}case v.FRAMESET:{this.insertionMode=te.IN_FRAMESET;return}case v.SELECT:{this._resetInsertionModeForSelect(t);return}case v.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case v.HTML:{this.insertionMode=this.headElement?te.AFTER_HEAD:te.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=te.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=te.IN_HEAD;return}break}}this.insertionMode=te.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===v.TEMPLATE)break;if(r===v.TABLE){this.insertionMode=te.IN_SELECT_IN_TABLE;return}}this.insertionMode=te.IN_SELECT}_isElementCausesFosterParenting(t){return Sx.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case v.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ne.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case v.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return b4[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){DM(this,t);return}switch(this.insertionMode){case te.INITIAL:{sa(this,t);break}case te.BEFORE_HTML:{$a(this,t);break}case te.BEFORE_HEAD:{Ha(this,t);break}case te.IN_HEAD:{za(this,t);break}case te.IN_HEAD_NO_SCRIPT:{Ua(this,t);break}case te.AFTER_HEAD:{Va(this,t);break}case te.IN_BODY:case te.IN_CAPTION:case te.IN_CELL:case te.IN_TEMPLATE:{wx(this,t);break}case te.TEXT:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case te.IN_TABLE:case te.IN_TABLE_BODY:case te.IN_ROW:{Pd(this,t);break}case te.IN_TABLE_TEXT:{Px(this,t);break}case te.IN_COLUMN_GROUP:{Wu(this,t);break}case te.AFTER_BODY:{qu(this,t);break}case te.AFTER_AFTER_BODY:{gu(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){wM(this,t);return}switch(this.insertionMode){case te.INITIAL:{sa(this,t);break}case te.BEFORE_HTML:{$a(this,t);break}case te.BEFORE_HEAD:{Ha(this,t);break}case te.IN_HEAD:{za(this,t);break}case te.IN_HEAD_NO_SCRIPT:{Ua(this,t);break}case te.AFTER_HEAD:{Va(this,t);break}case te.TEXT:{this._insertCharacters(t);break}case te.IN_TABLE:case te.IN_TABLE_BODY:case te.IN_ROW:{Pd(this,t);break}case te.IN_COLUMN_GROUP:{Wu(this,t);break}case te.AFTER_BODY:{qu(this,t);break}case te.AFTER_AFTER_BODY:{gu(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){If(this,t);return}switch(this.insertionMode){case te.INITIAL:case te.BEFORE_HTML:case te.BEFORE_HEAD:case te.IN_HEAD:case te.IN_HEAD_NO_SCRIPT:case te.AFTER_HEAD:case te.IN_BODY:case te.IN_TABLE:case te.IN_CAPTION:case te.IN_COLUMN_GROUP:case te.IN_TABLE_BODY:case te.IN_ROW:case te.IN_CELL:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:case te.IN_TEMPLATE:case te.IN_FRAMESET:case te.AFTER_FRAMESET:{If(this,t);break}case te.IN_TABLE_TEXT:{aa(this,t);break}case te.AFTER_BODY:{oO(this,t);break}case te.AFTER_AFTER_BODY:case te.AFTER_AFTER_FRAMESET:{iO(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case te.INITIAL:{sO(this,t);break}case te.BEFORE_HEAD:case te.IN_HEAD:case te.IN_HEAD_NO_SCRIPT:case te.AFTER_HEAD:{this._err(t,Te.misplacedDoctype);break}case te.IN_TABLE_TEXT:{aa(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,Te.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?IM(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case te.INITIAL:{sa(this,t);break}case te.BEFORE_HTML:{aO(this,t);break}case te.BEFORE_HEAD:{uO(this,t);break}case te.IN_HEAD:{jr(this,t);break}case te.IN_HEAD_NO_SCRIPT:{fO(this,t);break}case te.AFTER_HEAD:{hO(this,t);break}case te.IN_BODY:{Pn(this,t);break}case te.IN_TABLE:{vs(this,t);break}case te.IN_TABLE_TEXT:{aa(this,t);break}case te.IN_CAPTION:{cM(this,t);break}case te.IN_COLUMN_GROUP:{Ap(this,t);break}case te.IN_TABLE_BODY:{Oc(this,t);break}case te.IN_ROW:{Mc(this,t);break}case te.IN_CELL:{pM(this,t);break}case te.IN_SELECT:{Fx(this,t);break}case te.IN_SELECT_IN_TABLE:{mM(this,t);break}case te.IN_TEMPLATE:{bM(this,t);break}case te.AFTER_BODY:{xM(this,t);break}case te.IN_FRAMESET:{vM(this,t);break}case te.AFTER_FRAMESET:{EM(this,t);break}case te.AFTER_AFTER_BODY:{SM(this,t);break}case te.AFTER_AFTER_FRAMESET:{kM(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?AM(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case te.INITIAL:{sa(this,t);break}case te.BEFORE_HTML:{lO(this,t);break}case te.BEFORE_HEAD:{cO(this,t);break}case te.IN_HEAD:{dO(this,t);break}case te.IN_HEAD_NO_SCRIPT:{pO(this,t);break}case te.AFTER_HEAD:{mO(this,t);break}case te.IN_BODY:{Ac(this,t);break}case te.TEXT:{eM(this,t);break}case te.IN_TABLE:{sl(this,t);break}case te.IN_TABLE_TEXT:{aa(this,t);break}case te.IN_CAPTION:{dM(this,t);break}case te.IN_COLUMN_GROUP:{fM(this,t);break}case te.IN_TABLE_BODY:{Af(this,t);break}case te.IN_ROW:{Nx(this,t);break}case te.IN_CELL:{hM(this,t);break}case te.IN_SELECT:{Lx(this,t);break}case te.IN_SELECT_IN_TABLE:{gM(this,t);break}case te.IN_TEMPLATE:{yM(this,t);break}case te.AFTER_BODY:{Bx(this,t);break}case te.IN_FRAMESET:{CM(this,t);break}case te.AFTER_FRAMESET:{TM(this,t);break}case te.AFTER_AFTER_BODY:{gu(this,t);break}}}onEof(t){switch(this.insertionMode){case te.INITIAL:{sa(this,t);break}case te.BEFORE_HTML:{$a(this,t);break}case te.BEFORE_HEAD:{Ha(this,t);break}case te.IN_HEAD:{za(this,t);break}case te.IN_HEAD_NO_SCRIPT:{Ua(this,t);break}case te.AFTER_HEAD:{Va(this,t);break}case te.IN_BODY:case te.IN_TABLE:case te.IN_CAPTION:case te.IN_COLUMN_GROUP:case te.IN_TABLE_BODY:case te.IN_ROW:case te.IN_CELL:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:{Ox(this,t);break}case te.TEXT:{tM(this,t);break}case te.IN_TABLE_TEXT:{aa(this,t);break}case te.IN_TEMPLATE:{_x(this,t);break}case te.AFTER_BODY:case te.IN_FRAMESET:case te.AFTER_FRAMESET:case te.AFTER_AFTER_BODY:case te.AFTER_AFTER_FRAMESET:{Ip(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===K.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case te.IN_HEAD:case te.IN_HEAD_NO_SCRIPT:case te.AFTER_HEAD:case te.TEXT:case te.IN_COLUMN_GROUP:case te.IN_SELECT:case te.IN_SELECT_IN_TABLE:case te.IN_FRAMESET:case te.AFTER_FRAMESET:{this._insertCharacters(t);break}case te.IN_BODY:case te.IN_CAPTION:case te.IN_CELL:case te.IN_TEMPLATE:case te.AFTER_BODY:case te.AFTER_AFTER_BODY:case te.AFTER_AFTER_FRAMESET:{kx(this,t);break}case te.IN_TABLE:case te.IN_TABLE_BODY:case te.IN_ROW:{Pd(this,t);break}case te.IN_TABLE_TEXT:{Mx(this,t);break}}}}function Z4(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Ax(e,t),n}function J4(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const o=e.openElements.items[r];if(o===t.element)break;e._isSpecialElement(o,e.openElements.tagIDs[r])&&(n=o)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function eO(e,t,n){let r=t,o=e.openElements.getCommonAncestor(t);for(let i=0,s=o;s!==n;i++,s=o){o=e.openElements.getCommonAncestor(s);const a=e.activeFormattingElements.getElementEntry(s),l=a&&i>=Q4;!a||l?(l&&e.activeFormattingElements.removeEntry(a),e.openElements.remove(s)):(s=tO(e,a),r===t&&(e.activeFormattingElements.bookmark=a),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function tO(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function nO(e,t,n){const r=e.treeAdapter.getTagName(t),o=Fs(r);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);o===v.TEMPLATE&&i===Ne.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function rO(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:o}=n,i=e.treeAdapter.createElement(o.tagName,r,o.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,o),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,o.tagID)}function Dp(e,t){for(let n=0;n<G4;n++){const r=Z4(e,t);if(!r)break;const o=J4(e,r);if(!o)break;e.activeFormattingElements.bookmark=r;const i=eO(e,o,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),s&&nO(e,s,i),rO(e,o,r)}}function If(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function oO(e,t){e._appendCommentNode(t,e.openElements.items[0])}function iO(e,t){e._appendCommentNode(t,e.document)}function Ip(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],o=e.treeAdapter.getNodeSourceCodeLocation(r);if(o&&!o.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(i);s&&!s.endTag&&e._setEndLocation(i,t)}}}}function sO(e,t){e._setDocumentType(t);const n=t.forceQuirks?gr.QUIRKS:L4(t);F4(t)||e._err(t,Te.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=te.BEFORE_HTML}function sa(e,t){e._err(t,Te.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,gr.QUIRKS),e.insertionMode=te.BEFORE_HTML,e._processToken(t)}function aO(e,t){t.tagID===v.HTML?(e._insertElement(t,Ne.HTML),e.insertionMode=te.BEFORE_HEAD):$a(e,t)}function lO(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&$a(e,t)}function $a(e,t){e._insertFakeRootElement(),e.insertionMode=te.BEFORE_HEAD,e._processToken(t)}function uO(e,t){switch(t.tagID){case v.HTML:{Pn(e,t);break}case v.HEAD:{e._insertElement(t,Ne.HTML),e.headElement=e.openElements.current,e.insertionMode=te.IN_HEAD;break}default:Ha(e,t)}}function cO(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?Ha(e,t):e._err(t,Te.endTagWithoutMatchingOpenElement)}function Ha(e,t){e._insertFakeElement(me.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=te.IN_HEAD,e._processToken(t)}function jr(e,t){switch(t.tagID){case v.HTML:{Pn(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,Ne.HTML),t.ackSelfClosing=!0;break}case v.TITLE:{e._switchToTextParsing(t,cn.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,cn.RAWTEXT):(e._insertElement(t,Ne.HTML),e.insertionMode=te.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,cn.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,cn.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=te.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(te.IN_TEMPLATE);break}case v.HEAD:{e._err(t,Te.misplacedStartTagForHeadElement);break}default:za(e,t)}}function dO(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=te.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{za(e,t);break}case v.TEMPLATE:{Ti(e,t);break}default:e._err(t,Te.endTagWithoutMatchingOpenElement)}}function Ti(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,Te.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,Te.endTagWithoutMatchingOpenElement)}function za(e,t){e.openElements.pop(),e.insertionMode=te.AFTER_HEAD,e._processToken(t)}function fO(e,t){switch(t.tagID){case v.HTML:{Pn(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{jr(e,t);break}case v.NOSCRIPT:{e._err(t,Te.nestedNoscriptInHead);break}default:Ua(e,t)}}function pO(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=te.IN_HEAD;break}case v.BR:{Ua(e,t);break}default:e._err(t,Te.endTagWithoutMatchingOpenElement)}}function Ua(e,t){const n=t.type===xt.EOF?Te.openElementsLeftAfterEof:Te.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=te.IN_HEAD,e._processToken(t)}function hO(e,t){switch(t.tagID){case v.HTML:{Pn(e,t);break}case v.BODY:{e._insertElement(t,Ne.HTML),e.framesetOk=!1,e.insertionMode=te.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,Ne.HTML),e.insertionMode=te.IN_FRAMESET;break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{e._err(t,Te.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),jr(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,Te.misplacedStartTagForHeadElement);break}default:Va(e,t)}}function mO(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{Va(e,t);break}case v.TEMPLATE:{Ti(e,t);break}default:e._err(t,Te.endTagWithoutMatchingOpenElement)}}function Va(e,t){e._insertFakeElement(me.BODY,v.BODY),e.insertionMode=te.IN_BODY,Ic(e,t)}function Ic(e,t){switch(t.type){case xt.CHARACTER:{wx(e,t);break}case xt.WHITESPACE_CHARACTER:{kx(e,t);break}case xt.COMMENT:{If(e,t);break}case xt.START_TAG:{Pn(e,t);break}case xt.END_TAG:{Ac(e,t);break}case xt.EOF:{Ox(e,t);break}}}function kx(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function wx(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function gO(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function bO(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function yO(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ne.HTML),e.insertionMode=te.IN_FRAMESET)}function xO(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML)}function vO(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Df.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ne.HTML)}function CO(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function EO(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML),n||(e.formElement=e.openElements.current))}function TO(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const o=e.openElements.tagIDs[r];if(n===v.LI&&o===v.LI||(n===v.DD||n===v.DT)&&(o===v.DD||o===v.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==v.ADDRESS&&o!==v.DIV&&o!==v.P&&e._isSpecialElement(e.openElements.items[r],o))break}e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML)}function SO(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML),e.tokenizer.state=cn.PLAINTEXT}function kO(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML),e.framesetOk=!1}function wO(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(me.A);n&&(Dp(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function DO(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function IO(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(Dp(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ne.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function AO(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function OO(e,t){e.treeAdapter.getDocumentMode(e.document)!==gr.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,Ne.HTML),e.framesetOk=!1,e.insertionMode=te.IN_TABLE}function Dx(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ne.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ix(e){const t=gx(e,ui.TYPE);return t!=null&&t.toLowerCase()===K4}function MO(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ne.HTML),Ix(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function PO(e,t){e._appendElement(t,Ne.HTML),t.ackSelfClosing=!0}function RO(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,Ne.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function NO(e,t){t.tagName=me.IMG,t.tagID=v.IMG,Dx(e,t)}function FO(e,t){e._insertElement(t,Ne.HTML),e.skipNextNewLine=!0,e.tokenizer.state=cn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=te.TEXT}function LO(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,cn.RAWTEXT)}function _O(e,t){e.framesetOk=!1,e._switchToTextParsing(t,cn.RAWTEXT)}function og(e,t){e._switchToTextParsing(t,cn.RAWTEXT)}function BO(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===te.IN_TABLE||e.insertionMode===te.IN_CAPTION||e.insertionMode===te.IN_TABLE_BODY||e.insertionMode===te.IN_ROW||e.insertionMode===te.IN_CELL?te.IN_SELECT_IN_TABLE:te.IN_SELECT}function jO(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML)}function $O(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ne.HTML)}function HO(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,Ne.HTML)}function zO(e,t){e._reconstructActiveFormattingElements(),Ex(t),wp(t),t.selfClosing?e._appendElement(t,Ne.MATHML):e._insertElement(t,Ne.MATHML),t.ackSelfClosing=!0}function UO(e,t){e._reconstructActiveFormattingElements(),Tx(t),wp(t),t.selfClosing?e._appendElement(t,Ne.SVG):e._insertElement(t,Ne.SVG),t.ackSelfClosing=!0}function ig(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ne.HTML)}function Pn(e,t){switch(t.tagID){case v.I:case v.S:case v.B:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.SMALL:case v.STRIKE:case v.STRONG:{DO(e,t);break}case v.A:{wO(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{vO(e,t);break}case v.P:case v.DL:case v.OL:case v.UL:case v.DIV:case v.DIR:case v.NAV:case v.MAIN:case v.MENU:case v.ASIDE:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.DETAILS:case v.ADDRESS:case v.ARTICLE:case v.SEARCH:case v.SECTION:case v.SUMMARY:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{xO(e,t);break}case v.LI:case v.DD:case v.DT:{TO(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{Dx(e,t);break}case v.HR:{RO(e,t);break}case v.RB:case v.RTC:{$O(e,t);break}case v.RT:case v.RP:{HO(e,t);break}case v.PRE:case v.LISTING:{CO(e,t);break}case v.XMP:{LO(e,t);break}case v.SVG:{UO(e,t);break}case v.HTML:{gO(e,t);break}case v.BASE:case v.LINK:case v.META:case v.STYLE:case v.TITLE:case v.SCRIPT:case v.BGSOUND:case v.BASEFONT:case v.TEMPLATE:{jr(e,t);break}case v.BODY:{bO(e,t);break}case v.FORM:{EO(e,t);break}case v.NOBR:{IO(e,t);break}case v.MATH:{zO(e,t);break}case v.TABLE:{OO(e,t);break}case v.INPUT:{MO(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{PO(e,t);break}case v.IMAGE:{NO(e,t);break}case v.BUTTON:{kO(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{AO(e,t);break}case v.IFRAME:{_O(e,t);break}case v.SELECT:{BO(e,t);break}case v.OPTION:case v.OPTGROUP:{jO(e,t);break}case v.NOEMBED:case v.NOFRAMES:{og(e,t);break}case v.FRAMESET:{yO(e,t);break}case v.TEXTAREA:{FO(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?og(e,t):ig(e,t);break}case v.PLAINTEXT:{SO(e,t);break}case v.COL:case v.TH:case v.TD:case v.TR:case v.HEAD:case v.FRAME:case v.TBODY:case v.TFOOT:case v.THEAD:case v.CAPTION:case v.COLGROUP:break;default:ig(e,t)}}function VO(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=te.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function WO(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=te.AFTER_BODY,Bx(e,t))}function qO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function YO(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(v.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(v.FORM):n&&e.openElements.remove(n))}function KO(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(me.P,v.P),e._closePElement()}function GO(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function QO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function XO(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function ZO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function JO(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(me.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function Ax(e,t){const n=t.tagName,r=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const i=e.openElements.items[o],s=e.openElements.tagIDs[o];if(r===s&&(r!==v.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(i,s))break}}function Ac(e,t){switch(t.tagID){case v.A:case v.B:case v.I:case v.S:case v.U:case v.EM:case v.TT:case v.BIG:case v.CODE:case v.FONT:case v.NOBR:case v.SMALL:case v.STRIKE:case v.STRONG:{Dp(e,t);break}case v.P:{KO(e);break}case v.DL:case v.UL:case v.OL:case v.DIR:case v.DIV:case v.NAV:case v.PRE:case v.MAIN:case v.MENU:case v.ASIDE:case v.BUTTON:case v.CENTER:case v.FIGURE:case v.FOOTER:case v.HEADER:case v.HGROUP:case v.DIALOG:case v.ADDRESS:case v.ARTICLE:case v.DETAILS:case v.SEARCH:case v.SECTION:case v.SUMMARY:case v.LISTING:case v.FIELDSET:case v.BLOCKQUOTE:case v.FIGCAPTION:{qO(e,t);break}case v.LI:{GO(e);break}case v.DD:case v.DT:{QO(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{XO(e);break}case v.BR:{JO(e);break}case v.BODY:{VO(e,t);break}case v.HTML:{WO(e,t);break}case v.FORM:{YO(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{ZO(e,t);break}case v.TEMPLATE:{Ti(e,t);break}default:Ax(e,t)}}function Ox(e,t){e.tmplInsertionModeStack.length>0?_x(e,t):Ip(e,t)}function eM(e,t){var n;t.tagID===v.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function tM(e,t){e._err(t,Te.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Pd(e,t){if(e.openElements.currentTagId!==void 0&&Sx.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=te.IN_TABLE_TEXT,t.type){case xt.CHARACTER:{Px(e,t);break}case xt.WHITESPACE_CHARACTER:{Mx(e,t);break}}else wl(e,t)}function nM(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ne.HTML),e.insertionMode=te.IN_CAPTION}function rM(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ne.HTML),e.insertionMode=te.IN_COLUMN_GROUP}function oM(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(me.COLGROUP,v.COLGROUP),e.insertionMode=te.IN_COLUMN_GROUP,Ap(e,t)}function iM(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ne.HTML),e.insertionMode=te.IN_TABLE_BODY}function sM(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(me.TBODY,v.TBODY),e.insertionMode=te.IN_TABLE_BODY,Oc(e,t)}function aM(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function lM(e,t){Ix(t)?e._appendElement(t,Ne.HTML):wl(e,t),t.ackSelfClosing=!0}function uM(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ne.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function vs(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{sM(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{jr(e,t);break}case v.COL:{oM(e,t);break}case v.FORM:{uM(e,t);break}case v.TABLE:{aM(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{iM(e,t);break}case v.INPUT:{lM(e,t);break}case v.CAPTION:{nM(e,t);break}case v.COLGROUP:{rM(e,t);break}default:wl(e,t)}}function sl(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{Ti(e,t);break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TBODY:case v.TD:case v.TFOOT:case v.TH:case v.THEAD:case v.TR:break;default:wl(e,t)}}function wl(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Ic(e,t),e.fosterParentingEnabled=n}function Mx(e,t){e.pendingCharacterTokens.push(t)}function Px(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function aa(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)wl(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Rx=new Set([v.CAPTION,v.COL,v.COLGROUP,v.TBODY,v.TD,v.TFOOT,v.TH,v.THEAD,v.TR]);function cM(e,t){const n=t.tagID;Rx.has(n)?e.openElements.hasInTableScope(v.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=te.IN_TABLE,vs(e,t)):Pn(e,t)}function dM(e,t){const n=t.tagID;switch(n){case v.CAPTION:case v.TABLE:{e.openElements.hasInTableScope(v.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=te.IN_TABLE,n===v.TABLE&&sl(e,t));break}case v.BODY:case v.COL:case v.COLGROUP:case v.HTML:case v.TBODY:case v.TD:case v.TFOOT:case v.TH:case v.THEAD:case v.TR:break;default:Ac(e,t)}}function Ap(e,t){switch(t.tagID){case v.HTML:{Pn(e,t);break}case v.COL:{e._appendElement(t,Ne.HTML),t.ackSelfClosing=!0;break}case v.TEMPLATE:{jr(e,t);break}default:Wu(e,t)}}function fM(e,t){switch(t.tagID){case v.COLGROUP:{e.openElements.currentTagId===v.COLGROUP&&(e.openElements.pop(),e.insertionMode=te.IN_TABLE);break}case v.TEMPLATE:{Ti(e,t);break}case v.COL:break;default:Wu(e,t)}}function Wu(e,t){e.openElements.currentTagId===v.COLGROUP&&(e.openElements.pop(),e.insertionMode=te.IN_TABLE,e._processToken(t))}function Oc(e,t){switch(t.tagID){case v.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Ne.HTML),e.insertionMode=te.IN_ROW;break}case v.TH:case v.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(me.TR,v.TR),e.insertionMode=te.IN_ROW,Mc(e,t);break}case v.CAPTION:case v.COL:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE,vs(e,t));break}default:vs(e,t)}}function Af(e,t){const n=t.tagID;switch(t.tagID){case v.TBODY:case v.TFOOT:case v.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE);break}case v.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE,sl(e,t));break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TD:case v.TH:case v.TR:break;default:sl(e,t)}}function Mc(e,t){switch(t.tagID){case v.TH:case v.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Ne.HTML),e.insertionMode=te.IN_CELL,e.activeFormattingElements.insertMarker();break}case v.CAPTION:case v.COL:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:case v.TR:{e.openElements.hasInTableScope(v.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY,Oc(e,t));break}default:vs(e,t)}}function Nx(e,t){switch(t.tagID){case v.TR:{e.openElements.hasInTableScope(v.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY);break}case v.TABLE:{e.openElements.hasInTableScope(v.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY,Af(e,t));break}case v.TBODY:case v.TFOOT:case v.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(v.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=te.IN_TABLE_BODY,Af(e,t));break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:case v.TD:case v.TH:break;default:sl(e,t)}}function pM(e,t){const n=t.tagID;Rx.has(n)?(e.openElements.hasInTableScope(v.TD)||e.openElements.hasInTableScope(v.TH))&&(e._closeTableCell(),Mc(e,t)):Pn(e,t)}function hM(e,t){const n=t.tagID;switch(n){case v.TD:case v.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=te.IN_ROW);break}case v.TABLE:case v.TBODY:case v.TFOOT:case v.THEAD:case v.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Nx(e,t));break}case v.BODY:case v.CAPTION:case v.COL:case v.COLGROUP:case v.HTML:break;default:Ac(e,t)}}function Fx(e,t){switch(t.tagID){case v.HTML:{Pn(e,t);break}case v.OPTION:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._insertElement(t,Ne.HTML);break}case v.OPTGROUP:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Ne.HTML);break}case v.HR:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Ne.HTML),t.ackSelfClosing=!0;break}case v.INPUT:case v.KEYGEN:case v.TEXTAREA:case v.SELECT:{e.openElements.hasInSelectScope(v.SELECT)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),t.tagID!==v.SELECT&&e._processStartTag(t));break}case v.SCRIPT:case v.TEMPLATE:{jr(e,t);break}}}function Lx(e,t){switch(t.tagID){case v.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===v.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===v.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===v.OPTGROUP&&e.openElements.pop();break}case v.OPTION:{e.openElements.currentTagId===v.OPTION&&e.openElements.pop();break}case v.SELECT:{e.openElements.hasInSelectScope(v.SELECT)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode());break}case v.TEMPLATE:{Ti(e,t);break}}}function mM(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Fx(e,t)}function gM(e,t){const n=t.tagID;n===v.CAPTION||n===v.TABLE||n===v.TBODY||n===v.TFOOT||n===v.THEAD||n===v.TR||n===v.TD||n===v.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(v.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Lx(e,t)}function bM(e,t){switch(t.tagID){case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:case v.NOFRAMES:case v.SCRIPT:case v.STYLE:case v.TEMPLATE:case v.TITLE:{jr(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=te.IN_TABLE,e.insertionMode=te.IN_TABLE,vs(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=te.IN_COLUMN_GROUP,e.insertionMode=te.IN_COLUMN_GROUP,Ap(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=te.IN_TABLE_BODY,e.insertionMode=te.IN_TABLE_BODY,Oc(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=te.IN_ROW,e.insertionMode=te.IN_ROW,Mc(e,t);break}default:e.tmplInsertionModeStack[0]=te.IN_BODY,e.insertionMode=te.IN_BODY,Pn(e,t)}}function yM(e,t){t.tagID===v.TEMPLATE&&Ti(e,t)}function _x(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ip(e,t)}function xM(e,t){t.tagID===v.HTML?Pn(e,t):qu(e,t)}function Bx(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=te.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===v.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else qu(e,t)}function qu(e,t){e.insertionMode=te.IN_BODY,Ic(e,t)}function vM(e,t){switch(t.tagID){case v.HTML:{Pn(e,t);break}case v.FRAMESET:{e._insertElement(t,Ne.HTML);break}case v.FRAME:{e._appendElement(t,Ne.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{jr(e,t);break}}}function CM(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=te.AFTER_FRAMESET))}function EM(e,t){switch(t.tagID){case v.HTML:{Pn(e,t);break}case v.NOFRAMES:{jr(e,t);break}}}function TM(e,t){t.tagID===v.HTML&&(e.insertionMode=te.AFTER_AFTER_FRAMESET)}function SM(e,t){t.tagID===v.HTML?Pn(e,t):gu(e,t)}function gu(e,t){e.insertionMode=te.IN_BODY,Ic(e,t)}function kM(e,t){switch(t.tagID){case v.HTML:{Pn(e,t);break}case v.NOFRAMES:{jr(e,t);break}}}function wM(e,t){t.chars=en,e._insertCharacters(t)}function DM(e,t){e._insertCharacters(t),e.framesetOk=!1}function jx(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Ne.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function IM(e,t){if(U4(t))jx(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Ne.MATHML?Ex(t):r===Ne.SVG&&(V4(t),Tx(t)),wp(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function AM(e,t){if(t.tagID===v.P||t.tagID===v.BR){jx(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Ne.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(r);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(n);break}}}me.AREA,me.BASE,me.BASEFONT,me.BGSOUND,me.BR,me.COL,me.EMBED,me.FRAME,me.HR,me.IMG,me.INPUT,me.KEYGEN,me.LINK,me.META,me.PARAM,me.SOURCE,me.TRACK,me.WBR;const OM=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,MM=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),sg={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function $x(e,t){const n=HM(e),r=Dc("type",{handlers:{root:PM,element:RM,text:NM,comment:zx,doctype:FM,raw:_M},unknown:BM}),o={parser:n?new rg(sg):rg.getFragmentParser(void 0,sg),handle(a){r(a,o)},stitches:!1,options:t||{}};r(e,o),Ls(o,to());const i=n?o.parser.document:o.parser.getFragment(),s=R5(i,{file:o.options.file});return o.stitches&&Kn(s,"comment",function(a,l,u){const d=a;if(d.value.stitch&&u&&l!==void 0){const f=u.children;return f[l]=d.value.stitch,l}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function Hx(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function PM(e,t){Hx(e.children,t)}function RM(e,t){jM(e,t),Hx(e.children,t),$M(e,t)}function NM(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:xt.CHARACTER,chars:e.value,location:Dl(e)};Ls(t,to(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function FM(e,t){const n={type:xt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Dl(e)};Ls(t,to(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function LM(e,t){t.stitches=!0;const n=zM(e);if("children"in e&&"children"in n){const r=$x({type:"root",children:e.children},t.options);n.children=r.children}zx({type:"comment",value:{stitch:n}},t)}function zx(e,t){const n=e.value,r={type:xt.COMMENT,data:n,location:Dl(e)};Ls(t,to(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function _M(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Ux(t,to(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(OM,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function BM(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))LM(n,t);else{let r="";throw MM.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Ls(e,t){Ux(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=cn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Ux(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function jM(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===cn.PLAINTEXT)return;Ls(t,to(e));const r=t.parser.openElements.current;let o="namespaceURI"in r?r.namespaceURI:si.html;o===si.html&&n==="svg"&&(o=si.svg);const i=K5({...e,children:[]},{space:o===si.svg?"svg":"html"}),s={type:xt.START_TAG,tagName:n,tagID:Fs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:Dl(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function $M(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&fx.includes(n)||t.parser.tokenizer.state===cn.PLAINTEXT)return;Ls(t,Cc(e));const r={type:xt.END_TAG,tagName:n,tagID:Fs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Dl(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===cn.RCDATA||t.parser.tokenizer.state===cn.RAWTEXT||t.parser.tokenizer.state===cn.SCRIPT_DATA)&&(t.parser.tokenizer.state=cn.DATA)}function HM(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Dl(e){const t=to(e)||{line:void 0,column:void 0,offset:void 0},n=Cc(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function zM(e){return"children"in e?hi({...e,children:[]}):hi(e)}function UM(e){return function(t,n){return $x(t,{...e,file:n})}}const VM=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,WM=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,qM=({legacyTitle:e=!1,tagName:t="div"}={})=>n=>{Kn(n,"blockquote",(r,o,i)=>{let s="",a="",l=!0,u=r.children.map(d=>{if(l&&d.type==="paragraph"){const f=d.children[0],h=f.type==="text"?f.value:"",p=e?WM:VM,m=h.match(p);if(m&&(l=!1,s=m[1].toLocaleLowerCase(),a=e&&m[2]||s.toLocaleUpperCase(),h.includes(`
|
|
51
|
-
`)&&(d.children[0]={type:"text",value:h.replace(p,"").replace(/^\n+/,"")}),!h.includes(`
|
|
52
|
-
`))){const b=[];d.children.forEach((y,x)=>{x!=0&&(x==1&&y.type==="break"||b.push(y))}),d.children=[...b]}}return d});s&&(r.data={hName:t,hProperties:{class:`markdown-alert markdown-alert-${s}`,dir:"auto"}},u.unshift({type:"paragraph",children:[YM(s),{type:"text",value:a.replace(/^\//,"")}],data:{hProperties:{class:"markdown-alert-title",dir:"auto"}}})),r.children=[...u]})};function YM(e){let t=KM[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{class:"octicon",viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:t}},children:[]}]}}const KM={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"};function GM(e,t){if(typeof document>"u")return;const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style={position:"absolute",left:"-9999px"},document.body.appendChild(n);const r=document.getSelection().rangeCount>0?document.getSelection().getRangeAt(0):!1;n.select();let o=!1;try{o=!!document.execCommand("copy")}catch{o=!1}document.body.removeChild(n),r&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(r)),t&&t(o)}function Vx(e){if(!e)return null;var t=e;return t.dataset.code&&t.classList.contains("copied")?t:t.parentElement?Vx(t.parentElement):null}function QM(e){var t=n=>{var r=Vx(n.target);r&&(r.classList.add("active"),GM(r.dataset.code,function(){setTimeout(()=>{r.classList.remove("active")},2e3)}))};W.useEffect(()=>{var n,r;return(n=e.current)==null||n.removeEventListener("click",t,!1),(r=e.current)==null||r.addEventListener("click",t,!1),()=>{var o;(o=e.current)==null||o.removeEventListener("click",t,!1)}},[e])}var XM=["prefixCls","className","source","style","disableCopy","skipHtml","onScroll","onMouseOver","pluginsFilter","rehypeRewrite","wrapperElement","warpperElement","urlTransform"],ZM=e=>e;const JM=W.forwardRef((e,t)=>{var{prefixCls:n="wmde-markdown wmde-markdown-color",className:r,source:o,style:i,disableCopy:s=!1,skipHtml:a=!0,onScroll:l,onMouseOver:u,pluginsFilter:d,wrapperElement:f={},warpperElement:h={},urlTransform:p}=e,m=et(e,XM),b=W.useRef(null);W.useImperativeHandle(t,()=>Q({},e,{mdp:b}),[b,e]);var y=(n||"")+" "+(r||"");QM(b);var x=[...m.rehypePlugins||[]],C={allowElement:(I,D,_)=>m.allowElement?m.allowElement(I,D,_):/^[A-Za-z0-9]+$/.test(I.tagName)};a||x.push(UM);var E=[qM,...m.remarkPlugins||[],E5],T=Q({},h,f);return c.jsx("div",Q({ref:b,onScroll:l,onMouseOver:u},T,{className:y,style:i,children:c.jsx(f6,Q({},C,m,{skipHtml:!a,urlTransform:p||ZM,rehypePlugins:d?d("rehype",x):x,remarkPlugins:d?d("remark",E):E,children:o||""}))}))});var bu={},Of={};function eP(e,t){for(var n=t,r=0;r<e.length;r++){var o=r===e.length-1,i=e.charAt(r),s=n[i]||(n[i]={chars:{}});o&&(s.self=e),n=s.chars}}function ag(e){if(e.length===0)return bu;for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];eP(o,t)}return t}function tP(e){if(e.length===0)return Of;for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];t[o]=!0}return t}var tu={},lg={type:"String",optional:!0};function nP(e){var t={type:"NoArgument",optional:!1};function n(s){if(t.type&&t.type!==s&&t.type!=="NoArgument")throw new Error('Conflicting pseudo-class argument type: "'.concat(t.type,'" vs "').concat(s,'".'));t.type=s}for(var r=0,o=e;r<o.length;r++){var i=o[r];i==="NoArgument"&&(t.optional=!0),i==="Formula"&&n("Formula"),i==="FormulaOfSelector"&&(n("Formula"),t.ofSelector=!0),i==="String"&&n("String"),i==="Selector"&&n("Selector")}return t}function rP(e){for(var t={},n=0,r=Object.keys(e);n<r.length;n++){var o=r[n],i=e[o];if(i)for(var s=0,a=i;s<a.length;s++){var l=a[s];(t[l]||(t[l]=[])).push(o)}}return t}function ug(e){for(var t=rP(e),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r],s=t[i];s&&(n[i]=nP(s))}return n}var Cs=function(){return Cs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Cs.apply(this,arguments)},oP={},Mf={wildcard:!0};function iP(e){return e?typeof e=="boolean"?Mf:e:oP}function sP(e,t){return function(n,r){return t(e(n),e(r))}}function aP(e){return function(t,n){var r=e(t,n);if(!r)throw new Error("Syntax definition cannot be null or undefined.");return r}}function cg(e,t){return function(n,r){return r===!0?e:t(n===!0?e:n,r)}}function Xi(e){return function(t,n){if(!n||!t)return n;if(typeof n!="object"||n===null)throw new Error("Unexpected syntax definition extension type: ".concat(n,"."));for(var r=Cs({},t),o=0,i=Object.entries(n);o<i.length;o++){var s=i[o],a=s[0],l=s[1];if(a!=="latest"){var u=e[a];r[a]=u(t[a],l)}}return r}}function co(e,t){return t!==void 0?t:e}function nu(e,t){return t?e?e.concat(t):t:e}function dg(e,t){if(!t)return e;if(!e)return t;for(var n=Cs({},e),r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],s=i[0],a=i[1];if(!a){delete n[s];continue}var l=e[s];if(!l){n[s]=a;continue}n[s]=l.concat(a)}return n}var ci=aP(Xi({baseSyntax:co,modules:nu,tag:cg(Mf,Xi({wildcard:co})),ids:co,classNames:co,namespace:cg(Mf,Xi({wildcard:co})),combinators:nu,attributes:Xi({operators:nu,caseSensitivityModifiers:nu,unknownCaseSensitivityModifiers:co}),pseudoClasses:Xi({unknown:co,definitions:dg}),pseudoElements:Xi({unknown:co,notation:co,definitions:sP(function(e){return Array.isArray(e)?{NoArgument:e}:e},dg)})})),Wx={tag:{},ids:!0,classNames:!0,combinators:[],pseudoElements:{unknown:"reject",notation:"singleColon",definitions:["first-letter","first-line"]},pseudoClasses:{unknown:"reject",definitions:{NoArgument:["link","visited","active"]}}},qx=ci(Wx,{tag:{wildcard:!0},combinators:[">","+"],attributes:{unknownCaseSensitivityModifiers:"reject",operators:["=","~=","|="]},pseudoElements:{definitions:["before","after"]},pseudoClasses:{unknown:"reject",definitions:{NoArgument:["hover","focus","first-child"],String:["lang"]}}}),Pf=ci(qx,{namespace:{wildcard:!0},combinators:["~"],attributes:{operators:["^=","$=","*="]},pseudoElements:{notation:"both"},pseudoClasses:{definitions:{NoArgument:["root","last-child","first-of-type","last-of-type","only-child","only-of-type","empty","target","enabled","disabled","checked","indeterminate"],Formula:["nth-child","nth-last-child","nth-of-type","nth-last-of-type"],Selector:["not"]}}}),Yx=ci(Pf,{combinators:["||"],attributes:{caseSensitivityModifiers:["i","I","s","S"]},pseudoClasses:{definitions:{NoArgument:["any-link","local-link","target-within","scope","current","past","future","focus-within","focus-visible","read-write","read-only","placeholder-shown","default","valid","invalid","in-range","out-of-range","required","optional","blank","user-invalid","playing","paused","autofill","modal","fullscreen","picture-in-picture","defined","loading","popover-open"],Formula:["nth-col","nth-last-col"],String:["dir"],FormulaOfSelector:["nth-child","nth-last-child"],Selector:["current","is","where","has","state"]}},pseudoElements:{definitions:{NoArgument:["marker"]}}}),Yu={"css-position-1":{latest:!1,pseudoClasses:{definitions:{NoArgument:["static","relative","absolute"]}}},"css-position-2":{latest:!1,pseudoClasses:{definitions:{NoArgument:["static","relative","absolute","fixed"]}}},"css-position-3":{latest:!1,pseudoClasses:{definitions:{NoArgument:["sticky","fixed","absolute","relative","static"]}}},"css-position-4":{latest:!0,pseudoClasses:{definitions:{NoArgument:["sticky","fixed","absolute","relative","static","initial"]}}},"css-scoping-1":{latest:!0,pseudoClasses:{definitions:{NoArgument:["host","host-context"],Selector:["host","host-context"]}},pseudoElements:{definitions:{Selector:["slotted"]}}},"css-pseudo-4":{latest:!0,pseudoElements:{definitions:{NoArgument:["marker","selection","target-text","search-text","spelling-error","grammar-error","backdrop","file-selector-button","prefix","postfix","placeholder","details-content"],String:["highlight"]}}},"css-shadow-parts-1":{latest:!0,pseudoElements:{definitions:{String:["part"]}}}},Kx=Cs(Cs({},Yx),{modules:Object.entries(Yu).filter(function(e){var t=e[1].latest;return t}).map(function(e){var t=e[0];return t})}),lP=ci(Kx,{pseudoElements:{unknown:"accept"},pseudoClasses:{unknown:"accept"},attributes:{unknownCaseSensitivityModifiers:"accept"}}),Rf={css1:Wx,css2:qx,css3:Pf,"selectors-3":Pf,"selectors-4":Yx,latest:Kx,progressive:lP};function uP(){for(var e={pseudoClasses:{},pseudoElements:{}},t=["css1","css2","css3","selectors-3","selectors-4"],n=0,r=t;n<r.length;n++){var o=r[n],i=Rf[o];if(i.pseudoClasses&&typeof i.pseudoClasses=="object"){var s=i.pseudoClasses.definitions;if(s)for(var a=0,l=Object.entries(s);a<l.length;a++)for(var u=l[a],d=u[1],f=0,h=d;f<h.length;f++){var p=h[f];e.pseudoClasses[p]||(e.pseudoClasses[p]=[]),e.pseudoClasses[p].includes(o)||e.pseudoClasses[p].push(o)}}if(i.pseudoElements&&typeof i.pseudoElements=="object"){var s=i.pseudoElements.definitions;if(s)if(Array.isArray(s))for(var m=0,b=s;m<b.length;m++){var y=b[m];e.pseudoElements[y]||(e.pseudoElements[y]=[]),e.pseudoElements[y].includes(o)||e.pseudoElements[y].push(o)}else for(var x=0,C=Object.values(s);x<C.length;x++)for(var d=C[x],E=0,T=d;E<T.length;E++){var I=T[E];e.pseudoElements[I]||(e.pseudoElements[I]=[]),e.pseudoElements[I].includes(o)||e.pseudoElements[I].push(o)}}}for(var D=0,_=Object.entries(Yu);D<_.length;D++){var O=_[D],B=O[0],L=O[1];if(L.pseudoClasses&&typeof L.pseudoClasses=="object"){var s=L.pseudoClasses.definitions;if(s)for(var j=0,S=Object.values(s);j<S.length;j++)for(var d=S[j],$=0,F=d;$<F.length;$++){var R=F[$];e.pseudoClasses[R]||(e.pseudoClasses[R]=[]),e.pseudoClasses[R].includes(B)||e.pseudoClasses[R].push(B)}}if(L.pseudoElements&&typeof L.pseudoElements=="object"){var s=L.pseudoElements.definitions;if(s)if(Array.isArray(s))for(var H=0,V=s;H<V.length;H++){var Y=V[H];e.pseudoElements[Y]||(e.pseudoElements[Y]=[]),e.pseudoElements[Y].includes(B)||e.pseudoElements[Y].push(B)}else for(var q=0,P=Object.values(s);q<P.length;q++)for(var d=P[q],J=0,re=d;J<re.length;J++){var z=re[J];e.pseudoElements[z]||(e.pseudoElements[z]=[]),e.pseudoElements[z].includes(B)||e.pseudoElements[z].push(B)}}}return e}var fg=uP();function la(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="-"||e==="_"||e==="\\"||e>=" "}function pg(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="-"||e==="_"||e>=" "}function ua(e){return e>="a"&&e<="f"||e>="A"&&e<="F"||e>="0"&&e<="9"}var cP={" ":!0," ":!0,"\n":!0,"\r":!0,"\f":!0},dP={'"':!0,"'":!0},Rd={0:!0,1:!0,2:!0,3:!0,4:!0,5:!0,6:!0,7:!0,8:!0,9:!0},fP=6,Nd="css-selector-parser parse error: ";function pP(e){e===void 0&&(e={});var t=e.syntax,n=t===void 0?"latest":t,r=e.substitutes,o=e.strict,i=o===void 0?!0:o,s=e.modules,a=typeof n=="object"?n:Rf[n];if(a.baseSyntax&&(a=ci(Rf[a.baseSyntax],a)),a.modules&&a.modules.length>0)for(var l=0,u=a.modules;l<u.length;l++){var d=u[l],f=Yu[d];f&&(a=ci(f,a))}if(s&&s.length>0)for(var h=0,p=s;h<p.length;h++){var m=p[h],f=Yu[m];f&&(a=ci(f,a))}var b=a.tag?[!0,!!iP(a.tag).wildcard]:[!1,!1],y=b[0],x=b[1],C=!!a.ids,E=!!a.classNames,T=!!a.namespace,I=a.namespace&&(a.namespace===!0||a.namespace.wildcard===!0);if(T&&!y)throw new Error("".concat(Nd,"Namespaces cannot be enabled while tags are disabled."));var D=!!r,_=a.combinators?ag(a.combinators):bu,O=a.attributes?[!0,a.attributes.operators?ag(a.attributes.operators):bu,a.attributes.caseSensitivityModifiers?tP(a.attributes.caseSensitivityModifiers):Of,a.attributes.unknownCaseSensitivityModifiers==="accept"]:[!1,bu,Of,!1],B=O[0],L=O[1],j=O[2],S=O[3],$=S||Object.keys(j).length>0,F=a.pseudoClasses?[!0,a.pseudoClasses.definitions?ug(a.pseudoClasses.definitions):tu,a.pseudoClasses.unknown==="accept"]:[!1,tu,!1],R=F[0],H=F[1],V=F[2],Y=a.pseudoElements?[!0,a.pseudoElements.notation==="singleColon"||a.pseudoElements.notation==="both",!a.pseudoElements.notation||a.pseudoElements.notation==="doubleColon"||a.pseudoElements.notation==="both",a.pseudoElements.definitions?ug(Array.isArray(a.pseudoElements.definitions)?{NoArgument:a.pseudoElements.definitions}:a.pseudoElements.definitions):tu,a.pseudoElements.unknown==="accept"]:[!1,!1,!1,tu,!1],q=Y[0],P=Y[1],J=Y[2],re=Y[3],z=Y[4],ye="",se=ye.length,G=0,le="",oe=function(be){return le===be},ue=function(){return oe("*")||la(le)},ie=function(be){G=be,le=ye.charAt(G)},Z=function(){G++,le=ye.charAt(G)},de=function(){var be=le;return G++,le=ye.charAt(G),be};function ae(be){var Ae=Math.min(se-1,G),Re=new Error("".concat(Nd).concat(be," Pos: ").concat(Ae,"."));throw Re.position=Ae,Re.name="ParserError",Re}function ne(be,Ae){if(!be)return ae(Ae)}var Ce=function(){ne(G<se,"Unexpected end of input.")},ve=function(){return G>=se},Se=function(be){ne(G<se,'Expected "'.concat(be,'" but end of input reached.')),ne(le===be,'Expected "'.concat(be,'" but "').concat(le,'" found.')),G++,le=ye.charAt(G)};function he(be){var Ae=$e(be,G);if(Ae)return G+=Ae.length,le=ye.charAt(G),Ae}function $e(be,Ae){var Re=ye.charAt(Ae),Qe=be[Re];if(Qe){var st=$e(Qe.chars,Ae+1);if(st)return st;if(Qe.self)return Qe.self}}function Pe(){for(var be=de(),Ae=1;ua(le)&&Ae<fP;)be+=de(),Ae++;return ct(),String.fromCharCode(parseInt(be,16))}function Je(be){var Ae="";for(Se(be);G<se;){if(oe(be))return Z(),Ae;oe("\\")?(Z(),oe(be)?(Ae+=be,Z()):le===`
|
|
53
|
-
`||le==="\f"?Z():le==="\r"?(Z(),oe(`
|
|
54
|
-
`)&&Z()):ua(le)?Ae+=Pe():(Ae+=le,Z())):(Ae+=le,Z())}return Ae}function Me(){if(!la(le))return null;for(var be="";oe("-");)be+=le,Z();for(be==="-"&&!pg(le)&&!oe("\\")&&ae("Identifiers cannot consist of a single hyphen."),i&&be.length>=2&&ae("Identifiers cannot start with two hyphens with strict mode on."),Rd[le]&&ae("Identifiers cannot start with hyphens followed by digits.");G<se;)if(pg(le))be+=de();else if(oe("\\"))Z(),Ce(),ua(le)?be+=Pe():be+=de();else break;return be}function Nt(){for(var be="";G<se&&!oe(")");)if(oe("\\")){if(Z(),ve()&&!i)return(be+"\\").trim();Ce(),ua(le)?be+=Pe():be+=de()}else be+=de();return be.trim()}function ct(){if(le===" "||le===" "||le==="\f"||le===`
|
|
55
|
-
`){Z();return}le==="\r"&&Z(),le===`
|
|
56
|
-
`&&Z()}function tt(){for(;cP[le];)Z()}function xe(be){be===void 0&&(be=!1),tt();for(var Ae=[Mt(be)];oe(",");)Z(),tt(),Ae.push(Mt(be));return{type:"Selector",rules:Ae}}function Oe(){Se("["),tt();var be;if(oe("|")){ne(T,"Namespaces are not enabled."),Z();var Ae=Me();ne(Ae,"Expected attribute name."),be={type:"Attribute",name:Ae,namespace:{type:"NoNamespace"}}}else if(oe("*")){ne(T,"Namespaces are not enabled."),ne(I,"Wildcard namespace is not enabled."),Z(),Se("|");var Re=Me();ne(Re,"Expected attribute name."),be={type:"Attribute",name:Re,namespace:{type:"WildcardNamespace"}}}else{var Qe=Me();if(ne(Qe,"Expected attribute name."),be={type:"Attribute",name:Qe},oe("|")){var st=G;if(Z(),la(le)){ne(T,"Namespaces are not enabled.");var Lt=Me();ne(Lt,"Expected attribute name."),be={type:"Attribute",name:Lt,namespace:{type:"NamespaceName",name:Qe}}}else ie(st)}}if(ne(be.name,"Expected attribute name."),tt(),ve()&&!i)return be;if(oe("]"))Z();else{if(be.operator=he(L),ne(be.operator,"Expected a valid attribute selector operator."),tt(),Ce(),dP[le])be.value={type:"String",value:Je(le)};else if(D&&oe("$")){Z();var Qt=Me();ne(Qt,"Expected substitute name."),be.value={type:"Substitution",name:Qt}}else{var yt=Me();ne(yt,"Expected attribute value."),be.value={type:"String",value:yt}}if(tt(),ve()&&!i)return be;if(!oe("]")){var sn=Me();if(ne(sn,"Expected end of attribute selector."),be.caseSensitivityModifier=sn,ne($,"Attribute case sensitivity modifiers are not enabled."),ne(S||j[be.caseSensitivityModifier],"Unknown attribute case sensitivity modifier."),tt(),ve()&&!i)return be}Se("]")}return be}function We(){for(var be="";Rd[le];)be+=de();return ne(be!=="","Formula parse error."),parseInt(be)}var Xe=function(){return oe("-")||oe("+")||Rd[le]};function Ze(){if(oe("e")||oe("o")){var be=Me();if(be==="even")return tt(),[2,0];if(be==="odd")return tt(),[2,1]}var Ae=null,Re=1;if(oe("-")&&(Z(),Re=-1),Xe()&&(oe("+")&&Z(),Ae=We(),!oe("\\")&&!oe("n")))return[0,Ae*Re];Ae===null&&(Ae=1),Ae*=Re;var Qe;if(oe("\\")?(Z(),ua(le)?Qe=Pe():Qe=de()):Qe=de(),ne(Qe==="n",'Formula parse error: expected "n".'),tt(),oe("+")||oe("-")){var st=oe("+")?1:-1;return Z(),tt(),[Ae,st*We()]}else return[Ae,0]}function Fe(be,Ae,Re){var Qe;if(oe("(")){if(Z(),tt(),D&&oe("$")){Z();var st=Me();ne(st,"Expected substitute name."),Qe={type:"Substitution",name:st}}else if(Re.type==="String")Qe={type:"String",value:Nt()},ne(Qe.value,"Expected ".concat(Ae," argument value."));else if(Re.type==="Selector")Qe=xe(!0);else if(Re.type==="Formula"){var Lt=Ze(),Qt=Lt[0],yt=Lt[1];if(Qe={type:"Formula",a:Qt,b:yt},Re.ofSelector&&(tt(),oe("o")||oe("\\"))){var sn=Me();ne(sn==="of","Formula of selector parse error."),tt(),Qe={type:"FormulaOfSelector",a:Qt,b:yt,selector:Mt()}}}else return ae("Invalid ".concat(Ae," signature."));if(tt(),ve()&&!i)return Qe;Se(")")}else ne(Re.optional,"Argument is required for ".concat(Ae,' "').concat(be,'".'));return Qe}function dt(){if(oe("*"))return ne(x,"Wildcard tag name is not enabled."),Z(),{type:"WildcardTag"};if(la(le)){ne(y,"Tag names are not enabled.");var be=Me();return ne(be,"Expected tag name."),{type:"TagName",name:be}}else return ae("Expected tag name.")}function lt(){if(oe("*")){var be=G;if(Z(),!oe("|")||(Z(),!ue()))return ie(be),dt();ne(T,"Namespaces are not enabled."),ne(I,"Wildcard namespace is not enabled.");var Ae=dt();return Ae.namespace={type:"WildcardNamespace"},Ae}else if(oe("|")){ne(T,"Namespaces are not enabled."),Z();var Ae=dt();return Ae.namespace={type:"NoNamespace"},Ae}else if(la(le)){var Re=Me();if(ne(Re,"Expected tag name."),!oe("|"))return ne(y,"Tag names are not enabled."),{type:"TagName",name:Re};var be=G;if(Z(),!ue())return ie(be),{type:"TagName",name:Re};ne(T,"Namespaces are not enabled.");var Ae=dt();return Ae.namespace={type:"NamespaceName",name:Re},Ae}else return ae("Expected tag name.")}function Mt(be){var Ae,Re;be===void 0&&(be=!1);var Qe={type:"Rule",items:[]};if(be){var st=he(_);st&&(Qe.combinator=st,tt())}for(;G<se;)if(ue())ne(Qe.items.length===0,"Unexpected tag/namespace start."),Qe.items.push(lt());else if(oe("|")){var Lt=G;if(Z(),ue())ne(Qe.items.length===0,"Unexpected tag/namespace start."),ie(Lt),Qe.items.push(lt());else{ie(Lt);break}}else if(oe(".")){ne(E,"Class names are not enabled."),Z();var Qt=Me();ne(Qt,"Expected class name."),Qe.items.push({type:"ClassName",name:Qt})}else if(oe("#")){ne(C,"IDs are not enabled."),Z();var yt=Me();ne(yt,"Expected ID name."),Qe.items.push({type:"Id",name:yt})}else if(oe("["))ne(B,"Attributes are not enabled."),Qe.items.push(Oe());else if(oe(":")){var sn=!1,Rn=!1;Z(),oe(":")&&(ne(q,"Pseudo elements are not enabled."),ne(J,"Pseudo elements double colon notation is not enabled."),sn=!0,Z());var $t=Me();if(ne(sn||$t,"Expected pseudo-class name."),ne(!sn||$t,"Expected pseudo-element name."),ne($t,"Expected pseudo-class name."),!(!sn||z||Object.prototype.hasOwnProperty.call(re,$t))){var bn=fg.pseudoElements[$t],lr='Unknown pseudo-element "'.concat($t,'"');bn&&bn.length>0&&(lr+=". It is defined in: ".concat(bn.join(", "))),ae(lr+".")}if(Rn=q&&(sn||!sn&&P&&Object.prototype.hasOwnProperty.call(re,$t)),Rn){var Nn=(Ae=re[$t])!==null&&Ae!==void 0?Ae:z&&lg,$r={type:"PseudoElement",name:$t},Hn=Fe($t,"pseudo-element",Nn);Hn&&(ne(Hn.type!=="Formula"&&Hn.type!=="FormulaOfSelector","Pseudo-elements cannot have formula argument."),$r.argument=Hn),Qe.items.push($r)}else{ne(R,"Pseudo-classes are not enabled.");var Nn=(Re=H[$t])!==null&&Re!==void 0?Re:V&≶if(!Nn){var bn=fg.pseudoClasses[$t],lr='Unknown pseudo-class: "'.concat($t,'"');bn&&bn.length>0&&(lr+=". It is defined in: ".concat(bn.join(", "))),ae(lr+".")}var Hn=Fe($t,"pseudo-class",Nn),Pt={type:"PseudoClass",name:$t};Hn&&(Pt.argument=Hn),Qe.items.push(Pt)}}else break;if(Qe.items.length===0)return ve()?ae("Expected rule but end of input reached."):ae('Expected rule but "'.concat(le,'" found.'));if(tt(),!ve()&&!oe(",")&&!oe(")")){var st=he(_);tt(),Qe.nestedRule=Mt(),Qe.nestedRule.combinator=st}return Qe}return function(be){if(typeof be!="string")throw new Error("".concat(Nd,"Expected string input."));return ye=be,se=ye.length,G=0,le=ye.charAt(0),xe()}}const hP=pP({syntax:"selectors-4"});function mP(e){if(typeof e!="string")throw new TypeError("Expected `string` as selector, not `"+e+"`");return hP(e)}const Gx="֑-߿יִ-﷽ﹰ-ﻼ",Qx="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",gP=new RegExp("^[^"+Qx+"]*["+Gx+"]"),bP=new RegExp("^[^"+Gx+"]*["+Qx+"]");function yP(e){const t=String(e||"");return gP.test(t)?"rtl":bP.test(t)?"ltr":"neutral"}function Xx(e){return"children"in e?Zx(e):"value"in e?e.value:""}function xP(e){return e.type==="text"?e.value:"children"in e?Zx(e):""}function Zx(e){let t=-1;const n=[];for(;++t<e.children.length;)n[t]=xP(e.children[t]);return n.join("")}function vP(e,t){const n=e.schema,r=e.language,o=e.direction,i=e.editableOrEditingHost;let s;if(t.type==="element"){const u=t.properties.xmlLang||t.properties.lang,d=t.properties.type||"text",f=hg(t);u!=null&&(e.language=String(u)),n&&n.space==="html"?(t.properties.contentEditable==="true"&&(e.editableOrEditingHost=!0),t.tagName==="svg"&&(e.schema=jo),f==="rtl"?s=f:f==="ltr"||f!=="auto"&&t.tagName==="html"||f!=="auto"&&t.tagName==="input"&&d==="tel"?s="ltr":(f==="auto"||t.tagName==="bdi")&&(t.tagName==="textarea"?s=Fd(Xx(t)):t.tagName==="input"&&(d==="email"||d==="search"||d==="tel"||d==="text")?s=t.properties.value?Fd(String(t.properties.value)):"ltr":Kn(t,l)),s&&(e.direction=s)):e.editableOrEditingHost&&(e.editableOrEditingHost=!1)}return a;function a(){e.schema=n,e.language=r,e.direction=o,e.editableOrEditingHost=i}function l(u){if(u.type==="text")return s=Fd(u.value),s?zu:void 0;if(u!==t&&u.type==="element"&&(u.tagName==="bdi"||u.tagName==="script"||u.tagName==="style"||u.tagName==="textare"||hg(u)))return ja}}function Fd(e){const t=yP(e);return t==="neutral"?void 0:t}function hg(e){const t=e.type==="element"&&typeof e.properties.dir=="string"?e.properties.dir.toLowerCase():void 0;return t==="auto"||t==="ltr"||t==="rtl"?t:void 0}function CP(e,t,n){const r=El(n,e.name),o=t.properties[r.property];let i=EP(o,r);if(!e.value)return i!==void 0;e.value.type;let s=e.value.value;if(e.caseSensitivityModifier==="i"&&(s=s.toLowerCase(),i&&(i=i.toLowerCase())),i!==void 0)switch(e.operator){case"=":return s===i;case"$=":return s===i.slice(-s.length);case"*=":return i.includes(s);case"^=":return s===i.slice(0,s.length);case"|=":return s===i||s===i.slice(0,s.length)&&i.charAt(s.length)==="-";case"~=":return s===i||hf(i).includes(s)}return!1}function EP(e,t){if(e!=null)if(typeof e=="boolean"){if(e)return t.attribute}else if(Array.isArray(e)){if(e.length>0)return(t.commaSeparated?xc:vc)(e)}else return String(e)}const TP=[];function SP(e,t){return(t.properties.className||TP).includes(e.name)}function kP(e,t){return t.properties.id===e.name}function wP(e,t){return e.name===t.tagName}function DP(e,t){return function(n,r){let o=mg(n,"tag");const i=mg(r??"*","range"),s=[];let a=-1;for(;++a<i.length;){const l=i[a].toLowerCase();if(!t&&l==="*")continue;let u=-1;const d=[];for(;++u<o.length;)if(e(o[u].toLowerCase(),l)){if(!t)return o[u];s.push(o[u])}else d.push(o[u]);o=d}return t?s:void 0}}const IP=DP(function(e,t){const n=e.split("-"),r=t.split("-");let o=0,i=0;if(r[i]!=="*"&&n[o]!==r[i])return!1;for(o++,i++;i<r.length;){if(r[i]==="*"){i++;continue}if(!n[o])return!1;if(n[o]===r[i]){o++,i++;continue}if(n[o].length===1)return!1;o++}return!0},!0);function mg(e,t){const n=e&&typeof e=="string"?[e]:e;if(!n||typeof n!="object"||!("length"in n))throw new Error("Invalid "+t+" `"+n+"`, expected non-empty string");return n}const AP={}.hasOwnProperty;function mi(e,t){const n=e.type==="element"&&AP.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}const OP=new Set([9,10,12,13,32]),gg=48,MP=57;function PP(e){if(e=e.trim().toLowerCase(),e==="even")return[2,0];if(e==="odd")return[2,1];let t=0,n=0,r=i(),o=s();if(t<e.length&&e.charAt(t)==="n"&&(t++,n=r*(o??1),a(),t<e.length?(r=i(),a(),o=s()):r=o=0),o===null||t<e.length)throw new Error(`n-th rule couldn't be parsed ('${e}')`);return[n,r*o];function i(){return e.charAt(t)==="-"?(t++,-1):(e.charAt(t)==="+"&&t++,1)}function s(){const l=t;let u=0;for(;t<e.length&&e.charCodeAt(t)>=gg&&e.charCodeAt(t)<=MP;)u=u*10+(e.charCodeAt(t)-gg),t++;return t===l?null:u}function a(){for(;t<e.length&&OP.has(e.charCodeAt(t));)t++}}var Ld,bg;function RP(){return bg||(bg=1,Ld={trueFunc:function(){return!0},falseFunc:function(){return!1}}),Ld}var NP=RP();const yg=Sr(NP);function FP(e){const t=e[0],n=e[1]-1;if(n<0&&t<=0)return yg.falseFunc;if(t===-1)return i=>i<=n;if(t===0)return i=>i===n;if(t===1)return n<0?yg.trueFunc:i=>i>=n;const r=Math.abs(t),o=(n%r+r)%r;return t>1?i=>i>=n&&i%r===o:i=>i<=n&&i%r===o}function xg(e){return FP(PP(e))}const LP=xg.default||xg,_P=Dc("name",{handlers:{"any-link":BP,blank:jP,checked:$P,dir:HP,disabled:Jx,empty:zP,enabled:UP,"first-child":VP,"first-of-type":WP,has:qP,is:e2,lang:KP,"last-child":GP,"last-of-type":QP,not:XP,"nth-child":ZP,"nth-last-child":JP,"nth-last-of-type":eR,"nth-of-type":tR,"only-child":nR,"only-of-type":rR,optional:oR,"read-only":iR,"read-write":t2,required:n2,root:sR,scope:aR},invalid:YP,unknown:lR});function BP(e,t){return(t.tagName==="a"||t.tagName==="area"||t.tagName==="link")&&mi(t,"href")}function ro(e,t){if(e.shallow)throw new Error("Cannot use `:"+t.name+"` without parent")}function jP(e,t){return!r2(t,n);function n(r){return r.type==="element"||r.type==="text"&&!ap(r)}}function $P(e,t){return t.tagName==="input"||t.tagName==="menuitem"?!!((t.properties.type==="checkbox"||t.properties.type==="radio")&&mi(t,"checked")):t.tagName==="option"?mi(t,"selected"):!1}function HP(e,t,n,r,o){return e.argument,e.argument.type,o.direction===e.argument.value}function Jx(e,t){return(t.tagName==="button"||t.tagName==="input"||t.tagName==="select"||t.tagName==="textarea"||t.tagName==="optgroup"||t.tagName==="option"||t.tagName==="menuitem"||t.tagName==="fieldset")&&mi(t,"disabled")}function zP(e,t){return!r2(t,n);function n(r){return r.type==="element"||r.type==="text"}}function UP(e,t){return!Jx(e,t)}function VP(e,t,n,r,o){return ro(o,e),o.elementIndex===0}function WP(e,t,n,r,o){return ro(o,e),o.typeIndex===0}function Pc(e){let t=e._cachedFn;if(!t){const n=e.argument;if(n.type!=="Formula")throw new Error("Expected `nth` formula, such as `even` or `2n+1` (`of` is not yet supported)");t=LP(n.a+"n+"+n.b),e._cachedFn=t}return t}function qP(e,t,n,r,o){e.argument,e.argument.type;const i={...o,found:!1,one:!0,results:[],rootQuery:e.argument,scopeElements:[t],shallow:!1};return Op(i,{type:"root",children:t.children}),i.results.length>0}function YP(){}function e2(e,t,n,r,o){e.argument,e.argument.type;const i={...o,found:!1,one:!0,results:[],rootQuery:e.argument,scopeElements:[t],shallow:!1};return Op(i,t),i.results[0]===t}function KP(e,t,n,r,o){return e.argument,e.argument.type,o.language!==""&&o.language!==void 0&&IP(o.language,df(e.argument.value)).length>0}function GP(e,t,n,r,o){return ro(o,e),!!(o.elementCount&&o.elementIndex===o.elementCount-1)}function QP(e,t,n,r,o){return ro(o,e),typeof o.typeIndex=="number"&&typeof o.typeCount=="number"&&o.typeIndex===o.typeCount-1}function XP(e,t,n,r,o){return!e2(e,t,n,r,o)}function ZP(e,t,n,r,o){const i=Pc(e);return ro(o,e),typeof o.elementIndex=="number"&&i(o.elementIndex)}function JP(e,t,n,r,o){const i=Pc(e);return ro(o,e),!!(typeof o.elementCount=="number"&&typeof o.elementIndex=="number"&&i(o.elementCount-o.elementIndex-1))}function eR(e,t,n,r,o){const i=Pc(e);return ro(o,e),typeof o.typeCount=="number"&&typeof o.typeIndex=="number"&&i(o.typeCount-1-o.typeIndex)}function tR(e,t,n,r,o){const i=Pc(e);return ro(o,e),typeof o.typeIndex=="number"&&i(o.typeIndex)}function nR(e,t,n,r,o){return ro(o,e),o.elementCount===1}function rR(e,t,n,r,o){return ro(o,e),o.typeCount===1}function oR(e,t){return!n2(e,t)}function iR(e,t,n,r,o){return!t2(e,t,n,r,o)}function t2(e,t,n,r,o){return t.tagName==="input"||t.tagName==="textarea"?!mi(t,"readOnly")&&!mi(t,"disabled"):!!o.editableOrEditingHost}function n2(e,t){return(t.tagName==="input"||t.tagName==="textarea"||t.tagName==="select")&&mi(t,"required")}function sR(e,t,n,r,o){return!!((!r||r.type==="root")&&o.schema&&(o.schema.space==="html"||o.schema.space==="svg")&&(t.tagName==="html"||t.tagName==="svg"))}function aR(e,t,n,r,o){return o.scopeElements.includes(t)}function r2(e,t){const n=e.children;let r=-1;for(;++r<n.length;)if(t(n[r]))return!0;return!1}function lR(e){const t=e;throw new Error("Unknown pseudo-selector `"+t.name+"`")}function uR(e,t,n,r,o){for(const i of e.items)if(i.type==="Attribute"){if(!CP(i,t,o.schema))return!1}else if(i.type==="Id"){if(!kP(i,t))return!1}else if(i.type==="ClassName"){if(!SP(i,t))return!1}else if(i.type==="PseudoClass"){if(!_P(i,t,n,r,o))return!1}else{if(i.type==="PseudoElement")throw new Error("Invalid selector: `::"+i.name+"`");if(i.type==="TagName"&&!wP(i,t))return!1}return!0}const cR=[];function Op(e,t){t&&o2(e,[],t,void 0,void 0,t)}function _d(e,t,n){const r=e[t];r?r.push(n):e[t]=[n]}function dR(e,t,n,r){const o=yu(t.descendant,t.directChild);let i,s=-1;const a={count:0,types:new Map},l={count:0,types:new Map};for(;++s<n.children.length;)vg(a,n.children[s]);for(s=-1;++s<n.children.length;){const u=n.children[s],d=u.type==="element"?u.tagName.toUpperCase():void 0;if(e.elementIndex=l.count,e.typeIndex=d&&l.types.get(d)||0,e.elementCount=a.count,e.typeCount=d?a.types.get(d):0,"children"in u){const f=yu(o,i),h=o2(e,f,n.children[s],s,n,r);i=yu(h.generalSibling,h.adjacentSibling)}if(e.one&&e.found)break;vg(l,n.children[s])}}function fR(e,t,n,r,o){const i={adjacentSibling:void 0,descendant:void 0,directChild:void 0,generalSibling:void 0};let s=-1;for(;++s<t.length;){const a=t[s];if(e.one&&e.found)break;if(e.shallow&&a.nestedRule)throw new Error("Expected selector without nesting");if(uR(a,n,r,o,e)){const l=a.nestedRule;if(l){const u=l.combinator==="+"?"adjacentSibling":l.combinator==="~"?"generalSibling":l.combinator===">"?"directChild":"descendant";_d(i,u,l)}else e.found=!0,e.results.includes(n)||e.results.push(n)}a.combinator===void 0?_d(i,"descendant",a):a.combinator==="~"&&_d(i,"generalSibling",a)}return i}function yu(e,t){return e&&t&&e.length>0&&t.length>0?[...e,...t]:e&&e.length>0?e:t&&t.length>0?t:cR}function vg(e,t){if(t.type==="element"){const n=t.tagName.toUpperCase(),r=(e.types.get(n)||0)+1;e.count++,e.types.set(n,r)}}function o2(e,t,n,r,o,i){let s={adjacentSibling:void 0,descendant:void 0,directChild:void 0,generalSibling:void 0};const a=vP(e,n);if(n.type==="element"){let l=e.rootQuery.rules;o&&o!==i&&(l=e.rootQuery.rules.filter(u=>u.combinator===void 0||u.combinator===">"&&o===i)),s=fR(e,yu(t,l),n,r,o)}return"children"in n&&!e.shallow&&!(e.one&&e.found)&&dR(e,s,n,i),a(),s}function pR(e,t,n){const r=hR(e,t);return Op(r,t||void 0),r.results}function hR(e,t,n){return{direction:"ltr",editableOrEditingHost:!1,elementCount:void 0,elementIndex:void 0,found:!1,language:void 0,one:!1,results:[],rootQuery:mP(e),schema:Ms,scopeElements:t?t.type==="root"?t.children:[t]:[],shallow:!1,typeIndex:void 0,typeCount:void 0}}const i2=(e=[],t="")=>(e.forEach(n=>{n.type==="text"?t+=n.value:n.type==="element"&&n.children&&Array.isArray(n.children)&&(t+=i2(n.children))}),t),mR=e=>{const{selector:t,rewrite:n}=e||{};return r=>{if(!(!n||typeof n!="function")){if(t&&typeof t=="string"){const o=pR(t,r);o&&o.length>0&&Kn(r,o,(i,s,a)=>{n(i,s,a)});return}Kn(r,(o,i,s)=>{n(o,i,s)})}}},gR=(e="")=>(e.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((t,n)=>(t[n.slice(0,n.indexOf("="))]=n.slice(n.indexOf("=")+1),t),{}),bR=(e=[],t)=>{let n=t;for(;n>-1;){if(n--,!e[n])return;if(e[n]&&e[n].value&&e[n].value.replace(/(\n|\s)/g,"")!==""||e[n].type!=="text")return!/^rehype:/.test(e[n].value)||e[n].type!=="comment"?void 0:e[n]}},s2=(e=[],t,n,r)=>{let o=t;for(;o<e.length;)if(o++,n){const i=e[o];if(i&&i.value&&i.value.replace(/(\n|\s)/g,"")!==""||e[o]&&e[o].type==="element")return i.tagName===n?i:void 0}else{const i=e[o];if(!i||i.type==="element"||i.type==="text"&&i.value.replace(/(\n|\s)/g,"")!=="")return;if(i.type&&/^(comment|raw)$/ig.test(i.type))return i.value&&!/^rehype:/.test(i.value.replace(/^(\s+)?<!--(.*?)-->/,"$2")||"")?void 0:r?s2(e,o,"pre",r)?void 0:(i.value=(i.value||"").replace(/^(\n|\s)+/,""),i):(i.value=(i.value||"").replace(/^(\n|\s)+/,""),i)}},Cg=({value:e=""})=>{const t=gR(e.replace(/^<!--(.*?)-->/,"$1").replace(/^rehype:/,""));return Object.keys(t).forEach(n=>{t[n]==="true"&&(t[n]=!0),t[n]==="false"&&(t[n]=!1),typeof t[n]=="string"&&!/^0/.test(t[n])&&!isNaN(+t[n])&&(t[n]=+t[n])}),t},Eg=(e,t,n)=>n==="string"?{...e,"data-config":JSON.stringify({...t,rehyp:!0})}:n==="attr"?{...e,...t}:{...e,"data-config":{...t,rehyp:!0}},yR=(e={})=>{const{properties:t="data",codeBlockParames:n=!0}=e;return r=>{Kn(r,"element",(o,i,s)=>{if(n&&o.tagName==="pre"&&o&&Array.isArray(o.children)&&s&&Array.isArray(s.children)&&s.children.length>1){const a=o.children[0];if(a&&a.tagName==="code"&&typeof i=="number"){const l=bR(s.children,i);if(l){const u=Cg(l);Object.keys(u).length>0&&(o.properties={...o.properties,"data-type":"rehyp"},a.properties=Eg(a.properties,u,t))}}}if(/^(em|strong|b|a|i|p|pre|kbd|blockquote|h(1|2|3|4|5|6)|code|table|img|del|ul|ol)$/.test(o.tagName)&&s&&Array.isArray(s.children)&&typeof i=="number"){const a=s2(s.children,i,"",n);if(a){const l=Cg(a);Object.keys(l).length>0&&(o.properties=Eg(o.properties,l,t))}}})}};var xR=function(t){return n=>{Kn(n,r=>{r.type==="element"&&r.tagName==="code"&&r.data&&r.data.meta&&(r.properties=Q({},r.properties,{"data-meta":String(r.data.meta)}))})}},vR=function(t){return n=>{Kn(n,r=>{if(r.type==="element"&&r.tagName==="code"&&r.properties&&r.properties.dataMeta){r.data||(r.data={});var o=r.properties.dataMeta;typeof o=="string"&&(r.data.meta=o),delete r.properties.dataMeta}})}};const CR=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,ER=Object.hasOwnProperty;class TR{constructor(){this.occurrences,this.reset()}slug(t,n){const r=this;let o=SR(t,n===!0);const i=o;for(;ER.call(r.occurrences,o);)r.occurrences[i]++,o=i+"-"+r.occurrences[i];return r.occurrences[o]=0,o}reset(){this.occurrences=Object.create(null)}}function SR(e,t){return typeof e!="string"?"":(t||(e=e.toLowerCase()),e.replace(CR,"").replace(/ /g,"-"))}function a2(e){const t=e.type==="element"?e.tagName.toLowerCase():"",n=t.length===2&&t.charCodeAt(0)===104?t.charCodeAt(1):0;return n>48&&n<55?n-48:void 0}const kR={},Tg=new TR;function wR(e){const n=(e||kR).prefix||"";return function(r){Tg.reset(),Kn(r,"element",function(o){a2(o)&&!o.properties.id&&(o.properties.id=n+Tg.slug(Xx(o)))})}}const l2=(function(e){if(e==null)return AR;if(typeof e=="string")return IR(e);if(typeof e=="object")return DR(e);if(typeof e=="function")return Mp(e);throw new Error("Expected function, string, or array as `test`")});function DR(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=l2(e[n]);return Mp(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function IR(e){return Mp(t);function t(n){return n.tagName===e}}function Mp(e){return t;function t(n,r,o){return!!(OR(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function AR(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function OR(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Sg={type:"element",tagName:"span",properties:{className:["icon","icon-link"]},children:[]},MR={};function PR(e){const t=e||MR;let n=t.properties;const r=t.headingProperties,o=t.behavior||"prepend",i=t.content,s=t.group,a=l2(t.test);let l;return o==="after"||o==="before"?l=d:o==="wrap"?l=f:(l=u,n||(n={ariaHidden:"true",tabIndex:-1})),function(h){Kn(h,"element",function(p,m,b){if(a2(p)&&p.properties.id&&a(p,m,b))return Object.assign(p.properties,ru(r,p)),l(p,m,b)})};function u(h){const p=kg(i||Sg,h);return h.children[o==="prepend"?"unshift":"push"](Bd(h,ru(n,h),p)),[ja]}function d(h,p,m){if(typeof p!="number"||!m)return;const b=kg(i||Sg,h),y=Bd(h,ru(n,h),b);let x=o==="before"?[y,h]:[h,y];if(s){const C=u2(s,h);C&&!Array.isArray(C)&&C.type==="element"&&(C.children=x,x=[C])}return m.children.splice(p,1,...x),[ja,p+x.length]}function f(h){let p=h.children,m=[];return typeof i=="function"?(p=[],m=i(h)):i&&(m=Pp(i)),h.children=[Bd(h,ru(n,h),Array.isArray(m)?[...p,...m]:[...p,m])],[ja]}}function Pp(e){return hi(e)}function Bd(e,t,n){return{type:"element",tagName:"a",properties:{...t,href:"#"+e.properties.id},children:n}}function kg(e,t){const n=u2(e,t);return Array.isArray(n)?n:[n]}function u2(e,t){return typeof e=="function"?e(t):Pp(e)}function ru(e,t){return typeof e=="function"?e(t):e?Pp(e):{}}const RR=(e={})=>{const{openDelimiter:t="rehype:ignore:start",closeDelimiter:n="rehype:ignore:end"}=e;return r=>{Kn(r,(o,i,s)=>{if(o.type==="element"||o.type==="root"){let a=!1;o.children=o.children.filter(l=>{if(l.type==="raw"||l.type==="comment"){let u=(l.value||"").trim();if(u=u.replace(/^<!--(.*?)-->/,"$1"),u===t)return a=!0,!1;if(u===n)return a=!1,!1}return!a})}})}};var NR={type:"element",tagName:"svg",properties:{className:"octicon octicon-link",viewBox:"0 0 16 16",version:"1.1",width:"16",height:"16",ariaHidden:"true"},children:[{type:"element",tagName:"path",children:[],properties:{fillRule:"evenodd",d:"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"}}]};function FR(e){return e===void 0&&(e=""),{type:"element",tagName:"div",properties:{class:"copied","data-code":e},children:[{type:"element",tagName:"svg",properties:{className:"octicon-copy",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"},children:[]},{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"},children:[]}]},{type:"element",tagName:"svg",properties:{className:"octicon-check",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"},children:[]}]}]}}var LR=(e,t)=>(n,r,o)=>{if(n.type==="element"&&o&&o.type==="root"&&/h(1|2|3|4|5|6)/.test(n.tagName)){var i=n.children&&n.children[0];i&&i.properties&&i.properties.ariaHidden==="true"&&(i.properties=Q({class:"anchor"},i.properties),i.children=[NR])}if(n.type==="element"&&n.tagName==="pre"&&!e){var s=i2(n.children);n.children.push(FR(s))}t&&t(n,r===null?void 0:r,o===null?void 0:o)},_R=[wR,PR,RR];const c2=W.forwardRef((e,t)=>{var n,r=[xR,vR,..._R,[mR,{rewrite:LR((n=e.disableCopy)!=null?n:!1,e.rehypeRewrite)}],[yR,{properties:"attr"}],...e.rehypePlugins||[]];return c.jsx(JM,Q({},e,{rehypePlugins:r,ref:t}))});function BR(e,t){return Q({},e,t)}var _s=W.createContext({markdown:""});function d2(e,t){return e===void 0&&(e=[]),t===void 0&&(t={}),e.forEach(n=>{n.children&&Array.isArray(n.children)?t=Q({},t,d2(n.children||[])):n.keyCommand&&n.shortcuts&&n.execute&&(t[n.shortcuts.toLocaleLowerCase()]=n)}),t}function f2(e,t,n,r,o){t===void 0&&(t=[]);var i=d2(t||[]),s=[];if(e.altKey&&s.push("alt"),e.shiftKey&&s.push("shift"),e.metaKey&&s.push("cmd"),e.ctrlKey&&s.push("ctrl"),s.length>0&&!/(control|alt|meta|shift)/.test(e.key.toLocaleLowerCase())&&s.push(e.key.toLocaleLowerCase()),/escape/.test(e.key.toLocaleLowerCase())&&s.push("escape"),!(s.length<1)){var a=!!i[s.join("+")],l=a?i[s.join("+")]:void 0;if(Object.keys(i).forEach(u=>{var d=u.split("+").every(f=>/ctrlcmd/.test(f)?s.includes("ctrl")||s.includes("cmd"):s.includes(f));d&&(l=i[u])}),l&&n){e.stopPropagation(),e.preventDefault(),n.executeCommand(l,r,o,s);return}}}var jd;function wg(e){if(e.nodeName!=="TEXTAREA")return!1;if(typeof jd>"u"){var t=document.createElement("textarea");t.value="1",jd=!!t.firstChild}return jd}function ps(e,t){if(e.focus(),document.selection){var n=document.selection.createRange();n.text=t,n.collapse(!1),n.select();return}var r=!1;if(t!==""?r=document.execCommand&&document.execCommand("insertText",!1,t):r=document.execCommand&&document.execCommand("delete",!1),!r){var o=e.selectionStart,i=e.selectionEnd;if(typeof e.setRangeText=="function")e.setRangeText(t);else{var s=document.createRange(),a=document.createTextNode(t);if(wg(e)){var l=e.firstChild;if(!l)e.appendChild(a);else{for(var u=0,d=null,f=null;l&&(d===null||f===null);){var h=l.nodeValue.length;o>=u&&o<=u+h&&s.setStart(d=l,o-u),i>=u&&i<=u+h&&s.setEnd(f=l,i-u),u+=h,l=l.nextSibling}o!==i&&s.deleteContents()}}if(wg(e)&&s.commonAncestorContainer.nodeName==="#text")s.insertNode(a);else{var p=e.value;e.value=p.slice(0,o)+t+p.slice(i)}}e.setSelectionRange(o+t.length,o+t.length);var m=document.createEvent("UIEvent");m.initEvent("input",!0,!1),e.dispatchEvent(m)}}function jn(e){var{text:t,selection:n,prefix:r,suffix:o=r}=e,i=n;if(t&&t.length&&n.start===n.end&&(i=jR(t,n.start)),i.start>=r.length&&i.end<=t.length-o.length){var s=t.slice(i.start-r.length,i.end+o.length);if(s.startsWith(r)&&s.endsWith(o))return{start:i.start-r.length,end:i.end+o.length}}return i}function Wa(e){var{text:t,selection:n}=e,r=t.slice(0,n.start).lastIndexOf(`
|
|
57
|
-
`)+1,o=t.slice(n.end).indexOf(`
|
|
58
|
-
`)+n.end;return o===n.end-1&&(o=t.length),{start:r,end:o}}function p2(e,t){if(e===void 0&&(e=""),t===0)return 0;for(var n=2,r=!0,o=t-1;o>=0&&n>=0;o--)switch(e.charCodeAt(o)){case 32:continue;case 10:n--,r=!1;break;default:return n}return r?0:n}function h2(e,t){if(e===void 0&&(e=""),t===e.length-1)return 0;for(var n=2,r=!0,o=t;o<e.length&&n>=0;o++)switch(e.charCodeAt(o)){case 32:continue;case 10:{n--,r=!1;break}default:return n}return r?0:n}function jR(e,t){if(!e)throw Error("Argument 'text' should be truthy");for(var n=a=>a===" "||a.charCodeAt(0)===10,r=0,o=e.length,i=t;i-1>-1;i--)if(n(e[i-1])){r=i;break}for(var s=t;s<e.length;s++)if(n(e[s])){o=s;break}return{start:r,end:o}}function kn(e){var{api:t,selectedText:n,selection:r,prefix:o,suffix:i=o}=e;n.length>=o.length+i.length&&n.startsWith(o)&&n.endsWith(i)?(t.replaceSelection(n.slice(o.length,i.length?-i.length:void 0)),t.setSelectionRange({start:r.start-o.length,end:r.end-o.length})):(t.replaceSelection(""+o+n+i),t.setSelectionRange({start:r.start+o.length,end:r.end+o.length}))}function Rp(e,t){var n=e.split(/\n/),r=0,o=n.map((i,s)=>{if(typeof t=="string")return i.startsWith(t)?(r-=t.length,i.slice(t.length)):(r+=t.length,t+i);if(typeof t=="function"){if(i.startsWith(t(i,s)))return r-=t(i,s).length,i.slice(t(i,s).length);var a=t(i,s);return r+=a.length,t(i,s)+i}throw Error("insertion is expected to be either a string or a function")}).join(`
|
|
59
|
-
`);return{modifiedText:o,insertionLength:r}}var $R={name:"bold",keyCommand:"bold",shortcuts:"ctrlcmd+b",prefix:"**",buttonProps:{"aria-label":"Add bold text (ctrl + b)",title:"Add bold text (ctrl + b)"},icon:c.jsx("svg",{role:"img",width:"12",height:"12",viewBox:"0 0 384 512",children:c.jsx("path",{fill:"currentColor",d:"M304.793 243.891c33.639-18.537 53.657-54.16 53.657-95.693 0-48.236-26.25-87.626-68.626-104.179C265.138 34.01 240.849 32 209.661 32H24c-8.837 0-16 7.163-16 16v33.049c0 8.837 7.163 16 16 16h33.113v318.53H24c-8.837 0-16 7.163-16 16V464c0 8.837 7.163 16 16 16h195.69c24.203 0 44.834-1.289 66.866-7.584C337.52 457.193 376 410.647 376 350.014c0-52.168-26.573-91.684-71.207-106.123zM142.217 100.809h67.444c16.294 0 27.536 2.019 37.525 6.717 15.828 8.479 24.906 26.502 24.906 49.446 0 35.029-20.32 56.79-53.029 56.79h-76.846V100.809zm112.642 305.475c-10.14 4.056-22.677 4.907-31.409 4.907h-81.233V281.943h84.367c39.645 0 63.057 25.38 63.057 63.057.001 28.425-13.66 52.483-34.782 61.284z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),r=t.setSelectionRange(n);kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix})}},m2={name:"codeBlock",keyCommand:"codeBlock",shortcuts:"ctrlcmd+shift+j",prefix:"```",buttonProps:{"aria-label":"Insert Code Block (ctrl + shift + j)",title:"Insert Code Block (ctrl + shift +j)"},icon:c.jsx("svg",{width:"13",height:"13",role:"img",viewBox:"0 0 156 156",children:c.jsx("path",{fill:"currentColor",d:"M110.85 120.575 43.7 120.483333 43.7083334 110.091667 110.85 110.191667 110.841667 120.583333 110.85 120.575ZM85.1333334 87.1916666 43.625 86.7083332 43.7083334 76.3166666 85.2083334 76.7916666 85.1333334 87.1916666 85.1333334 87.1916666ZM110.841667 53.4166666 43.7 53.3166666 43.7083334 42.925 110.85 43.025 110.841667 53.4166666ZM36 138C27.2916666 138 20.75 136.216667 16.4 132.666667 12.1333334 129.2 10 124.308333 10 118L10 95.3333332C10 91.0666666 9.25 88.1333332 7.7333334 86.5333332 6.3166668 84.8416666 3.7333334 84 0 84L0 72C3.7333334 72 6.3083334 71.2 7.7333334 69.6 9.2416668 67.9083334 10 64.9333334 10 60.6666666L10 38C10 31.775 12.1333334 26.8833334 16.4 23.3333332 20.7583334 19.7749998 27.2916666 18 36 18L40.6666668 18 40.6666668 30 36 30C34.0212222 29.9719277 32.1263151 30.7979128 30.8 32.2666666 29.3605875 33.8216362 28.5938182 35.8823287 28.6666668 38L28.6666668 60.6666666C28.6666668 67.5083332 26.6666668 72.4 22.6666668 75.3333332 20.9317416 76.7274684 18.8640675 77.6464347 16.6666668 78 18.8916668 78.35 20.8916668 79.2416666 22.6666668 80.6666666 26.6666668 83.95 28.6666668 88.8416666 28.6666668 95.3333332L28.6666668 118C28.6666668 120.308333 29.3750002 122.216667 30.8 123.733333 32.2166666 125.241667 33.9583334 126 36 126L40.6666668 126 40.6666668 138 36 138 36 138ZM114.116667 126 118.783333 126C120.833333 126 122.566667 125.241667 123.983333 123.733333 125.422746 122.178364 126.189515 120.117671 126.116667 118L126.116667 95.3333332C126.116667 88.8333332 128.116667 83.9499998 132.116667 80.6666666 133.9 79.2416666 135.9 78.35 138.116667 78 135.919156 77.6468047 133.851391 76.7277979 132.116667 75.3333332 128.116667 72.3999998 126.116667 67.5 126.116667 60.6666666L126.116667 38C126.189515 35.8823287 125.422746 33.8216361 123.983333 32.2666666 122.657018 30.7979128 120.762111 29.9719277 118.783333 30L114.116667 30 114.116667 18 118.783333 18C127.5 18 133.983333 19.775 138.25 23.3333332 142.608333 26.8833332 144.783333 31.7749998 144.783333 38L144.783333 60.6666666C144.783333 64.9333332 145.5 67.9083332 146.916667 69.6 148.433333 71.2 151.05 72 154.783333 72L154.783333 84C151.05 84 148.433333 84.8333334 146.916667 86.5333332 145.5 88.1333332 144.783333 91.0666666 144.783333 95.3333332L144.783333 118C144.783333 124.308333 142.616667 129.2 138.25 132.666667 133.983333 136.216667 127.5 138 118.783333 138L114.116667 138 114.116667 126 114.116667 126Z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:"```\n",suffix:"\n```"}),r=t.setSelectionRange(n),o="\n```\n",i="\n```\n";r.selectedText.length>=o.length+i.length-2&&r.selectedText.startsWith(o)&&r.selectedText.endsWith(i)?(o="```\n",i="\n```"):((r.selection.start>=1&&e.text.slice(r.selection.start-1,r.selection.start)===`
|
|
60
|
-
`||r.selection.start===0)&&(o="```\n"),(r.selection.end<=e.text.length-1&&e.text.slice(r.selection.end,r.selection.end+1)===`
|
|
61
|
-
`||r.selection.end===e.text.length)&&(i="\n```"));var s=jn({text:e.text,selection:e.selection,prefix:o,suffix:i}),a=t.setSelectionRange(s);kn({api:t,selectedText:a.selectedText,selection:e.selection,prefix:o,suffix:i})}},HR={name:"code",keyCommand:"code",shortcuts:"ctrlcmd+j",prefix:"`",buttonProps:{"aria-label":"Insert code (ctrl + j)",title:"Insert code (ctrl + j)"},icon:c.jsx("svg",{width:"14",height:"14",role:"img",viewBox:"0 0 640 512",children:c.jsx("path",{fill:"currentColor",d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"})}),execute:(e,t)=>{if(e.selectedText.indexOf(`
|
|
62
|
-
`)===-1){var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),r=t.setSelectionRange(n);kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix})}else m2.execute(e,t)}},zR={name:"comment",keyCommand:"comment",shortcuts:"ctrlcmd+/",prefix:"<!-- ",suffix:" -->",buttonProps:{"aria-label":"Insert comment (ctrl + /)",title:"Insert comment (ctrl + /)"},icon:c.jsx("svg",{height:"1em",width:"1em",viewBox:"0 0 25 25",children:c.jsxs("g",{fill:"none",fillRule:"evenodd",children:[c.jsx("polygon",{points:".769 .727 24.981 .727 24.981 24.727 .769 24.727"}),c.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M12.625,23.8787879 L8.125,19.6969697 L5.125,19.6969697 C2.63971863,19.6969697 0.625,17.8247059 0.625,15.5151515 L0.625,7.15151515 C0.625,4.84196074 2.63971863,2.96969697 5.125,2.96969697 L20.125,2.96969697 C22.6102814,2.96969697 24.625,4.84196074 24.625,7.15151515 L24.625,15.5151515 C24.625,17.8247059 22.6102814,19.6969697 20.125,19.6969697 L17.125,19.6969697 L12.625,23.8787879"}),c.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M10.625,8.54545455 L7.25,11.3333333 L10.625,14.1212121 M15.6875,8.54545455 L19.0625,11.3333333 L15.6875,14.1212121"})]})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}),r=t.setSelectionRange(n);kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix})}},xu={keyCommand:"divider"},UR={name:"fullscreen",keyCommand:"fullscreen",shortcuts:"ctrlcmd+0",value:"fullscreen",buttonProps:{"aria-label":"Toggle fullscreen (ctrl + 0)",title:"Toggle fullscreen (ctrl+ 0)"},icon:c.jsx("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:c.jsx("path",{fill:"currentColor",d:"M118 171.133334L118 342.200271C118 353.766938 126.675 365.333605 141.133333 365.333605L382.634614 365.333605C394.201281 365.333605 405.767948 356.658605 405.767948 342.200271L405.767948 171.133334C405.767948 159.566667 397.092948 148 382.634614 148L141.133333 148C126.674999 148 117.999999 156.675 118 171.133334zM465.353591 413.444444L370 413.444444 370 471.222222 474.0221 471.222222C500.027624 471.222222 520.254143 451 520.254143 425L520.254143 321 462.464089 321 462.464089 413.444444 465.353591 413.444444zM471.0221 43L367 43 367 100.777778 462.353591 100.777778 462.353591 196.111111 520.143647 196.111111 520.143647 89.2222219C517.254144 63.2222219 497.027624 43 471.0221 43zM57.7900547 100.777778L153.143646 100.777778 153.143646 43 46.2320439 43C20.2265191 43 0 63.2222219 0 89.2222219L0 193.222222 57.7900547 193.222222 57.7900547 100.777778zM57.7900547 321L0 321 0 425C0 451 20.2265191 471.222222 46.2320439 471.222223L150.254143 471.222223 150.254143 413.444445 57.7900547 413.444445 57.7900547 321z"})}),execute:(e,t,n,r,o)=>{t.textArea.focus(),o&&n&&r&&n({fullscreen:!r.fullscreen})}};function VR(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var WR=(e,t)=>{var n=Q({children:e,icon:c.jsx("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:c.jsx("path",{fill:"currentColor",d:"M15.7083333,468 C7.03242448,468 0,462.030833 0,454.666667 L0,421.333333 C0,413.969167 7.03242448,408 15.7083333,408 L361.291667,408 C369.967576,408 377,413.969167 377,421.333333 L377,454.666667 C377,462.030833 369.967576,468 361.291667,468 L15.7083333,468 Z M21.6666667,366 C9.69989583,366 0,359.831861 0,352.222222 L0,317.777778 C0,310.168139 9.69989583,304 21.6666667,304 L498.333333,304 C510.300104,304 520,310.168139 520,317.777778 L520,352.222222 C520,359.831861 510.300104,366 498.333333,366 L21.6666667,366 Z M136.835938,64 L136.835937,126 L107.25,126 L107.25,251 L40.75,251 L40.75,126 L-5.68434189e-14,126 L-5.68434189e-14,64 L136.835938,64 Z M212,64 L212,251 L161.648438,251 L161.648438,64 L212,64 Z M378,64 L378,126 L343.25,126 L343.25,251 L281.75,251 L281.75,126 L238,126 L238,64 L378,64 Z M449.047619,189.550781 L520,189.550781 L520,251 L405,251 L405,64 L449.047619,64 L449.047619,189.550781 Z"})}),execute:()=>{}},t,{keyCommand:"group"});return Array.isArray(n.children)&&(n.children=n.children.map(r=>{var o=Q({},(VR(r),r));return o.parent=n,Q({},o)})),n},qR={name:"hr",keyCommand:"hr",shortcuts:"ctrlcmd+h",prefix:`
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
`,suffix:"",buttonProps:{"aria-label":"Insert HR (ctrl + h)",title:"Insert HR (ctrl + h)"},icon:c.jsx("svg",{width:"12",height:"12",viewBox:"0 0 175 175",children:c.jsx("path",{fill:"currentColor",d:"M0,129 L175,129 L175,154 L0,154 L0,129 Z M3,9 L28.2158203,9 L28.2158203,47.9824219 L55.7695313,47.9824219 L55.7695313,9 L81.0966797,9 L81.0966797,107.185547 L55.7695313,107.185547 L55.7695313,68.0214844 L28.2158203,68.0214844 L28.2158203,107.185547 L3,107.185547 L3,9 Z M93.1855469,100.603516 L93.1855469,19 L135.211914,19 C143.004922,19 148.960917,19.6679621 153.080078,21.0039063 C157.199239,22.3398504 160.520495,24.8168764 163.043945,28.4350586 C165.567395,32.0532407 166.829102,36.459935 166.829102,41.6552734 C166.829102,46.1826398 165.864267,50.0883625 163.93457,53.3725586 C162.004873,56.6567547 159.351579,59.3193257 155.974609,61.3603516 C153.822255,62.6591862 150.872089,63.7353473 147.124023,64.5888672 C150.129898,65.5908253 152.319329,66.5927684 153.692383,67.5947266 C154.620122,68.2626987 155.965323,69.6913953 157.728027,71.8808594 C159.490731,74.0703234 160.668942,75.7587831 161.262695,76.9462891 L173,100.603516 L144.953125,100.603516 L131.482422,75.6660156 C129.775382,72.4374839 128.253913,70.3408251 126.917969,69.3759766 C125.0996,68.1142515 123.040051,67.4833984 120.739258,67.4833984 L118.512695,67.4833984 L118.512695,100.603516 L93.1855469,100.603516 Z M118.512695,52.0644531 L129.144531,52.0644531 C130.294928,52.0644531 132.521468,51.6933631 135.824219,50.9511719 C137.494149,50.6171858 138.857905,49.7636787 139.915527,48.390625 C140.97315,47.0175713 141.501953,45.4404386 141.501953,43.6591797 C141.501953,41.0244009 140.667001,39.0019602 138.99707,37.5917969 C137.32714,36.1816336 134.191429,35.4765625 129.589844,35.4765625 L117.512695,35.4765625 L118.512695,52.0644531 Z",transform:"translate(0 9)"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}),r=t.setSelectionRange(n);r.selectedText.length>=e.command.prefix.length&&r.selectedText.startsWith(e.command.prefix)?kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}):(r=t.setSelectionRange({start:e.selection.start,end:e.selection.start}),kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}))}},YR={name:"image",keyCommand:"image",shortcuts:"ctrlcmd+k",prefix:"",buttonProps:{"aria-label":"Add image (ctrl + k)",title:"Add image (ctrl + k)"},icon:c.jsx("svg",{width:"13",height:"13",viewBox:"0 0 20 20",children:c.jsx("path",{fill:"currentColor",d:"M15 9c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm4-7H1c-.55 0-1 .45-1 1v14c0 .55.45 1 1 1h18c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 13l-6-5-2 2-4-5-4 8V4h16v11z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}),r=t.setSelectionRange(n);r.selectedText.includes("http")||r.selectedText.includes("www")?kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}):(n=jn({text:e.text,selection:e.selection,prefix:"![",suffix:"]()"}),r=t.setSelectionRange(n),r.selectedText.length===0?kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:""}):kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:"![",suffix:"]()"}))}},KR={name:"italic",keyCommand:"italic",shortcuts:"ctrlcmd+i",prefix:"*",buttonProps:{"aria-label":"Add italic text (ctrl + i)",title:"Add italic text (ctrl + i)"},icon:c.jsx("svg",{"data-name":"italic",width:"12",height:"12",role:"img",viewBox:"0 0 320 512",children:c.jsx("path",{fill:"currentColor",d:"M204.758 416h-33.849l62.092-320h40.725a16 16 0 0 0 15.704-12.937l6.242-32C297.599 41.184 290.034 32 279.968 32H120.235a16 16 0 0 0-15.704 12.937l-6.242 32C96.362 86.816 103.927 96 113.993 96h33.846l-62.09 320H46.278a16 16 0 0 0-15.704 12.935l-6.245 32C22.402 470.815 29.967 480 40.034 480h158.479a16 16 0 0 0 15.704-12.935l6.245-32c1.927-9.88-5.638-19.065-15.704-19.065z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),r=t.setSelectionRange(n);kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix})}},GR={name:"link",keyCommand:"link",shortcuts:"ctrlcmd+l",prefix:"[",suffix:"](url)",buttonProps:{"aria-label":"Add a link (ctrl + l)",title:"Add a link (ctrl + l)"},icon:c.jsx("svg",{"data-name":"italic",width:"12",height:"12",role:"img",viewBox:"0 0 520 520",children:c.jsx("path",{fill:"currentColor",d:"M331.751196,182.121107 C392.438214,241.974735 391.605313,337.935283 332.11686,396.871226 C332.005129,396.991316 331.873084,397.121413 331.751196,397.241503 L263.493918,464.491645 C203.291404,523.80587 105.345257,523.797864 45.151885,464.491645 C-15.0506283,405.187427 -15.0506283,308.675467 45.151885,249.371249 L82.8416853,212.237562 C92.836501,202.39022 110.049118,208.9351 110.56511,222.851476 C111.223305,240.5867 114.451306,258.404985 120.407566,275.611815 C122.424812,281.438159 120.983487,287.882964 116.565047,292.23621 L103.272145,305.332975 C74.8052033,333.379887 73.9123737,379.047937 102.098973,407.369054 C130.563883,435.969378 177.350591,436.139505 206.033884,407.879434 L274.291163,340.6393 C302.9257,312.427264 302.805844,266.827265 274.291163,238.733318 C270.531934,235.036561 266.74528,232.16442 263.787465,230.157924 C259.544542,227.2873 256.928256,222.609848 256.731165,217.542518 C256.328935,206.967633 260.13184,196.070508 268.613213,187.714278 L289.998463,166.643567 C295.606326,161.118448 304.403592,160.439942 310.906317,164.911276 C318.353355,170.034591 325.328531,175.793397 331.751196,182.121107 Z M240.704978,55.4828366 L172.447607,122.733236 C172.325719,122.853326 172.193674,122.983423 172.081943,123.103513 C117.703294,179.334654 129.953294,261.569283 185.365841,328.828764 C191.044403,335.721376 198.762988,340.914712 206.209732,346.037661 C212.712465,350.509012 221.510759,349.829503 227.117615,344.305363 L248.502893,323.234572 C256.984277,314.87831 260.787188,303.981143 260.384957,293.406218 C260.187865,288.338869 257.571576,283.661398 253.328648,280.790763 C250.370829,278.78426 246.58417,275.912107 242.824936,272.215337 C214.310216,244.121282 206.209732,204.825874 229.906702,179.334654 L298.164073,112.094263 C326.847404,83.8340838 373.633159,84.0042113 402.099123,112.604645 C430.285761,140.92587 429.393946,186.594095 400.92595,214.641114 L387.63303,227.737929 C383.214584,232.091191 381.773257,238.536021 383.790506,244.362388 C389.746774,261.569283 392.974779,279.387637 393.632975,297.122928 C394.149984,311.039357 411.361608,317.584262 421.356437,307.736882 L459.046288,270.603053 C519.249898,211.29961 519.249898,114.787281 459.047304,55.4828366 C398.853851,-3.82360914 300.907572,-3.83161514 240.704978,55.4828366 Z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}),r=t.setSelectionRange(n);r.selectedText.includes("http")||r.selectedText.includes("www")?(n=jn({text:e.text,selection:e.selection,prefix:"[](",suffix:")"}),r=t.setSelectionRange(n),kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:"[](",suffix:")"})):r.selectedText.length===0?kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:"[title",suffix:"](url)"}):kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix})}},Np=(e,t,n)=>{var r=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),o=t.setSelectionRange(r),i=p2(o.text,o.selection.start),s=Array(i+1).join(`
|
|
66
|
-
`),a=h2(o.text,o.selection.end),l=Array(a+1).join(`
|
|
67
|
-
`),{modifiedText:u,insertionLength:d}=Rp(o.selectedText,n);if(d<0){var f=o.selection.start,h=o.selection.end;o.selection.start>0&&e.text.slice(o.selection.start-1,o.selection.start)===`
|
|
68
|
-
`&&(f-=1),o.selection.end<e.text.length-1&&e.text.slice(o.selection.end,o.selection.end+1)===`
|
|
69
|
-
`&&(h+=1),t.setSelectionRange({start:f,end:h}),t.replaceSelection(""+u),t.setSelectionRange({start:f,end:f+u.length})}else{t.replaceSelection(""+s+u+l);var p=o.selection.start+i,m=p+u.length;t.setSelectionRange({start:p,end:m})}},QR={name:"unordered-list",keyCommand:"list",shortcuts:"ctrl+shift+u",prefix:"- ",buttonProps:{"aria-label":"Add unordered list (ctrl + shift + u)",title:"Add unordered list (ctrl + shift + u)"},icon:c.jsx("svg",{"data-name":"unordered-list",width:"12",height:"12",viewBox:"0 0 512 512",children:c.jsx("path",{fill:"currentColor",d:"M96 96c0 26.51-21.49 48-48 48S0 122.51 0 96s21.49-48 48-48 48 21.49 48 48zM48 208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm0 160c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm96-236h352c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"})}),execute:(e,t)=>{Np(e,t,"- ")}},XR={name:"ordered-list",keyCommand:"list",shortcuts:"ctrl+shift+o",prefix:"1. ",buttonProps:{"aria-label":"Add ordered list (ctrl + shift + o)",title:"Add ordered list (ctrl + shift + o)"},icon:c.jsx("svg",{"data-name":"ordered-list",width:"12",height:"12",role:"img",viewBox:"0 0 512 512",children:c.jsx("path",{fill:"currentColor",d:"M3.263 139.527c0-7.477 3.917-11.572 11.573-11.572h15.131V88.078c0-5.163.534-10.503.534-10.503h-.356s-1.779 2.67-2.848 3.738c-4.451 4.273-10.504 4.451-15.666-1.068l-5.518-6.231c-5.342-5.341-4.984-11.216.534-16.379l21.72-19.938C32.815 33.602 36.732 32 42.785 32H54.89c7.656 0 11.749 3.916 11.749 11.572v84.384h15.488c7.655 0 11.572 4.094 11.572 11.572v8.901c0 7.477-3.917 11.572-11.572 11.572H14.836c-7.656 0-11.573-4.095-11.573-11.572v-8.902zM2.211 304.591c0-47.278 50.955-56.383 50.955-69.165 0-7.18-5.954-8.755-9.28-8.755-3.153 0-6.479 1.051-9.455 3.852-5.079 4.903-10.507 7.004-16.111 2.451l-8.579-6.829c-5.779-4.553-7.18-9.805-2.803-15.409C13.592 201.981 26.025 192 47.387 192c19.437 0 44.476 10.506 44.476 39.573 0 38.347-46.753 46.402-48.679 56.909h39.049c7.529 0 11.557 4.027 11.557 11.382v8.755c0 7.354-4.028 11.382-11.557 11.382h-67.94c-7.005 0-12.083-4.028-12.083-11.382v-4.028zM5.654 454.61l5.603-9.28c3.853-6.654 9.105-7.004 15.584-3.152 4.903 2.101 9.63 3.152 14.359 3.152 10.155 0 14.358-3.502 14.358-8.23 0-6.654-5.604-9.106-15.934-9.106h-4.728c-5.954 0-9.28-2.101-12.258-7.88l-1.05-1.926c-2.451-4.728-1.226-9.806 2.801-14.884l5.604-7.004c6.829-8.405 12.257-13.483 12.257-13.483v-.35s-4.203 1.051-12.608 1.051H16.685c-7.53 0-11.383-4.028-11.383-11.382v-8.755c0-7.53 3.853-11.382 11.383-11.382h58.484c7.529 0 11.382 4.027 11.382 11.382v3.327c0 5.778-1.401 9.806-5.079 14.183l-17.509 20.137c19.611 5.078 28.716 20.487 28.716 34.845 0 21.363-14.358 44.126-48.503 44.126-16.636 0-28.192-4.728-35.896-9.455-5.779-4.202-6.304-9.805-2.626-15.934zM144 132h352c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"})}),execute:(e,t)=>{Np(e,t,(n,r)=>r+1+". ")}},ZR={name:"checked-list",keyCommand:"list",shortcuts:"ctrl+shift+c",prefix:"- [ ] ",buttonProps:{"aria-label":"Add checked list (ctrl + shift + c)",title:"Add checked list (ctrl + shift + c)"},icon:c.jsx("svg",{"data-name":"checked-list",width:"12",height:"12",role:"img",viewBox:"0 0 512 512",children:c.jsx("path",{fill:"currentColor",d:"M208 132h288c8.8 0 16-7.2 16-16V76c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16zm0 160h288c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16zm0 160h288c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16zM64 368c-26.5 0-48.6 21.5-48.6 48s22.1 48 48.6 48 48-21.5 48-48-21.5-48-48-48zm92.5-299l-72.2 72.2-15.6 15.6c-4.7 4.7-12.9 4.7-17.6 0L3.5 109.4c-4.7-4.7-4.7-12.3 0-17l15.7-15.7c4.7-4.7 12.3-4.7 17 0l22.7 22.1 63.7-63.3c4.7-4.7 12.3-4.7 17 0l17 16.5c4.6 4.7 4.6 12.3-.1 17zm0 159.6l-72.2 72.2-15.7 15.7c-4.7 4.7-12.9 4.7-17.6 0L3.5 269c-4.7-4.7-4.7-12.3 0-17l15.7-15.7c4.7-4.7 12.3-4.7 17 0l22.7 22.1 63.7-63.7c4.7-4.7 12.3-4.7 17 0l17 17c4.6 4.6 4.6 12.2-.1 16.9z"})}),execute:(e,t)=>{Np(e,t,(n,r)=>"- [ ] ")}},JR={name:"preview",keyCommand:"preview",value:"preview",shortcuts:"ctrlcmd+9",buttonProps:{"aria-label":"Preview code (ctrl + 9)",title:"Preview code (ctrl + 9)"},icon:c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[c.jsx("polygon",{fill:"currentColor",points:"0 71.293 0 122 38.023 123 38.023 398 0 397 0 449.707 91.023 450.413 91.023 72.293"}),c.jsx("polygon",{fill:"currentColor",points:"148.023 72.293 520 71.293 520 122 200.023 124 200.023 397 520 396 520 449.707 148.023 450.413"})]}),execute:(e,t,n,r,o)=>{t.textArea.focus(),o&&n&&r&&n({preview:"preview"})}},eN={name:"edit",keyCommand:"preview",value:"edit",shortcuts:"ctrlcmd+7",buttonProps:{"aria-label":"Edit code (ctrl + 7)",title:"Edit code (ctrl + 7)"},icon:c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[c.jsx("polygon",{fill:"currentColor",points:"0 71.293 0 122 319 122 319 397 0 397 0 449.707 372 449.413 372 71.293"}),c.jsx("polygon",{fill:"currentColor",points:"429 71.293 520 71.293 520 122 481 123 481 396 520 396 520 449.707 429 449.413"})]}),execute:(e,t,n,r,o)=>{t.textArea.focus(),o&&n&&r&&n({preview:"edit"})}},tN={name:"live",keyCommand:"preview",value:"live",shortcuts:"ctrlcmd+8",buttonProps:{"aria-label":"Live code (ctrl + 8)",title:"Live code (ctrl + 8)"},icon:c.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[c.jsx("polygon",{fill:"currentColor",points:"0 71.293 0 122 179 122 179 397 0 397 0 449.707 232 449.413 232 71.293"}),c.jsx("polygon",{fill:"currentColor",points:"289 71.293 520 71.293 520 122 341 123 341 396 520 396 520 449.707 289 449.413"})]}),execute:(e,t,n,r,o)=>{t.textArea.focus(),o&&n&&r&&n({preview:"live"})}},nN={name:"quote",keyCommand:"quote",shortcuts:"ctrlcmd+q",prefix:"> ",buttonProps:{"aria-label":"Insert a quote (ctrl + q)",title:"Insert a quote (ctrl + q)"},icon:c.jsx("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:c.jsx("path",{fill:"currentColor",d:"M520,95.75 L520,225.75 C520,364.908906 457.127578,437.050625 325.040469,472.443125 C309.577578,476.586875 294.396016,464.889922 294.396016,448.881641 L294.396016,414.457031 C294.396016,404.242891 300.721328,395.025078 310.328125,391.554687 C377.356328,367.342187 414.375,349.711094 414.375,274.5 L341.25,274.5 C314.325781,274.5 292.5,252.674219 292.5,225.75 L292.5,95.75 C292.5,68.8257812 314.325781,47 341.25,47 L471.25,47 C498.174219,47 520,68.8257812 520,95.75 Z M178.75,47 L48.75,47 C21.8257813,47 0,68.8257812 0,95.75 L0,225.75 C0,252.674219 21.8257813,274.5 48.75,274.5 L121.875,274.5 C121.875,349.711094 84.8563281,367.342187 17.828125,391.554687 C8.22132813,395.025078 1.89601563,404.242891 1.89601563,414.457031 L1.89601563,448.881641 C1.89601563,464.889922 17.0775781,476.586875 32.5404687,472.443125 C164.627578,437.050625 227.5,364.908906 227.5,225.75 L227.5,95.75 C227.5,68.8257812 205.674219,47 178.75,47 Z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),r=t.setSelectionRange(n),o=p2(r.text,r.selection.start),i=Array(o+1).join(`
|
|
70
|
-
`),s=h2(r.text,r.selection.end),a=Array(s+1).join(`
|
|
71
|
-
`),l=Rp(r.selectedText,e.command.prefix);t.replaceSelection(""+i+l.modifiedText+a);var u=r.selection.start+o,d=u+l.modifiedText.length;t.setSelectionRange({start:u,end:d})}},rN={name:"strikethrough",keyCommand:"strikethrough",shortcuts:"ctrl+shift+x",buttonProps:{"aria-label":"Add strikethrough text (ctrl + shift + x)",title:"Add strikethrough text (ctrl + shift + x)"},prefix:"~~",icon:c.jsx("svg",{"data-name":"strikethrough",width:"12",height:"12",role:"img",viewBox:"0 0 512 512",children:c.jsx("path",{fill:"currentColor",d:"M496 288H16c-8.837 0-16-7.163-16-16v-32c0-8.837 7.163-16 16-16h480c8.837 0 16 7.163 16 16v32c0 8.837-7.163 16-16 16zm-214.666 16c27.258 12.937 46.524 28.683 46.524 56.243 0 33.108-28.977 53.676-75.621 53.676-32.325 0-76.874-12.08-76.874-44.271V368c0-8.837-7.164-16-16-16H113.75c-8.836 0-16 7.163-16 16v19.204c0 66.845 77.717 101.82 154.487 101.82 88.578 0 162.013-45.438 162.013-134.424 0-19.815-3.618-36.417-10.143-50.6H281.334zm-30.952-96c-32.422-13.505-56.836-28.946-56.836-59.683 0-33.92 30.901-47.406 64.962-47.406 42.647 0 64.962 16.593 64.962 32.985V136c0 8.837 7.164 16 16 16h45.613c8.836 0 16-7.163 16-16v-30.318c0-52.438-71.725-79.875-142.575-79.875-85.203 0-150.726 40.972-150.726 125.646 0 22.71 4.665 41.176 12.777 56.547h129.823z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix}),r=t.setSelectionRange(n);kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix})}},g2={name:"heading1",keyCommand:"heading1",shortcuts:"ctrlcmd+1",prefix:"# ",suffix:"",buttonProps:{"aria-label":"Insert Heading 1 (ctrl + 1)",title:"Insert Heading 1 (ctrl + 1)"},icon:c.jsx("div",{style:{fontSize:18,textAlign:"left"},children:"Heading 1"}),execute:(e,t)=>{Bs({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},oN=g2;function Bs(e){var{state:t,api:n,prefix:r,suffix:o=r}=e,i=Wa({text:t.text,selection:t.selection}),s=n.setSelectionRange(i);kn({api:n,selectedText:s.selectedText,selection:t.selection,prefix:r,suffix:o})}Q({},g2,{icon:c.jsx("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:c.jsx("path",{fill:"currentColor",d:"M15.7083333,468 C7.03242448,468 0,462.030833 0,454.666667 L0,421.333333 C0,413.969167 7.03242448,408 15.7083333,408 L361.291667,408 C369.967576,408 377,413.969167 377,421.333333 L377,454.666667 C377,462.030833 369.967576,468 361.291667,468 L15.7083333,468 Z M21.6666667,366 C9.69989583,366 0,359.831861 0,352.222222 L0,317.777778 C0,310.168139 9.69989583,304 21.6666667,304 L498.333333,304 C510.300104,304 520,310.168139 520,317.777778 L520,352.222222 C520,359.831861 510.300104,366 498.333333,366 L21.6666667,366 Z M136.835938,64 L136.835937,126 L107.25,126 L107.25,251 L40.75,251 L40.75,126 L-5.68434189e-14,126 L-5.68434189e-14,64 L136.835938,64 Z M212,64 L212,251 L161.648438,251 L161.648438,64 L212,64 Z M378,64 L378,126 L343.25,126 L343.25,251 L281.75,251 L281.75,126 L238,126 L238,64 L378,64 Z M449.047619,189.550781 L520,189.550781 L520,251 L405,251 L405,64 L449.047619,64 L449.047619,189.550781 Z"})})});var iN={name:"heading2",keyCommand:"heading2",shortcuts:"ctrlcmd+2",prefix:"## ",suffix:"",buttonProps:{"aria-label":"Insert Heading 2 (ctrl + 2)",title:"Insert Heading 2 (ctrl + 2)"},icon:c.jsx("div",{style:{fontSize:16,textAlign:"left"},children:"Heading 2"}),execute:(e,t)=>{Bs({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},sN=iN,aN={name:"heading3",keyCommand:"heading3",shortcuts:"ctrlcmd+3",prefix:"### ",suffix:"",buttonProps:{"aria-label":"Insert Heading 3 (ctrl + 3)",title:"Insert Heading 3 (ctrl + 3)"},icon:c.jsx("div",{style:{fontSize:15,textAlign:"left"},children:"Heading 3"}),execute:(e,t)=>{Bs({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},lN=aN,uN={name:"heading4",keyCommand:"heading4",shortcuts:"ctrlcmd+4",prefix:"#### ",suffix:"",buttonProps:{"aria-label":"Insert Heading 4 (ctrl + 4)",title:"Insert Heading 4 (ctrl + 4)"},icon:c.jsx("div",{style:{fontSize:14,textAlign:"left"},children:"Heading 4"}),execute:(e,t)=>{Bs({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},cN=uN,dN={name:"heading5",keyCommand:"heading5",shortcuts:"ctrlcmd+5",prefix:"##### ",suffix:"",buttonProps:{"aria-label":"Insert Heading 5 (ctrl + 5)",title:"Insert Heading 5 (ctrl + 5)"},icon:c.jsx("div",{style:{fontSize:12,textAlign:"left"},children:"Heading 5"}),execute:(e,t)=>{Bs({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},fN=dN,pN={name:"heading6",keyCommand:"heading6",shortcuts:"ctrlcmd+6",prefix:"###### ",suffix:"",buttonProps:{"aria-label":"Insert Heading 6 (ctrl + 6)",title:"Insert Heading 6 (ctrl + 6)"},icon:c.jsx("div",{style:{fontSize:12,textAlign:"left"},children:"Heading 6"}),execute:(e,t)=>{Bs({state:e,api:t,prefix:e.command.prefix,suffix:e.command.suffix})}},hN=pN,mN={name:"table",keyCommand:"table",prefix:`
|
|
72
|
-
| Header | Header |
|
|
73
|
-
|--------|--------|
|
|
74
|
-
| Cell | Cell |
|
|
75
|
-
| Cell | Cell |
|
|
76
|
-
| Cell | Cell |
|
|
77
|
-
|
|
78
|
-
`,suffix:"",buttonProps:{"aria-label":"Add table",title:"Add table"},icon:c.jsx("svg",{role:"img",width:"12",height:"12",viewBox:"0 0 512 512",children:c.jsx("path",{fill:"currentColor",d:"M64 256V160H224v96H64zm0 64H224v96H64V320zm224 96V320H448v96H288zM448 256H288V160H448v96zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"})}),execute:(e,t)=>{var n=jn({text:e.text,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}),r=t.setSelectionRange(n);r.selectedText.length>=e.command.prefix.length+e.command.suffix.length&&r.selectedText.startsWith(e.command.prefix)?kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}):(r=t.setSelectionRange({start:e.selection.start,end:e.selection.start}),kn({api:t,selectedText:r.selectedText,selection:e.selection,prefix:e.command.prefix,suffix:e.command.suffix}))}},gN={name:"help",keyCommand:"help",buttonProps:{"aria-label":"Open help",title:"Open help"},icon:c.jsx("svg",{viewBox:"0 0 16 16",width:"12px",height:"12px",children:c.jsx("path",{d:"M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm.9 13H7v-1.8h1.9V13Zm-.1-3.6v.5H7.1v-.6c.2-2.1 2-1.9 1.9-3.2.1-.7-.3-1.1-1-1.1-.8 0-1.2.7-1.2 1.6H5c0-1.7 1.2-3 2.9-3 2.3 0 3 1.4 3 2.3.1 2.3-1.9 2-2.1 3.5Z",fill:"currentColor"})}),execute:()=>{window.open("https://www.markdownguide.org/basic-syntax/","_blank","noreferrer")}},bN=()=>[$R,KR,rN,qR,WR([oN,sN,lN,cN,fN,hN],{name:"title",groupName:"title",buttonProps:{"aria-label":"Insert title",title:"Insert title"}}),xu,GR,nN,HR,m2,zR,YR,mN,xu,QR,XR,ZR,xu,gN],yN=()=>[eN,tN,JR,xu,UR];function Ku(e){var t;return{selection:{start:e.selectionStart,end:e.selectionEnd},text:e.value,selectedText:(t=e.value)==null?void 0:t.slice(e.selectionStart,e.selectionEnd)}}class Fp{constructor(t){this.textArea=void 0,this.textArea=t}replaceSelection(t){return ps(this.textArea,t),Ku(this.textArea)}setSelectionRange(t){return this.textArea.focus(),this.textArea.selectionStart=t.start,this.textArea.selectionEnd=t.end,Ku(this.textArea)}}class Lp{constructor(t){this.textArea=void 0,this.textApi=void 0,this.textArea=t,this.textApi=new Fp(t)}getState(){return this.textArea?Ku(this.textArea):!1}executeCommand(t,n,r,o){t.execute&&t.execute(Q({command:t},Ku(this.textArea)),this.textApi,n,r,o)}}function vu(e){e.stopPropagation(),e.preventDefault()}function Dg(e,t){vu(e);var n=e.target,r=new Fp(n),o={start:n.selectionStart,end:n.selectionEnd};if(o=Wa({text:n.value,selection:o}),!(t<0&&o.start<=0||t>0&&o.end>=n.value.length)){var i=n.value.slice(o.start,o.end);if(t<0){var s=Wa({text:n.value,selection:{start:o.start-1,end:o.start-1}}),a=n.value.slice(s.start,s.end);r.setSelectionRange({start:s.start,end:o.end}),ps(n,i+`
|
|
79
|
-
`+a),r.setSelectionRange({start:s.start,end:s.start+i.length})}else{var l=Wa({text:n.value,selection:{start:o.end+1,end:o.end+1}}),u=n.value.slice(l.start,l.end);r.setSelectionRange({start:o.start,end:l.end}),ps(n,u+`
|
|
80
|
-
`+i),r.setSelectionRange({start:l.end-i.length,end:l.end})}}}function xN(e,t,n){t===void 0&&(t=2),n===void 0&&(n=!1);var r=e.target,o=r.value.substr(0,r.selectionStart),i=o.split(`
|
|
81
|
-
`),s=i[i.length-1],a=new Fp(r);if(!n&&e.code&&e.code.toLowerCase()==="tab"){vu(e);var l=new Array(t+1).join(" ");if(r.selectionStart!==r.selectionEnd){var u=r.value.substring(0,r.selectionStart).split(`
|
|
82
|
-
`),d=r.value.substring(0,r.selectionEnd).split(`
|
|
83
|
-
`),f=[];d.forEach((_,O)=>{_!==u[O]&&f.push(_)});var h=f.join(`
|
|
84
|
-
`),p=r.value.substring(r.selectionStart,r.selectionEnd),m=r.value.substring(0,r.selectionStart).length;a.setSelectionRange({start:r.value.indexOf(h),end:r.selectionEnd});var b=Rp(h,e.shiftKey?"":l),y=b.modifiedText;e.shiftKey&&(y=y.split(`
|
|
85
|
-
`).map(_=>_.replace(new RegExp("^"+l),"")).join(`
|
|
86
|
-
`)),a.replaceSelection(y);var x=e.shiftKey?-t:t,C=e.shiftKey?-f.length*t:f.length*t;a.setSelectionRange({start:m+x,end:m+p.length+C})}else return ps(r,l)}else if(e.keyCode===13&&e.code.toLowerCase()==="enter"&&(/^(-|\*)\s/.test(s)||/^\d+.\s/.test(s))&&!e.shiftKey){vu(e);var E=`
|
|
87
|
-
- `;return s.startsWith("*")&&(E=`
|
|
88
|
-
* `),(s.startsWith("- [ ]")||s.startsWith("- [X]")||s.startsWith("- [x]"))&&(E=`
|
|
89
|
-
- [ ] `),/^\d+.\s/.test(s)&&(E=`
|
|
90
|
-
`+(parseInt(s)+1)+". "),ps(r,E)}else if(e.code&&e.code.toLowerCase()==="keyd"&&e.ctrlKey){vu(e);var T={start:r.selectionStart,end:r.selectionEnd},I=T;T=Wa({text:r.value,selection:T});var D=r.value.slice(T.start,T.end);a.setSelectionRange({start:T.end,end:T.end}),ps(r,`
|
|
91
|
-
`+D),a.setSelectionRange({start:I.start,end:I.end})}else e.code&&e.code.toLowerCase()==="arrowup"&&e.altKey?Dg(e,-1):e.code&&e.code.toLowerCase()==="arrowdown"&&e.altKey&&Dg(e,1)}var vN=["prefixCls","onChange"],CN=["markdown","commands","fullscreen","preview","highlightEnable","extraCommands","tabSize","defaultTabEnable","autoFocusEnd","textareaWarp","dispatch"];function EN(e){var{prefixCls:t,onChange:n}=e,r=et(e,vN),o=W.useContext(_s),{markdown:i,commands:s,fullscreen:a,preview:l,highlightEnable:u,extraCommands:d,tabSize:f,defaultTabEnable:h,autoFocusEnd:p,textareaWarp:m,dispatch:b}=o;et(o,CN);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 T=new Lp(y.current);x.current=T,b({textarea:y.current,commandOrchestrator:T})}},[]),W.useEffect(()=>{if(p&&y.current&&m){y.current.focus();var T=y.current.value.length;y.current.setSelectionRange(T,T),setTimeout(()=>{m&&(m.scrollTop=m.scrollHeight),y.current&&(y.current.scrollTop=y.current.scrollHeight)},0)}},[m]);var E=T=>{xN(T,f,h),f2(T,[...s||[],...d||[]],x.current,b,C.current)};return W.useEffect(()=>(y.current&&y.current.addEventListener("keydown",E),()=>{y.current&&y.current.removeEventListener("keydown",E)}),[]),c.jsx("textarea",Q({autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1},r,{ref:y,className:t+"-text-input "+(r.className?r.className:""),value:i,onChange:T=>{b&&b({markdown:T.target.value}),n&&n(T)}}))}var TN=["prefixCls","className","onScroll","renderTextarea"];function SN(e){var t=e||{},{prefixCls:n,className:r,onScroll:o,renderTextarea:i}=t,s=et(t,TN),{markdown:a,scrollTop:l,commands:u,extraCommands:d,dispatch:f}=W.useContext(_s),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(Q({},y))},[]),W.useEffect(()=>{if(h.current&&f){var y=new Lp(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(Q({},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:f2,useContext:{commands:u,extraCommands:d,commandOrchestrator:p.current}}),{ref:h}):c.jsx(W.Fragment,{children:c.jsx(EN,Q({prefixCls:n},s,{style:b}))})})})}function kN(e){var{prefixCls:t,groupName:n,commands:r,children:o}=e||{},{barPopup:i={}}=W.useContext(_s);return W.useMemo(()=>c.jsx("div",{className:t+"-toolbar-child "+(n&&i[n]?"active":""),onClick:s=>s.stopPropagation(),children:Array.isArray(r)?c.jsx(b2,Q({commands:r},e,{isChild:!0})):o}),[r,i,n,t])}function Ig(e){var{prefixCls:t,overflow:n}=e,{fullscreen:r,preview:o,barPopup:i={},components:s,commandOrchestrator:a,dispatch:l}=W.useContext(_s),u=W.useRef("");function d(f,h){if(l){var p={barPopup:Q({},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(Q({},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",Q({},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",Q({},f.liProps,{className:p?"active":"",children:[x&&W.isValidElement(x)&&x,!x&&!f.buttonProps&&f.icon,!x&&f.buttonProps&&W.createElement("button",Q({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(kN,{overflow:n,groupName:f.groupName,prefixCls:t,children:m,commands:Array.isArray(f.children)?f.children:void 0})]}),h)})})}function b2(e){e===void 0&&(e={});var{prefixCls:t,isChild:n,className:r}=e,{commands:o,extraCommands:i}=W.useContext(_s);return c.jsxs("div",{className:t+"-toolbar "+r,children:[c.jsx(Ig,Q({},e,{commands:e.commands||o||[]})),!n&&c.jsx(Ig,Q({},e,{commands:i||[]}))]})}function Ag(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(b2,{prefixCls:i,overflow:o,className:s})}var wN=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})},DN=["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 IN(e){return e===void 0&&(e={}),Object.keys(e).forEach(t=>{e[t]=!1}),e}var AN=W.forwardRef((e,t)=>{var n=e||{},{prefixCls:r="w-md-editor",className:o,value:i,commands:s=bN(),commandsFilter:a,direction:l,extraCommands:u=yN(),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:E=1200,minHeight:T=100,autoFocus:I,autoFocusEnd:D=!1,tabSize:_=2,defaultTabEnable:O=!1,onChange:B,onStatistics:L,onHeightChange:j,hideToolbar:S,toolbarBottom:$=!1,components:F,renderTextarea:R}=n,H=et(n,DN),V=s.map(Se=>a?a(Se,!1):Se).filter(Boolean),Y=u.map(Se=>a?a(Se,!0):Se).filter(Boolean),[q,P]=W.useReducer(BR,{markdown:i,preview:m,components:F,height:d,minHeight:T,highlightEnable:p,tabSize:_,defaultTabEnable:O,scrollTop:0,scrollTopPreview:0,commands:V,extraCommands:Y,fullscreen:b,barPopup:{}}),J=W.useRef(null),re=W.useRef(null),z=W.useRef(f);W.useImperativeHandle(t,()=>Q({},q,{container:J.current,dispatch:P})),W.useMemo(()=>z.current=f,[f]),W.useEffect(()=>{var Se={};J.current&&(Se.container=J.current||void 0),Se.markdown=i||"",Se.barPopup={},P&&P(Q({},q,Se))},[]);var ye=[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&&P({markdown:i||""}),[i,q.markdown]),W.useMemo(()=>m!==q.preview&&P({preview:m}),[m]),W.useMemo(()=>_!==q.tabSize&&P({tabSize:_}),[_]),W.useMemo(()=>p!==q.highlightEnable&&P({highlightEnable:p}),[p]),W.useMemo(()=>I!==q.autoFocus&&P({autoFocus:I}),[I]),W.useMemo(()=>D!==q.autoFocusEnd&&P({autoFocusEnd:D}),[D]),W.useMemo(()=>b!==q.fullscreen&&P({fullscreen:b}),[b]),W.useMemo(()=>d!==q.height&&P({height:d}),[d]),W.useMemo(()=>d!==q.height&&j&&j(q.height,d,q),[d,j,q]),W.useMemo(()=>s!==q.commands&&P({commands:V}),[e.commands]),W.useMemo(()=>u!==q.extraCommands&&P({extraCommands:Y}),[e.extraCommands]);var se=W.useRef(),G=W.useRef("preview"),le=W.useRef(!1);W.useMemo(()=>{se.current=q.textareaWarp,q.textareaWarp&&(q.textareaWarp.addEventListener("mouseover",()=>{G.current="text"}),q.textareaWarp.addEventListener("mouseleave",()=>{G.current="preview"}))},[q.textareaWarp]);var oe=(Se,he)=>{if(z.current){var $e=se.current,Pe=re.current?re.current:void 0;if(le.current||(G.current=he,le.current=!0),$e&&Pe){var Je=($e.scrollHeight-$e.offsetHeight)/(Pe.scrollHeight-Pe.offsetHeight);Se.target===$e&&G.current==="text"&&(Pe.scrollTop=$e.scrollTop/Je),Se.target===Pe&&G.current==="preview"&&($e.scrollTop=Pe.scrollTop*Je);var Me=0;G.current==="text"?Me=$e.scrollTop||0:G.current==="preview"&&(Me=Pe.scrollTop||0),P({scrollTop:Me})}}},ue=r+"-preview "+(x.className||""),ie=Se=>oe(Se,"preview"),Z=W.useMemo(()=>c.jsx("div",{ref:re,className:ue,children:c.jsx(c2,Q({},x,{onScroll:ie,source:q.markdown||""}))}),[ue,x,q.markdown]),de=F?.preview&&F?.preview(q.markdown||"",q,P);de&&W.isValidElement(de)&&(Z=c.jsx("div",{className:ue,ref:re,onScroll:ie,children:de}));var ae=Q({},H.style,{height:q.height||"100%"}),ne=()=>P({barPopup:Q({},IN(q.barPopup))}),Ce=Se=>P({height:Se}),ve=Se=>{if(B&&B(Se.target.value,Se,q),C&&C.onChange&&C.onChange(Se),q.textarea&&q.textarea instanceof HTMLTextAreaElement&&L){var he=new Lp(q.textarea),$e=he.getState()||{};L(Q({},$e,{lineCount:Se.target.value.split(`
|
|
92
|
-
`).length,length:Se.target.value.length}))}};return c.jsx(_s.Provider,{value:Q({},q,{dispatch:P}),children:c.jsxs("div",Q({ref:J,className:ye},H,{onClick:ne,style:ae,children:[c.jsx(Ag,{hideToolbar:S,toolbarBottom:$,prefixCls:r,overflow:y,placement:"top"}),c.jsxs("div",{className:r+"-content",children:[/(edit|live)/.test(q.preview||"")&&c.jsx(SN,Q({className:r+"-input",prefixCls:r,autoFocus:I},C,{onChange:ve,renderTextarea:F?.textarea||R,onScroll:Se=>oe(Se,"text")})),/(live|preview)/.test(q.preview||"")&&Z]}),h&&!q.fullscreen&&c.jsx(wN,{prefixCls:r,height:q.height,maxHeight:E,minHeight:T,onChange:Ce}),c.jsx(Ag,{hideToolbar:S,toolbarBottom:$,prefixCls:r,overflow:y,placement:"bottom"})]}))})}),y2=AN;y2.Markdown=c2;const $d={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"}]}}},ON={...$d,patterns:[...$d.patterns,{include:"#docvar"}],repository:{...$d.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},MN={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"}]}}},PN="github-light",RN="github-dark";let Hd;function NN(){return Hd||(Hd=(async()=>{const[{createHighlighterCore:e},{createOnigurumaEngine:t},{default:n},{default:r},{default:o},{default:i},{default:s}]=await Promise.all([Promise.resolve().then(()=>require("./core-CWKmWEg2.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"],...ON},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...MN}]})})()),Hd}async function Gu(e,t,n="light"){return(await NN()).codeToHtml(e,{lang:t,theme:n==="dark"?RN:PN})}function zt(e){const{server:t}=Ie.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 Tr.useQuery(n,Ie.globalQueryClient)}function Sn(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 Tr.useMutation(t,Ie.globalQueryClient)}const jt=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},Il=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 _p({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:i}){return W.useEffect(()=>{o&&o(t)},[t,o]),c.jsx(Ie.StyledCardMedia,{children:c.jsxs(Ot.Stack,{spacing:2,component:"section",children:[c.jsx(x2,{sourceAndPath:e[t],existingQuery:n,onChange:s=>{r&&r(s)},resourceUri:i}),c.jsx(Ot.Box,{height:"5px"})]})})}function Cu(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function FN({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:i}){const[s,a]=W.useState(n||Cu()),[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:E}=jt(i),{apiClients:T}=Ie.useServer(),I=Sn({mutationFn:()=>{const B=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:B}),T.models.executeQueryModel(x,C,e.modelPath,{query:B,sourceName:void 0,queryName:void 0,versionId:E})},onSuccess:B=>{if(B){const L=JSON.parse(B.data.result);a({...s,malloyResult:L}),u(j=>j?{...j,executionState:"finished",response:{result:L}}:void 0)}},onError:B=>{u(void 0),console.error("Query execution error:",B)}}),[D,_]=W.useState(e.sourceInfo.name);W.useEffect(()=>{D!==e.sourceInfo.name&&(_(e.sourceInfo.name),a(Cu()),u(void 0))},[e,D]);const O=W.useCallback(B=>{a({...s,malloyQuery:B,malloyResult:void 0})},[s]);return D!==e.sourceInfo.name?c.jsx("div",{children:"Loading..."}):c.jsx(Ie.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(Cu())})}),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(B){console.error("Error running query:",B)}}})}),c.jsx(b,{source:e.sourceInfo,draftQuery:s?.malloyQuery,setDraftQuery:B=>a({...s,malloyQuery:B}),submittedQuery:l,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function x2(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(Ie.StyledExplorerPage,{children:c.jsx(Ie.StyledExplorerContent,{children:c.jsx(Ot.Box,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):c.jsx(FN,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}const v2=gt(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 xn({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(k.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:i},children:[c.jsx(k.CircularProgress,{size:t,color:n,thickness:r}),e&&c.jsx(k.Typography,{variant:s,color:"text.secondary",children:e})]});return o?c.jsx(k.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:a}):a}const LN=new Set(["warn","error"]);function _N(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!LN.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 BN=W.lazy(()=>Promise.resolve().then(()=>qq)),jN=2e3;function Si({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r,drill:o}){const i=W.useRef(null),[s,a]=W.useState(Math.min(t,jN)),[l,u]=W.useState(!1),d=_N(r);if(!e)return null;if(n>0&&e.length>n&&!l)return c.jsxs(k.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(k.Typography,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),c.jsx(k.Button,{variant:"contained",color:"primary",onClick:()=>u(!0),children:"Proceed"})]});const h=c.jsx(xn,{text:"Loading...",centered:!0,size:32}),p=Math.min(t,s);return c.jsxs(k.Box,{ref:i,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden"},children:[e&&c.jsx(W.Suspense,{fallback:h,children:c.jsx(BN,{result:e,height:p,onSizeChange:a,drill:o})}),d&&c.jsx(k.Box,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:c.jsx(k.Tooltip,{title:d.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:c.jsx(k.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(v2,{fontSize:"small",color:d.severity==="error"?"error":"warning"})})})})]})}function $N({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(_p,{resourceUri:n,sourceAndPaths:t,selectedSourceIndex:s>=0?s:0,existingQuery:i,onQueryChange:r,onSourceChange:o})}function HN({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(),[E,T]=W.useState(Cu()),[I,D]=W.useState(!1),[_,O]=W.useState(e.sourceName?r.findIndex(re=>re.sourceInfo.name===e.sourceName):0),{mode:B}=Ie.usePublisherTheme();W.useEffect(()=>{e.isMarkdown||Gu(e.value,"malloy",B).then(re=>{x(re)})},[e,B]),W.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[L,j]=W.useState(!1),S=()=>{l(),j(!1)},$=r.length===0,F=W.useCallback(()=>{const re=r[_],z=re?.modelPath||e.modelPath||"",ye=re?.sourceInfo.name||e.sourceName||"";i({...e,value:e.isMarkdown?d:E.query,result:E.malloyResult?JSON.stringify(E.malloyResult):void 0,queryInfo:E.malloyQuery?JSON.stringify(E.malloyQuery):void 0,sourceName:ye,modelPath:z})},[e,d,E,i,_,r]),R=c.jsx(k.Tooltip,{title:"Delete Cell",children:c.jsx(k.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"})})})}),H=c.jsxs(k.Dialog,{open:L,onClose:()=>j(!1),children:[c.jsx(k.DialogTitle,{children:"Confirm Delete"}),c.jsx(k.DialogContent,{children:c.jsx(k.Typography,{children:"Are you sure you want to delete this cell?"})}),c.jsxs(k.DialogActions,{children:[c.jsx(k.Button,{onClick:()=>j(!1),children:"Cancel"}),c.jsx(k.Button,{onClick:S,color:"error",children:"Delete"})]})]}),V=()=>{F(),s()},Y=e.isMarkdown?c.jsxs(c.Fragment,{children:[n?c.jsx(k.Tooltip,{title:"Save",children:c.jsx(k.IconButton,{size:"small",onClick:V,children:c.jsx(Gl,{})})}):c.jsx(k.Tooltip,{title:"Edit",children:c.jsx(k.IconButton,{size:"small",onClick:a,children:c.jsx(Zm,{})})}),!n&&R]}):c.jsxs(c.Fragment,{children:[!t&&c.jsx(k.Tooltip,{title:h?"Hide Code":"View Code",children:c.jsx(k.IconButton,{size:"small",onClick:()=>{p(!h)},children:c.jsx(Gb,{})})}),!t&&e.result&&c.jsx(k.Tooltip,{title:m?"Hide Embedding":"View Embedding",children:c.jsx(k.IconButton,{size:"small",onClick:()=>{b(!m)},children:c.jsx(sp,{})})}),t&&c.jsx(k.Tooltip,{title:"Save",children:c.jsx(k.IconButton,{size:"small",onClick:V,children:c.jsx(Gl,{})})}),!t&&c.jsx(k.Tooltip,{title:"Edit",children:c.jsx(k.IconButton,{size:"small",onClick:a,children:c.jsx(Zm,{})})}),!t&&R]}),q=t||n,P=n?c.jsx(k.Tooltip,{title:"Save",children:c.jsx(k.IconButton,{size:"small",onClick:V,children:c.jsx(Gl,{})})}):t?c.jsx(k.Tooltip,{title:"Save",children:c.jsx(k.IconButton,{size:"small",onClick:V,children:c.jsx(Gl,{})})}):null,J=I&&c.jsx(k.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),Y]})||P});return c.jsxs(Ie.StyledCard,{sx:re=>({position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:re.palette.background.paper,minHeight:"50px"}),onMouseEnter:()=>D(!0),onMouseLeave:()=>{D(!1)},children:[J,e.isMarkdown?c.jsx(c.Fragment,{children:n?c.jsx(y2,{value:d,preview:"edit",autoFocus:!0,onChange:re=>{f(re),i({...e,value:re})},onBlur:()=>{F(),I||V()}}):c.jsx(k.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(k.Box,{onClick:a,sx:{cursor:"pointer"},children:c.jsx(Fu,{children:e.value})}):c.jsxs(k.Box,{onClick:a,sx:{cursor:"pointer"},children:[c.jsx(k.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),c.jsx(k.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):c.jsxs(c.Fragment,{children:[c.jsx(k.Collapse,{in:m,timeout:"auto",unmountOnExit:!0,children:c.jsx(k.Stack,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:c.jsx(k.Typography,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:C}})})}),c.jsx(k.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,children:c.jsx(k.Stack,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:c.jsx(k.Typography,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:y}})})}),t&&($?c.jsxs(c.Fragment,{children:[c.jsx(k.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),c.jsx(k.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):c.jsx($N,{sourceAndPaths:r,resourceUri:o,onQueryChange:re=>{T(re)},onSourceChange:re=>{O(re)},cell:e})),!t&&e.result&&c.jsx(Ie.StyledCard,{variant:"outlined",sx:{borderRadius:0},children:c.jsx(Si,{result:e.result,maxHeight:800})}),!t&&!e.result&&c.jsxs(k.Box,{onClick:a,sx:{cursor:"pointer"},children:[c.jsx(k.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),c.jsx(k.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),L&&H]})}const C2=W.createContext(void 0);function zN({children:e,workbookStorage:t}){const n=W.useMemo(()=>({workbookStorage:t}),[t]);return c.jsx(C2.Provider,{value:n,children:e})}function Bp(){const e=W.useContext(C2);if(!e)throw new Error("useWorkbookStorage must be used within a WorkbookStorageProvider");return e}const _r=gt(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"})),UN=gt(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 vn({error:e,context:t}){const n=e.data?.message||"Unknown Error";return c.jsxs(c.Fragment,{children:[t&&c.jsx(k.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 VN({initialSelectedModels:e,onModelChange:t,resourceUri:n}){const{environmentName:r,packageName:o,versionId:i}=jt(n),{apiClients:s}=Ie.useServer(),{data:a,isLoading:l,isSuccess:u,isError:d,error:f}=zt({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=E=>{const T=h.filter(I=>I!==E);p(T),t(T)},x=E=>{const T=[...h,E];p(T),t(T),b(null)};let C=[];return u&&a?.data&&(C=a.data.filter(E=>!h.includes(E.path)).map(E=>E.path)),d?c.jsx(vn,{error:f,context:`${r} > ${o} > Model Picker`}):c.jsxs(c.Fragment,{children:[c.jsxs(k.FormControl,{fullWidth:!0,children:[l&&c.jsx(k.Typography,{children:"Loading..."}),c.jsxs(k.Stack,{direction:"row",spacing:1,children:[h.map(E=>c.jsx(k.Chip,{label:E,onDelete:()=>y(E),deleteIcon:c.jsx(_r,{}),sx:{marginBottom:"5px"}},E)),c.jsx(k.Button,{size:"small",startIcon:c.jsx(UN,{}),onClick:E=>b(E.currentTarget),disabled:l||d||C.length===0,children:"Add Model"})]})]}),c.jsxs(k.Menu,{anchorEl:m,open:!!m,onClose:()=>b(null),children:[c.jsx(k.Typography,{variant:"subtitle2",sx:{ml:1},children:"Models"}),c.jsx(k.Divider,{}),C.length===0?c.jsx(k.MenuItem,{disabled:!0,children:"No models available"}):C.map(E=>c.jsx(k.MenuItem,{onClick:()=>x(E),children:c.jsx(k.Typography,{variant:"body2",children:E})},E))]})]})}function E2(){const e=NT.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 WN({workbookPath:e,resourceUri:t}){const n=E2(),{server:r,getAccessToken:o}=Ie.useServer(),{apiClients:i}=Ie.useServer(),{workbookStorage:s}=Bp(),{environmentName:a,packageName:l}=jt(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(),[E,T]=W.useState([]),[I,D]=W.useState(null),[_,O]=W.useState(null),B=!!I,L=()=>{D(null),O(null)},j=(J,re)=>{p&&(m(p.insertCell(re,{isMarkdown:J,value:""})),J?C(re):y(re),L(),console.log("handleAddCell",J,re))},[S,$]=W.useState(!1),F=()=>{$(!0)},R=async()=>{e&&s&&await s.deleteWorkbook(e).then(()=>{h(void 0),d(void 0)}).catch(J=>{h(`Error deleting workbook: ${J.message}`),d(void 0)}),$(!1),n(`/${a}/${l}`)},H=()=>{$(!1)},V=W.useCallback(async()=>{if(!p){console.log("No workbook data ref");return}try{m(await p.saveWorkbook()),h(void 0),d("Workbook saved")}catch(J){h(`Error saving workbook: ${J.message}`),d(void 0)}},[p]);if(W.useEffect(()=>{if(!p)return;(async()=>{const re=new Map(E.map(({modelPath:se,sourceInfos:G})=>[se,G])),z=[],ye=[];for(const se of p.getModels())re.has(se)?z.push({modelPath:se,sourceInfos:re.get(se)}):(console.log("Fetching model from Publisher",se),ye.push(i.models.getModel(a,l,se,void 0).then(G=>({modelPath:se,sourceInfos:G.data.sourceInfos.map(le=>JSON.parse(le))}))));if(ye.length>0){const se=await Promise.all(ye);T([...z,...se])}else T(z)})()},[o,p,l,a,r]),W.useEffect(()=>{e&&cs.loadWorkbook(s,e).then(J=>{m(J)})},[e,s]),!p)return c.jsx("div",{children:"Loading..."});const Y=J=>{const re=[];for(const z of J)for(const ye of z.sourceInfos)re.push({modelPath:z.modelPath,sourceInfo:ye});return re},q=(J,re)=>c.jsx(k.Button,{size:"small",startIcon:c.jsx(ys,{}),onClick:()=>j(J,re),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:J?"Markdown":"Explore"}),P=c.jsxs(k.Box,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[q(!1,p.getCells().length),q(!0,p.getCells().length)]});return c.jsxs(Ie.StyledCard,{variant:"outlined",children:[c.jsxs(Ie.StyledCardContent,{children:[c.jsx(k.Box,{sx:{mb:2},children:c.jsx(k.Box,{sx:{minHeight:"24px"},children:f?c.jsx(k.Typography,{color:"error",variant:"body2",children:f}):u?c.jsx(k.Typography,{color:"success",variant:"body2",children:u}):c.jsx("span",{children:" "})})}),c.jsxs(Ki,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[c.jsxs(Ki,{direction:"row",spacing:1,alignItems:"center",children:[c.jsx(k.Typography,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),c.jsx(k.Typography,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${e.workspace} > ${e.path}`})]}),c.jsxs(Ki,{sx:{display:"flex",flexDirection:"row",gap:1},children:[c.jsx(k.Box,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:c.jsx(qN,{workbookData:p})}),c.jsxs(k.Box,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[c.jsx(k.Button,{color:"error",onClick:F,size:"small",children:"Delete"}),c.jsxs(k.Dialog,{open:S,onClose:H,children:[c.jsx(k.DialogTitle,{children:"Delete Workbook"}),c.jsx(k.DialogContent,{children:c.jsxs(k.DialogContentText,{children:['Are you sure you want to delete the workbook "',e.path,'"? This action cannot be undone.']})}),c.jsxs(k.DialogActions,{children:[c.jsx(k.Button,{onClick:H,color:"primary",size:"small",children:"Cancel"}),c.jsx(k.Button,{onClick:R,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),c.jsx(k.Divider,{}),c.jsxs(Ki,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[c.jsx(k.Box,{sx:{flex:1},children:c.jsx(VN,{initialSelectedModels:p.getModels(),onModelChange:J=>{m(p.setModels(J)),V()},resourceUri:t})}),c.jsx(k.Box,{sx:{flex:1}})]})]}),c.jsx(Ie.StyledCardMedia,{children:c.jsxs(Ki,{children:[p.getCells().length===0&&c.jsxs(c.Fragment,{children:[c.jsx(k.Typography,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),c.jsx(k.Typography,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),p.getCells().map((J,re)=>c.jsx(W.Fragment,{children:c.jsx(HN,{cell:J,resourceUri:t,addButtonCallback:z=>q(z,re),sourceAndPaths:Y(E),editingMarkdown:x===re,editingMalloy:b===re,onDelete:()=>{m(p.deleteCell(re)),V()},onCellChange:z=>{m(p.setCell(re,z))},onEdit:()=>{J.isMarkdown?C(re):y(re)},onClose:()=>{J.isMarkdown?C(void 0):y(void 0),V()}},`${re}-${J.isMarkdown}-${e.workspace}-${e.path}`)},`${re}-${p.getCells().length}`)),P,c.jsxs(k.Menu,{anchorEl:I,open:B,onClose:L,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(k.MenuItem,{onClick:()=>j(!0,_??0),children:"Add Markdown"}),c.jsx(k.MenuItem,{onClick:()=>j(!1,_??0),children:"Add Malloy"})]}),c.jsx(Ki,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function qN({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(k.Button,{color:"primary",onClick:r,size:"small",children:t?"Copied!":"Export"})}function T2({onWorkbookClick:e}){const{workbookStorage:t}=Bp(),[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(k.Box,{sx:{mb:2},children:c.jsx(k.Typography,{color:"error",variant:"body2",children:o})}),c.jsx(k.Divider,{}),c.jsx(k.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(k.List,{dense:!0,children:[n.length===0&&c.jsx(k.ListItem,{children:c.jsx(k.ListItemText,{primary:"No workbooks found.",sx:{textAlign:"center"}})}),n.map(s=>c.jsx(k.ListItem,{onClick:a=>e(s,a),sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}},children:c.jsx(k.ListItemText,{primary:s.path})},s.path))]})})]})}const Og="Local";class YN{async listWorkspaces(t){return Promise.resolve([{name:Og,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:Og})}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 KN({onWorkbookSelect:e}){const{workbookStorage:t}=Bp(),[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=D=>{u(D.currentTarget)},y=()=>{u(null)},x=()=>{p(!1)},C=()=>{f(!1),r(""),i("")};W.useEffect(()=>{t&&(console.log("fetching workspaces"),t.listWorkspaces(!0).then(D=>{a(D),D.length===1&&i(D[0].name)}).catch(D=>{console.error("Error fetching workspaces:",D),a([])}))},[t]);const E=(D,_)=>{p(!1),e(D,_)},T=D=>{f(!1),e({path:n,workspace:o},D),r(""),i("")},I=s.length===0;return c.jsxs(c.Fragment,{children:[c.jsx(k.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(k.Menu,{id:"basic-menu",anchorEl:l,open:m,onClose:y,MenuListProps:{"aria-labelledby":"basic-button",sx:{py:.5}},children:[c.jsxs(k.MenuItem,{onClick:()=>{f(!0),y()},sx:{py:1,px:2},disabled:I,children:[c.jsx(k.ListItemIcon,{children:c.jsx(On.Add,{fontSize:"small"})}),c.jsxs(k.ListItemText,{children:[c.jsx(k.Typography,{variant:"body2",fontWeight:500,children:"New Workbook"}),I?c.jsx(k.Typography,{variant:"caption",color:"text.secondary",children:"No workspaces available"}):c.jsx(k.Typography,{variant:"caption",color:"text.secondary",children:"Create a new analysis workbook"})]})]}),c.jsxs(k.MenuItem,{onClick:()=>{p(!0),y()},sx:{py:1,px:2},children:[c.jsx(k.ListItemIcon,{children:c.jsx(On.Launch,{fontSize:"small"})}),c.jsxs(k.ListItemText,{children:[c.jsx(k.Typography,{variant:"body2",fontWeight:500,children:"Open Workbook"}),c.jsx(k.Typography,{variant:"caption",color:"text.secondary",children:"Open an existing workbook"})]})]})]}),c.jsxs(k.Dialog,{open:d,onClose:C,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(k.DialogTitle,{sx:{pb:1,pt:2,px:2},children:[c.jsx(k.Typography,{fontWeight:600,sx:{fontSize:"1.5rem",mb:.5},children:"Create New Workbook"}),c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"Start a new analysis workbook to explore your data"})]}),c.jsx(k.DialogContent,{sx:{px:2,pb:2},children:c.jsxs(k.Stack,{spacing:2,sx:{mt:1},children:[s.length>1?c.jsxs(k.FormControl,{fullWidth:!0,size:"small",children:[c.jsx(k.InputLabel,{children:"Workspace"}),c.jsx(k.Select,{value:o,label:"Workspace",onChange:D=>i(D.target.value),children:s.map(D=>c.jsx(k.MenuItem,{value:D.name,children:c.jsxs(k.Box,{children:[c.jsx(k.Typography,{variant:"body2",fontWeight:500,children:D.name}),c.jsx(k.Typography,{variant:"caption",color:"text.secondary",children:D.description})]})},D.name))})]}):s.length===1?c.jsxs(k.Box,{sx:D=>({p:2,border:1,borderColor:"divider",borderRadius:1,backgroundColor:D.palette.mode==="dark"?"rgba(255, 255, 255, 0.04)":"grey.50"}),children:[c.jsxs(k.Typography,{variant:"body2",fontWeight:500,gutterBottom:!0,children:["Workspace: ",s[0].name]}),c.jsx(k.Typography,{variant:"caption",color:"text.secondary",children:s[0].description})]}):null,c.jsx(k.FormControl,{fullWidth:!0,children:c.jsx(k.TextField,{label:"Workbook Name",value:n,onChange:D=>r(D.target.value),placeholder:"Enter workbook name...",fullWidth:!0,autoFocus:!0,size:"small"})}),c.jsxs(k.Stack,{direction:"row",spacing:1,justifyContent:"flex-end",children:[c.jsx(k.Button,{onClick:C,variant:"outlined",size:"small",children:"Cancel"}),c.jsx(k.Button,{onClick:D=>T(D),variant:"contained",disabled:!n.trim()||s.length>1&&!o,size:"small",children:"Create Workbook"})]})]})})]}),c.jsxs(k.Dialog,{open:h,onClose:x,maxWidth:"md",fullWidth:!0,children:[c.jsxs(k.DialogTitle,{sx:{pb:1,pt:2,px:2},children:[c.jsx(k.Typography,{fontWeight:600,sx:{mb:.5,fontSize:"1.5rem"},children:"Open Workbook"}),c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"Select an existing workbook to continue your analysis"})]}),c.jsx(k.DialogContent,{sx:{px:2,pb:2},children:c.jsx(T2,{onWorkbookClick:E})})]})]})}function oi(e){return(e??"").startsWith("filter<")}function qa(e){const t=/^filter<(.+)>$/.exec(e??"");return t?t[1]:void 0}function jp(e){const t=e.filter(n=>n.trim()!=="");return t.length===0?"":Is.StringFilterExpression.unparse({operator:"=",values:[...t]})}function GN(e){if(e.trim()==="")return[];const{parsed:t}=Is.StringFilterExpression.parse(e);return S2(t)?t.values:[e]}function QN(e){return e===void 0||e.trim()===""?!0:S2(Is.StringFilterExpression.parse(e).parsed)}function S2(e){return e!==null&&Is.isStringCondition(e)&&e.operator==="="&&e.not!==!0}function XN(e){return Is.NumberFilterExpression.unparse({operator:">=",values:[String(e)]})}function Mg(e){const t=e.trim();if(t==="")return;const{parsed:n}=Is.NumberFilterExpression.parse(t);if(n===null||n.operator!==">="||n.not===!0||n.values?.length!==1)return;const r=Number(n.values[0]);return Number.isFinite(r)?r:void 0}function ZN(e,t){if(e!=null){if(e instanceof Date)return D2(e,t);if(!Array.isArray(e))return String(e)}}function JN(e,t){return new Date(Date.UTC(e.year(),e.month(),e.date(),t?.getUTCHours()??0,t?.getUTCMinutes()??0,t?.getUTCSeconds()??0,t?.getUTCMilliseconds()??0))}const eF=/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s]+(\d{1,2}):(\d{2})(?::(\d{2}))?(?:\.(\d{1,9}))?)?\s*(Z|[+-]\d{2}:?\d{2}|[+-]\d{2}|UTC|GMT)?$/i;function k2(e){const t=e.trim();return t===""?e:t.replace(/^(\d{4}-\d{1,2}-\d{1,2}[T\s]+\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,9})?)\s+(\d{2}:?\d{2}|\d{2})$/,"$1+$2")}function tF(e,t=!1){const n=k2(e);if(n==="")return;const r=eF.exec(n);if(!r)return;const[,o,i,s,a,l,u,d,f]=r,h={year:Number(o),month:Number(i),day:Number(s),hour:Number(a??0),minute:Number(l??0),second:Number(u??0),milli:Number((d??"").slice(0,3).padEnd(3,"0")||0)},p=Date.UTC(h.year,h.month-1,h.day,h.hour,h.minute,h.second,h.milli),m=new Date(p);if(!(m.getUTCFullYear()===h.year&&m.getUTCMonth()===h.month-1&&m.getUTCDate()===h.day&&m.getUTCHours()===h.hour&&m.getUTCMinutes()===h.minute&&m.getUTCSeconds()===h.second)||f!==void 0&&a===void 0)return;const y=nF(f);if(y===void 0)return;const x=new Date(p-y*6e4);if(!(t&&f!==void 0&&x.getUTCDate()!==h.day))return x}function nF(e){if(e===void 0)return 0;const t=e.toUpperCase();if(t==="Z"||t==="UTC"||t==="GMT")return 0;const n=/^([+-])(\d{2}):?(\d{2})?$/.exec(t);if(!n)return;const r=Number(n[3]??0);if(r>59)return;const o=Number(n[2])*60+r,i=n[1]!=="-";if(!(o>(i?840:720)))return i?o:-o}function rF(e){return!oF.has(e??"")}const oF=new Set(["boolean","number","date","timestamp","timestamptz"]);function w2(e,t){if(t===""&&!rF(e))return null;if(oi(e))return t;switch(e){case"number":{const n=t.trim()===""?NaN:Number(t);return Number.isFinite(n)?n:t}case"boolean":return t==="true"?!0:t==="false"?!1:t;case"date":case"timestamp":case"timestamptz":{const n=k2(t);return tF(n,e==="date")??n}default:return t}}function iF(e,t){const n={};for(const[r,o]of e){const i=ZN(o,t.get(r));i!==void 0&&(n[r]=i)}return n}function D2(e,t){const n=e.toISOString();switch(t){case"timestamptz":return n;case"timestamp":return n.slice(0,-1);default:return n.slice(0,10)}}function I2(e,t,n){const r=n?new Set(n):void 0,o={};for(const[i,s]of e)r&&!r.has(i)||s!=null&&(Array.isArray(s)||(o[i]=s instanceof Date?D2(s,t.get(i)):s));return o}function Pg(e,t){const n=new Map;for(const[r,o]of Object.entries(e))t.has(r)&&n.set(r,w2(t.get(r),o));return n}function Rg(e,t){const n=Array.from(e.keys()).filter(o=>!t.has(o));if(n.length===0)return e;const r=new Map(e);for(const o of n)r.delete(o);return r}function Ng(e){return Object.entries(e??{}).sort(([t],[n])=>t<n?-1:1)}function sF(e,t){const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>e[r]===t[r])}function $p({declaredTypes:e,startingValues:t,params:n,onParamsChange:r,documentKey:o,autorun:i}){const s=W.useMemo(()=>Pg(t??{},e),[e,JSON.stringify(t)]),a=W.useMemo(()=>Pg({...t??{},...n??{}},e),[e,JSON.stringify(t),JSON.stringify(n)]),l=W.useMemo(()=>JSON.stringify([o??null,Ng(t),Ng(n)]),[o,JSON.stringify(t),JSON.stringify(n)]),[u,d]=W.useState(null),f=u?.key===l?u:null;W.useEffect(()=>{u!==null&&u.key!==l&&d(null)},[u,l]);const h=W.useMemo(()=>Rg(f?.draft??a,e),[f,a,e]),p=W.useMemo(()=>Rg(f?.applied??a,e),[f,a,e]),m=W.useCallback(I=>I?.key===l?I:{key:l,draft:a,applied:a},[l,a]),b=W.useMemo(()=>iF(p,e),[p,e]),y=W.useRef(b);W.useEffect(()=>{r&&(sF(y.current,b)||(y.current=b,r(b)))},[b,r]);const x=W.useCallback((I,D)=>{d(_=>{const O=m(_),B=new Map(O.draft);return D===null?B.delete(I):B.set(I,D),{key:O.key,draft:B,applied:i?B:O.applied}})},[i,m]),C=W.useCallback(()=>{d(I=>({key:m(I).key,draft:s,applied:s}))},[m,s]),E=W.useCallback(()=>{d(I=>{const D=m(I);return{key:D.key,draft:D.draft,applied:D.draft}})},[m]),T=W.useMemo(()=>{if(i)return!1;if(h.size!==p.size)return!0;for(const[I,D]of h){const _=p.get(I);if(D instanceof Date&&_ instanceof Date){if(D.getTime()!==_.getTime())return!0}else if(Array.isArray(D)&&Array.isArray(_)){if(String(D)!==String(_))return!0}else if(D!==_)return!0}return!1},[i,h,p]);return{draft:h,applied:p,setGiven:x,reset:C,apply:E,pending:T}}const aF=1e3;function A2(e){const t=e.split(".");return t[t.length-1]}function lF(e,t){return`run: ${e} -> {
|
|
94
|
-
group_by: ${t}
|
|
95
|
-
order_by: ${A2(t)} asc
|
|
96
|
-
limit: ${aF}
|
|
97
|
-
}`}function Hp(e,t,n,r,o){const{apiClients:i}=Ie.useServer(),s=W.useMemo(()=>r.filter(d=>d.name!==void 0&&(d.control==="select"||d.control==="multiselect")&&(d.suggest?.query!==void 0||d.suggest?.source!==void 0&&d.suggest?.dimension!==void 0)),[r]),a=Tr.useQueries({queries:s.map(d=>({queryKey:["givenSuggest",e,t,o,n,d.name,d.suggest?.query,d.suggest?.source,d.suggest?.dimension],enabled:n!==void 0,staleTime:300*1e3,refetchOnWindowFocus:!1,queryFn:async()=>{const f=d.suggest??{},h=await i.models.executeQueryModel(e,t,n,f.query!==void 0?{queryName:f.query,compactJson:!0,versionId:o}:{query:lF(f.source,f.dimension),compactJson:!0,versionId:o});return uF(h.data.result,f.dimension===void 0?void 0:A2(f.dimension))}}))}),l=W.useMemo(()=>{const d=new Map;return s.forEach((f,h)=>{const p=a[h]?.data;f.name&&p&&d.set(f.name,p)}),d},[s,JSON.stringify(a.map(d=>d.data))]),u=W.useMemo(()=>{const d=new Set;return s.forEach((f,h)=>{f.name&&a[h]?.isError&&d.add(f.name)}),d},[s,a.map(d=>d.isError).join("|")]);return{options:l,isLoading:a.some(d=>d.isLoading),failed:u}}function uF(e,t){if(!e)return[];let n;try{n=JSON.parse(e)}catch{throw new Error("Suggest query returned a result that is not JSON.")}if(!Array.isArray(n))throw new Error("Suggest query returned JSON that is not a list of rows.");const r=[],o=new Set;for(const i of n){if(i===null||typeof i!="object")continue;const s=i,a=Object.keys(s),l=t!==void 0&&Object.prototype.hasOwnProperty.call(s,t)?t:a[0],u=l===void 0?void 0:s[l];if(u==null)continue;const d=String(u);o.has(d)||(o.add(d),r.push(d))}return r}const Xr="publisher-drill";function O2(e,t){const n=new Set;let r;try{r=e.getMetadata()?.getAllFields()??[]}catch{return n}const o=new Set;for(const i of r)!i||t(i)||i.tag?.tag("hidden")===void 0&&o.add(i.tag?.text("label")??i.name);for(const i of r){if(!i||!t(i))continue;const s=i.tag?.text("label")??i.name;o.has(s)||n.add(s)}return n}function Ya(e){const t=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return t?t[1]:void 0}function M2(e,t){if(t.size!==0)for(const n of e.querySelectorAll(".malloy-table")){const r=s=>s.closest(".malloy-table")===n,o=new Set;for(const s of n.querySelectorAll(".column-cell.th")){if(!r(s))continue;const a=(s.textContent??"").replace(/\u200b/g,"").trim(),l=Ya(s);l&&t.has(a)&&o.add(l)}if(o.size===0)continue;const i=new Set;for(const s of n.querySelectorAll(`.${Xr}[tabindex="0"]`)){if(!r(s))continue;const a=Ya(s);a&&(i.has(a)?s.tabIndex=-1:i.add(a))}for(const s of n.querySelectorAll(".column-cell.td")){if(!r(s))continue;const a=Ya(s),l=!s.querySelector(".value-null")&&(s.textContent??"").trim()!=="";if(a&&l&&o.has(a)&&!s.querySelector(".malloy-table")){if(s.classList.add(Xr),s.tabIndex===0)i.add(a);else{const u=i.has(a);u||i.add(a),s.tabIndex=u?-1:0}s.setAttribute("role","button")}}}}function cF(e){const t=e.closest(".malloy-table"),n=Ya(e);return!t||!n?[]:Array.from(t.querySelectorAll(`.${Xr}`)).filter(r=>r.closest(".malloy-table")===t&&Ya(r)===n)}function Fg(e,t){const n=cF(e),r=n.indexOf(e);if(r===-1)return;const o=t==="first"?n[0]:t==="last"?n[n.length-1]:n[Math.min(Math.max(r+t,0),n.length-1)];if(o){for(const i of n)i.tabIndex=i===o?0:-1;return o}}const Eu="self";function zp(e){if(!e)return[];if(e.wasDimension&&!e.wasDimension())return[];const t=e.tag?.tag("drill");return t?(t.textArray("to")??[t.text("to")].filter(Lg)).filter(Lg):[]}function Up(e){const t=e.replace(/[-_]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function P2(e){return e.tag?.tag("drill")?.text("given")??e.name}function Rc(e){if(typeof e=="string"){const t=jp([e]);return t===""?void 0:t}if(typeof e=="boolean")return String(e);if(typeof e=="number")return Number.isFinite(e)?String(e):void 0;if(e instanceof Date){const t=e.toISOString();return t.slice(0,t.indexOf("T"))}}function dF(e){return e instanceof Date?Rc(e)??"":String(e)}function R2(e){if(!e||e.isHeader)return;const t=e.field;if(!t)return;const n=zp(t);if(n.length===0)return;const r=Rc(e.value);if(r!==void 0)return{to:n,given:P2(t),value:r,rawValue:e.value,label:dF(e.value)}}function Lg(e){return typeof e=="string"&&e!==""}function Vp(e,t){if(t!==void 0&&!oi(t)){if(t==="number"){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(typeof e!="string"||e.trim()==="")return;const n=Number(e);return Number.isFinite(n)?n:void 0}if(t==="date"||t==="timestamp"||t==="timestamptz")return e instanceof Date?e:void 0;if(t==="boolean")return typeof e=="boolean"?e:e==="true"?!0:e==="false"?!1:void 0;if(typeof e=="string")return e.trim()===""?void 0:e;if(typeof e=="number")return Number.isFinite(e)?String(e):void 0;if(typeof e=="boolean")return String(e)}return qa(t)==="string"&&typeof e=="number"?Number.isFinite(e)?jp([String(e)]):void 0:qa(t)==="number"?typeof e=="number"?Number.isFinite(e)?String(e):void 0:typeof e!="string"||e.trim()===""?void 0:Number.isFinite(Number(e))?e.trim():void 0:Rc(e)}function Wp({onNavigate:e,onSelf:t,selfLabel:n="Filter this view",canSelf:r}){const[o,i]=W.useState(null),s=W.useCallback((h,p)=>h.filter(m=>m===Eu?t!==void 0&&(r?.(p)??!0):e!==void 0),[e,t,r]),a=W.useCallback((h,p,m)=>{if(p===Eu){t?.(h.given,h.rawValue);return}e?.({dashboard:p,givens:{[h.given]:h.value}},m)},[e,t]),l=W.useCallback(h=>{const p=R2(h);if(!p)return;const m=s(p.to,p.given);if(m.length!==0){if(m.length===1){a(p,m[0],h.event);return}i({intent:p,destinations:m,event:h.event,top:h.event?.clientY??0,left:h.event?.clientX??0})}},[a,s]),u=W.useCallback(h=>s(zp(h),P2(h)).length>0,[s]),d=W.useMemo(()=>({onClick:l,canDrill:u}),[l,u]),f=W.useCallback(()=>i(null),[]);return{drill:d,drillMenu:c.jsxs(k.Menu,{open:o!==null,onClose:f,anchorReference:"anchorPosition",anchorPosition:{top:o?.top??0,left:o?.left??0},children:[c.jsx(k.ListSubheader,{sx:{lineHeight:"32px"},children:o?`${o.intent.label} →`:""}),Array.from(new Set(o?.destinations??[])).map(h=>c.jsx(k.MenuItem,{onClick:()=>{f(),o&&a(o.intent,h,o.event)},children:h===Eu?n:Up(h)},h))]})}}const Nf=gt(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"}));var Tu={exports:{}},fF=Tu.exports,_g;function pF(){return _g||(_g=1,(function(e,t){(function(n,r){e.exports=r()})(fF,(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(F){var R=["th","st","nd","rd"],H=F%100;return"["+F+(R[(H-20)%10]||R[H]||R[0])+"]"}},E=function(F,R,H){var V=String(F);return!V||V.length>=R?F:""+Array(R+1-V.length).join(H)+F},T={s:E,z:function(F){var R=-F.utcOffset(),H=Math.abs(R),V=Math.floor(H/60),Y=H%60;return(R<=0?"+":"-")+E(V,2,"0")+":"+E(Y,2,"0")},m:function F(R,H){if(R.date()<H.date())return-F(H,R);var V=12*(H.year()-R.year())+(H.month()-R.month()),Y=R.clone().add(V,f),q=H-Y<0,P=R.clone().add(V+(q?-1:1),f);return+(-(V+(H-Y)/(q?Y-P:P-Y))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:f,y:p,w:d,d:u,D:m,h:l,m:a,s,ms:i,Q:h}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},I="en",D={};D[I]=C;var _="$isDayjsObject",O=function(F){return F instanceof S||!(!F||!F[_])},B=function F(R,H,V){var Y;if(!R)return I;if(typeof R=="string"){var q=R.toLowerCase();D[q]&&(Y=q),H&&(D[q]=H,Y=q);var P=R.split("-");if(!Y&&P.length>1)return F(P[0])}else{var J=R.name;D[J]=R,Y=J}return!V&&Y&&(I=Y),Y||!V&&I},L=function(F,R){if(O(F))return F.clone();var H=typeof R=="object"?R:{};return H.date=F,H.args=arguments,new S(H)},j=T;j.l=B,j.i=O,j.w=function(F,R){return L(F,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var S=(function(){function F(H){this.$L=B(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[_]=!0}var R=F.prototype;return R.parse=function(H){this.$d=(function(V){var Y=V.date,q=V.utc;if(Y===null)return new Date(NaN);if(j.u(Y))return new Date;if(Y instanceof Date)return new Date(Y);if(typeof Y=="string"&&!/Z$/i.test(Y)){var P=Y.match(y);if(P){var J=P[2]-1||0,re=(P[7]||"0").substring(0,3);return q?new Date(Date.UTC(P[1],J,P[3]||1,P[4]||0,P[5]||0,P[6]||0,re)):new Date(P[1],J,P[3]||1,P[4]||0,P[5]||0,P[6]||0,re)}}return new Date(Y)})(H),this.init()},R.init=function(){var H=this.$d;this.$y=H.getFullYear(),this.$M=H.getMonth(),this.$D=H.getDate(),this.$W=H.getDay(),this.$H=H.getHours(),this.$m=H.getMinutes(),this.$s=H.getSeconds(),this.$ms=H.getMilliseconds()},R.$utils=function(){return j},R.isValid=function(){return this.$d.toString()!==b},R.isSame=function(H,V){var Y=L(H);return this.startOf(V)<=Y&&Y<=this.endOf(V)},R.isAfter=function(H,V){return L(H)<this.startOf(V)},R.isBefore=function(H,V){return this.endOf(V)<L(H)},R.$g=function(H,V,Y){return j.u(H)?this[V]:this.set(Y,H)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(H,V){var Y=this,q=!!j.u(V)||V,P=j.p(H),J=function(ue,ie){var Z=j.w(Y.$u?Date.UTC(Y.$y,ie,ue):new Date(Y.$y,ie,ue),Y);return q?Z:Z.endOf(u)},re=function(ue,ie){return j.w(Y.toDate()[ue].apply(Y.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(ie)),Y)},z=this.$W,ye=this.$M,se=this.$D,G="set"+(this.$u?"UTC":"");switch(P){case p:return q?J(1,0):J(31,11);case f:return q?J(1,ye):J(0,ye+1);case d:var le=this.$locale().weekStart||0,oe=(z<le?z+7:z)-le;return J(q?se-oe:se+(6-oe),ye);case u:case m:return re(G+"Hours",0);case l:return re(G+"Minutes",1);case a:return re(G+"Seconds",2);case s:return re(G+"Milliseconds",3);default:return this.clone()}},R.endOf=function(H){return this.startOf(H,!1)},R.$set=function(H,V){var Y,q=j.p(H),P="set"+(this.$u?"UTC":""),J=(Y={},Y[u]=P+"Date",Y[m]=P+"Date",Y[f]=P+"Month",Y[p]=P+"FullYear",Y[l]=P+"Hours",Y[a]=P+"Minutes",Y[s]=P+"Seconds",Y[i]=P+"Milliseconds",Y)[q],re=q===u?this.$D+(V-this.$W):V;if(q===f||q===p){var z=this.clone().set(m,1);z.$d[J](re),z.init(),this.$d=z.set(m,Math.min(this.$D,z.daysInMonth())).$d}else J&&this.$d[J](re);return this.init(),this},R.set=function(H,V){return this.clone().$set(H,V)},R.get=function(H){return this[j.p(H)]()},R.add=function(H,V){var Y,q=this;H=Number(H);var P=j.p(V),J=function(ye){var se=L(q);return j.w(se.date(se.date()+Math.round(ye*H)),q)};if(P===f)return this.set(f,this.$M+H);if(P===p)return this.set(p,this.$y+H);if(P===u)return J(1);if(P===d)return J(7);var re=(Y={},Y[a]=r,Y[l]=o,Y[s]=n,Y)[P]||1,z=this.$d.getTime()+H*re;return j.w(z,this)},R.subtract=function(H,V){return this.add(-1*H,V)},R.format=function(H){var V=this,Y=this.$locale();if(!this.isValid())return Y.invalidDate||b;var q=H||"YYYY-MM-DDTHH:mm:ssZ",P=j.z(this),J=this.$H,re=this.$m,z=this.$M,ye=Y.weekdays,se=Y.months,G=Y.meridiem,le=function(ie,Z,de,ae){return ie&&(ie[Z]||ie(V,q))||de[Z].slice(0,ae)},oe=function(ie){return j.s(J%12||12,ie,"0")},ue=G||function(ie,Z,de){var ae=ie<12?"AM":"PM";return de?ae.toLowerCase():ae};return q.replace(x,(function(ie,Z){return Z||(function(de){switch(de){case"YY":return String(V.$y).slice(-2);case"YYYY":return j.s(V.$y,4,"0");case"M":return z+1;case"MM":return j.s(z+1,2,"0");case"MMM":return le(Y.monthsShort,z,se,3);case"MMMM":return le(se,z);case"D":return V.$D;case"DD":return j.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return le(Y.weekdaysMin,V.$W,ye,2);case"ddd":return le(Y.weekdaysShort,V.$W,ye,3);case"dddd":return ye[V.$W];case"H":return String(J);case"HH":return j.s(J,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return ue(J,re,!0);case"A":return ue(J,re,!1);case"m":return String(re);case"mm":return j.s(re,2,"0");case"s":return String(V.$s);case"ss":return j.s(V.$s,2,"0");case"SSS":return j.s(V.$ms,3,"0");case"Z":return P}return null})(ie)||P.replace(":","")}))},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(H,V,Y){var q,P=this,J=j.p(V),re=L(H),z=(re.utcOffset()-this.utcOffset())*r,ye=this-re,se=function(){return j.m(P,re)};switch(J){case p:q=se()/12;break;case f:q=se();break;case h:q=se()/3;break;case d:q=(ye-z)/6048e5;break;case u:q=(ye-z)/864e5;break;case l:q=ye/o;break;case a:q=ye/r;break;case s:q=ye/n;break;default:q=ye}return Y?q:j.a(q)},R.daysInMonth=function(){return this.endOf(f).$D},R.$locale=function(){return D[this.$L]},R.locale=function(H,V){if(!H)return this.$L;var Y=this.clone(),q=B(H,V,!0);return q&&(Y.$L=q),Y},R.clone=function(){return j.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},F})(),$=S.prototype;return L.prototype=$,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",u],["$M",f],["$y",p],["$D",m]].forEach((function(F){$[F[1]]=function(R){return this.$g(R,F[0],F[1])}})),L.extend=function(F,R){return F.$i||(F(R,S,L),F.$i=!0),L},L.locale=B,L.isDayjs=O,L.unix=function(F){return L(1e3*F)},L.en=D[I],L.Ls=D,L.p={},L}))})(Tu)),Tu.exports}var hF=pF();const Ft=Sr(hF);var Su={exports:{}},mF=Su.exports,Bg;function gF(){return Bg||(Bg=1,(function(e,t){(function(n,r){e.exports=r()})(mF,(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)}}}))})(Su)),Su.exports}var bF=gF();const yF=Sr(bF);var ku={exports:{}},xF=ku.exports,jg;function vF(){return jg||(jg=1,(function(e,t){(function(n,r){e.exports=r()})(xF,(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),E=60*C[1]+(+C[2]||0);return E===0?0:C[0]==="+"?-E:E})(y)}],h=function(y){var x=l[y];return x&&(x.indexOf?x:x.s.concat(x.f))},p=function(y,x){var C,E=l.meridiem;if(E){for(var T=1;T<=24;T+=1)if(y.indexOf(E(T,0,x))>-1){C=T>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 E=1;E<=31;E+=1)x(E).replace(/\[|\]/g,"")===y&&(this.day=E)}],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(E){return E.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 E=(y=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(L,j,S){var $=S&&S.toUpperCase();return j||C[S]||n[S]||C[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(F,R,H){return R||H.slice(1)}))}))).match(r),T=E.length,I=0;I<T;I+=1){var D=E[I],_=m[D],O=_&&_[0],B=_&&_[1];E[I]=B?{regex:O,parser:B}:D.replace(/^\[|\]$/g,"")}return function(L){for(var j={},S=0,$=0;S<T;S+=1){var F=E[S];if(typeof F=="string")$+=F.length;else{var R=F.regex,H=F.parser,V=L.slice($),Y=R.exec(V)[0];H.call(j,Y),L=L.replace(Y,"")}}return(function(q){var P=q.afternoon;if(P!==void 0){var J=q.hours;P?J<12&&(q.hours+=12):J===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 E=x.prototype,T=E.parse;E.parse=function(I){var D=I.date,_=I.utc,O=I.args;this.$u=_;var B=O[1];if(typeof B=="string"){var L=O[2]===!0,j=O[3]===!0,S=L||j,$=O[2];j&&($=O[2]),l=this.$locale(),!L&&$&&(l=C.Ls[$]),this.$d=(function(V,Y,q,P){try{if(["x","X"].indexOf(Y)>-1)return new Date((Y==="X"?1e3:1)*V);var J=b(Y)(V),re=J.year,z=J.month,ye=J.day,se=J.hours,G=J.minutes,le=J.seconds,oe=J.milliseconds,ue=J.zone,ie=J.week,Z=new Date,de=ye||(re||z?1:Z.getDate()),ae=re||Z.getFullYear(),ne=0;re&&!z||(ne=z>0?z-1:Z.getMonth());var Ce,ve=se||0,Se=G||0,he=le||0,$e=oe||0;return ue?new Date(Date.UTC(ae,ne,de,ve,Se,he,$e+60*ue.offset*1e3)):q?new Date(Date.UTC(ae,ne,de,ve,Se,he,$e)):(Ce=new Date(ae,ne,de,ve,Se,he,$e),ie&&(Ce=P(Ce).week(ie).toDate()),Ce)}catch{return new Date("")}})(D,B,_,C),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),S&&D!=this.format(B)&&(this.$d=new Date("")),l={}}else if(B instanceof Array)for(var F=B.length,R=1;R<=F;R+=1){O[1]=B[R-1];var H=C.apply(this,O);if(H.isValid()){this.$d=H.$d,this.$L=H.$L,this.init();break}R===F&&(this.$d=new Date(""))}else T.call(this,I)}}}))})(ku)),ku.exports}var CF=vF();const EF=Sr(CF);var wu={exports:{}},TF=wu.exports,$g;function SF(){return $g||($g=1,(function(e,t){(function(n,r){e.exports=r()})(TF,(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,E){return C||E.slice(1)}))}))})(l,u===void 0?{}:u);return a.call(this,d)}}}))})(wu)),wu.exports}var kF=SF();const wF=Sr(kF);var Du={exports:{}},DF=Du.exports,Hg;function IF(){return Hg||(Hg=1,(function(e,t){(function(n,r){e.exports=r()})(DF,(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))}}}))})(Du)),Du.exports}var AF=IF();const OF=Sr(AF);var Iu={exports:{}},MF=Iu.exports,zg;function PF(){return zg||(zg=1,(function(e,t){(function(n,r){e.exports=r()})(MF,(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)}}}))})(Iu)),Iu.exports}var RF=PF();const NF=Sr(RF);Ft.extend(wF);Ft.extend(yF);Ft.extend(OF);Ft.extend(NF);const FF={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"},LF={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(`
|
|
98
|
-
`),Ug=["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(`
|
|
99
|
-
`),_F=(e,t)=>t?(...n)=>e(...n).locale(t):e;class Qu{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=FF,this.setLocaleToValue=r=>{const o=this.getCurrentLocaleCode();return o===r.locale()?r:r.locale(o)},this.hasUTCPlugin=()=>typeof Ft.utc<"u",this.hasTimezonePlugin=()=>typeof Ft.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 Ft.tz.guess();default:return r}},this.createSystemDate=r=>{if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const o=Ft.tz.guess();return o!=="UTC"?Ft.tz(r,o):Ft(r)}return Ft(r)},this.createUTCDate=r=>{if(!this.hasUTCPlugin())throw new Error(zd);return Ft.utc(r)},this.createTZDate=(r,o)=>{if(!this.hasUTCPlugin())throw new Error(zd);if(!this.hasTimezonePlugin())throw new Error(Ug);const i=r!==void 0&&!r.endsWith("Z");return Ft(r).tz(this.cleanTimezone(o),i)},this.getLocaleFormats=()=>{const r=Ft.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=()=>Ft(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(Ug)}return Ft.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=_F(Ft,t),this.locale=t,this.formats=Q({},LF,n),Ft.extend(EF)}getDayOfWeek(t){return t.day()+1}}function N2(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:nl(t.components[n].defaultProps,r)}function BF({props:e,name:t,defaultTheme:n,themeId:r}){let o=gk(n);return o=o[r]||o,N2({theme:o,name:t,props:e})}function jF(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 $F={...M},F2=$F.useSyncExternalStore;function HF(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 F2(l,a,s)}function L2(e={}){const{themeId:t}=e;return function(r,o={}){let i=jb();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}=N2({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(`
|
|
100
|
-
`)),(F2!==void 0?HF:jF)(f,a,l,u,d)}}L2();const _2=L2({themeId:As});function Gt({props:e,name:t}){return BF({props:e,name:t,defaultTheme:yc,themeId:As})}const B2=Ee.oneOfType([Ee.func,Ee.object]),Vg={};function j2(e,t){const n=M.useRef(Vg);return n.current===Vg&&(n.current=e(t)),n}const zF=[];function UF(e){M.useEffect(e,zF)}class qp{static create(){return new qp}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 Nc(){const e=j2(qp.create).current;return UF(e.disposeEffect),e}function Wg(e){try{return e.matches(":focus-visible")}catch{}return!1}function $2(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}const VF=e=>{const t=M.useRef({});return M.useEffect(()=>{t.current=e}),t.current},WF={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function Es(e){return typeof e=="string"}function H2(e,t,n){return e===void 0||Es(e)?t:{...t,ownerState:{...t.ownerState,...n}}}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 qg(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 z2(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=qg(r),l=qg(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 br(e,t,n){return typeof e=="function"?e(t,n):e}function Ct(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...i}=e,s=o?{}:br(n,r),{props:a,internalRef:l}=z2({...i,externalSlotProps:s}),u=Et(l,s?.ref,e.additionalProps?.ref);return H2(t,{...a,ref:u},r)}function js(e){return parseInt(M.version,10)>=19?e?.props?.ref||null:e?.ref||null}const ca=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),qF=({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}},Xu=(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},Ka=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,utils:s,timezone:a})=>{const l=Xu(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},YF=(e,t)=>t==null||!e.isValid(t)?null:t,vr=(e,t,n)=>t==null||!e.isValid(t)?n:t,KF=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),Yp=(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},U2=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),GF=["year","month","day"],Yg=e=>GF.includes(e),Kp=(e,{format:t,views:n},r)=>{if(t!=null)return t;const o=e.formats;return ca(n,["year"])?o.year:ca(n,["month"])?o.month:ca(n,["day"])?o.dayOfMonth:ca(n,["month","year"])?`${o.month} ${o.year}`:ca(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},QF=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},XF=["hours","minutes","seconds"],ZF=e=>XF.includes(e),Kg=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),JF=(e,t)=>(n,r)=>e?t.isAfter(n,r):Kg(n,t)>Kg(r,t),Gr={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},eL=e=>Math.max(...e.map(t=>Gr[t.type]??1)),da=(e,t,n)=>{if(t===Gr.year)return e.startOfYear(n);if(t===Gr.month)return e.startOfMonth(n);if(t===Gr.day)return e.startOfDay(n);let r=n;return t<Gr.minutes&&(r=e.setMinutes(r,0)),t<Gr.seconds&&(r=e.setSeconds(r,0)),t<Gr.milliseconds&&(r=e.setMilliseconds(r,0)),r},tL=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:o})=>{let i=o?o():da(t,n,U2(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,i)&&(i=da(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,i)&&(i=da(t,n,e.maxDate));const s=JF(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&s(e.minTime,i)&&(i=da(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:Xu(t,i,e.minTime))),e.maxTime!=null&&s(i,e.maxTime)&&(i=da(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:Xu(t,i,e.maxTime))),i},V2=(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(`
|
|
101
|
-
`));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},nL=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},Fc=(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))},W2=(e,t,n,r)=>{switch(n){case"month":return Yp(e,e.date(void 0,t)).map(o=>e.formatByString(o,r));case"weekDay":return Fc(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[]}},Gg="s",rL=["0","1","2","3","4","5","6","7","8","9"],oL=e=>{const t=e.date(void 0);return e.formatByString(e.setSeconds(t,0),Gg)==="0"?rL:Array.from({length:10}).map((r,o)=>e.formatByString(e.setSeconds(t,o),Gg))},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("")},Gp=(e,t)=>t[0]==="0"?e:e.split("").map(n=>t[Number(n)]).join(""),Qg=(e,t)=>{const n=gi(e,t);return n!==" "&&!Number.isNaN(Number(n))},q2=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},Y2=(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=q2(i,o.maxLength)),Gp(i,r)},iL=(e,t,n,r,o,i,s,a)=>{const l=nL(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=>Y2(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=W2(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()},Qp=(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},Xg=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),sL=(e,t)=>e.formatByString(e.date(void 0,"system"),t).length===4,K2=(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")}},aL=(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(Qp(u,"non-input",n)))}const s=o.join(" "),a=i.join(" ");return e.parse(a,s)},lL=e=>e.map(t=>`${t.startSeparator}${t.value||t.placeholder}${t.endSeparator}`).join(""),uL=(e,t,n)=>{const o=e.map(i=>{const s=Qp(i,n?"input-rtl":"input-ltr",t);return`${i.startSeparator}${s}${i.endSeparator}`}).join("");return n?`${o}`:o},cL=(e,t,n)=>{const r=e.date(void 0,n),o=e.endOfYear(r),i=e.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=Yp(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:sL(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=Fc(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})}},dL=(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=Fc(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}},Zg={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},Jg=(e,t,n,r,o)=>[...n].sort((i,s)=>Zg[i.type]-Zg[s.type]).reduce((i,s)=>!o||s.modified?dL(e,s,t,i):i,r),fL=()=>navigator.userAgent.toLowerCase().includes("android"),pL=(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]}},Ff=(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},hL=(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}},mL=(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}},gL=["value","referenceDate"],Jr={emptyValue:null,getTodayValue:U2,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=et(e,gL);return t!=null&&r.utils.isValid(t)?t:n??tL(r)},cleanValue:YF,areValuesEqual:KF,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)},bL={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&!!n?n:r(t),getV7HiddenInputValueFromSections:lL,getV6InputValueFromSections:uL,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)},yL=["localeText"],Lf=M.createContext(null),al=function(t){const{localeText:n}=t,r=et(t,yL),{utils:o,localeText:i}=M.useContext(Lf)??{utils:void 0,localeText:void 0},s=Gt({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:u,dateLibInstance:d,adapterLocale:f,localeText:h}=s,p=M.useMemo(()=>Q({},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(`
|
|
102
|
-
`));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(Lf.Provider,{value:y,children:a})},xL=e=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:Q({},e)}}}}),G2=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)}},Q2={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"},vL=Q2;xL(Q2);const ki=()=>{const e=M.useContext(Lf);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(`
|
|
103
|
-
`));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(`
|
|
104
|
-
`));const t=M.useMemo(()=>Q({},vL,e.localeText),[e.localeText]);return M.useMemo(()=>Q({},e,{localeText:t}),[e,t])},Zt=()=>ki().utils,Al=()=>ki().defaultDates,Lc=e=>{const t=Zt(),n=M.useRef(void 0);return n.current===void 0&&(n.current=t.date(void 0,e)),n.current};function CL(e){return typeof e.main=="string"}function EL(e,t=[]){if(!CL(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&&EL(t,e)}function TL(e){return Ge("MuiTypography",e)}const e1=qe("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),SL={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},kL=rw(),wL=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Le(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Ke(a,TL,s)},DL=pe("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${Le(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(pt(({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${Le(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}}]}))),t1={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=!SL[r],s=kL({...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=t1,...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]||t1[p])||"span",C=wL(y);return c.jsx(DL,{as:x,ref:n,className:Ue(C.root,l),...b,ownerState:y,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...b.style}})});function IL(e){return Ge("MuiPickersToolbar",e)}qe("MuiPickersToolbar",["root","content"]);const AL=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],OL=e=>{const{classes:t}=e;return Ke({root:["root"],content:["content"]},IL,t)},ML=pe("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"}}]})),PL=pe("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"}}]}),RL=M.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiPickersToolbar"}),{children:o,className:i,toolbarTitle:s,hidden:a,titleId:l}=r,u=et(r,AL),d=r,f=OL(d);return a?null:c.jsxs(ML,Q({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(PL,{className:f.content,ownerState:d,children:o})]}))}),Eo=()=>ki().localeText;function NL(e){return Ge("MuiDatePickerToolbar",e)}qe("MuiDatePickerToolbar",["root","title"]);const FL=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],LL=e=>{const{classes:t}=e;return Ke({root:["root"],title:["title"]},NL,t)},_L=pe(RL,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),BL=pe(Dt,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),jL=M.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiDatePickerToolbar"}),{value:o,isLandscape:i,toolbarFormat:s,toolbarPlaceholder:a="––",views:l,className:u}=r,d=et(r,FL),f=Zt(),h=Eo(),p=LL(r),m=M.useMemo(()=>{if(!o)return a;const y=Kp(f,{format:s,views:l},!0);return f.formatByString(o,y)},[o,s,a,f,l]),b=r;return c.jsx(_L,Q({ref:n,toolbarTitle:h.datePickerToolbarTitle,isLandscape:i,className:Ue(p.root,u)},d,{children:c.jsx(BL,{variant:"h4",align:i?"left":"center",ownerState:b,className:p.title,children:m})}))});function X2(e,t){const n=Zt(),r=Al(),o=Gt({props:e,name:t}),i=M.useMemo(()=>o.localeText?.toolbarTitle==null?o.localeText:Q({},o.localeText,{datePickerToolbarTitle:o.localeText.toolbarTitle}),[o.localeText]);return Q({},o,{localeText:i},qF({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:Q({toolbar:jL},o.slots)})}const Ol=({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}};Ol.valueManager=Jr;const Z2=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],$L=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],HL=["minDateTime","maxDateTime"],zL=[...Z2,...$L,...HL],J2=e=>zL.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{});function ev(e){const{props:t,validator:n,value:r,timezone:o,onError:i}=e,s=ki(),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}}const _c=M.createContext(void 0);function ar(){return M.useContext(_c)}function UL(e){return Ge("MuiInputAdornment",e)}const n1=qe("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var r1;const VL=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Le(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},WL=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:o,size:i,variant:s}=e,a={root:["root",n&&"disablePointerEvents",o&&`position${Le(o)}`,s,r&&"hiddenLabel",i&&`size${Le(i)}`]};return Ke(a,UL,t)},qL=pe("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:VL})(pt(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${n1.positionStart}&:not(.${n1.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),tv=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=WL(m);return c.jsx(_c.Provider,{value:null,children:c.jsx(qL,{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"?r1||(r1=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):null,o]})})})});class Zu{static create(){return new Zu}static use(){const t=j2(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=KL(),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 YL(){return Zu.use()}function KL(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function _f(e,t){return _f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},_f(e,t)}function Xp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_f(e,t)}function GL(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function QL(e,t){e.classList?e.classList.add(t):GL(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function o1(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function XL(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=o1(e.className,t):e.setAttribute("class",o1(e.className&&e.className.baseVal||"",t))}const i1={disabled:!1},Ju=W.createContext(null);var nv=function(t){return t.scrollTop},Pa="unmounted",ni="exited",ri="entering",os="entered",Bf="exiting",Ir=(function(e){Xp(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=ni,i.appearStatus=ri):l=os:r.unmountOnExit||r.mountOnEnter?l=Pa:l=ni,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===Pa?{status:ni}: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!==ri&&s!==os&&(i=ri):(s===ri||s===os)&&(i=Bf)}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===ri){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Ia.findDOMNode(this);s&&nv(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ni&&this.setState({status:Pa})},n.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[Ia.findDOMNode(this),a],u=l[0],d=l[1],f=this.getTimeouts(),h=a?f.appear:f.enter;if(!o&&!s||i1.disabled){this.safeSetState({status:os},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:ri},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:os},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:Ia.findDOMNode(this);if(!i||i1.disabled){this.safeSetState({status:ni},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:Bf},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:ni},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:Ia.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===Pa)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=et(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return W.createElement(Ju.Provider,{value:null},typeof s=="function"?s(o,a):W.cloneElement(W.Children.only(s),a))},t})(W.Component);Ir.contextType=Ju;Ir.propTypes={};function Zi(){}Ir.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Zi,onEntering:Zi,onEntered:Zi,onExit:Zi,onExiting:Zi,onExited:Zi};Ir.UNMOUNTED=Pa;Ir.EXITED=ni;Ir.ENTERING=ri;Ir.ENTERED=os;Ir.EXITING=Bf;var ZL=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return QL(t,r)})},Ud=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return XL(t,r)})},Zp=(function(e){Xp(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&&nv(o),a&&(this.appliedClasses[i][s]=a,ZL(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&&Ud(o,a),l&&Ud(o,l),u&&Ud(o,u)},n.render=function(){var o=this.props;o.classNames;var i=et(o,["classNames"]);return W.createElement(Ir,Q({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(W.Component);Zp.defaultProps={classNames:""};Zp.propTypes={};function JL(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jp(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 e8(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 ai(e,t,n){return n[t]!=null?n[t]:e.props[t]}function t8(e,t){return Jp(e.children,function(n){return W.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:ai(n,"appear",e),enter:ai(n,"enter",e),exit:ai(n,"exit",e)})})}function n8(e,t,n){var r=Jp(e.children),o=e8(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:ai(s,"exit",e),enter:ai(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:ai(s,"exit",e),enter:ai(s,"enter",e)}))}}),o}var r8=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},o8={component:"div",childFactory:function(t){return t}},Ml=(function(e){Xp(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=i.handleExited.bind(JL(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?t8(o,a):n8(o,s,a),firstRender:!1}},n.handleExited=function(o,i){var s=Jp(this.props.children);o.key in s||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(a){var l=Q({},a.children);return delete l[o.key],{children:l}}))},n.render=function(){var o=this.props,i=o.component,s=o.childFactory,a=et(o,["component","childFactory"]),l=this.state.contextValue,u=r8(this.state.children).map(s);return delete a.appear,delete a.enter,delete a.exit,i===null?W.createElement(Ju.Provider,{value:l},u):W.createElement(Ju.Provider,{value:l},W.createElement(i,a,u))},t})(W.Component);Ml.propTypes={};Ml.defaultProps=o8;function i8(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=qe("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),jf=550,s8=80,a8=Ot.keyframes`
|
|
105
|
-
0% {
|
|
106
|
-
transform: scale(0);
|
|
107
|
-
opacity: 0.1;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
100% {
|
|
111
|
-
transform: scale(1);
|
|
112
|
-
opacity: 0.3;
|
|
113
|
-
}
|
|
114
|
-
`,l8=Ot.keyframes`
|
|
115
|
-
0% {
|
|
116
|
-
opacity: 1;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
100% {
|
|
120
|
-
opacity: 0;
|
|
121
|
-
}
|
|
122
|
-
`,u8=Ot.keyframes`
|
|
123
|
-
0% {
|
|
124
|
-
transform: scale(1);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
50% {
|
|
128
|
-
transform: scale(0.92);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
100% {
|
|
132
|
-
transform: scale(1);
|
|
133
|
-
}
|
|
134
|
-
`,c8=pe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),d8=pe(i8,{name:"MuiTouchRipple",slot:"Ripple"})`
|
|
135
|
-
opacity: 0;
|
|
136
|
-
position: absolute;
|
|
137
|
-
|
|
138
|
-
&.${pr.rippleVisible} {
|
|
139
|
-
opacity: 0.3;
|
|
140
|
-
transform: scale(1);
|
|
141
|
-
animation-name: ${a8};
|
|
142
|
-
animation-duration: ${jf}ms;
|
|
143
|
-
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
&.${pr.ripplePulsate} {
|
|
147
|
-
animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
& .${pr.child} {
|
|
151
|
-
opacity: 1;
|
|
152
|
-
display: block;
|
|
153
|
-
width: 100%;
|
|
154
|
-
height: 100%;
|
|
155
|
-
border-radius: 50%;
|
|
156
|
-
background-color: currentColor;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
& .${pr.childLeaving} {
|
|
160
|
-
opacity: 0;
|
|
161
|
-
animation-name: ${l8};
|
|
162
|
-
animation-duration: ${jf}ms;
|
|
163
|
-
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
& .${pr.childPulsate} {
|
|
167
|
-
position: absolute;
|
|
168
|
-
/* @noflip */
|
|
169
|
-
left: 0px;
|
|
170
|
-
top: 0;
|
|
171
|
-
animation-name: ${u8};
|
|
172
|
-
animation-duration: 2500ms;
|
|
173
|
-
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
|
174
|
-
animation-iteration-count: infinite;
|
|
175
|
-
animation-delay: 200ms;
|
|
176
|
-
}
|
|
177
|
-
`,f8=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=Nc(),m=M.useRef(null),b=M.useRef(null),y=M.useCallback(T=>{const{pulsate:I,rippleX:D,rippleY:_,rippleSize:O,cb:B}=T;u(L=>[...L,c.jsx(d8,{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:jf,pulsate:I,rippleX:D,rippleY:_,rippleSize:O},d.current)]),d.current+=1,f.current=B},[i]),x=M.useCallback((T={},I={},D=()=>{})=>{const{pulsate:_=!1,center:O=o||I.pulsate,fakeElement:B=!1}=I;if(T?.type==="mousedown"&&h.current){h.current=!1;return}T?.type==="touchstart"&&(h.current=!0);const L=B?null:b.current,j=L?L.getBoundingClientRect():{width:0,height:0,left:0,top:0};let S,$,F;if(O||T===void 0||T.clientX===0&&T.clientY===0||!T.clientX&&!T.touches)S=Math.round(j.width/2),$=Math.round(j.height/2);else{const{clientX:R,clientY:H}=T.touches&&T.touches.length>0?T.touches[0]:T;S=Math.round(R-j.left),$=Math.round(H-j.top)}if(O)F=Math.sqrt((2*j.width**2+j.height**2)/3),F%2===0&&(F+=1);else{const R=Math.max(Math.abs((L?L.clientWidth:0)-S),S)*2+2,H=Math.max(Math.abs((L?L.clientHeight:0)-$),$)*2+2;F=Math.sqrt(R**2+H**2)}T?.touches?m.current===null&&(m.current=()=>{y({pulsate:_,rippleX:S,rippleY:$,rippleSize:F,cb:D})},p.start(s8,()=>{m.current&&(m.current(),m.current=null)})):y({pulsate:_,rippleX:S,rippleY:$,rippleSize:F,cb:D})},[o,y,p]),C=M.useCallback(()=>{x({},{pulsate:!0})},[x]),E=M.useCallback((T,I)=>{if(p.clear(),T?.type==="touchend"&&m.current){m.current(),m.current=null,p.start(0,()=>{E(T,I)});return}m.current=null,u(D=>D.length>0?D.slice(1):D),f.current=I},[p]);return M.useImperativeHandle(n,()=>({pulsate:C,start:x,stop:E}),[C,x,E]),c.jsx(c8,{className:Ue(pr.root,i.root,s),ref:b,...a,children:c.jsx(Ml,{component:null,exit:!0,children:l})})});function p8(e){return Ge("MuiButtonBase",e)}const h8=qe("MuiButtonBase",["root","disabled","focusVisible"]),m8=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,s=Ke({root:["root",t&&"disabled",n&&"focusVisible"]},p8,o);return n&&r&&(s.root+=` ${r}`),s},g8=pe("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"},[`&.${h8.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),bi=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:E,onFocusVisible:T,onKeyDown:I,onKeyUp:D,onMouseDown:_,onMouseLeave:O,onMouseUp:B,onTouchEnd:L,onTouchMove:j,onTouchStart:S,tabIndex:$=0,TouchRippleProps:F,touchRippleRef:R,type:H,...V}=r,Y=M.useRef(null),q=YL(),P=Et(q.ref,R),[J,re]=M.useState(!1);u&&J&&re(!1),M.useImperativeHandle(o,()=>({focusVisible:()=>{re(!0),Y.current.focus()}}),[]);const z=q.shouldMount&&!d&&!u;M.useEffect(()=>{J&&h&&!d&&q.pulsate()},[d,h,J,q]);const ye=fo(q,"start",_,f),se=fo(q,"stop",x,f),G=fo(q,"stop",C,f),le=fo(q,"stop",B,f),oe=fo(q,"stop",Me=>{J&&Me.preventDefault(),O&&O(Me)},f),ue=fo(q,"start",S,f),ie=fo(q,"stop",L,f),Z=fo(q,"stop",j,f),de=fo(q,"stop",Me=>{Wg(Me.target)||re(!1),b&&b(Me)},!1),ae=Ve(Me=>{Y.current||(Y.current=Me.currentTarget),Wg(Me.target)&&(re(!0),T&&T(Me)),E&&E(Me)}),ne=()=>{const Me=Y.current;return l&&l!=="button"&&!(Me.tagName==="A"&&Me.href)},Ce=Ve(Me=>{h&&!Me.repeat&&J&&Me.key===" "&&q.stop(Me,()=>{q.start(Me)}),Me.target===Me.currentTarget&&ne()&&Me.key===" "&&Me.preventDefault(),I&&I(Me),Me.target===Me.currentTarget&&ne()&&Me.key==="Enter"&&!u&&(Me.preventDefault(),y&&y(Me))}),ve=Ve(Me=>{h&&Me.key===" "&&J&&!Me.defaultPrevented&&q.stop(Me,()=>{q.pulsate(Me)}),D&&D(Me),y&&Me.target===Me.currentTarget&&ne()&&Me.key===" "&&!Me.defaultPrevented&&y(Me)});let Se=l;Se==="button"&&(V.href||V.to)&&(Se=m);const he={};Se==="button"?(he.type=H===void 0?"button":H,he.disabled=u):(!V.href&&!V.to&&(he.role="button"),u&&(he["aria-disabled"]=u));const $e=Et(n,Y),Pe={...r,centerRipple:i,component:l,disabled:u,disableRipple:d,disableTouchRipple:f,focusRipple:h,tabIndex:$,focusVisible:J},Je=m8(Pe);return c.jsxs(g8,{as:Se,className:Ue(Je.root,a),ownerState:Pe,onBlur:de,onClick:y,onContextMenu:se,onFocus:ae,onKeyDown:Ce,onKeyUp:ve,onMouseDown:ye,onMouseLeave:oe,onMouseUp:le,onDragLeave:G,onTouchEnd:ie,onTouchMove:Z,onTouchStart:ue,ref:$e,tabIndex:u?-1:$,type:H,...he,...V,children:[s,z?c.jsx(f8,{ref:P,center:i,...F}):null]})});function fo(e,t,n,r=!1){return Ve(o=>(n&&n(o),r||e[t](o),!0))}function b8(e){return Ge("MuiCircularProgress",e)}qe("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Ao=44,$f=Ot.keyframes`
|
|
178
|
-
0% {
|
|
179
|
-
transform: rotate(0deg);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
100% {
|
|
183
|
-
transform: rotate(360deg);
|
|
184
|
-
}
|
|
185
|
-
`,Hf=Ot.keyframes`
|
|
186
|
-
0% {
|
|
187
|
-
stroke-dasharray: 1px, 200px;
|
|
188
|
-
stroke-dashoffset: 0;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
50% {
|
|
192
|
-
stroke-dasharray: 100px, 200px;
|
|
193
|
-
stroke-dashoffset: -15px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
100% {
|
|
197
|
-
stroke-dasharray: 1px, 200px;
|
|
198
|
-
stroke-dashoffset: -126px;
|
|
199
|
-
}
|
|
200
|
-
`,y8=typeof $f!="string"?Ot.css`
|
|
201
|
-
animation: ${$f} 1.4s linear infinite;
|
|
202
|
-
`:null,x8=typeof Hf!="string"?Ot.css`
|
|
203
|
-
animation: ${Hf} 1.4s ease-in-out infinite;
|
|
204
|
-
`:null,v8=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,i={root:["root",n,`color${Le(r)}`],svg:["svg"],circle:["circle",`circle${Le(n)}`,o&&"circleDisableShrink"]};return Ke(i,b8,t)},C8=pe("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Le(n.color)}`]]}})(pt(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:y8||{animation:`${$f} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),E8=pe("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),T8=pe("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Le(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(pt(({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:x8||{animation:`${Hf} 1.4s ease-in-out infinite`}}]}))),eh=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=v8(p),b={},y={},x={};if(f==="determinate"){const C=2*Math.PI*((Ao-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(C8,{className:Ue(m.root,o),style:{width:a,height:a,...y,...l},ownerState:p,ref:n,role:"progressbar",...x,...h,children:c.jsx(E8,{className:m.svg,ownerState:p,viewBox:`${Ao/2} ${Ao/2} ${Ao} ${Ao}`,children:c.jsx(T8,{className:m.circle,style:b,ownerState:p,cx:Ao,cy:Ao,r:(Ao-u)/2,fill:"none",strokeWidth:u})})})});function S8(e){return Ge("MuiIconButton",e)}const s1=qe("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),k8=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${Le(r)}`,o&&`edge${Le(o)}`,`size${Le(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Ke(a,S8,t)},w8=pe(bi,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${Le(n.color)}`],n.edge&&t[`edge${Le(n.edge)}`],t[`size${Le(n.size)}`]]}})(pt(({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}}]})),pt(({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)}}],[`&.${s1.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${s1.loading}`]:{color:"transparent"}}))),D8=pe("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"}}]})),Ar=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=Br(f),y=p??c.jsx(eh,{"aria-labelledby":b,color:"inherit",size:16}),x={...r,edge:o,color:a,disabled:l,disableFocusRipple:u,loading:h,loadingIndicator:y,size:d},C=k8(x);return c.jsxs(w8,{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(D8,{className:C.loadingIndicator,ownerState:x,children:h&&y})}),i]})}),rv=e=>e.scrollTop;function Ts(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}}function zf(e){return`scale(${e}, ${e**2})`}const I8={entering:{opacity:1,transform:zf(1)},entered:{opacity:1,transform:"none"}},Vd=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),ll=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=Ir,...x}=t,C=Nc(),E=M.useRef(),T=Bo(),I=M.useRef(null),D=Et(I,js(i),n),_=R=>H=>{if(R){const V=I.current;H===void 0?R(V):R(V,H)}},O=_(d),B=_((R,H)=>{rv(R);const{duration:V,delay:Y,easing:q}=Ts({style:m,timeout:b,easing:s},{mode:"enter"});let P;b==="auto"?(P=T.transitions.getAutoHeightDuration(R.clientHeight),E.current=P):P=V,R.style.transition=[T.transitions.create("opacity",{duration:P,delay:Y}),T.transitions.create("transform",{duration:Vd?P:P*.666,delay:Y,easing:q})].join(","),l&&l(R,H)}),L=_(u),j=_(p),S=_(R=>{const{duration:H,delay:V,easing:Y}=Ts({style:m,timeout:b,easing:s},{mode:"exit"});let q;b==="auto"?(q=T.transitions.getAutoHeightDuration(R.clientHeight),E.current=q):q=H,R.style.transition=[T.transitions.create("opacity",{duration:q,delay:V}),T.transitions.create("transform",{duration:Vd?q:q*.666,delay:Vd?V:V||q*.333,easing:Y})].join(","),R.style.opacity=0,R.style.transform=zf(.75),f&&f(R)}),$=_(h),F=R=>{b==="auto"&&C.start(E.current||0,R),r&&r(I.current,R)};return c.jsx(y,{appear:o,in:a,nodeRef:I,onEnter:B,onEntered:L,onEntering:O,onExit:S,onExited:$,onExiting:j,addEndListener:F,timeout:b==="auto"?null:b,...x,children:(R,{ownerState:H,...V})=>M.cloneElement(i,{style:{opacity:0,transform:zf(.75),visibility:R==="exited"&&!a?"hidden":void 0,...I8[R],...m,...i.props.style},ref:D,...V})})});ll&&(ll.muiSupportAuto=!0);const A8={entering:{opacity:1},entered:{opacity:1}},yi=M.forwardRef(function(t,n){const r=Bo(),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=Ir,...E}=t,T=M.useRef(null),I=Et(T,js(a),n),D=F=>R=>{if(F){const H=T.current;R===void 0?F(H):F(H,R)}},_=D(h),O=D((F,R)=>{rv(F);const H=Ts({style:y,timeout:x,easing:l},{mode:"enter"});F.style.webkitTransition=r.transitions.create("opacity",H),F.style.transition=r.transitions.create("opacity",H),d&&d(F,R)}),B=D(f),L=D(b),j=D(F=>{const R=Ts({style:y,timeout:x,easing:l},{mode:"exit"});F.style.webkitTransition=r.transitions.create("opacity",R),F.style.transition=r.transitions.create("opacity",R),p&&p(F)}),S=D(m),$=F=>{i&&i(T.current,F)};return c.jsx(C,{appear:s,in:u,nodeRef:T,onEnter:O,onEntered:B,onEntering:_,onExit:j,onExited:S,onExiting:L,addEndListener:$,timeout:x,...E,children:(F,{ownerState:R,...H})=>M.cloneElement(a,{style:{opacity:0,visibility:F==="exited"&&!u?"hidden":void 0,...A8[F],...y,...a.props.style},ref:I,...H})})});function O8(e){return Ge("MuiPaper",e)}qe("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 M8=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Ke(i,O8,o)},P8=pe("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}`]]}})(pt(({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)"}}]}))),wi=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiPaper"}),o=Bo(),{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=M8(f);return c.jsx(P8,{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(${_u("#fff",uf(a))}, ${_u("#fff",uf(a))})`}},...d.style}})});var qn="top",Cr="bottom",Er="right",Yn="left",th="auto",Pl=[qn,Cr,Er,Yn],Ss="start",ul="end",R8="clippingParents",ov="viewport",fa="popper",N8="reference",a1=Pl.reduce(function(e,t){return e.concat([t+"-"+Ss,t+"-"+ul])},[]),iv=[].concat(Pl,[th]).reduce(function(e,t){return e.concat([t,t+"-"+Ss,t+"-"+ul])},[]),F8="beforeRead",L8="read",_8="afterRead",B8="beforeMain",j8="main",$8="afterMain",H8="beforeWrite",z8="write",U8="afterWrite",V8=[F8,L8,_8,B8,j8,$8,H8,z8,U8];function eo(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 xi(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 nh(e){if(typeof ShadowRoot>"u")return!1;var t=sr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function W8(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)||!eo(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 q8(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)||!eo(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const Y8={name:"applyStyles",enabled:!0,phase:"write",fn:W8,effect:q8,requires:["computeStyles"]};function Zr(e){return e.split("-")[0]}var di=Math.max,ec=Math.min,ks=Math.round;function Uf(){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 sv(){return!/^((?!chrome|android).)*safari/i.test(Uf())}function ws(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&&ks(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&ks(r.height)/e.offsetHeight||1);var s=xi(e)?sr(e):window,a=s.visualViewport,l=!sv()&&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 rh(e){var t=ws(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 av(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&nh(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function vo(e){return sr(e).getComputedStyle(e)}function K8(e){return["table","td","th"].indexOf(eo(e))>=0}function Ho(e){return((xi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Bc(e){return eo(e)==="html"?e:e.assignedSlot||e.parentNode||(nh(e)?e.host:null)||Ho(e)}function l1(e){return!yr(e)||vo(e).position==="fixed"?null:e.offsetParent}function G8(e){var t=/firefox/i.test(Uf()),n=/Trident/i.test(Uf());if(n&&yr(e)){var r=vo(e);if(r.position==="fixed")return null}var o=Bc(e);for(nh(o)&&(o=o.host);yr(o)&&["html","body"].indexOf(eo(o))<0;){var i=vo(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 Rl(e){for(var t=sr(e),n=l1(e);n&&K8(n)&&vo(n).position==="static";)n=l1(n);return n&&(eo(n)==="html"||eo(n)==="body"&&vo(n).position==="static")?t:n||G8(e)||t}function oh(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ga(e,t,n){return di(e,ec(t,n))}function Q8(e,t,n){var r=Ga(e,t,n);return r>n?n:r}function lv(){return{top:0,right:0,bottom:0,left:0}}function uv(e){return Object.assign({},lv(),e)}function cv(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var X8=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,uv(typeof t!="number"?t:cv(t,Pl))};function Z8(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Zr(n.placement),l=oh(a),u=[Yn,Er].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!s)){var f=X8(o.padding,n),h=rh(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=Rl(i),C=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,E=b/2-y/2,T=f[p],I=C-h[d]-f[m],D=C/2-h[d]/2+E,_=Ga(T,D,I),O=l;n.modifiersData[r]=(t={},t[O]=_,t.centerOffset=_-D,t)}}function J8(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)||av(t.elements.popper,o)&&(t.elements.arrow=o))}const e_={name:"arrow",enabled:!0,phase:"main",fn:Z8,effect:J8,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ds(e){return e.split("-")[1]}var t_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function n_(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:ks(n*o)/o||0,y:ks(r*o)/o||0}}function u1(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"),E=Yn,T=qn,I=window;if(u){var D=Rl(n),_="clientHeight",O="clientWidth";if(D===sr(n)&&(D=Ho(n),vo(D).position!=="static"&&a==="absolute"&&(_="scrollHeight",O="scrollWidth")),D=D,o===qn||(o===Yn||o===Er)&&i===ul){T=Cr;var B=f&&D===I&&I.visualViewport?I.visualViewport.height:D[_];b-=B-r.height,b*=l?1:-1}if(o===Yn||(o===qn||o===Cr)&&i===ul){E=Er;var L=f&&D===I&&I.visualViewport?I.visualViewport.width:D[O];p-=L-r.width,p*=l?1:-1}}var j=Object.assign({position:a},u&&t_),S=d===!0?n_({x:p,y:b},sr(n)):{x:p,y:b};if(p=S.x,b=S.y,l){var $;return Object.assign({},j,($={},$[T]=C?"0":"",$[E]=x?"0":"",$.transform=(I.devicePixelRatio||1)<=1?"translate("+p+"px, "+b+"px)":"translate3d("+p+"px, "+b+"px, 0)",$))}return Object.assign({},j,(t={},t[T]=C?b+"px":"",t[E]=x?p+"px":"",t.transform="",t))}function r_(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:Zr(t.placement),variation:Ds(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,u1(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,u1(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 o_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:r_,data:{}};var ou={passive:!0};function i_(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,ou)}),a&&l.addEventListener("resize",n.update,ou),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,ou)}),a&&l.removeEventListener("resize",n.update,ou)}}const s_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:i_,data:{}};var a_={left:"right",right:"left",bottom:"top",top:"bottom"};function Au(e){return e.replace(/left|right|bottom|top/g,function(t){return a_[t]})}var l_={start:"end",end:"start"};function c1(e){return e.replace(/start|end/g,function(t){return l_[t]})}function ih(e){var t=sr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function sh(e){return ws(Ho(e)).left+ih(e).scrollLeft}function u_(e,t){var n=sr(e),r=Ho(e),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var u=sv();(u||!u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+sh(e),y:l}}function c_(e){var t,n=Ho(e),r=ih(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=di(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=di(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+sh(e),l=-r.scrollTop;return vo(o||n).direction==="rtl"&&(a+=di(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function ah(e){var t=vo(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function dv(e){return["html","body","#document"].indexOf(eo(e))>=0?e.ownerDocument.body:yr(e)&&ah(e)?e:dv(Bc(e))}function Qa(e,t){var n;t===void 0&&(t=[]);var r=dv(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=sr(r),s=o?[i].concat(i.visualViewport||[],ah(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(Qa(Bc(s)))}function Vf(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function d_(e,t){var n=ws(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 d1(e,t,n){return t===ov?Vf(u_(e,n)):xi(t)?d_(t,n):Vf(c_(Ho(e)))}function f_(e){var t=Qa(Bc(e)),n=["absolute","fixed"].indexOf(vo(e).position)>=0,r=n&&yr(e)?Rl(e):e;return xi(r)?t.filter(function(o){return xi(o)&&av(o,r)&&eo(o)!=="body"}):[]}function p_(e,t,n,r){var o=t==="clippingParents"?f_(e):[].concat(t),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,u){var d=d1(e,u,r);return l.top=di(d.top,l.top),l.right=ec(d.right,l.right),l.bottom=ec(d.bottom,l.bottom),l.left=di(d.left,l.left),l},d1(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 fv(e){var t=e.reference,n=e.element,r=e.placement,o=r?Zr(r):null,i=r?Ds(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?oh(o):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case Ss:l[u]=l[u]-(t[d]/2-n[d]/2);break;case ul:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function cl(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?R8:a,u=n.rootBoundary,d=u===void 0?ov:u,f=n.elementContext,h=f===void 0?fa:f,p=n.altBoundary,m=p===void 0?!1:p,b=n.padding,y=b===void 0?0:b,x=uv(typeof y!="number"?y:cv(y,Pl)),C=h===fa?N8:fa,E=e.rects.popper,T=e.elements[m?C:h],I=p_(xi(T)?T:T.contextElement||Ho(e.elements.popper),l,d,s),D=ws(e.elements.reference),_=fv({reference:D,element:E,placement:o}),O=Vf(Object.assign({},E,_)),B=h===fa?O:D,L={top:I.top-B.top+x.top,bottom:B.bottom-I.bottom+x.bottom,left:I.left-B.left+x.left,right:B.right-I.right+x.right},j=e.modifiersData.offset;if(h===fa&&j){var S=j[o];Object.keys(L).forEach(function($){var F=[Er,Cr].indexOf($)>=0?1:-1,R=[qn,Cr].indexOf($)>=0?"y":"x";L[$]+=S[R]*F})}return L}function h_(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?iv:l,d=Ds(r),f=d?a?a1:a1.filter(function(m){return Ds(m)===d}):Pl,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]=cl(e,{placement:b,boundary:o,rootBoundary:i,padding:s})[Zr(b)],m},{});return Object.keys(p).sort(function(m,b){return p[m]-p[b]})}function m_(e){if(Zr(e)===th)return[];var t=Au(e);return[c1(e),t,c1(t)]}function g_(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=Zr(y),C=x===y,E=l||(C||!m?[Au(y)]:m_(y)),T=[y].concat(E).reduce(function(ye,se){return ye.concat(Zr(se)===th?h_(t,{placement:se,boundary:d,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:b}):se)},[]),I=t.rects.reference,D=t.rects.popper,_=new Map,O=!0,B=T[0],L=0;L<T.length;L++){var j=T[L],S=Zr(j),$=Ds(j)===Ss,F=[qn,Cr].indexOf(S)>=0,R=F?"width":"height",H=cl(t,{placement:j,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),V=F?$?Er:Yn:$?Cr:qn;I[R]>D[R]&&(V=Au(V));var Y=Au(V),q=[];if(i&&q.push(H[S]<=0),a&&q.push(H[V]<=0,H[Y]<=0),q.every(function(ye){return ye})){B=j,O=!1;break}_.set(j,q)}if(O)for(var P=m?3:1,J=function(se){var G=T.find(function(le){var oe=_.get(le);if(oe)return oe.slice(0,se).every(function(ue){return ue})});if(G)return B=G,"break"},re=P;re>0;re--){var z=J(re);if(z==="break")break}t.placement!==B&&(t.modifiersData[r]._skip=!0,t.placement=B,t.reset=!0)}}const b_={name:"flip",enabled:!0,phase:"main",fn:g_,requiresIfExists:["offset"],data:{_skip:!1}};function f1(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 p1(e){return[qn,Er,Cr,Yn].some(function(t){return e[t]>=0})}function y_(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=cl(t,{elementContext:"reference"}),a=cl(t,{altBoundary:!0}),l=f1(s,r),u=f1(a,o,i),d=p1(l),f=p1(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 x_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:y_};function v_(e,t,n){var r=Zr(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 C_(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,s=iv.reduce(function(d,f){return d[f]=v_(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 E_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:C_};function T_(e){var t=e.state,n=e.name;t.modifiersData[n]=fv({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const S_={name:"popperOffsets",enabled:!0,phase:"read",fn:T_,data:{}};function k_(e){return e==="x"?"y":"x"}function w_(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=cl(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:d}),x=Zr(t.placement),C=Ds(t.placement),E=!C,T=oh(x),I=k_(T),D=t.modifiersData.popperOffsets,_=t.rects.reference,O=t.rects.popper,B=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,L=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(D){if(i){var $,F=T==="y"?qn:Yn,R=T==="y"?Cr:Er,H=T==="y"?"height":"width",V=D[T],Y=V+y[F],q=V-y[R],P=p?-O[H]/2:0,J=C===Ss?_[H]:O[H],re=C===Ss?-O[H]:-_[H],z=t.elements.arrow,ye=p&&z?rh(z):{width:0,height:0},se=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:lv(),G=se[F],le=se[R],oe=Ga(0,_[H],ye[H]),ue=E?_[H]/2-P-oe-G-L.mainAxis:J-oe-G-L.mainAxis,ie=E?-_[H]/2+P+oe+le+L.mainAxis:re+oe+le+L.mainAxis,Z=t.elements.arrow&&Rl(t.elements.arrow),de=Z?T==="y"?Z.clientTop||0:Z.clientLeft||0:0,ae=($=j?.[T])!=null?$:0,ne=V+ue-ae-de,Ce=V+ie-ae,ve=Ga(p?ec(Y,ne):Y,V,p?di(q,Ce):q);D[T]=ve,S[T]=ve-V}if(a){var Se,he=T==="x"?qn:Yn,$e=T==="x"?Cr:Er,Pe=D[I],Je=I==="y"?"height":"width",Me=Pe+y[he],Nt=Pe-y[$e],ct=[qn,Yn].indexOf(x)!==-1,tt=(Se=j?.[I])!=null?Se:0,xe=ct?Me:Pe-_[Je]-O[Je]-tt+L.altAxis,Oe=ct?Pe+_[Je]+O[Je]-tt-L.altAxis:Nt,We=p&&ct?Q8(xe,Pe,Oe):Ga(p?xe:Me,Pe,p?Oe:Nt);D[I]=We,S[I]=We-Pe}t.modifiersData[r]=S}}const D_={name:"preventOverflow",enabled:!0,phase:"main",fn:w_,requiresIfExists:["offset"]};function I_(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function A_(e){return e===sr(e)||!yr(e)?ih(e):I_(e)}function O_(e){var t=e.getBoundingClientRect(),n=ks(t.width)/e.offsetWidth||1,r=ks(t.height)/e.offsetHeight||1;return n!==1||r!==1}function M_(e,t,n){n===void 0&&(n=!1);var r=yr(t),o=yr(t)&&O_(t),i=Ho(t),s=ws(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((eo(t)!=="body"||ah(i))&&(a=A_(t)),yr(t)?(l=ws(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=sh(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function P_(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 R_(e){var t=P_(e);return V8.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function N_(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function F_(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 h1={placement:"bottom",modifiers:[],strategy:"absolute"};function m1(){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 L_(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,i=o===void 0?h1:o;return function(a,l,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},h1,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:xi(a)?Qa(a):a.contextElement?Qa(a.contextElement):[],popper:Qa(l)};var E=R_(F_([].concat(r,d.options.modifiers)));return d.orderedModifiers=E.filter(function(T){return T.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var x=d.elements,C=x.reference,E=x.popper;if(m1(C,E)){d.rects={reference:M_(C,Rl(E),d.options.strategy==="fixed"),popper:rh(E)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(L){return d.modifiersData[L.name]=Object.assign({},L.data)});for(var T=0;T<d.orderedModifiers.length;T++){if(d.reset===!0){d.reset=!1,T=-1;continue}var I=d.orderedModifiers[T],D=I.fn,_=I.options,O=_===void 0?{}:_,B=I.name;typeof D=="function"&&(d=D({state:d,options:O,name:B,instance:p})||d)}}}},update:N_(function(){return new Promise(function(y){p.forceUpdate(),y(d)})}),destroy:function(){b(),h=!0}};if(!m1(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,E=C===void 0?{}:C,T=y.effect;if(typeof T=="function"){var I=T({state:d,name:x,instance:p,options:E}),D=function(){};f.push(I||D)}})}function b(){f.forEach(function(y){return y()}),f=[]}return p}}var __=[s_,S_,o_,Y8,E_,b_,D_,e_,x_],B_=L_({defaultModifiers:__});function j_(e){return typeof e=="function"?e():e}const pv=M.forwardRef(function(t,n){const{children:r,container:o,disablePortal:i=!1}=t,[s,a]=M.useState(null),l=Et(M.isValidElement(r)?js(r):null,n);if(yn(()=>{i||a(j_(o)||document.body)},[o,i]),yn(()=>{if(s&&!i)return cf(n,s),()=>{cf(n,null)}},[n,s,i]),i){if(M.isValidElement(r)){const u={ref:l};return M.cloneElement(r,u)}return r}return s&&FT.createPortal(r,s)});function $_(e){return Ge("MuiPopper",e)}qe("MuiPopper",["root"]);function H_(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 Wf(e){return typeof e=="function"?e():e}function z_(e){return e.nodeType!==void 0}const U_=e=>{const{classes:t}=e;return Ke({root:["root"]},$_,t)},V_={},W_=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=Et(x,n),E=M.useRef(null),T=Et(E,f),I=M.useRef(T);yn(()=>{I.current=T},[T]),M.useImperativeHandle(f,()=>E.current,[]);const D=H_(u,i),[_,O]=M.useState(D),[B,L]=M.useState(Wf(r));M.useEffect(()=>{E.current&&E.current.forceUpdate()}),M.useEffect(()=>{r&&L(Wf(r))},[r]),yn(()=>{if(!B||!l)return;const R=Y=>{O(Y.placement)};let H=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:Y})=>{R(Y)}}];a!=null&&(H=H.concat(a)),d&&d.modifiers!=null&&(H=H.concat(d.modifiers));const V=B_(B,x.current,{placement:D,...d,modifiers:H});return I.current(V),()=>{V.destroy(),I.current(null)}},[B,s,a,l,d,D]);const j={placement:_};m!==null&&(j.TransitionProps=m);const S=U_(t),$=p.root??"div",F=Ct({elementType:$,externalSlotProps:h.root,externalForwardedProps:y,additionalProps:{role:"tooltip",ref:C},ownerState:t,className:S.root});return c.jsx($,{...F,children:typeof o=="function"?o(j):o})}),q_=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=V_,popperRef:p,style:m,transition:b=!1,slotProps:y={},slots:x={},...C}=t,[E,T]=M.useState(!0),I=()=>{T(!1)},D=()=>{T(!0)};if(!l&&!d&&(!b||E))return null;let _;if(i)_=i;else if(r){const L=Wf(r);_=L&&z_(L)?gn(L).body:gn(null).body}const O=!d&&l&&(!b||E)?"none":void 0,B=b?{in:d,onEnter:I,onExited:D}:void 0;return c.jsx(pv,{disablePortal:a,container:_,children:c.jsx(W_,{anchorEl:r,direction:s,disablePortal:a,modifiers:u,ref:n,open:b?!E:d,placement:f,popperOptions:h,popperRef:p,slotProps:y,slots:x,...C,style:{position:"fixed",top:0,left:0,display:O,...m},TransitionProps:B,children:o})})}),Y_=pe(q_,{name:"MuiPopper",slot:"Root"})({}),lh=M.forwardRef(function(t,n){const r=wr(),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:E,...T}=o,I=C?.root??a?.Root,D={anchorEl:i,container:u,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:m,popperOptions:b,popperRef:y,transition:x,...T};return c.jsx(Y_,{as:s,direction:r?"rtl":"ltr",slots:{root:I},slotProps:E??l,...D,ref:n})}),K_=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function G_(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 Q_(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 X_(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||Q_(e))}function Z_(e){const t=[],n=[];return Array.from(e.querySelectorAll(K_)).forEach((r,o)=>{const i=G_(r);i===-1||!X_(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 J_(){return!0}function hv(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=Z_,isEnabled:s=J_,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=Et(js(t),m),y=M.useRef(null);M.useEffect(()=>{!a||!m.current||(p.current=!n)},[n,a]),M.useEffect(()=>{if(!a||!m.current)return;const E=gn(m.current);return m.current.contains(E.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 E=gn(m.current),T=_=>{y.current=_,!(r||!s()||_.key!=="Tab")&&E.activeElement===m.current&&_.shiftKey&&(l.current=!0,d.current&&d.current.focus())},I=()=>{const _=m.current;if(_===null)return;if(!E.hasFocus()||!s()||l.current){l.current=!1;return}if(_.contains(E.activeElement)||r&&E.activeElement!==u.current&&E.activeElement!==d.current)return;if(E.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!p.current)return;let O=[];if((E.activeElement===u.current||E.activeElement===d.current)&&(O=i(m.current)),O.length>0){const B=!!(y.current?.shiftKey&&y.current?.key==="Tab"),L=O[0],j=O[O.length-1];typeof L!="string"&&typeof j!="string"&&(B?j.focus():L.focus())}else _.focus()};E.addEventListener("focusin",I),E.addEventListener("keydown",T,!0);const D=setInterval(()=>{E.activeElement&&E.activeElement.tagName==="BODY"&&I()},50);return()=>{clearInterval(D),E.removeEventListener("focusin",I),E.removeEventListener("keydown",T,!0)}},[n,r,o,s,a,i]);const x=E=>{f.current===null&&(f.current=E.relatedTarget),p.current=!0,h.current=E.target;const T=t.props.onFocus;T&&T(E)},C=E=>{f.current===null&&(f.current=E.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 e7(e){return Ge("MuiPickersPopper",e)}qe("MuiPickersPopper",["root","paper"]);function t7(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const n7=(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},r7="@media (pointer: fine)",o7="@media (prefers-reduced-motion: reduce)",hs=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),g1=hs&&hs[1]?parseInt(hs[1],10):null,b1=hs&&hs[2]?parseInt(hs[2],10):null,i7=g1&&g1<10||b1&&b1<13||!1,mv=()=>_2(o7,{defaultMatches:!1})||i7,s7=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],a7=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"]},e7,t)},l7=pe(lh,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),u7=pe(wi,{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 c7(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function d7(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=gn(o.current);if(!o.current||"clientX"in l&&c7(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=gn(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=gn(o.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[e,s]),[o,a,a]}const f7=M.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:o,children:i,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:u}=e,d=et(e,s7),f=Q({},o,{placement:r}),h=Ct({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:a,ownerState:f});return c.jsx(n,Q({},d,h,{onClick:p=>{l(p),h.onClick?.(p)},onTouchStart:p=>{u(p),h.onTouchStart?.(p)},ownerState:f,children:i}))});function p7(e){const t=Gt({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 R(H){l&&H.key==="Escape"&&a()}return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[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]=d7(l,s??a),C=M.useRef(null),E=Et(C,o),T=Et(E,b),I=t,D=a7(I),_=mv(),O=p??_,B=R=>{R.key==="Escape"&&(R.stopPropagation(),a())},L=f?.desktopTransition??O?yi:ll,j=f?.desktopTrapFocus??hv,S=f?.desktopPaper??u7,$=f?.popper??l7,F=Ct({elementType:$,externalSlotProps:h?.popper,additionalProps:{transition:!0,role:u,open:l,anchorEl:n,placement:d,onKeyDown:B},className:D.root,ownerState:t});return c.jsx($,Q({},F,{children:({TransitionProps:R,placement:H})=>c.jsx(j,Q({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:u==="tooltip",isEnabled:()=>!0},h?.desktopTrapFocus,{children:c.jsx(L,Q({},R,h?.desktopTransition,{children:c.jsx(f7,{PaperComponent:S,ownerState:I,popperPlacement:H,ref:T,onPaperClick:y,onPaperTouchStart:x,paperClasses:D.paper,paperSlotProps:h?.desktopPaper,children:r})}))}))}))}const h7=({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}},uh=({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}},ch=({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 uh({timezone:t,value:a,defaultValue:void 0,referenceDate:o,onChange:u,valueManager:s})},m7=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},g7=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},b7=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},y7=({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=ki(),{isOpen:C,setIsOpen:E}=h7(e),{timezone:T,value:I,handleValueChange:D}=uh({timezone:d,value:a,defaultValue:h,referenceDate:f,onChange:s,valueManager:t}),[_,O]=M.useState(()=>{let ue;return I!==void 0?ue=I:h!==void 0?ue=h:ue=t.emptyValue,{draft:ue,lastPublishedValue:ue,lastCommittedValue:ue,lastControlledValue:a,hasBeenModifiedSinceMount:!1}}),B=t.getTimezone(y,_.draft);m!==d&&(b(d),d&&B&&d!==B&&O(ue=>Q({},ue,{draft:t.setTimezone(y,d,ue.draft)})));const{getValidationErrorForNewValue:L}=ev({props:e,validator:o,timezone:T,value:_.draft,onError:e.onError}),j=Ve(ue=>{const ie={action:ue,dateState:_,hasChanged:ve=>!t.areValuesEqual(y,ue.value,ve),isControlled:p,closeOnSelect:u},Z=m7(ie),de=g7(ie),ae=b7(ie);O(ve=>Q({},ve,{draft:ue.value,lastPublishedValue:Z?ue.value:ve.lastPublishedValue,lastCommittedValue:de?ue.value:ve.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let ne=null;const Ce=()=>(ne||(ne={validationError:ue.name==="setValueFromField"?ue.context.validationError:L(ue.value)},ue.name==="setValueFromShortcut"&&(ne.shortcut=ue.shortcut)),ne);Z&&D(ue.value,Ce()),de&&i&&i(ue.value,Ce()),ae&&E(!1)});if(_.lastControlledValue!==a){const ue=t.areValuesEqual(y,_.draft,I);O(ie=>Q({},ie,{lastControlledValue:a},ue?{}:{lastCommittedValue:I,lastPublishedValue:I,draft:I,hasBeenModifiedSinceMount:!0}))}const S=Ve(()=>{j({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),$=Ve(()=>{j({value:_.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),F=Ve(()=>{j({value:_.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),R=Ve(()=>{j({value:_.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),H=Ve(()=>{j({value:t.getTodayValue(y,T,n),name:"setValueFromAction",pickerAction:"today"})}),V=Ve(ue=>{ue.preventDefault(),E(!0)}),Y=Ve(ue=>{ue?.preventDefault(),E(!1)}),q=Ve((ue,ie="partial")=>j({name:"setValueFromView",value:ue,selectionState:ie})),P=Ve((ue,ie,Z)=>j({name:"setValueFromShortcut",value:ue,changeImportance:ie,shortcut:Z})),J=Ve((ue,ie)=>j({name:"setValueFromField",value:ue,context:ie})),re={onClear:S,onAccept:$,onDismiss:F,onCancel:R,onSetToday:H,onOpen:V,onClose:Y},z={value:_.draft,onChange:J},ye=M.useMemo(()=>t.cleanValue(y,_.draft),[y,t,_.draft]),se={value:ye,onChange:q,onClose:Y,open:C},le=Q({},re,{value:ye,onChange:q,onSelectShortcut:P,isValid:ue=>{const ie=o({adapter:x,value:ue,timezone:T,props:e});return!t.hasError(ie)}}),oe=M.useMemo(()=>({onOpen:V,onClose:Y,open:C}),[C,Y,V]);return{open:C,fieldProps:z,viewProps:se,layoutProps:le,actions:re,contextValue:oe}};function gv({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(_=>!o.includes(_)))&&(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,E=Ve((_,O)=>{b(O?_:B=>_===B?null:B),a?.(_,O)}),T=Ve(_=>{E(_,!0),_!==f&&(h(_),t&&t(_))}),I=Ve(()=>{C&&T(C)}),D=Ve((_,O,B)=>{const L=O==="finish",j=B?o.indexOf(B)<o.length-1:!!C;if(e(_,L&&j?"partial":O,B),B&&B!==f){const $=o[o.indexOf(B)+1];$&&T($)}else L&&I()});return{view:f,setView:T,focusedView:m,setFocusedView:E,nextView:C,previousView:x,defaultView:o.includes(n)?n:o[0],goToNextView:I,setValueAndGoToNextView:D}}const x7=["className","sx"],v7=({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=et(e,x7),{view:y,setView:x,defaultView:C,focusedView:E,setFocusedView:T,setValueAndGoToNextView:I}=gv({view:u,views:d,openTo:f,onChange:s,onViewChange:h,autoFocus:r}),{hasUIView:D,viewModeLookup:_}=M.useMemo(()=>d.reduce((F,R)=>{let H;return p[R]!=null?H="UI":H="field",F.viewModeLookup[R]=H,H==="UI"&&(F.hasUIView=!0),F},{hasUIView:!1,viewModeLookup:{}}),[p,d]),O=M.useMemo(()=>d.reduce((F,R)=>p[R]!=null&&ZF(R)?F+1:F,0),[p,d]),B=_[y],L=Ve(()=>B==="UI"),[j,S]=M.useState(B==="UI"?y:null);return j!==y&&_[y]==="UI"&&S(y),yn(()=>{B==="field"&&a&&(l(),setTimeout(()=>{i?.current?.setSelectedSections(y),i?.current?.focusField(y)}))},[y]),yn(()=>{if(!a)return;let F=y;B==="field"&&j!=null&&(F=j),F!==C&&_[F]==="UI"&&_[C]==="UI"&&(F=C),F!==y&&x(F),T(F,!0)},[a]),{hasUIView:D,shouldRestoreFocus:L,layoutProps:{views:d,view:j,onViewChange:x},renderCurrentView:()=>{if(j==null)return null;const F=p[j];if(F==null)return null;const R=Q({},b,n,t,{views:d,timezone:m,onChange:I,view:j,onViewChange:x,focusedView:E,onFocusedViewChange:T,showViewSwitcher:O>1,timeViewsCount:O});return o?o(p,j,R):F(R)}}};function y1(){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 C7=(e,t)=>{const[n,r]=M.useState(y1);return yn(()=>{const i=()=>{r(y1())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),t7(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},E7=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:o}=e,i=C7(n.views,o),s=wr();return{layoutProps:Q({},n,t,{isLandscape:i,isRtl:s,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}};function T7(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 bv=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:o,validator:i,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{const u=y7({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i}),d=v7({props:e,additionalViewProps:o,autoFocusView:s,fieldRef:l,propsFromPickerValue:u.viewProps,rendererInterceptor:a}),f=E7({props:e,wrapperVariant:r,propsFromPickerValue:u.layoutProps,propsFromPickerViews:d.layoutProps}),h=T7({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 yv(e){return Ge("MuiPickersLayout",e)}const Qo=qe("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]);function S7(e){return Ge("MuiButton",e)}const Xo=qe("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"]),k7=M.createContext({}),w7=M.createContext(void 0),D7=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}${Le(t)}`,`size${Le(o)}`,`${i}Size${Le(o)}`,`color${Le(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${Le(a)}`],startIcon:["icon","startIcon",`iconSize${Le(o)}`],endIcon:["icon","endIcon",`iconSize${Le(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},d=Ke(u,S7,l);return{...l,...d}},xv=[{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}}}],I7=pe(bi,{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}${Le(n.color)}`],t[`size${Le(n.size)}`],t[`${n.variant}Size${Le(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(pt(({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"},[`&.${Xo.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]},[`&.${Xo.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Xo.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)",[`&.${Xo.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"},[`&.${Xo.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Xo.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}),[`&.${Xo.loading}`]:{color:"transparent"}}}]}})),A7=pe("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Le(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}},...xv]})),O7=pe("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Le(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}},...xv]})),M7=pe("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}}]})),x1=pe("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),tn=M.forwardRef(function(t,n){const r=M.useContext(k7),o=M.useContext(w7),i=nl(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:E,loadingPosition:T="center",size:I="medium",startIcon:D,type:_,variant:O="text",...B}=s,L=Br(x),j=E??c.jsx(eh,{"aria-labelledby":L,color:"inherit",size:16}),S={...s,color:l,component:u,disabled:f,disableElevation:h,disableFocusRipple:p,fullWidth:y,loading:C,loadingIndicator:j,loadingPosition:T,size:I,type:_,variant:O},$=D7(S),F=(D||C&&T==="start")&&c.jsx(A7,{className:$.startIcon,ownerState:S,children:D||c.jsx(x1,{className:$.loadingIconPlaceholder,ownerState:S})}),R=(m||C&&T==="end")&&c.jsx(O7,{className:$.endIcon,ownerState:S,children:m||c.jsx(x1,{className:$.loadingIconPlaceholder,ownerState:S})}),H=o||"",V=typeof C=="boolean"?c.jsx("span",{className:$.loadingWrapper,style:{display:"contents"},children:C&&c.jsx(M7,{className:$.loadingIndicator,ownerState:S,children:j})}):null;return c.jsxs(I7,{ownerState:S,className:Ue(r.className,$.root,d,H),component:u,disabled:f||C,focusRipple:!p,focusVisibleClassName:Ue($.focusVisible,b),ref:n,type:_,id:C?L:x,...B,classes:$,children:[F,T!=="end"&&V,a,T==="end"&&V,R]})});function P7(e){return Ge("MuiDialogActions",e)}qe("MuiDialogActions",["root","spacing"]);const R7=e=>{const{classes:t,disableSpacing:n}=e;return Ke({root:["root",!n&&"spacing"]},P7,t)},N7=pe("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}}}]}),oo=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:i=!1,...s}=r,a={...r,disableSpacing:i},l=R7(a);return c.jsx(N7,{className:Ue(l.root,o),ownerState:a,ref:n,...s})}),F7=["onAccept","onClear","onCancel","onSetToday","actions"];function L7(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:o,actions:i}=e,s=et(e,F7),a=Eo();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(oo,Q({},s,{children:l}))}const go=M.createContext({});function _7(e){return Ge("MuiList",e)}qe("MuiList",["root","padding","dense","subheader"]);const B7=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Ke({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},_7,t)},j7=pe("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}}]}),vv=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=B7(h);return c.jsx(go.Provider,{value:f,children:c.jsxs(j7,{as:s,className:Ue(p.root,i),ref:n,ownerState:h,...d,children:[u,o]})})});function $7(e){return Ge("MuiListItem",e)}qe("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);const H7=qe("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function z7(e){return Ge("MuiListItemSecondaryAction",e)}qe("MuiListItemSecondaryAction",["root","disableGutters"]);const U7=e=>{const{disableGutters:t,classes:n}=e;return Ke({root:["root",t&&"disableGutters"]},z7,n)},V7=pe("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}}]}),Cv=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemSecondaryAction"}),{className:o,...i}=r,s=M.useContext(go),a={...r,disableGutters:s.disableGutters},l=U7(a);return c.jsx(V7,{className:Ue(l.root,o),ownerState:a,ref:n,...i})});Cv.muiName="ListItemSecondaryAction";const W7=(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]},q7=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"]},$7,n)},Y7=pe("div",{name:"MuiListItem",slot:"Root",overridesResolver:W7})(pt(({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:{[`& > .${H7.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}}]}))),K7=pe("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),G7=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:E={},...T}=r,I=M.useContext(go),D=M.useMemo(()=>({dense:p||I.dense||!1,alignItems:o,disableGutters:m}),[o,I.dense,p,m]),_=M.useRef(null),O=M.Children.toArray(i),B=O.length&&pu(O[O.length-1],["ListItemSecondaryAction"]),L={...r,alignItems:o,dense:D.dense,disableGutters:m,disablePadding:b,divider:y,hasSecondaryAction:B},j=q7(L),S=Et(_,n),$=E.root||l.Root||Y7,F=C.root||u.root||{},R={className:Ue(j.root,F.className,s),...T};let H=a||"li";return B?(H=!R.component&&!a?"div":H,d==="li"&&(H==="li"?H="div":R.component==="li"&&(R.component="div")),c.jsx(go.Provider,{value:D,children:c.jsxs(K7,{as:d,className:Ue(j.container,f),ref:S,ownerState:L,...h,children:[c.jsx($,{...F,...!Es($)&&{as:H,ownerState:{...L,...F.ownerState}},...R,children:O}),O.pop()]})})):c.jsx(go.Provider,{value:D,children:c.jsxs($,{...F,as:H,ref:S,...!Es($)&&{ownerState:{...L,...F.ownerState}},...R,children:[O,x&&c.jsx(Cv,{children:x})]})})}),Q7=gt(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 X7(e){return Ge("MuiChip",e)}const Tt=qe("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"]);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}=z2({className:n,...l,externalForwardedProps:e==="root"?h:void 0,externalSlotProps:m}),C=Et(x,m?.ref,t.ref),E=e==="root"?b||u:b,T=H2(p,{...e==="root"&&!u&&!d[e]&&s,...e!=="root"&&!d[e]&&s,...y,...E&&!a&&{as:E},...E&&a&&{component:E},ref:C},o);return[p,T]}const Z7=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${Le(r)}`,`color${Le(o)}`,a&&"clickable",a&&`clickableColor${Le(o)}`,s&&"deletable",s&&`deletableColor${Le(o)}`,`${l}${Le(o)}`],label:["label",`label${Le(r)}`],avatar:["avatar",`avatar${Le(r)}`,`avatarColor${Le(o)}`],icon:["icon",`icon${Le(r)}`,`iconColor${Le(i)}`],deleteIcon:["deleteIcon",`deleteIcon${Le(r)}`,`deleteIconColor${Le(o)}`,`deleteIcon${Le(l)}Color${Le(o)}`]};return Ke(u,X7,t)},J7=pe("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${Le(a)}`]},{[`& .${Tt.avatar}`]:t[`avatarColor${Le(r)}`]},{[`& .${Tt.icon}`]:t.icon},{[`& .${Tt.icon}`]:t[`icon${Le(a)}`]},{[`& .${Tt.icon}`]:t[`iconColor${Le(o)}`]},{[`& .${Tt.deleteIcon}`]:t.deleteIcon},{[`& .${Tt.deleteIcon}`]:t[`deleteIcon${Le(a)}`]},{[`& .${Tt.deleteIcon}`]:t[`deleteIconColor${Le(r)}`]},{[`& .${Tt.deleteIcon}`]:t[`deleteIcon${Le(l)}Color${Le(r)}`]},t.root,t[`size${Le(a)}`],t[`color${Le(r)}`],i&&t.clickable,i&&r!=="default"&&t[`clickableColor${Le(r)})`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${Le(r)}`],t[l],t[`${l}${Le(r)}`]]}})(pt(({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}}}}))]}})),e9=pe("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${Le(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 v1(e){return e.key==="Backspace"||e.key==="Delete"}const Ev=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:E,skipFocusWhenDisabled:T=!1,slots:I={},slotProps:D={},..._}=r,O=M.useRef(null),B=Et(O,n),L=G=>{G.stopPropagation(),m&&m(G)},j=G=>{G.currentTarget===G.target&&v1(G)&&G.preventDefault(),b&&b(G)},S=G=>{G.currentTarget===G.target&&m&&v1(G)&&m(G),y&&y(G)},$=s!==!1&&p?!0:s,F=$||m?bi:l||"div",R={...r,component:F,disabled:d,size:x,color:a,iconColor:M.isValidElement(f)&&f.props.color||a,onDelete:!!m,clickable:$,variant:C},H=Z7(R),V=F===bi?{component:l||"div",focusVisibleClassName:H.focusVisible,...m&&{disableRipple:!0}}:{};let Y=null;m&&(Y=u&&M.isValidElement(u)?M.cloneElement(u,{className:Ue(u.props.className,H.deleteIcon),onClick:L}):c.jsx(Q7,{className:H.deleteIcon,onClick:L}));let q=null;o&&M.isValidElement(o)&&(q=M.cloneElement(o,{className:Ue(H.avatar,o.props.className)}));let P=null;f&&M.isValidElement(f)&&(P=M.cloneElement(f,{className:Ue(H.icon,f.props.className)}));const J={slots:I,slotProps:D},[re,z]=kt("root",{elementType:J7,externalForwardedProps:{...J,..._},ownerState:R,shouldForwardComponentProp:!0,ref:B,className:Ue(H.root,i),additionalProps:{disabled:$&&d?!0:void 0,tabIndex:T&&d?-1:E,...V},getSlotProps:G=>({...G,onClick:le=>{G.onClick?.(le),p?.(le)},onKeyDown:le=>{G.onKeyDown?.(le),j(le)},onKeyUp:le=>{G.onKeyUp?.(le),S(le)}})}),[ye,se]=kt("label",{elementType:e9,externalForwardedProps:J,ownerState:R,className:H.label});return c.jsxs(re,{as:F,...z,children:[q||P,c.jsx(ye,{...se,children:h}),Y]})}),dl=36,jc=2,$c=320,t9=280,dh=336,n9=["items","changeImportance","isLandscape","onChange","isValid"],r9=["getValue"];function o9(e){const{items:t,changeImportance:n="accept",onChange:r,isValid:o}=e,i=et(e,n9);if(t==null||t.length===0)return null;const s=t.map(a=>{let{getValue:l}=a,u=et(a,r9);const d=l({isValid:o});return Q({},u,{label:u.label,onClick:()=>{r(d,n,u)},disabled:!o(d)})});return c.jsx(vv,Q({dense:!0,sx:[{maxHeight:dh,maxWidth:200,overflow:"auto"},...Array.isArray(i.sx)?i.sx:[i.sx]]},i,{children:s.map(a=>c.jsx(G7,{children:c.jsx(Ev,Q({},a))},a.id??a.label))}))}function i9(e){return e.view!==null}const s9=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"]},yv,t)},a9=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,E=s9(e),T=x?.actionBar??L7,I=Ct({elementType:T,externalSlotProps:C?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:o,onSetToday:i,actions:t==="desktop"?[]:["cancel","accept"]},className:E.actionBar,ownerState:Q({},e,{wrapperVariant:t})}),D=c.jsx(T,Q({},I)),_=x?.toolbar,O=Ct({elementType:_,externalSlotProps:C?.toolbar,additionalProps:{isLandscape:p,onChange:d,value:u,view:s,onViewChange:l,views:a,disabled:m,readOnly:b},className:E.toolbar,ownerState:Q({},e,{wrapperVariant:t})}),B=i9(O)&&_?c.jsx(_,Q({},O)):null,L=y,j=x?.tabs,S=s&&j?c.jsx(j,Q({view:s,onViewChange:l,className:E.tabs},C?.tabs)):null,$=x?.shortcuts??o9,F=Ct({elementType:$,externalSlotProps:C?.shortcuts,additionalProps:{isValid:h,isLandscape:p,onChange:f},className:E.shortcuts,ownerState:{isValid:h,isLandscape:p,onChange:f,wrapperVariant:t}}),R=s&&$?c.jsx($,Q({},F)):null;return{toolbar:B,content:L,tabs:S,actionBar:D,shortcuts:R}},l9=e=>{const{isLandscape:t,classes:n}=e;return Ke({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},yv,n)},u9=pe("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${Qo.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${Qo.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${Qo.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${Qo.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${Qo.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${Qo.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${Qo.shortcuts}`]:{gridColumn:3}}}]}),c9=pe("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),Tv=M.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiPickersLayout"}),{toolbar:o,content:i,tabs:s,actionBar:a,shortcuts:l}=a9(r),{sx:u,className:d,isLandscape:f,wrapperVariant:h}=r,p=l9(r);return c.jsxs(u9,{ref:n,sx:u,className:Ue(p.root,d),ownerState:r,children:[f?l:o,f?o:l,c.jsx(c9,{className:p.contentWrapper,children:h==="desktop"?c.jsxs(M.Fragment,{children:[i,s]}):c.jsxs(M.Fragment,{children:[s,i]})}),a]})}),d9=M.createContext(null);function Sv(e){const{contextValue:t,localeText:n,children:r}=e;return c.jsx(d9.Provider,{value:t,children:c.jsx(al,{localeText:n,children:r})})}const f9=["props","getOpenDialogAriaText"],p9=["ownerState"],h9=["ownerState"],m9=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=et(e,f9);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:E,localeText:T,reduceAnimations:I}=t,D=M.useRef(null),_=M.useRef(null),O=Br(),B=i?.toolbar?.hidden??!1,{open:L,actions:j,hasUIView:S,layoutProps:$,renderCurrentView:F,shouldRestoreFocus:R,fieldProps:H,contextValue:V,ownerState:Y}=bv(Q({},r,{props:t,fieldRef:_,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),q=o.inputAdornment??tv,P=Ct({elementType:q,externalSlotProps:i?.inputAdornment,additionalProps:{position:"end"},ownerState:t}),J=et(P,p9),re=o.openPickerButton??Ar,z=Ct({elementType:re,externalSlotProps:i?.openPickerButton,additionalProps:{disabled:C||x,onClick:L?j.onClose:j.onOpen,"aria-label":n(H.value),edge:J.position},ownerState:t}),ye=et(z,h9),se=o.openPickerIcon,G=Ct({elementType:se,externalSlotProps:i?.openPickerIcon,ownerState:Y}),le=o.field,oe=Ct({elementType:le,externalSlotProps:i?.field,additionalProps:Q({},H,B&&{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:E&&!t.open,focused:L?!0:void 0},y?{inputRef:y}:{}),ownerState:t});S&&(oe.InputProps=Q({},oe.InputProps,{ref:D},!t.disableOpenPicker&&{[`${J.position}Adornment`]:c.jsx(q,Q({},J,{children:c.jsx(re,Q({},ye,{children:c.jsx(se,Q({},G))}))}))}));const ue=Q({textField:o.textField,clearIcon:o.clearIcon,clearButton:o.clearButton},oe.slots),ie=o.layout??Tv;let Z=O;B&&(b?Z=`${O}-label`:Z=void 0);const de=Q({},i,{toolbar:Q({},i?.toolbar,{titleId:O}),popper:Q({"aria-labelledby":Z},i?.popper)}),ae=Et(_,oe.unstableFieldRef);return{renderPicker:()=>c.jsxs(Sv,{contextValue:V,localeText:T,children:[c.jsx(le,Q({},oe,{slots:ue,slotProps:de,unstableFieldRef:ae})),c.jsx(p7,Q({role:"dialog",placement:"bottom-start",anchorEl:D.current},j,{open:L,slots:o,slotProps:de,shouldRestoreFocus:R,reduceAnimations:I,children:c.jsx(ie,Q({},$,de?.layout,{slots:o,slotProps:de,children:F()}))}))]})}},g9=gt(c.jsx("path",{d:"M7 10l5 5 5-5z"})),b9=gt(c.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})),y9=gt(c.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),x9=gt(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"}));gt(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"})]}));gt(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"}));gt(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 v9=gt(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 iu(e){return parseInt(e,10)||0}const C9={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function E9(e){for(const t in e)return!1;return!0}function C1(e){return E9(e)||e.outerHeightStyle===0&&!e.overflowing}const T9=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=Et(n,d),h=M.useRef(null),p=M.useRef(null),m=M.useCallback(()=>{const E=d.current,T=p.current;if(!E||!T)return;const D=xo(E).getComputedStyle(E);if(D.width==="0px")return{outerHeightStyle:0,overflowing:!1};T.style.width=D.width,T.value=E.value||t.placeholder||"x",T.value.slice(-1)===`
|
|
205
|
-
`&&(T.value+=" ");const _=D.boxSizing,O=iu(D.paddingBottom)+iu(D.paddingTop),B=iu(D.borderBottomWidth)+iu(D.borderTopWidth),L=T.scrollHeight;T.value="x";const j=T.scrollHeight;let S=L;i&&(S=Math.max(Number(i)*j,S)),o&&(S=Math.min(Number(o)*j,S)),S=Math.max(S,j);const $=S+(_==="border-box"?O+B:0),F=Math.abs(S-L)<=1;return{outerHeightStyle:$,overflowing:F}},[o,i,t.placeholder]),b=Ve(()=>{const E=d.current,T=m();if(!E||!T||C1(T))return!1;const I=T.outerHeightStyle;return h.current!=null&&h.current!==I}),y=M.useCallback(()=>{const E=d.current,T=m();if(!E||!T||C1(T))return;const I=T.outerHeightStyle;h.current!==I&&(h.current=I,E.style.height=`${I}px`),E.style.overflow=T.overflowing?"hidden":""},[m]),x=M.useRef(-1);yn(()=>{const E=Yb(y),T=d?.current;if(!T)return;const I=xo(T);I.addEventListener("resize",E);let D;return typeof ResizeObserver<"u"&&(D=new ResizeObserver(()=>{b()&&(D.unobserve(T),cancelAnimationFrame(x.current),y(),x.current=requestAnimationFrame(()=>{D.observe(T)}))}),D.observe(T)),()=>{E.clear(),cancelAnimationFrame(x.current),I.removeEventListener("resize",E),D&&D.disconnect()}},[m,y,b]),yn(()=>{y()});const C=E=>{u||y();const T=E.target,I=T.value.length,D=T.value.endsWith(`
|
|
206
|
-
`),_=T.selectionStart===I;D&&_&&T.setSelectionRange(I,I),r&&r(E)};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:{...C9.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function Di({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),{})}function E1(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function tc(e,t=!1){return e&&(E1(e.value)&&e.value!==""||t&&E1(e.defaultValue)&&e.defaultValue!=="")}function S9(e){return e.startAdornment}function k9(e){return Ge("MuiInputBase",e)}const tr=qe("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var T1;const Hc=(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${Le(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},zc=(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]},w9=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${Le(n)}`,r&&"disabled",o&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",h&&h!=="medium"&&`size${Le(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,k9,t)},Uc=pe("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Hc})(pt(({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%"}}]}))),Vc=pe("input",{name:"MuiInputBase",slot:"Input",overridesResolver:zc})(pt(({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"}}]}})),S1=nw({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),fh=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:E={},inputRef:T,margin:I,maxRows:D,minRows:_,multiline:O=!1,name:B,onBlur:L,onChange:j,onClick:S,onFocus:$,onKeyDown:F,onKeyUp:R,placeholder:H,readOnly:V,renderSuffix:Y,rows:q,size:P,slotProps:J={},slots:re={},startAdornment:z,type:ye="text",value:se,...G}=r,le=E.value!=null?E.value:se,{current:oe}=M.useRef(le!=null),ue=M.useRef(),ie=M.useCallback(Fe=>{},[]),Z=Et(ue,T,E.ref,ie),[de,ae]=M.useState(!1),ne=ar(),Ce=Di({props:r,muiFormControl:ne,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Ce.focused=ne?ne.focused:de,M.useEffect(()=>{!ne&&h&&de&&(ae(!1),L&&L())},[ne,h,de,L]);const ve=ne&&ne.onFilled,Se=ne&&ne.onEmpty,he=M.useCallback(Fe=>{tc(Fe)?ve&&ve():Se&&Se()},[ve,Se]);yn(()=>{oe&&he({value:le})},[le,he,oe]);const $e=Fe=>{$&&$(Fe),E.onFocus&&E.onFocus(Fe),ne&&ne.onFocus?ne.onFocus(Fe):ae(!0)},Pe=Fe=>{L&&L(Fe),E.onBlur&&E.onBlur(Fe),ne&&ne.onBlur?ne.onBlur(Fe):ae(!1)},Je=(Fe,...dt)=>{if(!oe){const lt=Fe.target||ue.current;if(lt==null)throw new Error(bo(1));he({value:lt.value})}E.onChange&&E.onChange(Fe,...dt),j&&j(Fe,...dt)};M.useEffect(()=>{he(ue.current)},[]);const Me=Fe=>{ue.current&&Fe.currentTarget===Fe.target&&ue.current.focus(),S&&S(Fe)};let Nt=C,ct=E;O&&Nt==="input"&&(q?ct={type:void 0,minRows:q,maxRows:q,...ct}:ct={type:void 0,maxRows:D,minRows:_,...ct},Nt=T9);const tt=Fe=>{he(Fe.animationName==="mui-auto-fill-cancel"?ue.current:{value:"x"})};M.useEffect(()=>{ne&&ne.setAdornedStart(!!z)},[ne,z]);const xe={...r,color:Ce.color||"primary",disabled:Ce.disabled,endAdornment:m,error:Ce.error,focused:Ce.focused,formControl:ne,fullWidth:y,hiddenLabel:Ce.hiddenLabel,multiline:O,size:Ce.size,startAdornment:z,type:ye},Oe=w9(xe),We=re.root||u.Root||Uc,Xe=J.root||d.root||{},Ze=re.input||u.Input||Vc;return ct={...ct,...J.input??d.input},c.jsxs(M.Fragment,{children:[!p&&typeof S1=="function"&&(T1||(T1=c.jsx(S1,{}))),c.jsxs(We,{...Xe,ref:n,onClick:Me,...G,...!Es(We)&&{ownerState:{...xe,...Xe.ownerState}},className:Ue(Oe.root,Xe.className,a,V&&"MuiInputBase-readOnly"),children:[z,c.jsx(_c.Provider,{value:null,children:c.jsx(Ze,{"aria-invalid":Ce.error,"aria-describedby":o,autoComplete:i,autoFocus:s,defaultValue:f,disabled:Ce.disabled,id:x,onAnimationStart:tt,name:B,placeholder:H,readOnly:V,required:Ce.required,rows:q,value:le,onKeyDown:F,onKeyUp:R,type:ye,...ct,...!Es(Ze)&&{as:Nt,ownerState:{...xe,...ct.ownerState}},ref:Z,className:Ue(Oe.input,ct.className,V&&"MuiInputBase-readOnly"),onBlur:Pe,onChange:Je,onFocus:$e})}),m,Y?Y({...Ce,startAdornment:z}):null]})]})});function D9(e){return Ge("MuiInput",e)}const Po={...tr,...qe("MuiInput",["root","underline","input"])},I9=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},D9,t);return{...t,...o}},A9=pe(Uc,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Hc(e,t),!n.disableUnderline&&t.underline]}})(pt(({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"},[`&.${Po.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Po.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(.${Po.disabled}, .${Po.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${Po.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}`}}}))]}})),O9=pe(Vc,{name:"MuiInput",slot:"Input",overridesResolver:zc})({}),ph=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=I9(r),y={root:{ownerState:{disableUnderline:o}}},x=d??s?An(d??s,y):y,C=f.root??i.Root??A9,E=f.input??i.Input??O9;return c.jsx(fh,{slots:{root:C,input:E},slotProps:x,fullWidth:a,inputComponent:l,multiline:u,ref:n,type:h,...p,classes:m})});ph.muiName="Input";function M9(e){return Ge("MuiFilledInput",e)}const nr={...tr,...qe("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},P9=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${Le(i)}`,s&&"hiddenLabel",a&&"multiline"],input:["input"]},u=Ke(l,M9,t);return{...t,...u}},R9=pe(Uc,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Hc(e,t),!n.disableUnderline&&t.underline]}})(pt(({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}}]}})),N9=pe(Vc,{name:"MuiFilledInput",slot:"Input",overridesResolver:zc})(pt(({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}}]}))),hh=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=P9(r),x={root:{ownerState:b},input:{ownerState:b}},C=f??s?An(x,f??s):x,E=h.root??i.Root??R9,T=h.input??i.Input??N9;return c.jsx(fh,{slots:{root:E,input:T},slotProps:C,fullWidth:a,inputComponent:u,multiline:d,ref:n,type:p,...m,classes:y})});hh.muiName="Input";var k1;const F9=pe("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%"}),L9=pe("legend",{name:"MuiNotchedOutlined",shouldForwardProp:$n})(pt(({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 _9(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(F9,{"aria-hidden":!0,className:r,ownerState:l,...s,children:c.jsx(L9,{ownerState:l,children:a?c.jsx("span",{children:o}):k1||(k1=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:""}))})})}function B9(e){return Ge("MuiOutlinedInput",e)}const fr={...tr,...qe("MuiOutlinedInput",["root","notchedOutline","input"])},j9=e=>{const{classes:t}=e,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},B9,t);return{...t,...r}},$9=pe(Uc,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Hc})(pt(({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"}}]}})),H9=pe(_9,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(pt(({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}})),z9=pe(Vc,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:zc})(pt(({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}}]}))),mh=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=j9(r),b=ar(),y=Di({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??$9,E=d.input??o.Input??z9,[T,I]=kt("notchedOutline",{elementType:H9,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(fh,{slots:{root:C,input:E},slotProps:f,renderSuffix:D=>c.jsx(T,{...I,notched:typeof u<"u"?u:!!(D.startAdornment||D.filled||D.focused)}),fullWidth:i,inputComponent:s,multiline:l,ref:n,type:h,...p,classes:{...m,notchedOutline:null}})});mh.muiName="Input";function U9(e){return Ge("MuiFormLabel",e)}const Xa=qe("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),V9=e=>{const{classes:t,color:n,focused:r,disabled:o,error:i,filled:s,required:a}=e,l={root:["root",`color${Le(n)}`,o&&"disabled",i&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",i&&"error"]};return Ke(l,U9,t)},W9=pe("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(pt(({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:{[`&.${Xa.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${Xa.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Xa.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),q9=pe("span",{name:"MuiFormLabel",slot:"Asterisk"})(pt(({theme:e})=>({[`&.${Xa.error}`]:{color:(e.vars||e).palette.error.main}}))),Y9=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=Di({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=V9(y);return c.jsxs(W9,{as:a,ownerState:y,className:Ue(x.root,i),ref:n,...p,children:[o,b.required&&c.jsxs(q9,{ownerState:y,"aria-hidden":!0,className:x.asterisk,children:[" ","*"]})]})});function K9(e){return Ge("MuiInputLabel",e)}qe("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const G9=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${Le(r)}`,s],asterisk:[a&&"asterisk"]},u=Ke(l,K9,t);return{...t,...u}},Q9=pe(Y9,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Xa.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]]}})(pt(({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)"}}]}))),nc=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=Di({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=G9(p);return c.jsx(Q9,{"data-shrink":f,ref:n,className:Ue(m.root,l),...u,ownerState:p,classes:m})});function X9(e){return Ge("MuiFormControl",e)}qe("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Z9=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${Le(n)}`,r&&"fullWidth"]};return Ke(o,X9,t)},J9=pe("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Le(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%"}}]}),rc=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},E=Z9(C),[T,I]=M.useState(()=>{let R=!1;return o&&M.Children.forEach(o,H=>{if(!pu(H,["Input","Select"]))return;const V=pu(H,["Select"])?H.props.input:H;V&&S9(V.props)&&(R=!0)}),R}),[D,_]=M.useState(()=>{let R=!1;return o&&M.Children.forEach(o,H=>{pu(H,["Input","Select"])&&(tc(H.props,!0)||tc(H.props.inputProps,!0))&&(R=!0)}),R}),[O,B]=M.useState(!1);l&&O&&B(!1);const L=d!==void 0&&!l?d:O;let j;M.useRef(!1);const S=M.useCallback(()=>{_(!0)},[]),$=M.useCallback(()=>{_(!1)},[]),F=M.useMemo(()=>({adornedStart:T,setAdornedStart:I,color:s,disabled:l,error:u,filled:D,focused:L,fullWidth:f,hiddenLabel:h,size:b,onBlur:()=>{B(!1)},onFocus:()=>{B(!0)},onEmpty:$,onFilled:S,registerEffect:j,required:m,variant:y}),[T,s,l,u,D,L,f,h,j,$,S,m,b,y]);return c.jsx(_c.Provider,{value:F,children:c.jsx(J9,{as:a,ownerState:C,className:Ue(E.root,i),ref:n,...x,children:o})})});function eB(e){return Ge("MuiFormHelperText",e)}const w1=qe("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var D1;const tB=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${Le(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Ke(u,eB,t)},nB=pe("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Le(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(pt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${w1.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${w1.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}}]}))),kv=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=Di({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=tB(x);return c.jsx(nB,{as:s,className:Ue(C.root,i),ref:n,...m,ownerState:x,children:o===" "?D1||(D1=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):o})});function Wd(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function I1(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function wv(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 pa(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")||!wv(a,i)||l)a=o(e,a,n);else return a.focus(),!0}return!1}const rB=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:(E,{direction:T})=>{const I=!p.current.style.width;if(E.clientHeight<p.current.clientHeight&&I){const D=`${$2(xo(E))}px`;p.current.style[T==="rtl"?"paddingLeft":"paddingRight"]=D,p.current.style.width=`calc(100% + ${D})`}return p.current}}),[]);const b=E=>{const T=p.current,I=E.key;if(E.ctrlKey||E.metaKey||E.altKey){d&&d(E);return}const _=gn(T).activeElement;if(I==="ArrowDown")E.preventDefault(),pa(T,_,u,l,Wd);else if(I==="ArrowUp")E.preventDefault(),pa(T,_,u,l,I1);else if(I==="Home")E.preventDefault(),pa(T,null,u,l,Wd);else if(I==="End")E.preventDefault(),pa(T,null,u,l,I1);else if(I.length===1){const O=m.current,B=I.toLowerCase(),L=performance.now();O.keys.length>0&&(L-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&B!==O.keys[0]&&(O.repeating=!1)),O.lastTime=L,O.keys.push(B);const j=_&&!O.repeating&&wv(_,O);O.previousKeyMatched&&(j||pa(T,_,!1,l,Wd,O))?E.preventDefault():O.previousKeyMatched=!1}d&&d(E)},y=Et(p,n);let x=-1;M.Children.forEach(s,(E,T)=>{if(!M.isValidElement(E)){x===T&&(x+=1,x>=s.length&&(x=-1));return}E.props.disabled||(f==="selectedMenu"&&E.props.selected||x===-1)&&(x=T),x===T&&(E.props.disabled||E.props.muiSkipListHighlight||E.type.muiSkipListHighlight)&&(x+=1,x>=s.length&&(x=-1))});const C=M.Children.map(s,(E,T)=>{if(T===x){const I={};return i&&(I.autoFocus=!0),E.props.tabIndex===void 0&&f==="selectedMenu"&&(I.tabIndex=0),M.cloneElement(E,I)}return E});return c.jsx(vv,{role:"menu",ref:y,className:a,onKeyDown:b,tabIndex:o?0:-1,...h,children:C})});function oB(e){const t=gn(e);return t.body===e?xo(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Za(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function A1(e){return parseInt(xo(e).getComputedStyle(e).paddingRight,10)||0}function iB(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 O1(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,s=>{const a=!i.includes(s),l=!iB(s);a&&l&&Za(s,o)})}function qd(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function sB(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(oB(r)){const s=$2(xo(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${A1(r)+s}px`;const a=gn(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${A1(l)+s}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=gn(r).body;else{const s=r.parentElement,a=xo(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 aB(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class lB{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&&Za(t.modalRef,!1);const o=aB(n);O1(n,t.mount,t.modalRef,o,!0);const i=qd(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=qd(this.containers,i=>i.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=sB(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=qd(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&&Za(t.modalRef,n),O1(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&&Za(s.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function uB(e){return Ge("MuiBackdrop",e)}qe("MuiBackdrop",["root","invisible"]);const cB=e=>{const{classes:t,invisible:n}=e;return Ke({root:["root",n&&"invisible"]},uB,t)},dB=pe("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"}}]}),Dv=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=cB(y),C={transition:p,root:u.Root,...h},E={...d,...f},T={component:s,slots:C,slotProps:E},[I,D]=kt("root",{elementType:dB,externalForwardedProps:T,className:Ue(x.root,i),ownerState:y}),[_,O]=kt("transition",{elementType:yi,externalForwardedProps:T,ownerState:y});return c.jsx(_,{in:l,timeout:m,...b,...O,children:c.jsx(I,{"aria-hidden":!0,...D,classes:x,ref:n,children:o})})});function fB(e){return typeof e=="function"?e():e}function pB(e){return e?e.props.hasOwnProperty("in"):!1}const M1=()=>{},su=new lB;function hB(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=Et(p,d),[b,y]=M.useState(!u),x=pB(a);let C=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(C=!1);const E=()=>gn(h.current),T=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),I=()=>{su.mount(T(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},D=Ve(()=>{const R=fB(t)||E().body;su.add(T(),R),p.current&&I()}),_=()=>su.isTopModal(T()),O=Ve(R=>{h.current=R,R&&(u&&_()?I():p.current&&Za(p.current,C))}),B=M.useCallback(()=>{su.remove(T(),C)},[C]);M.useEffect(()=>()=>{B()},[B]),M.useEffect(()=>{u?D():(!x||!o)&&B()},[u,B,x,o,D]);const L=R=>H=>{R.onKeyDown?.(H),!(H.key!=="Escape"||H.which===229||!_())&&(n||(H.stopPropagation(),l&&l(H,"escapeKeyDown")))},j=R=>H=>{R.onClick?.(H),H.target===H.currentTarget&&l&&l(H,"backdropClick")};return{getRootProps:(R={})=>{const H=Ln(e);delete H.onTransitionEnter,delete H.onTransitionExited;const V={...H,...R};return{role:"presentation",...V,onKeyDown:L(V),ref:m}},getBackdropProps:(R={})=>{const H=R;return{"aria-hidden":!0,...H,onClick:j(H),open:u}},getTransitionProps:()=>{const R=()=>{y(!1),i&&i()},H=()=>{y(!0),s&&s(),o&&B()};return{onEnter:Im(R,a?.props.onEnter??M1),onExited:Im(H,a?.props.onExited??M1)}},rootRef:m,portalRef:O,isTopModal:_,exited:b,hasTransition:x}}function mB(e){return Ge("MuiModal",e)}qe("MuiModal",["root","hidden","backdrop"]);const gB=e=>{const{open:t,exited:n,classes:r}=e;return Ke({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},mB,r)},bB=pe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(pt(({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"}}]}))),yB=pe(Dv,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),Iv=M.forwardRef(function(t,n){const r=ut({name:"MuiModal",props:t}),{BackdropComponent:o=yB,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:E=!1,hideBackdrop:T=!1,keepMounted:I=!1,onClose:D,onTransitionEnter:_,onTransitionExited:O,open:B,slotProps:L={},slots:j={},theme:S,...$}=r,F={...r,closeAfterTransition:l,disableAutoFocus:m,disableEnforceFocus:b,disableEscapeKeyDown:y,disablePortal:x,disableRestoreFocus:C,disableScrollLock:E,hideBackdrop:T,keepMounted:I},{getRootProps:R,getBackdropProps:H,getTransitionProps:V,portalRef:Y,isTopModal:q,exited:P,hasTransition:J}=hB({...F,rootRef:n}),re={...F,exited:P},z=gB(re),ye={};if(u.props.tabIndex===void 0&&(ye.tabIndex="-1"),J){const{onEnter:ie,onExited:Z}=V();ye.onEnter=ie,ye.onExited=Z}const se={slots:{root:h.Root,backdrop:h.Backdrop,...j},slotProps:{...p,...L}},[G,le]=kt("root",{ref:n,elementType:bB,externalForwardedProps:{...se,...$,component:f},getSlotProps:R,ownerState:re,className:Ue(a,z?.root,!re.open&&re.exited&&z?.hidden)}),[oe,ue]=kt("backdrop",{ref:i?.ref,elementType:o,externalForwardedProps:se,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:ie=>H({...ie,onClick:Z=>{ie?.onClick&&ie.onClick(Z)}}),className:Ue(i?.className,z?.backdrop),ownerState:re});return!I&&!B&&(!J||P)?null:c.jsx(pv,{ref:Y,container:d,disablePortal:x,children:c.jsxs(G,{...le,children:[!T&&o?c.jsx(oe,{...ue}):null,c.jsx(hv,{disableEnforceFocus:b,disableAutoFocus:m,disableRestoreFocus:C,isEnabled:q,open:B,children:M.cloneElement(u,ye)})]})})});function xB(e){return Ge("MuiPopover",e)}qe("MuiPopover",["root","paper"]);function P1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function R1(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 au(e){return typeof e=="function"?e():e}const vB=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"]},xB,t)},CB=pe(Iv,{name:"MuiPopover",slot:"Root"})({}),Av=pe(wi,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),EB=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:E,transitionDuration:T="auto",TransitionProps:I={},disableScrollLock:D=!1,..._}=r,O=M.useRef(),B={...r,anchorOrigin:s,anchorReference:l,elevation:h,marginThreshold:p,transformOrigin:C,TransitionComponent:E,transitionDuration:T,TransitionProps:I},L=vB(B),j=M.useCallback(()=>{if(l==="anchorPosition")return a;const ie=au(i),de=(ie&&ie.nodeType===1?ie:gn(O.current).body).getBoundingClientRect();return{top:de.top+P1(de,s.vertical),left:de.left+R1(de,s.horizontal)}},[i,s.horizontal,s.vertical,a,l]),S=M.useCallback(ie=>({vertical:P1(ie,C.vertical),horizontal:R1(ie,C.horizontal)}),[C.horizontal,C.vertical]),$=M.useCallback(ie=>{const Z={width:ie.offsetWidth,height:ie.offsetHeight},de=S(Z);if(l==="none")return{top:null,left:null,transformOrigin:N1(de)};const ae=j();let ne=ae.top-de.vertical,Ce=ae.left-de.horizontal;const ve=ne+Z.height,Se=Ce+Z.width,he=xo(au(i)),$e=he.innerHeight-p,Pe=he.innerWidth-p;if(p!==null&&ne<p){const Je=ne-p;ne-=Je,de.vertical+=Je}else if(p!==null&&ve>$e){const Je=ve-$e;ne-=Je,de.vertical+=Je}if(p!==null&&Ce<p){const Je=Ce-p;Ce-=Je,de.horizontal+=Je}else if(Se>Pe){const Je=Se-Pe;Ce-=Je,de.horizontal+=Je}return{top:`${Math.round(ne)}px`,left:`${Math.round(Ce)}px`,transformOrigin:N1(de)}},[i,l,j,S,p]),[F,R]=M.useState(m),H=M.useCallback(()=>{const ie=O.current;if(!ie)return;const Z=$(ie);Z.top!==null&&ie.style.setProperty("top",Z.top),Z.left!==null&&(ie.style.left=Z.left),ie.style.transformOrigin=Z.transformOrigin,R(!0)},[$]);M.useEffect(()=>(D&&window.addEventListener("scroll",H),()=>window.removeEventListener("scroll",H)),[i,D,H]);const V=()=>{H()},Y=()=>{R(!1)};M.useEffect(()=>{m&&H()}),M.useImperativeHandle(o,()=>m?{updatePosition:()=>{H()}}:null,[m,H]),M.useEffect(()=>{if(!m)return;const ie=Yb(()=>{H()}),Z=xo(au(i));return Z.addEventListener("resize",ie),()=>{ie.clear(),Z.removeEventListener("resize",ie)}},[i,m,H]);let q=T;const P={slots:{transition:E,...y},slotProps:{transition:I,paper:b,...x}},[J,re]=kt("transition",{elementType:ll,externalForwardedProps:P,ownerState:B,getSlotProps:ie=>({...ie,onEntering:(Z,de)=>{ie.onEntering?.(Z,de),V()},onExited:Z=>{ie.onExited?.(Z),Y()}}),additionalProps:{appear:!0,in:m}});T==="auto"&&!J.muiSupportAuto&&(q=void 0);const z=f||(i?gn(au(i)).body:void 0),[ye,{slots:se,slotProps:G,...le}]=kt("root",{ref:n,elementType:CB,externalForwardedProps:{...P,..._},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:y.backdrop},slotProps:{backdrop:Kb(typeof x.backdrop=="function"?x.backdrop(B):x.backdrop,{invisible:!0})},container:z,open:m},ownerState:B,className:Ue(L.root,d)}),[oe,ue]=kt("paper",{ref:O,className:L.paper,elementType:Av,externalForwardedProps:P,shouldForwardComponentProp:!0,additionalProps:{elevation:h,style:F?void 0:{opacity:0}},ownerState:B});return c.jsx(ye,{...le,...!Es(ye)&&{slots:se,slotProps:G,disableScrollLock:D},children:c.jsx(J,{...re,timeout:q,children:c.jsx(oe,{...ue,children:u})})})});function TB(e){return Ge("MuiMenu",e)}qe("MuiMenu",["root","paper","list"]);const SB={vertical:"top",horizontal:"right"},kB={vertical:"top",horizontal:"left"},wB=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"],list:["list"]},TB,t)},DB=pe(EB,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),IB=pe(Av,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),AB=pe(rB,{name:"MuiMenu",slot:"List"})({outline:0}),OB=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={},...E}=r,T=wr(),I={...r,autoFocus:o,disableAutoFocusItem:a,MenuListProps:l,onEntering:m,PaperProps:f,transitionDuration:p,TransitionProps:b,variant:y},D=wB(I),_=o&&!a&&d,O=M.useRef(null),B=(q,P)=>{O.current&&O.current.adjustStyleForScrollbar(q,{direction:T?"rtl":"ltr"}),m&&m(q,P)},L=q=>{q.key==="Tab"&&(q.preventDefault(),u&&u(q,"tabKeyDown"))};let j=-1;M.Children.map(i,(q,P)=>{M.isValidElement(q)&&(q.props.disabled||(y==="selectedMenu"&&q.props.selected||j===-1)&&(j=P))});const S={slots:x,slotProps:{list:l,transition:b,paper:f,...C}},$=Ct({elementType:x.root,externalSlotProps:C.root,ownerState:I,className:[D.root,s]}),[F,R]=kt("paper",{className:D.paper,elementType:IB,externalForwardedProps:S,shouldForwardComponentProp:!0,ownerState:I}),[H,V]=kt("list",{className:Ue(D.list,l.className),elementType:AB,shouldForwardComponentProp:!0,externalForwardedProps:S,getSlotProps:q=>({...q,onKeyDown:P=>{L(P),q.onKeyDown?.(P)}}),ownerState:I}),Y=typeof S.slotProps.transition=="function"?S.slotProps.transition(I):S.slotProps.transition;return c.jsx(DB,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:T?"right":"left"},transformOrigin:T?SB:kB,slots:{root:x.root,paper:F,backdrop:x.backdrop,...x.transition&&{transition:x.transition}},slotProps:{root:$,paper:R,backdrop:typeof C.backdrop=="function"?C.backdrop(I):C.backdrop,transition:{...Y,onEntering:(...q)=>{B(...q),Y?.onEntering?.(...q)}}},open:d,ref:n,transitionDuration:p,ownerState:I,...E,classes:h,children:c.jsx(H,{actions:O,autoFocus:o&&(j===-1||a),autoFocusItem:_,variant:y,...V,children:i})})});function MB(e){return Ge("MuiNativeSelect",e)}const gh=qe("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),PB=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${Le(n)}`,i&&"iconOpen",r&&"disabled"]};return Ke(a,MB,t)},Ov=pe("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${gh.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}}}]})),RB=pe(Ov,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:$n,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${gh.multiple}`]:t.multiple}]}})({}),Mv=pe("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${gh.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}}]})),NB=pe(Mv,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Le(n.variant)}`],n.open&&t.iconOpen]}})({}),FB=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=PB(d);return c.jsxs(M.Fragment,{children:[c.jsx(RB,{ownerState:d,className:Ue(f.select,r),disabled:o,ref:a||n,...u}),t.multiple?null:c.jsx(NB,{as:s,ownerState:d,className:f.icon})]})});function Pv(e){return Ge("MuiSelect",e)}const ha=qe("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var F1;const LB=pe(Ov,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${ha.select}`]:t.select},{[`&.${ha.select}`]:t[n.variant]},{[`&.${ha.error}`]:t.error},{[`&.${ha.multiple}`]:t.multiple}]}})({[`&.${ha.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),_B=pe(Mv,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Le(n.variant)}`],n.open&&t.iconOpen]}})({}),BB=pe("input",{shouldForwardProp:e=>qb(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function L1(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function jB(e){return e==null||typeof e=="string"&&!e.trim()}const $B=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${Le(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ke(a,Pv,t)},HB=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:E,onBlur:T,onChange:I,onClose:D,onFocus:_,onOpen:O,open:B,readOnly:L,renderValue:j,required:S,SelectDisplayProps:$={},tabIndex:F,type:R,value:H,variant:V="standard",...Y}=t,[q,P]=or({controlled:H,default:d,name:"Select"}),[J,re]=or({controlled:B,default:u,name:"Select"}),z=M.useRef(null),ye=M.useRef(null),[se,G]=M.useState(null),{current:le}=M.useRef(B!=null),[oe,ue]=M.useState(),ie=Et(n,b),Z=M.useCallback(be=>{ye.current=be,be&&G(be)},[]),de=se?.parentNode;M.useImperativeHandle(ie,()=>({focus:()=>{ye.current.focus()},node:z.current,value:q}),[q]),M.useEffect(()=>{u&&J&&se&&!le&&(ue(s?null:de.clientWidth),ye.current.focus())},[se,s]),M.useEffect(()=>{i&&ye.current.focus()},[i]),M.useEffect(()=>{if(!y)return;const be=gn(ye.current).getElementById(y);if(be){const Ae=()=>{getSelection().isCollapsed&&ye.current.focus()};return be.addEventListener("click",Ae),()=>{be.removeEventListener("click",Ae)}}},[y]);const ae=(be,Ae)=>{be?O&&O(Ae):D&&D(Ae),le||(ue(s?null:de.clientWidth),re(be))},ne=be=>{be.button===0&&(be.preventDefault(),ye.current.focus(),ae(!0,be))},Ce=be=>{ae(!1,be)},ve=M.Children.toArray(a),Se=be=>{const Ae=ve.find(Re=>Re.props.value===be.target.value);Ae!==void 0&&(P(Ae.props.value),I&&I(be,Ae))},he=be=>Ae=>{let Re;if(Ae.currentTarget.hasAttribute("tabindex")){if(C){Re=Array.isArray(q)?q.slice():[];const Qe=q.indexOf(be.props.value);Qe===-1?Re.push(be.props.value):Re.splice(Qe,1)}else Re=be.props.value;if(be.props.onClick&&be.props.onClick(Ae),q!==Re&&(P(Re),I)){const Qe=Ae.nativeEvent||Ae,st=new Qe.constructor(Qe.type,Qe);Object.defineProperty(st,"target",{writable:!0,value:{value:Re,name:E}}),I(st,be)}C||ae(!1,Ae)}},$e=be=>{L||[" ","ArrowUp","ArrowDown","Enter"].includes(be.key)&&(be.preventDefault(),ae(!0,be))},Pe=se!==null&&J,Je=be=>{!Pe&&T&&(Object.defineProperty(be,"target",{writable:!0,value:{value:q,name:E}}),T(be))};delete Y["aria-invalid"];let Me,Nt;const ct=[];let tt=!1;(tc({value:q})||h)&&(j?Me=j(q):tt=!0);const xe=ve.map(be=>{if(!M.isValidElement(be))return null;let Ae;if(C){if(!Array.isArray(q))throw new Error(bo(2));Ae=q.some(Re=>L1(Re,be.props.value)),Ae&&tt&&ct.push(be.props.children)}else Ae=L1(q,be.props.value),Ae&&tt&&(Nt=be.props.children);return M.cloneElement(be,{"aria-selected":Ae?"true":"false",onClick:he(be),onKeyUp:Re=>{Re.key===" "&&Re.preventDefault(),be.props.onKeyUp&&be.props.onKeyUp(Re)},role:"option",selected:Ae,value:void 0,"data-value":be.props.value})});tt&&(C?ct.length===0?Me=null:Me=ct.reduce((be,Ae,Re)=>(be.push(Ae),Re<ct.length-1&&be.push(", "),be),[]):Me=Nt);let Oe=oe;!s&&le&&se&&(Oe=de.clientWidth);let We;typeof F<"u"?We=F:We=f?null:0;const Xe=$.id||(E?`mui-component-select-${E}`:void 0),Ze={...t,variant:V,value:q,open:Pe,error:p},Fe=$B(Ze),dt={...x.PaperProps,...typeof x.slotProps?.paper=="function"?x.slotProps.paper(Ze):x.slotProps?.paper},lt={...x.MenuListProps,...typeof x.slotProps?.list=="function"?x.slotProps.list(Ze):x.slotProps?.list},Mt=Br();return c.jsxs(M.Fragment,{children:[c.jsx(LB,{as:"div",ref:Z,tabIndex:We,role:"combobox","aria-controls":Pe?Mt:void 0,"aria-disabled":f?"true":void 0,"aria-expanded":Pe?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[y,Xe].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":S?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:$e,onMouseDown:f||L?null:ne,onBlur:Je,onFocus:_,...$,ownerState:Ze,className:Ue($.className,Fe.select,l),id:Xe,children:jB(Me)?F1||(F1=c.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):Me}),c.jsx(BB,{"aria-invalid":p,value:Array.isArray(q)?q.join(","):q,name:E,ref:z,"aria-hidden":!0,onChange:Se,tabIndex:-1,disabled:f,className:Fe.nativeInput,autoFocus:i,required:S,...Y,ownerState:Ze}),c.jsx(_B,{as:m,className:Fe.icon,ownerState:Ze}),c.jsx(OB,{id:`menu-${E||""}`,anchorEl:de,open:Pe,onClose:Ce,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:{...dt,style:{minWidth:Oe,...dt!=null?dt.style:null}}},children:xe})]})}),Rv=gt(c.jsx("path",{d:"M7 10l5 5 5-5z"})),zB=e=>{const{classes:t}=e,r=Ke({root:["root"]},Pv,t);return{...t,...r}},bh={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>$n(e)&&e!=="variant"},UB=pe(ph,bh)(""),VB=pe(mh,bh)(""),WB=pe(hh,bh)(""),oc=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=Rv,id:f,input:h,inputProps:p,label:m,labelId:b,MenuProps:y,multiple:x=!1,native:C=!1,onClose:E,onOpen:T,open:I,renderValue:D,SelectDisplayProps:_,variant:O="outlined",...B}=r,L=C?FB:HB,j=ar(),S=Di({props:r,muiFormControl:j,states:["variant","error"]}),$=S.variant||O,F={...r,variant:$,classes:s},R=zB(F),{root:H,...V}=R,Y=h||{standard:c.jsx(UB,{ownerState:F}),outlined:c.jsx(VB,{label:m,ownerState:F}),filled:c.jsx(WB,{ownerState:F})}[$],q=Et(n,js(Y));return c.jsx(M.Fragment,{children:M.cloneElement(Y,{inputComponent:L,inputProps:{children:i,error:S.error,IconComponent:d,variant:$,type:void 0,multiple:x,...C?{id:f}:{autoWidth:o,defaultOpen:l,displayEmpty:u,labelId:b,MenuProps:y,onClose:E,onOpen:T,open:I,renderValue:D,SelectDisplayProps:{id:f,..._}},...p,classes:p?An(V,p.classes):V,...h?h.props.inputProps:{}},...(x&&C||u)&&$==="outlined"?{notched:!0}:{},ref:q,className:Ue(Y.props.className,a,R.root),...!h&&{variant:$},...B})})});oc.muiName="Select";function qB(e){return Ge("MuiTextField",e)}qe("MuiTextField",["root"]);const YB={standard:ph,filled:hh,outlined:mh},KB=e=>{const{classes:t}=e;return Ke({root:["root"]},qB,t)},GB=pe(rc,{name:"MuiTextField",slot:"Root"})({}),vt=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:E,label:T,maxRows:I,minRows:D,multiline:_=!1,name:O,onBlur:B,onChange:L,onFocus:j,placeholder:S,required:$=!1,rows:F,select:R=!1,SelectProps:H,slots:V={},slotProps:Y={},type:q,value:P,variant:J="outlined",...re}=r,z={...r,autoFocus:i,color:l,disabled:d,error:f,fullWidth:p,multiline:_,required:$,select:R,variant:J},ye=KB(z),se=Br(b),G=m&&se?`${se}-helper-text`:void 0,le=T&&se?`${se}-label`:void 0,oe=YB[J],ue={slots:V,slotProps:{input:C,inputLabel:y,htmlInput:x,formHelperText:h,select:H,...Y}},ie={},Z=ue.slotProps.inputLabel;J==="outlined"&&(Z&&typeof Z.shrink<"u"&&(ie.notched=Z.shrink),ie.label=T),R&&((!H||!H.native)&&(ie.id=void 0),ie["aria-describedby"]=void 0);const[de,ae]=kt("root",{elementType:GB,shouldForwardComponentProp:!0,externalForwardedProps:{...ue,...re},ownerState:z,className:Ue(ye.root,a),ref:n,additionalProps:{disabled:d,error:f,fullWidth:p,required:$,color:l,variant:J}}),[ne,Ce]=kt("input",{elementType:oe,externalForwardedProps:ue,additionalProps:ie,ownerState:z}),[ve,Se]=kt("inputLabel",{elementType:nc,externalForwardedProps:ue,ownerState:z}),[he,$e]=kt("htmlInput",{elementType:"input",externalForwardedProps:ue,ownerState:z}),[Pe,Je]=kt("formHelperText",{elementType:kv,externalForwardedProps:ue,ownerState:z}),[Me,Nt]=kt("select",{elementType:oc,externalForwardedProps:ue,ownerState:z}),ct=c.jsx(ne,{"aria-describedby":G,autoComplete:o,autoFocus:i,defaultValue:u,fullWidth:p,multiline:_,name:O,rows:F,maxRows:I,minRows:D,type:q,value:P,id:se,inputRef:E,onBlur:B,onChange:L,onFocus:j,placeholder:S,inputProps:$e,slots:{input:V.htmlInput?he:void 0},...Ce});return c.jsxs(de,{...ae,children:[T!=null&&T!==""&&c.jsx(ve,{htmlFor:se,id:le,...Se,children:T}),R?c.jsx(Me,{"aria-describedby":G,id:se,labelId:le,value:P,input:ct,...Nt,children:s}):ct,m&&c.jsx(Pe,{id:G,...Je,children:m})]})}),QB=({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},XB=({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},ZB=(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}},JB=({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=V2(e,s),u=K2(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=Gp(q2(gi(h,o),p),o))}return Q({},l,{format:s,maxLength:p,value:h,placeholder:ZB(e,r,l,s),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:d,startSeparator:a,endSeparator:"",modified:!1})},ej=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(JB(Q({},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},tj=({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}),_1=e=>{let t=QB(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=XB(Q({},e,{expandedFormat:t})),r=ej(Q({},e,{expandedFormat:t,escapedParts:n}));return tj(Q({},e,{sections:r}))},nj=e=>{const t=Zt(),n=Eo(),r=ki(),o=wr(),{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:E,enableAccessibleFieldDOMStructure:T=!1}}=e,{timezone:I,value:D,handleValueChange:_}=uh({timezone:E,value:d,defaultValue:f,referenceDate:h,onChange:p,valueManager:i}),O=M.useMemo(()=>oL(t),[t]),B=M.useMemo(()=>cL(t,O,I),[t,O,I]),L=M.useCallback((se,G=null)=>s.getSectionsFromValue(t,se,G,le=>_1({utils:t,localeText:n,localizedDigits:O,format:m,date:le,formatDensity:b,shouldRespectLeadingZeros:C,enableAccessibleFieldDOMStructure:T,isRtl:o})),[s,m,n,O,o,C,t,b,T]),[j,S]=M.useState(()=>{const se=L(D),G={sections:se,value:D,referenceValue:i.emptyValue,tempValueStrAndroid:null},le=eL(se),oe=i.getInitialReferenceValue({referenceDate:h,value:D,utils:t,props:u,granularity:le,timezone:I});return Q({},G,{referenceValue:oe})}),[$,F]=or({controlled:y,default:null,name:"useField",state:"selectedSections"}),R=se=>{F(se),x?.(se)},H=M.useMemo(()=>Ff($,j.sections),[$,j.sections]),V=H==="all"?0:H,Y=({value:se,referenceValue:G,sections:le})=>{if(S(ue=>Q({},ue,{sections:le,value:se,referenceValue:G,tempValueStrAndroid:null})),i.areValuesEqual(t,j.value,se))return;const oe={validationError:l({adapter:r,value:se,timezone:I,props:u})};_(se,oe)},q=(se,G)=>{const le=[...j.sections];return le[se]=Q({},le[se],{value:G,modified:!0}),le},P=()=>{Y({value:i.emptyValue,referenceValue:j.referenceValue,sections:L(i.emptyValue)})},J=()=>{if(V==null)return;const se=j.sections[V],G=s.getActiveDateManager(t,j,se),oe=G.getSections(j.sections).filter(de=>de.value!=="").length===(se.value===""?0:1),ue=q(V,""),ie=oe?null:t.getInvalidDate(),Z=G.getNewValuesFromNewActiveDate(ie);Y(Q({},Z,{sections:ue}))},re=se=>{const G=(ue,ie)=>{const Z=t.parse(ue,m);if(Z==null||!t.isValid(Z))return null;const de=_1({utils:t,localeText:n,localizedDigits:O,format:m,date:Z,formatDensity:b,shouldRespectLeadingZeros:C,enableAccessibleFieldDOMStructure:T,isRtl:o});return Jg(t,Z,de,ie,!1)},le=s.parseValueStr(se,j.referenceValue,G),oe=s.updateReferenceValue(t,le,j.referenceValue);Y({value:le,referenceValue:oe,sections:L(le,j.sections)})},z=({activeSection:se,newSectionValue:G,shouldGoToNextSection:le})=>{le&&V<j.sections.length-1&&R(V+1);const oe=s.getActiveDateManager(t,j,se),ue=q(V,G),ie=oe.getSections(ue),Z=aL(t,ie,O);let de,ae;if(Z!=null&&t.isValid(Z)){const ne=Jg(t,Z,ie,oe.referenceDate,!0);de=oe.getNewValuesFromNewActiveDate(ne),ae=!0}else de=oe.getNewValuesFromNewActiveDate(Z),ae=(Z!=null&&!t.isValid(Z))!=(oe.date!=null&&!t.isValid(oe.date));return ae?Y(Q({},de,{sections:ue})):S(ne=>Q({},ne,de,{sections:ue,tempValueStrAndroid:null}))},ye=se=>S(G=>Q({},G,{tempValueStrAndroid:se}));return M.useEffect(()=>{const se=L(j.value);S(G=>Q({},G,{sections:se}))},[m,t.locale,o]),M.useEffect(()=>{let se;i.areValuesEqual(t,j.value,D)?se=i.getTimezone(t,j.value)!==i.getTimezone(t,D):se=!0,se&&S(G=>Q({},G,{value:D,referenceValue:s.updateReferenceValue(t,D,G.referenceValue),sections:L(D)}))},[D]),{state:j,activeSectionIndex:V,parsedSelectedSections:H,setSelectedSections:R,clearValue:P,clearActiveSection:J,updateSectionValue:z,updateValueFromValueStr:re,setTempAndroidValueStr:ye,getSectionsFromValue:L,sectionsValueBoundaries:B,localizedDigits:O,timezone:I}},rj=5e3,Ji=e=>e.saveQuery!=null,oj=({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(),rj);return()=>{clearTimeout(m)}}return()=>{}},[a,u]);const d=({keyPressed:m,sectionIndex:b},y,x)=>{const C=m.toLowerCase(),E=e[b];if(a!=null&&(!x||x(a.value))&&a.sectionIndex===b){const I=`${a.value}${C}`,D=y(I,E);if(!Ji(D))return l({sectionIndex:b,value:I,sectionType:E.type}),D}const T=y(C,E);return Ji(T)&&!T.saveQuery?(u(),null):(l({sectionIndex:b,value:C,sectionType:E.type}),Ji(T)?null:T)},f=m=>{const b=(C,E,T)=>{const I=E.filter(D=>D.toLowerCase().startsWith(T));return I.length===0?{saveQuery:!1}:{sectionValue:I[0],shouldGoToNextSection:I.length===1}},y=(C,E,T,I)=>{const D=_=>W2(s,i,E.type,_);if(E.contentType==="letter")return b(E.format,D(E.format),C);if(T&&I!=null&&V2(s,T).contentType==="letter"){const _=D(T),O=b(T,_,C);return Ji(O)?{saveQuery:!1}:Q({},O,{sectionValue:I(O.sectionValue,_)})}return{saveQuery:!1}};return d(m,(C,E)=>{switch(E.type){case"month":{const T=I=>Xg(s,I,s.formats.month,E.format);return y(C,E,s.formats.month,T)}case"weekDay":{const T=(I,D)=>D.indexOf(I).toString();return y(C,E,s.formats.weekday,T)}case"meridiem":return y(C,E);default:return{saveQuery:!1}}})},h=m=>{const b=(x,C)=>{const E=gi(x,r),T=Number(E),I=n[C.type]({currentDate:null,format:C.format,contentType:C.contentType});if(T>I.maximum)return{saveQuery:!1};if(T<I.minimum)return{saveQuery:!0};const D=T*10>I.maximum||E.length===I.maximum.toString().length;return{sectionValue:Y2(s,T,I,r,C),shouldGoToNextSection:D}};return d(m,(x,C)=>{if(C.contentType==="digit"||C.contentType==="digit-with-letter")return b(x,C);if(C.type==="month"){K2(s,"digit","month","MM");const E=b(x,{type:C.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(Ji(E))return E;const T=Xg(s,E.sectionValue,"MM",C.format);return Q({},E,{sectionValue:T})}if(C.type==="weekDay"){const E=b(x,C);if(Ji(E))return E;const T=Fc(s,C.format)[Number(E.sectionValue)-1];return Q({},E,{sectionValue:T})}return{saveQuery:!1}},x=>Qg(x,r))};return{applyCharacterEditing:Ve(m=>{const b=e[m.sectionIndex],x=Qg(m.keyPressed,r)?h(Q({},m,{keyPressed:Gp(m.keyPressed,r)})):f(m);if(x==null){o(null);return}t({activeSection:b,newSectionValue:x.sectionValue,shouldGoToNextSection:x.shouldGoToNextSection})}),resetCharacterQuery:u}},ij=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:E,updateValueFromValueStr:T,sectionOrder:I,areAllSectionsEmpty:D,sectionsValueBoundaries:_}=e,O=M.useRef(null),B=Et(r,O),L=Eo(),j=Zt(),S=Br(),[$,F]=M.useState(!1),R=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!O.current)return;const ae=document.getSelection();if(!ae)return;if(b==null){ae.rangeCount>0&&O.current.getRoot().contains(ae.getRangeAt(0).startContainer)&&ae.removeAllRanges(),$&&O.current.getRoot().blur();return}if(!O.current.getRoot().contains(Wn(document)))return;const ne=new window.Range;let Ce;b==="all"?Ce=O.current.getRoot():y.sections[b].type==="empty"?Ce=O.current.getSectionContainer(b):Ce=O.current.getSectionContent(b),ne.selectNodeContents(Ce),Ce.focus(),ae.removeAllRanges(),ae.addRange(ne)},getActiveSectionIndexFromDOM:()=>{const ae=Wn(document);return!ae||!O.current||!O.current.getRoot().contains(ae)?null:O.current.getSectionIndexFromDOMElement(ae)},focusField:(ae=0)=>{if(!O.current||R.getActiveSectionIndexFromDOM()!=null)return;const ne=Ff(ae,y.sections);F(!0),O.current.getSectionContent(ne).focus()},setSelectedSections:ae=>{if(!O.current)return;const ne=Ff(ae,y.sections);F((ne==="all"?0:ne)!==null),m(ae)},isFieldFocused:()=>{const ae=Wn(document);return!!O.current&&O.current.getRoot().contains(ae)}}),[b,m,y.sections,$]),H=Ve(ae=>{if(!O.current)return;const ne=y.sections[ae];O.current.getSectionContent(ae).innerHTML=ne.value||ne.placeholder,R.syncSelectionToDOM()}),V=Ve((ae,...ne)=>{ae.isDefaultPrevented()||!O.current||(F(!0),i?.(ae,...ne),b==="all"?setTimeout(()=>{const Ce=document.getSelection().getRangeAt(0).startOffset;if(Ce===0){m(I.startIndex);return}let ve=0,Se=0;for(;Se<Ce&&ve<y.sections.length;){const he=y.sections[ve];ve+=1,Se+=`${he.startSeparator}${he.value||he.placeholder}${he.endSeparator}`.length}m(ve-1)}):$?O.current.getRoot().contains(ae.target)||m(I.startIndex):(F(!0),m(I.startIndex)))}),Y=Ve(ae=>{if(a?.(ae),!O.current||b!=="all")return;const Ce=ae.target.textContent??"";O.current.getRoot().innerHTML=y.sections.map(ve=>`${ve.startSeparator}${ve.value||ve.placeholder}${ve.endSeparator}`).join(""),R.syncSelectionToDOM(),Ce.length===0||Ce.charCodeAt(0)===10?(p(),C(),m("all")):Ce.length>1?T(Ce):(b==="all"&&m(0),h({keyPressed:Ce,sectionIndex:0}))}),q=Ve(ae=>{if(l?.(ae),n||b!=="all"){ae.preventDefault();return}const ne=ae.clipboardData.getData("text");ae.preventDefault(),p(),T(ne)}),P=Ve((...ae)=>{if(s?.(...ae),$||!O.current)return;F(!0),O.current.getSectionIndexFromDOMElement(Wn(document))!=null||m(I.startIndex)}),J=Ve((...ae)=>{o?.(...ae),setTimeout(()=>{if(!O.current)return;const ne=Wn(document);!O.current.getRoot().contains(ne)&&(F(!1),m(null))})}),re=Ve(ae=>ne=>{ne.isDefaultPrevented()||m(ae)}),z=Ve(ae=>{ae.preventDefault()}),ye=Ve(ae=>()=>{m(ae)}),se=Ve(ae=>{if(ae.preventDefault(),n||t||typeof b!="number")return;const ne=y.sections[b],Ce=ae.clipboardData.getData("text"),ve=/^[a-zA-Z]+$/.test(Ce),Se=/^[0-9]+$/.test(Ce),he=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Ce);ne.contentType==="letter"&&ve||ne.contentType==="digit"&&Se||ne.contentType==="digit-with-letter"&&he?(p(),E({activeSection:ne,newSectionValue:Ce,shouldGoToNextSection:!0})):!ve&&!Se&&(p(),T(Ce))}),G=Ve(ae=>{ae.preventDefault(),ae.dataTransfer.dropEffect="none"}),le=Ve(ae=>{if(!O.current)return;const ne=ae.target,Ce=ne.textContent??"",ve=O.current.getSectionIndexFromDOMElement(ne),Se=y.sections[ve];if(n||!O.current){H(ve);return}if(Ce.length===0){if(Se.value===""){H(ve);return}const he=ae.nativeEvent.inputType;if(he==="insertParagraph"||he==="insertLineBreak"){H(ve);return}p(),x();return}h({keyPressed:Ce,sectionIndex:ve}),H(ve)});yn(()=>{if(!(!$||!O.current)){if(b==="all")O.current.getRoot().focus();else if(typeof b=="number"){const ae=O.current.getSectionContent(b);ae&&ae.focus()}}},[b,$]);const oe=M.useMemo(()=>y.sections.reduce((ae,ne)=>(ae[ne.type]=_[ne.type]({currentDate:null,contentType:ne.contentType,format:ne.format}),ae),{}),[_,y.sections]),ue=b==="all",ie=M.useMemo(()=>y.sections.map((ae,ne)=>{const Ce=!ue&&!t&&!n;return{container:{"data-sectionindex":ne,onClick:re(ne)},content:{tabIndex:ue||ne>0?-1:0,contentEditable:!ue&&!t&&!n,role:"spinbutton",id:`${S}-${ae.type}`,"aria-labelledby":`${S}-${ae.type}`,"aria-readonly":n,"aria-valuenow":mL(ae,j),"aria-valuemin":oe[ae.type].minimum,"aria-valuemax":oe[ae.type].maximum,"aria-valuetext":ae.value?hL(ae,j):L.empty,"aria-label":L[ae.type],"aria-disabled":t,spellCheck:Ce?!1:void 0,autoCapitalize:Ce?"off":void 0,autoCorrect:Ce?"off":void 0,[parseInt(M.version,10)>=17?"enterKeyHint":"enterkeyhint"]:Ce?"next":void 0,children:ae.value||ae.placeholder,onInput:le,onPaste:se,onFocus:ye(ne),onDragOver:G,onMouseUp:z,inputMode:ae.contentType==="letter"?"text":"numeric"},before:{children:ae.startSeparator},after:{children:ae.endSeparator}}}),[y.sections,ye,se,G,le,re,z,t,n,ue,L,j,oe,S]),Z=Ve(ae=>{T(ae.target.value)}),de=M.useMemo(()=>D?"":f.getV7HiddenInputValueFromSections(y.sections),[D,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(`
|
|
207
|
-
`));d&&O.current&&O.current.getSectionContent(I.startIndex).focus()},[]),{interactions:R,returnedValue:{autoFocus:d,readOnly:n,focused:u??$,sectionListRef:B,onBlur:J,onClick:V,onFocus:P,onInput:Y,onPaste:q,enableAccessibleFieldDOMStructure:!0,elements:ie,tabIndex:b===0?-1:0,contentEditable:ue,value:de,onChange:Z,areAllSectionsEmpty:D}}},ss=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),sj=(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=Qp(a,n?"input-rtl":"input-ltr",t),u=`${a.startSeparator}${l}${a.endSeparator}`,d=ss(u).length,f=u.length,h=ss(l),p=o+(h===""?0:l.indexOf(h[0]))+a.startSeparator.length,m=p+h.length;i.push(Q({},a,{start:r,end:r+d,startInInput:p,endInInput:m})),r+=d,o+=f}return i},aj=e=>{const t=wr(),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:E,updateValueFromValueStr:T,clearActiveSection:I,clearValue:D,setTempAndroidValueStr:_,setSelectedSections:O,getSectionsFromValue:B,areAllSectionsEmpty:L,localizedDigits:j}=e,S=M.useRef(null),$=Et(l,S),F=M.useMemo(()=>sj(m.sections,j,t),[m.sections,j,t]),R=M.useMemo(()=>({syncSelectionToDOM:()=>{if(!S.current)return;if(h==null){S.current.scrollLeft&&(S.current.scrollLeft=0);return}if(S.current!==Wn(document))return;const le=S.current.scrollTop;if(h==="all")S.current.select();else{const oe=F[h],ue=oe.type==="empty"?oe.startInInput-oe.startSeparator.length:oe.startInInput,ie=oe.type==="empty"?oe.endInInput+oe.endSeparator.length:oe.endInInput;(ue!==S.current.selectionStart||ie!==S.current.selectionEnd)&&S.current===Wn(document)&&S.current.setSelectionRange(ue,ie),clearTimeout(r.current),r.current=setTimeout(()=>{S.current&&S.current===Wn(document)&&S.current.selectionStart===S.current.selectionEnd&&(S.current.selectionStart!==ue||S.current.selectionEnd!==ie)&&R.syncSelectionToDOM()})}S.current.scrollTop=le},getActiveSectionIndexFromDOM:()=>{const le=S.current.selectionStart??0,oe=S.current.selectionEnd??0;if(le===0&&oe===0)return null;const ue=le<=F[0].startInInput?1:F.findIndex(ie=>ie.startInInput-ie.startSeparator.length>le);return ue===-1?F.length-1:ue-1},focusField:(le=0)=>{Wn(document)!==S.current&&(S.current?.focus(),O(le))},setSelectedSections:le=>O(le),isFieldFocused:()=>S.current===Wn(document)}),[S,h,F,O]),H=()=>{const le=S.current.selectionStart??0;let oe;le<=F[0].startInInput||le>=F[F.length-1].endInInput?oe=1:oe=F.findIndex(ie=>ie.startInInput-ie.startSeparator.length>le);const ue=oe===-1?F.length-1:oe-1;O(ue)},V=Ve((...le)=>{o?.(...le);const oe=S.current;clearTimeout(n.current),n.current=setTimeout(()=>{!oe||oe!==S.current||p==null&&(oe.value.length&&Number(oe.selectionEnd)-Number(oe.selectionStart)===oe.value.length?O("all"):H())})}),Y=Ve((le,...oe)=>{le.isDefaultPrevented()||(i?.(le,...oe),H())}),q=Ve(le=>{if(s?.(le),le.preventDefault(),d||f)return;const oe=le.clipboardData.getData("text");if(typeof h=="number"){const ue=m.sections[h],ie=/^[a-zA-Z]+$/.test(oe),Z=/^[0-9]+$/.test(oe),de=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(oe);if(ue.contentType==="letter"&&ie||ue.contentType==="digit"&&Z||ue.contentType==="digit-with-letter"&&de){C(),E({activeSection:ue,newSectionValue:oe,shouldGoToNextSection:!0});return}if(ie||Z)return}C(),T(oe)}),P=Ve((...le)=>{a?.(...le),O(null)}),J=Ve(le=>{if(d)return;const oe=le.target.value;if(oe===""){C(),D();return}const ue=le.nativeEvent.data,ie=ue&&ue.length>1,Z=ie?ue:oe,de=ss(Z);if(h==="all"&&O(p),p==null||ie){T(ie?ue:de);return}let ae;if(h==="all"&&de.length===1)ae=de;else{const ne=ss(b.getV6InputValueFromSections(F,j,t));let Ce=-1,ve=-1;for(let Pe=0;Pe<ne.length;Pe+=1)Ce===-1&&ne[Pe]!==de[Pe]&&(Ce=Pe),ve===-1&&ne[ne.length-Pe-1]!==de[de.length-Pe-1]&&(ve=Pe);const Se=F[p];if(Ce<Se.start||ne.length-ve-1>Se.end)return;const $e=de.length-ne.length+Se.end-ss(Se.endSeparator||"").length;ae=de.slice(Se.start+ss(Se.startSeparator||"").length,$e)}if(ae.length===0){fL()&&_(Z),C(),I();return}x({keyPressed:ae,sectionIndex:p})}),re=M.useMemo(()=>u!==void 0?u:b.getV6InputValueFromSections(B(y.emptyValue),j,t),[u,b,B,y.emptyValue,j,t]),z=M.useMemo(()=>m.tempValueStrAndroid??b.getV6InputValueFromSections(m.sections,j,t),[m.sections,b,m.tempValueStrAndroid,j,t]);M.useEffect(()=>(S.current&&S.current===Wn(document)&&O("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const ye=M.useMemo(()=>p==null||m.sections[p].contentType==="letter"?"text":"numeric",[p,m.sections]),G=!(S.current&&S.current===Wn(document))&&L;return{interactions:R,returnedValue:{readOnly:d,onBlur:P,onClick:Y,onFocus:V,onPaste:q,inputRef:$,enableAccessibleFieldDOMStructure:!1,placeholder:re,inputMode:ye,autoComplete:"off",value:G?"":z,onChange:J}}},lj=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=wr(),y=nj(e),{state:x,activeSectionIndex:C,parsedSelectedSections:E,setSelectedSections:T,clearValue:I,clearActiveSection:D,updateSectionValue:_,setTempAndroidValueStr:O,sectionsValueBoundaries:B,localizedDigits:L,timezone:j}=y,S=oj({sections:x.sections,updateSectionValue:_,sectionsValueBoundaries:B,localizedDigits:L,setTempAndroidValueStr:O,timezone:j}),{resetCharacterQuery:$}=S,F=p.areValuesEqual(t,x.value,p.emptyValue),R=i?ij:aj,H=M.useMemo(()=>pL(x.sections,b&&!i),[x.sections,b,i]),{returnedValue:V,interactions:Y}=R(Q({},e,y,S,{areAllSectionsEmpty:F,sectionOrder:H})),q=Ve(se=>{if(l?.(se),!s)switch(!0){case((se.ctrlKey||se.metaKey)&&String.fromCharCode(se.keyCode)==="A"&&!se.shiftKey&&!se.altKey):{se.preventDefault(),T("all");break}case se.key==="ArrowRight":{if(se.preventDefault(),E==null)T(H.startIndex);else if(E==="all")T(H.endIndex);else{const G=H.neighbors[E].rightIndex;G!==null&&T(G)}break}case se.key==="ArrowLeft":{if(se.preventDefault(),E==null)T(H.endIndex);else if(E==="all")T(H.startIndex);else{const G=H.neighbors[E].leftIndex;G!==null&&T(G)}break}case se.key==="Delete":{if(se.preventDefault(),a)break;E==null||E==="all"?I():D(),$();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(se.key):{if(se.preventDefault(),a||C==null)break;E==="all"&&T(C);const G=x.sections[C],le=h.getActiveDateManager(t,x,G),oe=iL(t,j,G,se.key,B,L,le.date,{minutesStep:o});_({activeSection:G,newSectionValue:oe,shouldGoToNextSection:!1});break}}});yn(()=>{Y.syncSelectionToDOM()});const{hasValidationError:P}=ev({props:n,validator:m,timezone:j,value:x.value,onError:n.onError}),J=M.useMemo(()=>u!==void 0?u:P,[P,u]);M.useEffect(()=>{!J&&C==null&&$()},[x.referenceValue,C,J]),M.useEffect(()=>{x.tempValueStrAndroid!=null&&C!=null&&($(),D())},[x.sections]),M.useImperativeHandle(r,()=>({getSections:()=>x.sections,getActiveSectionIndex:Y.getActiveSectionIndexFromDOM,setSelectedSections:Y.setSelectedSections,focusField:Y.focusField,isFieldFocused:Y.isFieldFocused}));const re=Ve((se,...G)=>{se.preventDefault(),f?.(se,...G),I(),Y.isFieldFocused()?T(H.startIndex):Y.focusField(0)}),z={onKeyDown:q,onClear:re,error:J,clearable:!!(d&&!F&&!a&&!s)},ye={disabled:s,readOnly:a};return Q({},e.forwardedProps,z,ye,V)},uj=["clearable","onClear","InputProps","sx","slots","slotProps"],cj=["ownerState"],dj=e=>{const t=Eo(),{clearable:n,onClear:r,InputProps:o,sx:i,slots:s,slotProps:a}=e,l=et(e,uj),u=s?.clearButton??Ar,d=Ct({elementType:u,externalSlotProps:a?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),f=et(d,cj),h=s?.clearIcon??v9,p=Ct({elementType:h,externalSlotProps:a?.clearIcon,ownerState:{}});return Q({},l,{InputProps:Q({},o,{endAdornment:c.jsxs(M.Fragment,{children:[n&&c.jsx(tv,{position:"end",sx:{marginRight:o?.endAdornment?-1:-1.5},children:c.jsx(u,Q({},f,{onClick:r,children:c.jsx(h,Q({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]]})},fj=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],pj=(e,t)=>M.useMemo(()=>{const n=Q({},e),r={},o=i=>{n.hasOwnProperty(i)&&(r[i]=n[i],delete n[i])};return fj.forEach(o),Z2.forEach(o),{forwardedProps:n,internalProps:r}},[e,t]),hj=e=>{const t=Zt(),n=Al();return Q({},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)})},mj=e=>{const t=hj(e),{forwardedProps:n,internalProps:r}=pj(t,"date");return lj({forwardedProps:n,internalProps:r,valueManager:Jr,fieldValueManager:bL,validator:Ol,valueType:"date"})};function gj(e){return Ge("MuiPickersTextField",e)}qe("MuiPickersTextField",["root","focused","disabled","error","required"]);function bj(e){return Ge("MuiPickersInputBase",e)}const ms=qe("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function yj(e){return Ge("MuiPickersSectionList",e)}const ma=qe("MuiPickersSectionList",["root","section","sectionContent"]),xj=["slots","slotProps","elements","sectionListRef"],Nv=pe("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),Fv=pe("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),Lv=pe("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),_v=pe("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),vj=e=>{const{classes:t}=e;return Ke({root:["root"],section:["section"],sectionContent:["sectionContent"]},yj,t)};function Cj(e){const{slots:t,slotProps:n,element:r,classes:o}=e,i=t?.section??Fv,s=Ct({elementType:i,externalSlotProps:n?.section,externalForwardedProps:r.container,className:o.section,ownerState:{}}),a=t?.sectionContent??_v,l=Ct({elementType:a,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),u=t?.sectionSeparator??Lv,d=Ct({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Ct({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return c.jsxs(i,Q({},s,{children:[c.jsx(u,Q({},d)),c.jsx(a,Q({},l)),c.jsx(u,Q({},f))]}))}const Ej=M.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiPickersSectionList"}),{slots:o,slotProps:i,elements:s,sectionListRef:a}=r,l=et(r,xj),u=vj(r),d=M.useRef(null),f=Et(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(`.${ma.section}[data-sectionindex="${b}"]`)},getSectionContent(b){return h("getSectionContent").querySelector(`.${ma.section}[data-sectionindex="${b}"] .${ma.sectionContent}`)},getSectionIndexFromDOMElement(b){const y=h("getSectionIndexFromDOMElement");if(b==null||!y.contains(b))return null;let x=null;return b.classList.contains(ma.section)?x=b:b.classList.contains(ma.sectionContent)&&(x=b.parentElement),x==null?null:Number(x.dataset.sectionindex)}}));const p=o?.root??Nv,m=Ct({elementType:p,externalSlotProps:i?.root,externalForwardedProps:l,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:u.root,ownerState:{}});return c.jsx(p,Q({},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(Cj,{slots:o,slotProps:i,element:b,classes:u},y))})}))}),Tj=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],Sj=e=>Math.round(e*1e5)/1e5,Wc=pe("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>Q({},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:`${Sj(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),yh=pe(Nv,{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}}]})),kj=pe(Fv,{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"})),wj=pe(_v,{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"})),Dj=pe(Lv,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),Ij=pe("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(Q({},WF)),Aj=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${Le(a)}`,l==="small"&&"inputSizeSmall",!!d&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Ke(f,bj,o)},xh=M.forwardRef(function(t,n){const r=Gt({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:E,readOnly:T,inputProps:I,inputRef:D,sectionListRef:_}=r,O=et(r,Tj),B=M.useRef(null),L=Et(n,B),j=Et(I?.ref,D),S=wr(),$=ar();if(!$)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const F=P=>{if($.disabled){P.stopPropagation();return}$.onFocus?.(P)};M.useEffect(()=>{$&&$.setAdornedStart(!!d)},[$,d]),M.useEffect(()=>{$&&(i?$.onEmpty():$.onFilled())},[$,i]);const R=Q({},r,$,{isRtl:S}),H=Aj(R),V=h?.root||Wc,Y=Ct({elementType:V,externalSlotProps:p?.root,externalForwardedProps:O,additionalProps:{"aria-invalid":$.error,ref:L},className:H.root,ownerState:R}),q=h?.input||yh;return c.jsxs(V,Q({},Y,{children:[d,c.jsx(Ej,{sectionListRef:_,elements:o,contentEditable:m,tabIndex:b,className:H.sectionsContainer,onFocus:F,onBlur:$.onBlur,onInput:y,onPaste:x,onKeyDown:C,slots:{root:q,section:kj,sectionContent:wj,sectionSeparator:Dj},slotProps:{root:{ownerState:R},sectionContent:{className:ms.sectionContent},sectionSeparator:({position:P})=>({className:P==="before"?ms.sectionBefore:ms.sectionAfter})}}),u,f?f(Q({},$)):null,c.jsx(Ij,Q({name:E,className:H.input,value:s,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:T,required:$.required,disabled:$.disabled},I,{ref:j}))]}))});function Oj(e){return Ge("MuiPickersOutlinedInput",e)}const Rr=Q({},ms,qe("MuiPickersOutlinedInput",["root","notchedOutline","input"])),Mj=["children","className","label","notched","shrink"],Pj=pe("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}}),B1=pe("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),Rj=pe("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 Nj(e){const{className:t,label:n}=e,r=et(e,Mj),o=n!=null&&n!=="",i=Q({},e,{withLabel:o});return c.jsx(Pj,Q({"aria-hidden":!0,className:t},r,{ownerState:i,children:c.jsx(Rj,{ownerState:i,children:o?c.jsx(B1,{children:n}):c.jsx(B1,{className:"notranslate",children:""})})}))}const Fj=["label","autoFocus","ownerState","notched"],Lj=pe(Wc,{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}}}))}}),_j=pe(yh,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),Bj=e=>{const{classes:t}=e,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Oj,t);return Q({},t,r)},Bv=M.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiPickersOutlinedInput"}),{label:o,ownerState:i,notched:s}=r,a=et(r,Fj),l=ar(),u=Q({},r,i,l,{color:l?.color||"primary"}),d=Bj(u);return c.jsx(xh,Q({slots:{root:Lj,input:_j},renderSuffix:f=>c.jsx(Nj,{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}))});Bv.muiName="Input";function jj(e){return Ge("MuiPickersFilledInput",e)}const Zo=Q({},ms,qe("MuiPickersFilledInput",["root","underline","input"])),$j=["label","autoFocus","disableUnderline","ownerState"],Hj=pe(Wc,{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}}]}}),zj=pe(yh,{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}}]}),Uj=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},jj,t);return Q({},t,o)},jv=M.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiPickersFilledInput"}),{label:o,disableUnderline:i=!1,ownerState:s}=r,a=et(r,$j),l=ar(),u=Q({},r,s,l,{color:l?.color||"primary"}),d=Uj(u);return c.jsx(xh,Q({slots:{root:Hj,input:zj},slotProps:{root:{disableUnderline:i}}},a,{label:o,classes:d,ref:n}))});jv.muiName="Input";function Vj(e){return Ge("MuiPickersFilledInput",e)}const ga=Q({},ms,qe("MuiPickersInput",["root","input"])),Wj=["label","autoFocus","disableUnderline","ownerState"],qj=pe(Wc,{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"},[`&.${ga.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ga.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(.${ga.disabled}, .${ga.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${ga.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),Yj=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},Vj,t);return Q({},t,o)},$v=M.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiPickersInput"}),{label:o,disableUnderline:i=!1,ownerState:s}=r,a=et(r,Wj),l=ar(),u=Q({},r,s,l,{disableUnderline:i,color:l?.color||"primary"}),d=Yj(u);return c.jsx(xh,Q({slots:{root:qj}},a,{label:o,classes:d,ref:n}))});$v.muiName="Input";const Kj=["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"],Gj={standard:$v,filled:jv,outlined:Bv},Qj=pe(rc,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),Xj=e=>{const{focused:t,disabled:n,classes:r,required:o}=e;return Ke({root:["root",t&&!n&&"focused",n&&"disabled",o&&"required"]},gj,r)},Zj=M.forwardRef(function(t,n){const r=Gt({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:E,onKeyUp:T,onPaste:I,onInput:D,endAdornment:_,startAdornment:O,tabIndex:B,contentEditable:L,focused:j,value:S,onChange:$,fullWidth:F,id:R,name:H,helperText:V,FormHelperTextProps:Y,label:q,InputLabelProps:P}=r,J=et(r,Kj),re=M.useRef(null),z=Et(n,re),ye=Br(R),se=V&&ye?`${ye}-helper-text`:void 0,G=q&&ye?`${ye}-label`:void 0,le=Q({},r,{color:a,disabled:l,error:u,focused:j,required:f,variant:d}),oe=Xj(le),ue=Gj[d];return c.jsxs(Qj,Q({className:Ue(oe.root,s),ref:z,focused:j,onFocus:o,onBlur:i,disabled:l,variant:d,error:u,color:a,fullWidth:F,required:f,ownerState:le},J,{children:[c.jsx(nc,Q({htmlFor:ye,id:G},P,{children:q})),c.jsx(ue,Q({elements:y,areAllSectionsEmpty:x,onClick:C,onKeyDown:E,onKeyUp:T,onInput:D,onPaste:I,endAdornment:_,startAdornment:O,tabIndex:B,contentEditable:L,value:S,onChange:$,id:ye,fullWidth:F,inputProps:p,inputRef:m,sectionListRef:b,label:q,name:H,role:"group","aria-labelledby":G,"aria-describedby":se,"aria-live":se?"polite":void 0},h)),V&&c.jsx(kv,Q({id:se},Y,{children:V}))]}))}),Jj=["enableAccessibleFieldDOMStructure"],e$=["InputProps","readOnly"],t$=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],n$=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=et(e,Jj);if(t){const{InputProps:f,readOnly:h}=n,p=et(n,e$);return Q({},p,{InputProps:Q({},f??{},{readOnly:h})})}const{onPaste:r,onKeyDown:o,inputMode:i,readOnly:s,InputProps:a,inputProps:l,inputRef:u}=n,d=et(n,t$);return Q({},d,{InputProps:Q({},a??{},{readOnly:s}),inputProps:Q({},l??{},{inputMode:i,onPaste:r,onKeyDown:o,ref:u})})},r$=["slots","slotProps","InputProps","inputProps"],Hv=M.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiDateField"}),{slots:o,slotProps:i,InputProps:s,inputProps:a}=r,l=et(r,r$),u=r,d=o?.textField??(t.enableAccessibleFieldDOMStructure?Zj:vt),f=Ct({elementType:d,externalSlotProps:i?.textField,externalForwardedProps:l,additionalProps:{ref:n},ownerState:u});f.inputProps=Q({},a,f.inputProps),f.InputProps=Q({},s,f.InputProps);const h=mj(f),p=n$(h),m=dj(Q({},p,{slots:o,slotProps:i}));return c.jsx(d,Q({},m))}),zv=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:s,timezone:a})=>{const l=ki();return M.useCallback(u=>Ol({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])},o$=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return Q({},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))),Q({},r,{currentMonth:s})}case"finishMonthSwitchingAnimation":return Q({},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 Q({},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")}},i$=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(o$(!!u,i,h)).current,m=M.useMemo(()=>Jr.getInitialReferenceValue({value:t,utils:h,timezone:f,props:e,referenceDate:n,granularity:Gr.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(D=>{y(Q({type:"changeMonth"},D)),l&&l(D.newMonth)},[l]),C=M.useCallback(D=>{const _=D;h.isSameMonth(_,b.currentMonth)||x({newMonth:h.startOfMonth(_),direction:h.isAfterDay(_,b.currentMonth)?"left":"right"})},[b.currentMonth,x,h]),E=zv({shouldDisableDate:d,minDate:a,maxDate:s,disableFuture:r,disablePast:o,timezone:f}),T=M.useCallback(()=>{y({type:"finishMonthSwitchingAnimation"})},[]),I=Ve((D,_)=>{E(D)||y({type:"changeFocusedDay",focusedDay:D,withoutMonthSwitchingAnimation:_})});return{referenceDate:m,calendarState:b,changeMonth:C,changeFocusedDay:I,isDateDisabled:E,onMonthSwitchingAnimationEnd:T,handleChangeMonth:x}},s$=e=>Ge("MuiPickersFadeTransitionGroup",e);qe("MuiPickersFadeTransitionGroup",["root"]);const a$=e=>{const{classes:t}=e;return Ke({root:["root"]},s$,t)},l$=pe(Ml,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function Uv(e){const t=Gt({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,s=a$(t),a=Bo();return o?n:c.jsx(l$,{className:Ue(s.root,r),children:c.jsx(yi,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},i)})}function u$(e){return Ge("MuiPickersDay",e)}const Jo=qe("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),c$=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],d$=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"]},u$,l)},Vv=({theme:e})=>Q({},e.typography.caption,{width:dl,height:dl,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 ${jc}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}`}}}]}),Wv=(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]},f$=pe(bi,{name:"MuiPickersDay",slot:"Root",overridesResolver:Wv})(Vv),p$=pe("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:Wv})(({theme:e})=>Q({},Vv({theme:e}),{opacity:0,pointerEvents:"none"})),ba=()=>{},h$=M.forwardRef(function(t,n){const r=Gt({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=ba,onBlur:m=ba,onKeyDown:b=ba,onMouseDown:y=ba,onMouseEnter:x=ba,outsideCurrentMonth:C,selected:E=!1,showDaysOutsideCurrentMonth:T=!1,children:I,today:D=!1}=r,_=et(r,c$),O=Q({},r,{autoFocus:o,disabled:a,disableHighlightToday:l,disableMargin:u,selected:E,showDaysOutsideCurrentMonth:T,today:D}),B=d$(O),L=Zt(),j=M.useRef(null),S=Et(j,n);yn(()=>{o&&!a&&!d&&!C&&j.current.focus()},[o,a,d,C]);const $=R=>{y(R),C&&R.preventDefault()},F=R=>{a||h(s),C&&R.currentTarget.focus(),f&&f(R)};return C&&!T?c.jsx(p$,{className:Ue(B.root,B.hiddenDaySpacingFiller,i),ownerState:O,role:_.role}):c.jsx(f$,Q({className:Ue(B.root,i),ref:S,centerRipple:!0,disabled:a,tabIndex:E?0:-1,onKeyDown:R=>b(R,s),onFocus:R=>p(R,s),onBlur:R=>m(R,s),onMouseEnter:R=>x(R,s),onClick:F,onMouseDown:$},_,{ownerState:O,children:I||L.format(s,"dayOfMonth")}))}),m$=M.memo(h$),g$=e=>Ge("MuiPickersSlideTransition",e),dr=qe("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),b$=["children","className","reduceAnimations","slideDirection","transKey","classes"],y$=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Ke(r,g$,t)},x$=pe(Ml,{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 v$(e){const t=Gt({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,s=et(t,b$),a=y$(t),l=Bo();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(x$,{className:Ue(a.root,r),childFactory:d=>M.cloneElement(d,{classNames:u}),role:"presentation",children:c.jsx(Zp,Q({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:u},s,{children:n}),i)})}const C$=e=>Ge("MuiDayCalendar",e);qe("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const E$=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],T$=["ownerState"],S$=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"]},C$,t)},qv=(dl+jc*2)*6,k$=pe("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),w$=pe("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),D$=pe(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})),I$=pe(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})),A$=pe(Dt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>Q({},e.typography.caption,{width:dl,height:dl,padding:0,margin:`0 ${jc}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),O$=pe("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:qv}),M$=pe(v$,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:qv}),P$=pe("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),R$=pe("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${jc}px 0`,display:"flex",justifyContent:"center"});function N$(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:o,isDateDisabled:i,currentMonthNumber:s,isViewFocused:a}=e,l=et(e,E$);const{disabled:u,disableHighlightToday:d,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:h,slots:p,slotProps:m,timezone:b}=t,y=Zt(),x=Lc(b),C=r!==null&&y.isSameDay(n,r),E=o.some(S=>y.isSameDay(S,n)),T=y.isSameDay(n,x),I=p?.day??m$,D=Ct({elementType:I,externalSlotProps:m?.day,additionalProps:Q({disableHighlightToday:d,showDaysOutsideCurrentMonth:h,role:"gridcell",isAnimating:f,"data-timestamp":y.toJsDate(n).valueOf()},l),ownerState:Q({},t,{day:n,selected:E})}),_=et(D,T$),O=M.useMemo(()=>u||i(n),[u,i,n]),B=M.useMemo(()=>y.getMonth(n)!==s,[y,n,s]),L=M.useMemo(()=>{const S=y.startOfMonth(y.setMonth(n,s));return h?y.isSameDay(n,y.startOfWeek(S)):y.isSameDay(n,S)},[s,n,h,y]),j=M.useMemo(()=>{const S=y.endOfMonth(y.setMonth(n,s));return h?y.isSameDay(n,y.endOfWeek(S)):y.isSameDay(n,S)},[s,n,h,y]);return c.jsx(I,Q({},_,{day:n,disabled:O,autoFocus:a&&C,today:T,outsideCurrentMonth:B,isFirstVisibleCell:L,isLastVisibleCell:j,selected:E,tabIndex:C?0:-1,"aria-selected":E,"aria-current":T?"date":void 0}))}function F$(e){const t=Gt({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:E,shouldDisableDate:T,shouldDisableMonth:I,shouldDisableYear:D,dayOfWeekFormatter:_=ve=>n.format(ve,"weekdayShort").charAt(0).toUpperCase(),hasFocus:O,onFocusedViewChange:B,gridLabelId:L,displayWeekNumber:j,fixedWeekNumber:S,autoFocus:$,timezone:F}=t,R=Lc(F),H=S$(t),V=wr(),Y=zv({shouldDisableDate:T,shouldDisableMonth:I,shouldDisableYear:D,minDate:C,maxDate:E,disablePast:y,disableFuture:x,timezone:F}),q=Eo(),[P,J]=or({name:"DayCalendar",state:"hasFocus",controlled:O,default:$??!1}),[re,z]=M.useState(()=>a||R),ye=Ve(ve=>{f||u(ve)}),se=ve=>{Y(ve)||(r(ve),z(ve),B?.(!0),J(!0))},G=Ve((ve,Se)=>{switch(ve.key){case"ArrowUp":se(n.addDays(Se,-7)),ve.preventDefault();break;case"ArrowDown":se(n.addDays(Se,7)),ve.preventDefault();break;case"ArrowLeft":{const he=n.addDays(Se,V?1:-1),$e=n.addMonths(Se,V?1:-1),Pe=Ka({utils:n,date:he,minDate:V?he:n.startOfMonth($e),maxDate:V?n.endOfMonth($e):he,isDateDisabled:Y,timezone:F});se(Pe||he),ve.preventDefault();break}case"ArrowRight":{const he=n.addDays(Se,V?-1:1),$e=n.addMonths(Se,V?-1:1),Pe=Ka({utils:n,date:he,minDate:V?n.startOfMonth($e):he,maxDate:V?he:n.endOfMonth($e),isDateDisabled:Y,timezone:F});se(Pe||he),ve.preventDefault();break}case"Home":se(n.startOfWeek(Se)),ve.preventDefault();break;case"End":se(n.endOfWeek(Se)),ve.preventDefault();break;case"PageUp":se(n.addMonths(Se,1)),ve.preventDefault();break;case"PageDown":se(n.addMonths(Se,-1)),ve.preventDefault();break}}),le=Ve((ve,Se)=>se(Se)),oe=Ve((ve,Se)=>{P&&n.isSameDay(re,Se)&&B?.(!1)}),ue=n.getMonth(i),ie=n.getYear(i),Z=M.useMemo(()=>s.filter(ve=>!!ve).map(ve=>n.startOfDay(ve)),[n,s]),de=`${ie}-${ue}`,ae=M.useMemo(()=>M.createRef(),[de]),ne=M.useMemo(()=>{const ve=n.startOfMonth(i),Se=n.endOfMonth(i);return Y(re)||n.isAfterDay(re,Se)||n.isBeforeDay(re,ve)?Ka({utils:n,date:re,minDate:ve,maxDate:Se,disablePast:y,disableFuture:x,isDateDisabled:Y,timezone:F}):re},[i,x,y,re,Y,n,F]),Ce=M.useMemo(()=>{const ve=n.getWeekArray(i);let Se=n.addMonths(i,1);for(;S&&ve.length<S;){const he=n.getWeekArray(Se),$e=n.isSameDay(ve[ve.length-1][0],he[0][0]);he.slice($e?1:0).forEach(Pe=>{ve.length<S&&ve.push(Pe)}),Se=n.addMonths(Se,1)}return ve},[i,S,n]);return c.jsxs(k$,{role:"grid","aria-labelledby":L,className:H.root,children:[c.jsxs(w$,{role:"row",className:H.header,children:[j&&c.jsx(I$,{variant:"caption",role:"columnheader","aria-label":q.calendarWeekNumberHeaderLabel,className:H.weekNumberLabel,children:q.calendarWeekNumberHeaderText}),QF(n,R).map((ve,Se)=>c.jsx(D$,{variant:"caption",role:"columnheader","aria-label":n.format(ve,"weekday"),className:H.weekDayLabel,children:_(ve)},Se.toString()))]}),l?c.jsx(O$,{className:H.loadingContainer,children:p()}):c.jsx(M$,Q({transKey:de,onExited:d,reduceAnimations:h,slideDirection:m,className:Ue(o,H.slideTransition)},b,{nodeRef:ae,children:c.jsx(P$,{ref:ae,role:"rowgroup",className:H.monthContainer,children:Ce.map((ve,Se)=>c.jsxs(R$,{role:"row",className:H.weekContainer,"aria-rowindex":Se+1,children:[j&&c.jsx(A$,{className:H.weekNumber,role:"rowheader","aria-label":q.calendarWeekNumberAriaLabelText(n.getWeekNumber(ve[0])),children:q.calendarWeekNumberText(n.getWeekNumber(ve[0]))}),ve.map((he,$e)=>c.jsx(N$,{parentProps:t,day:he,selectedDays:Z,focusableDay:ne,onKeyDown:G,onFocus:le,onBlur:oe,onDaySelect:ye,isDateDisabled:Y,currentMonthNumber:ue,isViewFocused:P,"aria-colindex":$e+1},he.toString()))]},`week-${ve[0]}`))})}))]})}function L$(e){return Ge("MuiPickersMonth",e)}const lu=qe("MuiPickersMonth",["root","monthButton","disabled","selected"]),_$=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],B$=e=>{const{disabled:t,selected:n,classes:r}=e;return Ke({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},L$,r)},j$=pe("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%"}}]}),$$=pe("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${lu.disabled}`]:t.disabled},{[`&.${lu.selected}`]:t.selected}]})(({theme:e})=>Q({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"},[`&.${lu.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${lu.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),H$=M.memo(function(t){const n=Gt({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=et(n,_$),E=M.useRef(null),T=B$(n);yn(()=>{r&&E.current?.focus()},[r]);const I=y?.monthButton??$$,D=Ct({elementType:I,externalSlotProps:x?.monthButton,additionalProps:{children:i,disabled:s,tabIndex:u,ref:E,type:"button",role:"radio","aria-current":m,"aria-checked":a,"aria-label":b,onClick:_=>d(_,l),onKeyDown:_=>f(_,l),onFocus:_=>h(_,l),onBlur:_=>p(_,l)},ownerState:n,className:T.monthButton});return c.jsx(j$,Q({className:Ue(T.root,o),ownerState:n},C,{children:c.jsx(I,Q({},D))}))});function z$(e){return Ge("MuiMonthCalendar",e)}qe("MuiMonthCalendar",["root"]);const U$=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],V$=e=>{const{classes:t}=e;return Ke({root:["root"]},z$,t)};function W$(e,t){const n=Zt(),r=Al(),o=Gt({props:e,name:t});return Q({disableFuture:!1,disablePast:!1},o,{minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate)})}const q$=pe("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:$c,boxSizing:"border-box"}),Y$=M.forwardRef(function(t,n){const r=W$(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:E,monthsPerRow:T=3,timezone:I,gridLabelId:D,slots:_,slotProps:O}=r,B=et(r,U$),{value:L,handleValueChange:j,timezone:S}=ch({name:"MonthCalendar",timezone:I,value:i,defaultValue:s,referenceDate:a,onChange:p,valueManager:Jr}),$=Lc(S),F=wr(),R=Zt(),H=M.useMemo(()=>Jr.getInitialReferenceValue({value:L,utils:R,props:r,timezone:S,referenceDate:a,granularity:Gr.month}),[]),V=r,Y=V$(V),q=M.useMemo(()=>R.getMonth($),[R,$]),P=M.useMemo(()=>L!=null?R.getMonth(L):null,[L,R]),[J,re]=M.useState(()=>P||R.getMonth(H)),[z,ye]=or({name:"MonthCalendar",state:"hasFocus",controlled:C,default:y??!1}),se=Ve(de=>{ye(de),E&&E(de)}),G=M.useCallback(de=>{const ae=R.startOfMonth(d&&R.isAfter($,h)?$:h),ne=R.startOfMonth(u&&R.isBefore($,f)?$:f),Ce=R.startOfMonth(de);return R.isBefore(Ce,ae)||R.isAfter(Ce,ne)?!0:m?m(Ce):!1},[u,d,f,h,$,m,R]),le=Ve((de,ae)=>{if(b)return;const ne=R.setMonth(L??H,ae);j(ne)}),oe=Ve(de=>{G(R.setMonth(L??H,de))||(re(de),se(!0),x&&x(de))});M.useEffect(()=>{re(de=>P!==null&&de!==P?P:de)},[P]);const ue=Ve((de,ae)=>{switch(de.key){case"ArrowUp":oe((12+ae-3)%12),de.preventDefault();break;case"ArrowDown":oe((12+ae+3)%12),de.preventDefault();break;case"ArrowLeft":oe((12+ae+(F?1:-1))%12),de.preventDefault();break;case"ArrowRight":oe((12+ae+(F?-1:1))%12),de.preventDefault();break}}),ie=Ve((de,ae)=>{oe(ae)}),Z=Ve((de,ae)=>{J===ae&&se(!1)});return c.jsx(q$,Q({ref:n,className:Ue(Y.root,o),ownerState:V,role:"radiogroup","aria-labelledby":D},B,{children:Yp(R,L??H).map(de=>{const ae=R.getMonth(de),ne=R.format(de,"monthShort"),Ce=R.format(de,"month"),ve=ae===P,Se=l||G(de);return c.jsx(H$,{selected:ve,value:ae,onClick:le,onKeyDown:ue,autoFocus:z&&ae===J,disabled:Se,tabIndex:ae===J&&!Se?0:-1,onFocus:ie,onBlur:Z,"aria-current":q===ae?"date":void 0,"aria-label":Ce,monthsPerRow:T,slots:_,slotProps:O,children:ne},ne)})}))});function K$(e){return Ge("MuiPickersYear",e)}const uu=qe("MuiPickersYear",["root","yearButton","selected","disabled"]),G$=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],Q$=e=>{const{disabled:t,selected:n,classes:r}=e;return Ke({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},K$,r)},X$=pe("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%"}}]}),Z$=pe("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${uu.disabled}`]:t.disabled},{[`&.${uu.selected}`]:t.selected}]})(({theme:e})=>Q({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"},[`&.${uu.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${uu.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),J$=M.memo(function(t){const n=Gt({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=et(n,G$),C=M.useRef(null),E=Q$(n);yn(()=>{r&&C.current?.focus()},[r]);const T=b?.yearButton??Z$,I=Ct({elementType:T,externalSlotProps:y?.yearButton,additionalProps:{children:i,disabled:s,tabIndex:u,ref:C,type:"button",role:"radio","aria-current":m,"aria-checked":a,onClick:D=>d(D,l),onKeyDown:D=>f(D,l),onFocus:D=>h(D,l),onBlur:D=>p(D,l)},ownerState:n,className:E.yearButton});return c.jsx(X$,Q({className:Ue(E.root,o),ownerState:n},x,{children:c.jsx(T,Q({},I))}))});function eH(e){return Ge("MuiYearCalendar",e)}qe("MuiYearCalendar",["root"]);const tH=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],nH=e=>{const{classes:t}=e;return Ke({root:["root"]},eH,t)};function rH(e,t){const n=Zt(),r=Al(),o=Gt({props:e,name:t});return Q({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:vr(n,o.minDate,r.minDate),maxDate:vr(n,o.maxDate,r.maxDate)})}const oH=pe("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:$c,maxHeight:t9,boxSizing:"border-box",position:"relative"}),iH=M.forwardRef(function(t,n){const r=rH(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:E,yearsOrder:T="asc",yearsPerRow:I,timezone:D,gridLabelId:_,slots:O,slotProps:B}=r,L=et(r,tH),{value:j,handleValueChange:S,timezone:$}=ch({name:"YearCalendar",timezone:D,value:s,defaultValue:a,referenceDate:l,onChange:m,valueManager:Jr}),F=Lc($),R=wr(),H=Zt(),V=M.useMemo(()=>Jr.getInitialReferenceValue({value:j,utils:H,props:r,timezone:$,referenceDate:l,granularity:Gr.year}),[]),Y=r,q=nH(Y),P=M.useMemo(()=>H.getYear(F),[H,F]),J=M.useMemo(()=>j!=null?H.getYear(j):null,[j,H]),[re,z]=M.useState(()=>J||H.getYear(V)),[ye,se]=or({name:"YearCalendar",state:"hasFocus",controlled:C,default:o??!1}),G=Ve(he=>{se(he),E&&E(he)}),le=M.useCallback(he=>{if(f&&H.isBeforeYear(he,F)||d&&H.isAfterYear(he,F)||p&&H.isBeforeYear(he,p)||h&&H.isAfterYear(he,h))return!0;if(!y)return!1;const $e=H.startOfYear(he);return y($e)},[d,f,h,p,F,y,H]),oe=Ve((he,$e)=>{if(b)return;const Pe=H.setYear(j??V,$e);S(Pe)}),ue=Ve(he=>{le(H.setYear(j??V,he))||(z(he),G(!0),x?.(he))});M.useEffect(()=>{z(he=>J!==null&&he!==J?J:he)},[J]);const ie=T!=="desc"?I*1:I*-1,Z=R&&T==="asc"||!R&&T==="desc"?-1:1,de=Ve((he,$e)=>{switch(he.key){case"ArrowUp":ue($e-ie),he.preventDefault();break;case"ArrowDown":ue($e+ie),he.preventDefault();break;case"ArrowLeft":ue($e-Z),he.preventDefault();break;case"ArrowRight":ue($e+Z),he.preventDefault();break}}),ae=Ve((he,$e)=>{ue($e)}),ne=Ve((he,$e)=>{re===$e&&G(!1)}),Ce=M.useRef(null),ve=Et(n,Ce);M.useEffect(()=>{if(o||Ce.current===null)return;const he=Ce.current.querySelector('[tabindex="0"]');if(!he)return;const $e=he.offsetHeight,Pe=he.offsetTop,Je=Ce.current.clientHeight,Me=Ce.current.scrollTop,Nt=Pe+$e;$e>Je||Pe<Me||(Ce.current.scrollTop=Nt-Je/2-$e/2)},[o]);const Se=H.getYearRange([p,h]);return T==="desc"&&Se.reverse(),c.jsx(oH,Q({ref:ve,className:Ue(q.root,i),ownerState:Y,role:"radiogroup","aria-labelledby":_},L,{children:Se.map(he=>{const $e=H.getYear(he),Pe=$e===J,Je=u||le(he);return c.jsx(J$,{selected:Pe,value:$e,onClick:oe,onKeyDown:de,autoFocus:ye&&$e===re,disabled:Je,tabIndex:$e===re&&!Je?0:-1,onFocus:ae,onBlur:ne,"aria-current":P===$e?"date":void 0,yearsPerRow:I,slots:O,slotProps:B,children:H.format(he,"year")},H.format(he,"year"))})}))}),sH=e=>Ge("MuiPickersCalendarHeader",e),aH=qe("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function lH(e){return Ge("MuiPickersArrowSwitcher",e)}qe("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const uH=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],cH=["ownerState"],dH=["ownerState"],fH=pe("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),pH=pe("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),j1=pe(Ar,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),hH=e=>{const{classes:t}=e;return Ke({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},lH,t)},mH=M.forwardRef(function(t,n){const r=wr(),o=Gt({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=et(o,uH),E=o,T=hH(E),I={isDisabled:u,isHidden:d,goTo:f,label:h},D={isDisabled:p,isHidden:m,goTo:b,label:y},_=a?.previousIconButton??j1,O=Ct({elementType:_,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:D.label,"aria-label":D.label,disabled:D.isDisabled,edge:"end",onClick:D.goTo},ownerState:Q({},E,{hidden:D.isHidden}),className:Ue(T.button,T.previousIconButton)}),B=a?.nextIconButton??j1,L=Ct({elementType:B,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:I.label,"aria-label":I.label,disabled:I.isDisabled,edge:"start",onClick:I.goTo},ownerState:Q({},E,{hidden:I.isHidden}),className:Ue(T.button,T.nextIconButton)}),j=a?.leftArrowIcon??b9,S=Ct({elementType:j,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:E,className:T.leftArrowIcon}),$=et(S,cH),F=a?.rightArrowIcon??y9,R=Ct({elementType:F,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:E,className:T.rightArrowIcon}),H=et(R,dH);return c.jsxs(fH,Q({ref:n,className:Ue(T.root,s),ownerState:E},C,{children:[c.jsx(_,Q({},O,{children:r?c.jsx(F,Q({},H)):c.jsx(j,Q({},$))})),i?c.jsx(Dt,{variant:"subtitle1",component:"span",id:x,children:i}):c.jsx(pH,{className:T.spacer,ownerState:E}),c.jsx(B,Q({},L,{children:r?c.jsx(j,Q({},$)):c.jsx(F,Q({},H))}))]}))});function gH(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 bH(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 yH=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],xH=["ownerState"],vH=e=>{const{classes:t}=e;return Ke({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},sH,t)},CH=pe("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}),EH=pe("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>Q({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),TH=pe("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),SH=pe(Ar,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${aH.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),kH=pe(g9,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),wH=M.forwardRef(function(t,n){const r=Eo(),o=Zt(),i=Gt({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:E,className:T,timezone:I,format:D=`${o.formats.month} ${o.formats.year}`}=i,_=et(i,yH),O=i,B=vH(i),L=s?.switchViewButton??SH,j=Ct({elementType:L,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(y)},ownerState:O,className:B.switchViewButton}),S=s?.switchViewIcon??kH,$=Ct({elementType:S,externalSlotProps:a?.switchViewIcon,ownerState:O,className:B.switchViewIcon}),F=et($,xH),R=()=>m(o.addMonths(l,1),"left"),H=()=>m(o.addMonths(l,-1),"right"),V=gH(l,{disableFuture:d,maxDate:h,timezone:I}),Y=bH(l,{disablePast:f,minDate:p,timezone:I}),q=()=>{if(!(C.length===1||!b||u))if(C.length===2)b(C.find(J=>J!==y)||C[0]);else{const J=C.indexOf(y)!==0?0:1;b(C[J])}};if(C.length===1&&C[0]==="year")return null;const P=o.formatByString(l,D);return c.jsxs(CH,Q({},_,{ownerState:O,className:Ue(B.root,T),ref:n,children:[c.jsxs(EH,{role:"presentation",onClick:q,ownerState:O,"aria-live":"polite",className:B.labelContainer,children:[c.jsx(Uv,{reduceAnimations:x,transKey:P,children:c.jsx(TH,{id:E,ownerState:O,className:B.label,children:P})}),C.length>1&&!u&&c.jsx(L,Q({},j,{children:c.jsx(S,Q({},F))}))]}),c.jsx(yi,{in:y==="day",appear:!x,enter:!x,children:c.jsx(mH,{slots:s,slotProps:a,onGoToPrevious:H,isPreviousDisabled:Y,previousLabel:r.previousMonth,onGoToNext:R,isNextDisabled:V,nextLabel:r.nextMonth})})]}))}),DH=pe("div")({overflow:"hidden",width:$c,maxHeight:dh,display:"flex",flexDirection:"column",margin:"0 auto"}),IH=e=>Ge("MuiDateCalendar",e);qe("MuiDateCalendar",["root","viewTransitionContainer"]);const AH=["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"],OH=e=>{const{classes:t}=e;return Ke({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},IH,t)};function MH(e,t){const n=Zt(),r=Al(),o=mv(),i=Gt({props:e,name:t});return Q({},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 PH=pe(DH,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:dh}),RH=pe(Uv,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),NH=M.forwardRef(function(t,n){const r=Zt(),o=Br(),i=MH(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:E,view:T,views:I,openTo:D,className:_,disabled:O,readOnly:B,minDate:L,maxDate:j,disableHighlightToday:S,focusedView:$,onFocusedViewChange:F,showDaysOutsideCurrentMonth:R,fixedWeekNumber:H,dayOfWeekFormatter:V,slots:Y,slotProps:q,loading:P,renderLoading:J,displayWeekNumber:re,yearsOrder:z,yearsPerRow:ye,monthsPerRow:se,timezone:G}=i,le=et(i,AH),{value:oe,handleValueChange:ue,timezone:ie}=ch({name:"DateCalendar",timezone:G,value:l,defaultValue:u,referenceDate:d,onChange:p,valueManager:Jr}),{view:Z,setView:de,focusedView:ae,setFocusedView:ne,goToNextView:Ce,setValueAndGoToNextView:ve}=gv({view:T,views:I,openTo:D,onChange:ue,onViewChange:a,autoFocus:s,focusedView:$,onFocusedViewChange:F}),{referenceDate:Se,calendarState:he,changeFocusedDay:$e,changeMonth:Pe,handleChangeMonth:Je,isDateDisabled:Me,onMonthSwitchingAnimationEnd:Nt}=i$({value:oe,referenceDate:d,reduceAnimations:y,onMonthChange:b,minDate:L,maxDate:j,shouldDisableDate:x,disablePast:h,disableFuture:f,timezone:ie}),ct=O&&oe||L,tt=O&&oe||j,xe=`${o}-grid-label`,Oe=ae!==null,We=Y?.calendarHeader??wH,Xe=Ct({elementType:We,externalSlotProps:q?.calendarHeader,additionalProps:{views:I,view:Z,currentMonth:he.currentMonth,onViewChange:de,onMonthChange:(st,Lt)=>Je({newMonth:st,direction:Lt}),minDate:ct,maxDate:tt,disabled:O,disablePast:h,disableFuture:f,reduceAnimations:y,timezone:ie,labelId:xe},ownerState:i}),Ze=Ve(st=>{const Lt=r.startOfMonth(st),Qt=r.endOfMonth(st),yt=Me(st)?Ka({utils:r,date:st,minDate:r.isBefore(L,Lt)?Lt:L,maxDate:r.isAfter(j,Qt)?Qt:j,disablePast:h,disableFuture:f,isDateDisabled:Me,timezone:ie}):st;yt?(ve(yt,"finish"),b?.(Lt)):(Ce(),Pe(Lt)),$e(yt,!0)}),Fe=Ve(st=>{const Lt=r.startOfYear(st),Qt=r.endOfYear(st),yt=Me(st)?Ka({utils:r,date:st,minDate:r.isBefore(L,Lt)?Lt:L,maxDate:r.isAfter(j,Qt)?Qt:j,disablePast:h,disableFuture:f,isDateDisabled:Me,timezone:ie}):st;yt?(ve(yt,"finish"),m?.(yt)):(Ce(),Pe(Lt)),$e(yt,!0)}),dt=Ve(st=>ue(st&&Xu(r,st,oe??Se),"finish",Z));M.useEffect(()=>{oe!=null&&r.isValid(oe)&&Pe(oe)},[oe]);const lt=i,Mt=OH(lt),be={disablePast:h,disableFuture:f,maxDate:j,minDate:L},Ae={disableHighlightToday:S,readOnly:B,disabled:O,timezone:ie,gridLabelId:xe,slots:Y,slotProps:q},Re=M.useRef(Z);M.useEffect(()=>{Re.current!==Z&&(ae===Re.current&&ne(Z,!0),Re.current=Z)},[ae,ne,Z]);const Qe=M.useMemo(()=>[oe],[oe]);return c.jsxs(PH,Q({ref:n,className:Ue(Mt.root,_),ownerState:lt},le,{children:[c.jsx(We,Q({},Xe,{slots:Y,slotProps:q})),c.jsx(RH,{reduceAnimations:y,className:Mt.viewTransitionContainer,transKey:Z,ownerState:lt,children:c.jsxs("div",{children:[Z==="year"&&c.jsx(iH,Q({},be,Ae,{value:oe,onChange:Fe,shouldDisableYear:E,hasFocus:Oe,onFocusedViewChange:st=>ne("year",st),yearsOrder:z,yearsPerRow:ye,referenceDate:Se})),Z==="month"&&c.jsx(Y$,Q({},be,Ae,{hasFocus:Oe,className:_,value:oe,onChange:Ze,shouldDisableMonth:C,onFocusedViewChange:st=>ne("month",st),monthsPerRow:se,referenceDate:Se})),Z==="day"&&c.jsx(F$,Q({},he,be,Ae,{onMonthSwitchingAnimationEnd:Nt,onFocusedDayChange:$e,reduceAnimations:y,selectedDays:Qe,onSelectedDaysChange:dt,shouldDisableDate:x,shouldDisableMonth:C,shouldDisableYear:E,hasFocus:Oe,onFocusedViewChange:st=>ne("day",st),showDaysOutsideCurrentMonth:R,fixedWeekNumber:H,dayOfWeekFormatter:V,displayWeekNumber:re,loading:P,renderLoading:J}))]})})]}))}),gs=({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:E,monthsPerRow:T,onYearChange:I,yearsOrder:D,yearsPerRow:_,slots:O,slotProps:B,loading:L,renderLoading:j,disableHighlightToday:S,readOnly:$,disabled:F,showDaysOutsideCurrentMonth:R,dayOfWeekFormatter:H,sx:V,autoFocus:Y,fixedWeekNumber:q,displayWeekNumber:P,timezone:J})=>c.jsx(NH,{view:e,onViewChange:t,views:n.filter(Yg),focusedView:r&&Yg(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:E,monthsPerRow:T,onYearChange:I,yearsOrder:D,yearsPerRow:_,slots:O,slotProps:B,loading:L,renderLoading:j,disableHighlightToday:S,readOnly:$,disabled:F,showDaysOutsideCurrentMonth:R,dayOfWeekFormatter:H,sx:V,autoFocus:Y,fixedWeekNumber:q,displayWeekNumber:P,timezone:J}),Yv=M.forwardRef(function(t,n){const r=Eo(),o=Zt(),i=X2(t,"MuiDesktopDatePicker"),s=Q({day:gs,month:gs,year:gs},i.viewRenderers),a=Q({},i,{viewRenderers:s,format:Kp(o,i,!1),yearsPerRow:i.yearsPerRow??4,slots:Q({openPickerIcon:x9,field:Hv},i.slots),slotProps:Q({},i.slotProps,{field:u=>Q({},br(i.slotProps?.field,u),J2(i),{ref:n}),toolbar:Q({hidden:!0},i.slotProps?.toolbar)})}),{renderPicker:l}=m9({props:a,valueManager:Jr,valueType:"date",getOpenDialogAriaText:G2({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:a.localeText?.openDatePickerDialogue}),validator:Ol});return l()});Yv.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:B2,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])};function FH(e){return Ge("MuiDialogContent",e)}qe("MuiDialogContent",["root","dividers"]);function LH(e){return Ge("MuiDialogTitle",e)}const _H=qe("MuiDialogTitle",["root"]),BH=e=>{const{classes:t,dividers:n}=e;return Ke({root:["root",n&&"dividers"]},FH,t)},jH=pe("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(pt(({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:{[`.${_H.root} + &`]:{paddingTop:0}}}]}))),io=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogContent"}),{className:o,dividers:i=!1,...s}=r,a={...r,dividers:i},l=BH(a);return c.jsx(jH,{className:Ue(l.root,o),ownerState:a,ref:n,...s})});function $H(e){return Ge("MuiDialog",e)}const Ja=qe("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Kv=M.createContext({}),HH=pe(Dv,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),zH=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:i}=e,s={root:["root"],container:["container",`scroll${Le(n)}`],paper:["paper",`paperScroll${Le(n)}`,`paperWidth${Le(String(r))}`,o&&"paperFullWidth",i&&"paperFullScreen"]};return Ke(s,$H,t)},UH=pe(Iv,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),VH=pe("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Le(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"}}}]}),WH=pe(wi,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Le(n.scroll)}`],t[`paperWidth${Le(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(pt(({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)`,[`&.${Ja.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}`,[`&.${Ja.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,[`&.${Ja.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),so=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialog"}),o=Bo(),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:E,PaperComponent:T=wi,PaperProps:I={},scroll:D="paper",slots:_={},slotProps:O={},TransitionComponent:B=yi,transitionDuration:L=i,TransitionProps:j,...S}=r,$={...r,disableEscapeKeyDown:p,fullScreen:m,fullWidth:b,maxWidth:y,scroll:D},F=zH($),R=M.useRef(),H=ae=>{R.current=ae.target===ae.currentTarget},V=ae=>{x&&x(ae),R.current&&(R.current=null,C&&C(ae,"backdropClick"))},Y=Br(a),q=M.useMemo(()=>({titleId:Y}),[Y]),P={transition:B,..._},J={transition:j,paper:I,backdrop:d,...O},re={slots:P,slotProps:J},[z,ye]=kt("root",{elementType:UH,shouldForwardComponentProp:!0,externalForwardedProps:re,ownerState:$,className:Ue(F.root,h),ref:n}),[se,G]=kt("backdrop",{elementType:HH,shouldForwardComponentProp:!0,externalForwardedProps:re,ownerState:$}),[le,oe]=kt("paper",{elementType:WH,shouldForwardComponentProp:!0,externalForwardedProps:re,ownerState:$,className:Ue(F.paper,I.className)}),[ue,ie]=kt("container",{elementType:VH,externalForwardedProps:re,ownerState:$,className:F.container}),[Z,de]=kt("transition",{elementType:yi,externalForwardedProps:re,ownerState:$,additionalProps:{appear:!0,in:E,timeout:L,role:"presentation"}});return c.jsx(z,{closeAfterTransition:!0,slots:{backdrop:se},slotProps:{backdrop:{transitionDuration:L,as:u,...G}},disableEscapeKeyDown:p,onClose:C,open:E,onClick:V,...ye,...S,children:c.jsx(Z,{...de,children:c.jsx(ue,{onMouseDown:H,...ie,children:c.jsx(le,{as:T,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":Y,"aria-modal":l,...oe,children:c.jsx(Kv.Provider,{value:q,children:f})})})})})}),qH=pe(so)({[`& .${Ja.container}`]:{outline:0},[`& .${Ja.paper}`]:{outline:0,minWidth:$c}}),YH=pe(io)({"&:first-of-type":{padding:0}});function KH(e){const{children:t,onDismiss:n,open:r,slots:o,slotProps:i}=e,s=o?.dialog??qH,a=o?.mobileTransition??yi;return c.jsx(s,Q({open:r,onClose:n},i?.dialog,{TransitionComponent:a,TransitionProps:i?.mobileTransition,PaperComponent:o?.mobilePaper,PaperProps:i?.mobilePaper,children:c.jsx(YH,{children:t})}))}const GH=["props","getOpenDialogAriaText"],QH=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=et(e,GH);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:E}=t,T=M.useRef(null),I=Br(),D=i?.toolbar?.hidden??!1,{open:_,actions:O,layoutProps:B,renderCurrentView:L,fieldProps:j,contextValue:S}=bv(Q({},r,{props:t,fieldRef:T,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),$=o.field,F=Ct({elementType:$,externalSlotProps:i?.field,additionalProps:Q({},j,D&&{id:I},!(C||x)&&{onClick:O.onOpen,onKeyDown:n7(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});F.inputProps=Q({},F.inputProps,{"aria-label":n(j.value)});const R=Q({textField:o.textField},F.slots),H=o.layout??Tv;let V=I;D&&(b?V=`${I}-label`:V=void 0);const Y=Q({},i,{toolbar:Q({},i?.toolbar,{titleId:I}),mobilePaper:Q({"aria-labelledby":V},i?.mobilePaper)}),q=Et(T,F.unstableFieldRef);return{renderPicker:()=>c.jsxs(Sv,{contextValue:S,localeText:E,children:[c.jsx($,Q({},F,{slots:R,slotProps:Y,unstableFieldRef:q})),c.jsx(KH,Q({},O,{open:_,slots:o,slotProps:Y,children:c.jsx(H,Q({},B,Y?.layout,{slots:o,slotProps:Y,children:L()}))}))]})}},Gv=M.forwardRef(function(t,n){const r=Eo(),o=Zt(),i=X2(t,"MuiMobileDatePicker"),s=Q({day:gs,month:gs,year:gs},i.viewRenderers),a=Q({},i,{viewRenderers:s,format:Kp(o,i,!1),slots:Q({field:Hv},i.slots),slotProps:Q({},i.slotProps,{field:u=>Q({},br(i.slotProps?.field,u),J2(i),{ref:n}),toolbar:Q({hidden:!1},i.slotProps?.toolbar)})}),{renderPicker:l}=QH({props:a,valueManager:Jr,valueType:"date",getOpenDialogAriaText:G2({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:a.localeText?.openDatePickerDialogue}),validator:Ol});return l()});Gv.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:B2,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 XH=["desktopModeMediaQuery"],el=M.forwardRef(function(t,n){const r=Gt({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:o=r7}=r,i=et(r,XH);return _2(o,{defaultMatches:!0})?c.jsx(Yv,Q({ref:n},i)):c.jsx(Gv,Q({ref:n},i))});var Ou={exports:{}},ZH=Ou.exports,$1;function JH(){return $1||($1=1,(function(e,t){(function(n,r){e.exports=r()})(ZH,(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 D=I.match(r);if(!D)return null;var _=(""+D[0]).match(o)||["-",0,0],O=_[0],B=60*+_[1]+ +_[2];return B===0?0:O==="+"?B:-B})(b),b===null))return this;var C=Math.abs(b)<=16?60*b:b;if(C===0)return this.utc(y);var E=this.clone();if(y)return E.$offset=C,E.$u=!1,E;var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(E=this.local().add(C+T,n)).$offset=C,E.$x.$localOffset=T,E};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(),E=a(b).local();return m.call(C,E,y,x)}}}))})(Ou)),Ou.exports}var ez=JH();const Qv=Sr(ez);function tz(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"?nz(n):n}function nz(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"?`
|
|
208
|
-
`:r==="t"?" ":r==="r"?"\r":r):e}Ft.extend(Qv);const H1=14,rz=42;function oz(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(`
|
|
209
|
-
`):void 0}function Xv({given:e,value:t,onChange:n,options:r,optionsLoading:o,optionsFailed:i}){const s=e.label??e.name??"",a=e.type??"string",l=oz(e),u=tz(a,e.default),d=u!==void 0?`Default: ${u===""?"(empty)":u}`:void 0,f=l||d?c.jsxs(c.Fragment,{children:[l,l&&d?c.jsx("br",{}):null,d]}):void 0,h=a==="string"||qa(a)==="string",p=!oi(a)||typeof t!="string"||QN(t),m=F=>c.jsx(k.TextField,{label:s,value:String(t),error:!0,inputProps:{readOnly:!0},helperText:c.jsxs(c.Fragment,{children:[`Not a ${F}. Clear it to pick one.`,f?c.jsx("br",{}):null,f]}),slotProps:{input:{endAdornment:c.jsx(Yd,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"}),b=oi(a),y=e.control==="multiselect"&&b,x=oi(a),C=e.control==="select"||e.control==="multiselect",E=C?x?typeof t=="string"?GN(t):[]:typeof t=="string"&&t!==""?[t]:[]:[];if(C&&h&&p&&!(!y&&E.length>1)){const F=R=>{const H=x?jp(R):void 0;if(R.length===0||H===""){n(null);return}n(x?H:R[0])};return c.jsx(k.Autocomplete,{multiple:y,disableCloseOnSelect:y,freeSolo:!0,forcePopupIcon:!0,autoSelect:!0,options:r??[],loading:o,noOptionsText:i?"Options unavailable":"No matching values",value:y?E:E[0]??null,onChange:(R,H)=>F(H===null?[]:Array.isArray(H)?H:[H]),renderInput:R=>c.jsx(k.TextField,{...R,label:s,size:"small",placeholder:E.length!==0?void 0:t===""?"All":u??"All",error:i,helperText:i?c.jsxs(c.Fragment,{children:["Could not load the options for this control. Type a value to filter anyway.",f?c.jsx("br",{}):null,f]}):f,slotProps:{input:{...R.InputProps,endAdornment:c.jsxs(c.Fragment,{children:[o&&c.jsx(k.CircularProgress,{size:16}),R.InputProps.endAdornment]})}}}),fullWidth:!0})}const T=oi(a)&&qa(a)==="number",{rangeMin:I,rangeMax:D}=e,_=!T||t===void 0||t===null||t===""||typeof t=="string"&&Mg(t)!==void 0;if((T||a==="number")&&I!==void 0&&D!==void 0&&_){const F=T?typeof t=="string"?Mg(t):void 0:typeof t=="number"?t:void 0;if(F===void 0&&t!==void 0&&t!==null&&t!=="")return m("number");const R=F??I,H=T&&t==="",V=F!==void 0||H;return c.jsxs(k.FormControl,{fullWidth:!0,children:[c.jsxs(k.Box,{sx:{height:rz,px:`${H1}px`,display:"flex",flexDirection:"column",justifyContent:"center"},children:[c.jsxs(k.Stack,{direction:"row",alignItems:"center",spacing:1,children:[c.jsx(k.Typography,{variant:"body2",color:"text.secondary",noWrap:!0,children:s}),c.jsx(k.Typography,{variant:"body2",sx:{fontWeight:600},children:V?H?"Any":T?`≥ ${R}`:String(R):T?"Any":u??"Unset"}),V&&c.jsx(k.IconButton,{size:"small","aria-label":"clear value",onClick:()=>n(null),sx:{p:0},children:c.jsx(Nf,{fontSize:"small"})})]}),c.jsx(k.Slider,{size:"small",min:I,max:D,value:R,valueLabelDisplay:"auto","aria-label":s,sx:{py:0,mt:.5},onChange:(Y,q)=>{const P=Array.isArray(q)?q[0]:q;if(T&&P<=I){n(null);return}n(T?XN(P):P)}})]}),f&&c.jsx(k.FormHelperText,{sx:{mx:`${H1}px`},children:f})]})}const O=oi(a)?qa(a):void 0,B=O==="date"||O==="timestamp"||O==="timestamptz",L=typeof t=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(t),j=t==null||L;if(B&&j){const F=L?Ft.utc(t):null;return c.jsx(al,{dateAdapter:Qu,children:c.jsx(el,{label:s,value:F?.isValid()?F:null,onChange:R=>n(R?R.format("YYYY-MM-DD"):null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:f},field:{clearable:!0,onClear:()=>n(null)}}})})}if(a==="boolean"){const F=typeof t=="boolean";if(!F&&t!==void 0&&t!==null)return m("true or false");const R=e.default?.trim()==="true",H=F?t:R;return c.jsxs(k.FormControl,{children:[c.jsxs(k.Stack,{direction:"row",alignItems:"center",children:[c.jsx(k.FormControlLabel,{control:c.jsx(k.Checkbox,{checked:H,onChange:V=>n(V.target.checked)}),label:s}),F&&c.jsx(k.IconButton,{size:"small","aria-label":"clear value",onClick:()=>n(null),edge:"end",children:c.jsx(Nf,{fontSize:"small"})})]}),f&&c.jsx(k.FormHelperText,{children:f})]})}if(a==="number"){const F=typeof t=="number"?t:"",R=t!=null;return R&&t!==""&&typeof t!="number"?m("number"):c.jsx(k.TextField,{label:s,type:"number",value:F,onChange:H=>{const V=H.target.value;n(V===""?null:Number(V))},placeholder:u,helperText:f,slotProps:{input:{endAdornment:R&&c.jsx(Yd,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}if(a==="date"||a==="timestamp"||a==="timestamptz"){const F=t instanceof Date?t:typeof t=="string"?(V=>V instanceof Date?V:null)(w2(a,t)):null,R=F?Ft.utc(F):null;return t!=null&&t!==""&&F===null?m("date"):c.jsx(al,{dateAdapter:Qu,children:c.jsx(el,{label:s,value:R,onChange:V=>n(V?JN(V,F??void 0):null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:f},field:{clearable:!0,onClear:()=>n(null)}}})})}const S=typeof t=="string"?t:"",$=t!=null;return c.jsx(k.TextField,{label:s,value:S,onChange:F=>n(F.target.value),placeholder:$?void 0:u??(a.startsWith("filter<")?a:void 0),helperText:f,slotProps:{input:{endAdornment:$&&c.jsx(Yd,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}function Yd({onClear:e}){return c.jsx(k.InputAdornment,{position:"end",children:c.jsx(k.IconButton,{size:"small","aria-label":"clear value",onClick:e,edge:"end",children:c.jsx(Nf,{fontSize:"small"})})})}function vh({givens:e,values:t,onChange:n,onReset:r,layout:o="panel",options:i,optionsLoading:s,optionsFailed:a,apply:l,title:u}){if(e.length===0)return null;const d=Array.from(t.values()).some(p=>p!==null),f=e.map(p=>c.jsx(k.Box,{sx:o==="bar"?{minWidth:200,flex:"1 1 200px",maxWidth:320}:void 0,children:c.jsx(Xv,{given:p,value:p.name?t.get(p.name):void 0,onChange:m=>p.name&&n(p.name,m),options:p.name?i?.get(p.name):void 0,optionsLoading:s,optionsFailed:p.name?a?.has(p.name):void 0})},p.name)),h=c.jsxs(k.Stack,{direction:"row",alignItems:"center",spacing:1,children:[l&&c.jsx(k.Button,{variant:"contained",size:"small",disableElevation:!0,onClick:l.onApply,disabled:!l.pending,sx:{textTransform:"none"},children:"Apply"}),d&&c.jsx(k.Button,{variant:"text",size:"small",onClick:r,sx:{textTransform:"none"},children:"Reset"})]});return o==="bar"?c.jsx(k.Paper,{elevation:0,sx:{p:2,border:1,borderColor:"divider",borderRadius:1,backgroundColor:"background.paper"},children:c.jsxs(k.Stack,{direction:"row",alignItems:"flex-start",spacing:2,useFlexGap:!0,sx:{flexWrap:"wrap"},children:[f,c.jsx(k.Box,{sx:{flex:"0 0 auto",ml:"auto",pt:.5},children:h})]})}):c.jsxs(k.Paper,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[c.jsxs(k.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[c.jsx(k.Typography,{variant:"subtitle2",sx:{fontWeight:600,color:"#333"},children:u??"Parameters"}),h]}),c.jsx(k.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",alignItems:"start",columnGap:3,rowGap:2.5},children:f})]})}const Ch=20,iz={radius:"8px",padding:`${Ch}px`};function Zv(e,t=iz){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,"--publisher-drill-link":e.drillLink,"--publisher-dashboard-card-radius":t.radius,"--publisher-dashboard-card-padding":t.padding}}function sz(e){const t=e.split("->").at(-1)?.trim()??e;return/^[A-Za-z_][\w-]*$/.test(t)?Up(t):e}function qf({environmentName:e,packageName:t,versionId:n,modelPath:r,queryName:o,tile:i,label:s,subtitle:a,borderless:l,givens:u,declaredTypes:d,givenNames:f,height:h,maxResultSize:p,drill:m}){const{apiClients:b}=Ie.useServer(),{theme:y}=Ie.usePublisherTheme(),x=I2(u,d,f),{data:C,isSuccess:E,isError:T,error:I}=zt({queryKey:["dashboardTile",e,t,n,r,o,i,JSON.stringify(x)],queryFn:()=>b.models.executeQueryModel(e,t,r,{queryName:o,query:i!==void 0?`run: ${i}`:void 0,givens:x,versionId:n}),...Ie.CHART_RESULT_QUERY_OPTIONS});return c.jsxs(k.Paper,{elevation:0,sx:{border:l?"none":y.border,borderRadius:l?0:1,background:l?"none":void 0,overflow:"hidden",minHeight:120,p:l?"12px 0":`${Ch}px`},children:[i!==void 0&&c.jsxs(k.Box,{sx:{pb:1.5},children:[c.jsx(k.Typography,{variant:"subtitle2",sx:{fontWeight:500,color:y.tileTitle,fontFamily:y.font.family},title:i,children:s??sz(i)}),a!==void 0&&c.jsx(k.Typography,{variant:"caption",sx:{display:"block",color:y.tileTitle,fontFamily:y.font.family,opacity:.8},children:a})]}),!E&&!T&&c.jsx(xn,{text:"Running…"}),E&&c.jsx(Si,{result:C.data.result,maxHeight:h,maxResultSize:p,renderLogs:C.data.renderLogs,drill:m}),T&&c.jsx(k.Box,{sx:{p:2},children:c.jsx(vn,{context:i??o??r,error:I})})]})}const az=400,lz=2e4,uz=2;function cz(e,t){const n=Math.min(e.colspan??1,t);return e.break?`1 / span ${n}`:`span ${n}`}function dz({resourceUri:e,dashboard:t,givens:n,onGivensChange:r,onNavigate:o,height:i,maxResultSize:s}){const a=jt(e),{apiClients:l}=Ie.useServer(),u=a.environmentName??"",d=a.packageName??"",f=a.versionId,h=!!a.environmentName&&!!a.packageName,{data:p,isSuccess:m,isError:b,error:y}=zt({queryKey:["dashboard",u,d,f,t],queryFn:()=>l.dashboards.getDashboard(u,d,t,f),enabled:h}),x=p?.data,C=W.useMemo(()=>x?.givens??[],[x]),E=W.useMemo(()=>new Map(C.filter(z=>z.name!==void 0).map(z=>[z.name,z.type])),[C]),T=W.useCallback(z=>{m&&r?.(z,Array.from(E.keys()))},[m,r,E]),{draft:I,applied:D,setGiven:_,reset:O,apply:B,pending:L}=$p({declaredTypes:E,startingValues:x?.startingGivens,params:n,onParamsChange:m?T:void 0,documentKey:`${u}/${d}/${f??""}/${t}`,autorun:x?.autorun!==!1}),{options:j,isLoading:S,failed:$}=Hp(u,d,x?.path,C,f),F=W.useMemo(()=>{const z=new Map;for(const ye of E.keys())z.has(ye.toLowerCase())||z.set(ye.toLowerCase(),ye);return z},[E]),R=W.useCallback(z=>E.has(z)?z:F.get(z.toLowerCase()),[E,F]),H=W.useCallback(z=>R(z)!==void 0,[R]),V=W.useCallback((z,ye)=>{const se=R(z);if(se===void 0)return;const G=E.get(se),le=Vp(ye,G);if(le===void 0){console.warn(`Drill declined: ${JSON.stringify(ye)} cannot be a value for given "${se}"`+(G?` of type ${G}`:""));return}_(se,le)},[E,R,_]),{drill:Y,drillMenu:q}=Wp({onNavigate:o,onSelf:V,canSelf:H,selfLabel:"Filter this dashboard"});if(!h)return c.jsxs(k.Alert,{severity:"error",children:["A dashboard resource URI must name an environment and a package. Received: ",e]});if(b)return c.jsx(vn,{context:`${u} > ${d} > ${t}`,error:y});if(!m||!x)return c.jsx(xn,{text:"Loading dashboard…"});if(x.error)return c.jsxs(k.Stack,{spacing:2,children:[c.jsx(z1,{manifest:x}),c.jsx(k.Alert,{severity:"error",children:x.error})]});const P=x.path,J=x.tiles??[],re=x.dashboardColumns??uz;return c.jsxs(k.Stack,{spacing:2,children:[c.jsx(z1,{manifest:x}),c.jsx(vh,{givens:C,values:I,onChange:_,onReset:O,layout:"bar",options:j,optionsLoading:S,optionsFailed:$,apply:x.autorun===!1?{onApply:B,pending:L}:void 0}),P===void 0?c.jsx(k.Alert,{severity:"error",children:"This dashboard has no model path, so there is nothing to run."}):x.query!==void 0?c.jsx(qf,{environmentName:u,packageName:d,versionId:f,modelPath:P,queryName:x.query,givens:D,declaredTypes:E,height:i??lz,maxResultSize:s,drill:Y}):J.length>0?c.jsx(k.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:`repeat(${re}, minmax(0, 1fr))`},gap:2},children:J.map((z,ye)=>c.jsx(k.Box,{sx:{display:"grid",gridColumn:{md:cz(z,re)}},children:c.jsx(qf,{environmentName:u,packageName:d,versionId:f,modelPath:P,tile:z.query,label:z.label,subtitle:z.subtitle,borderless:z.borderless,givens:D,declaredTypes:E,givenNames:z.givenNames,height:i??az,maxResultSize:s,drill:Y})},`${ye}:${z.query}`))}):c.jsx(k.Alert,{severity:"warning",children:"This dashboard names neither a query nor any tiles."}),q]})}function z1({manifest:e}){return c.jsxs(k.Box,{children:[c.jsx(k.Typography,{variant:"h5",sx:{fontWeight:600},children:e.title??e.name}),e.description&&c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:e.description})]})}const Jv=gt(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"})),fz="publisher:resize";function pz(e){return typeof e=="object"&&e!==null&&e.type===fz&&typeof e.height=="number"}function Eh(e){return e.replace(/\/api\/v0\/?$/,"")}function eC({server:e,environmentName:t,packageName:n,path:r}){const o=r.startsWith("public/")?r.slice(7):r;return`${Eh(e)}/environments/${encodeURIComponent(t)}/packages/${encodeURIComponent(n)}/`+o}function hz(e){try{const{environmentName:t,packageName:n,modelPath:r}=jt(e);return!t||!n||!r?null:{environmentName:t,packageName:n,dataAppPath:r}}catch{return null}}function mz({resourceUri:e}){const{server:t,apiClients:n}=Ie.useServer(),r=hz(e),o=r?.environmentName??"",i=r?.packageName??"",s=r?.dataAppPath??"",a=W.useMemo(()=>eC({server:t,environmentName:o,packageName:i,path:s}),[t,o,i,s]),u=zt({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){pz(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(k.Box,{sx:{p:3,...f?{height:"100%",display:"flex",flexDirection:"column"}:{maxWidth:1200,mx:"auto"}},children:[c.jsxs(k.Stack,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1,flexShrink:0},children:[c.jsx(k.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:d}),c.jsx(k.Typography,{variant:"caption",color:"text.secondary",sx:{fontFamily:Ie.MONO_FONT_FAMILY},children:s}),c.jsx(k.Box,{sx:{flex:1}}),c.jsx(k.Tooltip,{title:"Open standalone in new tab",children:c.jsx(k.IconButton,{size:"small",href:a,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",sx:{color:"text.secondary"},children:c.jsx(Jv,{fontSize:"small"})})})]}),c.jsx(k.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(k.Box,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[c.jsx(k.Typography,{variant:"h6",sx:{fontWeight:600},children:"Can't open data app"}),c.jsxs(k.Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["This data app link is missing an environment, package, or path:",c.jsx(k.Box,{component:"span",sx:{fontFamily:Ie.MONO_FONT_FAMILY,ml:1},children:e})]})]})}const tC=gt(c.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}));function gz({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(k.Button,{variant:"contained",startIcon:c.jsx(ys,{}),onClick:()=>i(!0),disabled:n,"aria-label":"New materialization",children:"New materialization"})});return c.jsxs(c.Fragment,{children:[n&&r?c.jsx(k.Tooltip,{title:r,children:d}):d,c.jsxs(k.Dialog,{open:o,onClose:l,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-materialization-title",children:[c.jsx(k.DialogTitle,{id:"create-materialization-title",children:"New materialization"}),c.jsxs(k.DialogContent,{children:[c.jsx(k.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(k.FormGroup,{children:c.jsx(k.FormControlLabel,{control:c.jsx(k.Switch,{checked:s,onChange:f=>a(f.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})})]}),c.jsxs(k.DialogActions,{children:[c.jsx(k.Button,{onClick:l,children:"Cancel"}),c.jsx(k.Button,{variant:"contained",loading:t,onClick:u,children:"Materialize"})]})]})]})}function Yf({children:e}){return c.jsx(k.Typography,{variant:"caption",component:"h6",sx:{display:"block",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,color:"text.secondary",mb:1},children:e})}function fl(e){return e===Ie.MaterializationStatus.Pending||e===Ie.MaterializationStatus.ManifestRowsReady}function bz(e){return e===Ie.MaterializationStatus.ManifestFileReady||e===Ie.MaterializationStatus.Failed||e===Ie.MaterializationStatus.Cancelled}function nC(e){switch(e){case Ie.MaterializationStatus.ManifestFileReady:return"Done";case Ie.MaterializationStatus.Failed:return"Failed";case Ie.MaterializationStatus.Cancelled:return"Cancelled";case Ie.MaterializationStatus.Pending:case Ie.MaterializationStatus.ManifestRowsReady:return"Pending";default:return"Unknown"}}function rC(e){switch(e){case Ie.MaterializationStatus.ManifestRowsReady:return"info";case Ie.MaterializationStatus.ManifestFileReady:return"success";case Ie.MaterializationStatus.Failed:return"error";case Ie.MaterializationStatus.Cancelled:return"warning";case Ie.MaterializationStatus.Pending:default:return"default"}}function oC(e){return e.metadata??{}}function yz(e){return e.trigger==="SCHEDULER"?"Scheduled":"Manual"}function iC(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 Kf(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 xz(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 vz({entries:e,builtAt:t}){const n=Object.entries(e??{});return c.jsxs(k.Box,{children:[c.jsxs(k.Stack,{direction:"row",alignItems:"baseline",justifyContent:"space-between",children:[c.jsx(Yf,{children:"Build manifest"}),t&&c.jsxs(k.Typography,{variant:"caption",color:"text.secondary",children:["Built ",Kf(t)]})]}),n.length===0?c.jsx(k.Typography,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"No materialized tables yet."}):c.jsxs(k.Table,{size:"small",children:[c.jsx(k.TableHead,{children:c.jsxs(k.TableRow,{children:[c.jsx(k.TableCell,{children:"Source"}),c.jsx(k.TableCell,{children:"Table name"}),c.jsx(k.TableCell,{children:"Connection"}),c.jsx(k.TableCell,{children:"Realization"}),c.jsx(k.TableCell,{align:"right",children:"Rows"})]})}),c.jsx(k.TableBody,{children:n.map(([r,o])=>c.jsxs(k.TableRow,{children:[c.jsx(k.TableCell,{sx:{fontFamily:Ie.MONO_FONT_FAMILY},children:o.sourceName??r}),c.jsx(k.TableCell,{sx:{fontFamily:Ie.MONO_FONT_FAMILY},children:o.physicalTableName??"-"}),c.jsx(k.TableCell,{sx:{fontFamily:Ie.MONO_FONT_FAMILY},children:o.connectionName??"-"}),c.jsx(k.TableCell,{children:o.realization??"-"}),c.jsx(k.TableCell,{align:"right",children:o.rowCount??"-"})]},r))})]})]})}const ic=gt([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")]),Cz=gt(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 sC({meta:e}){const t=e.trigger==="SCHEDULER";return c.jsx(k.Tooltip,{title:t?"Fired by the materialization schedule":"Triggered manually",children:c.jsx(k.Chip,{size:"small",variant:"outlined",color:t?"info":"default",icon:t?c.jsx(ic,{fontSize:"small"}):c.jsx(Cz,{fontSize:"small"}),label:yz(e)})})}function aC({materialization:e,buildPlan:t,showBuildPlan:n=!0,onClose:r}){const o=e?oC(e):{},i=Object.values(t?.sources??{});return c.jsx(k.Dialog,{open:e!==null,onClose:r,maxWidth:"md",fullWidth:!0,"aria-labelledby":"materialization-detail-title",children:e&&c.jsxs(c.Fragment,{children:[c.jsxs(k.DialogTitle,{sx:{pr:6,pb:1.5},id:"materialization-detail-title",children:[c.jsxs(k.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.75},children:[c.jsx(k.Chip,{size:"small",label:nC(e.status),color:rC(e.status),variant:fl(e.status)?"filled":"outlined"}),c.jsx(sC,{meta:o})]}),c.jsx(k.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:e.packageName??"Materialization"}),c.jsx(k.Typography,{variant:"caption",color:"text.secondary",sx:{fontFamily:Ie.MONO_FONT_FAMILY,wordBreak:"break-all"},children:e.id}),c.jsx(k.IconButton,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8},children:c.jsx(_r,{fontSize:"small"})})]}),c.jsxs(k.DialogContent,{dividers:!0,children:[c.jsxs(k.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(ya,{label:"Started",value:Kf(e.startedAt??e.createdAt)}),c.jsx(ya,{label:"Completed",value:Kf(e.completedAt)}),c.jsx(ya,{label:"Duration",value:iC(e.startedAt,e.completedAt)}),c.jsx(ya,{label:"Sources",value:`${o.sourcesBuilt??0} built · ${o.sourcesReused??0} reused`}),c.jsx(ya,{label:"Force refresh",value:o.forceRefresh?"Yes":"No"})]}),e.error&&c.jsxs(k.Box,{sx:{borderRadius:2,p:2,mb:3,border:"1px solid",borderColor:"error.main"},children:[c.jsx(Yf,{children:c.jsx(k.Box,{component:"span",sx:{color:"error.main"},children:"Error"})}),c.jsx(k.Typography,{variant:"body2",sx:{fontFamily:Ie.MONO_FONT_FAMILY,whiteSpace:"pre-wrap"},children:e.error})]}),n&&c.jsxs(k.Box,{sx:{mb:3},children:[c.jsx(Yf,{children:"Build plan"}),i.length===0?c.jsx(k.Typography,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"This package has no persist sources."}):c.jsxs(k.Table,{size:"small",children:[c.jsx(k.TableHead,{children:c.jsxs(k.TableRow,{children:[c.jsx(k.TableCell,{children:"Source"}),c.jsx(k.TableCell,{children:"Connection"}),c.jsx(k.TableCell,{children:"Dialect"}),c.jsx(k.TableCell,{align:"right",children:"Columns"}),c.jsx(k.TableCell,{children:"Source Entity ID"})]})}),c.jsx(k.TableBody,{children:i.map(s=>c.jsxs(k.TableRow,{children:[c.jsx(k.TableCell,{sx:{fontFamily:Ie.MONO_FONT_FAMILY},children:s.name}),c.jsx(k.TableCell,{sx:{fontFamily:Ie.MONO_FONT_FAMILY},children:s.connectionName}),c.jsx(k.TableCell,{children:s.dialect??"-"}),c.jsx(k.TableCell,{align:"right",children:s.columns?.length??0}),c.jsx(k.TableCell,{sx:{fontFamily:Ie.MONO_FONT_FAMILY,fontSize:"0.75rem",wordBreak:"break-all",maxWidth:220},children:s.sourceEntityId})]},s.sourceID))})]})]}),c.jsx(vz,{entries:e.manifest?.entries,builtAt:e.manifest?.builtAt})]})]})})}function ya({label:e,value:t}){return c.jsxs(k.Box,{children:[c.jsx(k.Typography,{variant:"caption",color:"text.secondary",display:"block",children:e}),c.jsx(k.Typography,{variant:"body2",children:t})]})}const Ez=gt(c.jsx("path",{d:"M6 6h12v12H6z"}));function Tz(e){return Ge("PrivateSwitchBase",e)}qe("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Sz=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,i={root:["root",n&&"checked",r&&"disabled",o&&`edge${Le(o)}`],input:["input"]};return Ke(i,Tz,t)},kz=pe(bi,{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}}]}),wz=pe("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}),Dz=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:E=!1,tabIndex:T,type:I,value:D,slots:_={},slotProps:O={},...B}=t,[L,j]=or({controlled:o,default:!!s,name:"SwitchBase",state:"checked"}),S=ar(),$=se=>{x&&x(se),S&&S.onFocus&&S.onFocus(se)},F=se=>{b&&b(se),S&&S.onBlur&&S.onBlur(se)},R=se=>{if(se.nativeEvent.defaultPrevented)return;const G=se.target.checked;j(G),y&&y(se,G)};let H=a;S&&typeof H>"u"&&(H=S.disabled);const V=I==="checkbox"||I==="radio",Y={...t,checked:L,disabled:H,disableFocusRipple:l,edge:u},q=Sz(Y),P={slots:_,slotProps:{input:h,...O}},[J,re]=kt("root",{ref:n,elementType:kz,className:q.root,shouldForwardComponentProp:!0,externalForwardedProps:{...P,component:"span",...B},getSlotProps:se=>({...se,onFocus:G=>{se.onFocus?.(G),$(G)},onBlur:G=>{se.onBlur?.(G),F(G)}}),ownerState:Y,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:H,role:void 0,tabIndex:null}}),[z,ye]=kt("input",{ref:p,elementType:wz,className:q.input,externalForwardedProps:P,getSlotProps:se=>({...se,onChange:G=>{se.onChange?.(G),R(G)}}),ownerState:Y,additionalProps:{autoFocus:r,checked:o,defaultChecked:s,disabled:H,id:V?f:void 0,name:m,readOnly:C,required:E,tabIndex:T,type:I,...I==="checkbox"&&D===void 0?{}:{value:D}}});return c.jsxs(J,{...re,children:[c.jsx(z,{...ye}),L?i:d]})}),Iz=gt(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"})),Az=gt(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"})),Oz=gt(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 Mz(e){return Ge("MuiCheckbox",e)}const Kd=qe("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Pz=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i={root:["root",n&&"indeterminate",`color${Le(r)}`,`size${Le(o)}`]},s=Ke(i,Mz,t);return{...t,...s}},Rz=pe(Dz,{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${Le(n.size)}`],n.color!=="default"&&t[`color${Le(n.color)}`]]}})(pt(({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:{[`&.${Kd.checked}, &.${Kd.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Kd.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),Nz=c.jsx(Az,{}),Fz=c.jsx(Iz,{}),Lz=c.jsx(Oz,{}),Th=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiCheckbox"}),{checkedIcon:o=Nz,color:i="primary",icon:s=Fz,indeterminate:a=!1,indeterminateIcon:l=Lz,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},E=Pz(C),T=m.input??u,[I,D]=kt("root",{ref:n,elementType:Rz,className:Ue(E.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:Kb(typeof T=="function"?T(C):T,{"data-indeterminate":a})}}});return c.jsx(I,{...D,classes:E})}),_z=e=>{const{classes:t}=e;return Ke({root:["root"]},LH,t)},Bz=pe(Dt,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),To=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogTitle"}),{className:o,id:i,...s}=r,a=r,l=_z(a),{titleId:u=i}=M.useContext(Kv);return c.jsx(Bz,{component:"h2",className:Ue(l.root,o),ownerState:a,ref:n,variant:"h6",id:i??u,...s})});function jz(e){return Ge("MuiFormControlLabel",e)}const Ra=qe("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),$z=e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e,s={root:["root",n&&"disabled",`labelPlacement${Le(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return Ke(s,jz,t)},Hz=pe("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Ra.label}`]:t.label},t.root,t[`labelPlacement${Le(n.labelPlacement)}`]]}})(pt(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Ra.disabled}`]:{cursor:"default"},[`& .${Ra.label}`]:{[`&.${Ra.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}}]}))),zz=pe("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(pt(({theme:e})=>({[`&.${Ra.error}`]:{color:(e.vars||e).palette.error.main}}))),Uz=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,...E}=r,T=ar(),I=l??a.props.disabled??T?.disabled,D=b??a.props.required,_={disabled:I,required:D};["checked","name","onChange","value","inputRef"].forEach(R=>{typeof a.props[R]>"u"&&typeof r[R]<"u"&&(_[R]=r[R])});const O=Di({props:r,muiFormControl:T,states:["error"]}),B={...r,disabled:I,labelPlacement:h,required:D,error:O.error},L=$z(B),j={slots:y,slotProps:{...s,...x}},[S,$]=kt("typography",{elementType:Dt,externalForwardedProps:j,ownerState:B});let F=f;return F!=null&&F.type!==Dt&&!u&&(F=c.jsx(S,{component:"span",...$,className:Ue(L.label,$?.className),children:F})),c.jsxs(Hz,{className:Ue(L.root,i),ownerState:B,ref:n,...E,children:[M.cloneElement(a,_),D?c.jsxs("div",{children:[F,c.jsxs(zz,{ownerState:B,"aria-hidden":!0,className:L.asterisk,children:[" ","*"]})]}):F]})});function Vz(e){return Ge("MuiListItemIcon",e)}const U1=qe("MuiListItemIcon",["root","alignItemsFlexStart"]),Wz=e=>{const{alignItems:t,classes:n}=e;return Ke({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},Vz,n)},qz=pe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(pt(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),Sh=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiListItemIcon"}),{className:o,...i}=r,s=M.useContext(go),a={...r,alignItems:s.alignItems},l=Wz(a);return c.jsx(qz,{className:Ue(l.root,o),ownerState:a,ref:n,...i})});function Yz(e){return Ge("MuiListItemText",e)}const as=qe("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),Kz=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"]},Yz,t)},Gz=pe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${as.primary}`]:t.primary},{[`& .${as.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,[`.${e1.root}:where(& .${as.primary})`]:{display:"block"},[`.${e1.root}:where(& .${as.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),kh=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(go);let y=l??o,x=d;const C={...r,disableTypography:s,inset:a,primary:!!y,secondary:!!x,dense:b},E=Kz(C),T={slots:h,slotProps:{primary:u,secondary:f,...p}},[I,D]=kt("root",{className:Ue(E.root,i),elementType:Gz,externalForwardedProps:{...T,...m},ownerState:C,ref:n}),[_,O]=kt("primary",{className:E.primary,elementType:Dt,externalForwardedProps:T,ownerState:C}),[B,L]=kt("secondary",{className:E.secondary,elementType:Dt,externalForwardedProps:T,ownerState:C});return y!=null&&y.type!==Dt&&!s&&(y=c.jsx(_,{variant:b?"body2":"body1",component:O?.variant?void 0:"span",...O,children:y})),x!=null&&x.type!==Dt&&!s&&(x=c.jsx(B,{variant:"body2",color:"textSecondary",...L,children:x})),c.jsxs(I,{...D,children:[y,x]})}),V1=qe("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);function Qz(e){return Ge("MuiMenuItem",e)}const xa=qe("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Xz=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},Zz=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"]},Qz,s);return{...s,...l}},Jz=pe(bi,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:Xz})(pt(({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"}},[`&.${xa.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${xa.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${xa.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)}},[`&.${xa.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${xa.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${V1.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${V1.inset}`]:{marginLeft:52},[`& .${as.root}`]:{marginTop:0,marginBottom:0},[`& .${as.inset}`]:{paddingLeft:36},[`& .${U1.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,[`& .${U1.root} svg`]:{fontSize:"1.25rem"}}}]}))),un=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(go),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=Zz(r),E=Et(y,n);let T;return r.disabled||(T=f!==void 0?f:-1),c.jsx(go.Provider,{value:b,children:c.jsx(Jz,{ref:E,role:d,tabIndex:T,component:i,focusVisibleClassName:Ue(C.focusVisible,u),className:Ue(C.root,h),...p,ownerState:x,classes:C})})});function eU({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(un,{"aria-label":`Delete materialization ${e?.id??""}`.trim(),onClick:d=>{d.stopPropagation(),l()},sx:{color:"error.main"},children:[c.jsx(Sh,{sx:{color:"inherit"},children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(kh,{children:"Delete"})]}),c.jsxs(so,{onClose:u,open:o,"aria-labelledby":"delete-materialization-title",children:[c.jsx(To,{sx:{m:0,p:2},id:"delete-materialization-title",children:"Delete Materialization"}),c.jsx(Ar,{"aria-label":"close",onClick:u,sx:d=>({position:"absolute",right:8,top:8,color:d.palette.grey[500]}),children:c.jsx(_r,{})}),c.jsxs(io,{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(Uz,{control:c.jsx(Th,{checked:s,onChange:d=>a(d.target.checked)}),label:"Also drop the materialized table(s) this run produced"})]}),c.jsx(oo,{children:c.jsx(tn,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(s),color:"error",children:"Delete"})})]})]})}function lC({materializations:e,mutable:t,isMutating:n,showPackage:r=!1,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a}){return e.length===0?c.jsx(k.Typography,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:"No materializations yet."}):c.jsxs(k.Table,{size:"small",children:[c.jsx(k.TableHead,{children:c.jsxs(k.TableRow,{children:[r&&c.jsx(k.TableCell,{children:"Package"}),c.jsx(k.TableCell,{children:"Status"}),c.jsx(k.TableCell,{children:"Trigger"}),c.jsx(k.TableCell,{children:"Started"}),c.jsx(k.TableCell,{children:"Duration"}),c.jsx(k.TableCell,{children:"Sources"}),c.jsx(k.TableCell,{align:"right",children:"Actions"})]})}),c.jsx(k.TableBody,{children:e.map(l=>c.jsx(tU,{materialization:l,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:i,onDelete:s,onViewDetails:a},l.id))})]})}function tU({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=oC(e),p=h.sourcesBuilt!==void 0||h.sourcesReused!==void 0?`${h.sourcesBuilt??0} built, ${h.sourcesReused??0} reused`:"-",m=fl(e.status),b=bz(e.status),y=e.error??void 0,x=t&&(m||b);return c.jsxs(k.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(k.TableCell,{onClick:C=>C.stopPropagation(),children:o?c.jsx(k.Link,{component:"button",underline:"hover",onClick:()=>o(e.packageName??""),sx:{fontWeight:500},children:e.packageName}):e.packageName}),c.jsx(k.TableCell,{children:c.jsxs(k.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[c.jsx(k.Chip,{size:"small",label:nC(e.status),color:rC(e.status),variant:m?"filled":"outlined"}),y&&c.jsx(k.Tooltip,{title:y,children:c.jsx(v2,{fontSize:"small",color:"error"})})]})}),c.jsx(k.TableCell,{children:c.jsx(sC,{meta:h})}),c.jsx(k.TableCell,{children:xz(e.startedAt??e.createdAt)}),c.jsx(k.TableCell,{children:iC(e.startedAt,e.completedAt)}),c.jsx(k.TableCell,{children:p}),c.jsx(k.TableCell,{align:"right",onClick:C=>C.stopPropagation(),children:x&&c.jsxs(c.Fragment,{children:[c.jsx(k.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(k.Menu,{anchorEl:l,open:d,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t&&m&&c.jsxs(k.MenuItem,{"aria-label":`Stop materialization ${e.id??""}`.trim(),disabled:n,onClick:()=>{f(),i(e)},children:[c.jsx(k.ListItemIcon,{children:c.jsx(Ez,{fontSize:"small"})}),c.jsx(k.ListItemText,{children:"Stop"})]}),t&&b&&c.jsx(eU,{materialization:e,isMutating:n,onCloseDialog:f,onDelete:C=>s(e,C)})]})]})})]})}var ei={},Xn={},va={},ti={},Gd={},W1;function nU(){return W1||(W1=1,Object.defineProperty(Gd,"__esModule",{value:!0})),Gd}var Ca={},Ea={},q1;function Ii(){if(q1)return Ea;q1=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.CronField=void 0;let e=class uC{#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(uC.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 Ea.CronField=e,Ea}var Y1;function rU(){if(Y1)return Ca;Y1=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.CronDayOfMonth=void 0;const e=Ii(),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 Ca.CronDayOfMonth=o,Ca}var Ta={},K1;function oU(){if(K1)return Ta;K1=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.CronDayOfWeek=void 0;const e=Ii(),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 Ta.CronDayOfWeek=o,Ta}var Sa={},G1;function iU(){if(G1)return Sa;G1=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.CronHour=void 0;const e=Ii(),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 Sa.CronHour=o,Sa}var ka={},Q1;function sU(){if(Q1)return ka;Q1=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.CronMinute=void 0;const e=Ii(),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 ka.CronMinute=o,ka}var wa={},Qd={},Un={},X1;function aU(){if(X1)return Un;X1=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},E={hour:l,minute:l,second:l,timeZoneName:d},T={hour:l,minute:l,hourCycle:"h23"},I={hour:l,minute:l,second:l,hourCycle:"h23"},D={hour:l,minute:l,second:l,hourCycle:"h23",timeZoneName:u},_={hour:l,minute:l,second:l,hourCycle:"h23",timeZoneName:d},O={year:l,month:l,day:l,hour:l,minute:l},B={year:l,month:l,day:l,hour:l,minute:l,second:l},L={year:l,month:u,day:l,hour:l,minute:l},j={year:l,month:u,day:l,hour:l,minute:l,second:l},S={year:l,month:u,day:l,weekday:u,hour:l,minute:l},$={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},F={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},R={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},H={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d};class V{get type(){throw new a}get name(){throw new a}get ianaName(){return this.name}get isUniversal(){throw new a}offsetName(g,w){throw new a}formatOffset(g,w){throw new a}offset(g){throw new a}equals(g){throw new a}get isValid(){throw new a}}let Y=null;class q extends V{static get instance(){return Y===null&&(Y=new q),Y}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(g,{format:w,locale:N}){return Bh(g,w,N)}formatOffset(g,w){return Vs(this.offset(g),w)}offset(g){return-new Date(g).getTimezoneOffset()}equals(g){return g.type==="system"}get isValid(){return!0}}const P=new Map;function J(A){let g=P.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"}),P.set(A,g)),g}const re={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function z(A,g){const w=A.format(g).replace(/\u200E/g,""),N=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(w),[,U,ee,ce,fe,ge,Be,nt]=N;return[ce,U,ee,fe,ge,Be,nt]}function ye(A,g){const w=A.formatToParts(g),N=[];for(let U=0;U<w.length;U++){const{type:ee,value:ce}=w[U],fe=re[ee];ee==="era"?N[fe]=ce:je(fe)||(N[fe]=parseInt(ce,10))}return N}const se=new Map;class G extends V{static create(g){let w=se.get(g);return w===void 0&&se.set(g,w=new G(g)),w}static resetCache(){se.clear(),P.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=G.isValidZone(g)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(g,{format:w,locale:N}){return Bh(g,w,N,this.name)}formatOffset(g,w){return Vs(this.offset(g),w)}offset(g){if(!this.valid)return NaN;const w=new Date(g);if(isNaN(w))return NaN;const N=J(this.name);let[U,ee,ce,fe,ge,Be,nt]=N.formatToParts?ye(N,w):z(N,w);fe==="BC"&&(U=-Math.abs(U)+1);const Vt=Bl({year:U,month:ee,day:ce,hour:ge===24?0:ge,minute:Be,second:nt,millisecond:0});let it=+w;const pn=it%1e3;return it-=pn>=0?pn:1e3+pn,(Vt-it)/(60*1e3)}equals(g){return g.type==="iana"&&g.name===this.name}get isValid(){return this.valid}}let le={};function oe(A,g={}){const w=JSON.stringify([A,g]);let N=le[w];return N||(N=new Intl.ListFormat(A,g),le[w]=N),N}const ue=new Map;function ie(A,g={}){const w=JSON.stringify([A,g]);let N=ue.get(w);return N===void 0&&(N=new Intl.DateTimeFormat(A,g),ue.set(w,N)),N}const Z=new Map;function de(A,g={}){const w=JSON.stringify([A,g]);let N=Z.get(w);return N===void 0&&(N=new Intl.NumberFormat(A,g),Z.set(w,N)),N}const ae=new Map;function ne(A,g={}){const{base:w,...N}=g,U=JSON.stringify([A,N]);let ee=ae.get(U);return ee===void 0&&(ee=new Intl.RelativeTimeFormat(A,g),ae.set(U,ee)),ee}let Ce=null;function ve(){return Ce||(Ce=new Intl.DateTimeFormat().resolvedOptions().locale,Ce)}const Se=new Map;function he(A){let g=Se.get(A);return g===void 0&&(g=new Intl.DateTimeFormat(A).resolvedOptions(),Se.set(A,g)),g}const $e=new Map;function Pe(A){let g=$e.get(A);if(!g){const w=new Intl.Locale(A);g="getWeekInfo"in w?w.getWeekInfo():w.weekInfo,"minimalDays"in g||(g={...Ze,...g}),$e.set(A,g)}return g}function Je(A){const g=A.indexOf("-x-");g!==-1&&(A=A.substring(0,g));const w=A.indexOf("-u-");if(w===-1)return[A];{let N,U;try{N=ie(A).resolvedOptions(),U=A}catch{const ge=A.substring(0,w);N=ie(ge).resolvedOptions(),U=ge}const{numberingSystem:ee,calendar:ce}=N;return[U,ee,ce]}}function Me(A,g,w){return(w||g)&&(A.includes("-u-")||(A+="-u"),w&&(A+=`-ca-${w}`),g&&(A+=`-nu-${g}`)),A}function Nt(A){const g=[];for(let w=1;w<=12;w++){const N=at.utc(2009,w,1);g.push(A(N))}return g}function ct(A){const g=[];for(let w=1;w<=7;w++){const N=at.utc(2016,11,13+w);g.push(A(N))}return g}function tt(A,g,w,N){const U=A.listingMode();return U==="error"?null:U==="en"?w(g):N(g)}function xe(A){return A.numberingSystem&&A.numberingSystem!=="latn"?!1:A.numberingSystem==="latn"||!A.locale||A.locale.startsWith("en")||he(A.locale).numberingSystem==="latn"}class Oe{constructor(g,w,N){this.padTo=N.padTo||0,this.floor=N.floor||!1;const{padTo:U,floor:ee,...ce}=N;if(!w||Object.keys(ce).length>0){const fe={useGrouping:!1,...N};N.padTo>0&&(fe.minimumIntegerDigits=N.padTo),this.inf=de(g,fe)}}format(g){if(this.inf){const w=this.floor?Math.floor(g):g;return this.inf.format(w)}else{const w=this.floor?Math.floor(g):Gc(g,3);return fn(w,this.padTo)}}}class We{constructor(g,w,N){this.opts=N,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),fe=ce>=0?`Etc/GMT+${ce}`:`Etc/GMT${ce}`;g.offset!==0&&G.create(fe).valid?(U=fe,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(w,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(w=>{if(w.type==="timeZoneName"){const N=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...w,value:N}}else return w}):g}resolvedOptions(){return this.dtf.resolvedOptions()}}class Xe{constructor(g,w,N){this.opts={style:"long",...N},!w&&$s()&&(this.rtf=ne(g,N))}format(g,w){return this.rtf?this.rtf.format(g,w):fE(w,g,this.opts.numeric,this.opts.style!=="long")}formatToParts(g,w){return this.rtf?this.rtf.formatToParts(g,w):[]}}const Ze={firstDay:1,minimalDays:4,weekend:[6,7]};class Fe{static fromOpts(g){return Fe.create(g.locale,g.numberingSystem,g.outputCalendar,g.weekSettings,g.defaultToEN)}static create(g,w,N,U,ee=!1){const ce=g||Pt.defaultLocale,fe=ce||(ee?"en-US":ve()),ge=w||Pt.defaultNumberingSystem,Be=N||Pt.defaultOutputCalendar,nt=ao(U)||Pt.defaultWeekSettings;return new Fe(fe,ge,Be,nt,ce)}static resetCache(){Ce=null,ue.clear(),Z.clear(),ae.clear(),Se.clear(),$e.clear()}static fromObject({locale:g,numberingSystem:w,outputCalendar:N,weekSettings:U}={}){return Fe.create(g,w,N,U)}constructor(g,w,N,U,ee){const[ce,fe,ge]=Je(g);this.locale=ce,this.numberingSystem=w||fe||null,this.outputCalendar=N||ge||null,this.weekSettings=U,this.intl=Me(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(),w=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return g&&w?"en":"intl"}clone(g){return!g||Object.getOwnPropertyNames(g).length===0?this:Fe.create(g.locale||this.specifiedLocale,g.numberingSystem||this.numberingSystem,g.outputCalendar||this.outputCalendar,ao(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,w=!1){return tt(this,g,Hh,()=>{const N=this.intl==="ja"||this.intl.startsWith("ja-");w&=!N;const U=w?{month:g,day:"numeric"}:{month:g},ee=w?"format":"standalone";if(!this.monthsCache[ee][g]){const ce=N?fe=>this.dtFormatter(fe,U).format():fe=>this.extract(fe,U,"month");this.monthsCache[ee][g]=Nt(ce)}return this.monthsCache[ee][g]})}weekdays(g,w=!1){return tt(this,g,Vh,()=>{const N=w?{weekday:g,year:"numeric",month:"long",day:"numeric"}:{weekday:g},U=w?"format":"standalone";return this.weekdaysCache[U][g]||(this.weekdaysCache[U][g]=ct(ee=>this.extract(ee,N,"weekday"))),this.weekdaysCache[U][g]})}meridiems(){return tt(this,void 0,()=>Wh,()=>{if(!this.meridiemCache){const g={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[at.utc(2016,11,13,9),at.utc(2016,11,13,19)].map(w=>this.extract(w,g,"dayperiod"))}return this.meridiemCache})}eras(g){return tt(this,g,qh,()=>{const w={era:g};return this.eraCache[g]||(this.eraCache[g]=[at.utc(-40,1,1),at.utc(2017,1,1)].map(N=>this.extract(N,w,"era"))),this.eraCache[g]})}extract(g,w,N){const U=this.dtFormatter(g,w),ee=U.formatToParts(),ce=ee.find(fe=>fe.type.toLowerCase()===N);return ce?ce.value:null}numberFormatter(g={}){return new Oe(this.intl,g.forceSimple||this.fastNumbers,g)}dtFormatter(g,w={}){return new We(g,this.intl,w)}relFormatter(g={}){return new Xe(this.intl,this.isEnglish(),g)}listFormatter(g={}){return oe(this.intl,g)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||he(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Hs()?Pe(this.locale):Ze}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 dt=null;class lt extends V{static get utcInstance(){return dt===null&&(dt=new lt(0)),dt}static instance(g){return g===0?lt.utcInstance:new lt(g)}static parseSpecifier(g){if(g){const w=g.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(w)return new lt(jl(w[1],w[2]))}return null}constructor(g){super(),this.fixed=g}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Vs(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Vs(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(g,w){return Vs(this.fixed,w)}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 V{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 V)return A;if(Qn(A)){const w=A.toLowerCase();return w==="default"?g:w==="local"||w==="system"?q.instance:w==="utc"||w==="gmt"?lt.utcInstance:lt.parseSpecifier(w)||G.create(A)}else return Ut(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"},Re={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 w=0;w<A.length;w++){const N=A.charCodeAt(w);if(A[w].search(Ae.hanidec)!==-1)g+=Qe.indexOf(A[w]);else for(const U in Re){const[ee,ce]=Re[U];N>=ee&&N<=ce&&(g+=N-ee)}}return parseInt(g,10)}else return g}const Lt=new Map;function Qt(){Lt.clear()}function yt({numberingSystem:A},g=""){const w=A||"latn";let N=Lt.get(w);N===void 0&&(N=new Map,Lt.set(w,N));let U=N.get(g);return U===void 0&&(U=new RegExp(`${Ae[w]}${g}`),N.set(g,U)),U}let sn=()=>Date.now(),Rn="system",$t=null,bn=null,lr=null,Nn=60,$r,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 $t}static set defaultLocale(g){$t=g}static get defaultNumberingSystem(){return bn}static set defaultNumberingSystem(g){bn=g}static get defaultOutputCalendar(){return lr}static set defaultOutputCalendar(g){lr=g}static get defaultWeekSettings(){return Hn}static set defaultWeekSettings(g){Hn=ao(g)}static get twoDigitCutoffYear(){return Nn}static set twoDigitCutoffYear(g){Nn=g%100}static get throwOnInvalid(){return $r}static set throwOnInvalid(g){$r=g}static resetCaches(){Fe.resetCache(),G.resetCache(),at.resetCache(),Qt()}}class Cn{constructor(g,w){this.reason=g,this.explanation=w}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const So=[0,31,59,90,120,151,181,212,243,273,304,334],Oi=[0,31,60,91,121,152,182,213,244,274,305,335];function wn(A,g){return new Cn("unit out of range",`you specified ${g} (of type ${typeof g}) as a ${A}, which is invalid`)}function zo(A,g,w){const N=new Date(Date.UTC(A,g-1,w));A<100&&A>=0&&N.setUTCFullYear(N.getUTCFullYear()-1900);const U=N.getUTCDay();return U===0?7:U}function Mi(A,g,w){return w+(zs(A)?Oi:So)[g-1]}function ko(A,g){const w=zs(A)?Oi:So,N=w.findIndex(ee=>ee<g),U=g-w[N];return{month:N+1,day:U}}function nn(A,g){return(A-g+7)%7+1}function rn(A,g=4,w=1){const{year:N,month:U,day:ee}=A,ce=Mi(N,U,ee),fe=nn(zo(N,U,ee),w);let ge=Math.floor((ce-fe+14-g)/7),Be;return ge<1?(Be=N-1,ge=Us(Be,g,w)):ge>Us(N,g,w)?(Be=N+1,ge=1):Be=N,{weekYear:Be,weekNumber:ge,weekday:fe,...Hl(A)}}function Or(A,g=4,w=1){const{weekYear:N,weekNumber:U,weekday:ee}=A,ce=nn(zo(N,1,g),w),fe=Ri(N);let ge=U*7+ee-ce-7+g,Be;ge<1?(Be=N-1,ge+=Ri(Be)):ge>fe?(Be=N+1,ge-=Ri(N)):Be=N;const{month:nt,day:ht}=ko(Be,ge);return{year:Be,month:nt,day:ht,...Hl(A)}}function Uo(A){const{year:g,month:w,day:N}=A,U=Mi(g,w,N);return{year:g,ordinal:U,...Hl(A)}}function wo(A){const{year:g,ordinal:w}=A,{month:N,day:U}=ko(g,w);return{year:g,month:N,day:U,...Hl(A)}}function Vo(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 De(A,g=4,w=1){const N=qt(A.weekYear),U=ur(A.weekNumber,1,Us(A.weekYear,g,w)),ee=ur(A.weekday,1,7);return N?U?ee?!1:wn("weekday",A.weekday):wn("week",A.weekNumber):wn("weekYear",A.weekYear)}function ke(A){const g=qt(A.year),w=ur(A.ordinal,1,Ri(A.year));return g?w?!1:wn("ordinal",A.ordinal):wn("year",A.year)}function Ye(A){const g=qt(A.year),w=ur(A.month,1,12),N=ur(A.day,1,_l(A.year,A.month));return g?w?N?!1:wn("day",A.day):wn("month",A.month):wn("year",A.year)}function ot(A){const{hour:g,minute:w,second:N,millisecond:U}=A,ee=ur(g,0,23)||g===24&&w===0&&N===0&&U===0,ce=ur(w,0,59),fe=ur(N,0,59),ge=ur(U,0,999);return ee?ce?fe?ge?!1:wn("millisecond",U):wn("second",N):wn("minute",w):wn("hour",g)}function je(A){return typeof A>"u"}function Ut(A){return typeof A=="number"}function qt(A){return typeof A=="number"&&A%1===0}function Qn(A){return typeof A=="string"}function Pi(A){return Object.prototype.toString.call(A)==="[object Date]"}function $s(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Hs(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ll(A){return Array.isArray(A)?A:[A]}function wt(A,g,w){if(A.length!==0)return A.reduce((N,U)=>{const ee=[g(U),U];return N&&w(N[0],ee[0])===N[0]?N:ee},null)[1]}function Hr(A,g){return g.reduce((w,N)=>(w[N]=A[N],w),{})}function Fn(A,g){return Object.prototype.hasOwnProperty.call(A,g)}function ao(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,w){return qt(A)&&A>=g&&A<=w}function tE(A,g){return A-g*Math.floor(A/g)}function fn(A,g=2){const w=A<0;let N;return w?N="-"+(""+-A).padStart(g,"0"):N=(""+A).padStart(g,"0"),N}function Do(A){if(!(je(A)||A===null||A===""))return parseInt(A,10)}function Wo(A){if(!(je(A)||A===null||A===""))return parseFloat(A)}function Kc(A){if(!(je(A)||A===null||A==="")){const g=parseFloat("0."+A)*1e3;return Math.floor(g)}}function Gc(A,g,w="round"){const N=10**g;switch(w){case"expand":return A>0?Math.ceil(A*N)/N:Math.floor(A*N)/N;case"trunc":return Math.trunc(A*N)/N;case"round":return Math.round(A*N)/N;case"floor":return Math.floor(A*N)/N;case"ceil":return Math.ceil(A*N)/N;default:throw new RangeError(`Value rounding ${w} is out of range`)}}function zs(A){return A%4===0&&(A%100!==0||A%400===0)}function Ri(A){return zs(A)?366:365}function _l(A,g){const w=tE(g-1,12)+1,N=A+(g-w)/12;return w===2?zs(N)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][w-1]}function Bl(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 _h(A,g,w){return-nn(zo(A,1,g),w)+g-1}function Us(A,g=4,w=1){const N=_h(A,g,w),U=_h(A+1,g,w);return(Ri(A)-N+U)/7}function Qc(A){return A>99?A:A>Pt.twoDigitCutoffYear?1900+A:2e3+A}function Bh(A,g,w,N=null){const U=new Date(A),ee={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};N&&(ee.timeZone=N);const ce={timeZoneName:g,...ee},fe=new Intl.DateTimeFormat(w,ce).formatToParts(U).find(ge=>ge.type.toLowerCase()==="timezonename");return fe?fe.value:null}function jl(A,g){let w=parseInt(A,10);Number.isNaN(w)&&(w=0);const N=parseInt(g,10)||0,U=w<0||Object.is(w,-0)?-N:N;return w*60+U}function jh(A){const g=Number(A);if(typeof A=="boolean"||A===""||!Number.isFinite(g))throw new s(`Invalid unit value ${A}`);return g}function $l(A,g){const w={};for(const N in A)if(Fn(A,N)){const U=A[N];if(U==null)continue;w[g(N)]=jh(U)}return w}function Vs(A,g){const w=Math.trunc(Math.abs(A/60)),N=Math.trunc(Math.abs(A%60)),U=A>=0?"+":"-";switch(g){case"short":return`${U}${fn(w,2)}:${fn(N,2)}`;case"narrow":return`${U}${w}${N>0?`:${N}`:""}`;case"techie":return`${U}${fn(w,2)}${fn(N,2)}`;default:throw new RangeError(`Value format ${g} is out of range for property format`)}}function Hl(A){return Hr(A,["hour","minute","second","millisecond"])}const nE=["January","February","March","April","May","June","July","August","September","October","November","December"],$h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rE=["J","F","M","A","M","J","J","A","S","O","N","D"];function Hh(A){switch(A){case"narrow":return[...rE];case"short":return[...$h];case"long":return[...nE];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 zh=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Uh=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],oE=["M","T","W","T","F","S","S"];function Vh(A){switch(A){case"narrow":return[...oE];case"short":return[...Uh];case"long":return[...zh];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Wh=["AM","PM"],iE=["Before Christ","Anno Domini"],sE=["BC","AD"],aE=["B","A"];function qh(A){switch(A){case"narrow":return[...aE];case"short":return[...sE];case"long":return[...iE];default:return null}}function lE(A){return Wh[A.hour<12?0:1]}function uE(A,g){return Vh(g)[A.weekday-1]}function cE(A,g){return Hh(g)[A.month-1]}function dE(A,g){return qh(g)[A.year<0?0:1]}function fE(A,g,w="always",N=!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(w==="auto"&&ee){const ht=A==="days";switch(g){case 1:return ht?"tomorrow":`next ${U[A][0]}`;case-1:return ht?"yesterday":`last ${U[A][0]}`;case 0:return ht?"today":`this ${U[A][0]}`}}const ce=Object.is(g,-0)||g<0,fe=Math.abs(g),ge=fe===1,Be=U[A],nt=N?ge?Be[1]:Be[2]||Be[1]:ge?U[A][0]:A;return ce?`${fe} ${nt} ago`:`in ${fe} ${nt}`}function Yh(A,g){let w="";for(const N of A)N.literal?w+=N.val:w+=g(N.val);return w}const pE={D:f,DD:h,DDD:m,DDDD:b,t:y,tt:x,ttt:C,tttt:E,T,TT:I,TTT:D,TTTT:_,f:O,ff:L,fff:$,ffff:R,F:B,FF:j,FFF:F,FFFF:H};class Dn{static create(g,w={}){return new Dn(g,w)}static parseFormat(g){let w=null,N="",U=!1;const ee=[];for(let ce=0;ce<g.length;ce++){const fe=g.charAt(ce);fe==="'"?((N.length>0||U)&&ee.push({literal:U||/^\s+$/.test(N),val:N===""?"'":N}),w=null,N="",U=!U):U||fe===w?N+=fe:(N.length>0&&ee.push({literal:/^\s+$/.test(N),val:N}),N=fe,w=fe)}return N.length>0&&ee.push({literal:U||/^\s+$/.test(N),val:N}),ee}static macroTokenToFormatOpts(g){return pE[g]}constructor(g,w){this.opts=w,this.loc=g,this.systemLoc=null}formatWithSystemDefault(g,w){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(g,{...this.opts,...w}).format()}dtFormatter(g,w={}){return this.loc.dtFormatter(g,{...this.opts,...w})}formatDateTime(g,w){return this.dtFormatter(g,w).format()}formatDateTimeParts(g,w){return this.dtFormatter(g,w).formatToParts()}formatInterval(g,w){return this.dtFormatter(g.start,w).dtf.formatRange(g.start.toJSDate(),g.end.toJSDate())}resolvedOptions(g,w){return this.dtFormatter(g,w).resolvedOptions()}num(g,w=0,N=void 0){if(this.opts.forceSimple)return fn(g,w);const U={...this.opts};return w>0&&(U.padTo=w),N&&(U.signDisplay=N),this.loc.numberFormatter(U).format(g)}formatDateTimeFromString(g,w){const N=this.loc.listingMode()==="en",U=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",ee=(it,pn)=>this.loc.extract(g,it,pn),ce=it=>g.isOffsetFixed&&g.offset===0&&it.allowZ?"Z":g.isValid?g.zone.formatOffset(g.ts,it.format):"",fe=()=>N?lE(g):ee({hour:"numeric",hourCycle:"h12"},"dayperiod"),ge=(it,pn)=>N?cE(g,it):ee(pn?{month:it}:{month:it,day:"numeric"},"month"),Be=(it,pn)=>N?uE(g,it):ee(pn?{weekday:it}:{weekday:it,month:"long",day:"numeric"},"weekday"),nt=it=>{const pn=Dn.macroTokenToFormatOpts(it);return pn?this.formatWithSystemDefault(g,pn):it},ht=it=>N?dE(g,it):ee({era:it},"era"),Vt=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 fe();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 ht("short");case"GG":return ht("long");case"GGGGG":return ht("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 nt(it)}};return Yh(Dn.parseFormat(w),Vt)}formatDurationFromString(g,w){const N=this.opts.signMode==="negativeLargestOnly"?-1:1,U=nt=>{switch(nt[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=(nt,ht)=>Vt=>{const it=U(Vt);if(it){const pn=ht.isNegativeDuration&&it!==ht.largestUnit?N:1;let Pr;return this.opts.signMode==="negativeLargestOnly"&&it!==ht.largestUnit?Pr="never":this.opts.signMode==="all"?Pr="always":Pr="auto",this.num(nt.get(it)*pn,Vt.length,Pr)}else return Vt},ce=Dn.parseFormat(w),fe=ce.reduce((nt,{literal:ht,val:Vt})=>ht?nt:nt.concat(Vt),[]),ge=g.shiftTo(...fe.map(U).filter(nt=>nt)),Be={isNegativeDuration:ge<0,largestUnit:Object.keys(ge.values)[0]};return Yh(ce,ee(ge,Be))}}const Kh=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ni(...A){const g=A.reduce((w,N)=>w+N.source,"");return RegExp(`^${g}$`)}function Fi(...A){return g=>A.reduce(([w,N,U],ee)=>{const[ce,fe,ge]=ee(g,U);return[{...w,...ce},fe||N,ge]},[{},null,1]).slice(0,2)}function Li(A,...g){if(A==null)return[null,null];for(const[w,N]of g){const U=w.exec(A);if(U)return N(U)}return[null,null]}function Gh(...A){return(g,w)=>{const N={};let U;for(U=0;U<A.length;U++)N[A[U]]=Do(g[w+U]);return[N,null,w+U]}}const Qh=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,hE=`(?:${Qh.source}?(?:\\[(${Kh.source})\\])?)?`,Xc=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Xh=RegExp(`${Xc.source}${hE}`),Zc=RegExp(`(?:[Tt]${Xh.source})?`),mE=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,gE=/(\d{4})-?W(\d\d)(?:-?(\d))?/,bE=/(\d{4})-?(\d{3})/,yE=Gh("weekYear","weekNumber","weekDay"),xE=Gh("year","ordinal"),vE=/(\d{4})-(\d\d)-(\d\d)/,Zh=RegExp(`${Xc.source} ?(?:${Qh.source}|(${Kh.source}))?`),CE=RegExp(`(?: ${Zh.source})?`);function _i(A,g,w){const N=A[g];return je(N)?w:Do(N)}function EE(A,g){return[{year:_i(A,g),month:_i(A,g+1,1),day:_i(A,g+2,1)},null,g+3]}function Bi(A,g){return[{hours:_i(A,g,0),minutes:_i(A,g+1,0),seconds:_i(A,g+2,0),milliseconds:Kc(A[g+3])},null,g+4]}function Ws(A,g){const w=!A[g]&&!A[g+1],N=jl(A[g+1],A[g+2]),U=w?null:lt.instance(N);return[{},U,g+3]}function qs(A,g){const w=A[g]?G.create(A[g]):null;return[{},w,g+1]}const TE=RegExp(`^T?${Xc.source}$`),SE=/^-?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 kE(A){const[g,w,N,U,ee,ce,fe,ge,Be]=A,nt=g[0]==="-",ht=ge&&ge[0]==="-",Vt=(it,pn=!1)=>it!==void 0&&(pn||it&&nt)?-it:it;return[{years:Vt(Wo(w)),months:Vt(Wo(N)),weeks:Vt(Wo(U)),days:Vt(Wo(ee)),hours:Vt(Wo(ce)),minutes:Vt(Wo(fe)),seconds:Vt(Wo(ge),ge==="-0"),milliseconds:Vt(Kc(Be),ht)}]}const wE={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Jc(A,g,w,N,U,ee,ce){const fe={year:g.length===2?Qc(Do(g)):Do(g),month:$h.indexOf(w)+1,day:Do(N),hour:Do(U),minute:Do(ee)};return ce&&(fe.second=Do(ce)),A&&(fe.weekday=A.length>3?zh.indexOf(A)+1:Uh.indexOf(A)+1),fe}const DE=/^(?:(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 IE(A){const[,g,w,N,U,ee,ce,fe,ge,Be,nt,ht]=A,Vt=Jc(g,U,N,w,ee,ce,fe);let it;return ge?it=wE[ge]:Be?it=0:it=jl(nt,ht),[Vt,new lt(it)]}function AE(A){return A.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const OE=/^(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$/,ME=/^(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$/,PE=/^(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 Jh(A){const[,g,w,N,U,ee,ce,fe]=A;return[Jc(g,U,N,w,ee,ce,fe),lt.utcInstance]}function RE(A){const[,g,w,N,U,ee,ce,fe]=A;return[Jc(g,fe,w,N,U,ee,ce),lt.utcInstance]}const NE=Ni(mE,Zc),FE=Ni(gE,Zc),LE=Ni(bE,Zc),_E=Ni(Xh),em=Fi(EE,Bi,Ws,qs),BE=Fi(yE,Bi,Ws,qs),jE=Fi(xE,Bi,Ws,qs),$E=Fi(Bi,Ws,qs);function HE(A){return Li(A,[NE,em],[FE,BE],[LE,jE],[_E,$E])}function zE(A){return Li(AE(A),[DE,IE])}function UE(A){return Li(A,[OE,Jh],[ME,Jh],[PE,RE])}function VE(A){return Li(A,[SE,kE])}const WE=Fi(Bi);function qE(A){return Li(A,[TE,WE])}const YE=Ni(vE,CE),KE=Ni(Zh),GE=Fi(Bi,Ws,qs);function QE(A){return Li(A,[YE,em],[KE,GE])}const tm="Invalid Duration",nm={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}},XE={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},...nm},cr=146097/400,ji=146097/4800,ZE={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:ji/7,days:ji,hours:ji*24,minutes:ji*24*60,seconds:ji*24*60*60,milliseconds:ji*24*60*60*1e3},...nm},qo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],JE=qo.slice(0).reverse();function lo(A,g,w=!1){const N={values:w?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(N)}function rm(A,g){var w;let N=(w=g.milliseconds)!=null?w:0;for(const U of JE.slice(1))g[U]&&(N+=g[U]*A[U].milliseconds);return N}function om(A,g){const w=rm(A,g)<0?-1:1;qo.reduceRight((N,U)=>{if(je(g[U]))return N;if(N){const ee=g[N]*w,ce=A[U][N],fe=Math.floor(ee/ce);g[U]+=fe*w,g[N]-=fe*ce*w}return U},null),qo.reduce((N,U)=>{if(je(g[U]))return N;if(N){const ee=g[N]%1;g[N]-=ee,g[U]+=ee*A[N][U]}return U},null)}function im(A){const g={};for(const[w,N]of Object.entries(A))N!==0&&(g[w]=N);return g}class It{constructor(g){const w=g.conversionAccuracy==="longterm"||!1;let N=w?ZE:XE;g.matrix&&(N=g.matrix),this.values=g.values,this.loc=g.loc||Fe.create(),this.conversionAccuracy=w?"longterm":"casual",this.invalid=g.invalid||null,this.matrix=N,this.isLuxonDuration=!0}static fromMillis(g,w){return It.fromObject({milliseconds:g},w)}static fromObject(g,w={}){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:$l(g,It.normalizeUnit),loc:Fe.fromObject(w),conversionAccuracy:w.conversionAccuracy,matrix:w.matrix})}static fromDurationLike(g){if(Ut(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,w){const[N]=VE(g);return N?It.fromObject(N,w):It.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static fromISOTime(g,w){const[N]=qE(g);return N?It.fromObject(N,w):It.invalid("unparsable",`the input "${g}" can't be parsed as ISO 8601`)}static invalid(g,w=null){if(!g)throw new s("need to specify a reason the Duration is invalid");const N=g instanceof Cn?g:new Cn(g,w);if(Pt.throwOnInvalid)throw new r(N);return new It({invalid:N})}static normalizeUnit(g){const w={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(!w)throw new i(g);return w}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,w={}){const N={...w,floor:w.round!==!1&&w.floor!==!1};return this.isValid?Dn.create(this.loc,N).formatDurationFromString(this,g):tm}toHuman(g={}){if(!this.isValid)return tm;const w=g.showZeros!==!1,N=qo.map(U=>{const ee=this.values[U];return je(ee)||ee===0&&!w?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(N)}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+=Gc(this.seconds+this.milliseconds/1e3,3)+"S"),g==="P"&&(g+="T0S"),g}toISOTime(g={}){if(!this.isValid)return null;const w=this.toMillis();return w<0||w>=864e5?null:(g={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...g,includeOffset:!1},at.fromMillis(w,{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?rm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(g){if(!this.isValid)return this;const w=It.fromDurationLike(g),N={};for(const U of qo)(Fn(w.values,U)||Fn(this.values,U))&&(N[U]=w.get(U)+this.get(U));return lo(this,{values:N},!0)}minus(g){if(!this.isValid)return this;const w=It.fromDurationLike(g);return this.plus(w.negate())}mapUnits(g){if(!this.isValid)return this;const w={};for(const N of Object.keys(this.values))w[N]=jh(g(this.values[N],N));return lo(this,{values:w},!0)}get(g){return this[It.normalizeUnit(g)]}set(g){if(!this.isValid)return this;const w={...this.values,...$l(g,It.normalizeUnit)};return lo(this,{values:w})}reconfigure({locale:g,numberingSystem:w,conversionAccuracy:N,matrix:U}={}){const ce={loc:this.loc.clone({locale:g,numberingSystem:w}),matrix:U,conversionAccuracy:N};return lo(this,ce)}as(g){return this.isValid?this.shiftTo(g).get(g):NaN}normalize(){if(!this.isValid)return this;const g=this.toObject();return om(this.matrix,g),lo(this,{values:g},!0)}rescale(){if(!this.isValid)return this;const g=im(this.normalize().shiftToAll().toObject());return lo(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 w={},N={},U=this.toObject();let ee;for(const ce of qo)if(g.indexOf(ce)>=0){ee=ce;let fe=0;for(const Be in N)fe+=this.matrix[Be][ce]*N[Be],N[Be]=0;Ut(U[ce])&&(fe+=U[ce]);const ge=Math.trunc(fe);w[ce]=ge,N[ce]=(fe*1e3-ge*1e3)/1e3}else Ut(U[ce])&&(N[ce]=U[ce]);for(const ce in N)N[ce]!==0&&(w[ee]+=ce===ee?N[ce]:N[ce]/this.matrix[ee][ce]);return om(this.matrix,w),lo(this,{values:w},!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 w of Object.keys(this.values))g[w]=this.values[w]===0?0:-this.values[w];return lo(this,{values:g},!0)}removeZeros(){if(!this.isValid)return this;const g=im(this.values);return lo(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 w(N,U){return N===void 0||N===0?U===void 0||U===0:N===U}for(const N of qo)if(!w(this.values[N],g.values[N]))return!1;return!0}}const $i="Invalid Interval";function eT(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,w=null){if(!g)throw new s("need to specify a reason the Interval is invalid");const N=g instanceof Cn?g:new Cn(g,w);if(Pt.throwOnInvalid)throw new n(N);return new on({invalid:N})}static fromDateTimes(g,w){const N=Qs(g),U=Qs(w),ee=eT(N,U);return ee??new on({start:N,end:U})}static after(g,w){const N=It.fromDurationLike(w),U=Qs(g);return on.fromDateTimes(U,U.plus(N))}static before(g,w){const N=It.fromDurationLike(w),U=Qs(g);return on.fromDateTimes(U.minus(N),U)}static fromISO(g,w){const[N,U]=(g||"").split("/",2);if(N&&U){let ee,ce;try{ee=at.fromISO(N,w),ce=ee.isValid}catch{ce=!1}let fe,ge;try{fe=at.fromISO(U,w),ge=fe.isValid}catch{ge=!1}if(ce&&ge)return on.fromDateTimes(ee,fe);if(ce){const Be=It.fromISO(U,w);if(Be.isValid)return on.after(ee,Be)}else if(ge){const Be=It.fromISO(N,w);if(Be.isValid)return on.before(fe,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",w){if(!this.isValid)return NaN;const N=this.start.startOf(g,w);let U;return w!=null&&w.useLocaleWeeks?U=this.end.reconfigure({locale:N.locale}):U=this.end,U=U.startOf(g,w),Math.floor(U.diff(N,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:w}={}){return this.isValid?on.fromDateTimes(g||this.s,w||this.e):this}splitAt(...g){if(!this.isValid)return[];const w=g.map(Qs).filter(ce=>this.contains(ce)).sort((ce,fe)=>ce.toMillis()-fe.toMillis()),N=[];let{s:U}=this,ee=0;for(;U<this.e;){const ce=w[ee]||this.e,fe=+ce>+this.e?this.e:ce;N.push(on.fromDateTimes(U,fe)),U=fe,ee+=1}return N}splitBy(g){const w=It.fromDurationLike(g);if(!this.isValid||!w.isValid||w.as("milliseconds")===0)return[];let{s:N}=this,U=1,ee;const ce=[];for(;N<this.e;){const fe=this.start.plus(w.mapUnits(ge=>ge*U));ee=+fe>+this.e?this.e:fe,ce.push(on.fromDateTimes(N,ee)),N=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 w=this.s>g.s?this.s:g.s,N=this.e<g.e?this.e:g.e;return w>=N?null:on.fromDateTimes(w,N)}union(g){if(!this.isValid)return this;const w=this.s<g.s?this.s:g.s,N=this.e>g.e?this.e:g.e;return on.fromDateTimes(w,N)}static merge(g){const[w,N]=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 N&&w.push(N),w}static xor(g){let w=null,N=0;const U=[],ee=g.map(ge=>[{time:ge.s,type:"s"},{time:ge.e,type:"e"}]),ce=Array.prototype.concat(...ee),fe=ce.sort((ge,Be)=>ge.time-Be.time);for(const ge of fe)N+=ge.type==="s"?1:-1,N===1?w=ge.time:(w&&+w!=+ge.time&&U.push(on.fromDateTimes(w,ge.time)),w=null);return on.merge(U)}difference(...g){return on.xor([this].concat(g)).map(w=>this.intersection(w)).filter(w=>w&&!w.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:$i}[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,w={}){return this.isValid?Dn.create(this.s.loc.clone(w),g).formatInterval(this):$i}toISO(g){return this.isValid?`${this.s.toISO(g)}/${this.e.toISO(g)}`:$i}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:$i}toISOTime(g){return this.isValid?`${this.s.toISOTime(g)}/${this.e.toISOTime(g)}`:$i}toFormat(g,{separator:w=" – "}={}){return this.isValid?`${this.s.toFormat(g)}${w}${this.e.toFormat(g)}`:$i}toDuration(g,w){return this.isValid?this.e.diff(this.s,g,w):It.invalid(this.invalidReason)}mapEndpoints(g){return on.fromDateTimes(g(this.s),g(this.e))}}class Ys{static hasDST(g=Pt.defaultZone){const w=at.now().setZone(g).set({month:12});return!g.isUniversal&&w.offset!==w.set({month:6}).offset}static isValidIANAZone(g){return G.isValidZone(g)}static normalizeZone(g){return be(g,Pt.defaultZone)}static getStartOfWeek({locale:g=null,locObj:w=null}={}){return(w||Fe.create(g)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:g=null,locObj:w=null}={}){return(w||Fe.create(g)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:g=null,locObj:w=null}={}){return(w||Fe.create(g)).getWeekendDays().slice()}static months(g="long",{locale:w=null,numberingSystem:N=null,locObj:U=null,outputCalendar:ee="gregory"}={}){return(U||Fe.create(w,N,ee)).months(g)}static monthsFormat(g="long",{locale:w=null,numberingSystem:N=null,locObj:U=null,outputCalendar:ee="gregory"}={}){return(U||Fe.create(w,N,ee)).months(g,!0)}static weekdays(g="long",{locale:w=null,numberingSystem:N=null,locObj:U=null}={}){return(U||Fe.create(w,N,null)).weekdays(g)}static weekdaysFormat(g="long",{locale:w=null,numberingSystem:N=null,locObj:U=null}={}){return(U||Fe.create(w,N,null)).weekdays(g,!0)}static meridiems({locale:g=null}={}){return Fe.create(g).meridiems()}static eras(g="short",{locale:w=null}={}){return Fe.create(w,null,"gregory").eras(g)}static features(){return{relative:$s(),localeWeek:Hs()}}}function sm(A,g){const w=U=>U.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),N=w(g)-w(A);return Math.floor(It.fromMillis(N).as("days"))}function tT(A,g,w){const N=[["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 nt=sm(ge,Be);return(nt-nt%7)/7}],["days",sm]],U={},ee=A;let ce,fe;for(const[ge,Be]of N)w.indexOf(ge)>=0&&(ce=ge,U[ge]=Be(A,g),fe=ee.plus(U),fe>g?(U[ge]--,A=ee.plus(U),A>g&&(fe=A,U[ge]--,A=ee.plus(U))):A=fe);return[A,U,fe,ce]}function nT(A,g,w,N){let[U,ee,ce,fe]=tT(A,g,w);const ge=g-U,Be=w.filter(ht=>["hours","minutes","seconds","milliseconds"].indexOf(ht)>=0);Be.length===0&&(ce<g&&(ce=U.plus({[fe]:1})),ce!==U&&(ee[fe]=(ee[fe]||0)+ge/(ce-U)));const nt=It.fromObject(ee,N);return Be.length>0?It.fromMillis(ge,N).shiftTo(...Be).plus(nt):nt}const rT="missing Intl.DateTimeFormat.formatToParts support";function Rt(A,g=w=>w){return{regex:A,deser:([w])=>g(st(w))}}const am="[ ]",lm=new RegExp(am,"g");function oT(A){return A.replace(/\./g,"\\.?").replace(lm,am)}function um(A){return A.replace(/\./g,"").replace(lm," ").toLowerCase()}function Mr(A,g){return A===null?null:{regex:RegExp(A.map(oT).join("|")),deser:([w])=>A.findIndex(N=>um(w)===um(N))+g}}function cm(A,g){return{regex:A,deser:([,w,N])=>jl(w,N),groups:g}}function zl(A){return{regex:A,deser:([g])=>g}}function iT(A){return A.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function sT(A,g){const w=yt(g),N=yt(g,"{2}"),U=yt(g,"{3}"),ee=yt(g,"{4}"),ce=yt(g,"{6}"),fe=yt(g,"{1,2}"),ge=yt(g,"{1,3}"),Be=yt(g,"{1,6}"),nt=yt(g,"{1,9}"),ht=yt(g,"{2,4}"),Vt=yt(g,"{4,6}"),it=zr=>({regex:RegExp(iT(zr.val)),deser:([zi])=>zi,literal:!0}),Pr=(zr=>{if(A.literal)return it(zr);switch(zr.val){case"G":return Mr(g.eras("short"),0);case"GG":return Mr(g.eras("long"),0);case"y":return Rt(Be);case"yy":return Rt(ht,Qc);case"yyyy":return Rt(ee);case"yyyyy":return Rt(Vt);case"yyyyyy":return Rt(ce);case"M":return Rt(fe);case"MM":return Rt(N);case"MMM":return Mr(g.months("short",!0),1);case"MMMM":return Mr(g.months("long",!0),1);case"L":return Rt(fe);case"LL":return Rt(N);case"LLL":return Mr(g.months("short",!1),1);case"LLLL":return Mr(g.months("long",!1),1);case"d":return Rt(fe);case"dd":return Rt(N);case"o":return Rt(ge);case"ooo":return Rt(U);case"HH":return Rt(N);case"H":return Rt(fe);case"hh":return Rt(N);case"h":return Rt(fe);case"mm":return Rt(N);case"m":return Rt(fe);case"q":return Rt(fe);case"qq":return Rt(N);case"s":return Rt(fe);case"ss":return Rt(N);case"S":return Rt(ge);case"SSS":return Rt(U);case"u":return zl(nt);case"uu":return zl(fe);case"uuu":return Rt(w);case"a":return Mr(g.meridiems(),0);case"kkkk":return Rt(ee);case"kk":return Rt(ht,Qc);case"W":return Rt(fe);case"WW":return Rt(N);case"E":case"c":return Rt(w);case"EEE":return Mr(g.weekdays("short",!1),1);case"EEEE":return Mr(g.weekdays("long",!1),1);case"ccc":return Mr(g.weekdays("short",!0),1);case"cccc":return Mr(g.weekdays("long",!0),1);case"Z":case"ZZ":return cm(new RegExp(`([+-]${fe.source})(?::(${N.source}))?`),2);case"ZZZ":return cm(new RegExp(`([+-]${fe.source})(${N.source})?`),2);case"z":return zl(/[a-z_+-/]{1,256}?/i);case" ":return zl(/[^\S\n\r]/);default:return it(zr)}})(A)||{invalidReason:rT};return Pr.token=A,Pr}const aT={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 lT(A,g,w){const{type:N,value:U}=A;if(N==="literal"){const ge=/^\s+$/.test(U);return{literal:!ge,val:ge?" ":U}}const ee=g[N];let ce=N;N==="hour"&&(g.hour12!=null?ce=g.hour12?"hour12":"hour24":g.hourCycle!=null?g.hourCycle==="h11"||g.hourCycle==="h12"?ce="hour12":ce="hour24":ce=w.hour12?"hour12":"hour24");let fe=aT[ce];if(typeof fe=="object"&&(fe=fe[ee]),fe)return{literal:!1,val:fe}}function uT(A){return[`^${A.map(w=>w.regex).reduce((w,N)=>`${w}(${N.source})`,"")}$`,A]}function cT(A,g,w){const N=A.match(g);if(N){const U={};let ee=1;for(const ce in w)if(Fn(w,ce)){const fe=w[ce],ge=fe.groups?fe.groups+1:1;!fe.literal&&fe.token&&(U[fe.token.val[0]]=fe.deser(N.slice(ee,ee+ge))),ee+=ge}return[N,U]}else return[N,{}]}function dT(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 w=null,N;return je(A.z)||(w=G.create(A.z)),je(A.Z)||(w||(w=new lt(A.Z)),N=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=Kc(A.u)),[Object.keys(A).reduce((ee,ce)=>{const fe=g(ce);return fe&&(ee[fe]=A[ce]),ee},{}),w,N]}let ed=null;function fT(){return ed||(ed=at.fromMillis(1555555555555)),ed}function pT(A,g){if(A.literal)return A;const w=Dn.macroTokenToFormatOpts(A.val),N=hm(w,g);return N==null||N.includes(void 0)?A:N}function dm(A,g){return Array.prototype.concat(...A.map(w=>pT(w,g)))}class fm{constructor(g,w){if(this.locale=g,this.format=w,this.tokens=dm(Dn.parseFormat(w),g),this.units=this.tokens.map(N=>sT(N,g)),this.disqualifyingUnit=this.units.find(N=>N.invalidReason),!this.disqualifyingUnit){const[N,U]=uT(this.units);this.regex=RegExp(N,"i"),this.handlers=U}}explainFromTokens(g){if(this.isValid){const[w,N]=cT(g,this.regex,this.handlers),[U,ee,ce]=N?dT(N):[null,null,void 0];if(Fn(N,"a")&&Fn(N,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:g,tokens:this.tokens,regex:this.regex,rawMatches:w,matches:N,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 pm(A,g,w){return new fm(A,w).explainFromTokens(g)}function hT(A,g,w){const{result:N,zone:U,specificOffset:ee,invalidReason:ce}=pm(A,g,w);return[N,U,ee,ce]}function hm(A,g){if(!A)return null;const N=Dn.create(g,A).dtFormatter(fT()),U=N.formatToParts(),ee=N.resolvedOptions();return U.map(ce=>lT(ce,A,ee))}const td="Invalid DateTime",mm=864e13;function Ks(A){return new Cn("unsupported zone",`the zone "${A.name}" is not supported`)}function nd(A){return A.weekData===null&&(A.weekData=rn(A.c)),A.weekData}function rd(A){return A.localWeekData===null&&(A.localWeekData=rn(A.c,A.loc.getMinDaysInFirstWeek(),A.loc.getStartOfWeek())),A.localWeekData}function Yo(A,g){const w={ts:A.ts,zone:A.zone,c:A.c,o:A.o,loc:A.loc,invalid:A.invalid};return new at({...w,...g,old:w})}function gm(A,g,w){let N=A-g*60*1e3;const U=w.offset(N);if(g===U)return[N,g];N-=(U-g)*60*1e3;const ee=w.offset(N);return U===ee?[N,U]:[A-Math.min(U,ee)*60*1e3,Math.max(U,ee)]}function Ul(A,g){A+=g*60*1e3;const w=new Date(A);return{year:w.getUTCFullYear(),month:w.getUTCMonth()+1,day:w.getUTCDate(),hour:w.getUTCHours(),minute:w.getUTCMinutes(),second:w.getUTCSeconds(),millisecond:w.getUTCMilliseconds()}}function Vl(A,g,w){return gm(Bl(A),g,w)}function bm(A,g){const w=A.o,N=A.c.year+Math.trunc(g.years),U=A.c.month+Math.trunc(g.months)+Math.trunc(g.quarters)*3,ee={...A.c,year:N,month:U,day:Math.min(A.c.day,_l(N,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"),fe=Bl(ee);let[ge,Be]=gm(fe,w,A.zone);return ce!==0&&(ge+=ce,Be=A.zone.offset(ge)),{ts:ge,o:Be}}function Hi(A,g,w,N,U,ee){const{setZone:ce,zone:fe}=w;if(A&&Object.keys(A).length!==0||g){const ge=g||fe,Be=at.fromObject(A,{...w,zone:ge,specificOffset:ee});return ce?Be:Be.setZone(fe)}else return at.invalid(new Cn("unparsable",`the input "${U}" can't be parsed as ${N}`))}function Wl(A,g,w=!0){return A.isValid?Dn.create(Fe.create("en-US"),{allowZ:w,forceSimple:!0}).formatDateTimeFromString(A,g):null}function od(A,g,w){const N=A.c.year>9999||A.c.year<0;let U="";if(N&&A.c.year>=0&&(U+="+"),U+=fn(A.c.year,N?6:4),w==="year")return U;if(g){if(U+="-",U+=fn(A.c.month),w==="month")return U;U+="-"}else if(U+=fn(A.c.month),w==="month")return U;return U+=fn(A.c.day),U}function ym(A,g,w,N,U,ee,ce){let fe=!w||A.c.millisecond!==0||A.c.second!==0,ge="";switch(ce){case"day":case"month":case"year":break;default:if(ge+=fn(A.c.hour),ce==="hour")break;if(g){if(ge+=":",ge+=fn(A.c.minute),ce==="minute")break;fe&&(ge+=":",ge+=fn(A.c.second))}else{if(ge+=fn(A.c.minute),ce==="minute")break;fe&&(ge+=fn(A.c.second))}if(ce==="second")break;fe&&(!N||A.c.millisecond!==0)&&(ge+=".",ge+=fn(A.c.millisecond,3))}return U&&(A.isOffsetFixed&&A.offset===0&&!ee?ge+="Z":A.o<0?(ge+="-",ge+=fn(Math.trunc(-A.o/60)),ge+=":",ge+=fn(Math.trunc(-A.o%60))):(ge+="+",ge+=fn(Math.trunc(A.o/60)),ge+=":",ge+=fn(Math.trunc(A.o%60)))),ee&&(ge+="["+A.zone.ianaName+"]"),ge}const xm={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},mT={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},gT={ordinal:1,hour:0,minute:0,second:0,millisecond:0},ql=["year","month","day","hour","minute","second","millisecond"],bT=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],yT=["year","ordinal","hour","minute","second","millisecond"];function Yl(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 vm(A){switch(A.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Yl(A)}}function xT(A){if(Gs===void 0&&(Gs=Pt.now()),A.type!=="iana")return A.offset(Gs);const g=A.name;let w=id.get(g);return w===void 0&&(w=A.offset(Gs),id.set(g,w)),w}function Cm(A,g){const w=be(g.zone,Pt.defaultZone);if(!w.isValid)return at.invalid(Ks(w));const N=Fe.fromObject(g);let U,ee;if(je(A.year))U=Pt.now();else{for(const ge of ql)je(A[ge])&&(A[ge]=xm[ge]);const ce=Ye(A)||ot(A);if(ce)return at.invalid(ce);const fe=xT(w);[U,ee]=Vl(A,fe,w)}return new at({ts:U,zone:w,loc:N,o:ee})}function Em(A,g,w){const N=je(w.round)?!0:w.round,U=je(w.rounding)?"trunc":w.rounding,ee=(fe,ge)=>(fe=Gc(fe,N||w.calendary?0:2,w.calendary?"round":U),g.loc.clone(w).relFormatter(w).format(fe,ge)),ce=fe=>w.calendary?g.hasSame(A,fe)?0:g.startOf(fe).diff(A.startOf(fe),fe).get(fe):g.diff(A,fe).get(fe);if(w.unit)return ee(ce(w.unit),w.unit);for(const fe of w.units){const ge=ce(fe);if(Math.abs(ge)>=1)return ee(ge,fe)}return ee(A>g?-0:0,w.units[w.units.length-1])}function Tm(A){let g={},w;return A.length>0&&typeof A[A.length-1]=="object"?(g=A[A.length-1],w=Array.from(A).slice(0,A.length-1)):w=Array.from(A),[g,w]}let Gs;const id=new Map;class at{constructor(g){const w=g.zone||Pt.defaultZone;let N=g.invalid||(Number.isNaN(g.ts)?new Cn("invalid input"):null)||(w.isValid?null:Ks(w));this.ts=je(g.ts)?Pt.now():g.ts;let U=null,ee=null;if(!N)if(g.old&&g.old.ts===this.ts&&g.old.zone.equals(w))[U,ee]=[g.old.c,g.old.o];else{const fe=Ut(g.o)&&!g.old?g.o:w.offset(this.ts);U=Ul(this.ts,fe),N=Number.isNaN(U.year)?new Cn("invalid input"):null,U=N?null:U,ee=N?null:fe}this._zone=w,this.loc=g.loc||Fe.create(),this.invalid=N,this.weekData=null,this.localWeekData=null,this.c=U,this.o=ee,this.isLuxonDateTime=!0}static now(){return new at({})}static local(){const[g,w]=Tm(arguments),[N,U,ee,ce,fe,ge,Be]=w;return Cm({year:N,month:U,day:ee,hour:ce,minute:fe,second:ge,millisecond:Be},g)}static utc(){const[g,w]=Tm(arguments),[N,U,ee,ce,fe,ge,Be]=w;return g.zone=lt.utcInstance,Cm({year:N,month:U,day:ee,hour:ce,minute:fe,second:ge,millisecond:Be},g)}static fromJSDate(g,w={}){const N=Pi(g)?g.valueOf():NaN;if(Number.isNaN(N))return at.invalid("invalid input");const U=be(w.zone,Pt.defaultZone);return U.isValid?new at({ts:N,zone:U,loc:Fe.fromObject(w)}):at.invalid(Ks(U))}static fromMillis(g,w={}){if(Ut(g))return g<-mm||g>mm?at.invalid("Timestamp out of range"):new at({ts:g,zone:be(w.zone,Pt.defaultZone),loc:Fe.fromObject(w)});throw new s(`fromMillis requires a numerical input, but received a ${typeof g} with value ${g}`)}static fromSeconds(g,w={}){if(Ut(g))return new at({ts:g*1e3,zone:be(w.zone,Pt.defaultZone),loc:Fe.fromObject(w)});throw new s("fromSeconds requires a numerical input")}static fromObject(g,w={}){g=g||{};const N=be(w.zone,Pt.defaultZone);if(!N.isValid)return at.invalid(Ks(N));const U=Fe.fromObject(w),ee=$l(g,vm),{minDaysInFirstWeek:ce,startOfWeek:fe}=Vo(ee,U),ge=Pt.now(),Be=je(w.specificOffset)?N.offset(ge):w.specificOffset,nt=!je(ee.ordinal),ht=!je(ee.year),Vt=!je(ee.month)||!je(ee.day),it=ht||Vt,pn=ee.weekYear||ee.weekNumber;if((it||nt)&&pn)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(Vt&&nt)throw new o("Can't mix ordinal dates with month/day");const Pr=pn||ee.weekday&&!it;let zr,zi,Xs=Ul(ge,Be);Pr?(zr=bT,zi=mT,Xs=rn(Xs,ce,fe)):nt?(zr=yT,zi=gT,Xs=Uo(Xs)):(zr=ql,zi=xm);let Sm=!1;for(const Js of zr){const kT=ee[Js];je(kT)?Sm?ee[Js]=zi[Js]:ee[Js]=Xs[Js]:Sm=!0}const CT=Pr?De(ee,ce,fe):nt?ke(ee):Ye(ee),km=CT||ot(ee);if(km)return at.invalid(km);const ET=Pr?Or(ee,ce,fe):nt?wo(ee):ee,[TT,ST]=Vl(ET,Be,N),Zs=new at({ts:TT,zone:N,o:ST,loc:U});return ee.weekday&&it&&g.weekday!==Zs.weekday?at.invalid("mismatched weekday",`you can't specify both a weekday of ${ee.weekday} and a date of ${Zs.toISO()}`):Zs.isValid?Zs:at.invalid(Zs.invalid)}static fromISO(g,w={}){const[N,U]=HE(g);return Hi(N,U,w,"ISO 8601",g)}static fromRFC2822(g,w={}){const[N,U]=zE(g);return Hi(N,U,w,"RFC 2822",g)}static fromHTTP(g,w={}){const[N,U]=UE(g);return Hi(N,U,w,"HTTP",w)}static fromFormat(g,w,N={}){if(je(g)||je(w))throw new s("fromFormat requires an input string and a format");const{locale:U=null,numberingSystem:ee=null}=N,ce=Fe.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0}),[fe,ge,Be,nt]=hT(ce,g,w);return nt?at.invalid(nt):Hi(fe,ge,N,`format ${w}`,g,Be)}static fromString(g,w,N={}){return at.fromFormat(g,w,N)}static fromSQL(g,w={}){const[N,U]=QE(g);return Hi(N,U,w,"SQL",g)}static invalid(g,w=null){if(!g)throw new s("need to specify a reason the DateTime is invalid");const N=g instanceof Cn?g:new Cn(g,w);if(Pt.throwOnInvalid)throw new t(N);return new at({invalid:N})}static isDateTime(g){return g&&g.isLuxonDateTime||!1}static parseFormatForOpts(g,w={}){const N=hm(g,Fe.fromObject(w));return N?N.map(U=>U?U.val:null).join(""):null}static expandFormat(g,w={}){return dm(Dn.parseFormat(g),Fe.fromObject(w)).map(U=>U.val).join("")}static resetCache(){Gs=void 0,id.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?nd(this).weekYear:NaN}get weekNumber(){return this.isValid?nd(this).weekNumber:NaN}get weekday(){return this.isValid?nd(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?rd(this).weekday:NaN}get localWeekNumber(){return this.isValid?rd(this).weekNumber:NaN}get localWeekYear(){return this.isValid?rd(this).weekYear:NaN}get ordinal(){return this.isValid?Uo(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ys.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ys.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ys.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ys.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,w=6e4,N=Bl(this.c),U=this.zone.offset(N-g),ee=this.zone.offset(N+g),ce=this.zone.offset(N-U*w),fe=this.zone.offset(N-ee*w);if(ce===fe)return[this];const ge=N-ce*w,Be=N-fe*w,nt=Ul(ge,ce),ht=Ul(Be,fe);return nt.hour===ht.hour&&nt.minute===ht.minute&&nt.second===ht.second&&nt.millisecond===ht.millisecond?[Yo(this,{ts:ge}),Yo(this,{ts:Be})]:[this]}get isInLeapYear(){return zs(this.year)}get daysInMonth(){return _l(this.year,this.month)}get daysInYear(){return this.isValid?Ri(this.year):NaN}get weeksInWeekYear(){return this.isValid?Us(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Us(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(g={}){const{locale:w,numberingSystem:N,calendar:U}=Dn.create(this.loc.clone(g),g).resolvedOptions(this);return{locale:w,numberingSystem:N,outputCalendar:U}}toUTC(g=0,w={}){return this.setZone(lt.instance(g),w)}toLocal(){return this.setZone(Pt.defaultZone)}setZone(g,{keepLocalTime:w=!1,keepCalendarTime:N=!1}={}){if(g=be(g,Pt.defaultZone),g.equals(this.zone))return this;if(g.isValid){let U=this.ts;if(w||N){const ee=g.offset(this.ts),ce=this.toObject();[U]=Vl(ce,ee,g)}return Yo(this,{ts:U,zone:g})}else return at.invalid(Ks(g))}reconfigure({locale:g,numberingSystem:w,outputCalendar:N}={}){const U=this.loc.clone({locale:g,numberingSystem:w,outputCalendar:N});return Yo(this,{loc:U})}setLocale(g){return this.reconfigure({locale:g})}set(g){if(!this.isValid)return this;const w=$l(g,vm),{minDaysInFirstWeek:N,startOfWeek:U}=Vo(w,this.loc),ee=!je(w.weekYear)||!je(w.weekNumber)||!je(w.weekday),ce=!je(w.ordinal),fe=!je(w.year),ge=!je(w.month)||!je(w.day),Be=fe||ge,nt=w.weekYear||w.weekNumber;if((Be||ce)&&nt)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 ht;ee?ht=Or({...rn(this.c,N,U),...w},N,U):je(w.ordinal)?(ht={...this.toObject(),...w},je(w.day)&&(ht.day=Math.min(_l(ht.year,ht.month),ht.day))):ht=wo({...Uo(this.c),...w});const[Vt,it]=Vl(ht,this.o,this.zone);return Yo(this,{ts:Vt,o:it})}plus(g){if(!this.isValid)return this;const w=It.fromDurationLike(g);return Yo(this,bm(this,w))}minus(g){if(!this.isValid)return this;const w=It.fromDurationLike(g).negate();return Yo(this,bm(this,w))}startOf(g,{useLocaleWeeks:w=!1}={}){if(!this.isValid)return this;const N={},U=It.normalizeUnit(g);switch(U){case"years":N.month=1;case"quarters":case"months":N.day=1;case"weeks":case"days":N.hour=0;case"hours":N.minute=0;case"minutes":N.second=0;case"seconds":N.millisecond=0;break}if(U==="weeks")if(w){const ee=this.loc.getStartOfWeek(),{weekday:ce}=this;ce<ee&&(N.weekNumber=this.weekNumber-1),N.weekday=ee}else N.weekday=1;if(U==="quarters"){const ee=Math.ceil(this.month/3);N.month=(ee-1)*3+1}return this.set(N)}endOf(g,w){return this.isValid?this.plus({[g]:1}).startOf(g,w).minus(1):this}toFormat(g,w={}){return this.isValid?Dn.create(this.loc.redefaultToEN(w)).formatDateTimeFromString(this,g):td}toLocaleString(g=f,w={}){return this.isValid?Dn.create(this.loc.clone(w),g).formatDateTime(this):td}toLocaleParts(g={}){return this.isValid?Dn.create(this.loc.clone(g),g).formatDateTimeParts(this):[]}toISO({format:g="extended",suppressSeconds:w=!1,suppressMilliseconds:N=!1,includeOffset:U=!0,extendedZone:ee=!1,precision:ce="milliseconds"}={}){if(!this.isValid)return null;ce=Yl(ce);const fe=g==="extended";let ge=od(this,fe,ce);return ql.indexOf(ce)>=3&&(ge+="T"),ge+=ym(this,fe,w,N,U,ee,ce),ge}toISODate({format:g="extended",precision:w="day"}={}){return this.isValid?od(this,g==="extended",Yl(w)):null}toISOWeekDate(){return Wl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:g=!1,suppressSeconds:w=!1,includeOffset:N=!0,includePrefix:U=!1,extendedZone:ee=!1,format:ce="extended",precision:fe="milliseconds"}={}){return this.isValid?(fe=Yl(fe),(U&&ql.indexOf(fe)>=3?"T":"")+ym(this,ce==="extended",w,g,N,ee,fe)):null}toRFC2822(){return Wl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Wl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?od(this,!0):null}toSQLTime({includeOffset:g=!0,includeZone:w=!1,includeOffsetSpace:N=!0}={}){let U="HH:mm:ss.SSS";return(w||g)&&(N&&(U+=" "),w?U+="z":g&&(U+="ZZ")),Wl(this,U,!0)}toSQL(g={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(g)}`:null}toString(){return this.isValid?this.toISO():td}[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 w={...this.c};return g.includeConfig&&(w.outputCalendar=this.outputCalendar,w.numberingSystem=this.loc.numberingSystem,w.locale=this.loc.locale),w}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(g,w="milliseconds",N={}){if(!this.isValid||!g.isValid)return It.invalid("created by diffing an invalid DateTime");const U={locale:this.locale,numberingSystem:this.numberingSystem,...N},ee=Ll(w).map(It.normalizeUnit),ce=g.valueOf()>this.valueOf(),fe=ce?this:g,ge=ce?g:this,Be=nT(fe,ge,ee,U);return ce?Be.negate():Be}diffNow(g="milliseconds",w={}){return this.diff(at.now(),g,w)}until(g){return this.isValid?on.fromDateTimes(this,g):this}hasSame(g,w,N){if(!this.isValid)return!1;const U=g.valueOf(),ee=this.setZone(g.zone,{keepLocalTime:!0});return ee.startOf(w,N)<=U&&U<=ee.endOf(w,N)}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 w=g.base||at.fromObject({},{zone:this.zone}),N=g.padding?this<w?-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),Em(w,this.plus(N),{...g,numeric:"always",units:U,unit:ee})}toRelativeCalendar(g={}){return this.isValid?Em(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,w=>w.valueOf(),Math.min)}static max(...g){if(!g.every(at.isDateTime))throw new s("max requires all arguments be DateTimes");return wt(g,w=>w.valueOf(),Math.max)}static fromFormatExplain(g,w,N={}){const{locale:U=null,numberingSystem:ee=null}=N,ce=Fe.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0});return pm(ce,g,w)}static fromStringExplain(g,w,N={}){return at.fromFormatExplain(g,w,N)}static buildFormatParser(g,w={}){const{locale:N=null,numberingSystem:U=null}=w,ee=Fe.fromOpts({locale:N,numberingSystem:U,defaultToEN:!0});return new fm(ee,g)}static fromFormatParser(g,w,N={}){if(je(g)||je(w))throw new s("fromFormatParser requires an input string and a format parser");const{locale:U=null,numberingSystem:ee=null}=N,ce=Fe.fromOpts({locale:U,numberingSystem:ee,defaultToEN:!0});if(!ce.equals(w.locale))throw new s(`fromFormatParser called with a locale of ${ce}, but the format parser was created for ${w.locale}`);const{result:fe,zone:ge,specificOffset:Be,invalidReason:nt}=w.explainFromTokens(g);return nt?at.invalid(nt):Hi(fe,ge,N,`format ${w.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 E}static get TIME_24_SIMPLE(){return T}static get TIME_24_WITH_SECONDS(){return I}static get TIME_24_WITH_SHORT_OFFSET(){return D}static get TIME_24_WITH_LONG_OFFSET(){return _}static get DATETIME_SHORT(){return O}static get DATETIME_SHORT_WITH_SECONDS(){return B}static get DATETIME_MED(){return L}static get DATETIME_MED_WITH_SECONDS(){return j}static get DATETIME_MED_WITH_WEEKDAY(){return S}static get DATETIME_FULL(){return $}static get DATETIME_FULL_WITH_SECONDS(){return F}static get DATETIME_HUGE(){return R}static get DATETIME_HUGE_WITH_SECONDS(){return H}}function Qs(A){if(at.isDateTime(A))return A;if(A&&A.valueOf&&Ut(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 vT="3.7.2";return Un.DateTime=at,Un.Duration=It,Un.FixedOffsetZone=lt,Un.IANAZone=G,Un.Info=Ys,Un.Interval=on,Un.InvalidZone=Mt,Un.Settings=Pt,Un.SystemZone=q,Un.VERSION=vT,Un.Zone=V,Un}var Z1;function wh(){return Z1||(Z1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;const t=aU();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})(Qd)),Qd}var J1;function lU(){if(J1)return wa;J1=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.CronMonth=void 0;const e=wh(),t=Ii(),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 wa.CronMonth=i,wa}var Da={},eb;function uU(){if(eb)return Da;eb=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.CronSecond=void 0;const e=Ii(),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 tb;function Dh(){return tb||(tb=1,(function(e){var t=ti&&ti.__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=ti&&ti.__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(nU(),e),n(rU(),e),n(oU(),e),n(Ii(),e),n(iU(),e),n(sU(),e),n(lU(),e),n(uU(),e)})(ti)),ti}var nb;function cC(){if(nb)return va;nb=1,Object.defineProperty(va,"__esModule",{value:!0}),va.CronFieldCollection=void 0;const e=Dh();let t=class Na{#e;#n;#i;#o;#r;#t;static from(r,o){return new Na({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=Na.compactField(i);if(s.length===1){const a=Na.#u(r,s[0],o);if(a)return a}return s.map(a=>{const l=a.count===1?a.start.toString():Na.#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 va.CronFieldCollection=t,va}var Xd={},rb;function dC(){return rb||(rb=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=wh();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})(Xd)),Xd}var cu={},ob;function cU(){if(ob)return cu;ob=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.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 cu}var ib;function Gf(){if(ib)return Xn;ib=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.CronExpressionParser=Xn.DayOfWeek=Xn.Months=Xn.CronUnit=Xn.PredefinedExpressions=void 0;const e=cC(),t=dC(),n=cU(),r=Dh();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),E=er.#n(i.Month,b.month,r.CronMonth.constraints,m),T=er.#n(i.DayOfMonth,b.dayOfMonth,r.CronDayOfMonth.constraints,m),{dayOfWeek:I,nthDayOfWeek:D}=er.#d(b.dayOfWeek),_=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(T,{rawValue:b.dayOfMonth}),month:new r.CronMonth(E,{rawValue:b.month}),dayOfWeek:new r.CronDayOfWeek(_,{rawValue:b.dayOfWeek,nthDayOfWeek:D})});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,E]=h;return{second:m,minute:b,hour:y,dayOfMonth:x,month:C,dayOfWeek:E}}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),E=parseInt(y,10),T=parseInt(x,10);if(C>E)throw new Error(`Invalid range: ${C}-${E}, min > max`);if(T<=0)throw new Error(`Invalid step: ${T}, must be positive`);const I=Math.max(C,f.min),D=Math.floor(p*T),_=[];for(let O=Math.floor(I/T)*T+D;O<=E;O+=T)O>=I&&_.push(O);return _.join(",")}else if(b&&y){const C=parseInt(b,10),E=parseInt(y,10);if(C>E)throw new Error(`Invalid range: ${C}-${E}, min > max`);return String(Math.floor(p*(E-C+1))+C)}else if(x){const C=parseInt(x,10);if(C<=0)throw new Error(`Invalid step: ${C}, must be positive`);const E=Math.floor(p*C),T=[];for(let I=Math.floor(f.min/C)*C+E;I<=f.max;I+=C)I>=f.min&&T.push(I);return T.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 Nr={};const dU={},fU=Object.freeze(Object.defineProperty({__proto__:null,default:dU},Symbol.toStringTag,{value:"Module"})),sb=_T(fU);var ab;function pU(){if(ab)return Nr;ab=1;var e=Nr&&Nr.__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=Nr&&Nr.__setModuleDefault||(Object.create?(function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}):function(i,s){i.default=s}),n=Nr&&Nr.__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(Nr,"__esModule",{value:!0}),Nr.CronFileParser=void 0;const r=Gf();let o=class Mu{static async parseFile(s){const{readFile:a}=await Promise.resolve().then(()=>n(sb)),l=await a(s,"utf8");return Mu.#e(l)}static parseFileSync(s){const{readFileSync:a}=sb,l=a(s,"utf8");return Mu.#e(l)}static#e(s){const a=s.split(`
|
|
210
|
-
`),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=Mu.#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 Nr.CronFileParser=o,Nr}var lb;function hU(){return lb||(lb=1,(function(e){var t=ei&&ei.__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=ei&&ei.__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=Gf();var o=wh();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return o.CronDate}});var i=cC();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return i.CronFieldCollection}});var s=dC();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return s.CronExpression}});var a=Gf();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return a.CronExpressionParser}});var l=pU();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return l.CronFileParser}}),n(Dh(),e),e.default=r.CronExpressionParser})(ei)),ei}var mU=hU(),Zd={exports:{}},ub;function gU(){return ub||(ub=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 D=I.replace(/\D/,""),_=D;return p.dayOfWeekStartIndexZero?D=="7"&&(_="0"):_=(parseInt(D)-1).toString(),I.replace(D,_)}),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 D=I.replace(/\D/,""),_=D;return p.monthStartIndexZero&&(_=(parseInt(D)+1).toString()),I.replace(D,_)});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 E=null;switch(C){case 4:E="12";break;case 5:E="6";break;case 6:E="9999";break;default:E=null;break}if(E!==null){var T=h[C].split("/");h[C]="".concat(T[0],"-").concat(E,"/").concat(T[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,E=C===void 0?!1:C,T=b.dayOfWeekStartIndexZero,I=T===void 0?!0:T,D=b.monthStartIndexZero,_=D===void 0?!1:D,O=b.use24HourTimeFormat,B=b.locale,L=B===void 0?null:B,j={throwExceptionOnParseError:x,verbose:E,dayOfWeekStartIndexZero:I,monthStartIndexZero:_,use24HourTimeFormat:O,locale:L};j.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var S=new h(p,j);return S.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(),E=this.getMonthDescription(),T=this.getDayOfWeekDescription(),I=this.getYearDescription();b+=x+C+T+E+I,b=this.transformVerbosity(b,!!this.options.verbose),b=b.charAt(0).toLocaleUpperCase()+b.substr(1)}catch(D){if(!this.options.throwExceptionOnParseError)b=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(D)}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 E=0;E<C.length;E++)y+=" ",y+=this.formatTime(C[E],m,""),E<C.length-2&&(y+=","),E==C.length-2&&(y+=this.i18n.spaceAnd())}else{var T=this.getSecondsDescription(),I=this.getMinutesDescription(),D=this.getHoursDescription();if(y+=T,y&&I&&(y+=", "),y+=I,I===D)return y;y&&D&&(y+=", "),y+=D}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(E){var T=E.split("-");T.length===2&&y.push({value:T[1],index:b+1}),b+=T.length});var x=0,C=this.getSegmentDescription(m,this.i18n.everyHour(),function(E){var T=y.find(function(D){return D.value===E&&D.index===x}),I=T&&p.expressionParts[1]!=="0";return x++,I?p.formatTime(E,"59",""):p.formatTime(E,"0","")},function(E){return u.StringUtilities.format(p.i18n.everyX0Hours(E),E)},function(E){return p.i18n.betweenX0AndX1()},function(E){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 E=parseInt(C),T=p.i18n.daysOfTheWeekInCase?p.i18n.daysOfTheWeekInCase(x)[E]:m[E];if(y.indexOf("#")>-1){var I=null,D=y.substring(y.indexOf("#")+1),_=y.substring(0,y.indexOf("#"));switch(D){case"1":I=p.i18n.first(_);break;case"2":I=p.i18n.second(_);break;case"3":I=p.i18n.third(_);break;case"4":I=p.i18n.fourth(_);break;case"5":I=p.i18n.fifth(_);break}T=I+" "+T}return T},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),E=y.substring(0,y.indexOf("#"));x=p.i18n.commaOnThe(C,E).trim()+p.i18n.spaceX0OfTheMonth()}else if(y.indexOf("L")>-1)x=p.i18n.commaOnTheLastX0OfTheMonth(y.replace("L",""));else{var T=p.expressionParts[3]!="*";x=T?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 E=b.match(/L-(\d{1,2})/);if(E){var T=E[1];m=u.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(T),T);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 E=null,T=p.indexOf("/")>-1,I=p.indexOf("-")>-1,D=p.indexOf(",")>-1;if(!p)E="";else if(p==="*")E=m;else if(!T&&!I&&!D)E=u.StringUtilities.format(C(p),b(p));else if(D){for(var _=p.split(","),O="",B=0;B<_.length;B++)if(B>0&&_.length>2&&(O+=",",B<_.length-1&&(O+=" ")),B>0&&_.length>1&&(B==_.length-1||_.length==2)&&(O+="".concat(this.i18n.spaceAnd()," ")),_[B].indexOf("/")>-1||_[B].indexOf("-")>-1){var L=_[B].indexOf("-")>-1&&_[B].indexOf("/")==-1,j=this.getSegmentDescription(_[B],m,b,y,L?this.i18n.commaX0ThroughX1:x,C);L&&(j=j.replace(", ","")),O+=j}else T?O+=this.getSegmentDescription(_[B],m,b,y,x,C):O+=b(_[B]);T?E=O:E=u.StringUtilities.format(C(p),O)}else if(T){var _=p.split("/");if(E=u.StringUtilities.format(y(_[1]),_[1]),_[0].indexOf("-")>-1){var S=this.generateRangeSegmentDescription(_[0],x,b);S.indexOf(", ")!=0&&(E+=", "),E+=S}else if(_[0].indexOf("*")==-1){var $=u.StringUtilities.format(C(_[0]),b(_[0]));$=$.replace(", ",""),E+=u.StringUtilities.format(this.i18n.commaStartingX0(),$)}}else I&&(E=this.generateRangeSegmentDescription(p,x,b));return E},h.prototype.generateRangeSegmentDescription=function(p,m,b){var y="",x=p.split("-"),C=b(x[0],1),E=b(x[1],2),T=m(p);return y+=u.StringUtilities.format(T,C,E),y},h.prototype.formatTime=function(p,m,b){var y=0,x=0,C=parseInt(p)+y,E=parseInt(m)+x;E>=60?(E-=60,C+=1):E<0&&(E+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var T="",I=!1;this.options.use24HourTimeFormat||(I=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),T=I?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var D="";return b&&(D=":".concat(("00"+b).substring(b.length))),"".concat(I?T:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+E.toString()).substring(E.toString().length)).concat(D).concat(I?"":T)},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],E=x[1];p=p.replace(new RegExp(C,"g"),E)}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})())})(Zd)),Zd.exports}var bU=gU();const yU=Sr(bU),xU=new Set(["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","SUN","MON","TUE","WED","THU","FRI","SAT"]);function vU(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)&&!xU.has(n.toUpperCase()))return!1}return!0}function fC(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(!vU(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=yU.toString(t,{use24HourTimeFormat:!0,verbose:!1}),r=mU.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 pC(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 cb="0 6 * * *";function CU({currentSchedule:e,isSubmitting:t,disabled:n,disabledReason:r,onSubmit:o}){const[i,s]=W.useState(!1),[a,l]=W.useState(e??cb),u=()=>{l(e??cb),s(!0)},d=()=>s(!1),f=fC(a),h=async m=>{try{await o(m),s(!1)}catch{}},p=c.jsx("span",{children:c.jsx(k.Button,{variant:"outlined",size:"small",startIcon:c.jsx(ic,{}),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(k.Tooltip,{title:r,children:p}):p,c.jsxs(k.Dialog,{open:i,onClose:d,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"set-schedule-title",children:[c.jsx(k.DialogTitle,{id:"set-schedule-title",children:e?"Edit schedule":"Set schedule"}),c.jsxs(k.DialogContent,{children:[c.jsx(k.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(k.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:Ie.MONO_FONT_FAMILY}}}}),c.jsx(k.Box,{sx:{mt:1.5,minHeight:48},children:f.valid?c.jsxs(c.Fragment,{children:[c.jsx(k.Typography,{variant:"body2",children:f.description}),c.jsxs(k.Typography,{variant:"body2",color:"text.secondary",children:["Next run: ",pC(f.nextRun)]})]}):c.jsx(k.Typography,{variant:"body2",color:"error",children:f.error})}),c.jsxs(k.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(k.DialogActions,{sx:{justifyContent:"space-between",px:3},children:[c.jsx(k.Box,{children:e&&c.jsx(k.Button,{color:"error",loading:t,onClick:()=>h(null),children:"Clear schedule"})}),c.jsxs(k.Box,{children:[c.jsx(k.Button,{onClick:d,children:"Cancel"}),c.jsx(k.Button,{variant:"contained",loading:t,disabled:!f.valid,onClick:()=>h(a.trim()),sx:{ml:1},children:"Save"})]})]})]})]})}function EU({schedule:e,scope:t,manifestLocation:n,hasFreshness:r,mutable:o,isSubmitting:i,isScopeMutating:s,onSubmit:a,onScopeChange:l}){const u=!!n,d=e?fC(e):null,f=!!e;return c.jsx(k.Card,{variant:"outlined",sx:{borderRadius:2,mb:6},children:c.jsx(k.CardContent,{children:c.jsxs(k.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:2,children:[c.jsxs(k.Box,{sx:{minWidth:0},children:[c.jsxs(k.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[c.jsx(ic,{fontSize:"small",color:"action"}),c.jsx(k.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Schedule"})]}),u?c.jsxs(k.Box,{children:[c.jsx(k.Chip,{size:"small",color:"default",variant:"outlined",label:"Control-plane managed",sx:{mb:1}}),c.jsx(k.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(k.Box,{children:[c.jsxs(k.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5,flexWrap:"wrap"},children:[c.jsx(k.Chip,{size:"small",color:"success",variant:"outlined",icon:c.jsx(ic,{fontSize:"small"}),label:"Active"}),c.jsx(k.Box,{component:"code",sx:{fontFamily:Ie.MONO_FONT_FAMILY,fontSize:"0.8125rem",px:.75,py:.25,borderRadius:1,bgcolor:"action.hover"},children:e})]}),c.jsx(k.Typography,{variant:"body2",children:d.valid?d.description:"Unrecognized cron expression."}),d.valid&&c.jsxs(k.Typography,{variant:"body2",color:"text.secondary",children:["Next run: ",pC(d.nextRun)]})]}):r?c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"This package uses a freshness policy; a cron schedule is not applicable."}):c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"On-demand only — no schedule set."}),!u&&c.jsxs(k.Box,{sx:{mt:2},children:[c.jsx(k.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Scope"}),c.jsx(k.Tooltip,{title:f?"A schedule requires version scope. Clear the schedule to change it.":"",children:c.jsx("span",{children:c.jsxs(k.ToggleButtonGroup,{size:"small",exclusive:!0,value:t,disabled:!o||!l||f||!!s,onChange:(h,p)=>{p&&p!==t&&l?.(p)},children:[c.jsx(k.ToggleButton,{value:"package",children:"package"}),c.jsx(k.ToggleButton,{value:"version",children:"version"})]})})}),c.jsx(k.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(k.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(CU,{currentSchedule:e,isSubmitting:i,disabled:r,disabledReason:"This package declares a freshness policy; a schedule and freshness are mutually exclusive.",onSubmit:a})]})})})}const TU=3e3;function SU({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=Ie.useServer(),o=Tr.useQueryClient(),{environmentName:i,packageName:s}=jt(e),[a,l]=W.useState(""),[u,d]=W.useState(null),f=t??(B=>{window.location.href=B});if(!s)throw new Error("Materializations requires a package in the resource URI");const h=zt({queryKey:["materializations",i,s],queryFn:()=>n.materializations.listMaterializations(i,s),refetchInterval:B=>(B.state.data?.data??[]).some(S=>fl(S.status))?TU:!1}),p=zt({queryKey:["package",i,s],queryFn:()=>n.packages.getPackage(i,s)}),m=()=>o.invalidateQueries({queryKey:["materializations",i,s]}),b=Sn({mutationFn:B=>n.materializations.createMaterialization(i,s,{forceRefresh:B.forceRefresh}),onSuccess(){l("Materialization requested"),m()},onError(B){l(B.message),m()}}),y=Sn({mutationFn:B=>n.materializations.materializationAction(i,s,B.id,Ie.MaterializationActionActionEnum.Stop),onSuccess(){l("Materialization stopped"),m()},onError(B){l(B.message)}}),x=Sn({mutationFn:({materialization:B,dropTables:L})=>n.materializations.deleteMaterialization(i,s,B.id,L),onSuccess(){l("Materialization deleted"),m()},onError(B){l(B.message)}}),C=p.data?.data,E=Sn({mutationFn:B=>n.packages.updatePackage(i,s,{name:s,description:C?.description,...B?{scope:Ie.PackageScopeEnum.Version}:{},materialization:{schedule:B}}),onSuccess(B,L){l(L?"Schedule updated":"Schedule cleared"),o.invalidateQueries({queryKey:["package",i,s]})},onError(B){l(B.message)}}),T=Sn({mutationFn:B=>n.packages.updatePackage(i,s,{name:s,description:C?.description,scope:B}),onSuccess(){l("Scope updated"),o.invalidateQueries({queryKey:["package",i,s]})},onError(B){l(B.message)}}),I=h.data?.data??[],D=I.find(B=>B.id===u)??null,_=I.some(B=>fl(B.status)),O=b.isPending||y.isPending||x.isPending;return c.jsxs(k.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[c.jsxs(k.Box,{sx:{mb:4},children:[c.jsxs(k.Link,{onClick:B=>f(`/${i}/${s}`,B),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(tC,{sx:{fontSize:18}}),"Back to ",s]}),c.jsxs(k.Stack,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[c.jsxs(k.Box,{children:[c.jsx(k.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:"Materializations"}),c.jsxs(k.Typography,{variant:"body2",color:"text.secondary",children:["Materialize the persist sources in ",s," into tables and serve queries from them"]})]}),r&&c.jsx(gz,{onSubmit:B=>b.mutateAsync(B),isSubmitting:b.isPending,disabled:_,disabledReason:"A materialization is already pending or running for this package."})]})]}),p.isSuccess&&c.jsx(EU,{schedule:C?.materialization?.schedule??null,scope:C?.scope===Ie.PackageScopeEnum.Version?"version":"package",manifestLocation:C?.manifestLocation??null,hasFreshness:!!C?.materialization?.freshness,mutable:r,isSubmitting:E.isPending,isScopeMutating:T.isPending,onSubmit:B=>E.mutateAsync(B),onScopeChange:B=>T.mutateAsync(B==="version"?Ie.PackageScopeEnum.Version:Ie.PackageScopeEnum.Package)}),c.jsxs(k.Box,{sx:{mb:6},children:[c.jsx(k.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:1},children:"Runs"}),h.isError&&c.jsx(vn,{error:h.error,context:`${i} > ${s} > Materializations`}),!h.isSuccess&&!h.isError&&c.jsx(xn,{text:"Loading materializations..."}),h.isSuccess&&c.jsx(lC,{materializations:I,mutable:r,isMutating:O,onStop:B=>y.mutate(B),onDelete:(B,L)=>x.mutate({materialization:B,dropTables:L}),onViewDetails:B=>d(B.id??null)})]}),c.jsx(aC,{materialization:D,buildPlan:p.data?.data?.buildPlan??null,onClose:()=>d(null)}),c.jsx(k.Snackbar,{open:a!=="",autoHideDuration:6e3,onClose:()=>l(""),message:a})]})}function kU({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(k.Button,{variant:"contained",startIcon:c.jsx(ys,{}),onClick:d,disabled:r,"aria-label":"New materialization",children:"New materialization"}),c.jsxs(k.Dialog,{open:o,onClose:f,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-env-materialization-title",children:[c.jsx(k.DialogTitle,{id:"create-env-materialization-title",children:"New materialization"}),c.jsxs(k.DialogContent,{children:[c.jsx(k.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(k.Typography,{variant:"body2",color:"text.secondary",children:"No packages in this environment."}):c.jsxs(c.Fragment,{children:[c.jsx(k.FormControlLabel,{control:c.jsx(k.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(k.Typography,{variant:"body2",children:"Select all"})}),c.jsx(k.Box,{sx:{maxHeight:240,overflowY:"auto",pl:1,borderLeft:"2px solid",borderColor:"divider"},children:c.jsx(k.FormGroup,{children:e.map(y=>c.jsx(k.FormControlLabel,{control:c.jsx(k.Checkbox,{checked:!!s[y.name],onChange:()=>p(y.name)}),label:y.name},y.name))})}),c.jsx(k.FormControlLabel,{sx:{mt:1},control:c.jsx(k.Switch,{checked:l,onChange:y=>u(y.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})]})]}),c.jsxs(k.DialogActions,{children:[c.jsx(k.Button,{onClick:f,children:"Cancel"}),c.jsxs(k.Button,{variant:"contained",loading:n,disabled:h.length===0,onClick:b,children:["Materialize",h.length>0?` (${h.length})`:""]})]})]})]})}const wU=3e3,db=10;function hC({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=Ie.useServer(),o=Tr.useQueryClient(),{environmentName:i}=jt(e),[s,a]=W.useState(""),[l,u]=W.useState(null),[d,f]=W.useState(db),h=t??(O=>{window.location.href=O}),p=zt({queryKey:["env-materializations",i,d],queryFn:()=>n.materializations.listEnvironmentMaterializations(i,d),placeholderData:O=>O,refetchInterval:O=>(O.state.data?.data??[]).some(j=>fl(j.status))?wU:!1}),m=zt({queryKey:["packages",i],queryFn:()=>n.packages.listPackages(i)}),b=()=>o.invalidateQueries({queryKey:["env-materializations",i]}),y=Sn({mutationFn:async O=>{const L=(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:L}},onSuccess(O){const B=O.total-O.failed;a(O.failed===0?`Started ${B} materialization${B===1?"":"s"}`:`Started ${B} of ${O.total} (${O.failed} could not start — a build may already be active)`),b()},onError(O){a(O.message),b()}}),x=Sn({mutationFn:O=>n.materializations.materializationAction(i,O.packageName,O.id,Ie.MaterializationActionActionEnum.Stop),onSuccess(){a("Materialization stopped"),b()},onError(O){a(O.message)}}),C=Sn({mutationFn:({materialization:O,dropTables:B})=>n.materializations.deleteMaterialization(i,O.packageName,O.id,B),onSuccess(){a("Materialization deleted"),b()},onError(O){a(O.message)}}),E=p.data?.data??[],T=m.data?.data??[],I=E.find(O=>O.id===l)??null,D=y.isPending||x.isPending||C.isPending,_=E.length>=d;return c.jsxs(k.Box,{children:[c.jsxs(k.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[c.jsxs(k.Box,{children:[c.jsx(k.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Materializations"}),c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"All materialization builds across the packages in this environment"})]}),r&&c.jsx(kU,{packages:T,onSubmit:O=>y.mutateAsync(O),isSubmitting:y.isPending})]}),p.isError&&c.jsx(vn,{error:p.error,context:`${i} > Materializations`}),!p.isSuccess&&!p.isError&&c.jsx(xn,{text:"Loading materializations..."}),p.isSuccess&&c.jsx(lC,{materializations:E,mutable:r,isMutating:D,showPackage:!0,onClickPackage:O=>h(`/${i}/${O}/materializations`),onStop:O=>x.mutate(O),onDelete:(O,B)=>C.mutate({materialization:O,dropTables:B}),onViewDetails:O=>u(O.id??null)}),p.isSuccess&&E.length>0&&c.jsxs(k.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:2,sx:{mt:2},children:[c.jsx(k.Typography,{variant:"caption",color:"text.secondary",children:_?`Showing ${E.length} most recent`:`${E.length} materialization${E.length===1?"":"s"}`}),_&&c.jsx(k.Button,{size:"small",onClick:()=>f(O=>O+db),disabled:p.isFetching,children:"Show more"})]}),c.jsx(aC,{materialization:I,buildPlan:null,showBuildPlan:!1,onClose:()=>u(null)}),c.jsx(k.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})}function DU({resourceUri:e}){const{environmentName:t}=jt(e),{apiClients:n}=Ie.useServer(),[r,o]=W.useState(!1),i=90,{data:s,isSuccess:a,isError:l,error:u}=zt({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(xn,{text:"Fetching About..."}),a&&d&&c.jsx(Ie.PackageCard,{children:c.jsxs(Ie.PackageCardContent,{children:[c.jsx(Ie.PackageSectionTitle,{children:"Readme"}),c.jsxs(k.Box,{sx:{mt:1,fontSize:"0.875rem",lineHeight:1.6},children:[c.jsx(Fu,{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(k.Box,{sx:{mt:1},children:[" ",c.jsx(k.Button,{variant:"text",size:"small",onClick:()=>o(!r),children:r?"Read less":"Read more"})]})]})]})}),l&&c.jsx(vn,{error:u,context:`${t} > About`})]})}const mC="https://docs.malloydata.dev/documentation",Jd=`${mC}/user_guides/publishing`,es="https://github.com/malloydata/publisher/blob/main/docs",Fr={docsHome:`${mC}/`,publishing:`${Jd}/publishing`,explorer:`${Jd}/explorer`,mcpAgents:`${Jd}/mcp_agents`,surfaces:`${es}/choosing-a-surface.md`,dashboards:`${es}/dashboards.md`,dataApps:`${es}/html-data-apps.md`,givens:`${es}/givens.md`,materialization:`${es}/materialization.md`,connections:`${es}/connections.md`};function IU({resourceUri:e}){const[t,n]=W.useState(!1),{apiClients:r}=Ie.useServer(),o=Tr.useQueryClient(),[i,s]=W.useState(""),{environmentName:a}=jt(e),l=Sn({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(k.Button,{onClick:()=>n(!0),variant:"contained",color:"primary",startIcon:c.jsx(On.Add,{}),children:"Add Package"}),c.jsxs(k.Dialog,{open:t,onClose:()=>n(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[c.jsx(k.DialogTitle,{sx:{fontSize:"1.25rem",fontWeight:600,letterSpacing:"-0.025em",pt:3,pb:1,px:3},children:"Create New Package"}),c.jsxs(k.DialogContent,{sx:{px:3,pb:0},children:[c.jsxs(k.Box,{sx:{mb:3},children:[c.jsx(k.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"Create a new Malloy package to start exploring your data."}),c.jsx(k.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(k.Typography,{variant:"body2",color:"text.secondary",children:["Make sure to conform to the"," ",c.jsx(k.Box,{component:"a",href:Fr.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(k.Stack,{spacing:2.5,children:[c.jsx(k.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(k.TextField,{id:"description",name:"description",label:"Description",multiline:!0,rows:3,fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),c.jsx(k.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(k.DialogActions,{sx:{px:3,pt:2,pb:3,gap:1},children:[c.jsx(k.Button,{variant:"outlined",disabled:l.isPending,onClick:()=>n(!1),children:"Cancel"}),c.jsx(k.Button,{type:"submit",form:"package-form",variant:"contained",loading:l.isPending,children:"Save Changes"})]})]}),c.jsx(k.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})}const AU=gt(c.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),gC=gt(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"})),OU=qe("MuiBox",["root"]),MU=Vb(),Xt=Ot.createBox({themeId:As,defaultTheme:MU,defaultClassName:OU.root,generateClassName:Ab.generate});function PU(e){return Ge("MuiDialogContentText",e)}qe("MuiDialogContentText",["root"]);const RU=e=>{const{classes:t}=e,r=Ke({root:["root"]},PU,t);return{...t,...r}},NU=pe(Dt,{shouldForwardProp:e=>$n(e)||e==="classes",name:"MuiDialogContentText",slot:"Root"})({}),Nl=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiDialogContentText"}),{children:o,className:i,...s}=r,a=RU(s);return c.jsx(NU,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:s,className:Ue(a.root,i),...r,classes:a})}),mo={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:[]},Pu={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",databricks:"databricksConnection",mysql:"mysqlConnection",duckdb:"duckdbConnection",motherduck:"motherduckConnection",ducklake:"ducklakeConnection",publisher:"publisherConnection"},bC=Object.values(Ie.ConnectionTypeEnum).filter(e=>e!==Ie.ConnectionTypeEnum.Publisher),Qf={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",gcs:"gcsConnection",s3:"s3Connection",azure:"azureConnection"},pl=[{label:"Credential Provider",name:"provider",type:"text",required:!1,selectOptions:[{label:"Access key pair",value:"config"},{label:"Host credential chain",value:"credential_chain"}]},{label:"Access Key ID",name:"accessKeyId",type:"text",required:!1,visibleWhen:{field:"provider",value:"config"}},{label:"Secret Access Key",name:"secretAccessKey",type:"password",required:!1,visibleWhen:{field:"provider",value:"config"}},{label:"Credential Chain",name:"chain",type:"text",required:!1,visibleWhen:{field:"provider",value:"credential_chain"}},{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,visibleWhen:{field:"provider",value:"config"}}],hl=[{label:"Key ID",name:"keyId",type:"text",required:!0},{label:"Secret",name:"secret",type:"password",required:!0}],FU=[{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 sc(e){return e==="postgres"||e==="bigquery"||e==="snowflake"?mo[e]||[]:e==="s3"?pl:e==="gcs"?hl:e==="azure"?FU:[]}function LU({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,p]=W.useState("config"),m=()=>{r(!0)},b=()=>{r(!1),a([]),i("postgres"),u("postgres"),f("s3"),p("config")},y=async T=>{T.preventDefault();const I=new FormData(T.currentTarget),D=I.get("name")?.toString(),_=I.get("type")?.toString(),O=mo[_];if(!D)throw new Error("Name is required");if(!_)throw new Error("Type is required");let B;if(_==="ducklake"){const L={};if(l==="postgres"){const $=mo.postgres,F={};if($.forEach(R=>{const H=I.get(`ducklake_pg_${R.name}`)?.toString();H&&(F[R.name]=H)}),Object.keys(F).length===0)throw new Error("DuckLake requires catalog connection");L.postgresConnection=F}const j=I.get("ducklake_bucketUrl")?.toString();if(!j)throw new Error("DuckLake requires a bucket URL");const S={bucketUrl:j};if(d==="s3"){const $={};if(pl.forEach(F=>{const R=I.get(`ducklake_s3_${F.name}`)?.toString();R&&($[F.name]=R)}),$.provider==="credential_chain")delete $.accessKeyId,delete $.secretAccessKey,delete $.sessionToken;else{if(delete $.chain,!$.accessKeyId)throw new Error("S3 Access Key ID is required");if(!$.secretAccessKey)throw new Error("S3 Secret Access Key is required")}Object.keys($).length>0&&(S.s3Connection=$)}else if(d==="gcs"){const $={};if(hl.forEach(F=>{const R=I.get(`ducklake_gcs_${F.name}`)?.toString();R&&($[F.name]=R)}),!$.keyId)throw new Error("GCS Key ID is required");if(!$.secret)throw new Error("GCS Secret is required");Object.keys($).length>0&&(S.gcsConnection=$)}B={name:D,type:_,ducklakeConnection:{catalog:L,storage:S}}}else if(_==="duckdb"){if(s.length===0)throw new Error("DuckDB connection must have at least one attached database");const L=s.map((j,S)=>{const $=j.dbType,F=I.get(`attachedDb_${S}_name`)?.toString();if(!F)throw new Error(`Attached database at index ${S} must have a name`);const R={name:F,type:$},H=sc($);if(H&&H.length>0){const V={};if(H.forEach(q=>{const P=I.get(`attachedDb_${S}_${q.name}`)?.toString();P&&(V[q.name]=P)}),$==="s3"){if(V.provider==="credential_chain")delete V.accessKeyId,delete V.secretAccessKey,delete V.sessionToken;else if(delete V.chain,!V.accessKeyId||!V.secretAccessKey)throw new Error(`Attached database "${F}" requires an S3 Access Key ID and Secret Access Key, or Credential Provider set to the host credential chain`)}const Y=Qf[$];Y&&(R[Y]=V)}return R});B={name:D,type:_,duckdbConnection:{attachedDatabases:L}}}else{const L={};if(O.forEach(j=>{const S=I.get(j.name)?.toString();S&&(L[j.name]=S)}),_==="postgres"){if(!!!L.connectionString?.trim()){const S=["host","port","databaseName","userName","password"];for(const $ of S)if(!L[$])throw new Error(`${O.find(F=>F.name===$)?.label||$} is required`)}}else if(_==="bigquery"){if(!L.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(_==="snowflake"){if(!L.account)throw new Error("Account is required");if(!L.username)throw new Error("Username is required");if(!L.warehouse)throw new Error("Warehouse is required");if(!L.password&&!L.privateKey)throw new Error("Either password or private key is required")}else if(_==="trino"){if(!L.server)throw new Error("Server is required");if(!L.user)throw new Error("User is required");if(L.server.trim().startsWith("https://")&&!L.password&&!L.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(_==="mysql"){const j=["host","port","database","user","password"];for(const S of j)if(!L[S])throw new Error(`${O.find($=>$.name===S)?.label||S} is required`)}else if(_==="motherduck"){if(!L.accessToken)throw new Error("Access Token is required")}else if(_==="databricks"){if(!L.host)throw new Error("Host is required");if(!L.path)throw new Error("HTTP Path is required");const j=L.oauthClientId&&L.oauthClientSecret;if(!L.token&&!j)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}B={name:D,type:_,[Pu[_]]:L}}await e(B),b()},x=()=>{a([...s,{name:"",dbType:"postgres"}])},C=T=>{a(s.filter((I,D)=>D!==T))},E=(T,I)=>{const D=[...s];D[T]={...D[T],dbType:I},a(D)};return c.jsxs(W.Fragment,{children:[c.jsx(tn,{variant:"contained",color:"primary",startIcon:c.jsx(ys,{}),onClick:m,children:"Add Connection"}),c.jsxs(so,{open:n,onClose:b,children:[c.jsx(To,{children:"Create New Connection"}),c.jsxs(io,{children:[c.jsx(Nl,{children:"Add a new connection to query your data database using Malloy."}),c.jsxs("form",{onSubmit:y,id:"connection-form",children:[c.jsx(vt,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard"}),c.jsx(vt,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:o,select:!0,onChange:T=>i(T.target.value),children:bC.map(T=>c.jsx(un,{value:T,children:T},T))}),o==="ducklake"?c.jsxs(Xt,{sx:{mt:2},children:[c.jsxs(Xt,{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(vt,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:l,select:!0,onChange:T=>u(T.target.value),children:c.jsx(un,{value:"postgres",children:"PostgreSQL"})}),l==="postgres"&&c.jsx(c.Fragment,{children:mo.postgres.map(T=>c.jsx(vt,{margin:"dense",id:`ducklake_pg_${T.name}`,name:`ducklake_pg_${T.name}`,label:T.label,type:T.type,fullWidth:!0,variant:"standard"},`pg_${T.name}`))})]}),c.jsxs(Xt,{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(vt,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:d,select:!0,onChange:T=>f(T.target.value),children:[c.jsx(un,{value:"s3",children:"S3"}),c.jsx(un,{value:"gcs",children:"GCS"})]}),c.jsx(vt,{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"}),pl.filter(T=>T.visibleWhen?h===T.visibleWhen.value:!0).map(T=>c.jsx(vt,{margin:"dense",id:`ducklake_s3_${T.name}`,name:`ducklake_s3_${T.name}`,label:T.label,type:T.selectOptions?void 0:T.type,fullWidth:!0,variant:"standard",required:T.required,select:!!T.selectOptions,defaultValue:T.selectOptions?h:void 0,onChange:T.name==="provider"?I=>p(I.target.value):void 0,placeholder:T.name==="region"?"us-east-1":void 0,children:T.selectOptions?.map(I=>c.jsx(un,{value:I.value,children:I.label},I.value))},`s3_${T.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"}),hl.map(T=>c.jsx(vt,{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},`gcs_${T.name}`))]})]})]}):o==="duckdb"?c.jsxs(Xt,{sx:{mt:2},children:[c.jsxs(Xt,{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(ys,{}),onClick:x,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((T,I)=>{const D=sc(T.dbType);return c.jsxs(Xt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsxs(Xt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsxs(Dt,{variant:"subtitle2",children:["Database ",I+1]}),c.jsx(Ar,{onClick:()=>C(I),size:"small",color:"error",children:c.jsx(gC,{fontSize:"small"})})]}),c.jsx(vt,{margin:"dense",required:!0,id:`attachedDb_${I}_name`,name:`attachedDb_${I}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:T.name}),c.jsx(vt,{margin:"dense",id:`attachedDb_${I}_type`,name:`attachedDb_${I}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:T.dbType,select:!0,onChange:_=>E(I,_.target.value),children:Object.values(Ie.AttachedDatabaseTypeEnum).map(_=>c.jsx(un,{value:_,children:_},_))}),D.filter(_=>_.visibleWhen?(T[_.visibleWhen.field]||D.find(B=>B.name===_.visibleWhen?.field)?.selectOptions?.[0]?.value)===_.visibleWhen.value:!0).map(_=>c.jsx(vt,{margin:"dense",id:`attachedDb_${I}_${_.name}`,name:`attachedDb_${I}_${_.name}`,label:_.label,type:_.selectOptions?void 0:_.type,fullWidth:!0,variant:"standard",required:_.required,select:!!_.selectOptions,defaultValue:_.selectOptions?.[0]?.value,onChange:_.selectOptions?O=>{const B=[...s];B[I]={...B[I],[_.name]:O.target.value},a(B)}:void 0,children:_.selectOptions?.map(O=>c.jsx(un,{value:O.value,children:O.label},O.value))},_.name))]},I)})]}):mo[o].map(T=>c.jsx(vt,{margin:"dense",id:T.name,name:T.name,label:T.label,type:T.type,fullWidth:!0,variant:"standard",required:T.required},T.name))]})]}),c.jsxs(oo,{children:[c.jsx(tn,{disabled:t,onClick:b,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"connection-form",loading:t,children:"Create Connection"})]})]})]})}function _U({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(un,{"aria-label":`Delete connection ${e?.name??""}`.trim(),onClick:d=>{d.stopPropagation(),l()},sx:{color:"error.main"},children:[c.jsx(Sh,{sx:{color:"inherit"},children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(kh,{children:"Delete"})]}),c.jsxs(so,{onClose:u,"aria-labelledby":"customized-dialog-title",open:o,children:[c.jsx(To,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Connection"}),c.jsx(Ar,{"aria-label":"close",onClick:u,sx:d=>({position:"absolute",right:8,top:8,color:d.palette.grey[500]}),children:c.jsx(_r,{})}),c.jsx(io,{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(oo,{children:c.jsx(tn,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(),color:"error",children:"Delete"})}),c.jsx(k.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function fb(e){const t=e.duckdbConnection?.attachedDatabases;return!t||t.length===0?[]:t.map(n=>({name:n.name||"",dbType:n.type||"postgres"}))}function pb(e){const t=e.ducklakeConnection;return t&&t.storage?.gcsConnection?"gcs":"s3"}function BU({connection:e,onSubmit:t,isSubmitting:n,onCloseDialog:r}){const[o,i]=W.useState(!1),[s,a]=W.useState(e.type),[l,u]=W.useState(()=>fb(e)),[d,f]=W.useState("postgres"),[h,p]=W.useState(()=>pb(e)),[m,b]=W.useState(()=>e.ducklakeConnection?.storage?.s3Connection?.provider??"config"),y=()=>{u(fb(e)),a(e.type),b(e.ducklakeConnection?.storage?.s3Connection?.provider??"config"),f("postgres"),p(pb(e)),i(!0)},x=()=>{i(!1),r?.()},C=async O=>{O.preventDefault();const B=new FormData(O.currentTarget),L=B.get("name")?.toString(),j=B.get("type")?.toString(),S=mo[j];if(!L)throw new Error("Name is required");if(!j)throw new Error("Type is required");let $;if(j==="ducklake"){const F={};if(d==="postgres"){const V=mo.postgres,Y={};if(V.forEach(q=>{const P=B.get(`ducklake_pg_${q.name}`)?.toString();P&&(Y[q.name]=P)}),Object.keys(Y).length===0)throw new Error("DuckLake requires catalog connection");F.postgresConnection=Y}const R=B.get("ducklake_bucketUrl")?.toString();if(!R)throw new Error("DuckLake requires a bucket URL");const H={bucketUrl:R};if(h==="s3"){const V={};pl.forEach(q=>{const P=B.get(`ducklake_s3_${q.name}`)?.toString();P&&(V[q.name]=P)});const Y=e.ducklakeConnection?.storage?.s3Connection;if(Y&&(!V.provider&&Y.provider&&(V.provider=Y.provider),!V.chain&&Y.chain&&(V.chain=Y.chain),!V.accessKeyId&&Y.accessKeyId&&(V.accessKeyId=Y.accessKeyId),!V.secretAccessKey&&Y.secretAccessKey&&(V.secretAccessKey=Y.secretAccessKey)),V.provider==="credential_chain")delete V.accessKeyId,delete V.secretAccessKey,delete V.sessionToken;else{if(delete V.chain,!V.accessKeyId)throw new Error("S3 Access Key ID is required");if(!V.secretAccessKey)throw new Error("S3 Secret Access Key is required")}Object.keys(V).length>0&&(H.s3Connection=V)}else if(h==="gcs"){const V={};hl.forEach(q=>{const P=B.get(`ducklake_gcs_${q.name}`)?.toString();P&&(V[q.name]=P)});const Y=e.ducklakeConnection?.storage?.gcsConnection;if(Y&&(!V.keyId&&Y.keyId&&(V.keyId=Y.keyId),!V.secret&&Y.secret&&(V.secret=Y.secret)),!V.keyId)throw new Error("GCS Key ID is required");if(!V.secret)throw new Error("GCS Secret is required");Object.keys(V).length>0&&(H.gcsConnection=V)}$={name:L,type:j,ducklakeConnection:{catalog:F,storage:H}}}else if(j==="duckdb"){if(l.length===0)throw new Error("DuckDB connection must have at least one attached database");const F=l.map((R,H)=>{const V=R.dbType,Y=B.get(`attachedDb_${H}_name`)?.toString();if(!Y)throw new Error(`Attached database at index ${H} must have a name`);const q={name:Y,type:V},P=sc(V);if(P&&P.length>0){const J={};if(P.forEach(z=>{const ye=B.get(`attachedDb_${H}_${z.name}`)?.toString();ye&&(J[z.name]=ye)}),V==="s3"){if(J.provider==="credential_chain")delete J.accessKeyId,delete J.secretAccessKey,delete J.sessionToken;else if(delete J.chain,!J.accessKeyId||!J.secretAccessKey)throw new Error(`Attached database "${Y}" requires an S3 Access Key ID and Secret Access Key, or Credential Provider set to the host credential chain`)}const re=Qf[V];re&&(q[re]=J)}return q});$={name:L,type:j,duckdbConnection:{attachedDatabases:F}}}else{const F=e[Pu[j]]||{},R={};if(S.forEach(H=>{const V=B.get(H.name)?.toString(),Y=F[H.name],q=H.type==="password"||H.name==="password"||H.name==="secretAccessKey"||H.name==="secret"||H.name==="accessToken"||H.name==="privateKey";V?R[H.name]=V:q&&Y?R[H.name]=Y:V!==void 0?R[H.name]=V:Y&&(R[H.name]=Y)}),j==="postgres"){if(!!!R.connectionString?.trim()){const V=["host","port","databaseName","userName","password"];for(const Y of V)if(!R[Y])throw new Error(`${S.find(q=>q.name===Y)?.label||Y} is required`)}}else if(j==="bigquery"){if(!R.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(j==="snowflake"){if(!R.account)throw new Error("Account is required");if(!R.username)throw new Error("Username is required");if(!R.warehouse)throw new Error("Warehouse is required");if(!R.password&&!R.privateKey)throw new Error("Either password or private key is required")}else if(j==="trino"){if(!R.server)throw new Error("Server is required");if(!R.user)throw new Error("User is required");if(R.server.trim().startsWith("https://")&&!R.password&&!R.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(j==="mysql"){const H=["host","port","database","user","password"];for(const V of H)if(!R[V])throw new Error(`${S.find(Y=>Y.name===V)?.label||V} is required`)}else if(j==="motherduck"){if(!R.accessToken)throw new Error("Access Token is required")}else if(j==="databricks"){if(!R.host)throw new Error("Host is required");if(!R.path)throw new Error("HTTP Path is required");const H=R.oauthClientId&&R.oauthClientSecret;if(!R.token&&!H)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}$={name:L,type:j,[Pu[j]]:R}}await t($),x()},E=()=>{u([...l,{name:"",dbType:"postgres"}])},T=O=>{u(l.filter((B,L)=>L!==O))},I=(O,B)=>{const L=[...l];L[O]={...L[O],dbType:B},u(L)},D=(O,B)=>{const L=e.duckdbConnection?.attachedDatabases;if(!L||!L[O])return"";const j=L[O],S=Qf[j.type||""];return S&&j[S]?j[S][B]??"":""},_=O=>{const B=e.ducklakeConnection;if(!B)return"";if(O.startsWith("pg_")){const L=O.replace("pg_","");return B.catalog?.postgresConnection?.[L]??""}if(O==="bucketUrl")return B.storage?.bucketUrl??"";if(O.startsWith("s3_")){const L=O.replace("s3_","");return B.storage?.s3Connection?.[L]??""}if(O.startsWith("gcs_")){const L=O.replace("gcs_","");return B.storage?.gcsConnection?.[L]??""}return""};return c.jsxs(W.Fragment,{children:[c.jsxs(un,{"aria-label":`Edit connection ${e?.name??""}`.trim(),onClick:O=>{O.preventDefault(),O.stopPropagation(),y()},children:[c.jsx(Sh,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(kh,{children:"Edit"})]}),c.jsxs(so,{open:o,onClose:x,children:[c.jsx(To,{onClick:O=>{O.stopPropagation()},children:"Edit Connection"}),c.jsxs(io,{onClick:O=>{O.stopPropagation()},children:[c.jsx(Nl,{children:"Edit a connection to query your data database using Malloy."}),c.jsxs("form",{onSubmit:C,id:"connection-form",children:[c.jsx(vt,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),c.jsx(vt,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:s,select:!0,onChange:O=>a(O.target.value),children:bC.map(O=>c.jsx(un,{value:O,children:O},O))}),s==="ducklake"?c.jsxs(Xt,{sx:{mt:2},children:[c.jsxs(Xt,{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(vt,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:d,select:!0,onChange:O=>f(O.target.value),children:c.jsx(un,{value:"postgres",children:"PostgreSQL"})}),d==="postgres"&&c.jsx(c.Fragment,{children:mo.postgres.map(O=>c.jsx(vt,{margin:"dense",id:`ducklake_pg_${O.name}`,name:`ducklake_pg_${O.name}`,label:O.label,type:O.type,fullWidth:!0,variant:"standard",defaultValue:_(`pg_${O.name}`)},`pg_${O.name}`))})]}),c.jsxs(Xt,{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(vt,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:h,select:!0,onChange:O=>p(O.target.value),children:[c.jsx(un,{value:"s3",children:"S3"}),c.jsx(un,{value:"gcs",children:"GCS"})]}),c.jsx(vt,{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:_("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"}),pl.filter(O=>O.visibleWhen?m===O.visibleWhen.value:!0).map(O=>c.jsx(vt,{margin:"dense",id:`ducklake_s3_${O.name}`,name:`ducklake_s3_${O.name}`,label:O.label,type:O.selectOptions?void 0:O.type,fullWidth:!0,variant:"standard",required:O.required&&O.name!=="secretAccessKey",select:!!O.selectOptions,defaultValue:O.selectOptions?m:_(`s3_${O.name}`),onChange:O.name==="provider"?B=>b(B.target.value):void 0,placeholder:O.name==="region"?"us-east-1":O.name==="secretAccessKey"?"Leave empty to keep existing":void 0,children:O.selectOptions?.map(B=>c.jsx(un,{value:B.value,children:B.label},B.value))},`s3_${O.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"}),hl.map(O=>c.jsx(vt,{margin:"dense",id:`ducklake_gcs_${O.name}`,name:`ducklake_gcs_${O.name}`,label:O.label,type:O.type,fullWidth:!0,variant:"standard",required:O.required&&O.name!=="secret",defaultValue:_(`gcs_${O.name}`),placeholder:O.name==="secret"?"Leave empty to keep existing":void 0},`gcs_${O.name}`))]})]})]}):s==="duckdb"?c.jsxs(Xt,{sx:{mt:2},children:[c.jsxs(Xt,{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(ys,{}),onClick:E,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((O,B)=>{const L=sc(O.dbType);return c.jsxs(Xt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[c.jsxs(Xt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[c.jsxs(Dt,{variant:"subtitle2",children:["Database ",B+1]}),c.jsx(Ar,{"aria-label":`Remove attached database ${B+1}`,onClick:()=>T(B),size:"small",color:"error",children:c.jsx(gC,{fontSize:"small"})})]}),c.jsx(vt,{margin:"dense",required:!0,id:`attachedDb_${B}_name`,name:`attachedDb_${B}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:O.name}),c.jsx(vt,{margin:"dense",id:`attachedDb_${B}_type`,name:`attachedDb_${B}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:O.dbType,select:!0,onChange:j=>I(B,j.target.value),children:Object.values(Ie.AttachedDatabaseTypeEnum).map(j=>c.jsx(un,{value:j,children:j},j))}),L.filter(j=>j.visibleWhen?(O[j.visibleWhen.field]||D(B,j.visibleWhen.field)||L.find($=>$.name===j.visibleWhen?.field)?.selectOptions?.[0]?.value)===j.visibleWhen.value:!0).map(j=>c.jsx(vt,{margin:"dense",id:`attachedDb_${B}_${j.name}`,name:`attachedDb_${B}_${j.name}`,label:j.label,type:j.selectOptions?void 0:j.type,fullWidth:!0,variant:"standard",required:j.required,select:!!j.selectOptions,defaultValue:D(B,j.name)||j.selectOptions?.[0]?.value,onChange:j.selectOptions?S=>{const $=[...l];$[B]={...$[B],[j.name]:S.target.value},u($)}:void 0,children:j.selectOptions?.map(S=>c.jsx(un,{value:S.value,children:S.label},S.value))},j.name))]},B)})]}):mo[s].map(O=>{const B=e?.[Pu[s]??""]?.[O.name??""]??"",L=O.type==="password"||O.name==="password"||O.name==="secretAccessKey"||O.name==="secret"||O.name==="accessToken"||O.name==="privateKey";return c.jsx(vt,{margin:"dense",id:O.name,name:O.name,label:O.label,type:O.type,fullWidth:!0,variant:"standard",required:O.required&&!L&&!B,defaultValue:B,placeholder:L&&B?"Leave empty to keep existing":void 0},O.name)})]})]}),c.jsxs(oo,{onClick:O=>{O.stopPropagation()},children:[c.jsx(tn,{disabled:n,onClick:x,children:"Cancel"}),c.jsx(tn,{type:"submit",form:"connection-form",loading:n,children:"Edit Connection"})]})]})]})}function hb(e,t){return!e||e.type!=="duckdb"?!1:(e.duckdbConnection?.attachedDatabases||[]).some(r=>r.type==="azure"&&r.name===t)}function jU(e){return e.startsWith("gs://")||e.startsWith("s3://")||e.startsWith("https://")||e.startsWith("abfss://")||e.startsWith("az://")}function yC({connectionName:e,resourceUri:t,schema:n,connection:r}){const{apiClients:o}=Ie.useServer(),{environmentName:i}=jt(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}=zt({queryKey:["schemas",i,e],queryFn:()=>o.connections.listSchemas(i,e)}),y=h?.data||[];return c.jsxs(k.Grid,{container:!0,spacing:1,children:[!n&&c.jsx(k.Grid,{size:{xs:12,md:4},children:c.jsxs(k.Paper,{sx:{p:1,m:0},children:[c.jsxs(k.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[c.jsx(k.Typography,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),c.jsx(k.FormControlLabel,{control:c.jsx(k.Switch,{checked:d,onChange:x=>f(x.target.checked)}),label:"Hidden Schemas"})]}),c.jsx(k.Divider,{sx:{mt:"2px"}}),c.jsxs(k.Box,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[m&&c.jsx(xn,{text:"Loading schemas..."}),p&&c.jsx(vn,{error:b,context:`${i} > ${e} > Schemas`}),!m&&!p&&y.length===0&&c.jsx(k.Typography,{variant:"body2",children:"No Schemas"}),!m&&!p&&y.length>0&&c.jsx(k.List,{dense:!0,disablePadding:!0,children:y.map(x=>{const C=x.name;if(x.isHidden&&!d)return null;const T=l===C;return c.jsx(k.ListItemButton,{selected:T,onClick:()=>{u(C),a(null)},children:c.jsx(k.ListItemText,{primary:C})},C)})})]})]})}),c.jsx(k.Grid,{size:{xs:12,md:n?6:4},children:l&&c.jsx(k.Paper,{sx:{p:1,m:0},children:c.jsx(zU,{connectionName:e,schemaName:l,onTableSelect:x=>{a(x)},resourceUri:t,connection:r})})}),c.jsx(k.Grid,{size:{xs:12,md:n?6:4},children:l&&s&&c.jsx($U,{environmentName:i,connectionName:e,schemaName:l,tableResource:s})})]})}function $U({environmentName:e,connectionName:t,schemaName:n,tableResource:r}){const{apiClients:o}=Ie.useServer(),{data:i,isLoading:s,isError:a,error:l}=zt({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(k.Paper,{sx:{p:1,m:0},children:[a&&c.jsx(vn,{error:l,context:`${e} > ${t} > ${n} > ${r}`}),!a&&c.jsx(HU,{table:u,loading:s})]})}function HU({table:e,loading:t}){return t?c.jsx(xn,{text:"Loading columns..."}):c.jsxs(c.Fragment,{children:[c.jsxs(k.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(k.Divider,{}),c.jsx(k.Box,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:c.jsx(k.TableContainer,{children:c.jsxs(k.Table,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[c.jsx(k.TableHead,{children:c.jsxs(k.TableRow,{children:[c.jsx(k.TableCell,{children:"NAME"}),c.jsx(k.TableCell,{children:"TYPE"})]})}),c.jsx(k.TableBody,{children:e.columns?.sort((n,r)=>n.name.localeCompare(r.name))?.map(n=>c.jsxs(k.TableRow,{children:[c.jsx(k.TableCell,{children:n.name}),c.jsx(k.TableCell,{children:n.type})]},n.name))})]})})})]})}function zU({connectionName:e,schemaName:t,onTableSelect:n,resourceUri:r,connection:o}){const{environmentName:i}=jt(r),{apiClients:s}=Ie.useServer(),[a,l]=W.useState(""),{data:u,isSuccess:d,isError:f,error:h,isLoading:p}=zt({queryKey:["tablesInSchema",i,e,t],queryFn:()=>s.connections.listTables(i,e,t)}),m=hb(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(k.Typography,{variant:"overline",fontWeight:"bold",children:jU(t)||hb(o,t)?`Files in ${t}`:`Tables in ${t}`}),c.jsx(k.Divider,{}),c.jsx(k.Box,{sx:{mt:1,mb:1},children:c.jsx(k.TextField,{size:"small",fullWidth:!0,placeholder:"Search tables...",value:a,onChange:x=>l(x.target.value),variant:"outlined"})}),c.jsx(k.Divider,{}),c.jsxs(k.Box,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[p&&c.jsx(xn,{text:"Fetching Tables..."}),f&&c.jsx(vn,{error:h,context:`${i} > ${e} > ${t}`}),d&&y.length===0&&c.jsx(k.Typography,{variant:"body2",children:"No Tables"}),d&&u?.data&&u.data.length>0&&c.jsx(k.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(k.ListItemButton,{onClick:()=>n(x.resource),children:c.jsx(k.ListItemText,{primary:C,secondary:x.columns.length>0?`${x.columns.length} columns`:void 0})},x.resource)})})]})]})}const UU={bigquery:"BigQuery",snowflake:"Snowflake",postgres:"PostgreSQL",mysql:"MySQL",trino:"Trino",databricks:"Databricks",duckdb:"DuckDB",ducklake:"DuckLake",s3:"S3",gcs:"GCS",azure:"Azure"};function VU(e){return e?UU[e]??e:""}function WU({resourceUri:e}){const{apiClients:t,mutable:n}=Ie.useServer(),r=Tr.useQueryClient(),{environmentName:o}=jt(e),[i,s]=W.useState(""),[a,l]=W.useState(null),u=Il({environmentName:o,connectionName:a}),{data:d,isSuccess:f,isError:h,error:p}=zt({queryKey:["connections",o],queryFn:()=>t.connections.listConnections(o)}),m=()=>{l(null)},b=Sn({mutationFn:T=>t.environments.updateEnvironment(o,{name:o,connections:[...d.data,T]}),onSuccess(){s("Connection added successfully"),r.invalidateQueries({queryKey:["connections",o]})},onError(T){s(T.message)}}),y=Sn({mutationFn:T=>t.environments.updateEnvironment(o,{name:o,connections:d.data.map(I=>I.name===T.name?T:I)}),onSuccess(T,I){s(`Connection ${I.name} updated successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(T){s(T.message)}}),x=Sn({mutationFn:T=>{if(!T.name)throw new Error("Cannot delete a connection with no name");return t.connections.deleteConnection(o,T.name)},onSuccess(T,I){s(`Connection ${I.name} deleted successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(T){s(T.message)}}),C=f?[...d.data].sort((T,I)=>(T.name??"").localeCompare(I.name??"")):[],E=b.isPending||y.isPending||x.isPending;return c.jsxs(k.Box,{children:[c.jsxs(k.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[c.jsxs(k.Box,{children:[c.jsx(k.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Connections"}),c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"Database connections available to packages in this environment"})]}),n&&f&&c.jsx(LU,{onSubmit:T=>b.mutateAsync(T),isSubmitting:b.isPending})]}),!f&&!h&&c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"Fetching Connections..."}),h&&c.jsx(vn,{error:p,context:`${o} > Connections`}),f&&C.length===0&&c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"No connections yet."}),f&&C.length>0&&c.jsx(k.Grid,{container:!0,spacing:2,children:C.map(T=>c.jsx(k.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(qU,{connection:T,mutable:n,isMutating:E,onOpenExplorer:()=>l(T.name??null),onEdit:I=>y.mutateAsync(I),onDelete:I=>x.mutateAsync(I)})},T.name))}),c.jsx(k.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i}),c.jsxs(k.Dialog,{open:a!==null,onClose:m,maxWidth:"lg",fullWidth:!0,children:[c.jsxs(k.DialogTitle,{children:["Connection Explorer: ",a,c.jsx(k.IconButton,{"aria-label":"close",onClick:m,sx:{position:"absolute",right:8,top:8},children:c.jsx(k.Box,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),c.jsx(k.DialogContent,{children:a&&c.jsx(yC,{resourceUri:u,connectionName:a,connection:d?.data?.find(T=>T.name===a)})})]})]})}function qU({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(k.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(k.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(k.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(k.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(AU,{sx:{fontSize:20}})}),c.jsxs(k.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(k.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(k.Typography,{variant:"body2",color:"text.secondary",noWrap:!0,children:VU(e.type)})]}),t&&c.jsxs(c.Fragment,{children:[c.jsx(k.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(k.Menu,{anchorEl:s,open:l,onClose:d,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(BU,{connection:e,onSubmit:o,isSubmitting:n,onCloseDialog:d}),c.jsx(_U,{connection:e,onCloseDialog:d,isMutating:n,onDelete:()=>i(e)})]})]})]})})})}const YU=gt([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 KU({resourceUri:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=Ie.useServer(),i=Tr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},{environmentName:d,packageName:f}=jt(e),h=Sn({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(k.MenuItem,{onClick:l,children:[c.jsx(k.ListItemIcon,{children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(k.ListItemText,{children:"Delete"})]}),c.jsxs(so,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[c.jsx(To,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Package"}),c.jsx(Ar,{"aria-label":"close",onClick:u,sx:p=>({position:"absolute",right:8,top:8,color:p.palette.grey[500]}),children:c.jsx(_r,{})}),c.jsx(io,{dividers:!0,children:c.jsxs(Dt,{gutterBottom:!0,children:['Are you sure you want to delete "',f,'"? This action cannot be undone.']})}),c.jsxs(oo,{children:[c.jsx(tn,{variant:"outlined",onClick:u,style:{borderColor:Ie.MALLOY_BRAND.teal,color:Ie.MALLOY_BRAND.teal},children:"Cancel"}),c.jsx(tn,{variant:"contained",autoFocus:!0,onClick:()=>h.mutate(),color:"error",loading:h.isPending,children:"Delete"})]}),c.jsx(k.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function GU({package:e,resourceUri:t,onCloseDialog:n}){const[r,o]=W.useState(!1),{apiClients:i}=Ie.useServer(),s=Tr.useQueryClient(),[a,l]=W.useState(""),u=()=>{o(!0)},d=()=>{o(!1),n()},{packageName:f,environmentName:h}=jt(t),p=Sn({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(k.MenuItem,{onClick:u,children:[c.jsx(k.ListItemIcon,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(k.ListItemText,{children:"Edit"})]}),c.jsxs(so,{open:r,onClose:d,children:[c.jsx(To,{children:"Edit Package"}),c.jsxs(io,{children:[c.jsxs(Nl,{children:['Update the details for "',e.name,'".']}),c.jsxs("form",{onSubmit:m,id:"package-form",children:[c.jsx(vt,{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(vt,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,defaultValue:e.description,variant:"standard"})]})]}),c.jsxs(oo,{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(k.Snackbar,{open:a!=="",autoHideDuration:6e3,onClose:()=>l(""),message:a})]})}function xC({onSelectPackage:e,resourceUri:t}){const{apiClients:n}=Ie.useServer(),{environmentName:r}=jt(t),{data:o,isSuccess:i,isError:s,error:a}=zt({queryKey:["packages",r],queryFn:()=>n.packages.listPackages(r)});if(s)return c.jsx(vn,{error:a,context:`${r} > Packages`});if(!i)return c.jsx(xn,{text:"Fetching Packages..."});const l=[...o.data].sort((u,d)=>u.name.localeCompare(d.name));return c.jsx(k.Grid,{container:!0,spacing:2,children:l.map(u=>{const d=Il({environmentName:r,packageName:u.name});return c.jsx(k.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(QU,{pkg:u,packageResourceUri:d,onSelectPackage:e})},u.name)})})}function QU({pkg:e,packageResourceUri:t,onSelectPackage:n}){const{mutable:r}=Ie.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(k.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(k.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(k.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(k.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(YU,{sx:{fontSize:20}})}),c.jsxs(k.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(k.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(k.Tooltip,{title:d,followCursor:!0,enterDelay:1e3,children:c.jsx(k.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(k.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(k.Menu,{anchorEl:o,open:s,onClose:u,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(GU,{package:e,resourceUri:t,onCloseDialog:u}),c.jsx(KU,{resourceUri:t,onCloseDialog:u})]})]})]})})})}function XU({onSelectPackage:e,resourceUri:t}){const{mutable:n}=Ie.useServer(),{environmentName:r}=jt(t);return W.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"})},[]),c.jsxs(k.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:4,py:3},children:[c.jsxs(k.Box,{sx:{mb:5},children:[c.jsx(k.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:r}),c.jsx(k.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(k.Box,{sx:{mb:5},children:[c.jsxs(k.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[c.jsxs(k.Box,{children:[c.jsx(k.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Packages"}),c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"Published packages available for use in this environment"})]}),n&&c.jsx(IU,{resourceUri:t})]}),c.jsx(xC,{onSelectPackage:e,resourceUri:t})]}),c.jsx(k.Box,{sx:{mb:5},children:c.jsx(WU,{resourceUri:t})}),c.jsx(k.Box,{sx:{mb:5},children:c.jsx(hC,{resourceUri:t,onClickPackageFile:e})}),c.jsx(DU,{resourceUri:t})]})}function mb({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 gb(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function ZU(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=gb(d));const f=d?a.filter(h=>{let p=(i||u)(h);return n&&(p=p.toLowerCase()),t&&(p=gb(p)),o==="start"?p.startsWith(d):p.includes(d)}):a;return typeof r=="number"?f.slice(0,r):f}}const JU=ZU(),bb=5,eV=e=>e.current!==null&&e.current.parentElement?.contains(document.activeElement),tV=[];function yb(e,t,n,r){if(t||e==null||r)return"";const o=n(e);return typeof o=="string"?o:""}function nV(e){const{unstable_isActiveElementInListbox:t=eV,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?tV:null,disableClearable:f=!1,disableCloseOnSelect:h=!1,disabled:p,disabledItemsFocusable:m=!1,disableListWrap:b=!1,filterOptions:y=JU,filterSelectedOptions:x=!1,freeSolo:C=!1,getOptionDisabled:E,getOptionKey:T,getOptionLabel:I=De=>De.label??De,groupBy:D,handleHomeEndKeys:_=!e.freeSolo,id:O,includeInputInList:B=!1,inputValue:L,isOptionEqualToValue:j=(De,ke)=>De===ke,multiple:S=!1,onChange:$,onClose:F,onHighlightChange:R,onInputChange:H,onOpen:V,open:Y,openOnFocus:q=!1,options:P,readOnly:J=!1,renderValue:re,selectOnFocus:z=!e.freeSolo,value:ye}=e,se=Br(O);let G=I;G=De=>{const ke=I(De);return typeof ke!="string"?String(ke):ke};const le=M.useRef(!1),oe=M.useRef(!0),ue=M.useRef(null),ie=M.useRef(null),[Z,de]=M.useState(null),[ae,ne]=M.useState(-1),Ce=o?0:-1,ve=M.useRef(Ce),Se=M.useRef(yb(d??ye,S,G)).current,[he,$e]=or({controlled:ye,default:d,name:u}),[Pe,Je]=or({controlled:L,default:Se,name:u,state:"inputValue"}),[Me,Nt]=M.useState(!1),ct=M.useCallback((De,ke,Ye)=>{if(!(S?he.length<ke.length:ke!==null)&&!a)return;const je=yb(ke,S,G,re);Pe!==je&&(Je(je),H&&H(De,je,Ye))},[G,Pe,S,H,Je,a,he,re]),[tt,xe]=or({controlled:Y,default:!1,name:u,state:"open"}),[Oe,We]=M.useState(!0),Xe=!S&&he!=null&&Pe===G(he),Ze=tt&&!J,Fe=Ze?y(P.filter(De=>!(x&&(S?he:[he]).some(ke=>ke!==null&&j(De,ke)))),{inputValue:Xe&&Oe?"":Pe,getOptionLabel:G}):[],dt=VF({filteredOptions:Fe,value:he,inputValue:Pe});M.useEffect(()=>{const De=he!==dt.value;Me&&!De||C&&!De||ct(null,he,"reset")},[he,ct,Me,dt.value,C]);const lt=tt&&Fe.length>0&&!J,Mt=Ve(De=>{if(De===-1)ue.current.focus();else{const ke=re?"data-item-index":"data-tag-index";Z.querySelector(`[${ke}="${De}"]`).focus()}});M.useEffect(()=>{S&&ae>he.length-1&&(ne(-1),Mt(-1))},[he,S,ae,Mt]);function be(De,ke){if(!ie.current||De<0||De>=Fe.length)return-1;let Ye=De;for(;;){const ot=ie.current.querySelector(`[data-option-index="${Ye}"]`),je=m?!1:!ot||ot.disabled||ot.getAttribute("aria-disabled")==="true";if(ot&&ot.hasAttribute("tabindex")&&!je)return Ye;if(ke==="next"?Ye=(Ye+1)%Fe.length:Ye=(Ye-1+Fe.length)%Fe.length,Ye===De)return-1}}const Ae=Ve(({event:De,index:ke,reason:Ye})=>{if(ve.current=ke,ke===-1?ue.current.removeAttribute("aria-activedescendant"):ue.current.setAttribute("aria-activedescendant",`${se}-option-${ke}`),R&&["mouse","keyboard","touch"].includes(Ye)&&R(De,ke===-1?null:Fe[ke],Ye),!ie.current)return;const ot=ie.current.querySelector(`[role="option"].${n}-focused`);ot&&(ot.classList.remove(`${n}-focused`),ot.classList.remove(`${n}-focusVisible`));let je=ie.current;if(ie.current.getAttribute("role")!=="listbox"&&(je=ie.current.parentElement.querySelector('[role="listbox"]')),!je)return;if(ke===-1){je.scrollTop=0;return}const Ut=ie.current.querySelector(`[data-option-index="${ke}"]`);if(Ut&&(Ut.classList.add(`${n}-focused`),Ye==="keyboard"&&Ut.classList.add(`${n}-focusVisible`),je.scrollHeight>je.clientHeight&&Ye!=="mouse"&&Ye!=="touch")){const qt=Ut,Qn=je.clientHeight+je.scrollTop,Pi=qt.offsetTop+qt.offsetHeight;Pi>Qn?je.scrollTop=Pi-je.clientHeight:qt.offsetTop-qt.offsetHeight*(D?1.3:0)<je.scrollTop&&(je.scrollTop=qt.offsetTop-qt.offsetHeight*(D?1.3:0))}}),Re=Ve(({event:De,diff:ke,direction:Ye="next",reason:ot})=>{if(!Ze)return;const Ut=be((()=>{const qt=Fe.length-1;if(ke==="reset")return Ce;if(ke==="start")return 0;if(ke==="end")return qt;const Qn=ve.current+ke;return Qn<0?Qn===-1&&B?-1:b&&ve.current!==-1||Math.abs(ke)>1?0:qt:Qn>qt?Qn===qt+1&&B?-1:b||Math.abs(ke)>1?qt:0:Qn})(),Ye);if(Ae({index:Ut,reason:ot,event:De}),r&&ke!=="reset")if(Ut===-1)ue.current.value=Pe;else{const qt=G(Fe[Ut]);ue.current.value=qt,qt.toLowerCase().indexOf(Pe.toLowerCase())===0&&Pe.length>0&&ue.current.setSelectionRange(Pe.length,qt.length)}}),Qe=!mb({array1:dt.filteredOptions,array2:Fe,parser:G}),st=()=>{const De=(ke,Ye)=>{const ot=ke?G(ke):"",je=Ye?G(Ye):"";return ot===je};if(ve.current!==-1&&!mb({array1:dt.filteredOptions,array2:Fe,parser:G})&&dt.inputValue===Pe&&(S?he.length===dt.value.length&&dt.value.every((ke,Ye)=>G(he[Ye])===G(ke)):De(dt.value,he))){const ke=dt.filteredOptions[ve.current];if(ke)return Fe.findIndex(Ye=>G(Ye)===G(ke))}return-1},Lt=M.useCallback(()=>{if(!Ze)return;const De=st();if(De!==-1){ve.current=De;return}const ke=S?he[0]:he;if(Fe.length===0||ke==null){Re({diff:"reset"});return}if(ie.current){if(ke!=null){const Ye=Fe[ve.current];if(S&&Ye&&he.findIndex(je=>j(Ye,je))!==-1)return;const ot=Fe.findIndex(je=>j(je,ke));ot===-1?Re({diff:"reset"}):Ae({index:ot});return}if(ve.current>=Fe.length-1){Ae({index:Fe.length-1});return}Ae({index:ve.current})}},[Fe.length,S?!1:he,x,Re,Ae,Ze,Pe,S]),Qt=Ve(De=>{cf(ie,De),De&&Lt()});M.useEffect(()=>{Qe&&Lt()},[Lt,Qe]);const yt=De=>{tt||(xe(!0),We(!0),V&&V(De))},sn=(De,ke)=>{tt&&(xe(!1),F&&F(De,ke))},Rn=(De,ke,Ye,ot)=>{if(S){if(he.length===ke.length&&he.every((je,Ut)=>je===ke[Ut]))return}else if(he===ke)return;$&&$(De,ke,Ye,ot),$e(ke)},$t=M.useRef(!1),bn=(De,ke,Ye="selectOption",ot="options")=>{let je=Ye,Ut=ke;if(S){Ut=Array.isArray(he)?he.slice():[];const qt=Ut.findIndex(Qn=>j(ke,Qn));qt===-1?Ut.push(ke):ot!=="freeSolo"&&(Ut.splice(qt,1),je="removeOption")}ct(De,Ut,je),Rn(De,Ut,je,{option:ke}),!h&&(!De||!De.ctrlKey&&!De.metaKey)&&sn(De,je),(s===!0||s==="touch"&&$t.current||s==="mouse"&&!$t.current)&&ue.current.blur()};function lr(De,ke){if(De===-1)return-1;let Ye=De;for(;;){if(ke==="next"&&Ye===he.length||ke==="previous"&&Ye===-1)return-1;const ot=re?"data-item-index":"data-tag-index",je=Z.querySelector(`[${ot}="${Ye}"]`);if(!je||!je.hasAttribute("tabindex")||je.disabled||je.getAttribute("aria-disabled")==="true")Ye+=ke==="next"?1:-1;else return Ye}}const Nn=(De,ke)=>{if(!S)return;Pe===""&&sn(De,"toggleInput");let Ye=ae;ae===-1?Pe===""&&ke==="previous"&&(Ye=he.length-1):(Ye+=ke==="next"?1:-1,Ye<0&&(Ye=0),Ye===he.length&&(Ye=-1)),Ye=lr(Ye,ke),ne(Ye),Mt(Ye)},$r=De=>{le.current=!0,Je(""),H&&H(De,"","clear"),Rn(De,S?[]:null,"clear")},Hn=De=>ke=>{if(De.onKeyDown&&De.onKeyDown(ke),!ke.defaultMuiPrevented&&(ae!==-1&&!["ArrowLeft","ArrowRight"].includes(ke.key)&&(ne(-1),Mt(-1)),ke.which!==229))switch(ke.key){case"Home":Ze&&_&&(ke.preventDefault(),Re({diff:"start",direction:"next",reason:"keyboard",event:ke}));break;case"End":Ze&&_&&(ke.preventDefault(),Re({diff:"end",direction:"previous",reason:"keyboard",event:ke}));break;case"PageUp":ke.preventDefault(),Re({diff:-bb,direction:"previous",reason:"keyboard",event:ke}),yt(ke);break;case"PageDown":ke.preventDefault(),Re({diff:bb,direction:"next",reason:"keyboard",event:ke}),yt(ke);break;case"ArrowDown":ke.preventDefault(),Re({diff:1,direction:"next",reason:"keyboard",event:ke}),yt(ke);break;case"ArrowUp":ke.preventDefault(),Re({diff:-1,direction:"previous",reason:"keyboard",event:ke}),yt(ke);break;case"ArrowLeft":!S&&re?Mt(0):Nn(ke,"previous");break;case"ArrowRight":!S&&re?Mt(-1):Nn(ke,"next");break;case"Enter":if(ve.current!==-1&&Ze){const Ye=Fe[ve.current],ot=E?E(Ye):!1;if(ke.preventDefault(),ot)return;bn(ke,Ye,"selectOption"),r&&ue.current.setSelectionRange(ue.current.value.length,ue.current.value.length)}else C&&Pe!==""&&Xe===!1&&(S&&ke.preventDefault(),bn(ke,Pe,"createOption","freeSolo"));break;case"Escape":Ze?(ke.preventDefault(),ke.stopPropagation(),sn(ke,"escape")):l&&(Pe!==""||S&&he.length>0||re)&&(ke.preventDefault(),ke.stopPropagation(),$r(ke));break;case"Backspace":if(S&&!J&&Pe===""&&he.length>0){const Ye=ae===-1?he.length-1:ae,ot=he.slice();ot.splice(Ye,1),Rn(ke,ot,"removeOption",{option:he[Ye]})}!S&&re&&!J&&($e(null),Mt(-1));break;case"Delete":if(S&&!J&&Pe===""&&he.length>0&&ae!==-1){const Ye=ae,ot=he.slice();ot.splice(Ye,1),Rn(ke,ot,"removeOption",{option:he[Ye]})}!S&&re&&!J&&($e(null),Mt(-1));break}},Pt=De=>{Nt(!0),q&&!le.current&&yt(De)},Cn=De=>{if(t(ie)){ue.current.focus();return}Nt(!1),oe.current=!0,le.current=!1,i&&ve.current!==-1&&Ze?bn(De,Fe[ve.current],"blur"):i&&C&&Pe!==""?bn(De,Pe,"blur","freeSolo"):a&&ct(De,he,"blur"),sn(De,"blur")},So=De=>{const ke=De.target.value;Pe!==ke&&(Je(ke),We(!1),H&&H(De,ke,"input")),ke===""?!f&&!S&&Rn(De,null,"clear"):yt(De)},Oi=De=>{const ke=Number(De.currentTarget.getAttribute("data-option-index"));ve.current!==ke&&Ae({event:De,index:ke,reason:"mouse"})},wn=De=>{Ae({event:De,index:Number(De.currentTarget.getAttribute("data-option-index")),reason:"touch"}),$t.current=!0},zo=De=>{const ke=Number(De.currentTarget.getAttribute("data-option-index"));bn(De,Fe[ke],"selectOption"),$t.current=!1},Mi=De=>ke=>{const Ye=he.slice();Ye.splice(De,1),Rn(ke,Ye,"removeOption",{option:he[De]})},ko=De=>{Rn(De,null,"removeOption",{option:he})},nn=De=>{tt?sn(De,"toggleInput"):yt(De)},rn=De=>{De.currentTarget.contains(De.target)&&De.target.getAttribute("id")!==se&&De.preventDefault()},Or=De=>{De.currentTarget.contains(De.target)&&(ue.current.focus(),z&&oe.current&&ue.current.selectionEnd-ue.current.selectionStart===0&&ue.current.select(),oe.current=!1)},Uo=De=>{!p&&(Pe===""||!tt)&&nn(De)};let wo=C&&Pe.length>0;wo=wo||(S?he.length>0:he!==null);let Vo=Fe;return D&&(Vo=Fe.reduce((De,ke,Ye)=>{const ot=D(ke);return De.length>0&&De[De.length-1].group===ot?De[De.length-1].options.push(ke):De.push({key:Ye,index:Ye,group:ot,options:[ke]}),De},[])),p&&Me&&Cn(),{getRootProps:(De={})=>({...De,onKeyDown:Hn(De),onMouseDown:rn,onClick:Or}),getInputLabelProps:()=>({id:`${se}-label`,htmlFor:se}),getInputProps:()=>({id:se,value:Pe,onBlur:Cn,onFocus:Pt,onChange:So,onMouseDown:Uo,"aria-activedescendant":Ze?"":null,"aria-autocomplete":r?"both":"list","aria-controls":lt?`${se}-listbox`:void 0,"aria-expanded":lt,autoComplete:"off",ref:ue,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:p}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:$r}),getItemProps:({index:De=0}={})=>({...S&&{key:De},...re?{"data-item-index":De}:{"data-tag-index":De},tabIndex:-1,...!J&&{onDelete:S?Mi(De):ko}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:nn}),getTagProps:({index:De})=>({key:De,"data-tag-index":De,tabIndex:-1,...!J&&{onDelete:Mi(De)}}),getListboxProps:()=>({role:"listbox",id:`${se}-listbox`,"aria-labelledby":`${se}-label`,ref:Qt,onMouseDown:De=>{De.preventDefault()}}),getOptionProps:({index:De,option:ke})=>{const Ye=(S?he:[he]).some(je=>je!=null&&j(ke,je)),ot=E?E(ke):!1;return{key:T?.(ke)??G(ke),tabIndex:-1,role:"option",id:`${se}-option-${De}`,onMouseMove:Oi,onClick:zo,onTouchStart:wn,"data-option-index":De,"aria-disabled":ot,"aria-selected":Ye}},id:se,inputValue:Pe,value:he,dirty:wo,expanded:Ze&&Z,popupOpen:Ze,focused:Me||ae!==-1,anchorEl:Z,setAnchorEl:de,focusedItem:ae,focusedTag:ae,groupedOptions:Vo}}function rV(e){return Ge("MuiListSubheader",e)}qe("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const oV=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:i}=e,s={root:["root",n!=="default"&&`color${Le(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Ke(s,rV,t)},iV=pe("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${Le(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(pt(({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}}]}))),Xf=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=oV(f);return c.jsx(iV,{as:s,className:Ue(h.root,o),ref:n,ownerState:f,...d})});Xf&&(Xf.muiSkipListHighlight=!0);const sV=gt(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 aV(e){return Ge("MuiAutocomplete",e)}const bt=qe("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 xb,vb;const lV=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${Le(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,aV,t)},uV=pe("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:s,size:a}=n;return[{[`& .${bt.tag}`]:t.tag},{[`& .${bt.tag}`]:t[`tagSize${Le(a)}`]},{[`& .${bt.inputRoot}`]:t.inputRoot},{[`& .${bt.input}`]:t.input},{[`& .${bt.input}`]:s&&t.inputFocused},t.root,r&&t.fullWidth,i&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${bt.focused} .${bt.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${bt.clearIndicator}`]:{visibility:"visible"}},[`& .${bt.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${bt.inputRoot}`]:{[`.${bt.hasPopupIcon}&, .${bt.hasClearIcon}&`]:{paddingRight:30},[`.${bt.hasPopupIcon}.${bt.hasClearIcon}&`]:{paddingRight:56},[`& .${bt.input}`]:{width:0,minWidth:30}},[`& .${Po.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Po.root}.${tr.sizeSmall}`]:{[`& .${Po.input}`]:{padding:"2px 4px 3px 0"}},[`& .${fr.root}`]:{padding:9,[`.${bt.hasPopupIcon}&, .${bt.hasClearIcon}&`]:{paddingRight:39},[`.${bt.hasPopupIcon}.${bt.hasClearIcon}&`]:{paddingRight:65},[`& .${bt.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${bt.endAdornment}`]:{right:9}},[`& .${fr.root}.${tr.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${bt.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${nr.root}`]:{paddingTop:19,paddingLeft:8,[`.${bt.hasPopupIcon}&, .${bt.hasClearIcon}&`]:{paddingRight:39},[`.${bt.hasPopupIcon}.${bt.hasClearIcon}&`]:{paddingRight:65},[`& .${nr.input}`]:{padding:"7px 4px"},[`& .${bt.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,[`& .${bt.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${nr.root}.${tr.hiddenLabel}.${tr.sizeSmall}`]:{[`& .${bt.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${bt.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${bt.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${bt.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${bt.inputRoot}`]:{flexWrap:"wrap"}}}]}),cV=pe("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),dV=pe(Ar,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),fV=pe(Ar,{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)"}}]}),pV=pe(lh,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${bt.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(pt(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),hV=pe(wi,{name:"MuiAutocomplete",slot:"Paper"})(pt(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),mV=pe("div",{name:"MuiAutocomplete",slot:"Loading"})(pt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),gV=pe("div",{name:"MuiAutocomplete",slot:"NoOptions"})(pt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),bV=pe("ul",{name:"MuiAutocomplete",slot:"Listbox"})(pt(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${bt.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"},[`&.${bt.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"},[`&.${bt.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),[`&.${bt.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}},[`&.${bt.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),yV=pe(Xf,{name:"MuiAutocomplete",slot:"GroupLabel"})(pt(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),xV=pe("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${bt.option}`]:{paddingLeft:24}}),Zf=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=xb||(xb=c.jsx(sV,{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:E=!1,disabledItemsFocusable:T=!1,disableListWrap:I=!1,disablePortal:D=!1,filterOptions:_,filterSelectedOptions:O=!1,forcePopupIcon:B="auto",freeSolo:L=!1,fullWidth:j=!1,getLimitTagsText:S=wt=>`+${wt}`,getOptionDisabled:$,getOptionKey:F,getOptionLabel:R,isOptionEqualToValue:H,groupBy:V,handleHomeEndKeys:Y=!r.freeSolo,id:q,includeInputInList:P=!1,inputValue:J,limitTags:re=-1,ListboxComponent:z,ListboxProps:ye,loading:se=!1,loadingText:G="Loading…",multiple:le=!1,noOptionsText:oe="No options",onChange:ue,onClose:ie,onHighlightChange:Z,onInputChange:de,onOpen:ae,open:ne,openOnFocus:Ce=!1,openText:ve="Open",options:Se,PaperComponent:he,PopperComponent:$e,popupIcon:Pe=vb||(vb=c.jsx(Rv,{})),readOnly:Je=!1,renderGroup:Me,renderInput:Nt,renderOption:ct,renderTags:tt,renderValue:xe,selectOnFocus:Oe=!r.freeSolo,size:We="medium",slots:Xe={},slotProps:Ze={},value:Fe,...dt}=r,{getRootProps:lt,getInputProps:Mt,getInputLabelProps:be,getPopupIndicatorProps:Ae,getClearProps:Re,getItemProps:Qe,getListboxProps:st,getOptionProps:Lt,value:Qt,dirty:yt,expanded:sn,id:Rn,popupOpen:$t,focused:bn,focusedItem:lr,anchorEl:Nn,setAnchorEl:$r,inputValue:Hn,groupedOptions:Pt}=nV({...r,componentName:"Autocomplete"}),Cn=!x&&!E&&yt&&!Je,So=(!L||B===!0)&&B!==!1,{onMouseDown:Oi}=Mt(),{ref:wn,...zo}=st(),ko=R||(wt=>wt.label??wt),nn={...r,disablePortal:D,expanded:sn,focused:bn,fullWidth:j,getOptionLabel:ko,hasClearIcon:Cn,hasPopupIcon:So,inputFocused:lr===-1,popupOpen:$t,size:We},rn=lV(nn),Or={slots:{paper:he,popper:$e,...Xe},slotProps:{chip:l,listbox:ye,...b,...Ze}},[Uo,wo]=kt("listbox",{elementType:bV,externalForwardedProps:Or,ownerState:nn,className:rn.listbox,additionalProps:zo,ref:wn}),[Vo,De]=kt("paper",{elementType:wi,externalForwardedProps:Or,ownerState:nn,className:rn.paper}),[ke,Ye]=kt("popper",{elementType:lh,externalForwardedProps:Or,ownerState:nn,className:rn.popper,additionalProps:{disablePortal:D,style:{width:Nn?Nn.clientWidth:null},role:"presentation",anchorEl:Nn,open:$t}});let ot;const je=wt=>({className:rn.tag,disabled:E,...Qe(wt)});if(le?Qt.length>0&&(tt?ot=tt(Qt,je,nn):xe?ot=xe(Qt,je,nn):ot=Qt.map((wt,Hr)=>{const{key:Fn,...ao}=je({index:Hr});return c.jsx(Ev,{label:ko(wt),size:We,...ao,...Or.slotProps.chip},Fn)})):xe&&Qt!=null&&(ot=xe(Qt,je,nn)),re>-1&&Array.isArray(ot)){const wt=ot.length-re;!bn&&wt>0&&(ot=ot.splice(0,re),ot.push(c.jsx("span",{className:rn.tag,children:S(wt)},ot.length)))}const qt=Me||(wt=>c.jsxs("li",{children:[c.jsx(yV,{className:rn.groupLabel,ownerState:nn,component:"div",children:wt.group}),c.jsx(xV,{className:rn.groupUl,ownerState:nn,children:wt.children})]},wt.key)),Pi=ct||((wt,Hr)=>{const{key:Fn,...ao}=wt;return c.jsx("li",{...ao,children:ko(Hr)},Fn)}),$s=(wt,Hr)=>{const Fn=Lt({option:wt,index:Hr});return Pi({...Fn,className:rn.option},wt,{selected:Fn["aria-selected"],index:Hr,inputValue:Hn},nn)},Hs=Or.slotProps.clearIndicator,Ll=Or.slotProps.popupIndicator;return c.jsxs(M.Fragment,{children:[c.jsx(uV,{ref:n,className:Ue(rn.root,u),ownerState:nn,...lt(dt),children:Nt({id:Rn,disabled:E,fullWidth:!0,size:We==="small"?"small":void 0,InputLabelProps:be(),InputProps:{ref:$r,className:rn.inputRoot,startAdornment:ot,onMouseDown:wt=>{wt.target===wt.currentTarget&&Oi(wt)},...(Cn||So)&&{endAdornment:c.jsxs(cV,{className:rn.endAdornment,ownerState:nn,children:[Cn?c.jsx(dV,{...Re(),"aria-label":p,title:p,ownerState:nn,...Hs,className:Ue(rn.clearIndicator,Hs?.className),children:d}):null,So?c.jsx(fV,{...Ae(),disabled:E,"aria-label":$t?m:ve,title:$t?m:ve,ownerState:nn,...Ll,className:Ue(rn.popupIndicator,Ll?.className),children:Pe}):null]})}},inputProps:{className:rn.input,disabled:E,readOnly:Je,...Mt()}})}),Nn?c.jsx(pV,{as:ke,...Ye,children:c.jsxs(hV,{as:Vo,...De,children:[se&&Pt.length===0?c.jsx(mV,{className:rn.loading,ownerState:nn,children:G}):null,Pt.length===0&&!L&&!se?c.jsx(gV,{className:rn.noOptions,ownerState:nn,role:"presentation",onMouseDown:wt=>{wt.preventDefault()},children:oe}):null,Pt.length>0?c.jsx(Uo,{as:z,...wo,children:Pt.map((wt,Hr)=>V?qt({key:wt.key,group:wt.group,children:wt.options.map((Fn,ao)=>$s(Fn,wt.index+ao))}):$s(wt,Hr))}):null]})}):null]})});Ft.extend(Qv);function ef(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 vV(e){return e==="DateMinMax"}function tf(e){return e==="Between"}function CV({spec:e,values:t,selection:n,onChange:r,retrievalFn:o}){const i=()=>n?.matchType?n.matchType:e.defaultMatchType?e.defaultMatchType:e.filterType==="DateMinMax"?"Between":ef(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,E]=W.useState(!1),[T,I]=W.useState(!1),D=W.useRef(null),_=W.useRef(0),[O,B]=W.useState(!1);W.useEffect(()=>{if(e.filterType!=="Retrieval"||!o)return;const P=y.trim();if(P.length<=2){p([]),E(!1);return}return D.current&&clearTimeout(D.current),D.current=setTimeout(async()=>{_.current+=1;const J=_.current;b(!0);try{const re=await o(P,e);J===_.current&&p(re)}catch(re){J===_.current&&(console.error("Retrieval failed",re),p([]))}finally{J===_.current&&(b(!1),E(!0))}},500),()=>{D.current&&clearTimeout(D.current)}},[y,e,o]),W.useEffect(()=>{n===null?(u(""),f(""),a(e.defaultMatchType??(e.filterType==="DateMinMax"?"Between":ef(e.filterType)[0]||"Equals"))):n&&(a(n.matchType),u(n.value??""),f(n.value2??""))},[n,e.filterType,e.defaultMatchType]);const L=ef(e.filterType),j=vV(e.filterType),S=tf(s),$=j&&t.length>=2&&t[0].value instanceof Date?Ft.utc(t[0].value):void 0,F=j&&t.length>=2&&t[1].value instanceof Date?Ft.utc(t[1].value):void 0,R=e.filterType==="MinMax"&&t.length>=2&&typeof t[0].value=="number"?t[0].value:void 0,H=e.filterType==="MinMax"&&t.length>=2&&typeof t[1].value=="number"?t[1].value:void 0;if(L.length===0)return null;const V=P=>{const J=P.target.value;a(J),tf(J)||f(""),l&&r({dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:J,value:l,...tf(J)&&d&&{value2:d}})},Y=(P,J)=>{u(P??""),J!==void 0&&f(J??"");const re=Array.isArray(P)&&P.length===0;r(!re&&P!==""&&P!==null&&P!==void 0?{dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:s,value:P,...S&&J&&{value2:J}}:null)},q=()=>{u(""),f(""),r(null)};return c.jsxs(Xt,{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(Xt,{sx:{fontWeight:600,color:e.required&&!n?"error.main":"text.primary"},children:[e.label??e.dimensionName,e.required&&c.jsx(Xt,{component:"span",sx:{color:n?"text.secondary":"error.main",fontWeight:400,fontSize:"0.7rem",ml:.5},children:"(required)"})]}),e.filterType!=="Boolean"&&!e.defaultMatchType&&L.length>1&&c.jsxs(rc,{size:"small",fullWidth:!0,children:[c.jsx(nc,{children:"Match Type"}),c.jsx(oc,{value:s,label:"Match Type",onChange:V,MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:L.map(P=>c.jsx(un,{value:P,children:P},P))})]}),e.filterType==="Star"&&s==="Equals"&&c.jsx(Zf,{multiple:!0,size:"small",options:t,getOptionLabel:P=>typeof P=="string"?P:typeof P=="object"&&P!==null&&"value"in P?String(P.value):String(P),value:Array.isArray(l)?l.map(P=>t.find(J=>J.value===P)||P):l?[t.find(P=>P.value===l)||l]:[],onChange:(P,J)=>{const re=J.map(z=>typeof z=="string"?z:z&&typeof z=="object"&&"value"in z?z.value:z);Y(re)},noOptionsText:"No matches found",renderInput:P=>c.jsx(vt,{...P,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(vt,{size:"small",label:"Search Text",value:l,onChange:P=>u(P.target.value),onBlur:()=>Y(l),onKeyDown:P=>{P.key==="Enter"&&Y(l)},placeholder:"Enter text to search...",fullWidth:!0}),e.filterType==="Boolean"&&c.jsxs(rc,{size:"small",fullWidth:!0,children:[c.jsx(nc,{children:"Value"}),c.jsxs(oc,{value:l===!0?"true":l===!1?"false":"",label:"Value",onChange:P=>{const J=P.target.value;J==="true"?Y(!0):J==="false"?Y(!1):q()},MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:[c.jsx(un,{value:"",children:c.jsx("em",{children:"Blank"})}),c.jsx(un,{value:"true",children:"True"}),c.jsx(un,{value:"false",children:"False"})]})]}),e.filterType==="Retrieval"&&s==="Semantic Search"&&c.jsx(Zf,{multiple:!0,size:"small",options:h,loading:m,getOptionLabel:P=>typeof P=="string"?P:typeof P=="object"&&P!==null&&"value"in P?String(P.value):String(P),value:Array.isArray(l)?l.map(P=>h.find(re=>re.value===P)||{value:P}):l?[{value:l}]:[],onInputChange:(P,J)=>{x(J)},onChange:(P,J)=>{const re=J.map(z=>typeof z=="string"?z:z&&typeof z=="object"&&"value"in z?z.value:z);Y(re)},noOptionsText:y.trim().length<=2?"Type at least 3 characters to search":"No matches found",renderInput:P=>c.jsx(vt,{...P,size:"small",label:"Search Values",placeholder:"Type to search...",onFocus:()=>I(!0),onBlur:()=>I(!1),helperText:T&&!m&&C&&h.length===0?"No matches found":void 0,InputProps:{...P.InputProps,endAdornment:c.jsxs(c.Fragment,{children:[m?c.jsx(eh,{color:"inherit",size:20}):null,P.InputProps.endAdornment]})}}),freeSolo:!0,filterOptions:P=>P,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="MinMax"&&!S&&c.jsx(vt,{size:"small",type:"number",label:"Value",value:l,onChange:P=>Y(parseFloat(P.target.value)||""),onFocus:()=>B(!0),onBlur:()=>B(!1),placeholder:"Enter number...",fullWidth:!0,inputProps:{min:R,max:H},helperText:O&&R!==void 0&&H!==void 0?`Valid range: [${R} - ${H}]`:void 0}),e.filterType==="MinMax"&&S&&c.jsxs(Xt,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.jsxs(Xt,{sx:{display:"flex",gap:1,alignItems:"center"},children:[c.jsx(vt,{size:"small",type:"number",label:"From",value:l,onChange:P=>Y(parseFloat(P.target.value)||"",d),onFocus:()=>B(!0),onBlur:()=>B(!1),placeholder:"Min...",fullWidth:!0,inputProps:{min:R,max:d||H}}),c.jsx(Xt,{children:"to"}),c.jsx(vt,{size:"small",type:"number",label:"To",value:d,onChange:P=>Y(l,parseFloat(P.target.value)||""),onFocus:()=>B(!0),onBlur:()=>B(!1),placeholder:"Max...",fullWidth:!0,inputProps:{min:l||R,max:H}})]}),O&&R!==void 0&&H!==void 0&&c.jsxs(Dt,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",R," - ",H,"]"]})]}),j&&!S&&c.jsx(al,{dateAdapter:Qu,children:c.jsx(el,{label:"Date",value:l instanceof Date?Ft.utc(l):null,onChange:P=>{P===null?Y(null):P.isValid()&&Y(P.utc().toDate())},timezone:"UTC",minDate:l instanceof Date?void 0:$,maxDate:l instanceof Date?void 0:F,referenceDate:s==="After"&&$?$:void 0,slotProps:{textField:{size:"small",fullWidth:!0,sx:{minWidth:150},onFocus:()=>B(!0),onBlur:()=>B(!1),helperText:O&&$&&F?`Valid range: [${$.format("YYYY-MM-DD")} - ${F.format("YYYY-MM-DD")}]`:void 0},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),j&&S&&c.jsx(al,{dateAdapter:Qu,children:c.jsxs(Xt,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.jsxs(Xt,{sx:{display:"flex",gap:1,alignItems:"center"},children:[c.jsx(Xt,{sx:{flex:1,minWidth:0},children:c.jsx(el,{label:"From",value:l instanceof Date?Ft.utc(l):null,onChange:P=>{P===null?Y(null,d):P.isValid()&&Y(P.utc().toDate(),d)},timezone:"UTC",minDate:l instanceof Date?void 0:$,maxDate:d instanceof Date?Ft.utc(d):l instanceof Date?void 0:F,referenceDate:$,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>B(!0),onBlur:()=>B(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),c.jsx(Xt,{children:"to"}),c.jsx(Xt,{sx:{flex:1,minWidth:0},children:c.jsx(el,{label:"To",value:d instanceof Date?Ft.utc(d):null,onChange:P=>{P===null?Y(l,null):P.isValid()&&Y(l,P.utc().toDate())},timezone:"UTC",minDate:l instanceof Date?Ft.utc(l):d instanceof Date?void 0:$,maxDate:d instanceof Date?void 0:F,referenceDate:l instanceof Date?Ft.utc(l):$,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>B(!0),onBlur:()=>B(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})})]}),O&&$&&F&&c.jsxs(Dt,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",$.format("YYYY-MM-DD")," -"," ",F.format("YYYY-MM-DD"),"]"]})]})})]})}function _o(e){return e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function EV(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 TV(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 vC(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 SV(e){const t=e.match(/^#\s*label\s*=\s*"([^"]+)"/);return t?t[1]:null}function kV(e){const t=new Map;let n="";for(const r of e)if(r.type==="code"){if(!n&&r.text){const i=r.text.split(`
|
|
211
|
-
`).map(s=>s.trim()).find(s=>s.startsWith("import "))?.match(/['"]([^'"\n]+)['"]/);i&&(n=i[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 wV(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=vC(f.value);h&&(u=h.type);const p=SV(f.value);p&&(d=p)}}r.push({source:o,model:n,dimensionName:i,filterType:u,label:d})}return r}function DV(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"?`'${_o(m)}'`: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'%${_o(l)}%'`:`${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 IV(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 AV(e,t){return`${e.trimEnd()} + {where: ${t}}`}const CC=gt(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"})),EC=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(" ")+"..."},TC=(e,t)=>{const n=(e.readme||void 0)?.split(`
|
|
212
|
-
`)??[];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(`
|
|
213
|
-
`)};function OV(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:i}=e,s=Nc();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 E=x.onBlur;E?.(C),f()},p=x=>C=>{const E=x.onFocus;E?.(C),d()},m=x=>C=>{const E=x.onMouseEnter;E?.(C),d()},b=x=>C=>{const E=x.onMouseLeave;E?.(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 Cb(e){return e.substring(2).toLowerCase()}function MV(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function PV(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=Et(js(t),a),f=Ve(m=>{const b=u.current;u.current=!1;const y=gn(a.current);if(!l.current||!a.current||"clientX"in m&&MV(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=Cb(i),b=gn(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=Cb(r),b=gn(a.current);return b.addEventListener(m,f),()=>{b.removeEventListener(m,f)}}},[f,r]),M.cloneElement(t,p)}function RV(e){return Ge("MuiSnackbarContent",e)}qe("MuiSnackbarContent",["root","message","action"]);const NV=e=>{const{classes:t}=e;return Ke({root:["root"],action:["action"],message:["message"]},RV,t)},FV=pe(wi,{name:"MuiSnackbarContent",slot:"Root"})(pt(({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(sf(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:sf(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),LV=pe("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),_V=pe("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),BV=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=NV(u);return c.jsxs(FV,{role:a,elevation:6,className:Ue(d.root,i),ownerState:u,ref:n,...l,children:[c.jsx(LV,{className:d.message,ownerState:u,children:s}),o?c.jsx(_V,{className:d.action,ownerState:u,children:o}):null]})});function jV(e){return Ge("MuiSnackbar",e)}qe("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const $V=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${Le(n.vertical)}${Le(n.horizontal)}`]};return Ke(r,jV,t)},HV=pe("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${Le(n.anchorOrigin.vertical)}${Le(n.anchorOrigin.horizontal)}`]]}})(pt(({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%)"}}}]}))),zV=M.forwardRef(function(t,n){const r=ut({props:t,name:"MuiSnackbar"}),o=Bo(),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:E,onMouseLeave:T,open:I,resumeHideDuration:D,slots:_={},slotProps:O={},TransitionComponent:B,transitionDuration:L=i,TransitionProps:{onEnter:j,onExited:S,...$}={},...F}=r,R={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:u,disableWindowBlurListener:m,TransitionComponent:B,transitionDuration:L},H=$V(R),{getRootProps:V,onClickAway:Y}=OV({...R}),[q,P]=M.useState(!0),J=ae=>{P(!0),S&&S(ae)},re=(ae,ne)=>{P(!1),j&&j(ae,ne)},z={slots:{transition:B,..._},slotProps:{content:p,clickAwayListener:h,transition:$,...O}},[ye,se]=kt("root",{ref:n,className:[H.root,f],elementType:HV,getSlotProps:V,externalForwardedProps:{...z,...F},ownerState:R}),[G,{ownerState:le,...oe}]=kt("clickAwayListener",{elementType:PV,externalForwardedProps:z,getSlotProps:ae=>({onClickAway:(...ne)=>{const Ce=ne[0];ae.onClickAway?.(...ne),!Ce?.defaultMuiPrevented&&Y(...ne)}}),ownerState:R}),[ue,ie]=kt("content",{elementType:BV,shouldForwardComponentProp:!0,externalForwardedProps:z,additionalProps:{message:b,action:s},ownerState:R}),[Z,de]=kt("transition",{elementType:ll,externalForwardedProps:z,getSlotProps:ae=>({onEnter:(...ne)=>{ae.onEnter?.(...ne),re(...ne)},onExited:(...ne)=>{ae.onExited?.(...ne),J(...ne)}}),additionalProps:{appear:!0,in:I,timeout:L,direction:a==="top"?"down":"up"},ownerState:R});return!I&&q?null:c.jsx(G,{...oe,..._.clickAwayListener&&{ownerState:le},children:c.jsx(ye,{...se,children:c.jsx(Z,{...de,children:d||c.jsx(ue,{...ie})})})})});function Eb(){const[e,t]=W.useState(!1),{apiClients:n}=Ie.useServer(),[r,o]=W.useState(""),i=()=>{t(!0)},s=()=>{t(!1)},a=Tr.useQueryClient(),l=Sn({async mutationFn(d){return n.environments.createEnvironment({name:d.name,readme:TC({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(so,{open:e,onClose:s,children:[c.jsx(To,{children:"Create New Environment"}),c.jsxs(io,{children:[c.jsx(Nl,{children:"Add a new environment to start exploring semantic models and analyzing data."}),c.jsxs("form",{onSubmit:u,id:"environment-form",children:[c.jsx(vt,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",type:"text",fullWidth:!0,variant:"standard"}),c.jsx(vt,{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(oo,{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(zV,{open:r!=="",autoHideDuration:6e3,onClose:()=>o(""),message:r})]})}function UV({environment:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=Ie.useServer(),i=Tr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},d=Sn({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(k.MenuItem,{onClick:l,children:[c.jsx(k.ListItemIcon,{children:c.jsx(On.Delete,{fontSize:"small"})}),c.jsx(k.ListItemText,{children:"Delete"})]}),c.jsxs(so,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[c.jsx(To,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Environment"}),c.jsx(Ar,{"aria-label":"close",onClick:u,sx:f=>({position:"absolute",right:8,top:8,color:f.palette.grey[500]}),children:c.jsx(_r,{})}),c.jsx(io,{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(oo,{children:[c.jsx(tn,{variant:"outlined",onClick:u,style:{borderColor:Ie.MALLOY_BRAND.teal,color:Ie.MALLOY_BRAND.teal},children:"Cancel"}),c.jsx(tn,{loading:d.isPending,variant:"contained",autoFocus:!0,onClick:()=>d.mutate(),color:"error",children:"Delete"})]}),c.jsx(k.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})]})}function VV({environment:e,onCloseDialog:t}){const[n,r]=W.useState(!1),{apiClients:o}=Ie.useServer(),i=Tr.useQueryClient(),[s,a]=W.useState(""),l=()=>{r(!0)},u=()=>{r(!1),t()},d=Sn({async mutationFn(h){return o.environments.updateEnvironment(e.name,{name:e.name,readme:TC({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(k.MenuItem,{onClick:l,children:[c.jsx(k.ListItemIcon,{children:c.jsx(On.Edit,{fontSize:"small"})}),c.jsx(k.ListItemText,{children:"Edit"})]}),c.jsxs(so,{open:n,onClose:u,children:[c.jsx(To,{children:"Edit Environment"}),c.jsxs(io,{children:[c.jsx(Nl,{children:"Edit this environment's description."}),c.jsxs("form",{onSubmit:f,id:"environment-form",children:[c.jsx(vt,{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(vt,{margin:"dense",id:"description",name:"description",label:"Environment Description",type:"text",fullWidth:!0,variant:"standard",defaultValue:EC(e.readme)})]})]}),c.jsxs(oo,{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(k.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>a(""),message:s})]})}const WV=[{title:"Ad-hoc analysis",body:"Browse the semantic sources on this server and build nested queries in Explorer. Every click writes valid Malloy, so metrics stay correct even across joins.",href:Fr.explorer},{title:"Notebooks",body:"A data story: markdown and live query cells in one file, versioned beside the model it reads. Any givens it imports become a panel of filter controls above the cells.",href:Fr.surfaces},{title:"Dashboards",body:"A tagged Malloy file is the page. Tags lay out the grid, the filter row is rendered from the query's parameters, and a tagged dimension clicks through to a detail page. No front-end code.",href:Fr.dashboards},{title:"Data apps",body:"Hand-author an HTML page in a package's public directory and Publisher serves it, backed by that package's models. No build step, and it embeds in a host page.",href:Fr.dataApps},{title:"AI data agents",body:"One MCP endpoint. Agents discover the sources, compile-check the Malloy they write, and ask well-formed questions instead of guessing at raw tables.",href:Fr.mcpAgents},{title:"Governed access",body:"Runtime parameters, row-level filters, and per-source access gates are declared in the model, so every surface reads the same rules rather than reimplementing them.",href:Fr.givens}];function du({href:e,children:t}){return c.jsx(k.Box,{component:"a",href:e,target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:t})}function qV({onClickEnvironment:e}){const{apiClients:t,mutable:n,server:r}=Ie.useServer(),{data:o,isSuccess:i,isError:s,error:a}=zt({queryKey:["environments"],queryFn:()=>t.environments.listEnvironments()});if(s)return c.jsx(vn,{error:a,context:"Environments List"});if(!i)return c.jsx(xn,{text:"Loading environments..."});const l=o.data??[];return c.jsxs(k.Container,{maxWidth:"md",sx:{py:6},children:[c.jsxs(k.Box,{sx:{mb:5},children:[c.jsx(k.Typography,{variant:"h3",component:"h1",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Publisher"}),c.jsx(k.Typography,{variant:"body1",color:"text.secondary",sx:{mb:3},children:"The open-source semantic model server for the Malloy data language."}),c.jsx(k.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 over a REST API and a single MCP endpoint, so applications, BI tools, and AI agents compose queries against the model instead of writing SQL, and the numbers come back right by construction."})]}),c.jsx(k.Grid,{container:!0,spacing:4,sx:{mb:5},children:WV.map(u=>c.jsx(k.Grid,{size:{xs:12,sm:6},children:c.jsxs(k.Stack,{spacing:1,children:[c.jsx(k.Typography,{variant:"body2",component:"a",href:u.href,target:"_blank",rel:"noopener noreferrer",sx:{fontWeight:500,color:"text.primary",textDecoration:"none","&:hover":{textDecoration:"underline"}},children:u.title}),c.jsx(k.Typography,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6},children:u.body})]})},u.title))}),c.jsx(k.Divider,{sx:{my:4}}),l.length>0?c.jsxs(k.Box,{sx:{mb:4},children:[c.jsxs(k.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[c.jsxs(k.Box,{children:[c.jsx(k.Typography,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:.5},children:"Environments"}),c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"Published environments available on this server"})]}),n&&c.jsx(Eb,{})]}),c.jsx(k.Grid,{container:!0,spacing:2,children:l.map(u=>c.jsx(k.Grid,{size:{xs:12,sm:6,md:4},children:c.jsx(YV,{environment:u,onClickEnvironment:e})},u.name))})]}):c.jsxs(k.Box,{sx:{mb:4},children:[c.jsx(k.Typography,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Get started"}),c.jsx(k.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(Eb,{}):c.jsx(k.Button,{variant:"contained",color:"primary",href:Fr.publishing,target:"_blank",rel:"noopener noreferrer",children:"Learn how to create models"})]}),c.jsx(k.Divider,{sx:{my:4}}),c.jsxs(k.Typography,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6},children:["Also here:"," ",c.jsx(du,{href:Fr.connections,children:"connections"})," to BigQuery, Snowflake, Postgres, MySQL, Trino, DuckDB and more;"," ",c.jsx(du,{href:Fr.materialization,children:"materialized tables"})," ","built on demand or on a schedule; and a"," ",c.jsx(du,{href:`${Eh(r)}/api-doc.html`,children:"REST API"})," ","that does everything this console does."]}),c.jsxs(k.Typography,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6,mt:2},children:["Publisher is built on fully open infrastructure and designed for the AI era. Join the"," ",c.jsx(du,{href:"https://join.slack.com/t/malloy-community/shared_invite/zt-1kgfwgi5g-CrsdaRqs81QY67QW0~t_uw",children:"Malloy Slack community"})," ","to ask questions, share ideas, and contribute."]})]})}function YV({environment:e,onClickEnvironment:t}){const{mutable:n}=Ie.useServer(),[r,o]=W.useState(null),i=!!r,s=EC(e.readme),a=d=>{e.name&&t&&t(`/${e.name}/`,d)},l=d=>{d.stopPropagation(),o(d.currentTarget)},u=()=>{o(null)};return c.jsx(k.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(k.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:c.jsxs(k.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[c.jsx(k.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(CC,{sx:{fontSize:20}})}),c.jsxs(k.Box,{sx:{flex:1,minWidth:0},children:[c.jsx(k.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),c.jsx(k.Tooltip,{title:s,followCursor:!0,enterDelay:1e3,children:c.jsx(k.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(k.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(k.Menu,{anchorEl:r,open:i,onClose:u,onClick:d=>d.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(VV,{environment:e,onCloseDialog:u}),c.jsx(UV,{environment:e,onCloseDialog:u})]})]})]})})})}const ac=gt(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"})),KV=gt(c.jsx("path",{d:"M8 5v14l11-7z"}));function SC({open:e,onClose:t,result:n,title:r="Results",renderLogs:o,drill:i}){return c.jsxs(k.Dialog,{open:e,onClose:t,maxWidth:!1,fullWidth:!0,sx:{"& .MuiDialog-paper":{width:"95vw",height:"95vh",maxWidth:"none"}},children:[c.jsxs(k.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r,c.jsx(k.IconButton,{onClick:t,sx:{color:"text.secondary"},children:c.jsx(_r,{})})]}),c.jsx(k.DialogContent,{sx:{height:"calc(95vh - 120px)",overflow:"auto",padding:"0 16px"},children:c.jsx(Si,{result:n,maxHeight:800,maxResultSize:1e6,renderLogs:o,drill:i})})]})}function GV({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}=jt(n),{apiClients:b}=Ie.useServer(),{data:y,isSuccess:x,isLoading:C}=zt({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,...Ie.CHART_RESULT_QUERY_OPTIONS}),{mode:E}=Ie.usePublisherTheme();return W.useEffect(()=>{if(t&&t.length>0){const T=t.map(I=>`// ${I}`).join(`
|
|
214
|
-
`);Gu(T,"typescript",E).then(I=>{s(I)})}},[t,E]),c.jsxs(Ie.CleanNotebookCell,{children:[i&&c.jsx(k.Box,{sx:{marginBottom:"16px"},children:c.jsx(k.Typography,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:c.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:i}})})}),c.jsxs(k.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[c.jsx(k.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(k.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(ac,{sx:{fontSize:"18px",color:"text.secondary"}})})]}),c.jsxs(Ie.CleanMetricCard,{sx:{position:"relative"},children:[r&&!u&&c.jsxs(k.Box,{sx:{padding:"40px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:"Click Run to execute the query"}),c.jsx(k.Button,{variant:"contained",startIcon:c.jsx(KV,{}),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(k.Box,{sx:{padding:"20px",textAlign:"center"},children:c.jsx(k.Typography,{children:"Loading results..."})}),(!r||u)&&x&&y?.data?.result&&c.jsx(Si,{result:y.data.result,maxHeight:600,maxResultSize:o,renderLogs:y.data.renderLogs})]}),c.jsx(SC,{open:a,onClose:()=>l(!1),result:y?.data?.result||"",renderLogs:y?.data?.renderLogs,title:`Query: ${e}`})]})}function Ih(e,t=!0){const{modelPath:n,environmentName:r,packageName:o,versionId:i}=jt(e),{apiClients:s}=Ie.useServer();return zt({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}=Ih(i,!e),{modelPath:h}=jt(i),p=e||l;if(d&&!e)return c.jsx(xn,{text:"Fetching Model..."});if(u&&!e)return console.log("error",f),c.jsx(vn,{error:f,context:`ModelExplorer > ${h}`});if(!p)return c.jsx(xn,{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(Ie.StyledCard,{variant:"outlined",children:[c.jsx(Ie.StyledCardContent,{children:c.jsx(k.Stack,{sx:{flexDirection:"row"},children:c.jsx(Zf,{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(vt,{...y}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),c.jsx(Ie.StyledCardMedia,{children:c.jsxs(k.Stack,{spacing:2,component:"section",children:[Array.isArray(p.sourceInfos)&&p.sourceInfos.length>0&&c.jsx(_p,{sourceAndPaths:p.sourceInfos.map(y=>({sourceInfo:JSON.parse(y),modelPath:h})),selectedSourceIndex:s,existingQuery:n,onQueryChange:t,resourceUri:i}),c.jsx(k.Box,{height:"5px"})]})})]})}function Oh({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(k.Dialog,{open:e,onClose:t,fullScreen:!0,children:[c.jsxs(k.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,c.jsx(k.IconButton,{onClick:t,sx:{color:"text.secondary"},children:c.jsx(_r,{})})]}),c.jsx(k.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 QV({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0}){const{modelPath:o}=jt(t),{data:i,isError:s,isLoading:a,error:l}=Ih(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 D=JSON.parse(x);return Array.isArray(D.imports)&&D.imports.length>0}catch{return!1}},[x]);if(a)return c.jsx(xn,{text:"Fetching Model..."});if(s)return console.log("error",l),c.jsx(vn,{error:l,context:`Model > ${o}`});const E=D=>{h(D),e&&e(D)},T=D=>{m(D)},I=()=>{const D=window.location.href;navigator.clipboard.writeText(D).then(()=>y("URL copied to clipboard!")).catch(()=>y("Failed to copy URL"))};return c.jsxs(c.Fragment,{children:[c.jsxs(k.Box,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(i?.sourceInfos)&&i.sourceInfos.length>0&&c.jsxs(k.Stack,{spacing:2,component:"section",children:[c.jsxs(k.Box,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx(k.Typography,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),c.jsx(k.Tooltip,{title:"Click to copy link",children:c.jsx(sp,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer"},onClick:I})})]}),c.jsx(Ah,{data:i,onChange:E,onSourceChange:T,existingQuery:f,initialSelectedSourceIndex:p,resourceUri:t}),c.jsx(k.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(ac,{sx:{fontSize:"18px",color:"text.secondary",marginBottom:"5px"}})})]}),i?.queries?.length>0&&c.jsxs(k.Stack,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[c.jsx(k.Box,{sx:{padding:"0 0 16px 0"},children:c.jsx(k.Typography,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),i.queries.map(D=>c.jsx(GV,{queryName:D.name,annotations:D.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},D.name))]}),(!Array.isArray(i?.sourceInfos)||i.sourceInfos.length===0)&&!(i?.queries&&i.queries.length>0)&&c.jsxs(k.Box,{sx:{textAlign:"center",py:6},children:[c.jsx(k.Typography,{variant:"body1",sx:{color:"text.secondary",marginBottom:"8px"},children:"This model exposes no sources or queries."}),C&&c.jsxs(k.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(Oh,{open:u,onClose:()=>d(!1),resourceUri:t,data:i,title:`Model: ${o.split("/").pop()}`,existingQuery:f,initialSelectedSourceIndex:p,onChange:E,onSourceChange:T})]}),c.jsx(k.Snackbar,{open:b!=="",autoHideDuration:6e3,onClose:()=>y(""),message:b})]})}function XV({ready:e,lastRunKey:t,pendingKey:n,runKey:r,documentKey:o}){if(!e)return{cancelPending:n!==void 0,dispatch:"none"};const i=n!==void 0&&n!==r;if(t===r)return{cancelPending:i,dispatch:"none"};if(n===r)return{cancelPending:i,dispatch:"none"};const s=t===null||!t.startsWith(`${o}|`);return{cancelPending:i,dispatch:s?"now":"settle"}}function kC(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 ZV=gt(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 Mh(e){const{environmentName:t,packageName:n}=jt(e.resourceUri);if(!t||!n)throw new Error("Environment and Package name must be provided for query embedding.");return JSON.stringify({...e})}function JV({embeddedQueryResult:e}){const{query:t,sourceName:n,queryName:r,resourceUri:o,height:i}=JSON.parse(e),{modelPath:s}=jt(o);if(!s||!t&&(!r||!n)||typeof s!="string")throw new Error("Invalid embedded query result: "+e);return c.jsx(wC,{query:t,sourceName:n,queryName:r,resourceUri:o,height:i})}function wC({query:e,sourceName:t,queryName:n,resourceUri:r,height:o=400}){const{modelPath:i,environmentName:s,packageName:a,versionId:l}=jt(r),{apiClients:u}=Ie.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}=zt({queryKey:[r,e,t,n],queryFn:()=>u.models.executeQueryModel(s,a,i,{query:e,sourceName:t,queryName:n,versionId:l}),...Ie.CHART_RESULT_QUERY_OPTIONS});return c.jsxs(c.Fragment,{children:[!f&&!h&&c.jsx(xn,{text:"Fetching Query Results..."}),f&&c.jsx(W.Suspense,{fallback:c.jsx("div",{children:"Loading..."}),children:c.jsx(Si,{result:d.data.result,maxHeight:o,renderLogs:d.data.renderLogs})}),h&&c.jsx(vn,{context:`${s} > ${a} > ${i}`,error:p})]})}const eW=700;function tW({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 nW({cell:e,hideCodeCellIcon:t,hideEmbeddingIcon:n,resourceUri:r,index:o,maxResultSize:i,isExecuting:s,pendingRerun:a,onNavigate:l,onDrillSelf:u,canDrillSelf:d,onDrillNavigate:f}){const[h,p]=W.useState(!1),[m,b]=W.useState(!1),[y,x]=W.useState(!1),[C,E]=W.useState(),[T,I]=W.useState(),[D,_]=W.useState(!1),[O,B]=W.useState(""),{environmentName:L,packageName:j,modelPath:S}=jt(r),{drill:$,drillMenu:F}=Wp({onNavigate:f,onSelf:u,canSelf:d,selfLabel:"Filter this notebook"}),R=S&&S.includes("/")?S.slice(0,S.lastIndexOf("/")+1):"",H={overrides:{a:{component:tW,props:{envName:L,pkgName:j,sourceDir:R,onNavigate:l}}}},V=/import\s*\{([^}]+)\}\s*from\s*['"`][^'"`]+['"`]/,Y=/import\s*(?:\{[^}]*\}\s*from\s*)?['"`]([^'"`]+)['"`]/,q=G=>G.split(`
|
|
215
|
-
`).filter(le=>!le.trimStart().startsWith("##")).join(`
|
|
216
|
-
`),P=!!e.text&&(V.test(e.text)||Y.test(e.text)),J=()=>{if(!e.newSources||e.newSources.length===0)return 0;let G=[],le="";if(e.text){const oe=e.text.match(V);oe&&(G=oe[1].split(",").map(ie=>ie.trim()));const ue=e.text.match(Y);ue&&(le=ue[1].trim())}for(let oe=0;oe<e.newSources.length;oe++)try{const ue=JSON.parse(e.newSources[oe]);if(G.length>0&&G.includes(ue.name)||le&&le===ue.path)return oe}catch{continue}return 0},re=e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:r}:void 0,z=Mh({query:e.text,resourceUri:r}),{mode:ye}=Ie.usePublisherTheme();W.useEffect(()=>{e.type==="code"&&Gu(q(e.text),"malloy",ye).then(G=>{E(G)})},[e,ye]),W.useEffect(()=>{Gu(z,"typescript",ye).then(G=>{I(G)})},[z,ye]);const se=()=>{const G=window.location.href;navigator.clipboard.writeText(G).then(()=>B("URL copied to clipboard!")).catch(()=>B("Failed to copy URL"))};return e.type==="markdown"&&c.jsx(Ie.CleanNotebookCell,{children:c.jsxs(k.Box,{sx:G=>({"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"600",color:G.palette.text.primary,marginBottom:"8px",marginTop:"16px"},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p":{color:G.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& ul, & ol":{color:G.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& li":{marginBottom:"4px"}}),children:[o===0?c.jsxs(k.Stack,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[c.jsx(Fu,{options:H,children:e.text}),c.jsx(k.Tooltip,{title:"Click to copy link",children:c.jsx(sp,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer",marginTop:"26px"},onClick:se})})]}):c.jsx(Fu,{options:H,children:e.text}),c.jsx(k.Snackbar,{open:O!=="",autoHideDuration:6e3,onClose:()=>B(""),message:O})]})})||e.type==="code"&&c.jsxs(Ie.CleanNotebookCell,{children:[(!t||!n&&e.result||e.newSources&&e.newSources.length>0)&&c.jsx(k.Stack,{sx:{flexDirection:"column",gap:"8px",marginBottom:"2px"},children:e.newSources&&e.newSources.length>0&&c.jsx(Ie.CleanMetricCard,{sx:{position:"relative",padding:"0"},children:c.jsxs(k.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[C&&c.jsx("span",{dangerouslySetInnerHTML:{__html:C},style:{fontFamily:"monospace",fontSize:"14px",flex:1,marginRight:"8px"}}),P&&c.jsx(k.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",flexShrink:0},onClick:()=>_(!0),children:c.jsx(ac,{sx:{fontSize:"18px",color:"grey.700"}})})]})})}),c.jsx(Oh,{open:D,onClose:()=>_(!1),title:"Data Sources",hasValidImport:P,resourceUri:r,data:re,initialSelectedSourceIndex:J()}),c.jsxs(k.Dialog,{open:h,onClose:()=>p(!1),maxWidth:"lg",fullWidth:!0,children:[c.jsxs(k.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Malloy Code",c.jsx(k.IconButton,{onClick:()=>p(!1),sx:{color:"text.secondary"},children:c.jsx(_r,{})})]}),c.jsx(k.DialogContent,{children:c.jsx(k.Box,{sx:G=>({border:`1px solid ${G.palette.divider}`,borderRadius:"8px",padding:"16px",fontFamily:"monospace",fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:G.palette.background.paper,color:G.palette.text.primary}),children:c.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:C}})})})]}),c.jsxs(k.Dialog,{open:m,onClose:()=>b(!1),maxWidth:"lg",fullWidth:!0,children:[c.jsxs(k.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Embeddable Code",c.jsx(k.IconButton,{onClick:()=>b(!1),sx:{color:"text.secondary"},children:c.jsx(_r,{})})]}),c.jsx(k.DialogContent,{children:c.jsxs(k.Stack,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},children:[c.jsx(k.Typography,{component:"div",sx:{fontSize:"12px",fontFamily:"monospace","& .line":{textWrap:"wrap"},flex:1},dangerouslySetInnerHTML:{__html:T}}),c.jsx(k.Tooltip,{title:"Copy Embeddable Code",children:c.jsx(k.IconButton,{sx:{width:"24px",height:"24px",marginLeft:"8px",color:"text.secondary"},onClick:()=>{navigator.clipboard.writeText(z)},children:c.jsx(ZV,{})})})]})})]}),c.jsx(SC,{open:y,onClose:()=>x(!1),result:e.result||"",title:"Results",drill:$}),s&&!e.result&&!e.error&&!P&&!(e.newSources&&e.newSources.length>0)&&c.jsx(Ie.CleanMetricCard,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:200},children:c.jsx(k.CircularProgress,{size:32})}),!e.result&&e.error&&c.jsxs(Ie.CleanMetricCard,{sx:{p:2},children:[c.jsx(k.Typography,{variant:"body2",sx:{color:"error.main"},children:"This cell could not be run."}),c.jsx(k.Typography,{variant:"body2",component:"pre",sx:{color:"text.secondary",whiteSpace:"pre-wrap",m:0,mt:1},children:e.error})]}),e.result&&a&&c.jsx(k.LinearProgress,{"aria-label":"a re-run is pending",sx:{mb:1,height:2,borderRadius:1}}),e.result&&c.jsxs(Ie.CleanMetricCard,{sx:{position:"relative"},children:[c.jsx(k.Box,{sx:{paddingTop:"24px"},children:c.jsx(Si,{result:e.result,maxHeight:eW,maxResultSize:i,drill:$})}),F,c.jsxs(k.Stack,{sx:{position:"absolute",top:"-12px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[!t&&c.jsx(k.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:G=>{G.stopPropagation(),p(!0)},children:c.jsx(Gb,{sx:{fontSize:"18px",color:"grey.700"}})}),c.jsx(k.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>x(!0),children:c.jsx(ac,{sx:{fontSize:"18px",color:"grey.700"}})})]})]})]})}const rW=4,oW=400;function iW(e){const t=e?.response?.data?.message;return typeof t=="string"&&t!==""?t:e instanceof Error&&e.message!==""?e.message:"The server did not say why."}function DC({resourceUri:e,maxResultSize:t=0,givens:n,onGivensChange:r,onNavigate:o,onDrillNavigate:i}){const{apiClients:s}=Ie.useServer(),{environmentName:a,packageName:l,versionId:u,modelPath:d}=jt(e),{data:f,isSuccess:h,isError:p,error:m}=zt({queryKey:[e],queryFn:async()=>(await s.notebooks.getNotebook(a,l,d,u)).data}),[b,y]=W.useState([]),[x,C]=W.useState(!1),[E,T]=W.useState(!1),I=W.useRef(void 0),[D,_]=W.useState(null),O=kC(f),B=W.useMemo(()=>new Map(O.filter(ne=>ne.name!==void 0).map(ne=>[ne.name,ne.type])),[O]),L=W.useCallback(ne=>{h&&r?.(ne,Array.from(B.keys()))},[h,r,B]),j=f?.autorun!==!1,{draft:S,applied:$,setGiven:F,reset:R,apply:H,pending:V}=$p({declaredTypes:B,startingValues:f?.startingGivens,params:n,onParamsChange:h?L:void 0,documentKey:e,autorun:j}),{options:Y,isLoading:q,failed:P}=Hp(a,l,d,O,u),J=W.useMemo(()=>{const ne=new Map;for(const Ce of B.keys())ne.has(Ce.toLowerCase())||ne.set(Ce.toLowerCase(),Ce);return ne},[B]),re=W.useCallback(ne=>B.has(ne)?ne:J.get(ne.toLowerCase()),[B,J]),z=W.useCallback(ne=>re(ne)!==void 0,[re]),ye=W.useCallback((ne,Ce)=>{const ve=re(ne);if(ve===void 0){console.warn(`# drill { to=self } tried to set '${ne}', which '${d}' does not declare as a given. Name the given with 'given=' on the drill tag.`);return}const Se=B.get(ve),he=Vp(Ce,Se);if(he===void 0){console.warn(`Drill declined: ${JSON.stringify(Ce)} cannot be a value for given "${ve}"`+(Se?` of type ${Se}`:""));return}F(ve,he)},[B,d,re,F]),se=W.useCallback(ne=>{const Ce=I2(ne,B);return Object.keys(Ce).length>0?JSON.stringify(Ce):void 0},[B]),G=W.useRef(0),le=W.useRef(null),oe=W.useRef(null),ue=W.useRef(void 0);W.useEffect(()=>()=>{le.current?.abort(),oe.current=null,clearTimeout(ue.current?.timer),ue.current=void 0},[]);const ie=W.useCallback(async(ne=new Map)=>{if(!h||!f?.notebookCells)return;const Ce=++G.current;le.current?.abort();const ve=new AbortController;le.current=ve,y(f.notebookCells.map(he=>({...he}))),C(!0),_(null);const Se=se(ne);try{const he=[];for(let Pe=0;Pe<f.notebookCells.length;Pe++){const Je=f.notebookCells[Pe];if(Je.type==="markdown")continue;const Me=Pe,Nt=async()=>{try{const ct=await s.notebooks.executeNotebookCell(a,l,d,Me,u,void 0,void 0,Se,{signal:ve.signal});if(G.current!==Ce)return;const tt=ct.data,xe=tt.result,Oe=Je.newSources||tt.newSources;y(We=>{const Xe=[...We];return Xe[Me]||(Xe[Me]={...Je}),Xe[Me]={...Xe[Me],result:xe,newSources:Oe},Xe})}catch(ct){if(ve.signal.aborted||G.current!==Ce)return;console.error(`Error executing cell ${Me}:`,ct);const tt=iW(ct);y(xe=>{const Oe=[...xe];return Oe[Me]||(Oe[Me]={...Je}),Oe[Me]={...Oe[Me],error:tt},Oe})}};he.push(Nt)}const $e=[];for(const Pe of he){const Je=Pe().then(()=>{$e.splice($e.indexOf(Je),1)});$e.push(Je),$e.length>=rW&&await Promise.race($e)}await Promise.all($e)}catch(he){if(ve.signal.aborted||G.current!==Ce)return;console.error("Error executing notebook cells:",he),_(he)}finally{G.current===Ce&&(C(!1),le.current=null)}},[h,f,se,a,l,d,u,s.notebooks]),Z=W.useRef(0),de=W.useRef(void 0);de.current!==f&&(de.current=f,Z.current+=1);const ae=Z.current;return W.useEffect(()=>{const ne=`${e}|${ae}`,Ce=`${ne}|${se($)??""}`;I.current!==void 0&&I.current!==ne&&(le.current?.abort(),le.current=null),I.current=ne;const ve=XV({ready:h&&!!f?.notebookCells,lastRunKey:oe.current,pendingKey:ue.current?.key,runKey:Ce,documentKey:ne});if(ve.cancelPending&&(clearTimeout(ue.current?.timer),ue.current=void 0,T(!1)),ve.dispatch==="none")return;const Se=()=>{ue.current=void 0,T(!1),oe.current=Ce,ie($)};if(ve.dispatch==="now"){Se();return}T(!0),ue.current={key:Ce,timer:setTimeout(Se,oW)}},[h,f,ae,e,$,se,ie]),c.jsx(Ie.CleanNotebookContainer,{children:c.jsx(Ie.CleanNotebookSection,{children:c.jsxs(k.Stack,{spacing:3,component:"section",children:[c.jsx(vh,{givens:O,values:S,onChange:F,onReset:R,options:Y,optionsLoading:q,optionsFailed:P,apply:j?void 0:{onApply:H,pending:V}}),!h&&!p&&c.jsx(xn,{text:"Fetching Notebook..."}),h&&(b.length>0?b:f?.notebookCells||[]).map((ne,Ce)=>c.jsx(nW,{cell:ne,index:Ce,resourceUri:e,maxResultSize:t,isExecuting:x,pendingRerun:E,onNavigate:o,onDrillNavigate:i,onDrillSelf:O.length>0?ye:void 0,canDrillSelf:z},Ce)),p&&m.status===404&&c.jsxs(k.Typography,{variant:"body2",sx:{color:"text.secondary"},children:[c.jsx("code",{children:`${a} > ${l} > ${d}`})," ","not found."]}),p&&m.status!==404&&c.jsx(vn,{error:m,context:`${a} > ${l} > ${d}`}),D&&c.jsx(vn,{error:{message:D.message,status:500,name:"ExecutionError"},context:"Notebook Execution"})]})})})}const sW={dashboard:Ie.MALLOY_BRAND.orange,report:Ie.MALLOY_BRAND.teal,model:Ie.MALLOY_BRAND.darkBlue,dataApp:Ie.MALLOY_ACCENT.violet,data:Ie.MALLOY_ACCENT.moss,materialization:Ie.MALLOY_ACCENT.magenta};function aW({type:e,size:t=18,sx:n,...r}){return c.jsx(ju,{...r,viewBox:"0 0 24 24",sx:{width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...n},children:lW[e]()})}const lW={report:uW,model:cW,data:dW,materialization:fW,dataApp:hW,dashboard:pW};function uW(){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 cW(){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 dW(){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 fW(){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 pW(){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:"M12 9.5 V20.5"}),c.jsx("path",{d:"M12 15 H20.5"})]})}function hW(){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 Tb="README.malloynb";function mW({onClickPackageFile:e,resourceUri:t}){const{apiClients:n,server:r}=Ie.useServer(),o=e??(S=>{window.location.href=S}),{environmentName:i,packageName:s,versionId:a}=jt(t),[l,u]=W.useState(null),d=zt({queryKey:["package",i,s,a],queryFn:()=>n.packages.getPackage(i,s,a,!1)}),f=zt({queryKey:["notebooks",i,s,a],queryFn:()=>n.notebooks.listNotebooks(i,s,a)}),h=zt({queryKey:["models",i,s,a],queryFn:()=>n.models.listModels(i,s,a)}),p=zt({queryKey:["databases",i,s,a],queryFn:()=>n.databases.listDatabases(i,s,a)}),b=zt({queryKey:["data-apps",i,s],queryFn:async()=>{try{return await n.dataApps.listDataApps(i,s)}catch(S){const $=S?.response?.status;if($===404||$===void 0)return{data:[]};throw S}}}).data?.data??[],y=zt({queryKey:["dashboards",i,s,a],queryFn:async()=>{try{return await n.dashboards.listDashboards(i,s,a)}catch(S){const $=S?.response?.status;if($===404||$===void 0)return{data:[]};throw S}}}),x=S=>S.title&&S.title!==S.name?S.title:S.name??"",C=S=>S.title&&S.title!==S.path?S.title:S.path??"",E=(y.data?.data??[]).slice().sort((S,$)=>x(S).localeCompare(x($))),T=(f.data?.data??[]).slice().sort((S,$)=>C(S).localeCompare(C($))),I=new Set(E.map(S=>S.path).filter(S=>S!==void 0)),D=(h.data?.data??[]).slice().filter(S=>!I.has(S.path)).sort((S,$)=>S.path.localeCompare($.path)),_=(p.data?.data??[]).slice().sort((S,$)=>S.path.localeCompare($.path)),O=d.data?.data?.description??"",B=T.some(S=>S.path===Tb),L=Il({environmentName:i,packageName:s,versionId:a,modelPath:Tb}),j=!f.isSuccess&&!f.isError||!y.isSuccess&&!y.isError;return d.isError?c.jsx(vn,{error:d.error,context:`${i} > ${s}`}):c.jsxs(k.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[c.jsxs(k.Box,{sx:{mb:4},children:[c.jsxs(k.Link,{onClick:S=>o(`/${i}/`,S),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(tC,{sx:{fontSize:18}}),"Back to ",i]}),c.jsx(k.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:s}),O&&c.jsx(k.Typography,{variant:"body2",color:"text.secondary",children:O})]}),j&&c.jsx(xn,{text:"Loading package..."}),!j&&c.jsxs(c.Fragment,{children:[y.isError&&c.jsx(k.Box,{sx:{mb:4},children:c.jsx(k.Alert,{severity:"warning",children:"Could not list this package's dashboards, so any it has are missing from this page."})}),E.length>0&&c.jsx(ts,{title:"Dashboards",count:E.length,children:E.map(S=>{const $=!!S.title&&S.title!==S.name;return c.jsx(ns,{type:"dashboard",label:$?S.title:S.name,rightLabel:$?S.name:void 0,onClick:F=>o(`/${i}/${s}/dashboards/`+encodeURIComponent(S.name??""),F)},S.name)})}),c.jsxs(ts,{title:"Notebooks",count:T.length,children:[T.map(S=>{const $=!!S.title&&S.title!==S.path;return c.jsx(ns,{type:"report",label:$?S.title:S.path,rightLabel:$?S.path:void 0,onClick:F=>o(`/${i}/${s}/${S.path}`,F)},S.path)}),T.length===0&&c.jsx(nf,{label:"No notebooks"})]}),b.length>0&&c.jsx(ts,{title:"Data Apps",count:b.length,children:b.map(S=>{const $=!!S.title&&S.title!==S.path,F=`${Eh(r)}${S.resource}`;return c.jsx(ns,{type:"dataApp",label:$?S.title:S.path,rightLabel:$?S.path:void 0,onClick:R=>{e?e(`/${i}/${s}/data-apps/${S.path}`,R):R&&(R.metaKey||R.ctrlKey)?window.open(F,"_blank"):window.location.href=F},trailingAction:c.jsx(k.Tooltip,{title:"Open standalone in new tab",children:c.jsx(k.IconButton,{size:"small",href:F,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",onClick:R=>R.stopPropagation(),sx:{color:"text.secondary"},children:c.jsx(Jv,{fontSize:"small"})})})},S.path)})}),c.jsxs(ts,{title:"Semantic Models",count:D.length,children:[D.map(S=>c.jsx(ns,{type:"model",label:S.path,onClick:$=>o(`/${i}/${s}/${S.path}`,$)},S.path)),D.length===0&&c.jsx(nf,{label:"No models"})]}),c.jsxs(ts,{title:"Package Data",count:_.length,children:[_.map(S=>c.jsx(ns,{type:"data",label:S.path,rightLabel:S.info?gW(S.info.rowCount):"Unreadable",onClick:()=>u(S)},S.path)),_.length===0&&c.jsx(nf,{label:"No data files"})]}),c.jsx(ts,{title:"Materializations",children:c.jsx(ns,{type:"materialization",label:"Materializations",onClick:S=>o(`/${i}/${s}/materializations`,S)})}),B&&c.jsx(k.Box,{sx:{mt:6},children:c.jsx(DC,{resourceUri:L,onNavigate:o})})]}),c.jsxs(k.Dialog,{open:l!==null,onClose:()=>u(null),maxWidth:"sm",fullWidth:!0,children:[c.jsxs(k.DialogTitle,{sx:{pr:6},children:[l?.path,c.jsx(k.IconButton,{"aria-label":"close",onClick:()=>u(null),sx:{position:"absolute",right:8,top:8},children:c.jsx(_r,{fontSize:"small"})})]}),c.jsxs(k.DialogContent,{children:[l?.error&&c.jsx(k.Typography,{variant:"body2",color:"error",children:l.error}),l?.info?.columns&&c.jsxs(k.Table,{size:"small",children:[c.jsx(k.TableHead,{children:c.jsxs(k.TableRow,{children:[c.jsx(k.TableCell,{children:"Column"}),c.jsx(k.TableCell,{children:"Type"})]})}),c.jsx(k.TableBody,{children:l.info.columns.map(S=>c.jsxs(k.TableRow,{children:[c.jsx(k.TableCell,{component:"th",scope:"row",children:S.name}),c.jsx(k.TableCell,{children:S.type})]},S.name))})]})]})]})]})}function ts({title:e,count:t,children:n}){return c.jsxs(k.Box,{sx:{mb:4},children:[c.jsxs(k.Stack,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1},children:[c.jsx(k.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:e}),t!==void 0&&c.jsxs(k.Typography,{variant:"caption",color:"text.secondary",children:["(",t,")"]})]}),c.jsx(k.Box,{children:n})]})}function ns({type:e,label:t,rightLabel:n,onClick:r,trailingAction:o}){const i=!!r,s=a=>{r&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),r(a))};return c.jsxs(k.Box,{onClick:r,onKeyDown:i?s:void 0,role:i?"button":void 0,tabIndex:i?0:void 0,sx:a=>({display:"flex",alignItems:"center",gap:1.5,py:1,px:1,mx:-1,cursor:i?"pointer":"default",borderRadius:1.5,transition:"background-color 0.1s","&:hover":i?{backgroundColor:a.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}:void 0,"&:focus-visible":i?{outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}:void 0}),children:[c.jsx(k.Box,{sx:{width:32,height:32,borderRadius:1,bgcolor:sW[e],color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:c.jsx(aW,{type:e})}),c.jsx(k.Typography,{variant:"body2",sx:{fontFamily:Ie.MONO_FONT_FAMILY,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),n&&c.jsx(k.Typography,{variant:"caption",color:"text.secondary",sx:{flexShrink:0},children:n}),o&&c.jsx(k.Box,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:o})]})}function nf({label:e}){return c.jsx(k.Typography,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:e})}function gW(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 bW(e){return Ge("MuiCollapse",e)}qe("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const yW=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Ke(r,bW,n)},xW=pe("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]}})(pt(({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"}}]}))),vW=pe("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),CW=pe("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),ml=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:E=$b.standard,TransitionComponent:T=Ir,...I}=r,D={...r,orientation:x,collapsedSize:a},_=yW(D),O=Bo(),B=Nc(),L=M.useRef(null),j=M.useRef(),S=typeof a=="number"?`${a}px`:a,$=x==="horizontal",F=$?"width":"height",R=M.useRef(null),H=Et(n,R),V=G=>le=>{if(G){const oe=R.current;le===void 0?G(oe):G(oe,le)}},Y=()=>L.current?L.current[$?"clientWidth":"clientHeight"]:0,q=V((G,le)=>{L.current&&$&&(L.current.style.position="absolute"),G.style[F]=S,f&&f(G,le)}),P=V((G,le)=>{const oe=Y();L.current&&$&&(L.current.style.position="");const{duration:ue,easing:ie}=Ts({style:C,timeout:E,easing:u},{mode:"enter"});if(E==="auto"){const Z=O.transitions.getAutoHeightDuration(oe);G.style.transitionDuration=`${Z}ms`,j.current=Z}else G.style.transitionDuration=typeof ue=="string"?ue:`${ue}ms`;G.style[F]=`${oe}px`,G.style.transitionTimingFunction=ie,p&&p(G,le)}),J=V((G,le)=>{G.style[F]="auto",h&&h(G,le)}),re=V(G=>{G.style[F]=`${Y()}px`,m&&m(G)}),z=V(b),ye=V(G=>{const le=Y(),{duration:oe,easing:ue}=Ts({style:C,timeout:E,easing:u},{mode:"exit"});if(E==="auto"){const ie=O.transitions.getAutoHeightDuration(le);G.style.transitionDuration=`${ie}ms`,j.current=ie}else G.style.transitionDuration=typeof oe=="string"?oe:`${oe}ms`;G.style[F]=S,G.style.transitionTimingFunction=ue,y&&y(G)}),se=G=>{E==="auto"&&B.start(j.current||0,G),o&&o(R.current,G)};return c.jsx(T,{in:d,onEnter:q,onEntered:J,onEntering:P,onExit:re,onExited:z,onExiting:ye,addEndListener:se,nodeRef:R,timeout:E==="auto"?null:E,...I,children:(G,{ownerState:le,...oe})=>c.jsx(xW,{as:l,className:Ue(_.root,s,{entered:_.entered,exited:!d&&S==="0px"&&_.hidden}[G]),style:{[$?"minWidth":"minHeight"]:S,...C},ref:H,ownerState:{...D,state:G},...oe,children:c.jsx(vW,{ownerState:{...D,state:G},className:_.wrapper,ref:L,children:c.jsx(CW,{ownerState:{...D,state:G},className:_.wrapperInner,children:i})})})})});ml&&(ml.muiSupportAuto=!0);function IC(e){return Gt}const AC=M.createContext(null);function EW(e){const{value:t,children:n}=e;return c.jsx(AC.Provider,{value:t,children:t.wrapRoot({children:n,instance:t.instance})})}const Ai=()=>{const e=M.useContext(AC);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(`
|
|
217
|
-
`));return e},TW=({props:e})=>{const{instance:t}=Ai(),{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=>Q({},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(`
|
|
218
|
-
`));n(p=>{const m=p.items.itemMetaMap[f];return m.label!==h?Q({},p,{items:Q({},p.items,{itemMetaMap:Q({},p.items.itemMetaMap,{[f]:Q({},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=TW;xr.getDefaultizedParams=({params:e,experimentalFeatures:t})=>{const n=t?.labelEditing;return Q({},e,{isItemEditable:n?e.isItemEditable??!1:!1})};xr.getInitialState=()=>({editedItemId:null});xr.params={onItemLabelChange:!0,isItemEditable:!0};const fi=(e,t)=>e.getAvailablePlugins().has(t),OC=e=>Array.isArray(e)?e.length>0&&e.some(OC):!!e,SW=({itemId:e,children:t})=>{const{instance:n,selection:{multiSelect:r},publicAPI:o}=Ai(),i={expandable:OC(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=()=>{fi(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)=>{fi(n,xr)&&n.isItemBeingEditedRef(e)&&(n.updateItemLabel(e,m),u(),n.focusItem(p,e))},handleCancelItemLabelEditing:p=>{fi(n,xr)&&n.isItemBeingEditedRef(e)&&(u(),n.focusItem(p,e))}},status:i,publicAPI:o}},Ph=M.createContext(()=>-1),MC=(e,t)=>{let n=t.length-1;for(;n>=0&&!e.isItemNavigable(t[n]);)n-=1;if(n!==-1)return t[n]},PC=(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:PC(e,n.parentId);let s=r[i],a=MC(e,e.getItemOrderedChildrenIds(s));for(;e.isItemExpanded(s)&&a!=null;)s=a,a=e.getItemOrderedChildrenIds(s).find(e.isItemNavigable);return s},Ru=(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},RC=e=>{let t=null;for(;t==null||e.isItemExpanded(t);){const n=e.getItemOrderedChildrenIds(t),r=MC(e,n);if(r==null)return t;t=r}return t},gl=e=>e.getItemOrderedChildrenIds(null).find(e.isItemNavigable),NC=(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]},kW=(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]=NC(e,t,n),s=[o];let a=o;for(;a!==i;)a=r(a),e.isItemDisabled(a)||s.push(a);return s},wW=e=>{let t=gl(e);const n=[];for(;t!=null;)n.push(t),t=Ru(e,t);return n},bl=(e,t)=>t!==e.closest('*[role="treeitem"]');let Sb=0;const DW=()=>(Sb+=1,`mui-tree-view-${Sb}`),Rh=({id:e,treeId:t="",itemId:n})=>e??`${t}-${n}`,IW=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}=Ai(),f=M.useContext(Ph),{id:h,itemId:p,label:m,children:b,rootRef:y}=e,{rootRef:x,contentRef:C,propsEnhancers:E}=t(e),{interactions:T,status:I}=SW({itemId:p,children:b}),D=M.useRef(null),_=M.useRef(null),O=Et(y,x,D),B=Et(C,_),L=M.useRef(null),j=Rh({itemId:p,treeId:l,id:h}),S=u.canItemBeTabbed(p)?0:-1,$={rootRefObject:D,contentRefObject:_,interactions:T},F=ie=>Z=>{if(ie.onFocus?.(Z),Z.defaultMuiPrevented)return;const de=!I.disabled||r;!I.focused&&de&&Z.currentTarget===Z.target&&u.focusItem(Z,p)},R=ie=>Z=>{if(ie.onBlur?.(Z),Z.defaultMuiPrevented)return;const de=u.getItemDOMElement(p);I.editing||Z.relatedTarget&&bl(Z.relatedTarget,de)&&(Z.target&&Z.target?.dataset?.element==="labelInput"&&bl(Z.target,de)||Z.relatedTarget?.dataset?.element==="labelInput")||u.removeFocusedItem()},H=ie=>Z=>{ie.onKeyDown?.(Z),!(Z.defaultMuiPrevented||Z.target?.dataset?.element==="labelInput")&&u.handleItemKeyDown(Z,p)},V=ie=>Z=>{ie.onDoubleClick?.(Z),!Z.defaultMuiPrevented&&T.toggleItemEditing()},Y=ie=>Z=>{ie.onClick?.(Z),n?.(Z,p),!(Z.defaultMuiPrevented||L.current?.contains(Z.target))&&(a==="content"&&T.handleExpansion(Z),s||T.handleSelection(Z))},q=ie=>Z=>{ie.onMouseDown?.(Z),!Z.defaultMuiPrevented&&(Z.shiftKey||Z.ctrlKey||Z.metaKey||I.disabled)&&Z.preventDefault()},P=ie=>Z=>{ie.onChange?.(Z),!Z.defaultMuiPrevented&&(i||I.disabled||T.handleCheckboxSelection(Z))},J=ie=>Z=>{ie.onClick?.(Z),!Z.defaultMuiPrevented&&a==="iconContainer"&&T.handleExpansion(Z)};return{getRootProps:(ie={})=>{const Z=Q({},Ln(e),Ln(ie));let de;I.selected?de=!0:i||I.disabled?de=void 0:de=!1;const ae=Q({},Z,{ref:O,role:"treeitem",tabIndex:S,id:j,"aria-expanded":I.expandable?I.expanded:void 0,"aria-selected":de,"aria-disabled":I.disabled||void 0},ie,{onFocus:F(Z),onBlur:R(Z),onKeyDown:H(Z)});o&&(ae.style={"--TreeView-itemDepth":typeof f=="function"?f(p):f});const ne=E.root?.(Q({},$,{externalEventHandlers:Z}))??{};return Q({},ae,ne)},getContentProps:(ie={})=>{const Z=Ln(ie),de=Q({},Z,ie,{ref:B,onClick:Y(Z),onMouseDown:q(Z),status:I});o&&(de.indentationAtItemLevel=!0);const ae=E.content?.(Q({},$,{externalEventHandlers:Z}))??{};return Q({},de,ae)},getGroupTransitionProps:(ie={})=>{const Z=Ln(ie),de=Q({},Z,{unmountOnExit:!0,component:"ul",role:"group",in:I.expanded,children:b},ie);return o&&(de.indentationAtItemLevel=!0),de},getIconContainerProps:(ie={})=>{const Z=Ln(ie);return Q({},Z,ie,{onClick:J(Z)})},getCheckboxProps:(ie={})=>{const Z=Ln(ie);return Q({},Z,{visible:s,ref:L,checked:I.selected,disabled:i||I.disabled,tabIndex:-1},ie,{onChange:P(Z)})},getLabelProps:(ie={})=>{const Z=Q({},Ln(ie)),de=Q({},Z,{children:m},ie,{onDoubleClick:V(Z)});return u.isTreeViewEditable&&(de.editable=I.editable),de},getLabelInputProps:(ie={})=>{const Z=Ln(ie),de=E.labelInput?.({rootRefObject:D,contentRefObject:_,externalEventHandlers:Z,interactions:T})??{};return Q({},ie,de)},getDragAndDropOverlayProps:(ie={})=>{const Z=Ln(ie),de=E.dragAndDropOverlay?.(Q({},$,{externalEventHandlers:Z}))??{};return Q({},ie,de)},rootRef:O,status:I,publicAPI:d}},AW=IW;function FC(e){const{instance:t,items:{onItemClick:n},selection:{multiSelect:r,checkboxSelection:o,disableSelection:i},expansion:{expansionTrigger:s}}=Ai(),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 D=r&&(I.shiftKey||I.ctrlKey||I.metaKey);a&&!(D&&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 D=I.nativeEvent.shiftKey;r&&D?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=()=>{fi(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,D)=>{fi(t,xr)&&t.isItemBeingEditedRef(e)&&(t.updateItemLabel(e,D),C(),t.focusItem(I,e))},handleCancelItemLabelEditing:I=>{fi(t,xr)&&t.isItemBeingEditedRef(e)&&(C(),t.focusItem(I,e))}}}const OW=pe("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 MW(e){return e.action==null?null:c.jsx(OW,Q({},e))}const PW=pe("input",{name:"MuiTreeItem2",slot:"LabelInput",overridesResolver:(e,t)=>t.labelInput})(({theme:e})=>Q({},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}`}})),RW=["classes","className","displayIcon","expansionIcon","icon","label","itemId","onClick","onMouseDown","dragAndDropOverlayProps","labelInputProps"],LC=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=et(t,RW),{disabled:b,expanded:y,selected:x,focused:C,editing:E,editable:T,disableSelection:I,checkboxSelection:D,handleExpansion:_,handleSelection:O,handleCheckboxSelection:B,handleContentClick:L,preventSelection:j,expansionTrigger:S,toggleItemEditing:$}=FC(u),F=a||s||i,R=M.useRef(null),H=q=>{j(q),f&&f(q)},V=q=>{L?.(q,u),!R.current?.contains(q.target)&&(S==="content"&&_(q),D||O(q),d&&d(q))},Y=q=>{q.defaultMuiPrevented||$()};return c.jsxs("div",Q({},m,{className:Ue(r.root,o,y&&r.expanded,x&&r.selected,C&&r.focused,b&&r.disabled,E&&r.editing,T&&r.editable),onClick:V,onMouseDown:H,ref:n,children:[c.jsx("div",{className:r.iconContainer,children:F}),D&&c.jsx(Th,{className:r.checkbox,checked:x,onChange:B,disabled:b||I,ref:R,tabIndex:-1}),E?c.jsx(PW,Q({},p,{className:r.labelInput})):c.jsx("div",Q({className:r.label},T&&{onDoubleClick:Y},{children:l})),h&&c.jsx(MW,Q({},h))]}))});function NW(e){return Ge("MuiTreeItem",e)}const po=qe("MuiTreeItem",["root","groupTransition","content","expanded","selected","focused","disabled","iconContainer","label","checkbox","labelInput","editable","editing","dragAndDropOverlay"]),_C=gt(c.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),BC=gt(c.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}));function Nh(e){const{children:t,itemId:n}=e,{wrapItem:r,instance:o}=Ai();return r({children:t,itemId:n,instance:o})}Nh.propTypes={children:Ee.node,itemId:Ee.string.isRequired};const FW=["children","className","slots","slotProps","ContentComponent","ContentProps","itemId","id","label","onClick","onMouseDown","onFocus","onBlur","onKeyDown"],LW=["ownerState"],_W=["ownerState"],BW=["ownerState"],jW=IC(),$W=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"]},NW,t)},HW=pe("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),zW=pe(LC,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${po.iconContainer}`]:t.iconContainer},t.label&&{[`& .${po.label}`]:t.label}],shouldForwardProp:e=>Fo(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"}},[`&.${po.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${po.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${po.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)}},[`&.${po.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)}},[`& .${po.iconContainer}`]:{width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${po.label}`]:Q({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1),[`& .${po.checkbox}`]:{padding:0},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}}]})),UW=pe(ml,{name:"MuiTreeItem",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>Fo(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]}),VW=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}=Ai(),f=M.useContext(Ph),h=jW({props:t,name:"MuiTreeItem"}),{children:p,className:m,slots:b,slotProps:y,ContentComponent:x=LC,ContentProps:C,itemId:E,id:T,label:I,onClick:D,onMouseDown:_,onBlur:O,onKeyDown:B}=h,L=et(h,FW),{expanded:j,focused:S,selected:$,disabled:F,editing:R,handleExpansion:H,handleCancelItemLabelEditing:V,handleSaveItemLabel:Y}=FC(E),{contentRef:q,rootRef:P,propsEnhancers:J}=o(h),re=M.useRef(null),z=M.useRef(null),ye=Et(n,P,re),se=Et(C?.ref,q,z),G={expandIcon:b?.expandIcon??r.slots.expandIcon??_C,collapseIcon:b?.collapseIcon??r.slots.collapseIcon??BC,endIcon:b?.endIcon??r.slots.endIcon,icon:b?.icon,groupTransition:b?.groupTransition},le=Re=>Array.isArray(Re)?Re.length>0&&Re.some(le):!!Re,oe=le(p),ue=Q({},h,{expanded:j,focused:S,selected:$,disabled:F,indentationAtItemLevel:s}),ie=$W(ue),Z=G.groupTransition??void 0,de=Ct({elementType:Z,ownerState:{},externalSlotProps:y?.groupTransition,additionalProps:Q({unmountOnExit:!0,in:j,component:"ul",role:"group"},s?{indentationAtItemLevel:!0}:{}),className:ie.groupTransition}),ae=Re=>{l==="iconContainer"&&H(Re)},ne=j?G.collapseIcon:G.expandIcon,Ce=Ct({elementType:ne,ownerState:{},externalSlotProps:Re=>j?Q({},br(r.slotProps.collapseIcon,Re),br(y?.collapseIcon,Re)):Q({},br(r.slotProps.expandIcon,Re),br(y?.expandIcon,Re)),additionalProps:{onClick:ae}}),ve=et(Ce,LW),Se=oe&&ne?c.jsx(ne,Q({},ve)):null,he=oe?void 0:G.endIcon,$e=Ct({elementType:he,ownerState:{},externalSlotProps:Re=>oe?{}:Q({},br(r.slotProps.endIcon,Re),br(y?.endIcon,Re))}),Pe=et($e,_W),Je=he?c.jsx(he,Q({},Pe)):null,Me=G.icon,Nt=Ct({elementType:Me,ownerState:{},externalSlotProps:y?.icon}),ct=et(Nt,BW),tt=Me?c.jsx(Me,Q({},ct)):null;let xe;$?xe=!0:a||F?xe=void 0:xe=!1;function Oe(Re){!S&&(!F||i)&&Re.currentTarget===Re.target&&d.focusItem(Re,E)}function We(Re){O?.(Re),!(R||Re.relatedTarget&&bl(Re.relatedTarget,re.current)&&(Re.target&&Re.target?.dataset?.element==="labelInput"&&bl(Re.target,re.current)||Re.relatedTarget?.dataset?.element==="labelInput"))&&d.removeFocusedItem()}const Xe=Re=>{B?.(Re),Re.target?.dataset?.element!=="labelInput"&&d.handleItemKeyDown(Re,E)},Ze=Rh({itemId:E,treeId:u,id:T}),Fe=d.canItemBeTabbed(E)?0:-1,dt={rootRefObject:re,contentRefObject:z,interactions:{handleSaveItemLabel:Y,handleCancelItemLabelEditing:V}},lt=J.root?.(Q({},dt,{externalEventHandlers:Ln(L)}))??{},Mt=J.content?.(Q({},dt,{externalEventHandlers:Ln(C)}))??{},be=J.dragAndDropOverlay?.(Q({},dt,{externalEventHandlers:{}}))??{},Ae=J.labelInput?.(Q({},dt,{externalEventHandlers:{}}))??{};return c.jsx(Nh,{itemId:E,children:c.jsxs(HW,Q({className:Ue(ie.root,m),role:"treeitem","aria-expanded":oe?j:void 0,"aria-selected":xe,"aria-disabled":F||void 0,id:Ze,tabIndex:Fe},L,{ownerState:ue,onFocus:Oe,onBlur:We,onKeyDown:Xe,ref:ye,style:s?Q({},L.style,{"--TreeView-itemDepth":typeof f=="function"?f(E):f}):L.style},lt,{children:[c.jsx(zW,Q({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:E,onClick:D,onMouseDown:_,icon:tt,expansionIcon:Se,displayIcon:Je,ownerState:ue},C,Mt,be.action==null?{}:{dragAndDropOverlayProps:be},Ae.value==null?{}:{labelInputProps:Ae},{ref:se})),p&&c.jsx(UW,Q({as:Z},de,{children:p}))]}))})});function WW(e){const{slots:t,slotProps:n,status:r}=e,o=Ai(),i=Q({},o.icons.slots,{expandIcon:o.icons.slots.expandIcon??_C,collapseIcon:o.icons.slots.collapseIcon??BC}),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=Ct({elementType:l,externalSlotProps:d=>Q({},br(s[a],d),br(n?.[a],d)),ownerState:{}});return l?c.jsx(l,Q({},u)):null}const qW=["visible"],YW=pe("li",{name:"MuiTreeItem2",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),KW=pe("div",{name:"MuiTreeItem2",slot:"Content",overridesResolver:(e,t)=>t.content,shouldForwardProp:e=>Fo(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)}}]})),GW=pe("div",{name:"MuiTreeItem2",slot:"Label",overridesResolver:(e,t)=>t.label,shouldForwardProp:e=>Fo(e)&&e!=="editable"})(({theme:e})=>Q({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative",overflow:"hidden"},e.typography.body1,{variants:[{props:({editable:t})=>t,style:{paddingLeft:"2px"}}]})),QW=pe("div",{name:"MuiTreeItem2",slot:"IconContainer",overridesResolver:(e,t)=>t.iconContainer})({width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}});pe(ml,{name:"MuiTreeItem2",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>Fo(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]});pe(M.forwardRef((e,t)=>{const{visible:n}=e,r=et(e,qW);return n?c.jsx(Th,Q({},r,{ref:t})):null}),{name:"MuiTreeItem2",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})({padding:0});function XW(e){return Ge("MuiRichTreeView",e)}qe("MuiRichTreeView",["root"]);const ZW=(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=>Q({},d,{[s]:u}))}}]}))};class JW{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 eq=e=>e.isPropagationStopped!==void 0,jC=()=>{const[e]=M.useState(()=>new JW),t=M.useCallback((...r)=>{const[o,i,s={}]=r;s.defaultMuiPrevented=!1,!(eq(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}}};jC.params={};const $C=({plugins:e})=>{const t=new Set(e);return{instance:{getAvailablePlugins:()=>t}}};$C.params={};const Fh=({params:e,state:t,setState:n})=>{M.useEffect(()=>{n(o=>o.id.treeId===e.id&&o.id.treeId!==void 0?o:Q({},o,{id:Q({},o.id,{treeId:e.id??DW()})}))},[n,e.id]);const r=e.id??t.id.treeId;return{getRootProps:()=>({id:r}),contextValue:{treeId:r}}};Fh.params={id:!0};Fh.getInitialState=({id:e})=>({id:{treeId:e??void 0}});const tq=[jC,$C,Fh],nq=["slots","slotProps","apiRef","experimentalFeatures"],rq=e=>{let{props:{slots:t,slotProps:n,apiRef:r,experimentalFeatures:o},plugins:i}=e,s=et(e.props,nq);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}},oq=({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 iq(e){const t=M.useRef({});return e?(e.current==null&&(e.current={}),e.current):t.current}const sq=({plugins:e,rootRef:t,props:n})=>{const r=[...tq,...e],{pluginParams:o,forwardedProps:i,apiRef:s,experimentalFeatures:a,slots:l,slotProps:u}=rq({plugins:r,props:n}),d=ZW(r,o),h=M.useRef({}).current,p=iq(s),m=M.useRef(null),b=Et(m,t),y=oq({plugins:r,instance:h,publicAPI:p,rootRef:m}),[x,C]=M.useState(()=>{const D={};return r.forEach(_=>{_.getInitialState&&Object.assign(D,_.getInitialState(o))}),D}),E=[],T=D=>{const _=D({instance:h,params:o,slots:l,slotProps:u,experimentalFeatures:a,state:x,setState:C,rootRef:m,models:d,plugins:r});_.getRootProps&&E.push(_.getRootProps),_.publicAPI&&Object.assign(p,_.publicAPI),_.instance&&Object.assign(h,_.instance),_.contextValue&&Object.assign(y,_.contextValue)};return r.forEach(T),{getRootProps:(D={})=>{const _=Q({role:"tree"},i,D,{ref:b});return E.forEach(O=>{Object.assign(_,O(D))}),_},rootRef:b,contextValue:y,instance:h}},aq=(e,t,n)=>{e.$$publishEvent(t,n)},ls="__TREE_VIEW_ROOT_PARENT_ID__",lq=e=>{const t={};return e.forEach((n,r)=>{t[n]=r}),t},uq=["children"],HC=({items:e,isItemDisabled:t,getItemLabel:n,getItemId:r})=>{const o={},i={},s={[ls]:[]},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(`
|
|
219
|
-
`));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(`
|
|
220
|
-
`));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(`
|
|
221
|
-
`));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??ls;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]=lq(s[u])}),{itemMetaMap:o,itemMap:i,itemOrderedChildrenIds:s,itemChildrenIndexes:l}},Fl=({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 E=n.items.itemMap[C],T=et(E,uq),I=n.items.itemOrderedChildrenIds[C];return I&&(T.children=I.map(x)),T};return n.items.itemOrderedChildrenIds[ls].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??ls;return n.items.itemChildrenIndexes[C][x]},[e,n.items.itemChildrenIndexes]),d=M.useCallback(x=>n.items.itemOrderedChildrenIds[x??ls]??[],[n.items.itemOrderedChildrenIds]),f=x=>{const C=e.getItemMeta(x);return C==null?null:document.getElementById(Rh({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=HC({items:t.items,isItemDisabled:t.isItemDisabled,getItemId:t.getItemId,getItemLabel:t.getItemLabel});return Object.values(x.items.itemMetaMap).forEach(E=>{C.itemMetaMap[E.id]||aq(e,"removeItem",{id:E.id})}),Q({},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 E=n.items.itemMetaMap[C];return{label:E.label,itemId:E.id,id:E.idAttribute,children:n.items.itemOrderedChildrenIds[C]?.map(x)}};return n.items.itemOrderedChildrenIds[ls].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}}}};Fl.getInitialState=e=>({items:HC({items:e.items,isItemDisabled:e.isItemDisabled,getItemId:e.getItemId,getItemLabel:e.getItemLabel})});Fl.getDefaultizedParams=({params:e})=>Q({},e,{disabledItemsFocusable:e.disabledItemsFocusable??!1,itemChildrenIndentation:e.itemChildrenIndentation??"12px"});Fl.wrapRoot=({children:e,instance:t})=>c.jsx(Ph.Provider,{value:n=>t.getItemMeta(n)?.depth??0,children:e});Fl.params={disabledItemsFocusable:!0,items:!0,isItemDisabled:!0,getItemLabel:!0,getItemId:!0,onItemClick:!0,itemChildrenIndentation:!0};const qc=({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}}}};qc.models={expandedItems:{getDefaultValue:e=>e.defaultExpandedItems}};const cq=[];qc.getDefaultizedParams=({params:e})=>Q({},e,{defaultExpandedItems:e.defaultExpandedItems??cq});qc.params={expandedItems:!0,defaultExpandedItems:!0,onExpandedItemsChange:!0,onItemExpansionToggle:!0,expansionTrigger:!0};const Nu=e=>Array.isArray(e)?e:e!=null?[e]:[],rf=e=>{const t={};return e.forEach(n=>{t[n]=!0}),t},Yc=({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(E=>!e.isItemSelected(E)),C=n.selectedItems.value.filter(E=>!y.includes(E));x.forEach(E=>{t.onItemSelectionToggle(b,E,!0)}),C.forEach(E=>{t.onItemSelectionToggle(b,E,!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 E;if(x){const T=Nu(n.selectedItems.value),I=e.isItemSelected(y);I&&(C===!1||C==null)?E=T.filter(D=>D!==y):!I&&(C===!0||C==null)?E=[y].concat(T):E=T}else C===!1||C==null&&e.isItemSelected(y)?E=t.multiSelect?[]:null:E=t.multiSelect?[y]:y;s(b,E),r.current=y,o.current={}},u=(b,[y,x])=>{if(t.disableSelection||!t.multiSelect)return;let C=Nu(n.selectedItems.value).slice();Object.keys(o.current).length>0&&(C=C.filter(D=>!o.current[D]));const E=rf(C),T=kW(e,y,x),I=T.filter(D=>!E[D]);C=C.concat(I),s(b,C),o.current=rf(T)};return{getRootProps:()=>({"aria-multiselectable":t.multiSelect}),publicAPI:{selectItem:l},instance:{isItemSelected:a,selectItem:l,selectAllNavigableItems:b=>{if(t.disableSelection||!t.multiSelect)return;const y=wW(e);s(b,y),o.current=rf(y)},expandSelectionRange:(b,y)=>{if(r.current!=null){const[x,C]=NC(e,y,r.current);u(b,[x,C])}},selectRangeFromStartToItem:(b,y)=>{u(b,[gl(e),y])},selectRangeFromItemToEnd:(b,y)=>{u(b,[y,RC(e)])},selectItemFromArrowNavigation:(b,y,x)=>{if(t.disableSelection||!t.multiSelect)return;let C=Nu(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(E=>E!==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}}}};Yc.models={selectedItems:{getDefaultValue:e=>e.defaultSelectedItems}};const dq=[];Yc.getDefaultizedParams=({params:e})=>Q({},e,{disableSelection:e.disableSelection??!1,multiSelect:e.multiSelect??!1,checkboxSelection:e.checkboxSelection??!1,defaultSelectedItems:e.defaultSelectedItems??(e.multiSelect?dq:null)});Yc.params={disableSelection:!0,multiSelect:!0,checkboxSelection:!0,defaultSelectedItems:!0,selectedItems:!0,onSelectedItemsChange:!0,onItemSelectionToggle:!0};const kb=1e3;class fq{constructor(t=kb){this.timeouts=new Map,this.cleanupTimeout=kb,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 pq{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 hq{}function mq(e){let t=0;return function(r,o,i){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new pq:new fq);const[s]=M.useState(new hq),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 gq={registry:null},bq=mq(gq),zC=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?zC(t.shadowRoot):t:null},yq=(e,t)=>{let n=Nu(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=gl(e)),n},Lh=({instance:e,params:t,state:n,setState:r,models:o,rootRef:i})=>{const s=yq(e,o.selectedItems.value),a=Ve(y=>{const x=typeof y=="function"?y(n.focusedItemId):y;n.focusedItemId!==x&&r(C=>Q({},C,{focusedItemId:x}))}),l=M.useCallback(()=>!!i.current&&i.current.contains(zC(gn(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;bq(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}}};Lh.getInitialState=()=>({focusedItemId:null});Lh.params={onItemFocus:!0};function xq(e){return!!e&&e.length===1&&!!e.match(/\S/)}const UC=({instance:e,params:t,state:n})=>{const r=wr(),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=Ru(e,x);return C===null?gl(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||bl(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":{fi(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=Ru(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=PC(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=Ru(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,gl(e)),d.preventDefault();break}case p==="End":{a(f)&&t.multiSelect&&h&&d.shiftKey?e.selectRangeFromItemToEnd(d,f):e.focusItem(d,RC(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&&xq(p)):{const m=s(f,p);m!=null&&(e.focusItem(d,m),d.preventDefault());break}}}}}};UC.params={};const VC=({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}}}});VC.params={};const vq=[Fl,qc,Yc,Lh,UC,VC,xr],Cq=["ownerState"];function Eq({slots:e,slotProps:t,label:n,id:r,itemId:o,itemsToRender:i}){const s=e?.item??VW,a=Ct({elementType:s,externalSlotProps:t?.item,additionalProps:{itemId:o,id:r,label:n},ownerState:{itemId:o,label:n}}),l=et(a,Cq),u=M.useMemo(()=>i?c.jsx(WC,{itemsToRender:i,slots:e,slotProps:t}):null,[i,e,t]);return c.jsx(s,Q({},l,{children:u}))}function WC(e){const{itemsToRender:t,slots:n,slotProps:r}=e;return c.jsx(M.Fragment,{children:t.map(o=>c.jsx(Eq,{slots:n,slotProps:r,label:o.label,id:o.id,itemId:o.itemId,itemsToRender:o.children},o.itemId))})}const Tq=IC(),Sq=e=>{const{classes:t}=e;return Ke({root:["root"]},XW,t)},kq=pe("ul",{name:"MuiRichTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0,position:"relative"}),wq=M.forwardRef(function(t,n){const r=Tq({props:t,name:"MuiRichTreeView"}),{getRootProps:o,contextValue:i,instance:s}=sq({plugins:vq,rootRef:n,props:r}),{slots:a,slotProps:l}=r,u=Sq(r),d=a?.root??kq,f=Ct({elementType:d,externalSlotProps:l?.root,className:u.root,getSlotProps:o,ownerState:r});return c.jsx(EW,{value:i,children:c.jsx(d,Q({},f,{children:c.jsx(WC,{slots:a,slotProps:l,itemsToRender:s.getItemsToRender()})}))})}),Dq=gt([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")]),Iq=gt(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"})),Aq=gt(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"})),Oq=gt(c.jsx("path",{d:"M15 4v2h3v12h-3v2h5V4zM4 20h5v-2H6V6h3V4H4z"}));function Mq({items:e,defaultExpandedItems:t,onClickTreeNode:n}){return c.jsx(wq,{items:Lq(e,n),defaultExpandedItems:t,slots:{item:Fq}})}const Pq=Db.animated(ml);function Rq(e){const t=Db.useSpring({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return c.jsx(Pq,{style:t,...e})}function Nq({item:e,...t}){const n=c.jsxs(GW,{...t,sx:{display:"flex",alignItems:"center",color:e.error?"error.main":"grey.600"},children:[e.fileType==="directory"&&c.jsx(CC,{})||e.fileType==="notebook"&&c.jsx(Dq,{})||e.fileType==="model"&&c.jsx(Oq,{})||e.fileType=="database"&&c.jsx(Aq,{})||c.jsx(Iq,{}),c.jsx(k.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(k.Tooltip,{title:e.error,placement:"right",children:n}):n}const Fq=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}=AW({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(Nh,{itemId:o,children:c.jsxs(YW,{...u(l),children:[c.jsxs(KW,{...d(),...y.link&&{onClick:x=>y.link(x)},sx:{pointerEvents:!y.selectable&&"none"},children:[c.jsx(QW,{...h(),children:c.jsx(WW,{status:m})}),c.jsx(Nq,{...f({item:y})})]}),s&&c.jsx(Rq,{...p()})]})})});function Lq(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))})}),qC(n,"",t)}function qC(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:qC(o,a,n)})}}),r}const _q=["notebooks/","models/"];function Bq({onClickModelFile:e,resourceUri:t}){const{environmentName:n,packageName:r,versionId:o}=jt(t),{apiClients:i}=Ie.useServer(),{data:s,isError:a,error:l,isSuccess:u}=zt({queryKey:["models",n,r,o],queryFn:()=>i.models.listModels(n,r,o)});return c.jsx(Ie.PackageCard,{children:c.jsxs(Ie.PackageCardContent,{children:[c.jsx(Ie.PackageSectionTitle,{children:"Semantic Models"}),c.jsxs(k.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!u&&!a&&c.jsx(xn,{text:"Fetching Models..."}),a&&c.jsx(vn,{error:l,context:`${n} > ${r} > Models`}),u&&s.data.length>0&&c.jsx(Mq,{items:s.data.sort((d,f)=>d.path.localeCompare(f.path)),onClickTreeNode:e,defaultExpandedItems:_q}),u&&s.data.length===0&&c.jsx(k.Typography,{variant:"body2",children:"No models found"})]})]})})}function YC(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 KC(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 GC(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 Ie.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 jq=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:KC(e),theme:YC(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};typeof window<"u"&&import("@malloydata/render");async function $q(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 GC(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:n});return}}function Hq(e,t,n){const r=Zv(t,n);for(const[o,i]of Object.entries(r))e.style.setProperty(o,i)}const zq=`
|
|
222
|
-
/* Card geometry, through the renderer's OWN theme vars rather than over the top
|
|
223
|
-
of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
|
|
224
|
-
passes each through to the --malloy-render--* the card CSS reads, so a value
|
|
225
|
-
inherited from our wrapper loses to that declaration however early it is set:
|
|
226
|
-
this has to be a rule on the same element, at higher specificity. Doubling the
|
|
227
|
-
class does that, and then no !important is needed — which matters, because
|
|
228
|
-
!important here also lands on .dashboard-item-borderless and repaints a card
|
|
229
|
-
the author asked to have no card. */
|
|
230
|
-
.malloy-render.malloy-render {
|
|
231
|
-
--malloy-theme--dashboard-card-radius: var(--publisher-dashboard-card-radius);
|
|
232
|
-
--malloy-theme--dashboard-card-padding: var(--publisher-dashboard-card-padding);
|
|
233
|
-
}
|
|
234
|
-
/* dashboard.css hardcodes background: #f7f9fc on .malloy-dashboard
|
|
235
|
-
and .dashboard-row-header, which would paint light grey in dark
|
|
236
|
-
mode and also bleed an operator-picked palette.background across
|
|
237
|
-
the panel chrome in light. Both surfaces use
|
|
238
|
-
--malloy-render--background here, which buildMalloyExplicitTheme
|
|
239
|
-
wires to dashboardRoot: a mode-keyed neutral that stays decoupled
|
|
240
|
-
from palette.background (the chart canvas) on purpose. Selectors
|
|
241
|
-
are duplicated at higher specificity to beat the renderer s own
|
|
242
|
-
scoped rules. */
|
|
243
|
-
.malloy-render .malloy-dashboard,
|
|
244
|
-
.malloy-render.malloy-render .malloy-dashboard,
|
|
245
|
-
div.malloy-render .malloy-dashboard {
|
|
246
|
-
/* --publisher-dashboard-root is set on the outer Publisher wrapper
|
|
247
|
-
(see buildTableCssVars) and stays decoupled from
|
|
248
|
-
--malloy-render--background, which gets shadowed inside the
|
|
249
|
-
renderer when a theme.background annotation is present. The
|
|
250
|
-
dedicated var means the panel between tiles always paints the
|
|
251
|
-
operator neutral dashboardRoot regardless of annotations. */
|
|
252
|
-
background: var(--publisher-dashboard-root) !important;
|
|
253
|
-
background-color: var(--publisher-dashboard-root) !important;
|
|
254
|
-
color: var(--malloy-render--table-body-color) !important;
|
|
255
|
-
}
|
|
256
|
-
.malloy-render .malloy-dashboard .dashboard-row,
|
|
257
|
-
.malloy-render .malloy-dashboard .dashboard-row-body,
|
|
258
|
-
.malloy-render .malloy-dashboard .dashboard-row-header,
|
|
259
|
-
.malloy-render.malloy-render .malloy-dashboard .dashboard-row-header,
|
|
260
|
-
div.malloy-render .malloy-dashboard .dashboard-row-header {
|
|
261
|
-
/* Belt + suspenders: dashboard.css hardcodes .dashboard-row-header
|
|
262
|
-
to #f7f9fc, and row / row-body have no explicit background but
|
|
263
|
-
get caught in any annotation-driven inline writes. Force all of
|
|
264
|
-
them to the neutral panel colour. */
|
|
265
|
-
background: var(--publisher-dashboard-root) !important;
|
|
266
|
-
background-color: var(--publisher-dashboard-root) !important;
|
|
267
|
-
}
|
|
268
|
-
.malloy-render .malloy-dashboard .dashboard-item:not(.dashboard-item-borderless) {
|
|
269
|
-
/* Tile padding around each chart / table. Uses our custom
|
|
270
|
-
--malloy-render--tile-background so the operator can theme the
|
|
271
|
-
tile separately from the table header row (which paints from
|
|
272
|
-
--malloy-render--table-pinned-background below).
|
|
273
|
-
|
|
274
|
-
A flat bordered card rather than the renderer's shadow ring, which is what
|
|
275
|
-
makes it match the composite tile's Paper. :not(borderless) because
|
|
276
|
-
# borderless asks for no card at all, and an !important background and
|
|
277
|
-
border drew one anyway. */
|
|
278
|
-
background: var(--malloy-render--tile-background) !important;
|
|
279
|
-
color: var(--malloy-render--table-body-color) !important;
|
|
280
|
-
box-shadow: none !important;
|
|
281
|
-
border: var(--malloy-render--table-border) !important;
|
|
282
|
-
}
|
|
283
|
-
.malloy-render .malloy-dashboard .dashboard-row-header-separator {
|
|
284
|
-
background: var(--malloy-render--table-border) !important;
|
|
285
|
-
}
|
|
286
|
-
.malloy-render .malloy-table .th.column-cell {
|
|
287
|
-
/* Non-pinned tables have no header background in the renderer's
|
|
288
|
-
own CSS (only pinned scrolled tables paint the pinned-header
|
|
289
|
-
with this var). Force the same value here so every table has a
|
|
290
|
-
visible header band reflecting the operator's choice. */
|
|
291
|
-
background: var(--malloy-render--table-pinned-background) !important;
|
|
292
|
-
}
|
|
293
|
-
.malloy-render .dashboard-item-title,
|
|
294
|
-
.malloy-render .dashboard-dimension-name {
|
|
295
|
-
color: var(--malloy-render--label-color) !important;
|
|
296
|
-
}
|
|
297
|
-
.malloy-render .dashboard-item-value,
|
|
298
|
-
.malloy-render .dashboard-item-value-measure,
|
|
299
|
-
.malloy-render .dashboard-dimension-value {
|
|
300
|
-
color: var(--malloy-render--value-color) !important;
|
|
301
|
-
}
|
|
302
|
-
.malloy-render .malloy-table,
|
|
303
|
-
.malloy-render .malloy-list {
|
|
304
|
-
color: var(--malloy-render--table-body-color) !important;
|
|
305
|
-
}
|
|
306
|
-
.malloy-render .column-cell.th,
|
|
307
|
-
.malloy-render .cell-content.header {
|
|
308
|
-
color: var(--malloy-render--table-header-color) !important;
|
|
309
|
-
}
|
|
310
|
-
/* A cell whose column declares a "# drill" this surface can honor, marked
|
|
311
|
-
by markDrillableCells. Ordinary text with a pointer cursor until hovered,
|
|
312
|
-
then it reads as a link: the same affordance Malloyyo gives the same tag,
|
|
313
|
-
and the only thing that tells a reader a cell navigates. Kept off the
|
|
314
|
-
resting state deliberately: a column painted blue competes with the data.
|
|
315
|
-
(No backticks in here: this is inside a template literal.) */
|
|
316
|
-
.malloy-render .${Xr} {
|
|
317
|
-
cursor: pointer;
|
|
318
|
-
}
|
|
319
|
-
.malloy-render .${Xr}:hover > .cell-content {
|
|
320
|
-
color: var(--publisher-drill-link) !important;
|
|
321
|
-
text-decoration: underline;
|
|
322
|
-
}
|
|
323
|
-
/* Keyboard focus reads the same as hover, plus a ring: a hover colour is not
|
|
324
|
-
something a keyboard user can produce, and a focus ring is not something a
|
|
325
|
-
mouse user sees. focus-visible rather than focus, so a click does not leave a
|
|
326
|
-
ring behind it. (No backticks in here: this is inside a template literal.) */
|
|
327
|
-
.malloy-render .${Xr}:focus-visible {
|
|
328
|
-
outline: 2px solid var(--publisher-drill-link);
|
|
329
|
-
outline-offset: -2px;
|
|
330
|
-
}
|
|
331
|
-
.malloy-render .${Xr}:focus-visible > .cell-content {
|
|
332
|
-
color: var(--publisher-drill-link) !important;
|
|
333
|
-
text-decoration: underline;
|
|
334
|
-
}
|
|
335
|
-
`,wb="publisher-malloy-renderer-overrides";function Uq(){if(typeof document>"u"||document.getElementById(wb))return;const e=document.createElement("style");e.id=wb,e.textContent=zq,document.head.appendChild(e)}function Vq(e){try{return e.getMetadata()?.getRootField().renderAs()==="table"}catch{return!1}}function Wq({result:e,height:t,drill:n,onSizeChange:r}){const o=W.useRef(null),i=W.useRef(n);i.current=n;const s=W.useCallback(y=>{i.current?.onClick(y)},[]),a=n!==void 0,l=W.useRef(!1),u=W.useRef(null),d=W.useRef(0),{theme:f,layers:h,mode:p}=Ie.usePublisherTheme(),m=k.useTheme().shape.borderRadius,b=W.useMemo(()=>({radius:`${m}px`,padding:`${Ch}px`}),[m]);return W.useEffect(()=>()=>{d.current+=1,u.current?.viz.remove(),u.current=null},[]),W.useLayoutEffect(()=>{if(!o.current||!e)return;Uq();const y=o.current,x=d.current+=1;let C=!1;const E=()=>!C&&x===d.current;let T,I,D=null,_=0,O=null,B=null,L=null,j=null,S=null,$=null,F=null,R=0,H=null;l.current=!1;const V=Y=>{if(C||!Y.firstElementChild)return;const P=Y.firstElementChild.firstElementChild;if(!P)return;const J=I!==void 0&&Vq(I);if(l.current&&!J)return;const re=P.firstElementChild;let z=P.scrollHeight||P.offsetHeight||0;re&&P.classList.contains("malloy-dashboard")&&(z=re.scrollHeight||re.offsetHeight||0),z>0&&(l.current=!0,r&&z!==R&&(R=z,r(z))),J&&F!==P&&(F=P,$?.disconnect(),$=new ResizeObserver(()=>V(Y)),$.observe(P))};return(async()=>{let Y;try{Y=JSON.parse(e)}catch(G){console.error("Error parsing visualization result:",G);return}const q=await $q(Y),P=q?Ie.resolveTheme([...h,q],p):f;if(!E())return;try{I=await jq(P,s)}catch(G){console.error("Failed to create renderer:",G);return}if(!E()){I.remove(),I=void 0;return}const J=u.current;T=document.createElement("div"),T.style.width="100%",T.style.height="100%",Hq(T,P,b),J&&(y.style.position="relative",T.style.position="absolute",T.style.inset="0",T.style.visibility="hidden"),y.appendChild(T);const re=T;j=new MutationObserver(()=>{S&&clearTimeout(S),S=setTimeout(()=>{V(re),l.current&&j?.disconnect()},100)}),j.observe(T,{childList:!0,subtree:!0,attributes:!0});const z=I;let ye=!1;const se=()=>{ye||!E()||(ye=!0,H&&(clearTimeout(H),H=null),J&&(J.viz.remove(),J.node.parentNode===y&&y.removeChild(J.node)),re.style.position="",re.style.inset="",re.style.visibility="",y.style.position="",u.current={viz:z,node:re},V(re))};try{I.setResult(Y),I.render(T);const G=i.current;try{if(G){const le=O2(I,G.canDrill),oe=()=>{try{M2(re,le)}catch(de){console.warn("Drill affordance skipped:",de)}};oe();const ue=de=>{const ne=de.querySelector(".cell-content")??de,Ce=ne.getBoundingClientRect();ne.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:ne.ownerDocument.defaultView,clientX:Math.round(Ce.left+Ce.width/2),clientY:Math.round(Ce.bottom)}))},ie=de=>de.target?.closest?.(`.${Xr}`)??null,Z=(de,ae)=>{Fg(de,ae)?.focus()};O=de=>{const ae=ie(de);if(!ae)return;const ne=de.key==="ArrowDown"?1:de.key==="ArrowUp"?-1:de.key==="Home"?"first":de.key==="End"?"last":void 0;if(ne!==void 0){de.preventDefault(),Z(ae,ne);return}de.key==="Enter"?(de.preventDefault(),ue(ae)):de.key===" "&&de.preventDefault()},B=de=>{if(de.key!==" ")return;const ae=ie(de);ae&&(de.preventDefault(),ue(ae))},L=de=>{const ae=de.target?.closest?.(`.${Xr}`);ae&&Fg(ae,0)},re.addEventListener("keydown",O),re.addEventListener("keyup",B),re.addEventListener("focusin",L),le.size>0&&typeof MutationObserver<"u"&&(D=new MutationObserver(()=>{cancelAnimationFrame(_),_=requestAnimationFrame(oe)}),D.observe(re,{childList:!0,subtree:!0}))}}catch(le){console.warn("Drill affordance skipped:",le)}I.onReady(se),H=setTimeout(se,1e4)}catch(G){console.error("Error rendering visualization:",G),j?.disconnect(),$?.disconnect(),D?.disconnect(),I.remove(),I=void 0,re.parentNode===y&&y.removeChild(re)}})(),()=>{C=!0,j?.disconnect(),$?.disconnect(),S&&clearTimeout(S),H&&clearTimeout(H),T&&u.current?.node!==T&&(O&&T.removeEventListener("keydown",O),B&&T.removeEventListener("keyup",B),L&&T.removeEventListener("focusin",L),D?.disconnect(),cancelAnimationFrame(_),I?.remove(),T.parentNode===y&&y.removeChild(T),y.style.position="")}},[e,s,a,r,f,h,p,b]),c.jsx("div",{ref:o,style:{width:"100%",height:t?`${t}px`:"400px"}})}function QC(e){return typeof window>"u"?c.jsx(k.Box,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):c.jsx(W.Suspense,{fallback:c.jsx(k.Box,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:c.jsx(Wq,{...e})})}const qq=Object.freeze(Object.defineProperty({__proto__:null,default:QC},Symbol.toStringTag,{value:"Module"}));function XC(e,t){return`${e}:${t}`}function vi(e){return XC(e.source,e.filterName??e.dimensionName)}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"?`'${_o(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function Yq(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'%${_o(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 Kq(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 Gq(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=>Yq(u)).filter(u=>u.length>0).join(" and "):"";return`
|
|
336
|
-
run: ${e} -> {
|
|
337
|
-
${l?`where: ${l}`:""}
|
|
338
|
-
index: ${s}
|
|
339
|
-
} -> {
|
|
340
|
-
select: *
|
|
341
|
-
order_by: weight desc
|
|
342
|
-
|
|
343
|
-
limit: ${n}
|
|
344
|
-
}
|
|
345
|
-
`}function Qq(e,t){const n=new Map;for(const d of t){const f=vi(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=vi(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 ZC(e){const{environment:t,package:n,dimensionSpecs:r,versionId:o,enabled:i=!0,indexLimit:s=1e4,activeFilters:a=[]}=e,l=W.useMemo(()=>Kq(r),[r]),u=W.useMemo(()=>{const b=[];for(const[y,x]of l){const[C,E]=y.split("|"),T=Gq(C,x,s,a);T?b.push({key:y,source:C,model:E,query:T,specs:x}):console.log("No query for source: ",C,"model: ",E)}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}=Ie.useServer(),h=zt({queryKey:["dimensionalFilter",t,n,r,o,a],queryFn:async()=>{if(!d){const C=new Map;for(const E of r){const T=vi(E);C.set(T,[])}return{values:C,noRowsMatchedFilter:!1}}const b=await Promise.all(u.map(async C=>{const E=await f.models.executeQueryModel(t,n,C.model,{query:C.query,versionId:o,bypassFilters:!0});return{config:C,result:Qq(E.data.result,C.specs)}})),y=new Map;let x=!1;for(const{result:C}of b){for(const[E,T]of C.values)y.set(E,T);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=vi(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 Wr(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"?`'${_o(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function Xq(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} = ${Wr(l,s)}`).join(" or ")})`:Array.isArray(r)?"":`${i} = ${Wr(r,s)}`;case"Contains":return typeof r=="string"?`${i} ~ f'%${_o(r)}%'`:Array.isArray(r)?"":`${i} = ${Wr(r)}`;case"After":return Array.isArray(r)?"":`${i} > ${Wr(r,s)}`;case"Before":return Array.isArray(r)?"":`${i} < ${Wr(r,s)}`;case"Greater Than":return Array.isArray(r)?"":`${i} > ${Wr(r)}`;case"Less Than":return Array.isArray(r)?"":`${i} < ${Wr(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${i} >= ${Wr(r,s)} and ${i} <= ${Wr(o,s)}`:`${i} >= ${Wr(r,s)}`;default:return""}}function JC(e){const{dimensionSpecs:t}=e,[n,r]=W.useState(()=>{const u=new Map;return t.forEach(d=>{const f=vi(d);u.set(f,{spec:d,selection:null})}),u});W.useEffect(()=>{r(u=>{const d=new Map;return t.forEach(f=>{const h=vi(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=>Xq(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 qr(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"?`'${_o(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function Zq(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} = ${qr(l,s)}`).join(" or ")})`:Array.isArray(r)?"":`${i} = ${qr(r,s)}`;case"Contains":return typeof r=="string"?`${i} ~ f'%${_o(r)}%'`:Array.isArray(r)?"":`${i} = ${qr(r)}`;case"After":return Array.isArray(r)?"":`${i} > ${qr(r,s)}`;case"Before":return Array.isArray(r)?"":`${i} < ${qr(r,s)}`;case"Greater Than":return Array.isArray(r)?"":`${i} > ${qr(r)}`;case"Less Than":return Array.isArray(r)?"":`${i} < ${qr(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${i} >= ${qr(r,s)} and ${i} <= ${qr(o,s)}`:`${i} >= ${qr(r,s)}`;default:return""}}function Jq(e){if(e.length===0)return"";const t=e.map(n=>Zq(n)).filter(n=>n.length>0);return t.length===0?"":t.join(" and ")}function eY(e,t,n,r=1e3){const o=Jq(t),s=n&&n.length>0?`group_by: ${n.map(a=>`\`${a}\``).join(", ")}`:"select: *";return o?`
|
|
346
|
-
run: ${e} -> {
|
|
347
|
-
where: ${o}
|
|
348
|
-
${s}
|
|
349
|
-
limit: ${r}
|
|
350
|
-
}
|
|
351
|
-
`:`
|
|
352
|
-
run: ${e} -> {
|
|
353
|
-
${s}
|
|
354
|
-
limit: ${r}
|
|
355
|
-
}
|
|
356
|
-
`}function eE(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(()=>eY(o,i,s,a),[o,i,s,a]),f=W.useMemo(()=>Il({environmentName:t,packageName:n,modelPath:r}),[t,n,r]),h=i.length>0,p=W.useCallback(()=>{if(!h){u(null);return}const m=Mh({resourceUri:f,query:d});u(m)},[h,f,d]);return{embeddedQueryResult:l,queryString:d,resourceUri:f,executeQuery:p,canExecute:h}}function tY(e,t=5e3){const n=e.dimensionSpecs[0]?.source??"",r=e.dimensionSpecs[0]?.model??"",{filterStates:o,updateFilter:i,clearAllFilters:s,getActiveFilters:a}=JC({dimensionSpecs:e.dimensionSpecs}),l=W.useMemo(()=>a(),[o,a]),{data:u,noRowsMatchedFilter:d,isLoading:f,isError:h,error:p,refetch:m}=ZC({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:E}=eE({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:E}}function nY({modelPath:e,query:t,sourceName:n,queryName:r,enabled:o=!0,resourceUri:i}){const{environmentName:s,packageName:a,versionId:l}=jt(i),{apiClients:u}=Ie.useServer(),{data:d,isSuccess:f,isError:h,error:p,isLoading:m}=zt({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=KN;exports.BrowserWorkbookStorage=YN;exports.ConnectionExplorer=yC;exports.DOC_LINKS=Fr;exports.DRILL_CELL_CLASS=Xr;exports.DRILL_SELF=Eu;exports.Dashboard=dz;exports.DashboardTile=qf;exports.DataAppViewer=mz;exports.DimensionFilter=CV;exports.EmbeddedQueryResult=JV;exports.Environment=XU;exports.EnvironmentMaterializations=hC;exports.GivenInput=Xv;exports.GivensPanel=vh;exports.Home=qV;exports.Loading=xn;exports.Materializations=SU;exports.Model=QV;exports.ModelExplorer=Ah;exports.ModelExplorerDialog=Oh;exports.Models=Bq;exports.Notebook=DC;exports.Package=mW;exports.Packages=xC;exports.QueryResult=wC;exports.RenderedResult=QC;exports.ResultContainer=Si;exports.SourceExplorerComponent=x2;exports.SourcesExplorer=_p;exports.Workbook=WN;exports.WorkbookList=T2;exports.WorkbookManager=cs;exports.WorkbookStorageProvider=zN;exports.buildMalloyExplicitTheme=YC;exports.buildTableCssVars=Zv;exports.buildVegaThemeOverride=KC;exports.ccount=Cf;exports.createEmbeddedQueryResult=Mh;exports.drillDestinations=zp;exports.drillValueToFilter=Rc;exports.drillableFieldNames=O2;exports.encodeDrillValue=Vp;exports.encodeResourceUri=Il;exports.extractDimensionSpecs=wV;exports.extractSourceFromQuery=IV;exports.find=El;exports.generateFilterClause=DV;exports.getDimensionKey=vi;exports.getJoinedSources=EV;exports.html=Ms;exports.htmlVoidElements=fx;exports.humanizeSlug=Up;exports.injectWhereClause=AV;exports.makeDimensionKey=XC;exports.markDrillableCells=M2;exports.packageFileUrl=eC;exports.parseAllSourceInfos=kV;exports.parseDimensionFilterAnnotation=vC;exports.parseNotebookFilterAnnotation=TV;exports.parseResourceUri=jt;exports.readChartAnnotations=GC;exports.resolveDrill=R2;exports.stringify=xc;exports.stringify$1=vc;exports.svg=jo;exports.useDimensionFilters=JC;exports.useDimensionFiltersFromSpec=tY;exports.useDimensionFiltersQuery=eE;exports.useDimensionalFilterRangeData=ZC;exports.useDrill=Wp;exports.useGivensState=$p;exports.useModelData=Ih;exports.useModelGivens=kC;exports.useRawQueryData=nY;exports.useRouterClickHandler=E2;exports.useSuggestOptions=Hp;exports.whitespace=ap;exports.zwitch=Dc;
|