@milaboratories/milaboratories.monetization-test.ui 1.1.39 → 1.1.40

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.
@@ -664,7 +664,7 @@ If you are trying to annotate ${s} with application data, use the '${s}.context'
664
664
  <div data-ref="eMenuContainer" class="ag-chart-docked-container"></div>
665
665
  </div>
666
666
  </div>
667
- `),this.eChart=fe,this.eWrapper=fe,this.eChartContainer=fe,this.eMenuContainer=fe,this.eEmpty=fe,this.params=e}wireBeans(e){this.crossFilterService=e.chartCrossFilterSvc,this.chartTranslation=e.chartTranslation,this.chartMenuSvc=e.chartMenuSvc,this.focusSvc=e.focusSvc,this.popupSvc=e.popupSvc,this.enterpriseChartProxyFactory=e.enterpriseChartProxyFactory,this.environment=e.environment}postConstruct(){const e={...this.params,chartType:SS(this.params.chartType),chartThemeName:this.getThemeName()},t=this.gos.get("enableRtl");this.eWrapper.classList.add(t?"ag-rtl":"ag-ltr");const r=this.createBean(new y2e(e));this.chartController=this.createManagedBean(new nFe(r)),this.chartOptionsService=this.createManagedBean(new hRe(this.chartController)),this.validateCustomThemes(),this.createChart(),this.params.insideDialog?this.addDialog():(this.addManagedEventListeners({gridStylesChanged:this.updateTheme.bind(this)}),this.updateTheme()),this.addMenu(),this.addManagedElementListeners(this.getGui(),{focusin:this.setActiveChartCellRange.bind(this)}),this.addManagedListeners(this.chartController,{chartModelUpdate:this.update.bind(this)}),this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes"],this.reactivePropertyUpdate.bind(this)),this.update(),this.raiseChartCreatedEvent()}updateTheme(){this.environment.applyThemeClasses(this.getGui())}createChart(){let e;this.chartProxy&&(e=this.chartProxy.destroy({keepChartInstance:!0}));const t=(n,i)=>{const o=this.params.crossFilteringContext;o.lastSelectedChartId=i?"":this.chartController.getChartId(),i&&this.params.crossFilteringResetCallback(),this.crossFilterService.filter(n,i)},r=this.chartController.getChartType(),s={agChartsExports:this.beans.agChartsExports,chartType:r,chartInstance:e,getChartThemeName:this.getChartThemeName.bind(this),getChartThemes:this.getChartThemes.bind(this),customChartThemes:this.gos.get("customChartThemes"),getGridOptionsChartThemeOverrides:()=>this.getGridOptionsChartThemeOverrides(),getExtraPaddingDirections:()=>{var n;return((n=this.chartMenu)==null?void 0:n.getExtraPaddingDirections())??[]},apiChartThemeOverrides:this.params.chartThemeOverrides,crossFiltering:this.params.crossFiltering??!1,crossFilterCallback:t,parentElement:this.eChart,grouping:this.chartController.isGrouping(),chartThemeToRestore:this.params.chartThemeName,chartOptionsToRestore:this.params.chartOptionsToRestore,chartPaletteToRestore:this.params.chartPaletteToRestore,seriesChartTypes:this.chartController.getSeriesChartTypes(),translate:n=>this.chartTranslation.translate(n)};if(this.params.chartOptionsToRestore=void 0,this.chartType=r,this.chartProxy=this.createChartProxy(s),!this.chartProxy){Ce(138,{chartType:s.chartType});return}this.chartController.setChartProxy(this.chartProxy),this.createMenuContext()}createMenuContext(){if(this.chartMenuContext)return;const e=this.createManagedBean(new Ev(this.chartOptionsService.getChartThemeOverridesProxy())),t=this.createManagedBean(new Ev(this.chartOptionsService.getAxisThemeOverridesProxy()));this.chartMenuContext={chartController:this.chartController,chartOptionsService:this.chartOptionsService,chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t}}getChartThemeName(){return this.chartController.getChartThemeName()}getChartThemes(){return this.chartController.getThemeNames()}getGridOptionsChartThemeOverrides(){return this.gos.get("chartThemeOverrides")}createChartProxy(e){var s;const{chartType:t}=e;switch(t){case"column":case"bar":case"groupedColumn":case"stackedColumn":case"normalizedColumn":case"groupedBar":case"stackedBar":case"normalizedBar":return new aFe(e);case"pie":case"donut":case"doughnut":return new hFe(e);case"area":case"stackedArea":case"normalizedArea":return new iFe(e);case"line":case"stackedLine":case"normalizedLine":return new lFe(e);case"scatter":case"bubble":return new cFe(e);case"columnLineCombo":case"areaColumnCombo":case"customCombo":return new uFe(e)}const r=(s=this.enterpriseChartProxyFactory)==null?void 0:s.createChartProxy(e);if(!r)throw Kc(251,{chartType:t});return r}addDialog(){const e=this.chartTranslation.translate(this.params.pivotChart?"pivotChartTitle":"rangeChartTitle"),{width:t,height:r}=this.getBestDialogSize(),s=this.params.focusDialogOnOpen?()=>setTimeout(()=>wi(this.getGui())):void 0;this.chartDialog=new Ux({resizable:!0,movable:!0,maximizable:!0,title:e,width:t,height:r,component:this,centered:!0,closable:!0,afterGuiAttached:s,postProcessPopupParams:{type:"chart"}}),this.createBean(this.chartDialog),this.chartDialog.addEventListener("destroyed",()=>{this.destroy(),this.chartMenuSvc.hideAdvancedSettings();const n=this.focusSvc.getFocusedCell();setTimeout(()=>{this.focusSvc.isAlive()&&(n?this.focusSvc.setFocusedCell({...n,forceBrowserFocus:!0}):Nj(this.beans))})})}getBestDialogSize(){const e=this.popupSvc.getPopupParent(),t=mv(e)*.75,r=KR(e)*.75,s=.553,n=this.chartProxy.getChart();let i=this.params.insideDialog?850:n.width,o=this.params.insideDialog?470:n.height;return(i>t||o>r)&&(i=Math.min(i,t),o=Math.round(i*s),o>r&&(o=r,i=Math.min(i,Math.round(o/s)))),{width:i,height:o}}addMenu(){this.params.crossFiltering||(this.chartMenu=this.createBean(new cRe(this.eChartContainer,this.eMenuContainer,this.chartMenuContext)),this.eChartContainer.appendChild(this.chartMenu.getGui()))}update(e){if(e!=null&&e.chartId&&!this.chartController.update(e))return;const t=this.chartTypeChanged(e),r=t||this.chartEmpty?(n=>{const i=this.chartType,o=n,a=this.chartProxy.getChart(),l=a==null?void 0:a.getOptions(),c=a==null?void 0:a.axes;return this.chartOptionsService.getPersistedChartThemeOverrides(l,c,i,o??i)})(t):void 0;t&&this.createChart(),r&&(e!=null&&e.chartThemeOverrides)&&Kn(r,e.chartThemeOverrides);const s=r??(e==null?void 0:e.chartThemeOverrides);this.updateChart(s),e!=null&&e.chartId&&this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartApiUpdateEvent()})}updateChart(e){const{chartProxy:t}=this,r=this.chartController.getSelectedValueColState(),s=this.chartController.getChartData(),n=this.handleEmptyChart(s,r.length);if(this.chartEmpty=n,n){e&&this.chartController.updateThemeOverrides(e);return}const i=this.chartController.getChartUpdateParams(e);t.update(i),this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartUpdatedEvent()})}chartTypeChanged(e){const[t,r]=[this.chartController.getChartType(),e==null?void 0:e.chartType],s=r?SS(r):void 0;return this.chartType!==t?s??t:s&&t!==s?s:null}getChartModel(){return this.chartController.getChartModel()}getChartImageDataURL(e){return this.chartProxy.getChartImageDataURL(e)}handleEmptyChart(e,t){const r=this.chartController.isPivotChart()&&!this.chartController.isPivotMode(),s=this.chartController.getChartType();let n=1;this.chartController.isActiveXYChart()?n=s==="bubble"?3:2:Zm(ln(s))&&(n=0);const i=t<n||e.length===0;if(this.eChart){const o=r||i;vt(this.eChart,!o),vt(this.eEmpty,o)}return r?(this.eEmpty.innerText=this.chartTranslation.translate("pivotChartRequiresPivotMode"),!0):i?(this.eEmpty.innerText=this.chartTranslation.translate("noDataToChart"),!0):!1}downloadChart(e,t,r){this.chartProxy.downloadChart(e,t,r)}openChartToolPanel(e){const t=e&&C2[e];this.chartMenu.showMenu({panel:t})}closeChartToolPanel(){this.chartMenu.hideMenu()}getChartId(){return this.chartController.getChartId()}getUnderlyingChart(){return this.chartProxy.getChartRef()}crossFilteringReset(){this.chartProxy.crossFilteringReset()}setActiveChartCellRange(e){this.getGui().contains(e.relatedTarget)||this.chartController.setChartRange(!0)}getThemeName(){const e=this.gos.get("chartThemes")||QZ;if(e.length===0)throw new Error(Kc(254));const{chartThemeName:t}=this.params;return e.includes(t)?t:e[0]}getAllKeysInObjects(e){const t={};return e.filter(r=>r!=null).forEach(r=>{Object.keys(r).forEach(s=>t[s]=null)}),Object.keys(t)}validateCustomThemes(){const e=this.getChartThemes(),t=this.gos.get("customChartThemes");t&&this.getAllKeysInObjects([t]).forEach(r=>{e.includes(r)||Ce(139,{customThemeName:r})})}reactivePropertyUpdate(){this.chartController.setChartThemeName(this.getThemeName(),!0);const e=this.getChartId(),t=this.chartController.isCrossFilterChart()?"crossFilter":this.getChartModel().modelType,r=this.gos.get("chartThemeOverrides")||{};this.update({type:`${t}ChartUpdate`,chartId:e,chartThemeOverrides:r})}raiseChartCreatedEvent(){this.chartProxy.getChart().waitForUpdate().then(()=>{this.eventSvc.dispatchEvent({type:"chartCreated",chartId:this.chartController.getChartId()})})}raiseChartDestroyedEvent(){this.eventSvc.dispatchEvent({type:"chartDestroyed",chartId:this.chartController.getChartId()})}destroy(){var t;super.destroy(),this.chartProxy&&this.chartProxy.destroy(),this.destroyBean(this.chartMenu),this.chartDialog&&this.chartDialog.isAlive()&&this.destroyBean(this.chartDialog),(t=this.onDestroyColorSchemeChangeListener)==null||t.call(this);const e=this.getGui();$r(e),Dn(e),this.raiseChartDestroyedEvent()}};function fRe(e){return e.version,e.version==null&&(e.version=DRe(e)),e=Ro("23.0.0",e,ARe),e=Ro("24.0.0",e,mRe),e=Ro("25.1.0",e,vRe),e=Ro("26.0.0",e,CRe),e=Ro("26.1.0",e,wRe),e=Ro("26.2.0",e,yRe),e=Ro("28.0.0",e,bRe),e=Ro("28.2.0",e,SRe),e=Ro("29.0.0",e,xRe),e=Ro("29.1.0",e,BX),e=Ro("29.2.0",e,LX),e=Ro("30.0.0",e,ERe),e=Ro("31.0.0",e,PRe),e=Ro("32.0.0",e,FRe),e=Ro("33.0.0",e,RRe),e=TRe(e),e=Ro(Rr,e,t=>t),e}function ARe(e){return e=to("chartOptions.legend.item.marker.type","shape",e),e=to("chartOptions.seriesDefaults.marker.type","shape",e),e=to("chartOptions.legend.padding","spacing",e),e}function mRe(e){e=js("chartOptions.seriesDefaults.marker.minSize",e);const{chartType:t,chartPalette:r,chartOptions:{xAxis:s,yAxis:n,...i},...o}=e,a=$Pe(t),l=a==null?void 0:a.map((u,d)=>({type:u,...d===0?s:n}));return{chartType:t,chartThemeName:{borneo:"ag-default",material:"ag-material",bright:"ag-vivid"}[r]??"ag-default",chartOptions:{...i,axes:l,xAxis:s,yAxis:n},...o}}function vRe(e){return e=to("chartOptions.seriesDefaults.label.minRequiredAngle","minAngle",e),e}function CRe(e){return e=sg("chartOptions.seriesDefaults.highlightStyle",e,({dimOpacity:r,...s})=>({...s,...r!=null?{series:{dimOpacity:r}}:{}})),e=js("chart",e),e=js("chartOptions.seriesDefaults.tooltipClass",e),e=js("chartOptions.seriesDefaults.tooltipTracking",e),e=FG("chartOptions.axes[].label.rotation",0,e),e=FG("chartOptions.axes[].label.rotation",335,e),e}function wRe(e){const t=({item:r,series:s,...n})=>({item:{...n,...r},...s?{series:s}:{}});return e=sg("chartOptions.seriesDefaults.highlightStyle",e,t),e=sg("chartOptions.series[].highlightStyle",e,t),e}function yRe(e){e=w2("chartOptions.seriesDefaults.fill.opacity","chartOptions.seriesDefaults.fillOpacity",e),e=w2("chartOptions.seriesDefaults.stroke.opacity","chartOptions.seriesDefaults.strokeOpacity",e),e=w2("chartOptions.seriesDefaults.stroke.width","chartOptions.seriesDefaults.strokeWidth",e),e=js("chartOptions.seriesDefaults.fill",e),e=js("chartOptions.seriesDefaults.stroke",e),e=js("chartOptions.seriesDefaults.callout.colors",e),e=js("chartOptions.xAxis",e),e=js("chartOptions.yAxis",e);const{chartType:t,chartOptions:{axes:r,series:s,seriesDefaults:n,...i},...o}=e,a=SS(t),l=ln(a),c=[l],u={};if(!DZ(l)){const g={top:{},bottom:{},left:{},right:{}},A=r.map(({type:w,...v})=>({[w]:{...g,...v}})).reduce(TG,{});IZ.filter(w=>A[w]==null).forEach(w=>{A[w]={...g}}),u.axes=A}const d=c.map(g=>({[g]:{...u,series:n,...i}})).reduce(TG,{});return e={...o,chartType:a,chartOptions:d},e}function bRe(e){return e=js("chartOptions.*.title.padding",e),e=js("chartOptions.*.subtitle.padding",e),e=js("chartOptions.*.axes.*.title.padding",e),e=c5("chartOptions.*.axes.*.title.enabled",!1,e),e}function SRe(e){return e=to("chartOptions.pie.series.callout","calloutLine",e),e=to("chartOptions.pie.series.label","calloutLabel",e),e=to("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=to("chartOptions.pie.series.labelName","sectorLabelName",e),e=to("chartOptions.donut.series.callout","calloutLine",e),e=to("chartOptions.donut.series.label","calloutLabel",e),e=to("chartOptions.donut.series.labelKey","sectorLabelKey",e),e=to("chartOptions.donut.series.labelName","sectorLabelName",e),e}function xRe(e){return e=Mb("chartOptions.scatter.series.fill","chartOptions.scatter.series.marker.fill",e),e=Mb("chartOptions.scatter.series.fillOpacity","chartOptions.scatter.series.marker.fillOpacity",e),e=Mb("chartOptions.scatter.series.stroke","chartOptions.scatter.series.marker.stroke",e),e=Mb("chartOptions.scatter.series.strokeOpacity","chartOptions.scatter.series.marker.strokeOpacity",e),e=Mb("chartOptions.scatter.series.strokeWidth","chartOptions.scatter.series.marker.strokeWidth",e),e=w2("chartOptions.scatter.series.paired","chartOptions.scatter.paired",e),e}function BX(e){return e=js("chartOptions.axes[].tick.count",e),e}function LX(e){return e=sg("chartOptions.*.tooltip",e,({tracking:r,...s})=>{const n={...s};return r===!1?(n.position??(n.position={type:"pointer"}),n.range??(n.range="nearest")):r===!0&&(n.position??(n.position={type:"node"}),n.range??(n.range="nearest")),n}),e}function ERe(e){return e=to("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=to("chartOptions.pie.series.labelName","sectorLabelName",e),e=BX(e),e=LX(e),e=js("chartOptions.*.series.flipXY",e),e=HX("chartOptions.common.legend.enabled",!0,e),e=c5("chartOptions.common.legend.position","right",e),e}function PRe(e){const t={"ag-pastel":"ag-sheets","ag-solar":"ag-polychroma"},r=to("chartOptions.column","bar",e),s=t[r.chartThemeName]||r.chartThemeName;return{...r,chartThemeName:s}}function FRe(e){return e=id("chartOptions.*.autoSize",!0,e,(t,r)=>{t[r]===!0||t[r]===!1&&(t.minHeight=600,t.minWidth=300),delete t[r]}),e}function RRe(e){return e=js("chartOptions.*.axes.category.label.format",e),e=js("chartOptions.*.axes.category.crosshair.label.format",e),e=js("chartOptions.*.axes.angle-category.label.format",e),e=js("chartOptions.*.axes.radius-category.label.format",e),e=to("chartOptions.*.axes.*.label.padding","spacing",e),e=to("chartOptions.*.navigator.miniChart.label.padding","spacing",e),e=js("chartOptions.*.axes.*.crossLines.label.className",e),e=id("chartOptions.*.axes.*.crossLines.label.position",!0,e,(t,r)=>{typeof t[r]=="string"&&(t[r]=t[r].replace(/([A-Z])/,"-$1").toLowerCase())}),e=js("chartOptions.bullet",e),e=RG("chartOptions.bar.series.label.placement",e,{inside:"inside-center",outside:"inside-end"}),e=RG("chartOptions.waterfall.series.item.*.label.placement",e,{inside:"inside-center",start:"outside-start",end:"outside-end"}),e=js("chartOptions.*.navigator.min",e),e=js("chartOptions.*.navigator.max",e),e=js("chartOptions.*.zoom.ratioX",e),e=js("chartOptions.*.zoom.ratioY",e),e=js("chartOptions.*.zoom.rangeX",e),e=js("chartOptions.*.zoom.rangeY",e),e}function TRe(e){return e=js("chartOptions.*.width",e),e=js("chartOptions.*.height",e),e=c5("chartOptions.*.axes.category.label.autoRotate",!0,e),e}function DRe(e){var c,u;const t=e;if(e.version!=null)return e.version;const r=(d,...g)=>Object.keys(d||{}).some(A=>g.includes(A)),s=t.chartOptions,n=r(s,"seriesDefaults")?s==null?void 0:s.seriesDefaults:s==null?void 0:s[Object.keys(s)[0]],i={"27.0.0":r(t,"seriesChartTypes"),"26.2.0":!r(s,"seriesDefaults"),"26.1.0":r(n==null?void 0:n.highlightStyle,"item"),"26.0.0":r(n==null?void 0:n.highlightStyle,"series"),"25.1.0":r(n==null?void 0:n.label,"minAngle"),"25.0.0":r(t,"modelType","aggFunc","unlinkChart","suppressChartRanges")||r(n,"lineDash","lineDashOffset"),"24.0.0":r(t,"chartThemeName","chart")||r(s,"series"),"23.2.0":r(s,"navigator"),"23.0.0":r((u=(c=s==null?void 0:s.legend)==null?void 0:c.item)==null?void 0:u.marker,"shape"),"22.1.0":r(t,"chartPalette","chartType")},o="27.1.0",a=Object.entries(i).filter(([d,g])=>g),[l=o]=a[0];return l}function Ro(e,t,r){if(PG(e)>PG(t.version)){const s=r(t);return s.version=e,s}return t}function MRe(e){const t=e.includes("-beta")?e.replace(/-beta.*/,""):e,r=typeof t=="string"?t.split(".").map(s=>Number(s)):[];if(r.length!==3||r.some(s=>isNaN(s)))throw new Error(Kc(253,{version:t}));return{major:r[0],minor:r[1],patch:r[2]}}function PG(e){const{major:t,minor:r,patch:s}=MRe(e);return t*1e4+r*100+s}function FG(e,t,r){return id(e,!0,r,(s,n)=>{s[n]===t&&delete s[n]})}function c5(e,t,r){return id(e,!1,r,(s,n)=>{s[n]==null&&(s[n]=t)})}function HX(e,t,r){typeof e=="string"&&(e=e.split("."));const s=e[0];return e.length>1&&(r[s]=HX(e.slice(1),t,r[s]??{})),Object.keys(r).includes(s)||(r[s]=t),r}function w2(e,t,r){let s,n=!1;return r=id(e,!0,r,(i,o)=>{n=!0,s=i[o],delete i[o]}),n?id(t,!1,r,(i,o)=>{i[o]=s}):r}function Mb(e,t,r){let s,n=!1;return r=id(e,!0,r,(i,o)=>{n=!0,s=i[o],delete i[o]}),n?id(t,!1,r,(i,o)=>{i[o]===void 0&&(i[o]=s)}):r}function to(e,t,r){return id(e,!0,r,(s,n)=>{s[t]=s[n],delete s[n]})}function js(e,t){return id(e,!0,t,(r,s)=>delete r[s])}function id(e,t,r,s){const n=e instanceof Array?e:e.split("."),i=n.slice(0,n.length-1),o=n[n.length-1];return sg(i,r,a=>{const l=Object.keys(a).includes(o);if(t&&!l)return a;const c={...a};return s(c,o),c})}function sg(e,t,r){const s=e instanceof Array?e:e.split(".");if(t={...t},s.length===0)return r(t);if(s[0].startsWith("{")){const n=s[0].substring(1,s[0].lastIndexOf("}")).split(",");for(const i of n)t[i]!=null&&(t[i]=sg(s.slice(1),t[i],r))}else if(s[0].endsWith("[]")){const n=s[0].substring(0,e[0].indexOf("["));t[n]instanceof Array&&(t[n]=t[n].map(i=>sg(s.slice(1),i,r)))}else if(s[0]==="*")for(const n of Object.keys(t))t[n]=sg(s.slice(1),t[n],r);else t[s[0]]!=null&&(t[s[0]]=sg(s.slice(1),t[s[0]],r));return t}function RG(e,t,r){return id(e,!0,t,(s,n)=>{typeof s[n]=="string"&&(s[n]=r[n]??n)})}var TG=(e,t)=>({...e,...t}),IRe=class extends ve{constructor(){super(...arguments),this.beanName="chartSvc",this.activeCharts=new Set,this.activeChartComps=new Set,this.crossFilteringContext={lastSelectedChartId:""},this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(e){this.visibleCols=e.visibleCols,this.rangeSvc=e.rangeSvc,this.agChartsExports=e.agChartsExports}updateChart(e){if(this.activeChartComps.size===0){Ce(124);return}const t=[...this.activeChartComps].find(r=>r.getChartId()===e.chartId);if(!t){Ce(125,{chartId:e.chartId});return}t.update(e)}getChartModels(){const e=[],t=r=>({...r,version:Rr});return this.activeChartComps.forEach(r=>e.push(t(r.getChartModel()))),e}getChartRef(e){let t;return this.activeCharts.forEach(r=>{r.chartId===e&&(t=r)}),t}getChartComp(e){let t;return this.activeChartComps.forEach(r=>{r.getChartId()===e&&(t=r)}),t}getChartImageDataURL(e){let t;return this.activeChartComps.forEach(r=>{r.getChartId()===e.chartId&&(t=r.getChartImageDataURL(e.fileFormat))}),t}downloadChart(e){const t=Array.from(this.activeChartComps).find(r=>r.getChartId()===e.chartId);t==null||t.downloadChart(e.dimensions,e.fileName,e.fileFormat)}openChartToolPanel(e){const t=Array.from(this.activeChartComps).find(r=>r.getChartId()===e.chartId);t==null||t.openChartToolPanel(e.panel)}closeChartToolPanel(e){const t=Array.from(this.activeChartComps).find(r=>r.getChartId()===e);t==null||t.closeChartToolPanel()}createChartFromCurrentRange(e="groupedColumn",t){const r=this.getSelectedRange();return this.createChart({cellRange:r,chartType:e,focusDialogOnOpen:!t})}restoreChart(e,t){if(!e){Ce(126);return}e.version!==Rr&&(e=fRe(e));let r,s,n,i;if(e.modelType==="pivot"?(this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"}),r=this.createCellRange(void 0,!0),s=!0,n=!0):(r=this.createCellRange(e.cellRange),i=e.chartPalette,n=e.suppressChartRanges),!!r)return this.createChart({...e,cellRange:r,pivotChart:s,suppressChartRanges:n,chartContainer:t,chartOptionsToRestore:e.chartOptions,chartPaletteToRestore:i})}createRangeChart(e,t){const r=this.createCellRange(e.cellRange);if(r)return this.createChart({...e,cellRange:r,focusDialogOnOpen:!t})}createPivotChart(e,t){this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"});const r=this.createCellRange(void 0,!0);if(r)return this.createChart({...e,cellRange:r,pivotChart:!0,suppressChartRanges:!0,focusDialogOnOpen:!t})}createCrossFilterChart(e,t){const r=this.createCellRange(e.cellRange);if(!r)return;const n=typeof e.suppressChartRanges<"u"&&e.suppressChartRanges!==null?e.suppressChartRanges:!0;return this.createChart({...e,cellRange:r,suppressChartRanges:n,crossFiltering:!0,focusDialogOnOpen:!t})}createChart(e){const t=eFe(e,this.agChartsExports.isEnterprise);if(!t)return;e=t===!0?e:t;const{chartType:r,chartContainer:s}=e,n=this.gos.getCallback("createChartContainer"),i={...e,chartId:this.generateId(),chartType:SS(r),insideDialog:!(s||n),crossFilteringContext:this.crossFilteringContext,crossFilteringResetCallback:()=>this.activeChartComps.forEach(l=>l.crossFilteringReset())},o=new gRe(i);this.createBean(o);const a=this.createChartRef(o);return s?s.appendChild(a.chartElement):n?n(a):o.addEventListener("destroyed",()=>{this.activeChartComps.delete(o),this.activeCharts.delete(a)}),a}createChartRef(e){const t={destroyChart:()=>{this.activeCharts.has(t)&&(this.destroyBean(e),this.activeChartComps.delete(e),this.activeCharts.delete(t))},focusChart:()=>{wi(e.getGui())},chartElement:e.getGui(),chart:e.getUnderlyingChart(),chartId:e.getChartModel().chartId};return this.activeCharts.add(t),this.activeChartComps.add(e),t}getSelectedRange(){var t;const e=((t=this.rangeSvc)==null?void 0:t.getCellRanges())??[];return e.length>0?e[0]:{columns:[]}}generateId(){return`id-${Math.random().toString(36).substring(2,18)}`}createCellRange(e,t){var n;const r=t?{rowStartIndex:null,rowStartPinned:void 0,rowEndIndex:null,rowEndPinned:void 0,columns:this.visibleCols.allCols.map(i=>i.getColId())}:e,s=r&&((n=this.rangeSvc)==null?void 0:n.createPartialCellRangeFromRangeParams(r,!0));return s||Ce(127,{allRange:t}),s}destroy(){this.activeCharts.forEach(e=>e.destroyChart()),super.destroy()}};function kRe(e){return e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=e.chartSvc)==null?void 0:t.getChartModels()})}function BRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.getChartRef(t)})}function LRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.getChartImageDataURL(t)})}function HRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.downloadChart(t)})}function GRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.openChartToolPanel(t)})}function ORe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.closeChartToolPanel(t.chartId)})}function NRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.createRangeChart(t,!0)})}function _Re(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.createPivotChart(t,!0)})}function VRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.createCrossFilterChart(t,!0)})}function zRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.updateChart(t)})}function QRe(e,t,r){return e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=e.chartSvc)==null?void 0:s.restoreChart(t,r)})}var URe=`.ag-chart{display:flex;height:100%;position:relative;width:100%}.ag-chart-components-wrapper{display:flex}.ag-chart-canvas-wrapper,.ag-chart-components-wrapper{flex:1 1 auto;position:relative}.ag-chart-menu{background:var(--ag-background-color);background-color:color-mix(in srgb,transparent,var(--ag-background-color) 30%);border-radius:var(--ag-border-radius);display:flex;flex-direction:row;gap:20px;padding:4px 2px;position:absolute;top:8px;width:auto;--ag-icon-size:20px}:where(.ag-ltr) .ag-chart-menu{justify-content:right;right:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}:where(.ag-rtl) .ag-chart-menu{justify-content:left;left:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}:where(.ag-chart) .ag-chart-menu{display:none}:where(.ag-chart-menu-hidden:hover) .ag-chart-menu{display:block}.ag-chart-docked-container{min-width:var(--ag-chart-menu-panel-width);position:relative}:where(.ag-chart-menu-hidden)~.ag-chart-docked-container{display:none}.ag-chart-tabbed-menu{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.ag-chart-tabbed-menu-header{cursor:default;flex:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-tabbed-menu-body{align-items:stretch;display:flex;flex:1 1 auto;overflow:hidden;position:relative;&:after{background:linear-gradient(var(--ag-background-color),transparent);content:"";display:block;height:16px;left:0;position:absolute;right:0;top:0}}.ag-chart-tab{overflow:hidden;overflow-y:auto;width:100%}.ag-chart-settings{overflow-x:hidden}.ag-chart-settings-wrapper{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}.ag-chart-settings-nav-bar{align-items:center;border-top:1px solid var(--ag-border-color);display:flex;height:30px;padding:0 10px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-chart-settings-card-selector{align-items:center;display:flex;flex:1 1 auto;height:100%;justify-content:space-around;padding:0 10px}.ag-chart-settings-card-item{background-color:var(--ag-foreground-color);border-radius:4px;cursor:pointer;height:8px;position:relative;width:8px;&.ag-not-selected{opacity:.2}&:before{background-color:transparent;content:" ";display:block;height:20px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:50%;width:20px}&.ag-selected{background-color:var(--ag-accent-color)}}.ag-chart-settings-next,.ag-chart-settings-prev{flex:none;position:relative;&:focus-within{border-radius:1px;box-shadow:var(--ag-focus-shadow)}}.ag-chart-settings-next-button,.ag-chart-settings-prev-button{cursor:pointer;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.ag-chart-settings-mini-charts-container{flex:1 1 auto;overflow:hidden auto;position:relative}.ag-chart-settings-mini-wrapper{display:flex;flex-direction:column;left:0;min-height:100%;overflow:hidden;padding-bottom:var(--ag-widget-container-vertical-padding);position:absolute;top:0;width:100%;&.ag-animating{transition:left .3s;transition-timing-function:ease-in-out}}.ag-chart-mini-thumbnail{border:1px solid var(--ag-border-color);border-radius:5px;cursor:pointer;&.ag-selected{border-color:var(--ag-accent-color);border-width:2px}&:focus-visible{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}}.ag-chart-mini-thumbnail-canvas{display:block}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper,.ag-chart-format-wrapper{display:flex;flex-direction:column;padding-bottom:16px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper{height:100%;overflow-y:auto}.ag-chart-advanced-settings{background-color:var(--ag-chrome-background-color)}.ag-chart-advanced-settings,.ag-chart-advanced-settings-wrapper{width:100%}.ag-chart-advanced-settings-wrapper{padding-bottom:0}.ag-chart-advanced-settings-section{border-bottom:1px solid var(--ag-border-color);display:flex;margin:0;padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding)}.ag-chart-empty-text{align-items:center;background-color:var(--ag-background-color);display:flex;height:100%;justify-content:center;top:0;width:100%}.ag-charts-font-size-color{align-self:stretch;display:flex;justify-content:space-between}.ag-charts-data-group-item{padding-bottom:var(--ag-widget-container-vertical-padding);position:relative}.ag-charts-data-group-item:where(:not(:last-child)){margin-bottom:var(--ag-spacing)}.ag-chart-menu-icon{border-radius:var(--ag-border-radius);cursor:pointer;margin:2px 0;opacity:.8;&:hover{opacity:1}}.ag-chart-menu-toolbar-button{background-color:unset;border:0;border-radius:1px;padding:0 2px}.ag-chart-data-column-drag-handle{margin-left:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-title-bar{background-color:unset;position:relative}.ag-charts-data-group-container{padding:calc(var(--ag-widget-container-vertical-padding)*.5) var(--ag-widget-container-horizontal-padding)}.ag-charts-data-group-item:where(:not(.ag-charts-format-sub-level-group,.ag-pill-select,.ag-select)){height:var(--ag-list-item-height)}.ag-charts-data-group-item:where(.ag-picker-field){margin-top:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-container,.ag-charts-format-top-level-group-container{margin-left:calc(var(--ag-spacing)*2);padding:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-item,.ag-charts-format-top-level-group-item{margin:var(--ag-spacing) 0}.ag-charts-format-sub-level-group-container{display:flex;flex-direction:column;padding:var(--ag-widget-vertical-spacing) 0}.ag-charts-settings-group-container{display:grid;grid-template-columns:60px 1fr 60px 1fr 60px;padding:var(--ag-spacing);row-gap:8px;:where(.ag-chart-mini-thumbnail:nth-child(3n+1)){grid-column:1}:where(.ag-chart-mini-thumbnail:nth-child(3n+2)){grid-column:3}:where(.ag-chart-mini-thumbnail:nth-child(3n+3)){grid-column:5}}.ag-chart-data-section,.ag-chart-format-section{display:flex;margin:0;:where(.ag-label:not(.ag-group-title-bar)){color:var(--ag-chart-menu-label-color)}:where(.ag-label-align-top .ag-label){margin-bottom:var(--ag-widget-vertical-spacing);margin-top:calc(var(--ag-widget-vertical-spacing)*.5)}:where(.ag-slider.ag-label-align-top .ag-label){margin-bottom:0}:where(label){display:inline-block}}.ag-chart-menu-panel{--ag-panel-background-color:var(--ag-chrome-background-color)}:where(.ag-ltr) .ag-chart-menu-panel{border-left:1px solid var(--ag-border-color)}:where(.ag-rtl) .ag-chart-menu-panel{border-right:1px solid var(--ag-border-color)}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-container,.ag-charts-settings-group-title-bar{border-top:none;font-weight:500;padding:0 calc(var(--ag-spacing)*1.5)}.ag-charts-format-sub-level-group-title-bar{background:none;font-weight:500;padding:var(--ag-widget-vertical-spacing) 0}.ag-chart-data-wrapper,.ag-chart-format-wrapper,.ag-charts-data-group-container,.ag-charts-data-group-title-bar,.ag-charts-format-sub-level-group,.ag-charts-format-sub-level-group-container>*,.ag-charts-format-sub-level-group-item:last-child,.ag-charts-format-top-level-group,.ag-charts-format-top-level-group-item,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-container,.ag-charts-settings-group-title-bar,:where(.ag-charts-format-top-level-group) .ag-charts-format-top-level-group-container{margin:0;padding:0}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-title-bar{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:relative}.ag-charts-data-group,.ag-charts-format-top-level-group{border-top:1px solid var(--ag-border-color)}:where(.ag-charts-data-group) .ag-charts-data-group-container,:where(.ag-charts-format-top-level-group) .ag-charts-format-top-level-group-container,:where(.ag-charts-settings-group) .ag-charts-settings-group-container{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-format-sub-level-group-container>*,.ag-charts-format-sub-level-no-header-group-container>*,.ag-charts-format-top-level-group-container>*{margin-bottom:var(--ag-widget-vertical-spacing)}.ag-charts-advanced-settings-top-level-group-container{margin:0}:where(.ag-charts-advanced-settings-top-level-group){.ag-charts-advanced-settings-top-level-group-container,.ag-charts-advanced-settings-top-level-group-title-bar{padding:0 var(--ag-widget-container-horizontal-padding)}}.ag-charts-advanced-settings-top-level-group-item{margin-bottom:0;margin-top:calc(var(--ag-widget-vertical-spacing)*2)}.ag-chart-settings-card-item.ag-not-selected:hover{opacity:.35}.ag-angle-select{align-items:center;display:flex}.ag-angle-select-wrapper{display:flex}.ag-angle-select-parent-circle{background-color:var(--ag-background-color);border:1px solid;border-color:var(--ag-border-color);border-radius:12px;display:block;height:24px;position:relative;width:24px}.ag-angle-select-child-circle{background-color:var(--ag-foreground-color);border-radius:3px;height:6px;left:12px;margin-left:-3px;margin-top:-4px;position:absolute;top:4px;width:6px}.ag-slider-wrapper{display:flex;:where(.ag-input-field){flex:1 1 auto}}.ag-color-panel{display:flex;flex-direction:column;padding:var(--ag-spacing);text-align:center;width:100%}.ag-spectrum-color{cursor:default;flex:1 1 auto;overflow:visible;position:relative}.ag-spectrum-fill{inset:0;position:absolute}.ag-spectrum-val{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0));cursor:pointer}.ag-spectrum-dragger{background:#000;border:3px solid #fff;border-radius:18px;box-shadow:0 0 2px 0 rgba(0,0,0,.24);cursor:pointer;height:18px;pointer-events:none;position:absolute;width:18px}.ag-spectrum-alpha,.ag-spectrum-hue{cursor:default}.ag-spectrum-hue-background{background:linear-gradient(270deg,red 3%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);height:100%;width:100%}.ag-spectrum-alpha-background{background:linear-gradient(to right,var(--ag-internal-spectrum-alpha-color-from),var(--ag-internal-spectrum-alpha-color-to)),url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>') 0 0 /4px 4px;height:100%;width:100%}.ag-spectrum-tool{border-radius:2px;cursor:pointer;height:11px;margin-bottom:10px;position:relative}.ag-spectrum-slider{border:2px solid #fff;border-radius:13px;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:13px;margin-top:-12px;pointer-events:none;position:absolute;width:13px}:where(.ag-spectrum-alpha) .ag-spectrum-slider{background:linear-gradient(to bottom,var(--ag-internal-spectrum-alpha-color),var(--ag-internal-spectrum-alpha-color)) var(--ag-background-color)}.ag-recent-colors{display:flex;gap:6px;margin-bottom:2px;margin-left:var(--ag-spacing);margin-right:var(--ag-spacing)}.ag-recent-color{border:1px solid var(--ag-border-color);cursor:pointer}.ag-angle-select[disabled]{opacity:.5;pointer-events:none}:where(.ag-ltr) .ag-angle-select-field,:where(.ag-ltr) .ag-slider-field{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-angle-select-field,:where(.ag-rtl) .ag-slider-field{margin-left:calc(var(--ag-spacing)*2)}.ag-color-dialog{border-radius:5px}:where(.ag-color-picker){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}.ag-picker-field-display{align-items:center;display:flex;flex-direction:row;min-height:var(--ag-list-item-height)}}:where(.ag-ltr) .ag-color-picker-color,:where(.ag-ltr) .ag-color-picker-value{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-color-picker-color,:where(.ag-rtl) .ag-color-picker-value{margin-left:var(--ag-spacing)}.ag-spectrum-tools{padding-bottom:0;padding-left:0;padding-right:0}.ag-spectrum-alpha-background,.ag-spectrum-hue-background{border-radius:2px}.ag-color-input-color,.ag-color-picker-color,.ag-recent-color{border-radius:4px}.ag-spectrum-sat{background-image:linear-gradient(90deg,#fff,hsla(20,42%,65%,0))}.ag-recent-color,.ag-spectrum-color,.ag-spectrum-slider{&:where(:not(:disabled,[readonly])):focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-color-input-color,.ag-color-picker-color{border:1px solid var(--ag-border-color);border-radius:2px;height:var(--ag-icon-size);width:var(--ag-icon-size)}:where(.ag-color-input){.ag-color-input-color{position:absolute}}:where(.ag-ltr) :where(.ag-color-input){.ag-input-field-input{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}.ag-color-input-color{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-color-input){.ag-input-field-input{padding-right:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}.ag-color-input-color{margin-right:var(--ag-spacing)}}.ag-range-field{align-items:center;display:flex;:where(.ag-input-wrapper){height:100%}}.ag-range-field-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;height:100%;overflow:visible;padding:0;width:100%;&:disabled{opacity:.5}}.ag-range-field-input{&::-webkit-slider-runnable-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--ag-background-color);border:1px solid var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-webkit-slider-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-webkit-slider-runnable-track{background-color:var(--ag-accent-color)}}.ag-range-field-input{&::-moz-range-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-moz-ag-range-thumb{-moz-appearance:none;appearance:none;background-color:var(--ag-background-color);border:1px solid var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-moz-ag-range-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-moz-ag-range-track{background-color:var(--ag-accent-color)}}`,GX=28,OX=6;function Qk(e){return e&&e.match(/\d+\.\d+\.\d+/)}function WRe({gridMajorVersion:e,chartsMajorVersion:t}){const r=parseInt(e,10),s=parseInt(t,10),n=r-GX,i=s-OX,o=n>=0;return n===i&&o}function jRe(e){if(!e||!Qk(e))return;const[t,r]=e.split(".")||[],s=`${t}.${r}.x`,i=parseInt(t,10)-GX+OX;if(i<0)return;const a=`${i}.${r}.x`;return{gridMajorMinor:s,chartsMajorMinor:a}}function eP({type:e,gridVersion:t,chartsVersion:r}){const s="AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.";if(!t)return s;const n=jRe(t);if(!n)return s;const{gridMajorMinor:i,chartsMajorMinor:o}=n;return e==="incompatible"?`AG Grid version ${t} and AG Charts version ${r} is not supported. AG Grid version ${i} should be used with AG Chart ${o}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:e==="invalidCharts"?`AG Grid version ${i} should be used with AG Chart ${o} not ${r}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:s}function KRe({gridVersion:e,chartsVersion:t}){if(!Qk(t))return{isValid:!1,message:eP({type:"invalidCharts",gridVersion:e,chartsVersion:t})};if(!Qk(e))return{isValid:!1,message:eP({type:"invalidGrid",gridVersion:e,chartsVersion:t})};const[r,s]=e.split(".")||[],[n,i,o]=t.split(".")||[],a=WRe({gridMajorVersion:r,chartsMajorVersion:n});return a&&s===i||o.includes("beta")?{isValid:!0}:!a||s!==i?{isValid:!1,message:eP({type:"incompatible",gridVersion:e,chartsVersion:t})}:{isValid:!1,message:eP({type:"invalid",gridVersion:e,chartsVersion:t})}}var YRe={linked:"linked",unlinked:"unlinked",chartsMenu:"menu-alt",chartsDownload:"save",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",chartsColorPicker:"small-down",chartsThemePrevious:"previous",chartsThemeNext:"next"},ZRe={getChartModels:kRe,getChartRef:BRe,getChartImageDataURL:LRe,downloadChart:HRe,openChartToolPanel:GRe,closeChartToolPanel:ORe,createRangeChart:NRe,createPivotChart:_Re,createCrossFilterChart:VRe,updateChart:zRe,restoreChart:QRe},DG=[SZ,Qs,jw,Eg,AT],MG="IntegratedCharts",XRe={moduleName:MG,version:Rr,dependsOn:DG,validate:()=>({isValid:!1,message:ZW(257)}),with:e=>{var t;if(e.setup(),(t=e.setGridContext)==null||t.call(e,!0),e.isEnterprise&&e.setLicenseKey){const r={setLicenseKey:e.setLicenseKey};p1.setChartsLicenseManager(r)}return{moduleName:MG,version:Rr,icons:YRe,apiFunctions:ZRe,dependsOn:DG,css:[URe],validate:()=>KRe({gridVersion:Rr,chartsVersion:e.VERSION}),beans:[NPe.bind(null,e),IRe,U2e,_2e,O2e,z2e,x2e,H2e]}}},IG=[F0e,W3e,_Se,Vxe,J3e,lEe,oxe,axe,SZ,lxe,vZ,k3e,B3e,kPe,BPe,wxe,Kxe,Q1e,NL,Lxe,H3e,jEe,iPe],kG="AllEnterprise",$Re={with:e=>({moduleName:kG,version:Rr,dependsOn:[...IG,XRe.with(e),OPe.with(e)]}),moduleName:kG,version:Rr,dependsOn:IG},y2={},JRe=Object.defineProperty,NX=e=>{throw TypeError(e)},qRe=(e,t,r)=>t in e?JRe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bs=(e,t,r)=>qRe(e,typeof t!="symbol"?t+"":t,r),u5=(e,t,r)=>t.has(e)||NX("Cannot "+r),de=(e,t,r)=>(u5(e,t,"read from private field"),r?r.call(e):t.get(e)),As=(e,t,r)=>t.has(e)?NX("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),hr=(e,t,r,s)=>(u5(e,t,"write to private field"),t.set(e,r),r),Wt=(e,t,r)=>(u5(e,t,"access private method"),r),Uk=(e,t,r,s)=>({set _(n){hr(e,t,n)},get _(){return de(e,t,s)}});function eTe(e,t){if(e==null)throw Error(t);return e}const SF=Array.isArray;function BG(e){return e!==null&&typeof e=="object"}function xS(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null}function LG(e){return Object.values(e).reduce((t,r)=>r!==void 0?t+1:t,0)}function Lc(e,t){if(!(BG(e)&&BG(t)))return e===t;if(SF(e)&&SF(t))return e.length!==t.length?!1:[...e.keys()].every(r=>Lc(e[r],t[r]));if(xS(e)&&xS(t))return LG(e)!==LG(t)?!1:Object.keys(e).every(r=>Lc(e[r],t[r]));throw Error(`Cannot compare a ${String(e)} and b ${String(t)}`)}function Th(e){if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=Th(e[r]);return t}else if(xS(e)){const t={};return Object.keys(e).forEach(r=>{t[r]=Th(e[r])}),t}else return e}function _X(e,t){return new Set([...Object.keys(e),...Object.keys(t)]).forEach(r=>{const s=e[r],n=t[r];xS(s)&&xS(n)||SF(s)&&SF(n)&&s.length===n.length?_X(s,n):e[r]=n}),e}var Ib=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tTe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ms;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{const i={};for(const o of n)i[o]=o;return i},e.getValidEnumValues=n=>{const i=e.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(const a of i)o[a]=n[a];return e.objectValues(o)},e.objectValues=n=>e.objectKeys(n).map(function(i){return n[i]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(o);return i},e.find=(n,i)=>{for(const o of n)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,i=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=s,e.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(ms||(ms={}));var Wk;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Wk||(Wk={}));const Ht=ms.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yf=e=>{switch(typeof e){case"undefined":return Ht.undefined;case"string":return Ht.string;case"number":return isNaN(e)?Ht.nan:Ht.number;case"boolean":return Ht.boolean;case"function":return Ht.function;case"bigint":return Ht.bigint;case"symbol":return Ht.symbol;case"object":return Array.isArray(e)?Ht.array:e===null?Ht.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ht.promise:typeof Map<"u"&&e instanceof Map?Ht.map:typeof Set<"u"&&e instanceof Set?Ht.set:typeof Date<"u"&&e instanceof Date?Ht.date:Ht.object;default:return Ht.unknown}},ft=ms.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),rTe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ul extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(i){return i.message},s={_errors:[]},n=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(r(o));else{let a=s,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return n(this),s}static assert(t){if(!(t instanceof Ul))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ms.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},s=[];for(const n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):s.push(t(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}Ul.create=e=>new Ul(e);const xw=(e,t)=>{let r;switch(e.code){case ft.invalid_type:e.received===Ht.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ft.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ms.jsonStringifyReplacer)}`;break;case ft.unrecognized_keys:r=`Unrecognized key(s) in object: ${ms.joinValues(e.keys,", ")}`;break;case ft.invalid_union:r="Invalid input";break;case ft.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ms.joinValues(e.options)}`;break;case ft.invalid_enum_value:r=`Invalid enum value. Expected ${ms.joinValues(e.options)}, received '${e.received}'`;break;case ft.invalid_arguments:r="Invalid function arguments";break;case ft.invalid_return_type:r="Invalid function return type";break;case ft.invalid_date:r="Invalid date";break;case ft.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ms.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ft.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ft.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ft.custom:r="Invalid input";break;case ft.invalid_intersection_types:r="Intersection results could not be merged";break;case ft.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ft.not_finite:r="Number must be finite";break;default:r=t.defaultError,ms.assertNever(e)}return{message:r}};let VX=xw;function sTe(e){VX=e}function xF(){return VX}const EF=e=>{const{data:t,path:r,errorMaps:s,issueData:n}=e,i=[...r,...n.path||[]],o={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let a="";const l=s.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...n,path:i,message:a}},nTe=[];function Mt(e,t){const r=xF(),s=EF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===xw?void 0:xw].filter(n=>!!n)});e.common.issues.push(s)}class Go{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const s=[];for(const n of r){if(n.status==="aborted")return Pr;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,r){const s=[];for(const n of r){const i=await n.key,o=await n.value;s.push({key:i,value:o})}return Go.mergeObjectSync(t,s)}static mergeObjectSync(t,r){const s={};for(const n of r){const{key:i,value:o}=n;if(i.status==="aborted"||o.status==="aborted")return Pr;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[i.value]=o.value)}return{status:t.value,value:s}}}const Pr=Object.freeze({status:"aborted"}),PF=e=>({status:"dirty",value:e}),fa=e=>({status:"valid",value:e}),jk=e=>e.status==="aborted",Kk=e=>e.status==="dirty",ES=e=>e.status==="valid",PS=e=>typeof Promise<"u"&&e instanceof Promise;function FF(e,t,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function zX(e,t,r,s,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var $t;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})($t||($t={}));var f1,A1;class Oh{constructor(t,r,s,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const HG=(e,t)=>{if(ES(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ul(e.common.issues);return this._error=r,this._error}}};function _r(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:s,description:n}=e;if(t&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(i,o)=>{var a,l;const{message:c}=e;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:(a=c??s)!==null&&a!==void 0?a:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:o.defaultError}},description:n}}class Yr{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Yf(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Yf(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Go,ctx:{common:t.parent.common,data:t.data,parsedType:Yf(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(PS(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const s=this.safeParse(t,r);if(s.success)return s.data;throw s.error}safeParse(t,r){var s;const n={common:{issues:[],async:(s=r==null?void 0:r.async)!==null&&s!==void 0?s:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Yf(t)},i=this._parseSync({data:t,path:n.path,parent:n});return HG(n,i)}async parseAsync(t,r){const s=await this.safeParseAsync(t,r);if(s.success)return s.data;throw s.error}async safeParseAsync(t,r){const s={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Yf(t)},n=this._parse({data:t,path:s.path,parent:s}),i=await(PS(n)?n:Promise.resolve(n));return HG(s,i)}refine(t,r){const s=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,i)=>{const o=t(n),a=()=>i.addIssue({code:ft.custom,...s(n)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,r){return this._refinement((s,n)=>t(s)?!0:(n.addIssue(typeof r=="function"?r(s,n):r),!1))}_refinement(t){return new od({schema:this,typeName:mr.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Dh.create(this,this._def)}nullable(){return CA.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $u.create(this,this._def)}promise(){return Pw.create(this,this._def)}or(t){return DS.create([this,t],this._def)}and(t){return MS.create(this,t,this._def)}transform(t){return new od({..._r(this._def),schema:this,typeName:mr.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new HS({..._r(this._def),innerType:this,defaultValue:r,typeName:mr.ZodDefault})}brand(){return new d5({typeName:mr.ZodBranded,type:this,..._r(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new GS({..._r(this._def),innerType:this,catchValue:r,typeName:mr.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Xx.create(this,t)}readonly(){return OS.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const iTe=/^c[^\s-]{8,}$/i,oTe=/^[0-9a-z]+$/,aTe=/^[0-9A-HJKMNP-TV-Z]{26}$/,lTe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cTe=/^[a-z0-9_-]{21}$/i,uTe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dTe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hTe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let o4;const pTe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gTe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,fTe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QX="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ATe=new RegExp(`^${QX}$`);function UX(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function mTe(e){return new RegExp(`^${UX(e)}$`)}function WX(e){let t=`${QX}T${UX(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function vTe(e,t){return!!((t==="v4"||!t)&&pTe.test(e)||(t==="v6"||!t)&&gTe.test(e))}class zu extends Yr{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ht.string){const n=this._getOrReturnCtx(t);return Mt(n,{code:ft.invalid_type,expected:Ht.string,received:n.parsedType}),Pr}const r=new Go;let s;for(const n of this._def.checks)if(n.kind==="min")t.data.length<n.value&&(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="max")t.data.length>n.value&&(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=t.data.length>n.value,o=t.data.length<n.value;(i||o)&&(s=this._getOrReturnCtx(t,s),i?Mt(s,{code:ft.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&Mt(s,{code:ft.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if(n.kind==="email")dTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"email",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="emoji")o4||(o4=new RegExp(hTe,"u")),o4.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"emoji",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="uuid")lTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"uuid",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="nanoid")cTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"nanoid",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid")iTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"cuid",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid2")oTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"cuid2",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="ulid")aTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"ulid",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Mt(s,{validation:"url",code:ft.invalid_string,message:n.message}),r.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"regex",code:ft.invalid_string,message:n.message}),r.dirty())):n.kind==="trim"?t.data=t.data.trim():n.kind==="includes"?t.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()):n.kind==="toLowerCase"?t.data=t.data.toLowerCase():n.kind==="toUpperCase"?t.data=t.data.toUpperCase():n.kind==="startsWith"?t.data.startsWith(n.value)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()):n.kind==="endsWith"?t.data.endsWith(n.value)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()):n.kind==="datetime"?WX(n).test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:"datetime",message:n.message}),r.dirty()):n.kind==="date"?ATe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:"date",message:n.message}),r.dirty()):n.kind==="time"?mTe(n).test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:"time",message:n.message}),r.dirty()):n.kind==="duration"?uTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"duration",code:ft.invalid_string,message:n.message}),r.dirty()):n.kind==="ip"?vTe(t.data,n.version)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"ip",code:ft.invalid_string,message:n.message}),r.dirty()):n.kind==="base64"?fTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"base64",code:ft.invalid_string,message:n.message}),r.dirty()):ms.assertNever(n);return{status:r.value,value:t.data}}_regex(t,r,s){return this.refinement(n=>t.test(n),{validation:r,code:ft.invalid_string,...$t.errToObj(s)})}_addCheck(t){return new zu({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...$t.errToObj(t)})}url(t){return this._addCheck({kind:"url",...$t.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...$t.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...$t.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...$t.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...$t.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...$t.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...$t.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...$t.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...$t.errToObj(t)})}datetime(t){var r,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...$t.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...$t.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...$t.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...$t.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...$t.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...$t.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...$t.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...$t.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...$t.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...$t.errToObj(r)})}nonempty(t){return this.min(1,$t.errToObj(t))}trim(){return new zu({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new zu({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new zu({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}zu.create=e=>{var t;return new zu({checks:[],typeName:mr.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,..._r(e)})};function CTe(e,t){const r=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=r>s?r:s,i=parseInt(e.toFixed(n).replace(".","")),o=parseInt(t.toFixed(n).replace(".",""));return i%o/Math.pow(10,n)}class AA extends Yr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ht.number){const n=this._getOrReturnCtx(t);return Mt(n,{code:ft.invalid_type,expected:Ht.number,received:n.parsedType}),Pr}let r;const s=new Go;for(const n of this._def.checks)n.kind==="int"?ms.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="multipleOf"?CTe(t.data,n.value)!==0&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):n.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.not_finite,message:n.message}),s.dirty()):ms.assertNever(n);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,$t.toString(r))}gt(t,r){return this.setLimit("min",t,!1,$t.toString(r))}lte(t,r){return this.setLimit("max",t,!0,$t.toString(r))}lt(t,r){return this.setLimit("max",t,!1,$t.toString(r))}setLimit(t,r,s,n){return new AA({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:$t.toString(n)}]})}_addCheck(t){return new AA({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:$t.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$t.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$t.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$t.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$t.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:$t.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:$t.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$t.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$t.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ms.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(r)&&Number.isFinite(t)}}AA.create=e=>new AA({checks:[],typeName:mr.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,..._r(e)});class mA extends Yr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Ht.bigint){const n=this._getOrReturnCtx(t);return Mt(n,{code:ft.invalid_type,expected:Ht.bigint,received:n.parsedType}),Pr}let r;const s=new Go;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="multipleOf"?t.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):ms.assertNever(n);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,$t.toString(r))}gt(t,r){return this.setLimit("min",t,!1,$t.toString(r))}lte(t,r){return this.setLimit("max",t,!0,$t.toString(r))}lt(t,r){return this.setLimit("max",t,!1,$t.toString(r))}setLimit(t,r,s,n){return new mA({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:$t.toString(n)}]})}_addCheck(t){return new mA({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$t.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$t.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$t.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$t.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:$t.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}mA.create=e=>{var t;return new mA({checks:[],typeName:mr.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,..._r(e)})};class FS extends Yr{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ht.boolean){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.boolean,received:r.parsedType}),Pr}return fa(t.data)}}FS.create=e=>new FS({typeName:mr.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,..._r(e)});class Fv extends Yr{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ht.date){const n=this._getOrReturnCtx(t);return Mt(n,{code:ft.invalid_type,expected:Ht.date,received:n.parsedType}),Pr}if(isNaN(t.data.getTime())){const n=this._getOrReturnCtx(t);return Mt(n,{code:ft.invalid_date}),Pr}const r=new Go;let s;for(const n of this._def.checks)n.kind==="min"?t.data.getTime()<n.value&&(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):n.kind==="max"?t.data.getTime()>n.value&&(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):ms.assertNever(n);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Fv({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:$t.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:$t.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}Fv.create=e=>new Fv({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:mr.ZodDate,..._r(e)});class RF extends Yr{_parse(t){if(this._getType(t)!==Ht.symbol){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.symbol,received:r.parsedType}),Pr}return fa(t.data)}}RF.create=e=>new RF({typeName:mr.ZodSymbol,..._r(e)});class RS extends Yr{_parse(t){if(this._getType(t)!==Ht.undefined){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.undefined,received:r.parsedType}),Pr}return fa(t.data)}}RS.create=e=>new RS({typeName:mr.ZodUndefined,..._r(e)});class TS extends Yr{_parse(t){if(this._getType(t)!==Ht.null){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.null,received:r.parsedType}),Pr}return fa(t.data)}}TS.create=e=>new TS({typeName:mr.ZodNull,..._r(e)});class Ew extends Yr{constructor(){super(...arguments),this._any=!0}_parse(t){return fa(t.data)}}Ew.create=e=>new Ew({typeName:mr.ZodAny,..._r(e)});class lv extends Yr{constructor(){super(...arguments),this._unknown=!0}_parse(t){return fa(t.data)}}lv.create=e=>new lv({typeName:mr.ZodUnknown,..._r(e)});class Ag extends Yr{_parse(t){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.never,received:r.parsedType}),Pr}}Ag.create=e=>new Ag({typeName:mr.ZodNever,..._r(e)});class TF extends Yr{_parse(t){if(this._getType(t)!==Ht.undefined){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.void,received:r.parsedType}),Pr}return fa(t.data)}}TF.create=e=>new TF({typeName:mr.ZodVoid,..._r(e)});class $u extends Yr{_parse(t){const{ctx:r,status:s}=this._processInputParams(t),n=this._def;if(r.parsedType!==Ht.array)return Mt(r,{code:ft.invalid_type,expected:Ht.array,received:r.parsedType}),Pr;if(n.exactLength!==null){const o=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(o||a)&&(Mt(r,{code:o?ft.too_big:ft.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(Mt(r,{code:ft.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(Mt(r,{code:ft.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>n.type._parseAsync(new Oh(r,o,r.path,a)))).then(o=>Go.mergeArray(s,o));const i=[...r.data].map((o,a)=>n.type._parseSync(new Oh(r,o,r.path,a)));return Go.mergeArray(s,i)}get element(){return this._def.type}min(t,r){return new $u({...this._def,minLength:{value:t,message:$t.toString(r)}})}max(t,r){return new $u({...this._def,maxLength:{value:t,message:$t.toString(r)}})}length(t,r){return new $u({...this._def,exactLength:{value:t,message:$t.toString(r)}})}nonempty(t){return this.min(1,t)}}$u.create=(e,t)=>new $u({type:e,minLength:null,maxLength:null,exactLength:null,typeName:mr.ZodArray,..._r(t)});function B0(e){if(e instanceof Fn){const t={};for(const r in e.shape){const s=e.shape[r];t[r]=Dh.create(B0(s))}return new Fn({...e._def,shape:()=>t})}else return e instanceof $u?new $u({...e._def,type:B0(e.element)}):e instanceof Dh?Dh.create(B0(e.unwrap())):e instanceof CA?CA.create(B0(e.unwrap())):e instanceof Nh?Nh.create(e.items.map(t=>B0(t))):e}class Fn extends Yr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=ms.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Ht.object){const l=this._getOrReturnCtx(t);return Mt(l,{code:ft.invalid_type,expected:Ht.object,received:l.parsedType}),Pr}const{status:r,ctx:s}=this._processInputParams(t),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ag&&this._def.unknownKeys==="strip"))for(const l in s.data)i.includes(l)||o.push(l);const a=[];for(const l of i){const c=n[l],u=s.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Oh(s,u,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof Ag){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of o)a.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});else if(l==="strict")o.length>0&&(Mt(s,{code:ft.unrecognized_keys,keys:o}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of o){const u=s.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Oh(s,u,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of a){const u=await c.key,d=await c.value;l.push({key:u,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>Go.mergeObjectSync(r,l)):Go.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(t){return $t.errToObj,new Fn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,s)=>{var n,i,o,a;const l=(o=(i=(n=this._def).errorMap)===null||i===void 0?void 0:i.call(n,r,s).message)!==null&&o!==void 0?o:s.defaultError;return r.code==="unrecognized_keys"?{message:(a=$t.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Fn({...this._def,unknownKeys:"strip"})}passthrough(){return new Fn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Fn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Fn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:mr.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Fn({...this._def,catchall:t})}pick(t){const r={};return ms.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new Fn({...this._def,shape:()=>r})}omit(t){const r={};return ms.objectKeys(this.shape).forEach(s=>{t[s]||(r[s]=this.shape[s])}),new Fn({...this._def,shape:()=>r})}deepPartial(){return B0(this)}partial(t){const r={};return ms.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];t&&!t[s]?r[s]=n:r[s]=n.optional()}),new Fn({...this._def,shape:()=>r})}required(t){const r={};return ms.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])r[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof Dh;)n=n._def.innerType;r[s]=n}}),new Fn({...this._def,shape:()=>r})}keyof(){return jX(ms.objectKeys(this.shape))}}Fn.create=(e,t)=>new Fn({shape:()=>e,unknownKeys:"strip",catchall:Ag.create(),typeName:mr.ZodObject,..._r(t)});Fn.strictCreate=(e,t)=>new Fn({shape:()=>e,unknownKeys:"strict",catchall:Ag.create(),typeName:mr.ZodObject,..._r(t)});Fn.lazycreate=(e,t)=>new Fn({shape:e,unknownKeys:"strip",catchall:Ag.create(),typeName:mr.ZodObject,..._r(t)});class DS extends Yr{_parse(t){const{ctx:r}=this._processInputParams(t),s=this._def.options;function n(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new Ul(a.ctx.common.issues));return Mt(r,{code:ft.invalid_union,unionErrors:o}),Pr}if(r.common.async)return Promise.all(s.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(n);{let i;const o=[];for(const l of s){const c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(l=>new Ul(l));return Mt(r,{code:ft.invalid_union,unionErrors:a}),Pr}}get options(){return this._def.options}}DS.create=(e,t)=>new DS({options:e,typeName:mr.ZodUnion,..._r(t)});const If=e=>e instanceof kS?If(e.schema):e instanceof od?If(e.innerType()):e instanceof BS?[e.value]:e instanceof vA?e.options:e instanceof LS?ms.objectValues(e.enum):e instanceof HS?If(e._def.innerType):e instanceof RS?[void 0]:e instanceof TS?[null]:e instanceof Dh?[void 0,...If(e.unwrap())]:e instanceof CA?[null,...If(e.unwrap())]:e instanceof d5||e instanceof OS?If(e.unwrap()):e instanceof GS?If(e._def.innerType):[];class yT extends Yr{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ht.object)return Mt(r,{code:ft.invalid_type,expected:Ht.object,received:r.parsedType}),Pr;const s=this.discriminator,n=r.data[s],i=this.optionsMap.get(n);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(Mt(r,{code:ft.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Pr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,s){const n=new Map;for(const i of r){const o=If(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(n.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,i)}}return new yT({typeName:mr.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,..._r(s)})}}function Yk(e,t){const r=Yf(e),s=Yf(t);if(e===t)return{valid:!0,data:e};if(r===Ht.object&&s===Ht.object){const n=ms.objectKeys(t),i=ms.objectKeys(e).filter(a=>n.indexOf(a)!==-1),o={...e,...t};for(const a of i){const l=Yk(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===Ht.array&&s===Ht.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let i=0;i<e.length;i++){const o=e[i],a=t[i],l=Yk(o,a);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===Ht.date&&s===Ht.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class MS extends Yr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=(i,o)=>{if(jk(i)||jk(o))return Pr;const a=Yk(i.value,o.value);return a.valid?((Kk(i)||Kk(o))&&r.dirty(),{status:r.value,value:a.data}):(Mt(s,{code:ft.invalid_intersection_types}),Pr)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,o])=>n(i,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}MS.create=(e,t,r)=>new MS({left:e,right:t,typeName:mr.ZodIntersection,..._r(r)});class Nh extends Yr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ht.array)return Mt(s,{code:ft.invalid_type,expected:Ht.array,received:s.parsedType}),Pr;if(s.data.length<this._def.items.length)return Mt(s,{code:ft.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Pr;!this._def.rest&&s.data.length>this._def.items.length&&(Mt(s,{code:ft.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const n=[...s.data].map((i,o)=>{const a=this._def.items[o]||this._def.rest;return a?a._parse(new Oh(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(n).then(i=>Go.mergeArray(r,i)):Go.mergeArray(r,n)}get items(){return this._def.items}rest(t){return new Nh({...this._def,rest:t})}}Nh.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nh({items:e,typeName:mr.ZodTuple,rest:null,..._r(t)})};class IS extends Yr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ht.object)return Mt(s,{code:ft.invalid_type,expected:Ht.object,received:s.parsedType}),Pr;const n=[],i=this._def.keyType,o=this._def.valueType;for(const a in s.data)n.push({key:i._parse(new Oh(s,a,s.path,a)),value:o._parse(new Oh(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?Go.mergeObjectAsync(r,n):Go.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,s){return r instanceof Yr?new IS({keyType:t,valueType:r,typeName:mr.ZodRecord,..._r(s)}):new IS({keyType:zu.create(),valueType:t,typeName:mr.ZodRecord,..._r(r)})}}class DF extends Yr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ht.map)return Mt(s,{code:ft.invalid_type,expected:Ht.map,received:s.parsedType}),Pr;const n=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([a,l],c)=>({key:n._parse(new Oh(s,a,s.path,[c,"key"])),value:i._parse(new Oh(s,l,s.path,[c,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Pr;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(c.value,u.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Pr;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(c.value,u.value)}return{status:r.value,value:a}}}}DF.create=(e,t,r)=>new DF({valueType:t,keyType:e,typeName:mr.ZodMap,..._r(r)});class Rv extends Yr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ht.set)return Mt(s,{code:ft.invalid_type,expected:Ht.set,received:s.parsedType}),Pr;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(Mt(s,{code:ft.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(Mt(s,{code:ft.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Pr;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}const a=[...s.data.values()].map((l,c)=>i._parse(new Oh(s,l,s.path,c)));return s.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,r){return new Rv({...this._def,minSize:{value:t,message:$t.toString(r)}})}max(t,r){return new Rv({...this._def,maxSize:{value:t,message:$t.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Rv.create=(e,t)=>new Rv({valueType:e,minSize:null,maxSize:null,typeName:mr.ZodSet,..._r(t)});class rw extends Yr{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ht.function)return Mt(r,{code:ft.invalid_type,expected:Ht.function,received:r.parsedType}),Pr;function s(a,l){return EF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xF(),xw].filter(c=>!!c),issueData:{code:ft.invalid_arguments,argumentsError:l}})}function n(a,l){return EF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xF(),xw].filter(c=>!!c),issueData:{code:ft.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Pw){const a=this;return fa(async function(...l){const c=new Ul([]),u=await a._def.args.parseAsync(l,i).catch(g=>{throw c.addIssue(s(l,g)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(n(d,g)),c})})}else{const a=this;return fa(function(...l){const c=a._def.args.safeParse(l,i);if(!c.success)throw new Ul([s(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,i);if(!d.success)throw new Ul([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new rw({...this._def,args:Nh.create(t).rest(lv.create())})}returns(t){return new rw({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,s){return new rw({args:t||Nh.create([]).rest(lv.create()),returns:r||lv.create(),typeName:mr.ZodFunction,..._r(s)})}}class kS extends Yr{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}kS.create=(e,t)=>new kS({getter:e,typeName:mr.ZodLazy,..._r(t)});class BS extends Yr{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return Mt(r,{received:r.data,code:ft.invalid_literal,expected:this._def.value}),Pr}return{status:"valid",value:t.data}}get value(){return this._def.value}}BS.create=(e,t)=>new BS({value:e,typeName:mr.ZodLiteral,..._r(t)});function jX(e,t){return new vA({values:e,typeName:mr.ZodEnum,..._r(t)})}class vA extends Yr{constructor(){super(...arguments),f1.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),s=this._def.values;return Mt(r,{expected:ms.joinValues(s),received:r.parsedType,code:ft.invalid_type}),Pr}if(FF(this,f1)||zX(this,f1,new Set(this._def.values)),!FF(this,f1).has(t.data)){const r=this._getOrReturnCtx(t),s=this._def.values;return Mt(r,{received:r.data,code:ft.invalid_enum_value,options:s}),Pr}return fa(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return vA.create(t,{...this._def,...r})}exclude(t,r=this._def){return vA.create(this.options.filter(s=>!t.includes(s)),{...this._def,...r})}}f1=new WeakMap;vA.create=jX;class LS extends Yr{constructor(){super(...arguments),A1.set(this,void 0)}_parse(t){const r=ms.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==Ht.string&&s.parsedType!==Ht.number){const n=ms.objectValues(r);return Mt(s,{expected:ms.joinValues(n),received:s.parsedType,code:ft.invalid_type}),Pr}if(FF(this,A1)||zX(this,A1,new Set(ms.getValidEnumValues(this._def.values))),!FF(this,A1).has(t.data)){const n=ms.objectValues(r);return Mt(s,{received:s.data,code:ft.invalid_enum_value,options:n}),Pr}return fa(t.data)}get enum(){return this._def.values}}A1=new WeakMap;LS.create=(e,t)=>new LS({values:e,typeName:mr.ZodNativeEnum,..._r(t)});class Pw extends Yr{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ht.promise&&r.common.async===!1)return Mt(r,{code:ft.invalid_type,expected:Ht.promise,received:r.parsedType}),Pr;const s=r.parsedType===Ht.promise?r.data:Promise.resolve(r.data);return fa(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Pw.create=(e,t)=>new Pw({type:e,typeName:mr.ZodPromise,..._r(t)});class od extends Yr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===mr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=this._def.effect||null,i={addIssue:o=>{Mt(s,o),o.fatal?r.abort():r.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const o=n.transform(s.data,i);if(s.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return Pr;const l=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return l.status==="aborted"?Pr:l.status==="dirty"||r.value==="dirty"?PF(l.value):l});{if(r.value==="aborted")return Pr;const a=this._def.schema._parseSync({data:o,path:s.path,parent:s});return a.status==="aborted"?Pr:a.status==="dirty"||r.value==="dirty"?PF(a.value):a}}if(n.type==="refinement"){const o=a=>{const l=n.refinement(a,i);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?Pr:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?Pr:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ES(o))return o;const a=n.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>ES(o)?Promise.resolve(n.transform(o.value,i)).then(a=>({status:r.value,value:a})):o);ms.assertNever(n)}}od.create=(e,t,r)=>new od({schema:e,typeName:mr.ZodEffects,effect:t,..._r(r)});od.createWithPreprocess=(e,t,r)=>new od({schema:t,effect:{type:"preprocess",transform:e},typeName:mr.ZodEffects,..._r(r)});class Dh extends Yr{_parse(t){return this._getType(t)===Ht.undefined?fa(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Dh.create=(e,t)=>new Dh({innerType:e,typeName:mr.ZodOptional,..._r(t)});class CA extends Yr{_parse(t){return this._getType(t)===Ht.null?fa(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}CA.create=(e,t)=>new CA({innerType:e,typeName:mr.ZodNullable,..._r(t)});class HS extends Yr{_parse(t){const{ctx:r}=this._processInputParams(t);let s=r.data;return r.parsedType===Ht.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}HS.create=(e,t)=>new HS({innerType:e,typeName:mr.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,..._r(t)});class GS extends Yr{_parse(t){const{ctx:r}=this._processInputParams(t),s={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return PS(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ul(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ul(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}GS.create=(e,t)=>new GS({innerType:e,typeName:mr.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,..._r(t)});class MF extends Yr{_parse(t){if(this._getType(t)!==Ht.nan){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.nan,received:r.parsedType}),Pr}return{status:"valid",value:t.data}}}MF.create=e=>new MF({typeName:mr.ZodNaN,..._r(e)});const wTe=Symbol("zod_brand");class d5 extends Yr{_parse(t){const{ctx:r}=this._processInputParams(t),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}}class Xx extends Yr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Pr:n.status==="dirty"?(r.dirty(),PF(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Pr:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,r){return new Xx({in:t,out:r,typeName:mr.ZodPipeline})}}class OS extends Yr{_parse(t){const r=this._def.innerType._parse(t),s=n=>(ES(n)&&(n.value=Object.freeze(n.value)),n);return PS(r)?r.then(n=>s(n)):s(r)}unwrap(){return this._def.innerType}}OS.create=(e,t)=>new OS({innerType:e,typeName:mr.ZodReadonly,..._r(t)});function KX(e,t={},r){return e?Ew.create().superRefine((s,n)=>{var i,o;if(!e(s)){const a=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,l=(o=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...c,fatal:l})}}):Ew.create()}const yTe={object:Fn.lazycreate};var mr;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(mr||(mr={}));const bTe=(e,t={message:`Input not instance of ${e.name}`})=>KX(r=>r instanceof e,t),YX=zu.create,ZX=AA.create,STe=MF.create,xTe=mA.create,XX=FS.create,ETe=Fv.create,PTe=RF.create,FTe=RS.create,RTe=TS.create,TTe=Ew.create,DTe=lv.create,MTe=Ag.create,ITe=TF.create,kTe=$u.create,BTe=Fn.create,LTe=Fn.strictCreate,HTe=DS.create,GTe=yT.create,OTe=MS.create,NTe=Nh.create,_Te=IS.create,VTe=DF.create,zTe=Rv.create,QTe=rw.create,UTe=kS.create,WTe=BS.create,jTe=vA.create,KTe=LS.create,YTe=Pw.create,GG=od.create,ZTe=Dh.create,XTe=CA.create,$Te=od.createWithPreprocess,JTe=Xx.create,qTe=()=>YX().optional(),eDe=()=>ZX().optional(),tDe=()=>XX().optional(),rDe={string:e=>zu.create({...e,coerce:!0}),number:e=>AA.create({...e,coerce:!0}),boolean:e=>FS.create({...e,coerce:!0}),bigint:e=>mA.create({...e,coerce:!0}),date:e=>Fv.create({...e,coerce:!0})},sDe=Pr;var y=Object.freeze({__proto__:null,defaultErrorMap:xw,setErrorMap:sTe,getErrorMap:xF,makeIssue:EF,EMPTY_PATH:nTe,addIssueToContext:Mt,ParseStatus:Go,INVALID:Pr,DIRTY:PF,OK:fa,isAborted:jk,isDirty:Kk,isValid:ES,isAsync:PS,get util(){return ms},get objectUtil(){return Wk},ZodParsedType:Ht,getParsedType:Yf,ZodType:Yr,datetimeRegex:WX,ZodString:zu,ZodNumber:AA,ZodBigInt:mA,ZodBoolean:FS,ZodDate:Fv,ZodSymbol:RF,ZodUndefined:RS,ZodNull:TS,ZodAny:Ew,ZodUnknown:lv,ZodNever:Ag,ZodVoid:TF,ZodArray:$u,ZodObject:Fn,ZodUnion:DS,ZodDiscriminatedUnion:yT,ZodIntersection:MS,ZodTuple:Nh,ZodRecord:IS,ZodMap:DF,ZodSet:Rv,ZodFunction:rw,ZodLazy:kS,ZodLiteral:BS,ZodEnum:vA,ZodNativeEnum:LS,ZodPromise:Pw,ZodEffects:od,ZodTransformer:od,ZodOptional:Dh,ZodNullable:CA,ZodDefault:HS,ZodCatch:GS,ZodNaN:MF,BRAND:wTe,ZodBranded:d5,ZodPipeline:Xx,ZodReadonly:OS,custom:KX,Schema:Yr,ZodSchema:Yr,late:yTe,get ZodFirstPartyTypeKind(){return mr},coerce:rDe,any:TTe,array:kTe,bigint:xTe,boolean:XX,date:ETe,discriminatedUnion:GTe,effect:GG,enum:jTe,function:QTe,instanceof:bTe,intersection:OTe,lazy:UTe,literal:WTe,map:VTe,nan:STe,nativeEnum:KTe,never:MTe,null:RTe,nullable:XTe,number:ZX,object:BTe,oboolean:tDe,onumber:eDe,optional:ZTe,ostring:qTe,pipeline:JTe,preprocess:$Te,promise:YTe,record:_Te,set:zTe,strictObject:LTe,string:YX,symbol:PTe,transformer:GG,tuple:NTe,undefined:FTe,union:HTe,unknown:DTe,void:ITe,NEVER:sDe,ZodIssueCode:ft,quotelessJson:rTe,ZodError:Ul});y.object({__isRef:y.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:y.string().describe("Upstream block id"),name:y.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:y.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();const nDe=24;y.string().length(nDe).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");var OG={exports:{}};(function(e,t){t=e.exports=r,t.getSerialize=s;function r(n,i,o,a){return JSON.stringify(n,s(i,a),o)}function s(n,i){var o=[],a=[];return i==null&&(i=function(l,c){return o[0]===c?"[Circular ~]":"[Circular ~."+a.slice(0,o.indexOf(c)).join(".")+"]"}),function(l,c){if(o.length>0){var u=o.indexOf(this);~u?o.splice(u+1):o.push(this),~u?a.splice(u,1/0,l):a.push(l),~o.indexOf(c)&&(c=i.call(this,l,c))}else o.push(c);return n==null?c:n.call(this,l,c)}}})(OG,OG.exports);const iDe=y.object({type:y.literal("PlError"),name:y.string(),message:y.string(),fullMessage:y.string().optional(),stack:y.string().optional()}),oDe=iDe.extend({cause:y.lazy(()=>IF).optional(),errors:y.lazy(()=>IF.array()).optional()}),aDe=y.object({type:y.literal("StandardError"),name:y.string(),message:y.string(),stack:y.string().optional()}),lDe=aDe.extend({cause:y.lazy(()=>IF).optional(),errors:y.lazy(()=>IF.array()).optional()}),IF=y.union([lDe,oDe]),cDe=y.object({name:y.string(),message:y.string(),fullMessage:y.string().optional(),stack:y.string().optional()}),NG=cDe.extend({cause:y.lazy(()=>NG).optional(),errors:y.lazy(()=>NG.array()).optional()});function uDe(e){if(e&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(e);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const dDe=y.object({type:y.string(),importance:y.number().optional(),id:y.string().optional(),label:y.string()});y.array(dDe);const hDe="1.31.15";function $X(){return uDe({sdkVersion:hDe})}function pDe(e){try{return $X()}catch{return e}}function gDe(e){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(e)}class fDe extends Error{}class JX extends Error{constructor(t){super(t.map(r=>typeof r=="string"?r:r.message).join(`
667
+ `),this.eChart=fe,this.eWrapper=fe,this.eChartContainer=fe,this.eMenuContainer=fe,this.eEmpty=fe,this.params=e}wireBeans(e){this.crossFilterService=e.chartCrossFilterSvc,this.chartTranslation=e.chartTranslation,this.chartMenuSvc=e.chartMenuSvc,this.focusSvc=e.focusSvc,this.popupSvc=e.popupSvc,this.enterpriseChartProxyFactory=e.enterpriseChartProxyFactory,this.environment=e.environment}postConstruct(){const e={...this.params,chartType:SS(this.params.chartType),chartThemeName:this.getThemeName()},t=this.gos.get("enableRtl");this.eWrapper.classList.add(t?"ag-rtl":"ag-ltr");const r=this.createBean(new y2e(e));this.chartController=this.createManagedBean(new nFe(r)),this.chartOptionsService=this.createManagedBean(new hRe(this.chartController)),this.validateCustomThemes(),this.createChart(),this.params.insideDialog?this.addDialog():(this.addManagedEventListeners({gridStylesChanged:this.updateTheme.bind(this)}),this.updateTheme()),this.addMenu(),this.addManagedElementListeners(this.getGui(),{focusin:this.setActiveChartCellRange.bind(this)}),this.addManagedListeners(this.chartController,{chartModelUpdate:this.update.bind(this)}),this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes"],this.reactivePropertyUpdate.bind(this)),this.update(),this.raiseChartCreatedEvent()}updateTheme(){this.environment.applyThemeClasses(this.getGui())}createChart(){let e;this.chartProxy&&(e=this.chartProxy.destroy({keepChartInstance:!0}));const t=(n,i)=>{const o=this.params.crossFilteringContext;o.lastSelectedChartId=i?"":this.chartController.getChartId(),i&&this.params.crossFilteringResetCallback(),this.crossFilterService.filter(n,i)},r=this.chartController.getChartType(),s={agChartsExports:this.beans.agChartsExports,chartType:r,chartInstance:e,getChartThemeName:this.getChartThemeName.bind(this),getChartThemes:this.getChartThemes.bind(this),customChartThemes:this.gos.get("customChartThemes"),getGridOptionsChartThemeOverrides:()=>this.getGridOptionsChartThemeOverrides(),getExtraPaddingDirections:()=>{var n;return((n=this.chartMenu)==null?void 0:n.getExtraPaddingDirections())??[]},apiChartThemeOverrides:this.params.chartThemeOverrides,crossFiltering:this.params.crossFiltering??!1,crossFilterCallback:t,parentElement:this.eChart,grouping:this.chartController.isGrouping(),chartThemeToRestore:this.params.chartThemeName,chartOptionsToRestore:this.params.chartOptionsToRestore,chartPaletteToRestore:this.params.chartPaletteToRestore,seriesChartTypes:this.chartController.getSeriesChartTypes(),translate:n=>this.chartTranslation.translate(n)};if(this.params.chartOptionsToRestore=void 0,this.chartType=r,this.chartProxy=this.createChartProxy(s),!this.chartProxy){Ce(138,{chartType:s.chartType});return}this.chartController.setChartProxy(this.chartProxy),this.createMenuContext()}createMenuContext(){if(this.chartMenuContext)return;const e=this.createManagedBean(new Ev(this.chartOptionsService.getChartThemeOverridesProxy())),t=this.createManagedBean(new Ev(this.chartOptionsService.getAxisThemeOverridesProxy()));this.chartMenuContext={chartController:this.chartController,chartOptionsService:this.chartOptionsService,chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t}}getChartThemeName(){return this.chartController.getChartThemeName()}getChartThemes(){return this.chartController.getThemeNames()}getGridOptionsChartThemeOverrides(){return this.gos.get("chartThemeOverrides")}createChartProxy(e){var s;const{chartType:t}=e;switch(t){case"column":case"bar":case"groupedColumn":case"stackedColumn":case"normalizedColumn":case"groupedBar":case"stackedBar":case"normalizedBar":return new aFe(e);case"pie":case"donut":case"doughnut":return new hFe(e);case"area":case"stackedArea":case"normalizedArea":return new iFe(e);case"line":case"stackedLine":case"normalizedLine":return new lFe(e);case"scatter":case"bubble":return new cFe(e);case"columnLineCombo":case"areaColumnCombo":case"customCombo":return new uFe(e)}const r=(s=this.enterpriseChartProxyFactory)==null?void 0:s.createChartProxy(e);if(!r)throw Kc(251,{chartType:t});return r}addDialog(){const e=this.chartTranslation.translate(this.params.pivotChart?"pivotChartTitle":"rangeChartTitle"),{width:t,height:r}=this.getBestDialogSize(),s=this.params.focusDialogOnOpen?()=>setTimeout(()=>wi(this.getGui())):void 0;this.chartDialog=new Ux({resizable:!0,movable:!0,maximizable:!0,title:e,width:t,height:r,component:this,centered:!0,closable:!0,afterGuiAttached:s,postProcessPopupParams:{type:"chart"}}),this.createBean(this.chartDialog),this.chartDialog.addEventListener("destroyed",()=>{this.destroy(),this.chartMenuSvc.hideAdvancedSettings();const n=this.focusSvc.getFocusedCell();setTimeout(()=>{this.focusSvc.isAlive()&&(n?this.focusSvc.setFocusedCell({...n,forceBrowserFocus:!0}):Nj(this.beans))})})}getBestDialogSize(){const e=this.popupSvc.getPopupParent(),t=mv(e)*.75,r=KR(e)*.75,s=.553,n=this.chartProxy.getChart();let i=this.params.insideDialog?850:n.width,o=this.params.insideDialog?470:n.height;return(i>t||o>r)&&(i=Math.min(i,t),o=Math.round(i*s),o>r&&(o=r,i=Math.min(i,Math.round(o/s)))),{width:i,height:o}}addMenu(){this.params.crossFiltering||(this.chartMenu=this.createBean(new cRe(this.eChartContainer,this.eMenuContainer,this.chartMenuContext)),this.eChartContainer.appendChild(this.chartMenu.getGui()))}update(e){if(e!=null&&e.chartId&&!this.chartController.update(e))return;const t=this.chartTypeChanged(e),r=t||this.chartEmpty?(n=>{const i=this.chartType,o=n,a=this.chartProxy.getChart(),l=a==null?void 0:a.getOptions(),c=a==null?void 0:a.axes;return this.chartOptionsService.getPersistedChartThemeOverrides(l,c,i,o??i)})(t):void 0;t&&this.createChart(),r&&(e!=null&&e.chartThemeOverrides)&&Kn(r,e.chartThemeOverrides);const s=r??(e==null?void 0:e.chartThemeOverrides);this.updateChart(s),e!=null&&e.chartId&&this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartApiUpdateEvent()})}updateChart(e){const{chartProxy:t}=this,r=this.chartController.getSelectedValueColState(),s=this.chartController.getChartData(),n=this.handleEmptyChart(s,r.length);if(this.chartEmpty=n,n){e&&this.chartController.updateThemeOverrides(e);return}const i=this.chartController.getChartUpdateParams(e);t.update(i),this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartUpdatedEvent()})}chartTypeChanged(e){const[t,r]=[this.chartController.getChartType(),e==null?void 0:e.chartType],s=r?SS(r):void 0;return this.chartType!==t?s??t:s&&t!==s?s:null}getChartModel(){return this.chartController.getChartModel()}getChartImageDataURL(e){return this.chartProxy.getChartImageDataURL(e)}handleEmptyChart(e,t){const r=this.chartController.isPivotChart()&&!this.chartController.isPivotMode(),s=this.chartController.getChartType();let n=1;this.chartController.isActiveXYChart()?n=s==="bubble"?3:2:Zm(ln(s))&&(n=0);const i=t<n||e.length===0;if(this.eChart){const o=r||i;vt(this.eChart,!o),vt(this.eEmpty,o)}return r?(this.eEmpty.innerText=this.chartTranslation.translate("pivotChartRequiresPivotMode"),!0):i?(this.eEmpty.innerText=this.chartTranslation.translate("noDataToChart"),!0):!1}downloadChart(e,t,r){this.chartProxy.downloadChart(e,t,r)}openChartToolPanel(e){const t=e&&C2[e];this.chartMenu.showMenu({panel:t})}closeChartToolPanel(){this.chartMenu.hideMenu()}getChartId(){return this.chartController.getChartId()}getUnderlyingChart(){return this.chartProxy.getChartRef()}crossFilteringReset(){this.chartProxy.crossFilteringReset()}setActiveChartCellRange(e){this.getGui().contains(e.relatedTarget)||this.chartController.setChartRange(!0)}getThemeName(){const e=this.gos.get("chartThemes")||QZ;if(e.length===0)throw new Error(Kc(254));const{chartThemeName:t}=this.params;return e.includes(t)?t:e[0]}getAllKeysInObjects(e){const t={};return e.filter(r=>r!=null).forEach(r=>{Object.keys(r).forEach(s=>t[s]=null)}),Object.keys(t)}validateCustomThemes(){const e=this.getChartThemes(),t=this.gos.get("customChartThemes");t&&this.getAllKeysInObjects([t]).forEach(r=>{e.includes(r)||Ce(139,{customThemeName:r})})}reactivePropertyUpdate(){this.chartController.setChartThemeName(this.getThemeName(),!0);const e=this.getChartId(),t=this.chartController.isCrossFilterChart()?"crossFilter":this.getChartModel().modelType,r=this.gos.get("chartThemeOverrides")||{};this.update({type:`${t}ChartUpdate`,chartId:e,chartThemeOverrides:r})}raiseChartCreatedEvent(){this.chartProxy.getChart().waitForUpdate().then(()=>{this.eventSvc.dispatchEvent({type:"chartCreated",chartId:this.chartController.getChartId()})})}raiseChartDestroyedEvent(){this.eventSvc.dispatchEvent({type:"chartDestroyed",chartId:this.chartController.getChartId()})}destroy(){var t;super.destroy(),this.chartProxy&&this.chartProxy.destroy(),this.destroyBean(this.chartMenu),this.chartDialog&&this.chartDialog.isAlive()&&this.destroyBean(this.chartDialog),(t=this.onDestroyColorSchemeChangeListener)==null||t.call(this);const e=this.getGui();$r(e),Dn(e),this.raiseChartDestroyedEvent()}};function fRe(e){return e.version,e.version==null&&(e.version=DRe(e)),e=Ro("23.0.0",e,ARe),e=Ro("24.0.0",e,mRe),e=Ro("25.1.0",e,vRe),e=Ro("26.0.0",e,CRe),e=Ro("26.1.0",e,wRe),e=Ro("26.2.0",e,yRe),e=Ro("28.0.0",e,bRe),e=Ro("28.2.0",e,SRe),e=Ro("29.0.0",e,xRe),e=Ro("29.1.0",e,BX),e=Ro("29.2.0",e,LX),e=Ro("30.0.0",e,ERe),e=Ro("31.0.0",e,PRe),e=Ro("32.0.0",e,FRe),e=Ro("33.0.0",e,RRe),e=TRe(e),e=Ro(Rr,e,t=>t),e}function ARe(e){return e=to("chartOptions.legend.item.marker.type","shape",e),e=to("chartOptions.seriesDefaults.marker.type","shape",e),e=to("chartOptions.legend.padding","spacing",e),e}function mRe(e){e=js("chartOptions.seriesDefaults.marker.minSize",e);const{chartType:t,chartPalette:r,chartOptions:{xAxis:s,yAxis:n,...i},...o}=e,a=$Pe(t),l=a==null?void 0:a.map((u,d)=>({type:u,...d===0?s:n}));return{chartType:t,chartThemeName:{borneo:"ag-default",material:"ag-material",bright:"ag-vivid"}[r]??"ag-default",chartOptions:{...i,axes:l,xAxis:s,yAxis:n},...o}}function vRe(e){return e=to("chartOptions.seriesDefaults.label.minRequiredAngle","minAngle",e),e}function CRe(e){return e=sg("chartOptions.seriesDefaults.highlightStyle",e,({dimOpacity:r,...s})=>({...s,...r!=null?{series:{dimOpacity:r}}:{}})),e=js("chart",e),e=js("chartOptions.seriesDefaults.tooltipClass",e),e=js("chartOptions.seriesDefaults.tooltipTracking",e),e=FG("chartOptions.axes[].label.rotation",0,e),e=FG("chartOptions.axes[].label.rotation",335,e),e}function wRe(e){const t=({item:r,series:s,...n})=>({item:{...n,...r},...s?{series:s}:{}});return e=sg("chartOptions.seriesDefaults.highlightStyle",e,t),e=sg("chartOptions.series[].highlightStyle",e,t),e}function yRe(e){e=w2("chartOptions.seriesDefaults.fill.opacity","chartOptions.seriesDefaults.fillOpacity",e),e=w2("chartOptions.seriesDefaults.stroke.opacity","chartOptions.seriesDefaults.strokeOpacity",e),e=w2("chartOptions.seriesDefaults.stroke.width","chartOptions.seriesDefaults.strokeWidth",e),e=js("chartOptions.seriesDefaults.fill",e),e=js("chartOptions.seriesDefaults.stroke",e),e=js("chartOptions.seriesDefaults.callout.colors",e),e=js("chartOptions.xAxis",e),e=js("chartOptions.yAxis",e);const{chartType:t,chartOptions:{axes:r,series:s,seriesDefaults:n,...i},...o}=e,a=SS(t),l=ln(a),c=[l],u={};if(!DZ(l)){const g={top:{},bottom:{},left:{},right:{}},A=r.map(({type:w,...v})=>({[w]:{...g,...v}})).reduce(TG,{});IZ.filter(w=>A[w]==null).forEach(w=>{A[w]={...g}}),u.axes=A}const d=c.map(g=>({[g]:{...u,series:n,...i}})).reduce(TG,{});return e={...o,chartType:a,chartOptions:d},e}function bRe(e){return e=js("chartOptions.*.title.padding",e),e=js("chartOptions.*.subtitle.padding",e),e=js("chartOptions.*.axes.*.title.padding",e),e=c5("chartOptions.*.axes.*.title.enabled",!1,e),e}function SRe(e){return e=to("chartOptions.pie.series.callout","calloutLine",e),e=to("chartOptions.pie.series.label","calloutLabel",e),e=to("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=to("chartOptions.pie.series.labelName","sectorLabelName",e),e=to("chartOptions.donut.series.callout","calloutLine",e),e=to("chartOptions.donut.series.label","calloutLabel",e),e=to("chartOptions.donut.series.labelKey","sectorLabelKey",e),e=to("chartOptions.donut.series.labelName","sectorLabelName",e),e}function xRe(e){return e=Mb("chartOptions.scatter.series.fill","chartOptions.scatter.series.marker.fill",e),e=Mb("chartOptions.scatter.series.fillOpacity","chartOptions.scatter.series.marker.fillOpacity",e),e=Mb("chartOptions.scatter.series.stroke","chartOptions.scatter.series.marker.stroke",e),e=Mb("chartOptions.scatter.series.strokeOpacity","chartOptions.scatter.series.marker.strokeOpacity",e),e=Mb("chartOptions.scatter.series.strokeWidth","chartOptions.scatter.series.marker.strokeWidth",e),e=w2("chartOptions.scatter.series.paired","chartOptions.scatter.paired",e),e}function BX(e){return e=js("chartOptions.axes[].tick.count",e),e}function LX(e){return e=sg("chartOptions.*.tooltip",e,({tracking:r,...s})=>{const n={...s};return r===!1?(n.position??(n.position={type:"pointer"}),n.range??(n.range="nearest")):r===!0&&(n.position??(n.position={type:"node"}),n.range??(n.range="nearest")),n}),e}function ERe(e){return e=to("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=to("chartOptions.pie.series.labelName","sectorLabelName",e),e=BX(e),e=LX(e),e=js("chartOptions.*.series.flipXY",e),e=HX("chartOptions.common.legend.enabled",!0,e),e=c5("chartOptions.common.legend.position","right",e),e}function PRe(e){const t={"ag-pastel":"ag-sheets","ag-solar":"ag-polychroma"},r=to("chartOptions.column","bar",e),s=t[r.chartThemeName]||r.chartThemeName;return{...r,chartThemeName:s}}function FRe(e){return e=id("chartOptions.*.autoSize",!0,e,(t,r)=>{t[r]===!0||t[r]===!1&&(t.minHeight=600,t.minWidth=300),delete t[r]}),e}function RRe(e){return e=js("chartOptions.*.axes.category.label.format",e),e=js("chartOptions.*.axes.category.crosshair.label.format",e),e=js("chartOptions.*.axes.angle-category.label.format",e),e=js("chartOptions.*.axes.radius-category.label.format",e),e=to("chartOptions.*.axes.*.label.padding","spacing",e),e=to("chartOptions.*.navigator.miniChart.label.padding","spacing",e),e=js("chartOptions.*.axes.*.crossLines.label.className",e),e=id("chartOptions.*.axes.*.crossLines.label.position",!0,e,(t,r)=>{typeof t[r]=="string"&&(t[r]=t[r].replace(/([A-Z])/,"-$1").toLowerCase())}),e=js("chartOptions.bullet",e),e=RG("chartOptions.bar.series.label.placement",e,{inside:"inside-center",outside:"inside-end"}),e=RG("chartOptions.waterfall.series.item.*.label.placement",e,{inside:"inside-center",start:"outside-start",end:"outside-end"}),e=js("chartOptions.*.navigator.min",e),e=js("chartOptions.*.navigator.max",e),e=js("chartOptions.*.zoom.ratioX",e),e=js("chartOptions.*.zoom.ratioY",e),e=js("chartOptions.*.zoom.rangeX",e),e=js("chartOptions.*.zoom.rangeY",e),e}function TRe(e){return e=js("chartOptions.*.width",e),e=js("chartOptions.*.height",e),e=c5("chartOptions.*.axes.category.label.autoRotate",!0,e),e}function DRe(e){var c,u;const t=e;if(e.version!=null)return e.version;const r=(d,...g)=>Object.keys(d||{}).some(A=>g.includes(A)),s=t.chartOptions,n=r(s,"seriesDefaults")?s==null?void 0:s.seriesDefaults:s==null?void 0:s[Object.keys(s)[0]],i={"27.0.0":r(t,"seriesChartTypes"),"26.2.0":!r(s,"seriesDefaults"),"26.1.0":r(n==null?void 0:n.highlightStyle,"item"),"26.0.0":r(n==null?void 0:n.highlightStyle,"series"),"25.1.0":r(n==null?void 0:n.label,"minAngle"),"25.0.0":r(t,"modelType","aggFunc","unlinkChart","suppressChartRanges")||r(n,"lineDash","lineDashOffset"),"24.0.0":r(t,"chartThemeName","chart")||r(s,"series"),"23.2.0":r(s,"navigator"),"23.0.0":r((u=(c=s==null?void 0:s.legend)==null?void 0:c.item)==null?void 0:u.marker,"shape"),"22.1.0":r(t,"chartPalette","chartType")},o="27.1.0",a=Object.entries(i).filter(([d,g])=>g),[l=o]=a[0];return l}function Ro(e,t,r){if(PG(e)>PG(t.version)){const s=r(t);return s.version=e,s}return t}function MRe(e){const t=e.includes("-beta")?e.replace(/-beta.*/,""):e,r=typeof t=="string"?t.split(".").map(s=>Number(s)):[];if(r.length!==3||r.some(s=>isNaN(s)))throw new Error(Kc(253,{version:t}));return{major:r[0],minor:r[1],patch:r[2]}}function PG(e){const{major:t,minor:r,patch:s}=MRe(e);return t*1e4+r*100+s}function FG(e,t,r){return id(e,!0,r,(s,n)=>{s[n]===t&&delete s[n]})}function c5(e,t,r){return id(e,!1,r,(s,n)=>{s[n]==null&&(s[n]=t)})}function HX(e,t,r){typeof e=="string"&&(e=e.split("."));const s=e[0];return e.length>1&&(r[s]=HX(e.slice(1),t,r[s]??{})),Object.keys(r).includes(s)||(r[s]=t),r}function w2(e,t,r){let s,n=!1;return r=id(e,!0,r,(i,o)=>{n=!0,s=i[o],delete i[o]}),n?id(t,!1,r,(i,o)=>{i[o]=s}):r}function Mb(e,t,r){let s,n=!1;return r=id(e,!0,r,(i,o)=>{n=!0,s=i[o],delete i[o]}),n?id(t,!1,r,(i,o)=>{i[o]===void 0&&(i[o]=s)}):r}function to(e,t,r){return id(e,!0,r,(s,n)=>{s[t]=s[n],delete s[n]})}function js(e,t){return id(e,!0,t,(r,s)=>delete r[s])}function id(e,t,r,s){const n=e instanceof Array?e:e.split("."),i=n.slice(0,n.length-1),o=n[n.length-1];return sg(i,r,a=>{const l=Object.keys(a).includes(o);if(t&&!l)return a;const c={...a};return s(c,o),c})}function sg(e,t,r){const s=e instanceof Array?e:e.split(".");if(t={...t},s.length===0)return r(t);if(s[0].startsWith("{")){const n=s[0].substring(1,s[0].lastIndexOf("}")).split(",");for(const i of n)t[i]!=null&&(t[i]=sg(s.slice(1),t[i],r))}else if(s[0].endsWith("[]")){const n=s[0].substring(0,e[0].indexOf("["));t[n]instanceof Array&&(t[n]=t[n].map(i=>sg(s.slice(1),i,r)))}else if(s[0]==="*")for(const n of Object.keys(t))t[n]=sg(s.slice(1),t[n],r);else t[s[0]]!=null&&(t[s[0]]=sg(s.slice(1),t[s[0]],r));return t}function RG(e,t,r){return id(e,!0,t,(s,n)=>{typeof s[n]=="string"&&(s[n]=r[n]??n)})}var TG=(e,t)=>({...e,...t}),IRe=class extends ve{constructor(){super(...arguments),this.beanName="chartSvc",this.activeCharts=new Set,this.activeChartComps=new Set,this.crossFilteringContext={lastSelectedChartId:""},this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(e){this.visibleCols=e.visibleCols,this.rangeSvc=e.rangeSvc,this.agChartsExports=e.agChartsExports}updateChart(e){if(this.activeChartComps.size===0){Ce(124);return}const t=[...this.activeChartComps].find(r=>r.getChartId()===e.chartId);if(!t){Ce(125,{chartId:e.chartId});return}t.update(e)}getChartModels(){const e=[],t=r=>({...r,version:Rr});return this.activeChartComps.forEach(r=>e.push(t(r.getChartModel()))),e}getChartRef(e){let t;return this.activeCharts.forEach(r=>{r.chartId===e&&(t=r)}),t}getChartComp(e){let t;return this.activeChartComps.forEach(r=>{r.getChartId()===e&&(t=r)}),t}getChartImageDataURL(e){let t;return this.activeChartComps.forEach(r=>{r.getChartId()===e.chartId&&(t=r.getChartImageDataURL(e.fileFormat))}),t}downloadChart(e){const t=Array.from(this.activeChartComps).find(r=>r.getChartId()===e.chartId);t==null||t.downloadChart(e.dimensions,e.fileName,e.fileFormat)}openChartToolPanel(e){const t=Array.from(this.activeChartComps).find(r=>r.getChartId()===e.chartId);t==null||t.openChartToolPanel(e.panel)}closeChartToolPanel(e){const t=Array.from(this.activeChartComps).find(r=>r.getChartId()===e);t==null||t.closeChartToolPanel()}createChartFromCurrentRange(e="groupedColumn",t){const r=this.getSelectedRange();return this.createChart({cellRange:r,chartType:e,focusDialogOnOpen:!t})}restoreChart(e,t){if(!e){Ce(126);return}e.version!==Rr&&(e=fRe(e));let r,s,n,i;if(e.modelType==="pivot"?(this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"}),r=this.createCellRange(void 0,!0),s=!0,n=!0):(r=this.createCellRange(e.cellRange),i=e.chartPalette,n=e.suppressChartRanges),!!r)return this.createChart({...e,cellRange:r,pivotChart:s,suppressChartRanges:n,chartContainer:t,chartOptionsToRestore:e.chartOptions,chartPaletteToRestore:i})}createRangeChart(e,t){const r=this.createCellRange(e.cellRange);if(r)return this.createChart({...e,cellRange:r,focusDialogOnOpen:!t})}createPivotChart(e,t){this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"});const r=this.createCellRange(void 0,!0);if(r)return this.createChart({...e,cellRange:r,pivotChart:!0,suppressChartRanges:!0,focusDialogOnOpen:!t})}createCrossFilterChart(e,t){const r=this.createCellRange(e.cellRange);if(!r)return;const n=typeof e.suppressChartRanges<"u"&&e.suppressChartRanges!==null?e.suppressChartRanges:!0;return this.createChart({...e,cellRange:r,suppressChartRanges:n,crossFiltering:!0,focusDialogOnOpen:!t})}createChart(e){const t=eFe(e,this.agChartsExports.isEnterprise);if(!t)return;e=t===!0?e:t;const{chartType:r,chartContainer:s}=e,n=this.gos.getCallback("createChartContainer"),i={...e,chartId:this.generateId(),chartType:SS(r),insideDialog:!(s||n),crossFilteringContext:this.crossFilteringContext,crossFilteringResetCallback:()=>this.activeChartComps.forEach(l=>l.crossFilteringReset())},o=new gRe(i);this.createBean(o);const a=this.createChartRef(o);return s?s.appendChild(a.chartElement):n?n(a):o.addEventListener("destroyed",()=>{this.activeChartComps.delete(o),this.activeCharts.delete(a)}),a}createChartRef(e){const t={destroyChart:()=>{this.activeCharts.has(t)&&(this.destroyBean(e),this.activeChartComps.delete(e),this.activeCharts.delete(t))},focusChart:()=>{wi(e.getGui())},chartElement:e.getGui(),chart:e.getUnderlyingChart(),chartId:e.getChartModel().chartId};return this.activeCharts.add(t),this.activeChartComps.add(e),t}getSelectedRange(){var t;const e=((t=this.rangeSvc)==null?void 0:t.getCellRanges())??[];return e.length>0?e[0]:{columns:[]}}generateId(){return`id-${Math.random().toString(36).substring(2,18)}`}createCellRange(e,t){var n;const r=t?{rowStartIndex:null,rowStartPinned:void 0,rowEndIndex:null,rowEndPinned:void 0,columns:this.visibleCols.allCols.map(i=>i.getColId())}:e,s=r&&((n=this.rangeSvc)==null?void 0:n.createPartialCellRangeFromRangeParams(r,!0));return s||Ce(127,{allRange:t}),s}destroy(){this.activeCharts.forEach(e=>e.destroyChart()),super.destroy()}};function kRe(e){return e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=e.chartSvc)==null?void 0:t.getChartModels()})}function BRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.getChartRef(t)})}function LRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.getChartImageDataURL(t)})}function HRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.downloadChart(t)})}function GRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.openChartToolPanel(t)})}function ORe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.closeChartToolPanel(t.chartId)})}function NRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.createRangeChart(t,!0)})}function _Re(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.createPivotChart(t,!0)})}function VRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.createCrossFilterChart(t,!0)})}function zRe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var r;return(r=e.chartSvc)==null?void 0:r.updateChart(t)})}function QRe(e,t,r){return e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=e.chartSvc)==null?void 0:s.restoreChart(t,r)})}var URe=`.ag-chart{display:flex;height:100%;position:relative;width:100%}.ag-chart-components-wrapper{display:flex}.ag-chart-canvas-wrapper,.ag-chart-components-wrapper{flex:1 1 auto;position:relative}.ag-chart-menu{background:var(--ag-background-color);background-color:color-mix(in srgb,transparent,var(--ag-background-color) 30%);border-radius:var(--ag-border-radius);display:flex;flex-direction:row;gap:20px;padding:4px 2px;position:absolute;top:8px;width:auto;--ag-icon-size:20px}:where(.ag-ltr) .ag-chart-menu{justify-content:right;right:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}:where(.ag-rtl) .ag-chart-menu{justify-content:left;left:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}:where(.ag-chart) .ag-chart-menu{display:none}:where(.ag-chart-menu-hidden:hover) .ag-chart-menu{display:block}.ag-chart-docked-container{min-width:var(--ag-chart-menu-panel-width);position:relative}:where(.ag-chart-menu-hidden)~.ag-chart-docked-container{display:none}.ag-chart-tabbed-menu{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.ag-chart-tabbed-menu-header{cursor:default;flex:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-tabbed-menu-body{align-items:stretch;display:flex;flex:1 1 auto;overflow:hidden;position:relative;&:after{background:linear-gradient(var(--ag-background-color),transparent);content:"";display:block;height:16px;left:0;position:absolute;right:0;top:0}}.ag-chart-tab{overflow:hidden;overflow-y:auto;width:100%}.ag-chart-settings{overflow-x:hidden}.ag-chart-settings-wrapper{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}.ag-chart-settings-nav-bar{align-items:center;border-top:1px solid var(--ag-border-color);display:flex;height:30px;padding:0 10px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-chart-settings-card-selector{align-items:center;display:flex;flex:1 1 auto;height:100%;justify-content:space-around;padding:0 10px}.ag-chart-settings-card-item{background-color:var(--ag-foreground-color);border-radius:4px;cursor:pointer;height:8px;position:relative;width:8px;&.ag-not-selected{opacity:.2}&:before{background-color:transparent;content:" ";display:block;height:20px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:50%;width:20px}&.ag-selected{background-color:var(--ag-accent-color)}}.ag-chart-settings-next,.ag-chart-settings-prev{flex:none;position:relative;&:focus-within{border-radius:1px;box-shadow:var(--ag-focus-shadow)}}.ag-chart-settings-next-button,.ag-chart-settings-prev-button{cursor:pointer;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.ag-chart-settings-mini-charts-container{flex:1 1 auto;overflow:hidden auto;position:relative}.ag-chart-settings-mini-wrapper{display:flex;flex-direction:column;left:0;min-height:100%;overflow:hidden;padding-bottom:var(--ag-widget-container-vertical-padding);position:absolute;top:0;width:100%;&.ag-animating{transition:left .3s;transition-timing-function:ease-in-out}}.ag-chart-mini-thumbnail{border:1px solid var(--ag-border-color);border-radius:5px;cursor:pointer;&.ag-selected{border-color:var(--ag-accent-color);border-width:2px}&:focus-visible{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}}.ag-chart-mini-thumbnail-canvas{display:block}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper,.ag-chart-format-wrapper{display:flex;flex-direction:column;padding-bottom:16px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper{height:100%;overflow-y:auto}.ag-chart-advanced-settings{background-color:var(--ag-chrome-background-color)}.ag-chart-advanced-settings,.ag-chart-advanced-settings-wrapper{width:100%}.ag-chart-advanced-settings-wrapper{padding-bottom:0}.ag-chart-advanced-settings-section{border-bottom:1px solid var(--ag-border-color);display:flex;margin:0;padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding)}.ag-chart-empty-text{align-items:center;background-color:var(--ag-background-color);display:flex;height:100%;justify-content:center;top:0;width:100%}.ag-charts-font-size-color{align-self:stretch;display:flex;justify-content:space-between}.ag-charts-data-group-item{padding-bottom:var(--ag-widget-container-vertical-padding);position:relative}.ag-charts-data-group-item:where(:not(:last-child)){margin-bottom:var(--ag-spacing)}.ag-chart-menu-icon{border-radius:var(--ag-border-radius);cursor:pointer;margin:2px 0;opacity:.8;&:hover{opacity:1}}.ag-chart-menu-toolbar-button{background-color:unset;border:0;border-radius:1px;padding:0 2px}.ag-chart-data-column-drag-handle{margin-left:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-title-bar{background-color:unset;position:relative}.ag-charts-data-group-container{padding:calc(var(--ag-widget-container-vertical-padding)*.5) var(--ag-widget-container-horizontal-padding)}.ag-charts-data-group-item:where(:not(.ag-charts-format-sub-level-group,.ag-pill-select,.ag-select)){height:var(--ag-list-item-height)}.ag-charts-data-group-item:where(.ag-picker-field){margin-top:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-container,.ag-charts-format-top-level-group-container{margin-left:calc(var(--ag-spacing)*2);padding:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-item,.ag-charts-format-top-level-group-item{margin:var(--ag-spacing) 0}.ag-charts-format-sub-level-group-container{display:flex;flex-direction:column;padding:var(--ag-widget-vertical-spacing) 0}.ag-charts-settings-group-container{display:grid;grid-template-columns:60px 1fr 60px 1fr 60px;padding:var(--ag-spacing);row-gap:8px;:where(.ag-chart-mini-thumbnail:nth-child(3n+1)){grid-column:1}:where(.ag-chart-mini-thumbnail:nth-child(3n+2)){grid-column:3}:where(.ag-chart-mini-thumbnail:nth-child(3n+3)){grid-column:5}}.ag-chart-data-section,.ag-chart-format-section{display:flex;margin:0;:where(.ag-label:not(.ag-group-title-bar)){color:var(--ag-chart-menu-label-color)}:where(.ag-label-align-top .ag-label){margin-bottom:var(--ag-widget-vertical-spacing);margin-top:calc(var(--ag-widget-vertical-spacing)*.5)}:where(.ag-slider.ag-label-align-top .ag-label){margin-bottom:0}:where(label){display:inline-block}}.ag-chart-menu-panel{--ag-panel-background-color:var(--ag-chrome-background-color)}:where(.ag-ltr) .ag-chart-menu-panel{border-left:1px solid var(--ag-border-color)}:where(.ag-rtl) .ag-chart-menu-panel{border-right:1px solid var(--ag-border-color)}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-container,.ag-charts-settings-group-title-bar{border-top:none;font-weight:500;padding:0 calc(var(--ag-spacing)*1.5)}.ag-charts-format-sub-level-group-title-bar{background:none;font-weight:500;padding:var(--ag-widget-vertical-spacing) 0}.ag-chart-data-wrapper,.ag-chart-format-wrapper,.ag-charts-data-group-container,.ag-charts-data-group-title-bar,.ag-charts-format-sub-level-group,.ag-charts-format-sub-level-group-container>*,.ag-charts-format-sub-level-group-item:last-child,.ag-charts-format-top-level-group,.ag-charts-format-top-level-group-item,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-container,.ag-charts-settings-group-title-bar,:where(.ag-charts-format-top-level-group) .ag-charts-format-top-level-group-container{margin:0;padding:0}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-title-bar{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:relative}.ag-charts-data-group,.ag-charts-format-top-level-group{border-top:1px solid var(--ag-border-color)}:where(.ag-charts-data-group) .ag-charts-data-group-container,:where(.ag-charts-format-top-level-group) .ag-charts-format-top-level-group-container,:where(.ag-charts-settings-group) .ag-charts-settings-group-container{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-format-sub-level-group-container>*,.ag-charts-format-sub-level-no-header-group-container>*,.ag-charts-format-top-level-group-container>*{margin-bottom:var(--ag-widget-vertical-spacing)}.ag-charts-advanced-settings-top-level-group-container{margin:0}:where(.ag-charts-advanced-settings-top-level-group){.ag-charts-advanced-settings-top-level-group-container,.ag-charts-advanced-settings-top-level-group-title-bar{padding:0 var(--ag-widget-container-horizontal-padding)}}.ag-charts-advanced-settings-top-level-group-item{margin-bottom:0;margin-top:calc(var(--ag-widget-vertical-spacing)*2)}.ag-chart-settings-card-item.ag-not-selected:hover{opacity:.35}.ag-angle-select{align-items:center;display:flex}.ag-angle-select-wrapper{display:flex}.ag-angle-select-parent-circle{background-color:var(--ag-background-color);border:1px solid;border-color:var(--ag-border-color);border-radius:12px;display:block;height:24px;position:relative;width:24px}.ag-angle-select-child-circle{background-color:var(--ag-foreground-color);border-radius:3px;height:6px;left:12px;margin-left:-3px;margin-top:-4px;position:absolute;top:4px;width:6px}.ag-slider-wrapper{display:flex;:where(.ag-input-field){flex:1 1 auto}}.ag-color-panel{display:flex;flex-direction:column;padding:var(--ag-spacing);text-align:center;width:100%}.ag-spectrum-color{cursor:default;flex:1 1 auto;overflow:visible;position:relative}.ag-spectrum-fill{inset:0;position:absolute}.ag-spectrum-val{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0));cursor:pointer}.ag-spectrum-dragger{background:#000;border:3px solid #fff;border-radius:18px;box-shadow:0 0 2px 0 rgba(0,0,0,.24);cursor:pointer;height:18px;pointer-events:none;position:absolute;width:18px}.ag-spectrum-alpha,.ag-spectrum-hue{cursor:default}.ag-spectrum-hue-background{background:linear-gradient(270deg,red 3%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);height:100%;width:100%}.ag-spectrum-alpha-background{background:linear-gradient(to right,var(--ag-internal-spectrum-alpha-color-from),var(--ag-internal-spectrum-alpha-color-to)),url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>') 0 0 /4px 4px;height:100%;width:100%}.ag-spectrum-tool{border-radius:2px;cursor:pointer;height:11px;margin-bottom:10px;position:relative}.ag-spectrum-slider{border:2px solid #fff;border-radius:13px;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:13px;margin-top:-12px;pointer-events:none;position:absolute;width:13px}:where(.ag-spectrum-alpha) .ag-spectrum-slider{background:linear-gradient(to bottom,var(--ag-internal-spectrum-alpha-color),var(--ag-internal-spectrum-alpha-color)) var(--ag-background-color)}.ag-recent-colors{display:flex;gap:6px;margin-bottom:2px;margin-left:var(--ag-spacing);margin-right:var(--ag-spacing)}.ag-recent-color{border:1px solid var(--ag-border-color);cursor:pointer}.ag-angle-select[disabled]{opacity:.5;pointer-events:none}:where(.ag-ltr) .ag-angle-select-field,:where(.ag-ltr) .ag-slider-field{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-angle-select-field,:where(.ag-rtl) .ag-slider-field{margin-left:calc(var(--ag-spacing)*2)}.ag-color-dialog{border-radius:5px}:where(.ag-color-picker){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}.ag-picker-field-display{align-items:center;display:flex;flex-direction:row;min-height:var(--ag-list-item-height)}}:where(.ag-ltr) .ag-color-picker-color,:where(.ag-ltr) .ag-color-picker-value{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-color-picker-color,:where(.ag-rtl) .ag-color-picker-value{margin-left:var(--ag-spacing)}.ag-spectrum-tools{padding-bottom:0;padding-left:0;padding-right:0}.ag-spectrum-alpha-background,.ag-spectrum-hue-background{border-radius:2px}.ag-color-input-color,.ag-color-picker-color,.ag-recent-color{border-radius:4px}.ag-spectrum-sat{background-image:linear-gradient(90deg,#fff,hsla(20,42%,65%,0))}.ag-recent-color,.ag-spectrum-color,.ag-spectrum-slider{&:where(:not(:disabled,[readonly])):focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-color-input-color,.ag-color-picker-color{border:1px solid var(--ag-border-color);border-radius:2px;height:var(--ag-icon-size);width:var(--ag-icon-size)}:where(.ag-color-input){.ag-color-input-color{position:absolute}}:where(.ag-ltr) :where(.ag-color-input){.ag-input-field-input{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}.ag-color-input-color{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-color-input){.ag-input-field-input{padding-right:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}.ag-color-input-color{margin-right:var(--ag-spacing)}}.ag-range-field{align-items:center;display:flex;:where(.ag-input-wrapper){height:100%}}.ag-range-field-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;height:100%;overflow:visible;padding:0;width:100%;&:disabled{opacity:.5}}.ag-range-field-input{&::-webkit-slider-runnable-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--ag-background-color);border:1px solid var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-webkit-slider-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-webkit-slider-runnable-track{background-color:var(--ag-accent-color)}}.ag-range-field-input{&::-moz-range-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-moz-ag-range-thumb{-moz-appearance:none;appearance:none;background-color:var(--ag-background-color);border:1px solid var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-moz-ag-range-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-moz-ag-range-track{background-color:var(--ag-accent-color)}}`,GX=28,OX=6;function Qk(e){return e&&e.match(/\d+\.\d+\.\d+/)}function WRe({gridMajorVersion:e,chartsMajorVersion:t}){const r=parseInt(e,10),s=parseInt(t,10),n=r-GX,i=s-OX,o=n>=0;return n===i&&o}function jRe(e){if(!e||!Qk(e))return;const[t,r]=e.split(".")||[],s=`${t}.${r}.x`,i=parseInt(t,10)-GX+OX;if(i<0)return;const a=`${i}.${r}.x`;return{gridMajorMinor:s,chartsMajorMinor:a}}function eP({type:e,gridVersion:t,chartsVersion:r}){const s="AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.";if(!t)return s;const n=jRe(t);if(!n)return s;const{gridMajorMinor:i,chartsMajorMinor:o}=n;return e==="incompatible"?`AG Grid version ${t} and AG Charts version ${r} is not supported. AG Grid version ${i} should be used with AG Chart ${o}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:e==="invalidCharts"?`AG Grid version ${i} should be used with AG Chart ${o} not ${r}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:s}function KRe({gridVersion:e,chartsVersion:t}){if(!Qk(t))return{isValid:!1,message:eP({type:"invalidCharts",gridVersion:e,chartsVersion:t})};if(!Qk(e))return{isValid:!1,message:eP({type:"invalidGrid",gridVersion:e,chartsVersion:t})};const[r,s]=e.split(".")||[],[n,i,o]=t.split(".")||[],a=WRe({gridMajorVersion:r,chartsMajorVersion:n});return a&&s===i||o.includes("beta")?{isValid:!0}:!a||s!==i?{isValid:!1,message:eP({type:"incompatible",gridVersion:e,chartsVersion:t})}:{isValid:!1,message:eP({type:"invalid",gridVersion:e,chartsVersion:t})}}var YRe={linked:"linked",unlinked:"unlinked",chartsMenu:"menu-alt",chartsDownload:"save",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",chartsColorPicker:"small-down",chartsThemePrevious:"previous",chartsThemeNext:"next"},ZRe={getChartModels:kRe,getChartRef:BRe,getChartImageDataURL:LRe,downloadChart:HRe,openChartToolPanel:GRe,closeChartToolPanel:ORe,createRangeChart:NRe,createPivotChart:_Re,createCrossFilterChart:VRe,updateChart:zRe,restoreChart:QRe},DG=[SZ,Qs,jw,Eg,AT],MG="IntegratedCharts",XRe={moduleName:MG,version:Rr,dependsOn:DG,validate:()=>({isValid:!1,message:ZW(257)}),with:e=>{var t;if(e.setup(),(t=e.setGridContext)==null||t.call(e,!0),e.isEnterprise&&e.setLicenseKey){const r={setLicenseKey:e.setLicenseKey};p1.setChartsLicenseManager(r)}return{moduleName:MG,version:Rr,icons:YRe,apiFunctions:ZRe,dependsOn:DG,css:[URe],validate:()=>KRe({gridVersion:Rr,chartsVersion:e.VERSION}),beans:[NPe.bind(null,e),IRe,U2e,_2e,O2e,z2e,x2e,H2e]}}},IG=[F0e,W3e,_Se,Vxe,J3e,lEe,oxe,axe,SZ,lxe,vZ,k3e,B3e,kPe,BPe,wxe,Kxe,Q1e,NL,Lxe,H3e,jEe,iPe],kG="AllEnterprise",$Re={with:e=>({moduleName:kG,version:Rr,dependsOn:[...IG,XRe.with(e),OPe.with(e)]}),moduleName:kG,version:Rr,dependsOn:IG},y2={},JRe=Object.defineProperty,NX=e=>{throw TypeError(e)},qRe=(e,t,r)=>t in e?JRe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bs=(e,t,r)=>qRe(e,typeof t!="symbol"?t+"":t,r),u5=(e,t,r)=>t.has(e)||NX("Cannot "+r),de=(e,t,r)=>(u5(e,t,"read from private field"),r?r.call(e):t.get(e)),As=(e,t,r)=>t.has(e)?NX("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),hr=(e,t,r,s)=>(u5(e,t,"write to private field"),t.set(e,r),r),Wt=(e,t,r)=>(u5(e,t,"access private method"),r),Uk=(e,t,r,s)=>({set _(n){hr(e,t,n)},get _(){return de(e,t,s)}});function eTe(e,t){if(e==null)throw Error(t);return e}const SF=Array.isArray;function BG(e){return e!==null&&typeof e=="object"}function xS(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null}function LG(e){return Object.values(e).reduce((t,r)=>r!==void 0?t+1:t,0)}function Lc(e,t){if(!(BG(e)&&BG(t)))return e===t;if(SF(e)&&SF(t))return e.length!==t.length?!1:[...e.keys()].every(r=>Lc(e[r],t[r]));if(xS(e)&&xS(t))return LG(e)!==LG(t)?!1:Object.keys(e).every(r=>Lc(e[r],t[r]));throw Error(`Cannot compare a ${String(e)} and b ${String(t)}`)}function Th(e){if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=Th(e[r]);return t}else if(xS(e)){const t={};return Object.keys(e).forEach(r=>{t[r]=Th(e[r])}),t}else return e}function _X(e,t){return new Set([...Object.keys(e),...Object.keys(t)]).forEach(r=>{const s=e[r],n=t[r];xS(s)&&xS(n)||SF(s)&&SF(n)&&s.length===n.length?_X(s,n):e[r]=n}),e}var Ib=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tTe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ms;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{const i={};for(const o of n)i[o]=o;return i},e.getValidEnumValues=n=>{const i=e.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(const a of i)o[a]=n[a];return e.objectValues(o)},e.objectValues=n=>e.objectKeys(n).map(function(i){return n[i]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(o);return i},e.find=(n,i)=>{for(const o of n)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,i=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=s,e.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(ms||(ms={}));var Wk;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Wk||(Wk={}));const Ht=ms.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yf=e=>{switch(typeof e){case"undefined":return Ht.undefined;case"string":return Ht.string;case"number":return isNaN(e)?Ht.nan:Ht.number;case"boolean":return Ht.boolean;case"function":return Ht.function;case"bigint":return Ht.bigint;case"symbol":return Ht.symbol;case"object":return Array.isArray(e)?Ht.array:e===null?Ht.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ht.promise:typeof Map<"u"&&e instanceof Map?Ht.map:typeof Set<"u"&&e instanceof Set?Ht.set:typeof Date<"u"&&e instanceof Date?Ht.date:Ht.object;default:return Ht.unknown}},ft=ms.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),rTe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ul extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(i){return i.message},s={_errors:[]},n=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(r(o));else{let a=s,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return n(this),s}static assert(t){if(!(t instanceof Ul))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ms.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},s=[];for(const n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):s.push(t(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}Ul.create=e=>new Ul(e);const xw=(e,t)=>{let r;switch(e.code){case ft.invalid_type:e.received===Ht.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ft.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ms.jsonStringifyReplacer)}`;break;case ft.unrecognized_keys:r=`Unrecognized key(s) in object: ${ms.joinValues(e.keys,", ")}`;break;case ft.invalid_union:r="Invalid input";break;case ft.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ms.joinValues(e.options)}`;break;case ft.invalid_enum_value:r=`Invalid enum value. Expected ${ms.joinValues(e.options)}, received '${e.received}'`;break;case ft.invalid_arguments:r="Invalid function arguments";break;case ft.invalid_return_type:r="Invalid function return type";break;case ft.invalid_date:r="Invalid date";break;case ft.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ms.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ft.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ft.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ft.custom:r="Invalid input";break;case ft.invalid_intersection_types:r="Intersection results could not be merged";break;case ft.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ft.not_finite:r="Number must be finite";break;default:r=t.defaultError,ms.assertNever(e)}return{message:r}};let VX=xw;function sTe(e){VX=e}function xF(){return VX}const EF=e=>{const{data:t,path:r,errorMaps:s,issueData:n}=e,i=[...r,...n.path||[]],o={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let a="";const l=s.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...n,path:i,message:a}},nTe=[];function Mt(e,t){const r=xF(),s=EF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===xw?void 0:xw].filter(n=>!!n)});e.common.issues.push(s)}class Go{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const s=[];for(const n of r){if(n.status==="aborted")return Pr;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,r){const s=[];for(const n of r){const i=await n.key,o=await n.value;s.push({key:i,value:o})}return Go.mergeObjectSync(t,s)}static mergeObjectSync(t,r){const s={};for(const n of r){const{key:i,value:o}=n;if(i.status==="aborted"||o.status==="aborted")return Pr;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[i.value]=o.value)}return{status:t.value,value:s}}}const Pr=Object.freeze({status:"aborted"}),PF=e=>({status:"dirty",value:e}),fa=e=>({status:"valid",value:e}),jk=e=>e.status==="aborted",Kk=e=>e.status==="dirty",ES=e=>e.status==="valid",PS=e=>typeof Promise<"u"&&e instanceof Promise;function FF(e,t,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function zX(e,t,r,s,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var $t;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})($t||($t={}));var f1,A1;class Oh{constructor(t,r,s,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const HG=(e,t)=>{if(ES(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ul(e.common.issues);return this._error=r,this._error}}};function _r(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:s,description:n}=e;if(t&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(i,o)=>{var a,l;const{message:c}=e;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:(a=c??s)!==null&&a!==void 0?a:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:o.defaultError}},description:n}}class Yr{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Yf(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Yf(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Go,ctx:{common:t.parent.common,data:t.data,parsedType:Yf(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(PS(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const s=this.safeParse(t,r);if(s.success)return s.data;throw s.error}safeParse(t,r){var s;const n={common:{issues:[],async:(s=r==null?void 0:r.async)!==null&&s!==void 0?s:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Yf(t)},i=this._parseSync({data:t,path:n.path,parent:n});return HG(n,i)}async parseAsync(t,r){const s=await this.safeParseAsync(t,r);if(s.success)return s.data;throw s.error}async safeParseAsync(t,r){const s={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Yf(t)},n=this._parse({data:t,path:s.path,parent:s}),i=await(PS(n)?n:Promise.resolve(n));return HG(s,i)}refine(t,r){const s=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,i)=>{const o=t(n),a=()=>i.addIssue({code:ft.custom,...s(n)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,r){return this._refinement((s,n)=>t(s)?!0:(n.addIssue(typeof r=="function"?r(s,n):r),!1))}_refinement(t){return new od({schema:this,typeName:mr.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Dh.create(this,this._def)}nullable(){return CA.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $u.create(this,this._def)}promise(){return Pw.create(this,this._def)}or(t){return DS.create([this,t],this._def)}and(t){return MS.create(this,t,this._def)}transform(t){return new od({..._r(this._def),schema:this,typeName:mr.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new HS({..._r(this._def),innerType:this,defaultValue:r,typeName:mr.ZodDefault})}brand(){return new d5({typeName:mr.ZodBranded,type:this,..._r(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new GS({..._r(this._def),innerType:this,catchValue:r,typeName:mr.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Xx.create(this,t)}readonly(){return OS.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const iTe=/^c[^\s-]{8,}$/i,oTe=/^[0-9a-z]+$/,aTe=/^[0-9A-HJKMNP-TV-Z]{26}$/,lTe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cTe=/^[a-z0-9_-]{21}$/i,uTe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dTe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hTe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let o4;const pTe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gTe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,fTe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QX="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ATe=new RegExp(`^${QX}$`);function UX(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function mTe(e){return new RegExp(`^${UX(e)}$`)}function WX(e){let t=`${QX}T${UX(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function vTe(e,t){return!!((t==="v4"||!t)&&pTe.test(e)||(t==="v6"||!t)&&gTe.test(e))}class zu extends Yr{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ht.string){const n=this._getOrReturnCtx(t);return Mt(n,{code:ft.invalid_type,expected:Ht.string,received:n.parsedType}),Pr}const r=new Go;let s;for(const n of this._def.checks)if(n.kind==="min")t.data.length<n.value&&(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="max")t.data.length>n.value&&(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=t.data.length>n.value,o=t.data.length<n.value;(i||o)&&(s=this._getOrReturnCtx(t,s),i?Mt(s,{code:ft.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&Mt(s,{code:ft.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if(n.kind==="email")dTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"email",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="emoji")o4||(o4=new RegExp(hTe,"u")),o4.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"emoji",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="uuid")lTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"uuid",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="nanoid")cTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"nanoid",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid")iTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"cuid",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid2")oTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"cuid2",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="ulid")aTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"ulid",code:ft.invalid_string,message:n.message}),r.dirty());else if(n.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Mt(s,{validation:"url",code:ft.invalid_string,message:n.message}),r.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"regex",code:ft.invalid_string,message:n.message}),r.dirty())):n.kind==="trim"?t.data=t.data.trim():n.kind==="includes"?t.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()):n.kind==="toLowerCase"?t.data=t.data.toLowerCase():n.kind==="toUpperCase"?t.data=t.data.toUpperCase():n.kind==="startsWith"?t.data.startsWith(n.value)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()):n.kind==="endsWith"?t.data.endsWith(n.value)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()):n.kind==="datetime"?WX(n).test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:"datetime",message:n.message}),r.dirty()):n.kind==="date"?ATe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:"date",message:n.message}),r.dirty()):n.kind==="time"?mTe(n).test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.invalid_string,validation:"time",message:n.message}),r.dirty()):n.kind==="duration"?uTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"duration",code:ft.invalid_string,message:n.message}),r.dirty()):n.kind==="ip"?vTe(t.data,n.version)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"ip",code:ft.invalid_string,message:n.message}),r.dirty()):n.kind==="base64"?fTe.test(t.data)||(s=this._getOrReturnCtx(t,s),Mt(s,{validation:"base64",code:ft.invalid_string,message:n.message}),r.dirty()):ms.assertNever(n);return{status:r.value,value:t.data}}_regex(t,r,s){return this.refinement(n=>t.test(n),{validation:r,code:ft.invalid_string,...$t.errToObj(s)})}_addCheck(t){return new zu({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...$t.errToObj(t)})}url(t){return this._addCheck({kind:"url",...$t.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...$t.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...$t.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...$t.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...$t.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...$t.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...$t.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...$t.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...$t.errToObj(t)})}datetime(t){var r,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...$t.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...$t.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...$t.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...$t.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...$t.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...$t.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...$t.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...$t.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...$t.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...$t.errToObj(r)})}nonempty(t){return this.min(1,$t.errToObj(t))}trim(){return new zu({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new zu({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new zu({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}zu.create=e=>{var t;return new zu({checks:[],typeName:mr.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,..._r(e)})};function CTe(e,t){const r=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=r>s?r:s,i=parseInt(e.toFixed(n).replace(".","")),o=parseInt(t.toFixed(n).replace(".",""));return i%o/Math.pow(10,n)}class AA extends Yr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ht.number){const n=this._getOrReturnCtx(t);return Mt(n,{code:ft.invalid_type,expected:Ht.number,received:n.parsedType}),Pr}let r;const s=new Go;for(const n of this._def.checks)n.kind==="int"?ms.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="multipleOf"?CTe(t.data,n.value)!==0&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):n.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.not_finite,message:n.message}),s.dirty()):ms.assertNever(n);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,$t.toString(r))}gt(t,r){return this.setLimit("min",t,!1,$t.toString(r))}lte(t,r){return this.setLimit("max",t,!0,$t.toString(r))}lt(t,r){return this.setLimit("max",t,!1,$t.toString(r))}setLimit(t,r,s,n){return new AA({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:$t.toString(n)}]})}_addCheck(t){return new AA({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:$t.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$t.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$t.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$t.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$t.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:$t.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:$t.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$t.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$t.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ms.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(r)&&Number.isFinite(t)}}AA.create=e=>new AA({checks:[],typeName:mr.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,..._r(e)});class mA extends Yr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Ht.bigint){const n=this._getOrReturnCtx(t);return Mt(n,{code:ft.invalid_type,expected:Ht.bigint,received:n.parsedType}),Pr}let r;const s=new Go;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="multipleOf"?t.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Mt(r,{code:ft.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):ms.assertNever(n);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,$t.toString(r))}gt(t,r){return this.setLimit("min",t,!1,$t.toString(r))}lte(t,r){return this.setLimit("max",t,!0,$t.toString(r))}lt(t,r){return this.setLimit("max",t,!1,$t.toString(r))}setLimit(t,r,s,n){return new mA({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:$t.toString(n)}]})}_addCheck(t){return new mA({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$t.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$t.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$t.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$t.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:$t.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}mA.create=e=>{var t;return new mA({checks:[],typeName:mr.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,..._r(e)})};class FS extends Yr{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ht.boolean){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.boolean,received:r.parsedType}),Pr}return fa(t.data)}}FS.create=e=>new FS({typeName:mr.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,..._r(e)});class Fv extends Yr{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ht.date){const n=this._getOrReturnCtx(t);return Mt(n,{code:ft.invalid_type,expected:Ht.date,received:n.parsedType}),Pr}if(isNaN(t.data.getTime())){const n=this._getOrReturnCtx(t);return Mt(n,{code:ft.invalid_date}),Pr}const r=new Go;let s;for(const n of this._def.checks)n.kind==="min"?t.data.getTime()<n.value&&(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):n.kind==="max"?t.data.getTime()>n.value&&(s=this._getOrReturnCtx(t,s),Mt(s,{code:ft.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):ms.assertNever(n);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Fv({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:$t.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:$t.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}Fv.create=e=>new Fv({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:mr.ZodDate,..._r(e)});class RF extends Yr{_parse(t){if(this._getType(t)!==Ht.symbol){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.symbol,received:r.parsedType}),Pr}return fa(t.data)}}RF.create=e=>new RF({typeName:mr.ZodSymbol,..._r(e)});class RS extends Yr{_parse(t){if(this._getType(t)!==Ht.undefined){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.undefined,received:r.parsedType}),Pr}return fa(t.data)}}RS.create=e=>new RS({typeName:mr.ZodUndefined,..._r(e)});class TS extends Yr{_parse(t){if(this._getType(t)!==Ht.null){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.null,received:r.parsedType}),Pr}return fa(t.data)}}TS.create=e=>new TS({typeName:mr.ZodNull,..._r(e)});class Ew extends Yr{constructor(){super(...arguments),this._any=!0}_parse(t){return fa(t.data)}}Ew.create=e=>new Ew({typeName:mr.ZodAny,..._r(e)});class lv extends Yr{constructor(){super(...arguments),this._unknown=!0}_parse(t){return fa(t.data)}}lv.create=e=>new lv({typeName:mr.ZodUnknown,..._r(e)});class Ag extends Yr{_parse(t){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.never,received:r.parsedType}),Pr}}Ag.create=e=>new Ag({typeName:mr.ZodNever,..._r(e)});class TF extends Yr{_parse(t){if(this._getType(t)!==Ht.undefined){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.void,received:r.parsedType}),Pr}return fa(t.data)}}TF.create=e=>new TF({typeName:mr.ZodVoid,..._r(e)});class $u extends Yr{_parse(t){const{ctx:r,status:s}=this._processInputParams(t),n=this._def;if(r.parsedType!==Ht.array)return Mt(r,{code:ft.invalid_type,expected:Ht.array,received:r.parsedType}),Pr;if(n.exactLength!==null){const o=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(o||a)&&(Mt(r,{code:o?ft.too_big:ft.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(Mt(r,{code:ft.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(Mt(r,{code:ft.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>n.type._parseAsync(new Oh(r,o,r.path,a)))).then(o=>Go.mergeArray(s,o));const i=[...r.data].map((o,a)=>n.type._parseSync(new Oh(r,o,r.path,a)));return Go.mergeArray(s,i)}get element(){return this._def.type}min(t,r){return new $u({...this._def,minLength:{value:t,message:$t.toString(r)}})}max(t,r){return new $u({...this._def,maxLength:{value:t,message:$t.toString(r)}})}length(t,r){return new $u({...this._def,exactLength:{value:t,message:$t.toString(r)}})}nonempty(t){return this.min(1,t)}}$u.create=(e,t)=>new $u({type:e,minLength:null,maxLength:null,exactLength:null,typeName:mr.ZodArray,..._r(t)});function B0(e){if(e instanceof Fn){const t={};for(const r in e.shape){const s=e.shape[r];t[r]=Dh.create(B0(s))}return new Fn({...e._def,shape:()=>t})}else return e instanceof $u?new $u({...e._def,type:B0(e.element)}):e instanceof Dh?Dh.create(B0(e.unwrap())):e instanceof CA?CA.create(B0(e.unwrap())):e instanceof Nh?Nh.create(e.items.map(t=>B0(t))):e}class Fn extends Yr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=ms.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Ht.object){const l=this._getOrReturnCtx(t);return Mt(l,{code:ft.invalid_type,expected:Ht.object,received:l.parsedType}),Pr}const{status:r,ctx:s}=this._processInputParams(t),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ag&&this._def.unknownKeys==="strip"))for(const l in s.data)i.includes(l)||o.push(l);const a=[];for(const l of i){const c=n[l],u=s.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Oh(s,u,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof Ag){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of o)a.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});else if(l==="strict")o.length>0&&(Mt(s,{code:ft.unrecognized_keys,keys:o}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of o){const u=s.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Oh(s,u,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of a){const u=await c.key,d=await c.value;l.push({key:u,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>Go.mergeObjectSync(r,l)):Go.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(t){return $t.errToObj,new Fn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,s)=>{var n,i,o,a;const l=(o=(i=(n=this._def).errorMap)===null||i===void 0?void 0:i.call(n,r,s).message)!==null&&o!==void 0?o:s.defaultError;return r.code==="unrecognized_keys"?{message:(a=$t.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Fn({...this._def,unknownKeys:"strip"})}passthrough(){return new Fn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Fn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Fn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:mr.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Fn({...this._def,catchall:t})}pick(t){const r={};return ms.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new Fn({...this._def,shape:()=>r})}omit(t){const r={};return ms.objectKeys(this.shape).forEach(s=>{t[s]||(r[s]=this.shape[s])}),new Fn({...this._def,shape:()=>r})}deepPartial(){return B0(this)}partial(t){const r={};return ms.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];t&&!t[s]?r[s]=n:r[s]=n.optional()}),new Fn({...this._def,shape:()=>r})}required(t){const r={};return ms.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])r[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof Dh;)n=n._def.innerType;r[s]=n}}),new Fn({...this._def,shape:()=>r})}keyof(){return jX(ms.objectKeys(this.shape))}}Fn.create=(e,t)=>new Fn({shape:()=>e,unknownKeys:"strip",catchall:Ag.create(),typeName:mr.ZodObject,..._r(t)});Fn.strictCreate=(e,t)=>new Fn({shape:()=>e,unknownKeys:"strict",catchall:Ag.create(),typeName:mr.ZodObject,..._r(t)});Fn.lazycreate=(e,t)=>new Fn({shape:e,unknownKeys:"strip",catchall:Ag.create(),typeName:mr.ZodObject,..._r(t)});class DS extends Yr{_parse(t){const{ctx:r}=this._processInputParams(t),s=this._def.options;function n(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new Ul(a.ctx.common.issues));return Mt(r,{code:ft.invalid_union,unionErrors:o}),Pr}if(r.common.async)return Promise.all(s.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(n);{let i;const o=[];for(const l of s){const c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(l=>new Ul(l));return Mt(r,{code:ft.invalid_union,unionErrors:a}),Pr}}get options(){return this._def.options}}DS.create=(e,t)=>new DS({options:e,typeName:mr.ZodUnion,..._r(t)});const If=e=>e instanceof kS?If(e.schema):e instanceof od?If(e.innerType()):e instanceof BS?[e.value]:e instanceof vA?e.options:e instanceof LS?ms.objectValues(e.enum):e instanceof HS?If(e._def.innerType):e instanceof RS?[void 0]:e instanceof TS?[null]:e instanceof Dh?[void 0,...If(e.unwrap())]:e instanceof CA?[null,...If(e.unwrap())]:e instanceof d5||e instanceof OS?If(e.unwrap()):e instanceof GS?If(e._def.innerType):[];class yT extends Yr{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ht.object)return Mt(r,{code:ft.invalid_type,expected:Ht.object,received:r.parsedType}),Pr;const s=this.discriminator,n=r.data[s],i=this.optionsMap.get(n);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(Mt(r,{code:ft.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Pr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,s){const n=new Map;for(const i of r){const o=If(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(n.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,i)}}return new yT({typeName:mr.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,..._r(s)})}}function Yk(e,t){const r=Yf(e),s=Yf(t);if(e===t)return{valid:!0,data:e};if(r===Ht.object&&s===Ht.object){const n=ms.objectKeys(t),i=ms.objectKeys(e).filter(a=>n.indexOf(a)!==-1),o={...e,...t};for(const a of i){const l=Yk(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===Ht.array&&s===Ht.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let i=0;i<e.length;i++){const o=e[i],a=t[i],l=Yk(o,a);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===Ht.date&&s===Ht.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class MS extends Yr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=(i,o)=>{if(jk(i)||jk(o))return Pr;const a=Yk(i.value,o.value);return a.valid?((Kk(i)||Kk(o))&&r.dirty(),{status:r.value,value:a.data}):(Mt(s,{code:ft.invalid_intersection_types}),Pr)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,o])=>n(i,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}MS.create=(e,t,r)=>new MS({left:e,right:t,typeName:mr.ZodIntersection,..._r(r)});class Nh extends Yr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ht.array)return Mt(s,{code:ft.invalid_type,expected:Ht.array,received:s.parsedType}),Pr;if(s.data.length<this._def.items.length)return Mt(s,{code:ft.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Pr;!this._def.rest&&s.data.length>this._def.items.length&&(Mt(s,{code:ft.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const n=[...s.data].map((i,o)=>{const a=this._def.items[o]||this._def.rest;return a?a._parse(new Oh(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(n).then(i=>Go.mergeArray(r,i)):Go.mergeArray(r,n)}get items(){return this._def.items}rest(t){return new Nh({...this._def,rest:t})}}Nh.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nh({items:e,typeName:mr.ZodTuple,rest:null,..._r(t)})};class IS extends Yr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ht.object)return Mt(s,{code:ft.invalid_type,expected:Ht.object,received:s.parsedType}),Pr;const n=[],i=this._def.keyType,o=this._def.valueType;for(const a in s.data)n.push({key:i._parse(new Oh(s,a,s.path,a)),value:o._parse(new Oh(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?Go.mergeObjectAsync(r,n):Go.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,s){return r instanceof Yr?new IS({keyType:t,valueType:r,typeName:mr.ZodRecord,..._r(s)}):new IS({keyType:zu.create(),valueType:t,typeName:mr.ZodRecord,..._r(r)})}}class DF extends Yr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ht.map)return Mt(s,{code:ft.invalid_type,expected:Ht.map,received:s.parsedType}),Pr;const n=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([a,l],c)=>({key:n._parse(new Oh(s,a,s.path,[c,"key"])),value:i._parse(new Oh(s,l,s.path,[c,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Pr;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(c.value,u.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Pr;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(c.value,u.value)}return{status:r.value,value:a}}}}DF.create=(e,t,r)=>new DF({valueType:t,keyType:e,typeName:mr.ZodMap,..._r(r)});class Rv extends Yr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ht.set)return Mt(s,{code:ft.invalid_type,expected:Ht.set,received:s.parsedType}),Pr;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(Mt(s,{code:ft.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(Mt(s,{code:ft.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Pr;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}const a=[...s.data.values()].map((l,c)=>i._parse(new Oh(s,l,s.path,c)));return s.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,r){return new Rv({...this._def,minSize:{value:t,message:$t.toString(r)}})}max(t,r){return new Rv({...this._def,maxSize:{value:t,message:$t.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Rv.create=(e,t)=>new Rv({valueType:e,minSize:null,maxSize:null,typeName:mr.ZodSet,..._r(t)});class rw extends Yr{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ht.function)return Mt(r,{code:ft.invalid_type,expected:Ht.function,received:r.parsedType}),Pr;function s(a,l){return EF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xF(),xw].filter(c=>!!c),issueData:{code:ft.invalid_arguments,argumentsError:l}})}function n(a,l){return EF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xF(),xw].filter(c=>!!c),issueData:{code:ft.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Pw){const a=this;return fa(async function(...l){const c=new Ul([]),u=await a._def.args.parseAsync(l,i).catch(g=>{throw c.addIssue(s(l,g)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(n(d,g)),c})})}else{const a=this;return fa(function(...l){const c=a._def.args.safeParse(l,i);if(!c.success)throw new Ul([s(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,i);if(!d.success)throw new Ul([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new rw({...this._def,args:Nh.create(t).rest(lv.create())})}returns(t){return new rw({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,s){return new rw({args:t||Nh.create([]).rest(lv.create()),returns:r||lv.create(),typeName:mr.ZodFunction,..._r(s)})}}class kS extends Yr{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}kS.create=(e,t)=>new kS({getter:e,typeName:mr.ZodLazy,..._r(t)});class BS extends Yr{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return Mt(r,{received:r.data,code:ft.invalid_literal,expected:this._def.value}),Pr}return{status:"valid",value:t.data}}get value(){return this._def.value}}BS.create=(e,t)=>new BS({value:e,typeName:mr.ZodLiteral,..._r(t)});function jX(e,t){return new vA({values:e,typeName:mr.ZodEnum,..._r(t)})}class vA extends Yr{constructor(){super(...arguments),f1.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),s=this._def.values;return Mt(r,{expected:ms.joinValues(s),received:r.parsedType,code:ft.invalid_type}),Pr}if(FF(this,f1)||zX(this,f1,new Set(this._def.values)),!FF(this,f1).has(t.data)){const r=this._getOrReturnCtx(t),s=this._def.values;return Mt(r,{received:r.data,code:ft.invalid_enum_value,options:s}),Pr}return fa(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return vA.create(t,{...this._def,...r})}exclude(t,r=this._def){return vA.create(this.options.filter(s=>!t.includes(s)),{...this._def,...r})}}f1=new WeakMap;vA.create=jX;class LS extends Yr{constructor(){super(...arguments),A1.set(this,void 0)}_parse(t){const r=ms.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==Ht.string&&s.parsedType!==Ht.number){const n=ms.objectValues(r);return Mt(s,{expected:ms.joinValues(n),received:s.parsedType,code:ft.invalid_type}),Pr}if(FF(this,A1)||zX(this,A1,new Set(ms.getValidEnumValues(this._def.values))),!FF(this,A1).has(t.data)){const n=ms.objectValues(r);return Mt(s,{received:s.data,code:ft.invalid_enum_value,options:n}),Pr}return fa(t.data)}get enum(){return this._def.values}}A1=new WeakMap;LS.create=(e,t)=>new LS({values:e,typeName:mr.ZodNativeEnum,..._r(t)});class Pw extends Yr{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ht.promise&&r.common.async===!1)return Mt(r,{code:ft.invalid_type,expected:Ht.promise,received:r.parsedType}),Pr;const s=r.parsedType===Ht.promise?r.data:Promise.resolve(r.data);return fa(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Pw.create=(e,t)=>new Pw({type:e,typeName:mr.ZodPromise,..._r(t)});class od extends Yr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===mr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=this._def.effect||null,i={addIssue:o=>{Mt(s,o),o.fatal?r.abort():r.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const o=n.transform(s.data,i);if(s.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return Pr;const l=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return l.status==="aborted"?Pr:l.status==="dirty"||r.value==="dirty"?PF(l.value):l});{if(r.value==="aborted")return Pr;const a=this._def.schema._parseSync({data:o,path:s.path,parent:s});return a.status==="aborted"?Pr:a.status==="dirty"||r.value==="dirty"?PF(a.value):a}}if(n.type==="refinement"){const o=a=>{const l=n.refinement(a,i);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?Pr:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?Pr:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ES(o))return o;const a=n.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>ES(o)?Promise.resolve(n.transform(o.value,i)).then(a=>({status:r.value,value:a})):o);ms.assertNever(n)}}od.create=(e,t,r)=>new od({schema:e,typeName:mr.ZodEffects,effect:t,..._r(r)});od.createWithPreprocess=(e,t,r)=>new od({schema:t,effect:{type:"preprocess",transform:e},typeName:mr.ZodEffects,..._r(r)});class Dh extends Yr{_parse(t){return this._getType(t)===Ht.undefined?fa(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Dh.create=(e,t)=>new Dh({innerType:e,typeName:mr.ZodOptional,..._r(t)});class CA extends Yr{_parse(t){return this._getType(t)===Ht.null?fa(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}CA.create=(e,t)=>new CA({innerType:e,typeName:mr.ZodNullable,..._r(t)});class HS extends Yr{_parse(t){const{ctx:r}=this._processInputParams(t);let s=r.data;return r.parsedType===Ht.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}HS.create=(e,t)=>new HS({innerType:e,typeName:mr.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,..._r(t)});class GS extends Yr{_parse(t){const{ctx:r}=this._processInputParams(t),s={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return PS(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ul(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ul(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}GS.create=(e,t)=>new GS({innerType:e,typeName:mr.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,..._r(t)});class MF extends Yr{_parse(t){if(this._getType(t)!==Ht.nan){const r=this._getOrReturnCtx(t);return Mt(r,{code:ft.invalid_type,expected:Ht.nan,received:r.parsedType}),Pr}return{status:"valid",value:t.data}}}MF.create=e=>new MF({typeName:mr.ZodNaN,..._r(e)});const wTe=Symbol("zod_brand");class d5 extends Yr{_parse(t){const{ctx:r}=this._processInputParams(t),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}}class Xx extends Yr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Pr:n.status==="dirty"?(r.dirty(),PF(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Pr:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,r){return new Xx({in:t,out:r,typeName:mr.ZodPipeline})}}class OS extends Yr{_parse(t){const r=this._def.innerType._parse(t),s=n=>(ES(n)&&(n.value=Object.freeze(n.value)),n);return PS(r)?r.then(n=>s(n)):s(r)}unwrap(){return this._def.innerType}}OS.create=(e,t)=>new OS({innerType:e,typeName:mr.ZodReadonly,..._r(t)});function KX(e,t={},r){return e?Ew.create().superRefine((s,n)=>{var i,o;if(!e(s)){const a=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,l=(o=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...c,fatal:l})}}):Ew.create()}const yTe={object:Fn.lazycreate};var mr;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(mr||(mr={}));const bTe=(e,t={message:`Input not instance of ${e.name}`})=>KX(r=>r instanceof e,t),YX=zu.create,ZX=AA.create,STe=MF.create,xTe=mA.create,XX=FS.create,ETe=Fv.create,PTe=RF.create,FTe=RS.create,RTe=TS.create,TTe=Ew.create,DTe=lv.create,MTe=Ag.create,ITe=TF.create,kTe=$u.create,BTe=Fn.create,LTe=Fn.strictCreate,HTe=DS.create,GTe=yT.create,OTe=MS.create,NTe=Nh.create,_Te=IS.create,VTe=DF.create,zTe=Rv.create,QTe=rw.create,UTe=kS.create,WTe=BS.create,jTe=vA.create,KTe=LS.create,YTe=Pw.create,GG=od.create,ZTe=Dh.create,XTe=CA.create,$Te=od.createWithPreprocess,JTe=Xx.create,qTe=()=>YX().optional(),eDe=()=>ZX().optional(),tDe=()=>XX().optional(),rDe={string:e=>zu.create({...e,coerce:!0}),number:e=>AA.create({...e,coerce:!0}),boolean:e=>FS.create({...e,coerce:!0}),bigint:e=>mA.create({...e,coerce:!0}),date:e=>Fv.create({...e,coerce:!0})},sDe=Pr;var y=Object.freeze({__proto__:null,defaultErrorMap:xw,setErrorMap:sTe,getErrorMap:xF,makeIssue:EF,EMPTY_PATH:nTe,addIssueToContext:Mt,ParseStatus:Go,INVALID:Pr,DIRTY:PF,OK:fa,isAborted:jk,isDirty:Kk,isValid:ES,isAsync:PS,get util(){return ms},get objectUtil(){return Wk},ZodParsedType:Ht,getParsedType:Yf,ZodType:Yr,datetimeRegex:WX,ZodString:zu,ZodNumber:AA,ZodBigInt:mA,ZodBoolean:FS,ZodDate:Fv,ZodSymbol:RF,ZodUndefined:RS,ZodNull:TS,ZodAny:Ew,ZodUnknown:lv,ZodNever:Ag,ZodVoid:TF,ZodArray:$u,ZodObject:Fn,ZodUnion:DS,ZodDiscriminatedUnion:yT,ZodIntersection:MS,ZodTuple:Nh,ZodRecord:IS,ZodMap:DF,ZodSet:Rv,ZodFunction:rw,ZodLazy:kS,ZodLiteral:BS,ZodEnum:vA,ZodNativeEnum:LS,ZodPromise:Pw,ZodEffects:od,ZodTransformer:od,ZodOptional:Dh,ZodNullable:CA,ZodDefault:HS,ZodCatch:GS,ZodNaN:MF,BRAND:wTe,ZodBranded:d5,ZodPipeline:Xx,ZodReadonly:OS,custom:KX,Schema:Yr,ZodSchema:Yr,late:yTe,get ZodFirstPartyTypeKind(){return mr},coerce:rDe,any:TTe,array:kTe,bigint:xTe,boolean:XX,date:ETe,discriminatedUnion:GTe,effect:GG,enum:jTe,function:QTe,instanceof:bTe,intersection:OTe,lazy:UTe,literal:WTe,map:VTe,nan:STe,nativeEnum:KTe,never:MTe,null:RTe,nullable:XTe,number:ZX,object:BTe,oboolean:tDe,onumber:eDe,optional:ZTe,ostring:qTe,pipeline:JTe,preprocess:$Te,promise:YTe,record:_Te,set:zTe,strictObject:LTe,string:YX,symbol:PTe,transformer:GG,tuple:NTe,undefined:FTe,union:HTe,unknown:DTe,void:ITe,NEVER:sDe,ZodIssueCode:ft,quotelessJson:rTe,ZodError:Ul});y.object({__isRef:y.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:y.string().describe("Upstream block id"),name:y.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:y.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();const nDe=24;y.string().length(nDe).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");var OG={exports:{}};(function(e,t){t=e.exports=r,t.getSerialize=s;function r(n,i,o,a){return JSON.stringify(n,s(i,a),o)}function s(n,i){var o=[],a=[];return i==null&&(i=function(l,c){return o[0]===c?"[Circular ~]":"[Circular ~."+a.slice(0,o.indexOf(c)).join(".")+"]"}),function(l,c){if(o.length>0){var u=o.indexOf(this);~u?o.splice(u+1):o.push(this),~u?a.splice(u,1/0,l):a.push(l),~o.indexOf(c)&&(c=i.call(this,l,c))}else o.push(c);return n==null?c:n.call(this,l,c)}}})(OG,OG.exports);const iDe=y.object({type:y.literal("PlError"),name:y.string(),message:y.string(),fullMessage:y.string().optional(),stack:y.string().optional()}),oDe=iDe.extend({cause:y.lazy(()=>IF).optional(),errors:y.lazy(()=>IF.array()).optional()}),aDe=y.object({type:y.literal("StandardError"),name:y.string(),message:y.string(),stack:y.string().optional()}),lDe=aDe.extend({cause:y.lazy(()=>IF).optional(),errors:y.lazy(()=>IF.array()).optional()}),IF=y.union([lDe,oDe]),cDe=y.object({name:y.string(),message:y.string(),fullMessage:y.string().optional(),stack:y.string().optional()}),NG=cDe.extend({cause:y.lazy(()=>NG).optional(),errors:y.lazy(()=>NG.array()).optional()});function uDe(e){if(e&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(e);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const dDe=y.object({type:y.string(),importance:y.number().optional(),id:y.string().optional(),label:y.string()});y.array(dDe);const hDe="1.31.16";function $X(){return uDe({sdkVersion:hDe})}function pDe(e){try{return $X()}catch{return e}}function gDe(e){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(e)}class fDe extends Error{}class JX extends Error{constructor(t){super(t.map(r=>typeof r=="string"?r:r.message).join(`
668
668
  `)),bs(this,"fullMessage"),this.errors=t,this.fullMessage=t.map(r=>typeof r=="string"?r:r.type=="PlError"&&"fullMessage"in r?r.fullMessage:r.message).join(`
669
669
  `)}}function ADe(e){if(!e)throw new fDe;if(!e.ok)throw new JX(e.errors);return e.value}const qX=e=>e,e$=e=>e instanceof Error?e:Error(String(e)),t$=e=>e.name==="ZodError",r$=e=>{const{formErrors:t,fieldErrors:r}=e.flatten(),s=Object.entries(r).map(([n,i])=>n+":"+(i==null?void 0:i.join(",")));return t.concat(s).join("; ")};function _G(e){const t=e.validate??qX,{autoSave:r}=e,s=br(),n=br(),i=w=>{n.value={model:Th(w)}};tn(()=>e.get(),w=>i(w),{immediate:!0});const o=()=>{var w;e.onSave(t(Th((w=n.value)==null?void 0:w.model)))},a=()=>{i(e.get()),s.value=void 0},l=w=>{const v=e$(w);t$(v)?s.value=Error(r$(v)):s.value=v},c=w=>{s.value=void 0;try{t(w),r&&o()}catch(v){l(v)}},u=Je({get:()=>{var w;return(w=n.value)==null?void 0:w.model},set(w){i(w),c(w)}});tn(n,(w,v)=>{w&&w===v&&c(w.model)},{deep:!0});const d=Je(()=>!s.value),g=Je(()=>!Lc(e.get(),Pe(n))),A=Je(()=>s.value?s.value.message:"");return oi({model:u,valid:d,isChanged:g,error:s,errorString:A,save:o,revert:a,setError:l})}function mDe(e,t,r){const s=e.validate??qX,{autoSave:n}=e,i=br(),o=br(),a=b=>{var S;if(r.deepPatchModel){const P=(S=o.value)==null?void 0:S.model,F=Object.assign(Th(b),t??{});o.value={model:P?_X(P,F):F,stage:Symbol()}}else o.value={model:Object.assign(Th(b),t??{}),stage:Symbol()}};tn(()=>e.get(),b=>a(b),{immediate:!0});const l=()=>{var b;e.onSave(s(Th((b=o.value)==null?void 0:b.model)))},c=()=>{a(e.get()),i.value=void 0},u=b=>{const S=e$(b);t$(S)?i.value=Error(r$(S)):i.value=S},d=b=>{i.value=void 0;try{s(b),n&&l()}catch(S){u(S)}},g=Je({get:()=>{var b;return(b=o.value)==null?void 0:b.model},set(){throw Error("Cannot replace base model")}});tn([()=>({args:g.value.args,ui:g.value.ui}),()=>{var b;return(b=o.value)==null?void 0:b.stage}],([b,S],[P,F])=>{S===F&&d(b)},{deep:!0});const A=Je(()=>!i.value),w=Je(()=>{var b;const{args:S,ui:P}=((b=Pe(o))==null?void 0:b.model)??{};return!Lc(e.get(),{args:S,ui:P})}),v=Je(()=>i.value?i.value.message:"");return oi({model:g,valid:A,isChanged:w,error:i,errorString:v,save:l,revert:c,setError:u})}const vDe=e=>Object.fromEntries(new URL(e,"http://dummy").searchParams);function VG(e){return x7()?(iU(e),!0):!1}const zG=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const QG=()=>{};function CDe(e,t){function r(...s){return new Promise((n,i)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(n).catch(i)})}return r}function wDe(e,t={}){let r,s,n=QG;const i=o=>{clearTimeout(o),n(),n=QG};return o=>{const a=N2(e),l=N2(t.maxWait);return r&&i(r),a<=0||l!==void 0&&l<=0?(s&&(i(s),s=null),Promise.resolve(o())):new Promise((c,u)=>{n=t.rejectOnCancel?u:c,l&&!s&&(s=setTimeout(()=>{r&&i(r),s=null,c(o())},l)),r=setTimeout(()=>{s&&i(s),s=null,c(o())},a)})}}function a4(e,t=200,r={}){return CDe(wDe(t,r),e)}function yDe(e,t=1e3,r={}){const{immediate:s=!0,immediateCallback:n=!1}=r;let i=null;const o=br(!1);function a(){i&&(clearInterval(i),i=null)}function l(){o.value=!1,a()}function c(){const u=N2(t);u<=0||(o.value=!0,n&&e(),a(),o.value&&(i=setInterval(e,u)))}if(s&&zG&&c(),Ci(t)||typeof t=="function"){const u=tn(t,()=>{o.value&&zG&&c()});VG(u)}return VG(l),{isActive:o,pause:l,resume:c}}function bDe(e,t,r){const s=(P,...F)=>{r.debug&&console.log(`%c>>> %c${P}`,"color: orange; font-weight: bold","color: orange",...F)},n=oi({args:Object.freeze(e.args),outputs:Object.freeze(e.outputs),ui:Object.freeze(e.ui),navigationState:Object.freeze(e.navigationState)}),i=r.debounceSpan??100,o=r.debounceMaxWait??1e3,a=a4(P=>{Lc(P,n.args)||t.setBlockArgs(P)},i,{maxWait:o}),l=a4(P=>{Lc(P,n.ui)||t.setBlockUiState(P)},i,{maxWait:o}),c=a4((P,F)=>{(!Lc(P,n.args)||!Lc(F,n.ui))&&t.setBlockArgsAndUiState(P,F)},i,{maxWait:o});t.onStateUpdates(async P=>{P.forEach(F=>{F.key==="args"&&!Lc(n.args,F.value)&&(n.args=Object.freeze(F.value),s("args patch",n.args)),F.key==="ui"&&!Lc(n.ui,F.value)&&(n.ui=Object.freeze(F.value),s("ui patch",n.ui)),F.key==="outputs"&&!Lc(n.outputs,F.value)&&(n.outputs=Object.freeze(F.value),s("outputs patch",n.outputs)),F.key==="navigationState"&&!Lc(n.navigationState,F.value)&&(n.navigationState=Object.freeze(F.value),s("navigationState patch",n.navigationState))}),await HR()});const u=()=>Th(n.args),d=()=>Th(n.ui),g=()=>Th(n.navigationState),A={createArgsModel(P={}){return _G({get(){return P.transform?P.transform(n.args):n.args},validate:P.validate,autoSave:!0,onSave(F){a(F)}})},createUiModel(P={},F){return _G({get(){return P.transform?P.transform(n.ui):n.ui??F()},validate:P.validate,autoSave:!0,onSave(T){l(T)}})},useOutputs(...P){const F=oi({errors:void 0,value:void 0});return tn(()=>n.outputs,()=>{try{Object.assign(F,{value:this.unwrapOutputs(...P),errors:void 0})}catch(T){Object.assign(F,{value:void 0,errors:[String(T)]})}},{immediate:!0,deep:!0}),F},unwrapOutputs(...P){const F=n.outputs,T=P.map(D=>[D,ADe(F[D])]);return Object.fromEntries(T)},updateArgs(P){const F=u();return P(F),t.setBlockArgs(F)},updateUiState(P){const F=d();return t.setBlockUiState(P(F))},updateNavigationState(P){const F=g();return P(F),t.setNavigationState(F)},navigateTo(P){const F=g();return F.href=P,t.setNavigationState(F)}},w=Je(()=>{const P=Object.entries(n.outputs).map(([F,T])=>[F,T.ok&&T.value!==void 0?T.value:void 0]);return Object.fromEntries(P)}),v=Je(()=>{const P=Object.entries(n.outputs).map(([F,T])=>[F,T&&!T.ok?new JX(T.errors):void 0]);return Object.fromEntries(P)}),b={snapshot:n,queryParams:Je(()=>vDe(n.navigationState.href)),href:Je(()=>n.navigationState.href),hasErrors:Je(()=>Object.values(n.outputs).some(P=>!(P!=null&&P.ok)))},S=mDe({get(){return{args:n.args,ui:n.ui}},autoSave:!0,onSave(P){c(P.args,P.ui)}},{outputs:w,outputErrors:v},r);return oi(Object.assign(S,A,b))}const SDe=`.ag-header {
670
670
  border-bottom: 1px solid var(--border-color-default);
@@ -699,8 +699,8 @@ If you are trying to annotate ${s} with application data, use the '${s}.context'
699
699
  <rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
700
700
  <path fill-rule="evenodd" clip-rule="evenodd" d="M17.5431 8.51739L10.3333 16.0877L6.45691 12.0174L7.54312 10.9829L10.3333 13.9127L16.4569 7.48291L17.5431 8.51739Z" fill="white"/>
701
701
  </svg>
702
- `,mMe=["innerHTML"],vMe={class:"dropdown-list-item__title-container"},CMe={class:"dropdown-list-item__title text-s"},wMe={key:0,class:"dropdown-list-item__description text-description"},yMe={key:1,class:"dropdown-list-item__icon flex-self-start"},i$=Tr({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(e){const t=e,r=Je(()=>{const i=[];return t.size==="small"&&i.push("dropdown-list-item__small"),t.isSelected&&i.push("dropdown-list-item__selected"),t.isHovered&&i.push("hovered-item"),i.join(" ")}),s=Je(()=>{const i=["dropdown-list-item__checkbox","flex-self-start"];return t.isSelected&&i.push("checked"),i.join(" ")}),n=Je(()=>t.isSelected?AMe:fMe);return(i,o)=>(ye(),je("div",{class:St([r.value,"dropdown-list-item"])},[t.useCheckbox?(ye(),je("div",{key:0,class:St(s.value),innerHTML:n.value},null,10,mMe)):yt("",!0),o[1]||(o[1]=Ne()),We("div",vMe,[We("div",CMe,Zt(i.option.label),1),o[0]||(o[0]=Ne()),i.option.description?(ye(),je("div",wMe,Zt(i.option.description),1)):yt("",!0)]),o[2]||(o[2]=Ne()),!t.useCheckbox&&t.isSelected?(ye(),je("div",yMe)):yt("",!0)],2))}});function bMe(e){return e()}function SMe(e){let t=!1;return function(...r){t||(requestAnimationFrame(()=>{e(...r),t=!1}),t=!0)}}function xMe(e){return new Promise(t=>setTimeout(t,e))}function EMe(e,t){const r=setTimeout(e,t);return()=>{clearTimeout(r)}}function PMe(e){return function(t){return 1-e(1-t)}}function FMe(e){const{duration:t,draw:r,timing:s}=e,n=performance.now();let i=!1;return requestAnimationFrame(function o(a){let l=(a-n)/t;(l>1||i)&&(l=1);const c=s(l);r(c),l<1&&requestAnimationFrame(o)}),function(){i=!0}}function RMe(e,t,r=!0){let s=0,n;return function(...i){n=()=>{e.apply(this,i),s=new Date().getTime()+t,n=null,r&&setTimeout(()=>{n==null||n()},t)},new Date().getTime()>s&&n()}}function o$(e){if(!Array.isArray(e))throw Error("Invalid component options: "+String(e));return e.map(t=>({label:"label"in t?t.label:t.text,value:t.value,description:t.description}))}function a$(e,t){const r=SMe(()=>{if(e.value){const{scrollTop:s,scrollLeft:n,scrollHeight:i,scrollWidth:o,clientHeight:a,clientWidth:l}=document.documentElement,c=e.value.getBoundingClientRect();t({scrollTop:s,scrollLeft:n,scrollHeight:i,scrollWidth:o,clientHeight:a,clientWidth:l,offsetY:s+c.y,offsetX:n+c.x,top:c.top,right:c.right,bottom:c.bottom,left:c.left,width:c.width,height:c.height,x:c.x,y:c.y})}});Yh(r),cv(window,"scroll",r,{capture:!0,passive:!0}),cv(window,"resize",r,{passive:!0}),cv(window,"adjust",r,!0)}const TMe=Tr({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(e){const t=e,r=Je(()=>t.size==="large"?"--mask-size: 24px":""),s=Je(()=>`mask-16 mask-${t.name}`);return(n,i)=>(ye(),je("i",{style:oo(r.value),class:St([s.value,n.$style.icon])},null,6))}}),DMe="_icon_1ugxm_2",MMe={icon:DMe},IMe={$style:MMe},Zk=$h(TMe,[["__cssModules",IMe]]);function l$(e){function t(r){const s=r.currentTarget,n=document.createElement("span"),i=Math.max(s.clientWidth,s.clientHeight),o=i/2;n.style.width=n.style.height=`${i}px`,n.style.left=`${r.clientX-s.offsetLeft-o}px`,n.style.top=`${r.clientY-s.offsetTop-o}px`,n.classList.add("ripple");const a=s.getElementsByClassName("ripple")[0];a&&a.remove(),s.appendChild(n)}Yh(()=>{var r;(r=e.value)==null||r.addEventListener("click",t)})}const kMe={key:0},BMe={inheritAttrs:!1},c$=Tr({...BMe,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e,r=br(),s=Je(()=>t.small||t.size==="small"),n=Je(()=>t.large||t.size==="large");return l$(r),(i,o)=>(ye(),je("button",dl({ref_key:"btn",ref:r,tabindex:"0",class:{loading:i.loading,small:s.value,large:n.value,round:i.round,reverse:i.reverse,justifyCenter:i.justifyCenter,[i.$attrs.class+""]:!0}},{...i.$attrs,disabled:!!i.$attrs.disabled||i.loading}),[i.round?yt("",!0):(ye(),je("span",kMe,[jr(i.$slots,"default")])),o[0]||(o[0]=Ne()),i.loading?(ye(),jt(Pe(Zk),{key:1,name:"loading",size:i.size},null,8,["size"])):i.icon?(ye(),jt(Pe(Zk),{key:2,name:i.icon,size:i.size},null,8,["name","size"])):yt("",!0)],16))}}),LMe={name:"PlBtnPrimary"},kF=Tr({...LMe,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e;return(r,s)=>(ye(),jt(c$,dl({class:"pl-btn-primary"},t),{default:er(()=>[jr(r.$slots,"default")]),_:3},16))}}),HMe={name:"PlBtnSecondary"},u$=Tr({...HMe,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e;return(r,s)=>(ye(),jt(c$,dl(t,{class:"pl-btn-secondary"}),{default:er(()=>[jr(r.$slots,"default")]),_:3},16))}}),GMe=Tr({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(e){const t=e,r=Je(()=>`mask-24 mask-${t.name}`);return(s,n)=>(ye(),je("i",{class:St([r.value,s.$style.icon])},null,2))}}),OMe="_icon_1ugxm_2",NMe={icon:OMe},_Me={$style:NMe},Vc=$h(GMe,[["__cssModules",_Me]]),VMe={key:0},zMe={name:"PlBtnGhost"},g5=Tr({...zMe,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!1}},setup(e){const t=e,r=Je(()=>t.size==="small"),s=Je(()=>t.size==="large"),n=br(),i=dd();return l$(n),(o,a)=>(ye(),je("button",dl({ref_key:"btnRef",ref:n,tabindex:"0",class:["pl-btn-ghost",{loading:o.loading,small:r.value,large:s.value,round:o.round,reverse:o.reverse,justifyCenter:o.justifyCenter,[o.$attrs.class+""]:!0}]},{...o.$attrs,disabled:!!o.$attrs.disabled||o.loading}),[Pe(i).default&&!o.round?(ye(),je("span",VMe,[jr(o.$slots,"default")])):yt("",!0),a[0]||(a[0]=Ne()),o.loading?(ye(),jt(Pe(Vc),{key:1,name:"loading",size:o.size},null,8,["size"])):o.icon?(ye(),jt(Pe(Vc),{key:2,name:o.icon,size:o.size},null,8,["name","size"])):yt("",!0),a[1]||(a[1]=Ne()),jr(o.$slots,"append")],16))}});function QMe(e,t){const r=br();return a$(e,s=>{r.value=s}),Je(()=>{const s=Pe(r),n=Pe(t),i=n.position??"top",o=n.gap??8;if(!s)return"";const a=s.offsetY+Math.floor(s.height/2),l=s.offsetX+Math.floor(s.width/2);return i==="top-left"?`left: ${s.offsetX}px; top: ${s.offsetY-o}px;`:i==="top"?`left: ${l}px; top: ${s.offsetY-o}px;`:i==="right"?`left: ${s.offsetX+s.width+o}px; top: ${a}px;`:i==="left"?`right: ${s.scrollWidth-s.x+o}px; top: ${a}px;`:i==="southwest"?`left: ${s.offsetX+s.width}px; top: ${s.offsetY+s.height+o}px;`:""})}function f5(e,t){return t(e)}function d$(e,t){if(e!=null)return t(e)}function UMe(e){return Array.isArray(e)?e:[e]}function h$(e,t){cv(document,"click",r=>{document.contains(r.target)&&(UMe(e).map(s=>s.value).filter(s=>!!s).some(s=>s==null?void 0:s.contains(r.target))||t())})}const WMe={},jMe={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function KMe(e,t){return ye(),je("svg",jMe,t[0]||(t[0]=[We("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const YMe=$h(WMe,[["render",KMe]]),u4=new Map,ZMe={name:"PlTooltip"},_h=Tr({...ZMe,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"},maxWidth:{default:"300px"}},emits:["tooltip:close"],setup(e,{emit:t}){const r=t,s=Symbol(),n=e,i=oi({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});u4.set(s,()=>c()),tn(()=>i.open,b=>{requestAnimationFrame(()=>{i.tooltipOpen=b})});let o=()=>{};const a=RMe(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),l=()=>{i.open=!0;for(const[b,S]of u4.entries())b!==s&&S()},c=()=>{i.open=!1,r("tooltip:close")},u=async()=>{n.hide||(a(),i.over=!0,o(),await xMe(100),i.over&&l())},d=()=>{i.over=!1,o=EMe(()=>{i.over||c()},n.closeDelay)};tn(()=>n.hide,b=>{b&&c()});const g=br(),A=br(),w=QMe(g,I7(n));h$([g,A],()=>c());const v=Je(()=>({"--pl-tooltip-max-width":n.maxWidth}));return Bx(()=>{u4.delete(s)}),(b,S)=>(ye(),jt(QU(b.element),dl(b.$attrs,{ref_key:"rootRef",ref:g,onClick:u,onMouseover:u,onMouseleave:d}),{default:er(()=>[jr(b.$slots,"default"),S[1]||(S[1]=Ne()),b.$slots.tooltip&&i.open?(ye(),jt(kx,{key:0,to:"body"},[zt(V7,{name:"tooltip-transition"},{default:er(()=>[i.tooltipOpen?(ye(),je("div",{key:0,class:"pl-tooltip__container",style:oo(Pe(w))},[We("div",{ref_key:"tooltip",ref:A,class:St(["pl-tooltip",b.position]),style:oo(v.value),onMouseover:u,onMouseleave:d},[We("div",null,[jr(b.$slots,"tooltip")]),S[0]||(S[0]=Ne()),zt(YMe)],38)],4)):yt("",!0)]),_:3})])):yt("",!0)]),_:3},16))}}),XMe={},$Me={class:"inner-border"};function JMe(e,t,r,s,n,i){return ye(),je("div",$Me,[jr(e.$slots,"default")])}const qMe=$h(XMe,[["render",JMe]]),e4e={key:0},t4e=["tabindex","onKeydown","onClick"],r4e={key:1,class:"pl-btn-group__helper"},s4e={key:2,class:"pl-btn-group__error"},n4e={name:"PlBtnGroup"},i4e=Tr({...n4e,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},compact:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(e,{emit:t}){const r=dd(),s=t,n=a=>s("update:modelValue",a),i=e,o=Je(()=>i.options.map(a=>({label:"label"in a?a.label:a.text,value:a.value})));return(a,l)=>(ye(),je("div",{class:St(["pl-btn-group",{disabled:a.disabled,compact:a.compact}])},[a.label?(ye(),je("label",e4e,[We("span",null,Zt(a.label),1),l[0]||(l[0]=Ne()),Pe(r).tooltip?(ye(),jt(Pe(_h),{key:0,class:"info",position:"top"},{tooltip:er(()=>[jr(a.$slots,"tooltip")]),_:3})):yt("",!0)])):yt("",!0),l[1]||(l[1]=Ne()),zt(qMe,{class:"pl-btn-group__container"},{default:er(()=>[(ye(!0),je(_s,null,Fh(o.value,(c,u)=>(ye(),je("div",{key:u,class:St(["pl-btn-group__option text-s",{active:a.modelValue===c.value}]),tabindex:a.modelValue===c.value||a.disabled?void 0:0,onKeydown:dw(d=>n(c.value),["enter"]),onClick:d=>n(c.value)},Zt(c.label),43,t4e))),128))]),_:1}),l[2]||(l[2]=Ne()),a.helper?(ye(),je("div",r4e,Zt(a.helper),1)):a.error?(ye(),je("div",s4e,Zt(a.error),1)):yt("",!0)],2))}}),o4e={inheritAttrs:!1},a4e={class:"double-contour"};function l4e(e,t,r,s,n,i){return ye(),je("div",a4e,[We("div",hie(gW(e.$attrs)),[jr(e.$slots,"default")],16)])}const $x=$h(o4e,[["render",l4e]]);function c4e(e){Yh(e),L7(e)}const A5=new WeakMap,Xk=new ResizeObserver(e=>{for(const t of e)d$(A5.get(t.target),r=>r(t))});function u4e(e,t){A5.set(e,t),Xk.unobserve(e),Xk.observe(e)}function d4e(e){Xk.unobserve(e),A5.delete(e)}const h4e=8,jG=4;function Jx(e,t="label"){const r=new Set;c4e(()=>{d$(e==null?void 0:e.value,s=>{const n=s.querySelector(t);n&&(r.add(n),u4e(n,()=>{const i=bMe(()=>n.getBoundingClientRect().width+f5(h4e,o=>Number.isNaN(o)?jG:o+jG));s.style.getPropertyValue("--label-offset-right-x")!==`${i}px`&&s.style.setProperty("--label-offset-right-x",`${i}px`)}))})}),H7(()=>{Array.from(r.values()).map(s=>d4e(s))})}function p4e(e,t){const r=[];return t&&t.length>0&&t.forEach(s=>{const n=s(e);typeof n=="string"&&r.push(n)}),{isValid:r.length===0,errors:r}}function g4e(e,t){return Je(()=>p4e(e.value,t))}const f4e=Tr({__name:"PlIcon16",props:{name:{},size:{}},setup(e){const t=e,r=Je(()=>t.size==="large"?"--icon-size: 24px":""),s=Je(()=>`icon-16 icon-${t.name}`);return(n,i)=>(ye(),je("i",{style:oo(r.value),class:St([s.value,n.$style.icon])},null,6))}}),A4e="_icon_1ugxm_2",m4e={icon:A4e},v4e={$style:m4e},_S=$h(f4e,[["__cssModules",v4e]]),C4e={class:"pl-text-field__envelope"},w4e={key:0,ref:"label"},y4e={key:0,class:"required-icon"},b4e={key:1,class:"pl-text-field__prefix"},S4e=["disabled","placeholder","type"],x4e={key:0,class:"pl-text-field__error"},E4e={key:1,class:"pl-text-field__helper"},P4e={name:"PlTextField"},d4=Tr({...P4e,props:KU({label:{},clearable:{type:[Boolean,Function]},parse:{type:Function},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=dd(),r=lW(e,"modelValue"),s=e,n=br(void 0),i=br(),o=br(!1),a=oi({cached:void 0}),l=Je({get(){return a.cached?a.cached.value:r.value===void 0||r.value===null?"":String(r.value)},set(D){if(a.cached=void 0,s.parse)try{r.value=s.parse(D)}catch(B){a.cached={error:B instanceof Error?B.message:String(B),value:D}}else r.value=D}}),c=Je(()=>s.type&&s.type==="password"?o.value?"text":s.type:"text"),u=Je(()=>o.value?"view-show":"view-hide"),d=()=>{s.clearable&&(a.cached=void 0,r.value=s.clearable===!0?"":s.clearable())},g=g4e(l,s.rules||[]),A=Je(()=>s.clearable?s.clearable===!0?r.value==="":r.value===s.clearable():r.value===""),w=Je(()=>!A.value),v=Je(()=>{const D=[];return s.error&&D.push(s.error),a.cached&&D.push(a.cached.error),g.value.isValid||D.push(...g.value.errors),D}),b=Je(()=>v.value.length>0),S=Je(()=>s.clearable&&w.value&&s.type!=="password"&&!s.disabled),P=()=>o.value=!o.value,F=()=>{a.cached=void 0},T=()=>{var D;return(D=i.value)==null?void 0:D.focus()};return Jx(n),(D,B)=>(ye(),je("div",C4e,[We("div",{ref_key:"rootRef",ref:n,class:St(["pl-text-field",{error:b.value,disabled:D.disabled,dashed:D.dashed,nonEmpty:w.value}])},[D.label?(ye(),je("label",w4e,[D.required?(ye(),je("i",y4e)):yt("",!0),B[1]||(B[1]=Ne()),We("span",null,Zt(D.label),1),B[2]||(B[2]=Ne()),Pe(t).tooltip?(ye(),jt(Pe(_h),{key:1,class:"info",position:"top"},{tooltip:er(()=>[jr(D.$slots,"tooltip")]),_:3})):yt("",!0)],512)):yt("",!0),B[5]||(B[5]=Ne()),D.prefix?(ye(),je("div",b4e,Zt(D.prefix),1)):yt("",!0),B[6]||(B[6]=Ne()),Av(We("input",{ref_key:"inputRef",ref:i,"onUpdate:modelValue":B[0]||(B[0]=k=>l.value=k),disabled:D.disabled,placeholder:D.placeholder||"...",type:c.value,spellcheck:"false",onFocusout:F},null,40,S4e),[[Pae,l.value]]),B[7]||(B[7]=Ne()),We("div",{class:"pl-text-field__append",onClick:T},[S.value?(ye(),jt(Pe(_S),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:Nn(d,["stop"])})):yt("",!0),B[3]||(B[3]=Ne()),D.type==="password"?(ye(),jt(Pe(Vc),{key:1,name:u.value,style:{cursor:"pointer"},onClick:Nn(P,["stop"])},null,8,["name"])):yt("",!0),B[4]||(B[4]=Ne()),jr(D.$slots,"append")]),B[8]||(B[8]=Ne()),zt($x,{class:"pl-text-field__contour"})],2),B[9]||(B[9]=Ne()),b.value?(ye(),je("div",x4e,Zt(v.value.join(" ")),1)):D.helper?(ye(),je("div",E4e,Zt(D.helper),1)):yt("",!0)]))}}),F4e=Tr({__name:"PlIcon24",props:{name:{},size:{}},setup(e){const t=e,r=Je(()=>`icon-24 icon-${t.name}`);return(s,n)=>(ye(),je("i",{class:St([r.value,s.$style.icon])},null,2))}}),R4e="_icon_1ugxm_2",T4e={icon:R4e},D4e={$style:T4e},m5=$h(F4e,[["__cssModules",D4e]]),M4e=["disabled","placeholder"],I4e=Tr({__name:"PlSearchField",props:{modelValue:{},clearable:{type:Boolean},placeholder:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const r=t,s=e,n=br(void 0),i=br(),o=Je({get(){return s.modelValue??""},set(c){r("update:modelValue",c)}}),a=Je(()=>!!s.modelValue),l=()=>r("update:modelValue","");return(c,u)=>(ye(),je("div",{ref_key:"root",ref:n,class:St(["pl-search-field",[c.$style.component]])},[zt(Pe(m5),{name:"search"}),u[1]||(u[1]=Ne()),Av(We("input",{ref_key:"input",ref:i,"onUpdate:modelValue":u[0]||(u[0]=d=>o.value=d),disabled:c.disabled,type:"text",placeholder:c.placeholder||"Find...",spellcheck:"false"},null,8,M4e),[[pS,o.value]]),u[2]||(u[2]=Ne()),c.clearable&&a.value?(ye(),jt(Pe(_S),{key:0,class:St(c.$style.clear),name:"delete-clear",onClick:Nn(l,["stop"])},null,8,["class"])):yt("",!0)],2))}}),k4e="_component_pz0lo_1",B4e="_clear_pz0lo_35",L4e={component:k4e,clear:B4e},H4e={$style:L4e},G4e=$h(I4e,[["__cssModules",H4e]]);function KG(e){return e!==null&&typeof e=="object"}function ng(e,t){return KG(e)&&KG(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(r=>ng(e[r],t[r])):e===t}function YG(e,t){return e.some(r=>ng(r,t))}const O4e=Tr({__name:"LongText",setup(e){cae(u=>({"5deba9de":o.value}));const t=br(!1),r=br(),s=br(!1),n=Je(()=>s.value&&t.value?"ui-lt-animate":""),i=MDe(u=>s.value=u,500),o=Je(()=>{var u;return r.value?`${((u=r.value)==null?void 0:u.innerHTML.length)*.4}s`:"5s"});function a(){const u=NS(r.value,"span cannot be empty");t.value=u.clientWidth<u.scrollWidth}function l(){a(),i(!0)}function c(){i(!1)}return(u,d)=>(ye(),je("div",dl(u.$attrs,{class:"ui-lt-container"}),[We("span",{onMouseover:l,onMouseleave:c},[We("span",{ref_key:"span",ref:r,class:St(n.value)},[jr(u.$slots,"default")],2)],32)],16))}});function N4e(e,t){const r=e.scrollTop,s=e.getBoundingClientRect().height,n=t.offsetTop,i=t.getBoundingClientRect().height;return n+i<s+r&&n>r}function _4e(e,t){const r=e.scrollTop,s=e.getBoundingClientRect().height,n=t.offsetTop,i=t.getBoundingClientRect().height;return n+i<s+r?"ceil":n>r?"floor":"visible"}function V4e(e,t,r={}){const s=e.scrollTop,n=e.getBoundingClientRect().height,i=t.getBoundingClientRect().height,o=t.offsetTop,a=_4e(e,t);if(a==="visible")return;const l=c=>{const u=a==="floor"?o-(n-i):o;e.scrollTop=s+c*(u-s)};N4e(e,t)||FMe({duration:r.duration||100,timing:PMe(c=>c),draw:l})}const p$=Tr({__name:"DropdownOverlay",props:{root:{},gap:{}},setup(e,{expose:t}){const r=e,s=oi({optionsHeight:0}),n=oi({top:"0px",left:"0px",width:"0px"}),i=I7(r,"root"),o=br();return t({scrollIntoActive:()=>{const a=o.value;a&&p5(a.querySelector(".hovered-item"),l=>{V4e(a,l)})},listRef:o}),tn(o,a=>{a&&requestAnimationFrame(()=>{const l=a.getBoundingClientRect();s.optionsHeight=l.height,window.dispatchEvent(new CustomEvent("adjust"))})}),a$(i,a=>{const l=document.body.getBoundingClientRect(),c=a.top-l.top,u=a.left-l.left,d=r.gap??0,g=c+a.height+d;g+s.optionsHeight>a.clientHeight?n.top=c-s.optionsHeight-d+"px":n.top=g+"px",n.left=u+"px",n.width=a.width+"px"}),(a,l)=>(ye(),jt(kx,{to:"body"},[We("div",dl({ref_key:"listRef",ref:o},a.$attrs,{style:n,tabindex:"-1"}),[jr(a.$slots,"default",{ref:"list"})],16)]))}}),z4e=["tabindex"],Q4e={class:"pl-dropdown__container"},U4e={class:"pl-dropdown__field"},W4e=["disabled","placeholder"],j4e={key:0,class:"input-value"},K4e={class:"pl-dropdown__controls"},Y4e={key:2,class:"arrow-icon arrow-icon-default"},Z4e={key:0},X4e={key:0,class:"required-icon"},$4e={key:0,class:"nothing-found"},J4e={key:0,class:"pl-dropdown__error"},q4e={key:1,class:"pl-dropdown__helper"},eIe={key:2,class:"pl-dropdown__helper"},tIe={name:"PlDropdown"},g$=Tr({...tIe,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(e,{emit:t}){const r=t,s=e,n=dd(),i=br(),o=br(),a=B7("overlay"),l=oi({search:"",activeIndex:-1,open:!1,optionsHeight:0}),c=()=>f5(F.value.findIndex(G=>ng(G.value,s.modelValue)),G=>G<0?0:G),u=()=>l.activeIndex=c(),d=Je(()=>s.options===void 0),g=Je(()=>d.value?!0:s.disabled),A=Je(()=>(s.options??[]).findIndex(G=>ng(G.value,s.modelValue))),w=Je(()=>{if(!d.value){if(s.error)return s.error;if(s.modelValue!==void 0&&A.value===-1)return"The selected value is not one of the options"}}),v=Je(()=>o$(s.options??[]).map((G,N)=>({...G,index:N,isSelected:N===A.value,isActive:N===l.activeIndex}))),b=Je(()=>{const G=Pe(v).find(N=>ng(N.value,s.modelValue));return(G==null?void 0:G.label)||s.modelValue}),S=Je(()=>!l.open&&s.modelValue?"":s.modelValue?String(b.value):s.placeholder),P=Je(()=>s.modelValue!==void 0&&s.modelValue!==null),F=Je(()=>{const G=v.value;return l.search?G.filter(N=>{const W=l.search.toLowerCase();return N.label.toLowerCase().includes(W)||N.description&&N.description.toLowerCase().includes(W)?!0:typeof N.value=="string"?N.value.toLowerCase().includes(W):N.value===l.search}):G}),T=Je(()=>g.value?void 0:"0"),D=G=>{var N;r("update:modelValue",G),l.search="",l.open=!1,(N=i==null?void 0:i.value)==null||N.focus()},B=()=>r("update:modelValue",void 0),k=()=>{var G;return(G=o.value)==null?void 0:G.focus()},z=()=>{l.open=!l.open,l.open||(l.search="")},O=()=>l.open=!0,j=G=>{var N,W,V;const q=G.relatedTarget;!((N=i.value)!=null&&N.contains(q))&&!((V=(W=a.value)==null?void 0:W.listRef)!=null&&V.contains(q))&&(l.search="",l.open=!1)},_=G=>{var N,W;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(G.code))G.preventDefault();else return;const{open:V,activeIndex:q}=l;if(!V){G.code==="Enter"&&(l.open=!0);return}G.code==="Escape"&&(l.open=!1,(N=i.value)==null||N.focus());const pe=Pe(F),{length:X}=pe;if(!X)return;G.code==="Enter"&&D((W=pe.find(se=>se.index===q))==null?void 0:W.value);const re=pe.findIndex(se=>se.index===q)??-1,ae=G.code==="ArrowDown"?1:G.code==="ArrowUp"?-1:0,$=Math.abs(re+ae+X)%X;l.activeIndex=F.value[$].index??-1};return Jx(i),tn(()=>s.modelValue,u,{immediate:!0}),tn(()=>l.open,G=>{var N;return G?(N=o.value)==null?void 0:N.focus():""}),oW(()=>{var G;l.search,l.activeIndex>=0&&l.open&&((G=a.value)==null||G.scrollIntoActive())}),(G,N)=>(ye(),je("div",{class:"pl-dropdown__envelope",onClick:k},[We("div",{ref_key:"rootRef",ref:i,tabindex:T.value,class:St(["pl-dropdown",{open:l.open,error:G.error,disabled:g.value}]),onKeydown:_,onFocusout:j},[We("div",Q4e,[We("div",U4e,[Av(We("input",{ref_key:"input",ref:o,"onUpdate:modelValue":N[0]||(N[0]=W=>l.search=W),type:"text",tabindex:"-1",disabled:g.value,placeholder:S.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:O},null,40,W4e),[[pS,l.search]]),N[4]||(N[4]=Ne()),l.open?yt("",!0):(ye(),je("div",j4e,[zt(O4e,null,{default:er(()=>[Ne(Zt(b.value),1)]),_:1})])),N[5]||(N[5]=Ne()),We("div",K4e,[d.value?(ye(),jt(Pe(Vc),{key:0,name:"loading"})):yt("",!0),N[1]||(N[1]=Ne()),G.clearable&&P.value?(ye(),jt(Pe(_S),{key:1,name:"delete-clear",onClick:Nn(B,["stop"])})):yt("",!0),N[2]||(N[2]=Ne()),jr(G.$slots,"append"),N[3]||(N[3]=Ne()),We("div",{class:"pl-dropdown__arrow-wrapper",onClick:Nn(z,["stop"])},[G.arrowIconLarge?(ye(),je("div",{key:0,class:St(["arrow-icon",[`icon-24 ${G.arrowIconLarge}`]])},null,2)):G.arrowIcon?(ye(),je("div",{key:1,class:St(["arrow-icon",[`icon-16 ${G.arrowIcon}`]])},null,2)):(ye(),je("div",Y4e))])])]),N[9]||(N[9]=Ne()),G.label?(ye(),je("label",Z4e,[G.required?(ye(),je("i",X4e)):yt("",!0),N[6]||(N[6]=Ne()),We("span",null,Zt(G.label),1),N[7]||(N[7]=Ne()),Pe(n).tooltip?(ye(),jt(Pe(_h),{key:1,class:"info",position:"top"},{tooltip:er(()=>[jr(G.$slots,"tooltip")]),_:3})):yt("",!0)])):yt("",!0),N[10]||(N[10]=Ne()),l.open?(ye(),jt(Pe(p$),{key:1,ref:"overlay",root:i.value,class:"pl-dropdown__options",tabindex:"-1",gap:3},{default:er(()=>[(ye(!0),je(_s,null,Fh(F.value,(W,V)=>(ye(),jt(i$,{key:V,option:W,"is-selected":W.isSelected,"is-hovered":W.isActive,size:G.optionSize,onClick:Nn(q=>D(W.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),N[8]||(N[8]=Ne()),F.value.length?yt("",!0):(ye(),je("div",$4e,"Nothing found"))]),_:1},8,["root"])):yt("",!0),N[11]||(N[11]=Ne()),zt($x,{class:"pl-dropdown__contour"})])],42,z4e),N[12]||(N[12]=Ne()),w.value?(ye(),je("div",J4e,Zt(w.value),1)):d.value&&G.loadingOptionsHelper?(ye(),je("div",q4e,Zt(G.loadingOptionsHelper),1)):G.helper?(ye(),je("div",eIe,Zt(G.helper),1)):yt("",!0)]))}}),rIe={class:"pl-chip__text"},ZG=Tr({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(e){const t=br(),r=br(!1);return Yh(()=>{var s;t.value&&(r.value=((s=t.value)==null?void 0:s.clientWidth)>=256)}),(s,n)=>(ye(),jt(Pe(_h),{position:"top",class:"pl-chip-tooltip",delay:500},UU({default:er(()=>[n[4]||(n[4]=Ne()),We("div",{ref_key:"chip",ref:t,class:St(["pl-chip",{small:s.small}])},[We("div",rIe,[jr(s.$slots,"default")]),n[3]||(n[3]=Ne()),s.closeable?(ye(),je("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:n[0]||(n[0]=dw(i=>s.$emit("close"),["enter"])),onClick:n[1]||(n[1]=Nn(i=>s.$emit("close"),["stop"]))},n[2]||(n[2]=[We("div",{class:"pl-chip__close--icon"},null,-1)]),32)):yt("",!0)],2)]),_:2},[r.value?{name:"tooltip",fn:er(()=>[jr(s.$slots,"default")]),key:"0"}:void 0]),1024))}}),sIe=["tabindex"],nIe={class:"pl-dropdown-multi__container"},iIe={class:"pl-dropdown-multi__field"},oIe=["disabled","placeholder"],aIe={key:0,class:"chips-container"},lIe={class:"pl-dropdown-multi__controls"},cIe={key:0},uIe={key:0,class:"required-icon"},dIe={class:"pl-dropdown-multi__open-chips-container"},hIe={key:0,class:"nothing-found"},pIe={key:0,class:"pl-dropdown-multi__error"},gIe={key:1,class:"pl-dropdown-multi__helper"},fIe={name:"PlDropdownMulti"},AIe=Tr({...fIe,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{default:void 0},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const r=t,s=O=>r("update:modelValue",O),n=dd(),i=e,o=br(),a=br(),l=B7("overlay"),c=oi({search:"",activeOption:-1,open:!1,optionsHeight:0}),u=Je(()=>Array.isArray(i.modelValue)?i.modelValue:[]),d=Je(()=>c.open&&i.modelValue.length>0?i.placeholder:i.modelValue.length>0?"":i.placeholder),g=Je(()=>o$(i.options??[])),A=Je(()=>u.value.map(O=>g.value.find(j=>ng(j.value,O))).filter(O=>O!==void 0)),w=Je(()=>{const O=Pe(u),j=Pe(g);return(c.search?j.filter(_=>{const G=c.search.toLowerCase();return _.label.toLowerCase().includes(G)?!0:typeof _.value=="string"?_.value.toLowerCase().includes(G):_.value===c.search}):[...j]).map(_=>({..._,selected:YG(O,_.value)}))}),v=Je(()=>i.options===void 0),b=Je(()=>v.value?!0:i.disabled),S=Je(()=>b.value?void 0:"0"),P=()=>{c.activeOption=f5(w.value.findIndex(O=>ng(O.value,i.modelValue)),O=>O<0?0:O)},F=O=>{var j;const _=Pe(u);s(YG(_,O)?_.filter(G=>!ng(G,O)):[..._,O]),c.search="",(j=o==null?void 0:o.value)==null||j.focus()},T=O=>s(Pe(u).filter(j=>!ng(j,O))),D=()=>{var O;return(O=a.value)==null?void 0:O.focus()},B=()=>{c.open=!c.open,c.open||(c.search="")},k=O=>{var j,_,G;const N=O.relatedTarget;!((j=o.value)!=null&&j.contains(N))&&!((G=(_=l.value)==null?void 0:_.listRef)!=null&&G.contains(N))&&(c.search="",c.open=!1)},z=O=>{var j;const{open:_,activeOption:G}=c;if(!_){O.code==="Enter"&&(c.open=!0);return}O.code==="Escape"&&(c.open=!1,(j=o.value)==null||j.focus());const N=Pe(w),{length:W}=N;if(!W)return;["ArrowDown","ArrowUp","Enter"].includes(O.code)&&O.preventDefault(),O.code==="Enter"&&F(N[G].value);const V=O.code==="ArrowDown"?1:O.code==="ArrowUp"?-1:0;c.activeOption=Math.abs(G+V+W)%W,requestAnimationFrame(()=>{var q;return(q=l.value)==null?void 0:q.scrollIntoActive()})};return Jx(o),tn(()=>i.modelValue,()=>P(),{immediate:!0}),oW(()=>{var O;c.search,c.open&&((O=l.value)==null||O.scrollIntoActive())}),(O,j)=>(ye(),je("div",{class:"pl-dropdown-multi__envelope",onClick:D},[We("div",{ref_key:"rootRef",ref:o,tabindex:S.value,class:St(["pl-dropdown-multi",{open:c.open,error:O.error,disabled:b.value}]),onKeydown:z,onFocusout:k},[We("div",nIe,[We("div",iIe,[Av(We("input",{ref_key:"input",ref:a,"onUpdate:modelValue":j[0]||(j[0]=_=>c.search=_),type:"text",tabindex:"-1",disabled:b.value,placeholder:d.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:j[1]||(j[1]=_=>c.open=!0)},null,40,oIe),[[pS,c.search]]),j[6]||(j[6]=Ne()),c.open?yt("",!0):(ye(),je("div",aIe,[(ye(!0),je(_s,null,Fh(A.value,(_,G)=>(ye(),jt(Pe(ZG),{key:G,closeable:"",small:"",onClick:j[2]||(j[2]=Nn(N=>c.open=!0,["stop"])),onClose:N=>T(_.value)},{default:er(()=>[Ne(Zt(_.label||_.value),1)]),_:2},1032,["onClose"]))),128))])),j[7]||(j[7]=Ne()),We("div",lIe,[v.value?(ye(),jt(Pe(Vc),{key:0,name:"loading"})):yt("",!0),j[4]||(j[4]=Ne()),jr(O.$slots,"append"),j[5]||(j[5]=Ne()),We("div",{class:"pl-dropdown-multi__arrow-wrapper",onClick:Nn(B,["stop"])},j[3]||(j[3]=[We("div",{class:"arrow-icon arrow-icon-default"},null,-1)]))])]),j[12]||(j[12]=Ne()),O.label?(ye(),je("label",cIe,[O.required?(ye(),je("i",uIe)):yt("",!0),j[8]||(j[8]=Ne()),We("span",null,Zt(O.label),1),j[9]||(j[9]=Ne()),Pe(n).tooltip?(ye(),jt(Pe(_h),{key:1,class:"info",position:"top"},{tooltip:er(()=>[jr(O.$slots,"tooltip")]),_:3})):yt("",!0)])):yt("",!0),j[13]||(j[13]=Ne()),c.open?(ye(),jt(p$,{key:1,ref_key:"overlay",ref:l,root:o.value,class:"pl-dropdown-multi__options",gap:5,tabindex:"-1",onFocusout:k},{default:er(()=>[We("div",dIe,[(ye(!0),je(_s,null,Fh(A.value,(_,G)=>(ye(),jt(Pe(ZG),{key:G,closeable:"",small:"",onClose:N=>T(_.value)},{default:er(()=>[Ne(Zt(_.label||_.value),1)]),_:2},1032,["onClose"]))),128))]),j[10]||(j[10]=Ne()),(ye(!0),je(_s,null,Fh(w.value,(_,G)=>(ye(),jt(i$,{key:G,option:_,"text-item":"text","is-selected":_.selected,"is-hovered":c.activeOption==G,size:"medium","use-checkbox":"",onClick:Nn(N=>F(_.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),j[11]||(j[11]=Ne()),w.value.length?yt("",!0):(ye(),je("div",hIe,"Nothing found"))]),_:1},8,["root"])):yt("",!0),j[14]||(j[14]=Ne()),zt($x,{class:"pl-dropdown-multi__contour"})])],42,sIe),j[15]||(j[15]=Ne()),O.error?(ye(),je("div",pIe,Zt(O.error),1)):O.helper?(ye(),je("div",gIe,Zt(O.helper),1)):yt("",!0)]))}}),XG=Tr({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean},indeterminate:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=e;return(r,s)=>(ye(),je("div",{tabindex:"0",class:St(["pl-checkbox-base",{...t.indeterminate?{indeterminate:!0}:{checked:t.modelValue},disabled:r.disabled}]),onClick:s[0]||(s[0]=n=>r.$emit("update:modelValue",!r.modelValue)),onKeydown:s[1]||(s[1]=dw(Nn(n=>r.$emit("update:modelValue",!r.modelValue),["prevent"]),["space"]))},null,34))}}),mIe={name:"PlCheckbox"},vIe=Tr({...mIe,props:{modelValue:{type:Boolean},disabled:{type:Boolean},indeterminate:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=e,r=dd();return(s,n)=>Pe(r).default?(ye(),je("div",{key:0,class:St(["pl-checkbox",{disabled:s.disabled}])},[zt(XG,dl(t,{"onUpdate:modelValue":n[0]||(n[0]=i=>s.$emit("update:modelValue",i))}),null,16),n[3]||(n[3]=Ne()),We("label",{onClick:n[1]||(n[1]=i=>s.$emit("update:modelValue",!s.$props.modelValue))},[jr(s.$slots,"default")])],2)):(ye(),jt(XG,dl({key:1},t,{"onUpdate:modelValue":n[2]||(n[2]=i=>s.$emit("update:modelValue",i))}),null,16))}}),CIe="_component_tupwt_1",wIe={component:CIe},yIe={};function bIe(e,t){return ye(),je("div",{class:St(e.$style.component)},t[0]||(t[0]=[We("div",null,null,-1)]),2)}const SIe={$style:wIe},xIe=$h(yIe,[["render",bIe],["__cssModules",SIe]]),EIe={key:1,class:"pl-dialog-modal__title"},PIe={inheritAttrs:!1},f$=Tr({...PIe,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean},size:{default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const r=dd(),s=t,n=e,i=br(),o=Je(()=>{const{width:l,height:c,minHeight:u,maxHeight:d,size:g}=n;return g==="small"?{width:"448px",height:"440px",minHeight:"auto",maxHeight:"auto"}:g==="medium"?{width:"720px",height:"720px",minHeight:"auto",maxHeight:"auto"}:g==="large"?{width:"1080px",height:"880px",minHeight:"auto",maxHeight:"auto"}:{width:l,height:c,minHeight:u,maxHeight:d}});function a(l){i.value&&n.closeOnOutsideClick&&document.contains(l.target)&&!i.value.contains(l.target)&&s("update:modelValue",!1)}return cv(document.body,"keyup",l=>{n.modelValue&&l.code==="Escape"&&s("update:modelValue",!1)}),(l,c)=>(ye(),jt(kx,{to:"body"},[zt(V7,{name:"dialog"},{default:er(()=>[l.modelValue?(ye(),je("div",{key:0,class:"pl-dialog-modal__shadow",onClick:a},[We("div",dl(l.$attrs,{ref_key:"modal",ref:i,class:["pl-dialog-modal",{"has-title":Pe(r).title,"has-content":Pe(r).default}],style:o.value}),[l.closable?(ye(),jt(xIe,{key:0,class:"close-modal-btn",onClick:c[0]||(c[0]=Nn(u=>s("update:modelValue",!1),["stop"]))})):yt("",!0),c[1]||(c[1]=Ne()),Pe(r).title?(ye(),je("div",EIe,[jr(l.$slots,"title")])):yt("",!0),c[2]||(c[2]=Ne()),We("div",{class:St(["pl-dialog-modal__content",{"no-content-gutters":l.noContentGutters,"no-top-content-gutter":l.noTopContentGutter}])},[jr(l.$slots,"default")],2),c[3]||(c[3]=Ne()),Pe(r).actions?(ye(),je("div",{key:2,class:St(["pl-dialog-modal__actions",{"has-top-border":l.actionsHasTopBorder}])},[jr(l.$slots,"actions")],2)):yt("",!0)],16)])):yt("",!0)]),_:3})]))}}),FIe=Tr({__name:"TransitionSlidePanel",setup(e){function t(){window.dispatchEvent(new CustomEvent("adjust"))}function r(){window.dispatchEvent(new CustomEvent("adjust"))}return(s,n)=>(ye(),jt(V7,{name:"slide-panel",onAfterEnter:t,onAfterLeave:r},{default:er(()=>[jr(s.$slots,"default")]),_:3}))}}),RIe={key:0,class:"pl-slide-modal__title"},TIe={class:"pl-slide-modal__title-content"},DIe={class:"pl-slide-modal__content"},MIe={key:1,class:"pl-slide-modal__actions"},IIe={name:"PlSlideModal",inheritAttrs:!1},kIe=Tr({...IIe,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const r=dd(),s=t,n=e,i=br(),o=doe();return h$(i,()=>{n.modelValue&&n.closeOnOutsideClick&&s("update:modelValue",!1)}),cv(document,"keydown",a=>{a.key==="Escape"&&s("update:modelValue",!1)}),(a,l)=>(ye(),jt(kx,{to:"body"},[zt(FIe,null,{default:er(()=>[a.modelValue?(ye(),je("div",dl({key:0,ref_key:"modal",ref:i,style:{width:a.width}},Pe(o),{class:["pl-slide-modal",{"has-title":Pe(r).title,"has-actions":Pe(r).actions}],onKeyup:l[1]||(l[1]=dw(c=>s("update:modelValue",!1),["esc"]))}),[We("div",{class:"close-dialog-btn",onClick:l[0]||(l[0]=c=>s("update:modelValue",!1))}),l[3]||(l[3]=Ne()),Pe(r).title?(ye(),je("div",RIe,[We("span",TIe,[jr(a.$slots,"title")])])):yt("",!0),l[4]||(l[4]=Ne()),We("div",DIe,[jr(a.$slots,"default")]),l[5]||(l[5]=Ne()),Pe(r).actions?(ye(),je("div",MIe,[jr(a.$slots,"actions")])):yt("",!0)],16)):yt("",!0)]),_:3}),l[6]||(l[6]=Ne()),a.modelValue&&a.shadow?(ye(),je("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:l[2]||(l[2]=dw(c=>s("update:modelValue",!1),["esc"]))},null,32)):yt("",!0)]))}});function A$(e){return x7()?(iU(e),!0):!1}const m$=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function BIe(e,t,r={}){const{immediate:s=!0}=r,n=br(!1);let i=null;function o(){i&&(clearTimeout(i),i=null)}function a(){n.value=!1,o()}function l(...c){o(),n.value=!0,i=setTimeout(()=>{n.value=!1,i=null,e(...c)},N2(t))}return s&&(n.value=!0,m$&&l()),A$(a),{isPending:T7(n),start:l,stop:a}}function LIe(e,t,r){return tn(e,(s,n,i)=>{s&&t(s,n,i)},{...r,once:!1})}function HIe(e,t,r={}){const{immediate:s=!0}=r,{start:n}=BIe(o,t,{immediate:!1}),i=br(!1);async function o(){i.value&&(await e(),n())}function a(){i.value||(i.value=!0,o())}function l(){i.value=!1}return s&&m$&&a(),A$(l),{isActive:i,pause:l,resume:a}}var vs;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{const i={};for(const o of n)i[o]=o;return i},e.getValidEnumValues=n=>{const i=e.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(const a of i)o[a]=n[a];return e.objectValues(o)},e.objectValues=n=>e.objectKeys(n).map(function(i){return n[i]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(o);return i},e.find=(n,i)=>{for(const o of n)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,i=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=s,e.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(vs||(vs={}));var $k;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})($k||($k={}));const Gt=vs.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zf=e=>{switch(typeof e){case"undefined":return Gt.undefined;case"string":return Gt.string;case"number":return isNaN(e)?Gt.nan:Gt.number;case"boolean":return Gt.boolean;case"function":return Gt.function;case"bigint":return Gt.bigint;case"symbol":return Gt.symbol;case"object":return Array.isArray(e)?Gt.array:e===null?Gt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Gt.promise:typeof Map<"u"&&e instanceof Map?Gt.map:typeof Set<"u"&&e instanceof Set?Gt.set:typeof Date<"u"&&e instanceof Date?Gt.date:Gt.object;default:return Gt.unknown}},At=vs.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),GIe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Wl extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(i){return i.message},s={_errors:[]},n=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(r(o));else{let a=s,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return n(this),s}static assert(t){if(!(t instanceof Wl))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,vs.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},s=[];for(const n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):s.push(t(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}Wl.create=e=>new Wl(e);const Fw=(e,t)=>{let r;switch(e.code){case At.invalid_type:e.received===Gt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case At.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,vs.jsonStringifyReplacer)}`;break;case At.unrecognized_keys:r=`Unrecognized key(s) in object: ${vs.joinValues(e.keys,", ")}`;break;case At.invalid_union:r="Invalid input";break;case At.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${vs.joinValues(e.options)}`;break;case At.invalid_enum_value:r=`Invalid enum value. Expected ${vs.joinValues(e.options)}, received '${e.received}'`;break;case At.invalid_arguments:r="Invalid function arguments";break;case At.invalid_return_type:r="Invalid function return type";break;case At.invalid_date:r="Invalid date";break;case At.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:vs.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case At.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case At.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case At.custom:r="Invalid input";break;case At.invalid_intersection_types:r="Intersection results could not be merged";break;case At.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case At.not_finite:r="Number must be finite";break;default:r=t.defaultError,vs.assertNever(e)}return{message:r}};let v$=Fw;function OIe(e){v$=e}function BF(){return v$}const LF=e=>{const{data:t,path:r,errorMaps:s,issueData:n}=e,i=[...r,...n.path||[]],o={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let a="";const l=s.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...n,path:i,message:a}},NIe=[];function It(e,t){const r=BF(),s=LF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Fw?void 0:Fw].filter(n=>!!n)});e.common.issues.push(s)}class Oo{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const s=[];for(const n of r){if(n.status==="aborted")return Fr;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,r){const s=[];for(const n of r){const i=await n.key,o=await n.value;s.push({key:i,value:o})}return Oo.mergeObjectSync(t,s)}static mergeObjectSync(t,r){const s={};for(const n of r){const{key:i,value:o}=n;if(i.status==="aborted"||o.status==="aborted")return Fr;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[i.value]=o.value)}return{status:t.value,value:s}}}const Fr=Object.freeze({status:"aborted"}),HF=e=>({status:"dirty",value:e}),Aa=e=>({status:"valid",value:e}),Jk=e=>e.status==="aborted",qk=e=>e.status==="dirty",VS=e=>e.status==="valid",zS=e=>typeof Promise<"u"&&e instanceof Promise;function GF(e,t,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function C$(e,t,r,s,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var Jt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Jt||(Jt={}));var m1,v1;let Vh=class{constructor(e,t,r,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const $G=(e,t)=>{if(VS(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Wl(e.common.issues);return this._error=r,this._error}}};function Vr(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:s,description:n}=e;if(t&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(i,o)=>{var a,l;const{message:c}=e;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:(a=c??s)!==null&&a!==void 0?a:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:o.defaultError}},description:n}}let Zr=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Zf(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Zf(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Oo,ctx:{common:e.parent.common,data:e.data,parsedType:Zf(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(zS(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const s={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zf(e)},n=this._parseSync({data:e,path:s.path,parent:s});return $G(s,n)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zf(e)},s=this._parse({data:e,path:r.path,parent:r}),n=await(zS(s)?s:Promise.resolve(s));return $G(r,n)}refine(e,t){const r=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,n)=>{const i=e(s),o=()=>n.addIssue({code:At.custom,...r(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(a=>a?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof t=="function"?t(r,s):t),!1))}_refinement(e){return new ad({schema:this,typeName:vr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Mh.create(this,this._def)}nullable(){return bA.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ju.create(this,this._def)}promise(){return Tw.create(this,this._def)}or(e){return YS.create([this,e],this._def)}and(e){return ZS.create(this,e,this._def)}transform(e){return new ad({...Vr(this._def),schema:this,typeName:vr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ex({...Vr(this._def),innerType:this,defaultValue:t,typeName:vr.ZodDefault})}brand(){return new v5({typeName:vr.ZodBranded,type:this,...Vr(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new tx({...Vr(this._def),innerType:this,catchValue:t,typeName:vr.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return e3.create(this,e)}readonly(){return rx.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const _Ie=/^c[^\s-]{8,}$/i,VIe=/^[0-9a-z]+$/,zIe=/^[0-9A-HJKMNP-TV-Z]{26}$/,QIe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,UIe=/^[a-z0-9_-]{21}$/i,WIe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jIe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KIe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let h4;const YIe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ZIe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,XIe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,w$="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",$Ie=new RegExp(`^${w$}$`);function y$(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function JIe(e){return new RegExp(`^${y$(e)}$`)}function b$(e){let t=`${w$}T${y$(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function qIe(e,t){return!!((t==="v4"||!t)&&YIe.test(e)||(t==="v6"||!t)&&ZIe.test(e))}class Qu extends Zr{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Gt.string){const n=this._getOrReturnCtx(t);return It(n,{code:At.invalid_type,expected:Gt.string,received:n.parsedType}),Fr}const r=new Oo;let s;for(const n of this._def.checks)if(n.kind==="min")t.data.length<n.value&&(s=this._getOrReturnCtx(t,s),It(s,{code:At.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="max")t.data.length>n.value&&(s=this._getOrReturnCtx(t,s),It(s,{code:At.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=t.data.length>n.value,o=t.data.length<n.value;(i||o)&&(s=this._getOrReturnCtx(t,s),i?It(s,{code:At.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&It(s,{code:At.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if(n.kind==="email")jIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"email",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="emoji")h4||(h4=new RegExp(KIe,"u")),h4.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"emoji",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="uuid")QIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"uuid",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="nanoid")UIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"nanoid",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid")_Ie.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"cuid",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid2")VIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"cuid2",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="ulid")zIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"ulid",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),It(s,{validation:"url",code:At.invalid_string,message:n.message}),r.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"regex",code:At.invalid_string,message:n.message}),r.dirty())):n.kind==="trim"?t.data=t.data.trim():n.kind==="includes"?t.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()):n.kind==="toLowerCase"?t.data=t.data.toLowerCase():n.kind==="toUpperCase"?t.data=t.data.toUpperCase():n.kind==="startsWith"?t.data.startsWith(n.value)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()):n.kind==="endsWith"?t.data.endsWith(n.value)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()):n.kind==="datetime"?b$(n).test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:"datetime",message:n.message}),r.dirty()):n.kind==="date"?$Ie.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:"date",message:n.message}),r.dirty()):n.kind==="time"?JIe(n).test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:"time",message:n.message}),r.dirty()):n.kind==="duration"?WIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"duration",code:At.invalid_string,message:n.message}),r.dirty()):n.kind==="ip"?qIe(t.data,n.version)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"ip",code:At.invalid_string,message:n.message}),r.dirty()):n.kind==="base64"?XIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"base64",code:At.invalid_string,message:n.message}),r.dirty()):vs.assertNever(n);return{status:r.value,value:t.data}}_regex(t,r,s){return this.refinement(n=>t.test(n),{validation:r,code:At.invalid_string,...Jt.errToObj(s)})}_addCheck(t){return new Qu({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Jt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Jt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Jt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Jt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Jt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Jt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Jt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Jt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Jt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Jt.errToObj(t)})}datetime(t){var r,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...Jt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Jt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Jt.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Jt.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Jt.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Jt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Jt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Jt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Jt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Jt.errToObj(r)})}nonempty(t){return this.min(1,Jt.errToObj(t))}trim(){return new Qu({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Qu({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Qu({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Qu.create=e=>{var t;return new Qu({checks:[],typeName:vr.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Vr(e)})};function eke(e,t){const r=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=r>s?r:s,i=parseInt(e.toFixed(n).replace(".","")),o=parseInt(t.toFixed(n).replace(".",""));return i%o/Math.pow(10,n)}let QS=class eB extends Zr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Gt.number){const n=this._getOrReturnCtx(t);return It(n,{code:At.invalid_type,expected:Gt.number,received:n.parsedType}),Fr}let r;const s=new Oo;for(const n of this._def.checks)n.kind==="int"?vs.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),It(r,{code:At.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="multipleOf"?eke(t.data,n.value)!==0&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):n.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),It(r,{code:At.not_finite,message:n.message}),s.dirty()):vs.assertNever(n);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Jt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Jt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Jt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Jt.toString(r))}setLimit(t,r,s,n){return new eB({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:Jt.toString(n)}]})}_addCheck(t){return new eB({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Jt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Jt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Jt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Jt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Jt.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&vs.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(r)&&Number.isFinite(t)}};QS.create=e=>new QS({checks:[],typeName:vr.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Vr(e)});class wA extends Zr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Gt.bigint){const n=this._getOrReturnCtx(t);return It(n,{code:At.invalid_type,expected:Gt.bigint,received:n.parsedType}),Fr}let r;const s=new Oo;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="multipleOf"?t.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):vs.assertNever(n);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Jt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Jt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Jt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Jt.toString(r))}setLimit(t,r,s,n){return new wA({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:Jt.toString(n)}]})}_addCheck(t){return new wA({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Jt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Jt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Jt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Jt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Jt.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}wA.create=e=>{var t;return new wA({checks:[],typeName:vr.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Vr(e)})};let US=class extends Zr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Gt.boolean){const t=this._getOrReturnCtx(e);return It(t,{code:At.invalid_type,expected:Gt.boolean,received:t.parsedType}),Fr}return Aa(e.data)}};US.create=e=>new US({typeName:vr.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Vr(e)});let WS=class S$ extends Zr{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Gt.date){const n=this._getOrReturnCtx(t);return It(n,{code:At.invalid_type,expected:Gt.date,received:n.parsedType}),Fr}if(isNaN(t.data.getTime())){const n=this._getOrReturnCtx(t);return It(n,{code:At.invalid_date}),Fr}const r=new Oo;let s;for(const n of this._def.checks)n.kind==="min"?t.data.getTime()<n.value&&(s=this._getOrReturnCtx(t,s),It(s,{code:At.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):n.kind==="max"?t.data.getTime()>n.value&&(s=this._getOrReturnCtx(t,s),It(s,{code:At.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):vs.assertNever(n);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new S$({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Jt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Jt.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};WS.create=e=>new WS({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:vr.ZodDate,...Vr(e)});let OF=class extends Zr{_parse(e){if(this._getType(e)!==Gt.symbol){const t=this._getOrReturnCtx(e);return It(t,{code:At.invalid_type,expected:Gt.symbol,received:t.parsedType}),Fr}return Aa(e.data)}};OF.create=e=>new OF({typeName:vr.ZodSymbol,...Vr(e)});class jS extends Zr{_parse(t){if(this._getType(t)!==Gt.undefined){const r=this._getOrReturnCtx(t);return It(r,{code:At.invalid_type,expected:Gt.undefined,received:r.parsedType}),Fr}return Aa(t.data)}}jS.create=e=>new jS({typeName:vr.ZodUndefined,...Vr(e)});class KS extends Zr{_parse(t){if(this._getType(t)!==Gt.null){const r=this._getOrReturnCtx(t);return It(r,{code:At.invalid_type,expected:Gt.null,received:r.parsedType}),Fr}return Aa(t.data)}}KS.create=e=>new KS({typeName:vr.ZodNull,...Vr(e)});let Rw=class extends Zr{constructor(){super(...arguments),this._any=!0}_parse(e){return Aa(e.data)}};Rw.create=e=>new Rw({typeName:vr.ZodAny,...Vr(e)});class uv extends Zr{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Aa(t.data)}}uv.create=e=>new uv({typeName:vr.ZodUnknown,...Vr(e)});class mg extends Zr{_parse(t){const r=this._getOrReturnCtx(t);return It(r,{code:At.invalid_type,expected:Gt.never,received:r.parsedType}),Fr}}mg.create=e=>new mg({typeName:vr.ZodNever,...Vr(e)});let NF=class extends Zr{_parse(e){if(this._getType(e)!==Gt.undefined){const t=this._getOrReturnCtx(e);return It(t,{code:At.invalid_type,expected:Gt.void,received:t.parsedType}),Fr}return Aa(e.data)}};NF.create=e=>new NF({typeName:vr.ZodVoid,...Vr(e)});class Ju extends Zr{_parse(t){const{ctx:r,status:s}=this._processInputParams(t),n=this._def;if(r.parsedType!==Gt.array)return It(r,{code:At.invalid_type,expected:Gt.array,received:r.parsedType}),Fr;if(n.exactLength!==null){const o=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(o||a)&&(It(r,{code:o?At.too_big:At.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(It(r,{code:At.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(It(r,{code:At.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>n.type._parseAsync(new Vh(r,o,r.path,a)))).then(o=>Oo.mergeArray(s,o));const i=[...r.data].map((o,a)=>n.type._parseSync(new Vh(r,o,r.path,a)));return Oo.mergeArray(s,i)}get element(){return this._def.type}min(t,r){return new Ju({...this._def,minLength:{value:t,message:Jt.toString(r)}})}max(t,r){return new Ju({...this._def,maxLength:{value:t,message:Jt.toString(r)}})}length(t,r){return new Ju({...this._def,exactLength:{value:t,message:Jt.toString(r)}})}nonempty(t){return this.min(1,t)}}Ju.create=(e,t)=>new Ju({type:e,minLength:null,maxLength:null,exactLength:null,typeName:vr.ZodArray,...Vr(t)});function L0(e){if(e instanceof Jc){const t={};for(const r in e.shape){const s=e.shape[r];t[r]=Mh.create(L0(s))}return new Jc({...e._def,shape:()=>t})}else return e instanceof Ju?new Ju({...e._def,type:L0(e.element)}):e instanceof Mh?Mh.create(L0(e.unwrap())):e instanceof bA?bA.create(L0(e.unwrap())):e instanceof yA?yA.create(e.items.map(t=>L0(t))):e}let Jc=class Lu extends Zr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=vs.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Gt.object){const l=this._getOrReturnCtx(t);return It(l,{code:At.invalid_type,expected:Gt.object,received:l.parsedType}),Fr}const{status:r,ctx:s}=this._processInputParams(t),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof mg&&this._def.unknownKeys==="strip"))for(const l in s.data)i.includes(l)||o.push(l);const a=[];for(const l of i){const c=n[l],u=s.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Vh(s,u,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof mg){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of o)a.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});else if(l==="strict")o.length>0&&(It(s,{code:At.unrecognized_keys,keys:o}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of o){const u=s.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Vh(s,u,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of a){const u=await c.key,d=await c.value;l.push({key:u,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>Oo.mergeObjectSync(r,l)):Oo.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(t){return Jt.errToObj,new Lu({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,s)=>{var n,i,o,a;const l=(o=(i=(n=this._def).errorMap)===null||i===void 0?void 0:i.call(n,r,s).message)!==null&&o!==void 0?o:s.defaultError;return r.code==="unrecognized_keys"?{message:(a=Jt.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Lu({...this._def,unknownKeys:"strip"})}passthrough(){return new Lu({...this._def,unknownKeys:"passthrough"})}extend(t){return new Lu({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Lu({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:vr.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Lu({...this._def,catchall:t})}pick(t){const r={};return vs.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new Lu({...this._def,shape:()=>r})}omit(t){const r={};return vs.objectKeys(this.shape).forEach(s=>{t[s]||(r[s]=this.shape[s])}),new Lu({...this._def,shape:()=>r})}deepPartial(){return L0(this)}partial(t){const r={};return vs.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];t&&!t[s]?r[s]=n:r[s]=n.optional()}),new Lu({...this._def,shape:()=>r})}required(t){const r={};return vs.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])r[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof Mh;)n=n._def.innerType;r[s]=n}}),new Lu({...this._def,shape:()=>r})}keyof(){return F$(vs.objectKeys(this.shape))}};Jc.create=(e,t)=>new Jc({shape:()=>e,unknownKeys:"strip",catchall:mg.create(),typeName:vr.ZodObject,...Vr(t)});Jc.strictCreate=(e,t)=>new Jc({shape:()=>e,unknownKeys:"strict",catchall:mg.create(),typeName:vr.ZodObject,...Vr(t)});Jc.lazycreate=(e,t)=>new Jc({shape:e,unknownKeys:"strip",catchall:mg.create(),typeName:vr.ZodObject,...Vr(t)});let YS=class extends Zr{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function s(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=n.map(o=>new Wl(o.ctx.common.issues));return It(t,{code:At.invalid_union,unionErrors:i}),Fr}if(t.common.async)return Promise.all(r.map(async n=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let n;const i=[];for(const a of r){const l={...t,common:{...t.common,issues:[]},parent:null},c=a._parseSync({data:t.data,path:t.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!n&&(n={result:c,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const o=i.map(a=>new Wl(a));return It(t,{code:At.invalid_union,unionErrors:o}),Fr}}get options(){return this._def.options}};YS.create=(e,t)=>new YS({options:e,typeName:vr.ZodUnion,...Vr(t)});const kf=e=>e instanceof $S?kf(e.schema):e instanceof ad?kf(e.innerType()):e instanceof JS?[e.value]:e instanceof qx?e.options:e instanceof qS?vs.objectValues(e.enum):e instanceof ex?kf(e._def.innerType):e instanceof jS?[void 0]:e instanceof KS?[null]:e instanceof Mh?[void 0,...kf(e.unwrap())]:e instanceof bA?[null,...kf(e.unwrap())]:e instanceof v5||e instanceof rx?kf(e.unwrap()):e instanceof tx?kf(e._def.innerType):[];let x$=class E$ extends Zr{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Gt.object)return It(r,{code:At.invalid_type,expected:Gt.object,received:r.parsedType}),Fr;const s=this.discriminator,n=r.data[s],i=this.optionsMap.get(n);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(It(r,{code:At.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Fr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,s){const n=new Map;for(const i of r){const o=kf(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(n.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,i)}}return new E$({typeName:vr.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...Vr(s)})}};function tB(e,t){const r=Zf(e),s=Zf(t);if(e===t)return{valid:!0,data:e};if(r===Gt.object&&s===Gt.object){const n=vs.objectKeys(t),i=vs.objectKeys(e).filter(a=>n.indexOf(a)!==-1),o={...e,...t};for(const a of i){const l=tB(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===Gt.array&&s===Gt.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let i=0;i<e.length;i++){const o=e[i],a=t[i],l=tB(o,a);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===Gt.date&&s===Gt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ZS extends Zr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=(i,o)=>{if(Jk(i)||Jk(o))return Fr;const a=tB(i.value,o.value);return a.valid?((qk(i)||qk(o))&&r.dirty(),{status:r.value,value:a.data}):(It(s,{code:At.invalid_intersection_types}),Fr)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,o])=>n(i,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ZS.create=(e,t,r)=>new ZS({left:e,right:t,typeName:vr.ZodIntersection,...Vr(r)});let yA=class P$ extends Zr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Gt.array)return It(s,{code:At.invalid_type,expected:Gt.array,received:s.parsedType}),Fr;if(s.data.length<this._def.items.length)return It(s,{code:At.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Fr;!this._def.rest&&s.data.length>this._def.items.length&&(It(s,{code:At.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const n=[...s.data].map((i,o)=>{const a=this._def.items[o]||this._def.rest;return a?a._parse(new Vh(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(n).then(i=>Oo.mergeArray(r,i)):Oo.mergeArray(r,n)}get items(){return this._def.items}rest(t){return new P$({...this._def,rest:t})}};yA.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yA({items:e,typeName:vr.ZodTuple,rest:null,...Vr(t)})};class XS extends Zr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Gt.object)return It(s,{code:At.invalid_type,expected:Gt.object,received:s.parsedType}),Fr;const n=[],i=this._def.keyType,o=this._def.valueType;for(const a in s.data)n.push({key:i._parse(new Vh(s,a,s.path,a)),value:o._parse(new Vh(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?Oo.mergeObjectAsync(r,n):Oo.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,s){return r instanceof Zr?new XS({keyType:t,valueType:r,typeName:vr.ZodRecord,...Vr(s)}):new XS({keyType:Qu.create(),valueType:t,typeName:vr.ZodRecord,...Vr(r)})}}let _F=class extends Zr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Gt.map)return It(r,{code:At.invalid_type,expected:Gt.map,received:r.parsedType}),Fr;const s=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([o,a],l)=>({key:s._parse(new Vh(r,o,r.path,[l,"key"])),value:n._parse(new Vh(r,a,r.path,[l,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const a of i){const l=await a.key,c=await a.value;if(l.status==="aborted"||c.status==="aborted")return Fr;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(l.value,c.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const a of i){const l=a.key,c=a.value;if(l.status==="aborted"||c.status==="aborted")return Fr;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(l.value,c.value)}return{status:t.value,value:o}}}};_F.create=(e,t,r)=>new _F({valueType:t,keyType:e,typeName:vr.ZodMap,...Vr(r)});let VF=class rB extends Zr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Gt.set)return It(s,{code:At.invalid_type,expected:Gt.set,received:s.parsedType}),Fr;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(It(s,{code:At.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(It(s,{code:At.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Fr;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}const a=[...s.data.values()].map((l,c)=>i._parse(new Vh(s,l,s.path,c)));return s.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,r){return new rB({...this._def,minSize:{value:t,message:Jt.toString(r)}})}max(t,r){return new rB({...this._def,maxSize:{value:t,message:Jt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};VF.create=(e,t)=>new VF({valueType:e,minSize:null,maxSize:null,typeName:vr.ZodSet,...Vr(t)});class sw extends Zr{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Gt.function)return It(r,{code:At.invalid_type,expected:Gt.function,received:r.parsedType}),Fr;function s(a,l){return LF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,BF(),Fw].filter(c=>!!c),issueData:{code:At.invalid_arguments,argumentsError:l}})}function n(a,l){return LF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,BF(),Fw].filter(c=>!!c),issueData:{code:At.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Tw){const a=this;return Aa(async function(...l){const c=new Wl([]),u=await a._def.args.parseAsync(l,i).catch(g=>{throw c.addIssue(s(l,g)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(n(d,g)),c})})}else{const a=this;return Aa(function(...l){const c=a._def.args.safeParse(l,i);if(!c.success)throw new Wl([s(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,i);if(!d.success)throw new Wl([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new sw({...this._def,args:yA.create(t).rest(uv.create())})}returns(t){return new sw({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,s){return new sw({args:t||yA.create([]).rest(uv.create()),returns:r||uv.create(),typeName:vr.ZodFunction,...Vr(s)})}}let $S=class extends Zr{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};$S.create=(e,t)=>new $S({getter:e,typeName:vr.ZodLazy,...Vr(t)});let JS=class extends Zr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return It(t,{received:t.data,code:At.invalid_literal,expected:this._def.value}),Fr}return{status:"valid",value:e.data}}get value(){return this._def.value}};JS.create=(e,t)=>new JS({value:e,typeName:vr.ZodLiteral,...Vr(t)});function F$(e,t){return new qx({values:e,typeName:vr.ZodEnum,...Vr(t)})}let qx=class sB extends Zr{constructor(){super(...arguments),m1.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),s=this._def.values;return It(r,{expected:vs.joinValues(s),received:r.parsedType,code:At.invalid_type}),Fr}if(GF(this,m1)||C$(this,m1,new Set(this._def.values)),!GF(this,m1).has(t.data)){const r=this._getOrReturnCtx(t),s=this._def.values;return It(r,{received:r.data,code:At.invalid_enum_value,options:s}),Fr}return Aa(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return sB.create(t,{...this._def,...r})}exclude(t,r=this._def){return sB.create(this.options.filter(s=>!t.includes(s)),{...this._def,...r})}};m1=new WeakMap;qx.create=F$;let qS=class extends Zr{constructor(){super(...arguments),v1.set(this,void 0)}_parse(e){const t=vs.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Gt.string&&r.parsedType!==Gt.number){const s=vs.objectValues(t);return It(r,{expected:vs.joinValues(s),received:r.parsedType,code:At.invalid_type}),Fr}if(GF(this,v1)||C$(this,v1,new Set(vs.getValidEnumValues(this._def.values))),!GF(this,v1).has(e.data)){const s=vs.objectValues(t);return It(r,{received:r.data,code:At.invalid_enum_value,options:s}),Fr}return Aa(e.data)}get enum(){return this._def.values}};v1=new WeakMap;qS.create=(e,t)=>new qS({values:e,typeName:vr.ZodNativeEnum,...Vr(t)});class Tw extends Zr{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Gt.promise&&r.common.async===!1)return It(r,{code:At.invalid_type,expected:Gt.promise,received:r.parsedType}),Fr;const s=r.parsedType===Gt.promise?r.data:Promise.resolve(r.data);return Aa(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Tw.create=(e,t)=>new Tw({type:e,typeName:vr.ZodPromise,...Vr(t)});class ad extends Zr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===vr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=this._def.effect||null,i={addIssue:o=>{It(s,o),o.fatal?r.abort():r.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const o=n.transform(s.data,i);if(s.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return Fr;const l=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return l.status==="aborted"?Fr:l.status==="dirty"||r.value==="dirty"?HF(l.value):l});{if(r.value==="aborted")return Fr;const a=this._def.schema._parseSync({data:o,path:s.path,parent:s});return a.status==="aborted"?Fr:a.status==="dirty"||r.value==="dirty"?HF(a.value):a}}if(n.type==="refinement"){const o=a=>{const l=n.refinement(a,i);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?Fr:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?Fr:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!VS(o))return o;const a=n.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>VS(o)?Promise.resolve(n.transform(o.value,i)).then(a=>({status:r.value,value:a})):o);vs.assertNever(n)}}ad.create=(e,t,r)=>new ad({schema:e,typeName:vr.ZodEffects,effect:t,...Vr(r)});ad.createWithPreprocess=(e,t,r)=>new ad({schema:t,effect:{type:"preprocess",transform:e},typeName:vr.ZodEffects,...Vr(r)});let Mh=class extends Zr{_parse(e){return this._getType(e)===Gt.undefined?Aa(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mh.create=(e,t)=>new Mh({innerType:e,typeName:vr.ZodOptional,...Vr(t)});class bA extends Zr{_parse(t){return this._getType(t)===Gt.null?Aa(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}bA.create=(e,t)=>new bA({innerType:e,typeName:vr.ZodNullable,...Vr(t)});let ex=class extends Zr{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===Gt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};ex.create=(e,t)=>new ex({innerType:e,typeName:vr.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Vr(t)});let tx=class extends Zr{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return zS(s)?s.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Wl(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wl(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};tx.create=(e,t)=>new tx({innerType:e,typeName:vr.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Vr(t)});let zF=class extends Zr{_parse(e){if(this._getType(e)!==Gt.nan){const t=this._getOrReturnCtx(e);return It(t,{code:At.invalid_type,expected:Gt.nan,received:t.parsedType}),Fr}return{status:"valid",value:e.data}}};zF.create=e=>new zF({typeName:vr.ZodNaN,...Vr(e)});const tke=Symbol("zod_brand");let v5=class extends Zr{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};class e3 extends Zr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Fr:n.status==="dirty"?(r.dirty(),HF(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Fr:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,r){return new e3({in:t,out:r,typeName:vr.ZodPipeline})}}let rx=class extends Zr{_parse(e){const t=this._def.innerType._parse(e),r=s=>(VS(s)&&(s.value=Object.freeze(s.value)),s);return zS(t)?t.then(s=>r(s)):r(t)}unwrap(){return this._def.innerType}};rx.create=(e,t)=>new rx({innerType:e,typeName:vr.ZodReadonly,...Vr(t)});function R$(e,t={},r){return e?Rw.create().superRefine((s,n)=>{var i,o;if(!e(s)){const a=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,l=(o=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...c,fatal:l})}}):Rw.create()}const rke={object:Jc.lazycreate};var vr;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(vr||(vr={}));const ske=(e,t={message:`Input not instance of ${e.name}`})=>R$(r=>r instanceof e,t),T$=Qu.create,D$=QS.create,nke=zF.create,ike=wA.create,M$=US.create,oke=WS.create,ake=OF.create,lke=jS.create,cke=KS.create,uke=Rw.create,dke=uv.create,hke=mg.create,pke=NF.create,gke=Ju.create,fke=Jc.create,Ake=Jc.strictCreate,mke=YS.create,vke=x$.create,Cke=ZS.create,wke=yA.create,yke=XS.create,bke=_F.create,Ske=VF.create,xke=sw.create,Eke=$S.create,Pke=JS.create,Fke=qx.create,Rke=qS.create,Tke=Tw.create,JG=ad.create,Dke=Mh.create,Mke=bA.create,Ike=ad.createWithPreprocess,kke=e3.create,Bke=()=>T$().optional(),Lke=()=>D$().optional(),Hke=()=>M$().optional(),Gke={string:e=>Qu.create({...e,coerce:!0}),number:e=>QS.create({...e,coerce:!0}),boolean:e=>US.create({...e,coerce:!0}),bigint:e=>wA.create({...e,coerce:!0}),date:e=>WS.create({...e,coerce:!0})},Oke=Fr;var cs=Object.freeze({__proto__:null,defaultErrorMap:Fw,setErrorMap:OIe,getErrorMap:BF,makeIssue:LF,EMPTY_PATH:NIe,addIssueToContext:It,ParseStatus:Oo,INVALID:Fr,DIRTY:HF,OK:Aa,isAborted:Jk,isDirty:qk,isValid:VS,isAsync:zS,get util(){return vs},get objectUtil(){return $k},ZodParsedType:Gt,getParsedType:Zf,ZodType:Zr,datetimeRegex:b$,ZodString:Qu,ZodNumber:QS,ZodBigInt:wA,ZodBoolean:US,ZodDate:WS,ZodSymbol:OF,ZodUndefined:jS,ZodNull:KS,ZodAny:Rw,ZodUnknown:uv,ZodNever:mg,ZodVoid:NF,ZodArray:Ju,ZodObject:Jc,ZodUnion:YS,ZodDiscriminatedUnion:x$,ZodIntersection:ZS,ZodTuple:yA,ZodRecord:XS,ZodMap:_F,ZodSet:VF,ZodFunction:sw,ZodLazy:$S,ZodLiteral:JS,ZodEnum:qx,ZodNativeEnum:qS,ZodPromise:Tw,ZodEffects:ad,ZodTransformer:ad,ZodOptional:Mh,ZodNullable:bA,ZodDefault:ex,ZodCatch:tx,ZodNaN:zF,BRAND:tke,ZodBranded:v5,ZodPipeline:e3,ZodReadonly:rx,custom:R$,Schema:Zr,ZodSchema:Zr,late:rke,get ZodFirstPartyTypeKind(){return vr},coerce:Gke,any:uke,array:gke,bigint:ike,boolean:M$,date:oke,discriminatedUnion:vke,effect:JG,enum:Fke,function:xke,instanceof:ske,intersection:Cke,lazy:Eke,literal:Pke,map:bke,nan:nke,nativeEnum:Rke,never:hke,null:cke,nullable:Mke,number:D$,object:fke,oboolean:Hke,onumber:Lke,optional:Dke,ostring:Bke,pipeline:kke,preprocess:Ike,promise:Tke,record:yke,set:Ske,strictObject:Ake,string:T$,symbol:ake,transformer:JG,tuple:wke,undefined:lke,union:mke,unknown:dke,void:pke,NEVER:Oke,ZodIssueCode:At,quotelessJson:GIe,ZodError:Wl});function Nke(e){throw new Error("Unexpected object: "+e)}const I$="upload://upload/",k$="index://index/";function _ke(e){return e.startsWith(I$)}function Vke(e){return e.startsWith(k$)}function B$(e){if(Vke(e)){const t=e.slice(k$.length);return JSON.parse(decodeURIComponent(t)).path}else if(_ke(e)){const t=e.slice(I$.length);return JSON.parse(decodeURIComponent(t)).localPath}Nke(e)}function zke(e){return e.replace(/^.*[\\/]/,"")}function Qke(e){return zke(B$(e))}cs.object({__isRef:cs.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:cs.string().describe("Upstream block id"),name:cs.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:cs.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();const Uke=24;cs.string().length(Uke).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");var qG={exports:{}};(function(e,t){t=e.exports=r,t.getSerialize=s;function r(n,i,o,a){return JSON.stringify(n,s(i,a),o)}function s(n,i){var o=[],a=[];return i==null&&(i=function(l,c){return o[0]===c?"[Circular ~]":"[Circular ~."+a.slice(0,o.indexOf(c)).join(".")+"]"}),function(l,c){if(o.length>0){var u=o.indexOf(this);~u?o.splice(u+1):o.push(this),~u?a.splice(u,1/0,l):a.push(l),~o.indexOf(c)&&(c=i.call(this,l,c))}else o.push(c);return n==null?c:n.call(this,l,c)}}})(qG,qG.exports);const Wke=cs.object({type:cs.literal("PlError"),name:cs.string(),message:cs.string(),fullMessage:cs.string().optional(),stack:cs.string().optional()}),jke=Wke.extend({cause:cs.lazy(()=>QF).optional(),errors:cs.lazy(()=>QF.array()).optional()}),Kke=cs.object({type:cs.literal("StandardError"),name:cs.string(),message:cs.string(),stack:cs.string().optional()}),Yke=Kke.extend({cause:cs.lazy(()=>QF).optional(),errors:cs.lazy(()=>QF.array()).optional()}),QF=cs.union([Yke,jke]),Zke=cs.object({name:cs.string(),message:cs.string(),fullMessage:cs.string().optional(),stack:cs.string().optional()}),eO=Zke.extend({cause:cs.lazy(()=>eO).optional(),errors:cs.lazy(()=>eO.array()).optional()});function Xke(e){if(e&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(e);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const $ke=cs.object({type:cs.string(),importance:cs.number().optional(),id:cs.string().optional(),label:cs.string()});cs.array($ke);const Jke="1.31.15";function tA(){return Xke({sdkVersion:Jke})}const qke="[==PROGRESS==]";function eBe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tBe(e){const t=br(),r=oi({errorCount:0});async function s(){var i;let o=t.value;if(o===void 0)return;const a=e.mockPlatforma??tA();if(!a){console.warn("Platforma API is not available");return}for(;;){const l=await a.logDriver.readText(o.logHandle,100,o.lastOffset);if(o.error=void 0,r.errorCount=0,l.shouldUpdateHandle||o.logHandle!==((i=t.value)==null?void 0:i.logHandle))return;const c=e.progressPrefix??qke,u=new TextDecoder().decode(l.data).replace(new RegExp(`${eBe(c)}`,"g"),"");if(o=Object.assign(o,{lines:o.lines+u,lastOffset:l.newOffset,finished:!l.live}),l.newOffset>=l.size)break}}const n=HIe(()=>s().catch(i=>{t.value&&(r.errorCount++,r.errorCount>(e.maxRetries??3)?t.value.error=i:console.warn("skip error:",i,"retry..."))}),1500,{immediate:!1});return LIe(()=>{var i;return(i=t==null?void 0:t.value)==null?void 0:i.finished},()=>n.pause()),tn(()=>e.logHandle,i=>{var o;i===void 0?(t.value=void 0,n.pause()):i!==((o=t.value)==null?void 0:o.logHandle)&&(t.value={logHandle:i,lastOffset:0,lines:"",finished:!1,error:void 0},r.errorCount=0,n.resume())},{immediate:!0}),t}const rBe={key:0},sBe={class:"pl-log-view__copy"},nBe={key:1,class:"pl-log-view__error"},iBe={name:"PlLogView"},oBe=Tr({...iBe,props:{value:{},valueToCopy:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{},disableAutoScroll:{type:Boolean}},setup(e){const t=v=>{if(v&&v.ok===!1)return v.errors.join(`
703
- `)},r=dd(),s=e,n=tBe(s),i=br(!0),o=br(),a=br(),l=Je(()=>{var v;return((v=n.value)==null?void 0:v.error)??s.error??t(s.output)}),c=Je(()=>{var v;return((v=n.value)==null?void 0:v.lines)??s.value??RDe(s.output)}),u=br(!1);Jx(a);const d=Je(()=>u.value?"clipboard-copied":"clipboard"),g=()=>{u.value=!0,setTimeout(()=>{u.value=!1},1200);let v;s.valueToCopy?v=s.valueToCopy:c.value&&typeof c.value=="string"&&(v=c.value),v!==void 0&&navigator.clipboard.writeText(v)},A=()=>{s.disableAutoScroll||p5(o.value,v=>{i.value&&v.scrollTo(v.scrollLeft,v.scrollHeight)})};tn(c,()=>{requestAnimationFrame(()=>{A()})},{immediate:!0});const w=v=>{const b=v.target;i.value=b.scrollTop+20>=b.scrollHeight-b.offsetHeight};return(v,b)=>(ye(),je("div",{ref_key:"root",ref:a,class:St(["pl-log-view",{"has-error":l.value}])},[v.label?(ye(),je("label",rBe,[We("span",null,Zt(v.label),1),b[0]||(b[0]=Ne()),Pe(r).tooltip?(ye(),jt(Pe(_h),{key:0,class:"info",position:"top"},{tooltip:er(()=>[jr(v.$slots,"tooltip")]),_:3})):yt("",!0)])):yt("",!0),b[2]||(b[2]=Ne()),zt($x,{class:"pl-log-view__contour"}),b[3]||(b[3]=Ne()),We("div",sBe,[zt(Pe(_h),{"close-delay":800,position:"top"},{tooltip:er(()=>[Ne(Zt(u.value?"copied":"copy"),1)]),default:er(()=>[zt(Pe(Vc),{title:"Copy content",name:d.value,onClick:g},null,8,["name"]),b[1]||(b[1]=Ne())]),_:1})]),b[4]||(b[4]=Ne()),l.value?(ye(),je("div",nBe,Zt(l.value),1)):(ye(),je("div",{key:2,ref_key:"contentRef",ref:o,class:"pl-log-view__content",onScroll:w},Zt(c.value),545))],2))}}),aBe="_component_1uz6e_1",lBe="_local_1uz6e_1",cBe="_supported_1uz6e_26",uBe="_remote_1uz6e_32",dBe="_search_1uz6e_40",hBe="_selected_1uz6e_72",pBe="_breadcrumbs_1uz6e_86",gBe="_cat_1uz6e_116",fBe="_message_1uz6e_122",ABe="_isFile_1uz6e_196",mBe="_isDir_1uz6e_200",vBe="_canBeSelected_1uz6e_206",CBe="_spin_1uz6e_1",ni={component:aBe,local:lBe,supported:cBe,remote:uBe,search:dBe,"ls-container":"_ls-container_1uz6e_50","ls-head":"_ls-head_1uz6e_57",selected:hBe,breadcrumbs:pBe,"ls-error":"_ls-error_1uz6e_108",cat:gBe,message:fBe,"ls-empty":"_ls-empty_1uz6e_131","ls-body":"_ls-body_1uz6e_152",isFile:ABe,isDir:mBe,canBeSelected:vBe,"ls-loader":"_ls-loader_1uz6e_212","loader-icon":"_loader-icon_1uz6e_220",spin:CBe},wBe=Tr({__name:"Shortcuts",setup(e){return(t,r)=>(ye(),jt(Pe(_h),{class:"info",position:"southwest","max-width":"420px"},{tooltip:er(()=>[We("span",{class:St(t.$style.title)},"Shortcuts",2),r[2]||(r[2]=Ne()),We("div",{class:St([t.$style.row,t.$style.head])},r[0]||(r[0]=[We("div",null,null,-1),Ne(),We("div",null,"MacOS",-1),Ne(),We("div",null,"Windows/Linux",-1)]),2),r[3]||(r[3]=Ne()),We("div",{class:St([t.$style.row,t.$style.body])},r[1]||(r[1]=[We("div",null,"Single File",-1),Ne(),We("div",null,"Click the file",-1),Ne(),We("div",null,"Click the file",-1),Ne(),We("div",null,"Adjacent multiple files",-1),Ne(),We("div",null,"Hold Shift, click first and last files",-1),Ne(),We("div",null,"Hold Shift, click first and last files",-1),Ne(),We("div",null,"Non-adjacent multiple files",-1),Ne(),We("div",null,"Hold Command (⌘), click each file",-1),Ne(),We("div",null,"Hold Ctrl, click each file",-1),Ne(),We("div",null,"All files",-1),Ne(),We("div",null,"Press Command (⌘) + A",-1),Ne(),We("div",null,"Press Ctrl + A",-1)]),2)]),_:1}))}}),yBe="_title_14dct_2",bBe="_row_14dct_10",SBe="_head_14dct_30",xBe="_body_14dct_58",EBe={title:yBe,row:bBe,head:SBe,body:xBe},PBe={$style:EBe},FBe=$h(wBe,[["__cssModules",PBe]]),tO=()=>({dirPath:"",search:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1});function RBe(e){return Je(()=>{let t=e.items;if(e.showHiddenItems||(t=t.filter(r=>!r.name.startsWith("."))),e.search){const r=e.search.toLocaleLowerCase();t=t.filter(s=>s.name.toLocaleLowerCase().includes(r))}return t})}const rO={mounted:e=>{if(e.clientWidth<e.scrollWidth){const t=e.innerText;e.innerText=t.substring(0,57)+"..."+t.substring(t.length-10)}}};function L$(e){return e?e.map(t=>"."+DDe(t,["."])):void 0}function TBe(e){const t="/",r=e.startsWith(t),s=TDe(e,[t]).split(t),n=[{index:0,name:"Root",path:""}];if(s.length===1&&s[0]==="")return n;for(let i=0;i<s.length;i++){const o=(r?t:"")+s.slice(0,i+1).join(t);n.push({index:i+1,name:s[i],path:o})}return n}const DBe=["title","onClick"],MBe={key:0,class:"ls-loader"},IBe=["onClick"],kBe=["title"],BBe=["onClick"],LBe=["title"],HBe=Tr({__name:"Remote",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},submit:{}},emits:["update:modelValue","import:files"],setup(e,{expose:t}){const r=D=>D.ctrlKey||D.metaKey,s=e,n=oi(tO()),i=()=>{n.search="",n.error="",n.lastSelected=void 0},o=Je(()=>L$(s.extensions)),a=RBe(n),l=Je(()=>{var D;return{modelValue:s.modelValue,dirPath:n.dirPath,storageHandle:(D=n.storageEntry)==null?void 0:D.handle}}),c=(D,B)=>{tA()&&n.currentLoadingPath!==B&&(n.currentLoadingPath=B,tA().lsDriver.listFiles(D,B).then(k=>{B===n.dirPath&&(n.items=NS(k).entries.map(z=>({path:z.fullPath,name:z.name,isDir:z.type==="dir",canBeSelected:z.type==="file"&&(!o.value||o.value.some(O=>z.fullPath.endsWith(O))),handle:z.type==="file"?z.handle:void 0,selected:!1})).sort((z,O)=>z.isDir&&!O.isDir?-1:!z.isDir&&O.isDir?1:z.name.localeCompare(O.name)).map((z,O)=>({id:O,...z})),n.lastSelected=void 0)}).catch(k=>n.error=String(k)).finally(()=>{n.currentLoadingPath=void 0}))},u=()=>{i();const{storageHandle:D,dirPath:B,modelValue:k}=l.value;D&&k&&c(D,B)},d=Je(()=>TBe(n.dirPath)),g=Je(()=>n.items.filter(D=>D.canBeSelected&&D.selected&&!D.isDir)),A=Je(()=>{var D;return g.value.length>0&&((D=n.storageEntry)==null?void 0:D.handle)}),w=()=>{var D;return{storageHandle:NS((D=n.storageEntry)==null?void 0:D.handle),files:g.value.map(B=>B.handle)}},v=D=>{n.dirPath=D},b=(D,B)=>{const{shiftKey:k}=D,z=r(D),{lastSelected:O}=n;D.preventDefault();const j=a.value;if(B.canBeSelected){if(s.multi||j.forEach(_=>_.selected=!1),B.selected=!B.selected,!s.multi)return;!z&&!k&&j.forEach(_=>{_.id!==B.id&&(_.selected=!1)}),k&&O!==void 0&&j.forEach(_=>{FDe(_.id,O,B.id)&&(_.selected=!0)}),B.selected&&(n.lastSelected=B.id)}},S=D=>{D&&!s.multi||a.value.filter(B=>B.canBeSelected).forEach(B=>{B.selected=D})},P=()=>S(!0),F=()=>S(!1),T=()=>{if(i(),F(),!tA()){console.warn("platforma API is not found");return}tA().lsDriver.getStorageList().then(D=>{D=D.filter(B=>B.name!=="local"&&!B.name.startsWith("local_disk_")),n.storageOptions=D.map(B=>({text:B.name,value:B})),s.autoSelectStorage&&p5(D[0],B=>{n.storageEntry=B})}).catch(D=>n.error=String(D))};return tn(I7(n,"storageEntry"),D=>{i(),n.dirPath=(D==null?void 0:D.initialFullPath)??""},{immediate:!0}),tn([()=>n.dirPath,()=>n.storageEntry],()=>{u()}),tn(()=>s.modelValue,D=>{D?T():Object.assign(n,tO())},{immediate:!0}),cv(document,"keydown",D=>{if(!s.modelValue||D.target!==document.body)return;const B=r(D);B&&D.code==="KeyA"&&(D.preventDefault(),P()),B&&D.shiftKey&&D.code==="Period"&&(D.preventDefault(),n.showHiddenItems=!n.showHiddenItems),D.code==="Enter"&&s.submit()}),t({isReady:A,getFilesToImport:w}),Yh(T),(D,B)=>(ye(),je("div",{class:St(Pe(ni).remote),onClick:Nn(F,["stop"])},[We("div",{class:St(Pe(ni).search)},[We("div",null,[zt(Pe(g$),{modelValue:n.storageEntry,"onUpdate:modelValue":B[0]||(B[0]=k=>n.storageEntry=k),label:"Select storage",options:n.storageOptions},null,8,["modelValue","options"])]),B[2]||(B[2]=Ne()),We("div",null,[zt(Pe(G4e),{modelValue:n.search,"onUpdate:modelValue":B[1]||(B[1]=k=>n.search=k),label:"Search in folder",clearable:""},null,8,["modelValue"])])],2),B[12]||(B[12]=Ne()),We("div",{class:St(Pe(ni)["ls-container"])},[We("div",{class:St(Pe(ni)["ls-head"])},[We("div",{class:St(Pe(ni).breadcrumbs)},[(ye(!0),je(_s,null,Fh(d.value,(k,z)=>(ye(),je(_s,{key:z},[We("div",{title:k.path,onClick:O=>v(k.path)},Zt(k.name),9,DBe),B[3]||(B[3]=Ne()),k.index!==d.value.length-1?(ye(),jt(Pe(_S),{key:0,name:"chevron-right"})):yt("",!0)],64))),128))],2),B[5]||(B[5]=Ne()),We("div",{class:St(Pe(ni).selected)},[We("span",null,"Selected: "+Zt(g.value.length),1),B[4]||(B[4]=Ne()),zt(FBe)],2)],2),B[11]||(B[11]=Ne()),n.currentLoadingPath!==void 0?(ye(),je("div",MBe,B[6]||(B[6]=[We("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):n.storageEntry?n.error?(ye(),je("div",{key:2,class:St(Pe(ni)["ls-error"])},[We("div",{class:St(Pe(ni).cat)},null,2),B[8]||(B[8]=Ne()),We("div",{class:St(Pe(ni).message)},Zt(n.error),3)],2)):(ye(),je("div",{key:3,class:St(Pe(ni)["ls-body"])},[(ye(!0),je(_s,null,Fh(Pe(a),k=>(ye(),je(_s,{key:k.id},[k.isDir?(ye(),je("div",{key:0,class:St(Pe(ni).isDir),onClick:z=>v(k.path)},[zt(Pe(_S),{name:"chevron-right"}),B[9]||(B[9]=Ne()),Av((ye(),je("span",{title:k.name},[Ne(Zt(k.name),1)],8,kBe)),[[Pe(rO)]])],10,IBe)):(ye(),je("div",{key:1,class:St({[Pe(ni).canBeSelected]:k.canBeSelected,[Pe(ni).selected]:k.selected}),onClick:Nn(z=>b(z,k),["stop"])},[zt(Pe(Zk),{name:"box",class:St(Pe(ni).isFile)},null,8,["class"]),B[10]||(B[10]=Ne()),Av((ye(),je("span",{title:k.name},[Ne(Zt(k.name),1)],8,LBe)),[[Pe(rO)]])],10,BBe))],64))),128))],2)):(ye(),je("div",{key:1,class:St(Pe(ni)["ls-empty"])},[We("div",{class:St(Pe(ni).cat)},null,2),B[7]||(B[7]=Ne()),We("div",{class:St(Pe(ni).message)},"Select storage to preview",2)],2))],2)],2))}}),GBe={key:1,class:"alert-error"},OBe=Tr({__name:"Local",props:{importFiles:{type:Function},multi:{type:Boolean},extensions:{}},setup(e){const t=e,r=oi({error:void 0}),s=Je(()=>t.multi?"Drag & Drop files here or click to add":"Drag & Drop file here or click to add"),n=async o=>{var a,l,c;const u=(l=(a=tA())==null?void 0:a.lsDriver)==null?void 0:l.fileToImportHandle;if(!u)return console.error("API getPlatformaRawInstance().lsDriver.fileToImportHandle is not available");const d=L$(t.extensions),g=await Promise.all([...((c=o.dataTransfer)==null?void 0:c.files)??[]].filter(A=>!!A).filter(A=>d?d.some(w=>A.name.endsWith(w)):!0).map(A=>u(A)));g.length&&t.importFiles({files:g})},i=async()=>{var o,a;const l=t.extensions?[{name:"All Files",extensions:t.extensions}]:[];t.multi?(o=tA())==null||o.lsDriver.showOpenMultipleFilesDialog({title:"Select files to import",filters:l}).then(({files:c})=>{c&&t.importFiles({files:c})}).catch(c=>r.error=c):(a=tA())==null||a.lsDriver.showOpenSingleFileDialog({title:"Select file to import",filters:l}).then(({file:c})=>{c&&t.importFiles({files:[c]})}).catch(c=>r.error=c)};return(o,a)=>(ye(),je("div",{class:St(Pe(ni).local),onDrop:n,onDragover:a[0]||(a[0]=Nn(()=>{},["prevent"])),onClick:i},[zt(Pe(m5),{name:"cloud-upload"}),a[1]||(a[1]=Ne()),We("span",null,Zt(s.value),1),a[2]||(a[2]=Ne()),o.extensions?(ye(),je("span",{key:0,class:St(Pe(ni).supported)},"Supported formats: "+Zt(o.extensions.join(", ")),3)):yt("",!0),a[3]||(a[3]=Ne()),r.error?(ye(),je("span",GBe,Zt(r.error),1)):yt("",!0)],34))}}),NBe={style:{margin:"0 24px"}},H$=Tr({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(e,{emit:t}){const r=t,s=e,n=br("local"),i=Je(()=>s.multi?"Select Files to Import":"Select File to Import"),o=[{label:"My Computer",value:"local"},{label:"Remote",value:"remote"}],a=()=>r("update:modelValue",!1),l=B7("remote"),c=()=>{var d,g;(d=l.value)!=null&&d.isReady&&(r("import:files",NS((g=l.value)==null?void 0:g.getFilesToImport())),a())},u=d=>{r("import:files",d),a()};return(d,g)=>(ye(),jt(Pe(f$),{"no-content-gutters":!0,"close-on-outside-click":d.closeOnOutsideClick,class:St(["pl-dialog-modal",Pe(ni).component]),"model-value":d.modelValue,width:"688px",height:"720px","onUpdate:modelValue":a},UU({title:er(()=>[Ne(Zt(d.title??i.value),1)]),default:er(()=>[g[4]||(g[4]=Ne()),We("div",NBe,[zt(Pe(i4e),{modelValue:n.value,"onUpdate:modelValue":g[0]||(g[0]=A=>n.value=A),options:o},null,8,["modelValue"])]),g[5]||(g[5]=Ne()),n.value==="remote"?(ye(),jt(HBe,dl({key:0,ref:"remote"},d.$props,{submit:c}),null,16)):yt("",!0),g[6]||(g[6]=Ne()),n.value==="local"?(ye(),jt(OBe,dl({key:1,"import-files":u},d.$props),null,16)):yt("",!0),g[7]||(g[7]=Ne())]),_:2},[n.value==="remote"?{name:"actions",fn:er(()=>{var A;return[zt(Pe(kF),{style:{"min-width":"160px"},disabled:!((A=Pe(l))!=null&&A.isReady),onClick:Nn(c,["stop"])},{default:er(()=>g[1]||(g[1]=[Ne("Import")])),_:1},8,["disabled"]),g[3]||(g[3]=Ne()),zt(Pe(g5),{"justify-center":!1,onClick:Nn(a,["stop"])},{default:er(()=>g[2]||(g[2]=[Ne("Cancel")])),_:1})]}),key:"0"}:void 0]),1032,["close-on-outside-click","class","model-value"]))}}),_Be={key:0,ref:"label"},VBe={key:0,class:"required-icon"},zBe=["data-placeholder"],QBe={key:5,class:"pl-file-input__stats"},UBe={key:0,class:"pl-file-input__error"},WBe={key:1,class:"pl-file-input__helper"},jBe=Tr({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},cellStyle:{type:Boolean,default:!1},fileDialogTitle:{default:void 0},fileDialogCloseOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const r=oi({fileDialogOpen:!1,error:""}),s=dd(),n=t,i=e,o=(F,T)=>{if(F)try{return T(F)}catch(D){return r.error=D instanceof Error?D.message:String(D),F}},a=Je(()=>o(i.modelValue,Qke)),l=Je(()=>o(i.modelValue,B$)),c=Je(()=>i.progress&&!i.progress.done),u=Je(()=>i.progress&&i.progress.done),d=Je(()=>r.error??i.error),g=Je(()=>!!d.value),A=Je(()=>{const{status:F,done:T}=i.progress??{};return!F||!F.bytesTotal?"":F.bytesProcessed&&!T?l4(F.bytesProcessed,{})+" / "+l4(F.bytesTotal,{}):l4(F.bytesTotal,{})}),w=Je(()=>{var F;const{progress:T}=i;return T?{width:T.done?"100%":Math.round((((F=T.status)==null?void 0:F.progress)??0)*100)+"%"}:{}}),v=()=>{r.fileDialogOpen=!0},b=F=>{F.files.length&&n("update:modelValue",F.files[0])},S=()=>n("update:modelValue",void 0);tn(()=>i.modelValue,()=>{r.error=""},{immediate:!0});const P=br();return i.cellStyle||Jx(P),(F,T)=>(ye(),je(_s,null,[We("div",{class:St([{"pl-file-input__cell-style":!!F.cellStyle,"has-file":!!a.value},"pl-file-input__envelope"])},[We("div",{ref_key:"rootRef",ref:P,class:St(["pl-file-input",{dashed:F.dashed,error:g.value}]),tabindex:"0",onKeyup:dw(v,["enter"]),onClick:Nn(v,["stop"])},[We("div",{class:"pl-file-input__progress",style:oo(w.value)},null,4),T[3]||(T[3]=Ne()),!F.cellStyle&&F.label?(ye(),je("label",_Be,[F.required?(ye(),je("i",VBe)):yt("",!0),T[1]||(T[1]=Ne()),We("span",null,Zt(F.label),1),T[2]||(T[2]=Ne()),Pe(s).tooltip||l.value?(ye(),jt(Pe(_h),{key:1,class:"info",position:"top"},{tooltip:er(()=>[Pe(s).tooltip?jr(F.$slots,"tooltip",{key:0}):(ye(),je(_s,{key:1},[Ne(Zt(l.value),1)],64))]),_:3})):yt("",!0)],512)):yt("",!0),T[4]||(T[4]=Ne()),g.value?(ye(),jt(Pe(Vc),{key:1,name:"restart"})):c.value?(ye(),jt(Pe(Vc),{key:2,name:"cloud-upload"})):u.value?(ye(),jt(Pe(Vc),{key:3,name:"success"})):(ye(),jt(Pe(Vc),{key:4,name:"paper-clip"})),T[5]||(T[5]=Ne()),We("div",{"data-placeholder":F.placeholder??"Choose file",class:"pl-file-input__filename"},Zt(a.value),9,zBe),T[6]||(T[6]=Ne()),A.value?(ye(),je("div",QBe,Zt(A.value),1)):yt("",!0),T[7]||(T[7]=Ne()),F.modelValue?(ye(),jt(Pe(Vc),{key:6,name:"close",onClick:Nn(S,["stop"])})):yt("",!0),T[8]||(T[8]=Ne()),zt($x,{class:"pl-file-input__contour"})],34),T[9]||(T[9]=Ne()),g.value?(ye(),je("div",UBe,Zt(d.value),1)):F.helper?(ye(),je("div",WBe,Zt(F.helper),1)):yt("",!0)],2),T[10]||(T[10]=Ne()),zt(Pe(H$),{modelValue:r.fileDialogOpen,"onUpdate:modelValue":T[0]||(T[0]=D=>r.fileDialogOpen=D),extensions:F.extensions,title:F.fileDialogTitle,"close-on-outside-click":F.fileDialogCloseOnOutsideClick,"onImport:files":b},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),KBe={class:"pl-notification-alert__wrapper d-flex text-s"},YBe={class:"pl-notification-alert__content flex-grow-1"},ZBe={key:0,class:"pl-notification-alert__close"},XBe={key:0,class:"pl-notification-alert__actions d-flex"},$Be=Tr({__name:"PlNotificationAlert",props:KU({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,r=lW(e,"modelValue");function s(){t.closable&&(r.value=!1)}return(n,i)=>r.value?(ye(),je("div",{key:0,class:St([n.type,"pl-notification-alert d-flex flex-column gap-16"]),style:oo({width:`${n.width}`})},[We("div",KBe,[We("div",YBe,[jr(n.$slots,"default")]),i[0]||(i[0]=Ne()),n.closable?(ye(),je("div",ZBe,[zt(Pe(g5),{icon:"close",onClick:Nn(s,["stop"])})])):yt("",!0)]),i[1]||(i[1]=Ne()),n.$slots.actions?(ye(),je("div",XBe,[jr(n.$slots,"actions")])):yt("",!0)],6)):yt("",!0)}});function S2(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function JBe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function G$(e){let t,r,s;e.length!==2?(t=S2,r=(a,l)=>S2(e(a),l),s=(a,l)=>e(a)-l):(t=e===S2||e===JBe?e:qBe,r=e,s=e);function n(a,l,c=0,u=a.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;r(a[d],l)<0?c=d+1:u=d}while(c<u)}return c}function i(a,l,c=0,u=a.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;r(a[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function o(a,l,c=0,u=a.length){const d=n(a,l,c,u-1);return d>c&&s(a[d-1],l)>-s(a[d],l)?d-1:d}return{left:n,center:o,right:i}}function qBe(){return 0}function e7e(e){return e===null?NaN:+e}G$(S2);G$(e7e).center;var t7e={value:()=>{}};function O$(){for(var e=0,t=arguments.length,r={},s;e<t;++e){if(!(s=arguments[e]+"")||s in r||/[\s.]/.test(s))throw new Error("illegal type: "+s);r[s]=[]}return new x2(r)}function x2(e){this._=e}function r7e(e,t){return e.trim().split(/^|\s+/).map(function(r){var s="",n=r.indexOf(".");if(n>=0&&(s=r.slice(n+1),r=r.slice(0,n)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:s}})}x2.prototype=O$.prototype={constructor:x2,on:function(e,t){var r=this._,s=r7e(e+"",r),n,i=-1,o=s.length;if(arguments.length<2){for(;++i<o;)if((n=(e=s[i]).type)&&(n=s7e(r[n],e.name)))return n;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(n=(e=s[i]).type)r[n]=sO(r[n],e.name,t);else if(t==null)for(n in r)r[n]=sO(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new x2(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var r=new Array(n),s=0,n,i;s<n;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,n=i.length;s<n;++s)i[s].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],n=0,i=s.length;n<i;++n)s[n].value.apply(t,r)}};function s7e(e,t){for(var r=0,s=e.length,n;r<s;++r)if((n=e[r]).name===t)return n.value}function sO(e,t,r){for(var s=0,n=e.length;s<n;++s)if(e[s].name===t){e[s]=t7e,e=e.slice(0,s).concat(e.slice(s+1));break}return r!=null&&e.push({name:t,value:r}),e}var nB="http://www.w3.org/1999/xhtml";const nO={svg:"http://www.w3.org/2000/svg",xhtml:nB,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bT(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),nO.hasOwnProperty(t)?{space:nO[t],local:e}:e}function n7e(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===nB&&t.documentElement.namespaceURI===nB?t.createElement(e):t.createElementNS(r,e)}}function i7e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function N$(e){var t=bT(e);return(t.local?i7e:n7e)(t)}function o7e(){}function C5(e){return e==null?o7e:function(){return this.querySelector(e)}}function a7e(e){typeof e!="function"&&(e=C5(e));for(var t=this._groups,r=t.length,s=new Array(r),n=0;n<r;++n)for(var i=t[n],o=i.length,a=s[n]=new Array(o),l,c,u=0;u<o;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new ld(s,this._parents)}function l7e(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function c7e(){return[]}function _$(e){return e==null?c7e:function(){return this.querySelectorAll(e)}}function u7e(e){return function(){return l7e(e.apply(this,arguments))}}function d7e(e){typeof e=="function"?e=u7e(e):e=_$(e);for(var t=this._groups,r=t.length,s=[],n=[],i=0;i<r;++i)for(var o=t[i],a=o.length,l,c=0;c<a;++c)(l=o[c])&&(s.push(e.call(l,l.__data__,c,o)),n.push(l));return new ld(s,n)}function V$(e){return function(){return this.matches(e)}}function z$(e){return function(t){return t.matches(e)}}var h7e=Array.prototype.find;function p7e(e){return function(){return h7e.call(this.children,e)}}function g7e(){return this.firstElementChild}function f7e(e){return this.select(e==null?g7e:p7e(typeof e=="function"?e:z$(e)))}var A7e=Array.prototype.filter;function m7e(){return Array.from(this.children)}function v7e(e){return function(){return A7e.call(this.children,e)}}function C7e(e){return this.selectAll(e==null?m7e:v7e(typeof e=="function"?e:z$(e)))}function w7e(e){typeof e!="function"&&(e=V$(e));for(var t=this._groups,r=t.length,s=new Array(r),n=0;n<r;++n)for(var i=t[n],o=i.length,a=s[n]=[],l,c=0;c<o;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new ld(s,this._parents)}function Q$(e){return new Array(e.length)}function y7e(){return new ld(this._enter||this._groups.map(Q$),this._parents)}function UF(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}UF.prototype={constructor:UF,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function b7e(e){return function(){return e}}function S7e(e,t,r,s,n,i){for(var o=0,a,l=t.length,c=i.length;o<c;++o)(a=t[o])?(a.__data__=i[o],s[o]=a):r[o]=new UF(e,i[o]);for(;o<l;++o)(a=t[o])&&(n[o]=a)}function x7e(e,t,r,s,n,i,o){var a,l,c=new Map,u=t.length,d=i.length,g=new Array(u),A;for(a=0;a<u;++a)(l=t[a])&&(g[a]=A=o.call(l,l.__data__,a,t)+"",c.has(A)?n[a]=l:c.set(A,l));for(a=0;a<d;++a)A=o.call(e,i[a],a,i)+"",(l=c.get(A))?(s[a]=l,l.__data__=i[a],c.delete(A)):r[a]=new UF(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(g[a])===l&&(n[a]=l)}function E7e(e){return e.__data__}function P7e(e,t){if(!arguments.length)return Array.from(this,E7e);var r=t?x7e:S7e,s=this._parents,n=this._groups;typeof e!="function"&&(e=b7e(e));for(var i=n.length,o=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=s[c],d=n[c],g=d.length,A=F7e(e.call(u,u&&u.__data__,c,s)),w=A.length,v=a[c]=new Array(w),b=o[c]=new Array(w),S=l[c]=new Array(g);r(u,d,v,b,S,A,t);for(var P=0,F=0,T,D;P<w;++P)if(T=v[P]){for(P>=F&&(F=P+1);!(D=b[F])&&++F<w;);T._next=D||null}}return o=new ld(o,s),o._enter=a,o._exit=l,o}function F7e(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function R7e(){return new ld(this._exit||this._groups.map(Q$),this._parents)}function T7e(e,t,r){var s=this.enter(),n=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(n=t(n),n&&(n=n.selection())),r==null?i.remove():r(i),s&&n?s.merge(n).order():n}function D7e(e){for(var t=e.selection?e.selection():e,r=this._groups,s=t._groups,n=r.length,i=s.length,o=Math.min(n,i),a=new Array(n),l=0;l<o;++l)for(var c=r[l],u=s[l],d=c.length,g=a[l]=new Array(d),A,w=0;w<d;++w)(A=c[w]||u[w])&&(g[w]=A);for(;l<n;++l)a[l]=r[l];return new ld(a,this._parents)}function M7e(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var s=e[t],n=s.length-1,i=s[n],o;--n>=0;)(o=s[n])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function I7e(e){e||(e=k7e);function t(d,g){return d&&g?e(d.__data__,g.__data__):!d-!g}for(var r=this._groups,s=r.length,n=new Array(s),i=0;i<s;++i){for(var o=r[i],a=o.length,l=n[i]=new Array(a),c,u=0;u<a;++u)(c=o[u])&&(l[u]=c);l.sort(t)}return new ld(n,this._parents).order()}function k7e(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function B7e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function L7e(){return Array.from(this)}function H7e(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],n=0,i=s.length;n<i;++n){var o=s[n];if(o)return o}return null}function G7e(){let e=0;for(const t of this)++e;return e}function O7e(){return!this.node()}function N7e(e){for(var t=this._groups,r=0,s=t.length;r<s;++r)for(var n=t[r],i=0,o=n.length,a;i<o;++i)(a=n[i])&&e.call(a,a.__data__,i,n);return this}function _7e(e){return function(){this.removeAttribute(e)}}function V7e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function z7e(e,t){return function(){this.setAttribute(e,t)}}function Q7e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function U7e(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function W7e(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function j7e(e,t){var r=bT(e);if(arguments.length<2){var s=this.node();return r.local?s.getAttributeNS(r.space,r.local):s.getAttribute(r)}return this.each((t==null?r.local?V7e:_7e:typeof t=="function"?r.local?W7e:U7e:r.local?Q7e:z7e)(r,t))}function U$(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function K7e(e){return function(){this.style.removeProperty(e)}}function Y7e(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Z7e(e,t,r){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,r)}}function X7e(e,t,r){return arguments.length>1?this.each((t==null?K7e:typeof t=="function"?Z7e:Y7e)(e,t,r??"")):Dw(this.node(),e)}function Dw(e,t){return e.style.getPropertyValue(t)||U$(e).getComputedStyle(e,null).getPropertyValue(t)}function $7e(e){return function(){delete this[e]}}function J7e(e,t){return function(){this[e]=t}}function q7e(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function eLe(e,t){return arguments.length>1?this.each((t==null?$7e:typeof t=="function"?q7e:J7e)(e,t)):this.node()[e]}function W$(e){return e.trim().split(/^|\s+/)}function w5(e){return e.classList||new j$(e)}function j$(e){this._node=e,this._names=W$(e.getAttribute("class")||"")}j$.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function K$(e,t){for(var r=w5(e),s=-1,n=t.length;++s<n;)r.add(t[s])}function Y$(e,t){for(var r=w5(e),s=-1,n=t.length;++s<n;)r.remove(t[s])}function tLe(e){return function(){K$(this,e)}}function rLe(e){return function(){Y$(this,e)}}function sLe(e,t){return function(){(t.apply(this,arguments)?K$:Y$)(this,e)}}function nLe(e,t){var r=W$(e+"");if(arguments.length<2){for(var s=w5(this.node()),n=-1,i=r.length;++n<i;)if(!s.contains(r[n]))return!1;return!0}return this.each((typeof t=="function"?sLe:t?tLe:rLe)(r,t))}function iLe(){this.textContent=""}function oLe(e){return function(){this.textContent=e}}function aLe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function lLe(e){return arguments.length?this.each(e==null?iLe:(typeof e=="function"?aLe:oLe)(e)):this.node().textContent}function cLe(){this.innerHTML=""}function uLe(e){return function(){this.innerHTML=e}}function dLe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function hLe(e){return arguments.length?this.each(e==null?cLe:(typeof e=="function"?dLe:uLe)(e)):this.node().innerHTML}function pLe(){this.nextSibling&&this.parentNode.appendChild(this)}function gLe(){return this.each(pLe)}function fLe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ALe(){return this.each(fLe)}function mLe(e){var t=typeof e=="function"?e:N$(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function vLe(){return null}function CLe(e,t){var r=typeof e=="function"?e:N$(e),s=t==null?vLe:typeof t=="function"?t:C5(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),s.apply(this,arguments)||null)})}function wLe(){var e=this.parentNode;e&&e.removeChild(this)}function yLe(){return this.each(wLe)}function bLe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function SLe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xLe(e){return this.select(e?SLe:bLe)}function ELe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function PLe(e){return function(t){e.call(this,t,this.__data__)}}function FLe(e){return e.trim().split(/^|\s+/).map(function(t){var r="",s=t.indexOf(".");return s>=0&&(r=t.slice(s+1),t=t.slice(0,s)),{type:t,name:r}})}function RLe(e){return function(){var t=this.__on;if(t){for(var r=0,s=-1,n=t.length,i;r<n;++r)i=t[r],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function TLe(e,t,r){return function(){var s=this.__on,n,i=PLe(t);if(s){for(var o=0,a=s.length;o<a;++o)if((n=s[o]).type===e.type&&n.name===e.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=i,n.options=r),n.value=t;return}}this.addEventListener(e.type,i,r),n={type:e.type,name:e.name,value:t,listener:i,options:r},s?s.push(n):this.__on=[n]}}function DLe(e,t,r){var s=FLe(e+""),n,i=s.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(n=0,u=a[l];n<i;++n)if((o=s[n]).type===u.type&&o.name===u.name)return u.value}return}for(a=t?TLe:RLe,n=0;n<i;++n)this.each(a(s[n],t,r));return this}function Z$(e,t,r){var s=U$(e),n=s.CustomEvent;typeof n=="function"?n=new n(t,r):(n=s.document.createEvent("Event"),r?(n.initEvent(t,r.bubbles,r.cancelable),n.detail=r.detail):n.initEvent(t,!1,!1)),e.dispatchEvent(n)}function MLe(e,t){return function(){return Z$(this,e,t)}}function ILe(e,t){return function(){return Z$(this,e,t.apply(this,arguments))}}function kLe(e,t){return this.each((typeof t=="function"?ILe:MLe)(e,t))}function*BLe(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],n=0,i=s.length,o;n<i;++n)(o=s[n])&&(yield o)}var LLe=[null];function ld(e,t){this._groups=e,this._parents=t}function t3(){return new ld([[document.documentElement]],LLe)}function HLe(){return this}ld.prototype=t3.prototype={constructor:ld,select:a7e,selectAll:d7e,selectChild:f7e,selectChildren:C7e,filter:w7e,data:P7e,enter:y7e,exit:R7e,join:T7e,merge:D7e,selection:HLe,order:M7e,sort:I7e,call:B7e,nodes:L7e,node:H7e,size:G7e,empty:O7e,each:N7e,attr:j7e,style:X7e,property:eLe,classed:nLe,text:lLe,html:hLe,raise:gLe,lower:ALe,append:mLe,insert:CLe,remove:yLe,clone:xLe,datum:ELe,on:DLe,dispatch:kLe,[Symbol.iterator]:BLe};function y5(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function X$(e,t){var r=Object.create(e.prototype);for(var s in t)r[s]=t[s];return r}function r3(){}var sx=.7,WF=1/sx,nw="\\s*([+-]?\\d+)\\s*",nx="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ih="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",GLe=/^#([0-9a-f]{3,8})$/,OLe=new RegExp(`^rgb\\(${nw},${nw},${nw}\\)$`),NLe=new RegExp(`^rgb\\(${Ih},${Ih},${Ih}\\)$`),_Le=new RegExp(`^rgba\\(${nw},${nw},${nw},${nx}\\)$`),VLe=new RegExp(`^rgba\\(${Ih},${Ih},${Ih},${nx}\\)$`),zLe=new RegExp(`^hsl\\(${nx},${Ih},${Ih}\\)$`),QLe=new RegExp(`^hsla\\(${nx},${Ih},${Ih},${nx}\\)$`),iO={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};y5(r3,ix,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oO,formatHex:oO,formatHex8:ULe,formatHsl:WLe,formatRgb:aO,toString:aO});function oO(){return this.rgb().formatHex()}function ULe(){return this.rgb().formatHex8()}function WLe(){return $$(this).formatHsl()}function aO(){return this.rgb().formatRgb()}function ix(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=GLe.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?lO(t):r===3?new sl(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?tP(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?tP(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=OLe.exec(e))?new sl(t[1],t[2],t[3],1):(t=NLe.exec(e))?new sl(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=_Le.exec(e))?tP(t[1],t[2],t[3],t[4]):(t=VLe.exec(e))?tP(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zLe.exec(e))?dO(t[1],t[2]/100,t[3]/100,1):(t=QLe.exec(e))?dO(t[1],t[2]/100,t[3]/100,t[4]):iO.hasOwnProperty(e)?lO(iO[e]):e==="transparent"?new sl(NaN,NaN,NaN,0):null}function lO(e){return new sl(e>>16&255,e>>8&255,e&255,1)}function tP(e,t,r,s){return s<=0&&(e=t=r=NaN),new sl(e,t,r,s)}function jLe(e){return e instanceof r3||(e=ix(e)),e?(e=e.rgb(),new sl(e.r,e.g,e.b,e.opacity)):new sl}function iB(e,t,r,s){return arguments.length===1?jLe(e):new sl(e,t,r,s??1)}function sl(e,t,r,s){this.r=+e,this.g=+t,this.b=+r,this.opacity=+s}y5(sl,iB,X$(r3,{brighter(e){return e=e==null?WF:Math.pow(WF,e),new sl(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sx:Math.pow(sx,e),new sl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sl(dv(this.r),dv(this.g),dv(this.b),jF(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cO,formatHex:cO,formatHex8:KLe,formatRgb:uO,toString:uO}));function cO(){return`#${Xm(this.r)}${Xm(this.g)}${Xm(this.b)}`}function KLe(){return`#${Xm(this.r)}${Xm(this.g)}${Xm(this.b)}${Xm((isNaN(this.opacity)?1:this.opacity)*255)}`}function uO(){const e=jF(this.opacity);return`${e===1?"rgb(":"rgba("}${dv(this.r)}, ${dv(this.g)}, ${dv(this.b)}${e===1?")":`, ${e})`}`}function jF(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function dv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xm(e){return e=dv(e),(e<16?"0":"")+e.toString(16)}function dO(e,t,r,s){return s<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Nu(e,t,r,s)}function $$(e){if(e instanceof Nu)return new Nu(e.h,e.s,e.l,e.opacity);if(e instanceof r3||(e=ix(e)),!e)return new Nu;if(e instanceof Nu)return e;e=e.rgb();var t=e.r/255,r=e.g/255,s=e.b/255,n=Math.min(t,r,s),i=Math.max(t,r,s),o=NaN,a=i-n,l=(i+n)/2;return a?(t===i?o=(r-s)/a+(r<s)*6:r===i?o=(s-t)/a+2:o=(t-r)/a+4,a/=l<.5?i+n:2-i-n,o*=60):a=l>0&&l<1?0:o,new Nu(o,a,l,e.opacity)}function YLe(e,t,r,s){return arguments.length===1?$$(e):new Nu(e,t,r,s??1)}function Nu(e,t,r,s){this.h=+e,this.s=+t,this.l=+r,this.opacity=+s}y5(Nu,YLe,X$(r3,{brighter(e){return e=e==null?WF:Math.pow(WF,e),new Nu(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sx:Math.pow(sx,e),new Nu(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,s=r+(r<.5?r:1-r)*t,n=2*r-s;return new sl(p4(e>=240?e-240:e+120,n,s),p4(e,n,s),p4(e<120?e+240:e-120,n,s),this.opacity)},clamp(){return new Nu(hO(this.h),rP(this.s),rP(this.l),jF(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=jF(this.opacity);return`${e===1?"hsl(":"hsla("}${hO(this.h)}, ${rP(this.s)*100}%, ${rP(this.l)*100}%${e===1?")":`, ${e})`}`}}));function hO(e){return e=(e||0)%360,e<0?e+360:e}function rP(e){return Math.max(0,Math.min(1,e||0))}function p4(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const J$=e=>()=>e;function ZLe(e,t){return function(r){return e+r*t}}function XLe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(s){return Math.pow(e+s*t,r)}}function $Le(e){return(e=+e)==1?q$:function(t,r){return r-t?XLe(t,r,e):J$(isNaN(t)?r:t)}}function q$(e,t){var r=t-e;return r?ZLe(e,r):J$(isNaN(e)?t:e)}const pO=function e(t){var r=$Le(t);function s(n,i){var o=r((n=iB(n)).r,(i=iB(i)).r),a=r(n.g,i.g),l=r(n.b,i.b),c=q$(n.opacity,i.opacity);return function(u){return n.r=o(u),n.g=a(u),n.b=l(u),n.opacity=c(u),n+""}}return s.gamma=e,s}(1);function Uf(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var oB=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,g4=new RegExp(oB.source,"g");function JLe(e){return function(){return e}}function qLe(e){return function(t){return e(t)+""}}function e5e(e,t){var r=oB.lastIndex=g4.lastIndex=0,s,n,i,o=-1,a=[],l=[];for(e=e+"",t=t+"";(s=oB.exec(e))&&(n=g4.exec(t));)(i=n.index)>r&&(i=t.slice(r,i),a[o]?a[o]+=i:a[++o]=i),(s=s[0])===(n=n[0])?a[o]?a[o]+=n:a[++o]=n:(a[++o]=null,l.push({i:o,x:Uf(s,n)})),r=g4.lastIndex;return r<t.length&&(i=t.slice(r),a[o]?a[o]+=i:a[++o]=i),a.length<2?l[0]?qLe(l[0].x):JLe(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}var gO=180/Math.PI,eJ={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tJ(e,t,r,s,n,i){var o,a,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*r+t*s)&&(r-=e*l,s-=t*l),(a=Math.sqrt(r*r+s*s))&&(r/=a,s/=a,l/=a),e*s<t*r&&(e=-e,t=-t,l=-l,o=-o),{translateX:n,translateY:i,rotate:Math.atan2(t,e)*gO,skewX:Math.atan(l)*gO,scaleX:o,scaleY:a}}var sP;function t5e(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?eJ:tJ(t.a,t.b,t.c,t.d,t.e,t.f)}function r5e(e){return e==null||(sP||(sP=document.createElementNS("http://www.w3.org/2000/svg","g")),sP.setAttribute("transform",e),!(e=sP.transform.baseVal.consolidate()))?eJ:(e=e.matrix,tJ(e.a,e.b,e.c,e.d,e.e,e.f))}function rJ(e,t,r,s){function n(c){return c.length?c.pop()+" ":""}function i(c,u,d,g,A,w){if(c!==d||u!==g){var v=A.push("translate(",null,t,null,r);w.push({i:v-4,x:Uf(c,d)},{i:v-2,x:Uf(u,g)})}else(d||g)&&A.push("translate("+d+t+g+r)}function o(c,u,d,g){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),g.push({i:d.push(n(d)+"rotate(",null,s)-2,x:Uf(c,u)})):u&&d.push(n(d)+"rotate("+u+s)}function a(c,u,d,g){c!==u?g.push({i:d.push(n(d)+"skewX(",null,s)-2,x:Uf(c,u)}):u&&d.push(n(d)+"skewX("+u+s)}function l(c,u,d,g,A,w){if(c!==d||u!==g){var v=A.push(n(A)+"scale(",null,",",null,")");w.push({i:v-4,x:Uf(c,d)},{i:v-2,x:Uf(u,g)})}else(d!==1||g!==1)&&A.push(n(A)+"scale("+d+","+g+")")}return function(c,u){var d=[],g=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,g),o(c.rotate,u.rotate,d,g),a(c.skewX,u.skewX,d,g),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,g),c=u=null,function(A){for(var w=-1,v=g.length,b;++w<v;)d[(b=g[w]).i]=b.x(A);return d.join("")}}}var s5e=rJ(t5e,"px, ","px)","deg)"),n5e=rJ(r5e,", ",")",")"),Mw=0,C1=0,Bb=0,sJ=1e3,KF,w1,YF=0,Tv=0,ST=0,ox=typeof performance=="object"&&performance.now?performance:Date,nJ=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function b5(){return Tv||(nJ(i5e),Tv=ox.now()+ST)}function i5e(){Tv=0}function ZF(){this._call=this._time=this._next=null}ZF.prototype=iJ.prototype={constructor:ZF,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?b5():+r)+(t==null?0:+t),!this._next&&w1!==this&&(w1?w1._next=this:KF=this,w1=this),this._call=e,this._time=r,aB()},stop:function(){this._call&&(this._call=null,this._time=1/0,aB())}};function iJ(e,t,r){var s=new ZF;return s.restart(e,t,r),s}function o5e(){b5(),++Mw;for(var e=KF,t;e;)(t=Tv-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Mw}function fO(){Tv=(YF=ox.now())+ST,Mw=C1=0;try{o5e()}finally{Mw=0,l5e(),Tv=0}}function a5e(){var e=ox.now(),t=e-YF;t>sJ&&(ST-=t,YF=e)}function l5e(){for(var e,t=KF,r,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:KF=r);w1=e,aB(s)}function aB(e){if(!Mw){C1&&(C1=clearTimeout(C1));var t=e-Tv;t>24?(e<1/0&&(C1=setTimeout(fO,e-ox.now()-ST)),Bb&&(Bb=clearInterval(Bb))):(Bb||(YF=ox.now(),Bb=setInterval(a5e,sJ)),Mw=1,nJ(fO))}}function AO(e,t,r){var s=new ZF;return t=t==null?0:+t,s.restart(n=>{s.stop(),e(n+t)},t,r),s}var c5e=O$("start","end","cancel","interrupt"),u5e=[],oJ=0,mO=1,lB=2,E2=3,vO=4,cB=5,P2=6;function xT(e,t,r,s,n,i){var o=e.__transition;if(!o)e.__transition={};else if(r in o)return;d5e(e,r,{name:t,index:s,group:n,on:c5e,tween:u5e,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:oJ})}function S5(e,t){var r=Ad(e,t);if(r.state>oJ)throw new Error("too late; already scheduled");return r}function Jh(e,t){var r=Ad(e,t);if(r.state>E2)throw new Error("too late; already running");return r}function Ad(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function d5e(e,t,r){var s=e.__transition,n;s[t]=r,r.timer=iJ(i,0,r.time);function i(c){r.state=mO,r.timer.restart(o,r.delay,r.time),r.delay<=c&&o(c-r.delay)}function o(c){var u,d,g,A;if(r.state!==mO)return l();for(u in s)if(A=s[u],A.name===r.name){if(A.state===E2)return AO(o);A.state===vO?(A.state=P2,A.timer.stop(),A.on.call("interrupt",e,e.__data__,A.index,A.group),delete s[u]):+u<t&&(A.state=P2,A.timer.stop(),A.on.call("cancel",e,e.__data__,A.index,A.group),delete s[u])}if(AO(function(){r.state===E2&&(r.state=vO,r.timer.restart(a,r.delay,r.time),a(c))}),r.state=lB,r.on.call("start",e,e.__data__,r.index,r.group),r.state===lB){for(r.state=E2,n=new Array(g=r.tween.length),u=0,d=-1;u<g;++u)(A=r.tween[u].value.call(e,e.__data__,r.index,r.group))&&(n[++d]=A);n.length=d+1}}function a(c){for(var u=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=cB,1),d=-1,g=n.length;++d<g;)n[d].call(e,u);r.state===cB&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=P2,r.timer.stop(),delete s[t];for(var c in s)return;delete e.__transition}}function h5e(e,t){var r=e.__transition,s,n,i=!0,o;if(r){t=t==null?null:t+"";for(o in r){if((s=r[o]).name!==t){i=!1;continue}n=s.state>lB&&s.state<cB,s.state=P2,s.timer.stop(),s.on.call(n?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete r[o]}i&&delete e.__transition}}function p5e(e){return this.each(function(){h5e(this,e)})}function g5e(e,t){var r,s;return function(){var n=Jh(this,e),i=n.tween;if(i!==r){s=r=i;for(var o=0,a=s.length;o<a;++o)if(s[o].name===t){s=s.slice(),s.splice(o,1);break}}n.tween=s}}function f5e(e,t,r){var s,n;if(typeof r!="function")throw new Error;return function(){var i=Jh(this,e),o=i.tween;if(o!==s){n=(s=o).slice();for(var a={name:t,value:r},l=0,c=n.length;l<c;++l)if(n[l].name===t){n[l]=a;break}l===c&&n.push(a)}i.tween=n}}function A5e(e,t){var r=this._id;if(e+="",arguments.length<2){for(var s=Ad(this.node(),r).tween,n=0,i=s.length,o;n<i;++n)if((o=s[n]).name===e)return o.value;return null}return this.each((t==null?g5e:f5e)(r,e,t))}function x5(e,t,r){var s=e._id;return e.each(function(){var n=Jh(this,s);(n.value||(n.value={}))[t]=r.apply(this,arguments)}),function(n){return Ad(n,s).value[t]}}function aJ(e,t){var r;return(typeof t=="number"?Uf:t instanceof ix?pO:(r=ix(t))?(t=r,pO):e5e)(e,t)}function m5e(e){return function(){this.removeAttribute(e)}}function v5e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function C5e(e,t,r){var s,n=r+"",i;return function(){var o=this.getAttribute(e);return o===n?null:o===s?i:i=t(s=o,r)}}function w5e(e,t,r){var s,n=r+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===n?null:o===s?i:i=t(s=o,r)}}function y5e(e,t,r){var s,n,i;return function(){var o,a=r(this),l;return a==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=a+"",o===l?null:o===s&&l===n?i:(n=l,i=t(s=o,a)))}}function b5e(e,t,r){var s,n,i;return function(){var o,a=r(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=a+"",o===l?null:o===s&&l===n?i:(n=l,i=t(s=o,a)))}}function S5e(e,t){var r=bT(e),s=r==="transform"?n5e:aJ;return this.attrTween(e,typeof t=="function"?(r.local?b5e:y5e)(r,s,x5(this,"attr."+e,t)):t==null?(r.local?v5e:m5e)(r):(r.local?w5e:C5e)(r,s,t))}function x5e(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function E5e(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function P5e(e,t){var r,s;function n(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&E5e(e,i)),r}return n._value=t,n}function F5e(e,t){var r,s;function n(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&x5e(e,i)),r}return n._value=t,n}function R5e(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var s=bT(e);return this.tween(r,(s.local?P5e:F5e)(s,t))}function T5e(e,t){return function(){S5(this,e).delay=+t.apply(this,arguments)}}function D5e(e,t){return t=+t,function(){S5(this,e).delay=t}}function M5e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?T5e:D5e)(t,e)):Ad(this.node(),t).delay}function I5e(e,t){return function(){Jh(this,e).duration=+t.apply(this,arguments)}}function k5e(e,t){return t=+t,function(){Jh(this,e).duration=t}}function B5e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?I5e:k5e)(t,e)):Ad(this.node(),t).duration}function L5e(e,t){if(typeof t!="function")throw new Error;return function(){Jh(this,e).ease=t}}function H5e(e){var t=this._id;return arguments.length?this.each(L5e(t,e)):Ad(this.node(),t).ease}function G5e(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Jh(this,e).ease=r}}function O5e(e){if(typeof e!="function")throw new Error;return this.each(G5e(this._id,e))}function N5e(e){typeof e!="function"&&(e=V$(e));for(var t=this._groups,r=t.length,s=new Array(r),n=0;n<r;++n)for(var i=t[n],o=i.length,a=s[n]=[],l,c=0;c<o;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new vg(s,this._parents,this._name,this._id)}function _5e(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,s=t.length,n=r.length,i=Math.min(s,n),o=new Array(s),a=0;a<i;++a)for(var l=t[a],c=r[a],u=l.length,d=o[a]=new Array(u),g,A=0;A<u;++A)(g=l[A]||c[A])&&(d[A]=g);for(;a<s;++a)o[a]=t[a];return new vg(o,this._parents,this._name,this._id)}function V5e(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function z5e(e,t,r){var s,n,i=V5e(t)?S5:Jh;return function(){var o=i(this,e),a=o.on;a!==s&&(n=(s=a).copy()).on(t,r),o.on=n}}function Q5e(e,t){var r=this._id;return arguments.length<2?Ad(this.node(),r).on.on(e):this.each(z5e(r,e,t))}function U5e(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function W5e(){return this.on("end.remove",U5e(this._id))}function j5e(e){var t=this._name,r=this._id;typeof e!="function"&&(e=C5(e));for(var s=this._groups,n=s.length,i=new Array(n),o=0;o<n;++o)for(var a=s[o],l=a.length,c=i[o]=new Array(l),u,d,g=0;g<l;++g)(u=a[g])&&(d=e.call(u,u.__data__,g,a))&&("__data__"in u&&(d.__data__=u.__data__),c[g]=d,xT(c[g],t,r,g,c,Ad(u,r)));return new vg(i,this._parents,t,r)}function K5e(e){var t=this._name,r=this._id;typeof e!="function"&&(e=_$(e));for(var s=this._groups,n=s.length,i=[],o=[],a=0;a<n;++a)for(var l=s[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var g=e.call(u,u.__data__,d,l),A,w=Ad(u,r),v=0,b=g.length;v<b;++v)(A=g[v])&&xT(A,t,r,v,g,w);i.push(g),o.push(u)}return new vg(i,o,t,r)}var Y5e=t3.prototype.constructor;function Z5e(){return new Y5e(this._groups,this._parents)}function X5e(e,t){var r,s,n;return function(){var i=Dw(this,e),o=(this.style.removeProperty(e),Dw(this,e));return i===o?null:i===r&&o===s?n:n=t(r=i,s=o)}}function lJ(e){return function(){this.style.removeProperty(e)}}function $5e(e,t,r){var s,n=r+"",i;return function(){var o=Dw(this,e);return o===n?null:o===s?i:i=t(s=o,r)}}function J5e(e,t,r){var s,n,i;return function(){var o=Dw(this,e),a=r(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Dw(this,e))),o===l?null:o===s&&l===n?i:(n=l,i=t(s=o,a))}}function q5e(e,t){var r,s,n,i="style."+t,o="end."+i,a;return function(){var l=Jh(this,e),c=l.on,u=l.value[i]==null?a||(a=lJ(t)):void 0;(c!==r||n!==u)&&(s=(r=c).copy()).on(o,n=u),l.on=s}}function e6e(e,t,r){var s=(e+="")=="transform"?s5e:aJ;return t==null?this.styleTween(e,X5e(e,s)).on("end.style."+e,lJ(e)):typeof t=="function"?this.styleTween(e,J5e(e,s,x5(this,"style."+e,t))).each(q5e(this._id,e)):this.styleTween(e,$5e(e,s,t),r).on("end.style."+e,null)}function t6e(e,t,r){return function(s){this.style.setProperty(e,t.call(this,s),r)}}function r6e(e,t,r){var s,n;function i(){var o=t.apply(this,arguments);return o!==n&&(s=(n=o)&&t6e(e,o,r)),s}return i._value=t,i}function s6e(e,t,r){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,r6e(e,t,r??""))}function n6e(e){return function(){this.textContent=e}}function i6e(e){return function(){var t=e(this);this.textContent=t??""}}function o6e(e){return this.tween("text",typeof e=="function"?i6e(x5(this,"text",e)):n6e(e==null?"":e+""))}function a6e(e){return function(t){this.textContent=e.call(this,t)}}function l6e(e){var t,r;function s(){var n=e.apply(this,arguments);return n!==r&&(t=(r=n)&&a6e(n)),t}return s._value=e,s}function c6e(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,l6e(e))}function u6e(){for(var e=this._name,t=this._id,r=cJ(),s=this._groups,n=s.length,i=0;i<n;++i)for(var o=s[i],a=o.length,l,c=0;c<a;++c)if(l=o[c]){var u=Ad(l,t);xT(l,e,r,c,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new vg(s,this._parents,e,r)}function d6e(){var e,t,r=this,s=r._id,n=r.size();return new Promise(function(i,o){var a={value:o},l={value:function(){--n===0&&i()}};r.each(function(){var c=Jh(this,s),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),n===0&&i()})}var h6e=0;function vg(e,t,r,s){this._groups=e,this._parents=t,this._name=r,this._id=s}function cJ(){return++h6e}var _p=t3.prototype;vg.prototype={constructor:vg,select:j5e,selectAll:K5e,selectChild:_p.selectChild,selectChildren:_p.selectChildren,filter:N5e,merge:_5e,selection:Z5e,transition:u6e,call:_p.call,nodes:_p.nodes,node:_p.node,size:_p.size,empty:_p.empty,each:_p.each,on:Q5e,attr:S5e,attrTween:R5e,style:e6e,styleTween:s6e,text:o6e,textTween:c6e,remove:W5e,tween:A5e,delay:M5e,duration:B5e,ease:H5e,easeVarying:O5e,end:d6e,[Symbol.iterator]:_p[Symbol.iterator]};function p6e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var g6e={time:null,delay:0,duration:250,ease:p6e};function f6e(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function A6e(e){var t,r;e instanceof vg?(t=e._id,e=e._name):(t=cJ(),(r=g6e).time=b5(),e=e==null?null:e+"");for(var s=this._groups,n=s.length,i=0;i<n;++i)for(var o=s[i],a=o.length,l,c=0;c<a;++c)(l=o[c])&&xT(l,e,t,c,o,r||f6e(l,t));return new vg(s,this._parents,e,t)}t3.prototype.interrupt=p5e;t3.prototype.transition=A6e;function m6e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function XF(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,s=e.slice(0,r);return[s.length>1?s[0]+s.slice(2):s,+e.slice(r+1)]}function v6e(e){return e=XF(Math.abs(e)),e?e[1]:NaN}function C6e(e,t){return function(r,s){for(var n=r.length,i=[],o=0,a=e[0],l=0;n>0&&a>0&&(l+a+1>s&&(a=Math.max(1,s-l)),i.push(r.substring(n-=a,n+a)),!((l+=a+1)>s));)a=e[o=(o+1)%e.length];return i.reverse().join(t)}}function w6e(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var y6e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function uB(e){if(!(t=y6e.exec(e)))throw new Error("invalid format: "+e);var t;return new E5({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}uB.prototype=E5.prototype;function E5(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}E5.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function b6e(e){e:for(var t=e.length,r=1,s=-1,n;r<t;++r)switch(e[r]){case".":s=n=r;break;case"0":s===0&&(s=r),n=r;break;default:if(!+e[r])break e;s>0&&(s=0);break}return s>0?e.slice(0,s)+e.slice(n+1):e}var uJ;function S6e(e,t){var r=XF(e,t);if(!r)return e+"";var s=r[0],n=r[1],i=n-(uJ=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,o=s.length;return i===o?s:i>o?s+new Array(i-o+1).join("0"):i>0?s.slice(0,i)+"."+s.slice(i):"0."+new Array(1-i).join("0")+XF(e,Math.max(0,t+i-1))[0]}function CO(e,t){var r=XF(e,t);if(!r)return e+"";var s=r[0],n=r[1];return n<0?"0."+new Array(-n).join("0")+s:s.length>n+1?s.slice(0,n+1)+"."+s.slice(n+1):s+new Array(n-s.length+2).join("0")}const wO={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:m6e,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>CO(e*100,t),r:CO,s:S6e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function yO(e){return e}var bO=Array.prototype.map,SO=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function x6e(e){var t=e.grouping===void 0||e.thousands===void 0?yO:C6e(bO.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",s=e.currency===void 0?"":e.currency[1]+"",n=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?yO:w6e(bO.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=uB(d);var g=d.fill,A=d.align,w=d.sign,v=d.symbol,b=d.zero,S=d.width,P=d.comma,F=d.precision,T=d.trim,D=d.type;D==="n"?(P=!0,D="g"):wO[D]||(F===void 0&&(F=12),T=!0,D="g"),(b||g==="0"&&A==="=")&&(b=!0,g="0",A="=");var B=v==="$"?r:v==="#"&&/[boxX]/.test(D)?"0"+D.toLowerCase():"",k=v==="$"?s:/[%p]/.test(D)?o:"",z=wO[D],O=/[defgprs%]/.test(D);F=F===void 0?6:/[gprs]/.test(D)?Math.max(1,Math.min(21,F)):Math.max(0,Math.min(20,F));function j(_){var G=B,N=k,W,V,q;if(D==="c")N=z(_)+N,_="";else{_=+_;var pe=_<0||1/_<0;if(_=isNaN(_)?l:z(Math.abs(_),F),T&&(_=b6e(_)),pe&&+_==0&&w!=="+"&&(pe=!1),G=(pe?w==="("?w:a:w==="-"||w==="("?"":w)+G,N=(D==="s"?SO[8+uJ/3]:"")+N+(pe&&w==="("?")":""),O){for(W=-1,V=_.length;++W<V;)if(q=_.charCodeAt(W),48>q||q>57){N=(q===46?n+_.slice(W+1):_.slice(W))+N,_=_.slice(0,W);break}}}P&&!b&&(_=t(_,1/0));var X=G.length+_.length+N.length,re=X<S?new Array(S-X+1).join(g):"";switch(P&&b&&(_=t(re+_,re.length?S-N.length:1/0),re=""),A){case"<":_=G+_+N+re;break;case"=":_=G+re+_+N;break;case"^":_=re.slice(0,X=re.length>>1)+G+_+N+re.slice(X);break;default:_=re+G+_+N;break}return i(_)}return j.toString=function(){return d+""},j}function u(d,g){var A=c((d=uB(d),d.type="f",d)),w=Math.max(-8,Math.min(8,Math.floor(v6e(g)/3)))*3,v=Math.pow(10,-w),b=SO[8+w/3];return function(S){return A(v*S)+b}}return{format:c,formatPrefix:u}}var nP;E6e({thousands:",",grouping:[3],currency:["$",""]});function E6e(e){return nP=x6e(e),nP.format,nP.formatPrefix,nP}function y1(e,t,r){this.k=e,this.x=t,this.y=r}y1.prototype={constructor:y1,scale:function(e){return e===1?this:new y1(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new y1(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};y1.prototype;const P6e={class:"block__not-found"},F6e=Tr({__name:"NotFound",setup(e){const t=h5().useApp(),r=()=>{t.updateNavigationState(s=>{s.href="/"})};return(s,n)=>(ye(),je("div",P6e,[We("h1",null,"Not found route: "+Zt(Pe(t).snapshot.navigationState.href),1),zt(Pe(u$),{onClick:Nn(r,["stop"])},{default:er(()=>n[0]||(n[0]=[Ne("Return to main page")])),_:1})]))}}),s3=(e,t)=>{const r=e.__vccOpts||e;for(const[s,n]of t)r[s]=n;return r},R6e={},T6e={class:"block__loader-page"};function D6e(e,t){return ye(),je("div",T6e,t[0]||(t[0]=[We("div",{class:"loader-container"},[We("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const M6e=s3(R6e,[["render",D6e]]),I6e={class:"pl-app-notification-alert"},k6e={class:"pl-app-notification-alert__content"},B6e={class:"pl-app-notification-alert__title"},L6e=Tr({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(e){const t=e,r=br(!1),s=br(!0),n=Je(()=>Object.entries(t.errors).filter(o=>!!o[1]));function i(){r.value=!0}return tn(()=>t.errors,o=>{s.value=Object.values(o).some(a=>!!a)},{immediate:!0,deep:!0}),(o,a)=>(ye(),je("div",I6e,[zt(Pe(f$),{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=l=>r.value=l),width:"720px",style:{"max-height":"100vh"}},{title:er(()=>a[2]||(a[2]=[Ne(" Errors ")])),default:er(()=>[We("div",k6e,[(ye(!0),je(_s,null,Fh(n.value,l=>{var c,u;return ye(),je("div",{key:l[0],class:"pl-app-notification-alert__item"},[We("div",B6e,"Block output: "+Zt(l[0]),1),zt(Pe(oBe),{value:(c=l[1])==null?void 0:c.message,valueToCopy:"fullMessage"in(l[1]??{})?l[1].fullMessage:(u=l[1])==null?void 0:u.message},null,8,["value","valueToCopy"])])}),128))])]),_:1},8,["modelValue"]),zt(Pe($Be),{modelValue:s.value,"onUpdate:modelValue":a[1]||(a[1]=l=>s.value=l),type:"error",closable:""},{actions:er(()=>[zt(Pe(kF),{icon:"arrow-right",onClick:i},{default:er(()=>a[3]||(a[3]=[Ne("See errors")])),_:1}),zt(Pe(cMe))]),default:er(()=>[a[4]||(a[4]=Ne(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),H6e={key:0,class:"block__loader"},G6e=Tr({__name:"BlockLoader",props:{value:{type:[Boolean,Number]}},setup(e){const t=e,r=Je(()=>typeof t.value=="boolean"&&t.value),s=Je(()=>{const n=t.value;if(typeof n=="number")return n>=1?void 0:(n*100).toFixed(2)+"%"});return(n,i)=>r.value?(ye(),je("div",H6e)):s.value!==void 0?(ye(),je("div",{key:1,class:"block__progress",style:oo({"--progress-width":s.value})},null,4)):yt("",!0)}});function O6e(e){const t=br(),r=".pl-block-page__title__append",s=()=>{HR(()=>{if(!e.value){t.value=void 0;return}t.value=document.querySelector(r)?r:void 0,t.value||console.error("[Monetization] use #title slot to place monetization button")})};return Yh(s),L7(s),t}const N6e=y.literal("trial"),_6e=y.literal("free"),V6e=y.literal("single_payment"),z6e=y.literal("subscription"),Q6e=y.union([N6e,_6e,V6e,z6e,y.literal("base")]),U6e=y.object({type:y.union([y.literal("unique_launches"),y.literal("volume_limit")]),used:y.number(),toSpend:y.number(),available:y.number().nullable()}),W6e=y.object({productKey:y.string(),productName:y.string().default("Unknown product"),customerEmail:y.string().optional(),canRun:y.boolean(),status:y.string(),mnz:y.object({type:Q6e.optional(),endOfBillingPeriod:y.string().nullable().optional(),limits:y.array(U6e).optional()})},{message:"Invalid DryRunResult"}),j6e=y.object({httpError:y.string().optional(),response:y.object({result:W6e.optional(),error:y.unknown().optional()}).optional()}).optional();function K6e(){const e=h5(),t=Je(()=>e.loaded?e.useApp():void 0),r=Je(()=>{var b,S;return"__mnzDate"in((S=(b=t.value)==null?void 0:b.model)==null?void 0:S.args)}),s=Je(()=>{var b;return j6e.safeParse((b=t.value)==null?void 0:b.model.outputs.__mnzInfo)}),n=Je(()=>{var b;return(b=s.value)==null?void 0:b.data}),i=Je(()=>{var b,S,P;return((b=s.value)==null?void 0:b.error)??((P=(S=o.value)==null?void 0:S.response)==null?void 0:P.error)}),o=br(void 0),a=br(!1),l=br(0);tn([n],([b])=>{if(b){o.value=b;const S=++l.value;setTimeout(()=>{l.value===S&&(a.value=!1)},1e3)}},{immediate:!0});const c=Je(()=>{var b,S;return(S=(b=o.value)==null?void 0:b.response)==null?void 0:S.result}),u=Je(()=>{var b;return!!((b=c.value)!=null&&b.canRun)}),d=Je(()=>{var b;return n.value?(b=c.value)==null?void 0:b.status:"awaiting"}),g=Je(()=>{var b;return(b=c.value)==null?void 0:b.customerEmail}),A=Je(()=>{var b;return(b=c.value)==null?void 0:b.mnz.endOfBillingPeriod}),w=Je(()=>{var b;return(b=c.value)==null?void 0:b.mnz.limits}),v=()=>{var b;a.value=!0,((b=t.value)==null?void 0:b.model.args).__mnzDate=new Date().toISOString()};return tn(u,b=>{var S;r.value&&(((S=t.value)==null?void 0:S.model.args).__mnzCanRun=b)}),r.value&&yDe(v,6e4),{hasMonetization:r,result:c,error:i,canRun:u,status:d,customerEmail:g,endOfBillingPeriod:A,limits:w,refresh:v,version:l,isLoading:a}}const Y6e=["title"],Z6e=Tr({__name:"UserCabinetCard",props:{userCabinetUrl:{}},setup(e){const t=e,r=br(""),s=Je(()=>r.value?"clipboard-copied":"clipboard"),n=()=>{t.userCabinetUrl&&navigator.clipboard.writeText(t.userCabinetUrl).then(()=>{r.value="URL copied!",setTimeout(()=>{r.value=""},2e3)}).catch(i=>{console.error("Failed to copy text: ",i),r.value="Copy failed",setTimeout(()=>{r.value=""},2e3)})};return(i,o)=>(ye(),je("div",null,[i.userCabinetUrl?(ye(),je("div",{key:0,class:St(i.$style.urlSection)},[We("div",{class:St(i.$style.urlLabel)},"Scientist cabinet URL:",2),We("div",{class:St(i.$style.urlActions)},[We("div",{class:St(i.$style.urlDisplay),title:i.userCabinetUrl},Zt(i.userCabinetUrl),11,Y6e),zt(Pe(_h),{"close-delay":800,position:"top"},{tooltip:er(()=>[Ne(Zt(r.value?r.value:"Copy"),1)]),default:er(()=>[zt(Pe(Vc),{class:St(i.$style.copyIcon),title:"Copy content",name:s.value,onClick:n},null,8,["class","name"])]),_:1})],2)],2)):yt("",!0),We("div",{class:St(i.$style.hint)}," * Copy and paste the link into your browser ",2)]))}}),X6e="_hint_1bvg8_2",$6e="_copyIcon_1bvg8_10",J6e="_urlSection_1bvg8_14",q6e="_urlLabel_1bvg8_23",e8e="_urlActions_1bvg8_28",t8e="_urlDisplay_1bvg8_35",r8e={hint:X6e,copyIcon:$6e,urlSection:J6e,urlLabel:q6e,urlActions:e8e,urlDisplay:t8e},s8e={$style:r8e},n8e=s3(Z6e,[["__cssModules",s8e]]),i8e=Tr({__name:"RunStatus",props:{canRun:{type:Boolean},statusText:{}},setup(e){const t=e;Je(()=>t.canRun?"Can run":"Cannot run: check your monetization settings");const r=Je(()=>t.canRun?"Ready to run":"Cannot run");return(s,n)=>(ye(),je("div",null,[We("div",{class:St([{[s.$style["can-run"]]:s.canRun},s.$style.container])},[We("div",{class:St(s.$style.badge)},[We("i",{class:St(s.$style.blob)},[We("span",null,[We("span",{class:St(s.$style.dot)},null,2)])],2),We("span",null,Zt(r.value),1)],2),yt("",!0),jr(s.$slots,"default")],2),s.statusText?(ye(),je("div",{key:0,class:St(s.$style.statusText)},Zt(s.statusText),3)):yt("",!0)]))}}),o8e="_container_s8cm3_2",a8e="_statusText_s8cm3_14",l8e="_badge_s8cm3_22",c8e="_blob_s8cm3_33",u8e="_dot_s8cm3_50",d8e={container:o8e,"can-run":"_can-run_s8cm3_8",statusText:a8e,badge:l8e,blob:c8e,"pulse-glob":"_pulse-glob_s8cm3_1",dot:u8e},h8e={$style:d8e},p8e=s3(i8e,[["__cssModules",h8e]]),g8e={key:0},f8e={key:1},A8e=Tr({__name:"LimitCard",props:{type:{},label:{},used:{},toSpend:{},available:{},unit:{}},setup(e){const t=e,r=Je(()=>t.available===null?0:t.toSpend/t.available*100),s=Je(()=>t.available===null?0:t.used/t.available*100),n=Je(()=>t.available===null?100:100-s.value-r.value),i=Je(()=>t.type==="unique_launches"?"Runs Limits":t.type==="volume_limit"?"Volume Limits":t.label),o=l=>(l/1024/1024/1024).toFixed(2)+" GB",a=l=>t.type==="volume_limit"?o(l):l;return(l,c)=>(ye(),je("div",{class:St(l.$style.container)},[We("span",{class:St(l.$style.label)},Zt(i.value),3),We("div",{class:St(l.$style.content)},[We("div",{class:St(l.$style.contentAvailable)},[c[0]||(c[0]=Ne(" Available: ")),c[1]||(c[1]=We("div",{style:{flex:"1"}},null,-1)),l.available!==null?(ye(),je("span",g8e,[We("strong",null,Zt(a(l.available)),1),Ne(" / "+Zt(a(l.available+l.toSpend+l.used)),1)])):(ye(),je("span",f8e,"Unlimited"))],2),We("div",{class:St(l.$style.progressBar)},[We("span",{class:St(l.$style.progressBarAvailable),style:oo({width:`${n.value}%`})},null,6),We("span",{class:St(l.$style.progressBarToSpend),style:oo({width:`${r.value}%`})},null,6),We("span",{class:St(l.$style.progressBarUsed),style:oo({width:`${s.value}%`})},null,6)],2),We("div",{class:St(l.$style.legends)},[We("div",{class:St(l.$style.usedLegend)},[c[2]||(c[2]=We("span",null,null,-1)),Ne(" Used: "+Zt(a(l.used)),1)],2),We("div",{class:St(l.$style.toSpendLegend)},[c[3]||(c[3]=We("span",null,null,-1)),Ne(" To spend: "+Zt(a(l.toSpend)),1)],2)],2)],2)],2))}}),m8e="_container_1qgbe_2",v8e="_label_1qgbe_16",C8e="_content_1qgbe_25",w8e="_contentAvailable_1qgbe_31",y8e="_progressBar_1qgbe_43",b8e="_progressBarAvailable_1qgbe_57",S8e="_progressBarUsed_1qgbe_62",x8e="_progressBarToSpend_1qgbe_67",E8e="_legends_1qgbe_72",P8e="_usedLegend_1qgbe_89",F8e="_toSpendLegend_1qgbe_98",R8e={container:m8e,label:v8e,content:C8e,contentAvailable:w8e,progressBar:y8e,progressBarAvailable:b8e,progressBarUsed:S8e,progressBarToSpend:x8e,legends:E8e,usedLegend:P8e,toSpendLegend:F8e},T8e={$style:R8e},D8e=s3(A8e,[["__cssModules",T8e]]),M8e=Tr({__name:"EndOfPeriod",props:{endOfPeriod:{}},setup(e){const t=r=>{if(!r)return"N/A";const s=new Date(r),n=s.getDate().toString().padStart(2,"0"),i=(s.getMonth()+1).toString().padStart(2,"0"),o=s.getFullYear();return`${n}.${i}.${o}`};return(r,s)=>(ye(),je("div",{class:St(r.$style.container)},[s[0]||(s[0]=We("span",null,"End of period",-1)),We("span",null,Zt(t(r.endOfPeriod)),1)],2))}}),I8e="_container_1vyu9_2",k8e={container:I8e},B8e={$style:k8e},L8e=s3(M8e,[["__cssModules",B8e]]),H8e=Tr({__name:"MonetizationSidebar",setup(e){const t=br(!1),{result:r,error:s,hasMonetization:n,canRun:i,status:o,customerEmail:a,endOfBillingPeriod:l,limits:c,refresh:u,isLoading:d}=K6e(),g=O6e(n),A=Je(()=>{var P;return(P=r.value)==null?void 0:P.productName}),w=Je(()=>{if(!r.value)return;const P=new URL(`https://scientist.platforma.bio/product/${r.value.productKey}`);return a.value&&P.searchParams.set("email",a.value),P.toString()}),v=Je(()=>r.value?[{label:r.value.productName,value:r.value.productName}]:[]),b=Je(()=>{switch(o.value){case"active":return"";case"limits_exceeded":return"Usage limits exceeded for the current billing period.";case"payment_required":return"Payment required to continue using the service.";case"select-tariff":return"Select a subscription plan in the Scientist Cabinet.";case"inactive":return"Not found billing period.";case"awaiting":return"Waiting for monetization information";default:return"Unknown status: "+o.value}}),S=Je(()=>i.value?"monetization-on":"monetization-off");return(P,F)=>(ye(),je(_s,null,[Pe(n)?(ye(),jt(Pe(kIe),{key:0,modelValue:t.value,"onUpdate:modelValue":F[0]||(F[0]=T=>t.value=T)},{title:er(()=>F[2]||(F[2]=[We("div",{class:"flex items-center gap-2"},[We("span",null,"Subscription")],-1)])),default:er(()=>[zt(Pe(g$),{label:"Product",readonly:"","model-value":A.value,options:v.value},null,8,["model-value","options"]),zt(p8e,{"can-run":Pe(i),"status-text":b.value},{default:er(()=>[zt(Pe(u$),{title:"Refresh status",round:"",size:"small",style:{"margin-left":"auto"},icon:"loading",loading:Pe(d),onClick:Pe(u)},null,8,["loading","onClick"])]),_:1},8,["can-run","status-text"]),Pe(s)?(ye(),jt(Pe(b2),{key:0,type:"error"},{default:er(()=>[Ne(Zt(Pe(s)),1)]),_:1})):yt("",!0),w.value?(ye(),jt(n8e,{key:1,"user-cabinet-url":w.value},null,8,["user-cabinet-url"])):yt("",!0),Pe(l)?(ye(),jt(L8e,{key:2,"end-of-period":Pe(l)},null,8,["end-of-period"])):yt("",!0),Pe(c)?(ye(!0),je(_s,{key:3},Fh(Pe(c),T=>(ye(),jt(D8e,{key:T.type,type:T.type,label:T.type,used:T.used,"to-spend":T.toSpend,available:T.available},null,8,["type","label","used","to-spend","available"]))),128)):yt("",!0)]),_:1},8,["modelValue"])):yt("",!0),Pe(n)&&Pe(g)?(ye(),jt(kx,{key:1,to:Pe(g)},[zt(Pe(g5),{onClick:F[1]||(F[1]=Nn(T=>t.value=!0,["stop"]))},{append:er(()=>[zt(Pe(m5),{name:S.value},null,8,["name"])]),default:er(()=>[F[3]||(F[3]=Ne(" Subscription "))]),_:1})],8,["to"])):yt("",!0)],64))}}),G8e={class:"block block__layout"},O8e={key:0},N8e=Tr({__name:"BlockLayout",setup(e){const t=h5(),r=c=>{try{return new URL(c,"http://dummy").pathname}catch{console.error("Invalid href",c);return}},s=Je(()=>t.loaded?t.useApp().href:void 0),n=Je(()=>{if(t.loaded){const c=t.useApp(),u=r(c.snapshot.navigationState.href);return u?c.getRoute(u):void 0}}),i=Je(()=>t.loaded?t.useApp():void 0),o=Je(()=>i.value?i.value.model.outputErrors:{}),a=Je(()=>{var c;return((c=i.value)==null?void 0:c.showErrorsNotification)??!0}),l=Je(()=>{var c,u;return(u=(c=i.value)==null?void 0:c.progress)==null?void 0:u.call(c)});return(c,u)=>(ye(),je(_s,null,[We("div",G8e,[zt(G6e,{value:l.value},null,8,["value"]),Pe(t).error?(ye(),je("div",O8e,Zt(Pe(t).error),1)):Pe(t).loaded?n.value?(ye(),jt(QU(n.value),{key:s.value})):(ye(),jt(F6e,{key:3})):(ye(),jt(M6e,{key:1},{default:er(()=>u[0]||(u[0]=[Ne("Loading...")])),_:1})),Pe(t).loaded&&a.value?(ye(),jt(Pe(L6e),{key:4,errors:o.value},null,8,["errors"])):yt("",!0)]),n.value?(ye(),jt(Pe(H8e),{key:0})):yt("",!0)],64))}});var $F={exports:{}};/**
702
+ `,mMe=["innerHTML"],vMe={class:"dropdown-list-item__title-container"},CMe={class:"dropdown-list-item__title text-s"},wMe={key:0,class:"dropdown-list-item__description text-description"},yMe={key:1,class:"dropdown-list-item__icon flex-self-start"},i$=Tr({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(e){const t=e,r=Je(()=>{const i=[];return t.size==="small"&&i.push("dropdown-list-item__small"),t.isSelected&&i.push("dropdown-list-item__selected"),t.isHovered&&i.push("hovered-item"),i.join(" ")}),s=Je(()=>{const i=["dropdown-list-item__checkbox","flex-self-start"];return t.isSelected&&i.push("checked"),i.join(" ")}),n=Je(()=>t.isSelected?AMe:fMe);return(i,o)=>(ye(),je("div",{class:St([r.value,"dropdown-list-item"])},[t.useCheckbox?(ye(),je("div",{key:0,class:St(s.value),innerHTML:n.value},null,10,mMe)):yt("",!0),o[1]||(o[1]=Ne()),We("div",vMe,[We("div",CMe,Zt(i.option.label),1),o[0]||(o[0]=Ne()),i.option.description?(ye(),je("div",wMe,Zt(i.option.description),1)):yt("",!0)]),o[2]||(o[2]=Ne()),!t.useCheckbox&&t.isSelected?(ye(),je("div",yMe)):yt("",!0)],2))}});function bMe(e){return e()}function SMe(e){let t=!1;return function(...r){t||(requestAnimationFrame(()=>{e(...r),t=!1}),t=!0)}}function xMe(e){return new Promise(t=>setTimeout(t,e))}function EMe(e,t){const r=setTimeout(e,t);return()=>{clearTimeout(r)}}function PMe(e){return function(t){return 1-e(1-t)}}function FMe(e){const{duration:t,draw:r,timing:s}=e,n=performance.now();let i=!1;return requestAnimationFrame(function o(a){let l=(a-n)/t;(l>1||i)&&(l=1);const c=s(l);r(c),l<1&&requestAnimationFrame(o)}),function(){i=!0}}function RMe(e,t,r=!0){let s=0,n;return function(...i){n=()=>{e.apply(this,i),s=new Date().getTime()+t,n=null,r&&setTimeout(()=>{n==null||n()},t)},new Date().getTime()>s&&n()}}function o$(e){if(!Array.isArray(e))throw Error("Invalid component options: "+String(e));return e.map(t=>({label:"label"in t?t.label:t.text,value:t.value,description:t.description}))}function a$(e,t){const r=SMe(()=>{if(e.value){const{scrollTop:s,scrollLeft:n,scrollHeight:i,scrollWidth:o,clientHeight:a,clientWidth:l}=document.documentElement,c=e.value.getBoundingClientRect();t({scrollTop:s,scrollLeft:n,scrollHeight:i,scrollWidth:o,clientHeight:a,clientWidth:l,offsetY:s+c.y,offsetX:n+c.x,top:c.top,right:c.right,bottom:c.bottom,left:c.left,width:c.width,height:c.height,x:c.x,y:c.y})}});Yh(r),cv(window,"scroll",r,{capture:!0,passive:!0}),cv(window,"resize",r,{passive:!0}),cv(window,"adjust",r,!0)}const TMe=Tr({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(e){const t=e,r=Je(()=>t.size==="large"?"--mask-size: 24px":""),s=Je(()=>`mask-16 mask-${t.name}`);return(n,i)=>(ye(),je("i",{style:oo(r.value),class:St([s.value,n.$style.icon])},null,6))}}),DMe="_icon_1ugxm_2",MMe={icon:DMe},IMe={$style:MMe},Zk=$h(TMe,[["__cssModules",IMe]]);function l$(e){function t(r){const s=r.currentTarget,n=document.createElement("span"),i=Math.max(s.clientWidth,s.clientHeight),o=i/2;n.style.width=n.style.height=`${i}px`,n.style.left=`${r.clientX-s.offsetLeft-o}px`,n.style.top=`${r.clientY-s.offsetTop-o}px`,n.classList.add("ripple");const a=s.getElementsByClassName("ripple")[0];a&&a.remove(),s.appendChild(n)}Yh(()=>{var r;(r=e.value)==null||r.addEventListener("click",t)})}const kMe={key:0},BMe={inheritAttrs:!1},c$=Tr({...BMe,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e,r=br(),s=Je(()=>t.small||t.size==="small"),n=Je(()=>t.large||t.size==="large");return l$(r),(i,o)=>(ye(),je("button",dl({ref_key:"btn",ref:r,tabindex:"0",class:{loading:i.loading,small:s.value,large:n.value,round:i.round,reverse:i.reverse,justifyCenter:i.justifyCenter,[i.$attrs.class+""]:!0}},{...i.$attrs,disabled:!!i.$attrs.disabled||i.loading}),[i.round?yt("",!0):(ye(),je("span",kMe,[jr(i.$slots,"default")])),o[0]||(o[0]=Ne()),i.loading?(ye(),jt(Pe(Zk),{key:1,name:"loading",size:i.size},null,8,["size"])):i.icon?(ye(),jt(Pe(Zk),{key:2,name:i.icon,size:i.size},null,8,["name","size"])):yt("",!0)],16))}}),LMe={name:"PlBtnPrimary"},kF=Tr({...LMe,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e;return(r,s)=>(ye(),jt(c$,dl({class:"pl-btn-primary"},t),{default:er(()=>[jr(r.$slots,"default")]),_:3},16))}}),HMe={name:"PlBtnSecondary"},u$=Tr({...HMe,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e;return(r,s)=>(ye(),jt(c$,dl(t,{class:"pl-btn-secondary"}),{default:er(()=>[jr(r.$slots,"default")]),_:3},16))}}),GMe=Tr({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(e){const t=e,r=Je(()=>`mask-24 mask-${t.name}`);return(s,n)=>(ye(),je("i",{class:St([r.value,s.$style.icon])},null,2))}}),OMe="_icon_1ugxm_2",NMe={icon:OMe},_Me={$style:NMe},Vc=$h(GMe,[["__cssModules",_Me]]),VMe={key:0},zMe={name:"PlBtnGhost"},g5=Tr({...zMe,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!1}},setup(e){const t=e,r=Je(()=>t.size==="small"),s=Je(()=>t.size==="large"),n=br(),i=dd();return l$(n),(o,a)=>(ye(),je("button",dl({ref_key:"btnRef",ref:n,tabindex:"0",class:["pl-btn-ghost",{loading:o.loading,small:r.value,large:s.value,round:o.round,reverse:o.reverse,justifyCenter:o.justifyCenter,[o.$attrs.class+""]:!0}]},{...o.$attrs,disabled:!!o.$attrs.disabled||o.loading}),[Pe(i).default&&!o.round?(ye(),je("span",VMe,[jr(o.$slots,"default")])):yt("",!0),a[0]||(a[0]=Ne()),o.loading?(ye(),jt(Pe(Vc),{key:1,name:"loading",size:o.size},null,8,["size"])):o.icon?(ye(),jt(Pe(Vc),{key:2,name:o.icon,size:o.size},null,8,["name","size"])):yt("",!0),a[1]||(a[1]=Ne()),jr(o.$slots,"append")],16))}});function QMe(e,t){const r=br();return a$(e,s=>{r.value=s}),Je(()=>{const s=Pe(r),n=Pe(t),i=n.position??"top",o=n.gap??8;if(!s)return"";const a=s.offsetY+Math.floor(s.height/2),l=s.offsetX+Math.floor(s.width/2);return i==="top-left"?`left: ${s.offsetX}px; top: ${s.offsetY-o}px;`:i==="top"?`left: ${l}px; top: ${s.offsetY-o}px;`:i==="right"?`left: ${s.offsetX+s.width+o}px; top: ${a}px;`:i==="left"?`right: ${s.scrollWidth-s.x+o}px; top: ${a}px;`:i==="southwest"?`left: ${s.offsetX+s.width}px; top: ${s.offsetY+s.height+o}px;`:""})}function f5(e,t){return t(e)}function d$(e,t){if(e!=null)return t(e)}function UMe(e){return Array.isArray(e)?e:[e]}function h$(e,t){cv(document,"click",r=>{document.contains(r.target)&&(UMe(e).map(s=>s.value).filter(s=>!!s).some(s=>s==null?void 0:s.contains(r.target))||t())})}const WMe={},jMe={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function KMe(e,t){return ye(),je("svg",jMe,t[0]||(t[0]=[We("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const YMe=$h(WMe,[["render",KMe]]),u4=new Map,ZMe={name:"PlTooltip"},_h=Tr({...ZMe,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"},maxWidth:{default:"300px"}},emits:["tooltip:close"],setup(e,{emit:t}){const r=t,s=Symbol(),n=e,i=oi({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});u4.set(s,()=>c()),tn(()=>i.open,b=>{requestAnimationFrame(()=>{i.tooltipOpen=b})});let o=()=>{};const a=RMe(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),l=()=>{i.open=!0;for(const[b,S]of u4.entries())b!==s&&S()},c=()=>{i.open=!1,r("tooltip:close")},u=async()=>{n.hide||(a(),i.over=!0,o(),await xMe(100),i.over&&l())},d=()=>{i.over=!1,o=EMe(()=>{i.over||c()},n.closeDelay)};tn(()=>n.hide,b=>{b&&c()});const g=br(),A=br(),w=QMe(g,I7(n));h$([g,A],()=>c());const v=Je(()=>({"--pl-tooltip-max-width":n.maxWidth}));return Bx(()=>{u4.delete(s)}),(b,S)=>(ye(),jt(QU(b.element),dl(b.$attrs,{ref_key:"rootRef",ref:g,onClick:u,onMouseover:u,onMouseleave:d}),{default:er(()=>[jr(b.$slots,"default"),S[1]||(S[1]=Ne()),b.$slots.tooltip&&i.open?(ye(),jt(kx,{key:0,to:"body"},[zt(V7,{name:"tooltip-transition"},{default:er(()=>[i.tooltipOpen?(ye(),je("div",{key:0,class:"pl-tooltip__container",style:oo(Pe(w))},[We("div",{ref_key:"tooltip",ref:A,class:St(["pl-tooltip",b.position]),style:oo(v.value),onMouseover:u,onMouseleave:d},[We("div",null,[jr(b.$slots,"tooltip")]),S[0]||(S[0]=Ne()),zt(YMe)],38)],4)):yt("",!0)]),_:3})])):yt("",!0)]),_:3},16))}}),XMe={},$Me={class:"inner-border"};function JMe(e,t,r,s,n,i){return ye(),je("div",$Me,[jr(e.$slots,"default")])}const qMe=$h(XMe,[["render",JMe]]),e4e={key:0},t4e=["tabindex","onKeydown","onClick"],r4e={key:1,class:"pl-btn-group__helper"},s4e={key:2,class:"pl-btn-group__error"},n4e={name:"PlBtnGroup"},i4e=Tr({...n4e,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},compact:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(e,{emit:t}){const r=dd(),s=t,n=a=>s("update:modelValue",a),i=e,o=Je(()=>i.options.map(a=>({label:"label"in a?a.label:a.text,value:a.value})));return(a,l)=>(ye(),je("div",{class:St(["pl-btn-group",{disabled:a.disabled,compact:a.compact}])},[a.label?(ye(),je("label",e4e,[We("span",null,Zt(a.label),1),l[0]||(l[0]=Ne()),Pe(r).tooltip?(ye(),jt(Pe(_h),{key:0,class:"info",position:"top"},{tooltip:er(()=>[jr(a.$slots,"tooltip")]),_:3})):yt("",!0)])):yt("",!0),l[1]||(l[1]=Ne()),zt(qMe,{class:"pl-btn-group__container"},{default:er(()=>[(ye(!0),je(_s,null,Fh(o.value,(c,u)=>(ye(),je("div",{key:u,class:St(["pl-btn-group__option text-s",{active:a.modelValue===c.value}]),tabindex:a.modelValue===c.value||a.disabled?void 0:0,onKeydown:dw(d=>n(c.value),["enter"]),onClick:d=>n(c.value)},Zt(c.label),43,t4e))),128))]),_:1}),l[2]||(l[2]=Ne()),a.helper?(ye(),je("div",r4e,Zt(a.helper),1)):a.error?(ye(),je("div",s4e,Zt(a.error),1)):yt("",!0)],2))}}),o4e={inheritAttrs:!1},a4e={class:"double-contour"};function l4e(e,t,r,s,n,i){return ye(),je("div",a4e,[We("div",hie(gW(e.$attrs)),[jr(e.$slots,"default")],16)])}const $x=$h(o4e,[["render",l4e]]);function c4e(e){Yh(e),L7(e)}const A5=new WeakMap,Xk=new ResizeObserver(e=>{for(const t of e)d$(A5.get(t.target),r=>r(t))});function u4e(e,t){A5.set(e,t),Xk.unobserve(e),Xk.observe(e)}function d4e(e){Xk.unobserve(e),A5.delete(e)}const h4e=8,jG=4;function Jx(e,t="label"){const r=new Set;c4e(()=>{d$(e==null?void 0:e.value,s=>{const n=s.querySelector(t);n&&(r.add(n),u4e(n,()=>{const i=bMe(()=>n.getBoundingClientRect().width+f5(h4e,o=>Number.isNaN(o)?jG:o+jG));s.style.getPropertyValue("--label-offset-right-x")!==`${i}px`&&s.style.setProperty("--label-offset-right-x",`${i}px`)}))})}),H7(()=>{Array.from(r.values()).map(s=>d4e(s))})}function p4e(e,t){const r=[];return t&&t.length>0&&t.forEach(s=>{const n=s(e);typeof n=="string"&&r.push(n)}),{isValid:r.length===0,errors:r}}function g4e(e,t){return Je(()=>p4e(e.value,t))}const f4e=Tr({__name:"PlIcon16",props:{name:{},size:{}},setup(e){const t=e,r=Je(()=>t.size==="large"?"--icon-size: 24px":""),s=Je(()=>`icon-16 icon-${t.name}`);return(n,i)=>(ye(),je("i",{style:oo(r.value),class:St([s.value,n.$style.icon])},null,6))}}),A4e="_icon_1ugxm_2",m4e={icon:A4e},v4e={$style:m4e},_S=$h(f4e,[["__cssModules",v4e]]),C4e={class:"pl-text-field__envelope"},w4e={key:0,ref:"label"},y4e={key:0,class:"required-icon"},b4e={key:1,class:"pl-text-field__prefix"},S4e=["disabled","placeholder","type"],x4e={key:0,class:"pl-text-field__error"},E4e={key:1,class:"pl-text-field__helper"},P4e={name:"PlTextField"},d4=Tr({...P4e,props:KU({label:{},clearable:{type:[Boolean,Function]},parse:{type:Function},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=dd(),r=lW(e,"modelValue"),s=e,n=br(void 0),i=br(),o=br(!1),a=oi({cached:void 0}),l=Je({get(){return a.cached?a.cached.value:r.value===void 0||r.value===null?"":String(r.value)},set(D){if(a.cached=void 0,s.parse)try{r.value=s.parse(D)}catch(B){a.cached={error:B instanceof Error?B.message:String(B),value:D}}else r.value=D}}),c=Je(()=>s.type&&s.type==="password"?o.value?"text":s.type:"text"),u=Je(()=>o.value?"view-show":"view-hide"),d=()=>{s.clearable&&(a.cached=void 0,r.value=s.clearable===!0?"":s.clearable())},g=g4e(l,s.rules||[]),A=Je(()=>s.clearable?s.clearable===!0?r.value==="":r.value===s.clearable():r.value===""),w=Je(()=>!A.value),v=Je(()=>{const D=[];return s.error&&D.push(s.error),a.cached&&D.push(a.cached.error),g.value.isValid||D.push(...g.value.errors),D}),b=Je(()=>v.value.length>0),S=Je(()=>s.clearable&&w.value&&s.type!=="password"&&!s.disabled),P=()=>o.value=!o.value,F=()=>{a.cached=void 0},T=()=>{var D;return(D=i.value)==null?void 0:D.focus()};return Jx(n),(D,B)=>(ye(),je("div",C4e,[We("div",{ref_key:"rootRef",ref:n,class:St(["pl-text-field",{error:b.value,disabled:D.disabled,dashed:D.dashed,nonEmpty:w.value}])},[D.label?(ye(),je("label",w4e,[D.required?(ye(),je("i",y4e)):yt("",!0),B[1]||(B[1]=Ne()),We("span",null,Zt(D.label),1),B[2]||(B[2]=Ne()),Pe(t).tooltip?(ye(),jt(Pe(_h),{key:1,class:"info",position:"top"},{tooltip:er(()=>[jr(D.$slots,"tooltip")]),_:3})):yt("",!0)],512)):yt("",!0),B[5]||(B[5]=Ne()),D.prefix?(ye(),je("div",b4e,Zt(D.prefix),1)):yt("",!0),B[6]||(B[6]=Ne()),Av(We("input",{ref_key:"inputRef",ref:i,"onUpdate:modelValue":B[0]||(B[0]=k=>l.value=k),disabled:D.disabled,placeholder:D.placeholder||"...",type:c.value,spellcheck:"false",onFocusout:F},null,40,S4e),[[Pae,l.value]]),B[7]||(B[7]=Ne()),We("div",{class:"pl-text-field__append",onClick:T},[S.value?(ye(),jt(Pe(_S),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:Nn(d,["stop"])})):yt("",!0),B[3]||(B[3]=Ne()),D.type==="password"?(ye(),jt(Pe(Vc),{key:1,name:u.value,style:{cursor:"pointer"},onClick:Nn(P,["stop"])},null,8,["name"])):yt("",!0),B[4]||(B[4]=Ne()),jr(D.$slots,"append")]),B[8]||(B[8]=Ne()),zt($x,{class:"pl-text-field__contour"})],2),B[9]||(B[9]=Ne()),b.value?(ye(),je("div",x4e,Zt(v.value.join(" ")),1)):D.helper?(ye(),je("div",E4e,Zt(D.helper),1)):yt("",!0)]))}}),F4e=Tr({__name:"PlIcon24",props:{name:{},size:{}},setup(e){const t=e,r=Je(()=>`icon-24 icon-${t.name}`);return(s,n)=>(ye(),je("i",{class:St([r.value,s.$style.icon])},null,2))}}),R4e="_icon_1ugxm_2",T4e={icon:R4e},D4e={$style:T4e},m5=$h(F4e,[["__cssModules",D4e]]),M4e=["disabled","placeholder"],I4e=Tr({__name:"PlSearchField",props:{modelValue:{},clearable:{type:Boolean},placeholder:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const r=t,s=e,n=br(void 0),i=br(),o=Je({get(){return s.modelValue??""},set(c){r("update:modelValue",c)}}),a=Je(()=>!!s.modelValue),l=()=>r("update:modelValue","");return(c,u)=>(ye(),je("div",{ref_key:"root",ref:n,class:St(["pl-search-field",[c.$style.component]])},[zt(Pe(m5),{name:"search"}),u[1]||(u[1]=Ne()),Av(We("input",{ref_key:"input",ref:i,"onUpdate:modelValue":u[0]||(u[0]=d=>o.value=d),disabled:c.disabled,type:"text",placeholder:c.placeholder||"Find...",spellcheck:"false"},null,8,M4e),[[pS,o.value]]),u[2]||(u[2]=Ne()),c.clearable&&a.value?(ye(),jt(Pe(_S),{key:0,class:St(c.$style.clear),name:"delete-clear",onClick:Nn(l,["stop"])},null,8,["class"])):yt("",!0)],2))}}),k4e="_component_pz0lo_1",B4e="_clear_pz0lo_35",L4e={component:k4e,clear:B4e},H4e={$style:L4e},G4e=$h(I4e,[["__cssModules",H4e]]);function KG(e){return e!==null&&typeof e=="object"}function ng(e,t){return KG(e)&&KG(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(r=>ng(e[r],t[r])):e===t}function YG(e,t){return e.some(r=>ng(r,t))}const O4e=Tr({__name:"LongText",setup(e){cae(u=>({"5deba9de":o.value}));const t=br(!1),r=br(),s=br(!1),n=Je(()=>s.value&&t.value?"ui-lt-animate":""),i=MDe(u=>s.value=u,500),o=Je(()=>{var u;return r.value?`${((u=r.value)==null?void 0:u.innerHTML.length)*.4}s`:"5s"});function a(){const u=NS(r.value,"span cannot be empty");t.value=u.clientWidth<u.scrollWidth}function l(){a(),i(!0)}function c(){i(!1)}return(u,d)=>(ye(),je("div",dl(u.$attrs,{class:"ui-lt-container"}),[We("span",{onMouseover:l,onMouseleave:c},[We("span",{ref_key:"span",ref:r,class:St(n.value)},[jr(u.$slots,"default")],2)],32)],16))}});function N4e(e,t){const r=e.scrollTop,s=e.getBoundingClientRect().height,n=t.offsetTop,i=t.getBoundingClientRect().height;return n+i<s+r&&n>r}function _4e(e,t){const r=e.scrollTop,s=e.getBoundingClientRect().height,n=t.offsetTop,i=t.getBoundingClientRect().height;return n+i<s+r?"ceil":n>r?"floor":"visible"}function V4e(e,t,r={}){const s=e.scrollTop,n=e.getBoundingClientRect().height,i=t.getBoundingClientRect().height,o=t.offsetTop,a=_4e(e,t);if(a==="visible")return;const l=c=>{const u=a==="floor"?o-(n-i):o;e.scrollTop=s+c*(u-s)};N4e(e,t)||FMe({duration:r.duration||100,timing:PMe(c=>c),draw:l})}const p$=Tr({__name:"DropdownOverlay",props:{root:{},gap:{}},setup(e,{expose:t}){const r=e,s=oi({optionsHeight:0}),n=oi({top:"0px",left:"0px",width:"0px"}),i=I7(r,"root"),o=br();return t({scrollIntoActive:()=>{const a=o.value;a&&p5(a.querySelector(".hovered-item"),l=>{V4e(a,l)})},listRef:o}),tn(o,a=>{a&&requestAnimationFrame(()=>{const l=a.getBoundingClientRect();s.optionsHeight=l.height,window.dispatchEvent(new CustomEvent("adjust"))})}),a$(i,a=>{const l=document.body.getBoundingClientRect(),c=a.top-l.top,u=a.left-l.left,d=r.gap??0,g=c+a.height+d;g+s.optionsHeight>a.clientHeight?n.top=c-s.optionsHeight-d+"px":n.top=g+"px",n.left=u+"px",n.width=a.width+"px"}),(a,l)=>(ye(),jt(kx,{to:"body"},[We("div",dl({ref_key:"listRef",ref:o},a.$attrs,{style:n,tabindex:"-1"}),[jr(a.$slots,"default",{ref:"list"})],16)]))}}),z4e=["tabindex"],Q4e={class:"pl-dropdown__container"},U4e={class:"pl-dropdown__field"},W4e=["disabled","placeholder"],j4e={key:0,class:"input-value"},K4e={class:"pl-dropdown__controls"},Y4e={key:2,class:"arrow-icon arrow-icon-default"},Z4e={key:0},X4e={key:0,class:"required-icon"},$4e={key:0,class:"nothing-found"},J4e={key:0,class:"pl-dropdown__error"},q4e={key:1,class:"pl-dropdown__helper"},eIe={key:2,class:"pl-dropdown__helper"},tIe={name:"PlDropdown"},g$=Tr({...tIe,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(e,{emit:t}){const r=t,s=e,n=dd(),i=br(),o=br(),a=B7("overlay"),l=oi({search:"",activeIndex:-1,open:!1,optionsHeight:0}),c=()=>f5(F.value.findIndex(G=>ng(G.value,s.modelValue)),G=>G<0?0:G),u=()=>l.activeIndex=c(),d=Je(()=>s.options===void 0),g=Je(()=>d.value?!0:s.disabled),A=Je(()=>(s.options??[]).findIndex(G=>ng(G.value,s.modelValue))),w=Je(()=>{if(!d.value){if(s.error)return s.error;if(s.modelValue!==void 0&&A.value===-1)return"The selected value is not one of the options"}}),v=Je(()=>o$(s.options??[]).map((G,N)=>({...G,index:N,isSelected:N===A.value,isActive:N===l.activeIndex}))),b=Je(()=>{const G=Pe(v).find(N=>ng(N.value,s.modelValue));return(G==null?void 0:G.label)||s.modelValue}),S=Je(()=>!l.open&&s.modelValue?"":s.modelValue?String(b.value):s.placeholder),P=Je(()=>s.modelValue!==void 0&&s.modelValue!==null),F=Je(()=>{const G=v.value;return l.search?G.filter(N=>{const W=l.search.toLowerCase();return N.label.toLowerCase().includes(W)||N.description&&N.description.toLowerCase().includes(W)?!0:typeof N.value=="string"?N.value.toLowerCase().includes(W):N.value===l.search}):G}),T=Je(()=>g.value?void 0:"0"),D=G=>{var N;r("update:modelValue",G),l.search="",l.open=!1,(N=i==null?void 0:i.value)==null||N.focus()},B=()=>r("update:modelValue",void 0),k=()=>{var G;return(G=o.value)==null?void 0:G.focus()},z=()=>{l.open=!l.open,l.open||(l.search="")},O=()=>l.open=!0,j=G=>{var N,W,V;const q=G.relatedTarget;!((N=i.value)!=null&&N.contains(q))&&!((V=(W=a.value)==null?void 0:W.listRef)!=null&&V.contains(q))&&(l.search="",l.open=!1)},_=G=>{var N,W;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(G.code))G.preventDefault();else return;const{open:V,activeIndex:q}=l;if(!V){G.code==="Enter"&&(l.open=!0);return}G.code==="Escape"&&(l.open=!1,(N=i.value)==null||N.focus());const pe=Pe(F),{length:X}=pe;if(!X)return;G.code==="Enter"&&D((W=pe.find(se=>se.index===q))==null?void 0:W.value);const re=pe.findIndex(se=>se.index===q)??-1,ae=G.code==="ArrowDown"?1:G.code==="ArrowUp"?-1:0,$=Math.abs(re+ae+X)%X;l.activeIndex=F.value[$].index??-1};return Jx(i),tn(()=>s.modelValue,u,{immediate:!0}),tn(()=>l.open,G=>{var N;return G?(N=o.value)==null?void 0:N.focus():""}),oW(()=>{var G;l.search,l.activeIndex>=0&&l.open&&((G=a.value)==null||G.scrollIntoActive())}),(G,N)=>(ye(),je("div",{class:"pl-dropdown__envelope",onClick:k},[We("div",{ref_key:"rootRef",ref:i,tabindex:T.value,class:St(["pl-dropdown",{open:l.open,error:G.error,disabled:g.value}]),onKeydown:_,onFocusout:j},[We("div",Q4e,[We("div",U4e,[Av(We("input",{ref_key:"input",ref:o,"onUpdate:modelValue":N[0]||(N[0]=W=>l.search=W),type:"text",tabindex:"-1",disabled:g.value,placeholder:S.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:O},null,40,W4e),[[pS,l.search]]),N[4]||(N[4]=Ne()),l.open?yt("",!0):(ye(),je("div",j4e,[zt(O4e,null,{default:er(()=>[Ne(Zt(b.value),1)]),_:1})])),N[5]||(N[5]=Ne()),We("div",K4e,[d.value?(ye(),jt(Pe(Vc),{key:0,name:"loading"})):yt("",!0),N[1]||(N[1]=Ne()),G.clearable&&P.value?(ye(),jt(Pe(_S),{key:1,name:"delete-clear",onClick:Nn(B,["stop"])})):yt("",!0),N[2]||(N[2]=Ne()),jr(G.$slots,"append"),N[3]||(N[3]=Ne()),We("div",{class:"pl-dropdown__arrow-wrapper",onClick:Nn(z,["stop"])},[G.arrowIconLarge?(ye(),je("div",{key:0,class:St(["arrow-icon",[`icon-24 ${G.arrowIconLarge}`]])},null,2)):G.arrowIcon?(ye(),je("div",{key:1,class:St(["arrow-icon",[`icon-16 ${G.arrowIcon}`]])},null,2)):(ye(),je("div",Y4e))])])]),N[9]||(N[9]=Ne()),G.label?(ye(),je("label",Z4e,[G.required?(ye(),je("i",X4e)):yt("",!0),N[6]||(N[6]=Ne()),We("span",null,Zt(G.label),1),N[7]||(N[7]=Ne()),Pe(n).tooltip?(ye(),jt(Pe(_h),{key:1,class:"info",position:"top"},{tooltip:er(()=>[jr(G.$slots,"tooltip")]),_:3})):yt("",!0)])):yt("",!0),N[10]||(N[10]=Ne()),l.open?(ye(),jt(Pe(p$),{key:1,ref:"overlay",root:i.value,class:"pl-dropdown__options",tabindex:"-1",gap:3},{default:er(()=>[(ye(!0),je(_s,null,Fh(F.value,(W,V)=>(ye(),jt(i$,{key:V,option:W,"is-selected":W.isSelected,"is-hovered":W.isActive,size:G.optionSize,onClick:Nn(q=>D(W.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),N[8]||(N[8]=Ne()),F.value.length?yt("",!0):(ye(),je("div",$4e,"Nothing found"))]),_:1},8,["root"])):yt("",!0),N[11]||(N[11]=Ne()),zt($x,{class:"pl-dropdown__contour"})])],42,z4e),N[12]||(N[12]=Ne()),w.value?(ye(),je("div",J4e,Zt(w.value),1)):d.value&&G.loadingOptionsHelper?(ye(),je("div",q4e,Zt(G.loadingOptionsHelper),1)):G.helper?(ye(),je("div",eIe,Zt(G.helper),1)):yt("",!0)]))}}),rIe={class:"pl-chip__text"},ZG=Tr({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(e){const t=br(),r=br(!1);return Yh(()=>{var s;t.value&&(r.value=((s=t.value)==null?void 0:s.clientWidth)>=256)}),(s,n)=>(ye(),jt(Pe(_h),{position:"top",class:"pl-chip-tooltip",delay:500},UU({default:er(()=>[n[4]||(n[4]=Ne()),We("div",{ref_key:"chip",ref:t,class:St(["pl-chip",{small:s.small}])},[We("div",rIe,[jr(s.$slots,"default")]),n[3]||(n[3]=Ne()),s.closeable?(ye(),je("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:n[0]||(n[0]=dw(i=>s.$emit("close"),["enter"])),onClick:n[1]||(n[1]=Nn(i=>s.$emit("close"),["stop"]))},n[2]||(n[2]=[We("div",{class:"pl-chip__close--icon"},null,-1)]),32)):yt("",!0)],2)]),_:2},[r.value?{name:"tooltip",fn:er(()=>[jr(s.$slots,"default")]),key:"0"}:void 0]),1024))}}),sIe=["tabindex"],nIe={class:"pl-dropdown-multi__container"},iIe={class:"pl-dropdown-multi__field"},oIe=["disabled","placeholder"],aIe={key:0,class:"chips-container"},lIe={class:"pl-dropdown-multi__controls"},cIe={key:0},uIe={key:0,class:"required-icon"},dIe={class:"pl-dropdown-multi__open-chips-container"},hIe={key:0,class:"nothing-found"},pIe={key:0,class:"pl-dropdown-multi__error"},gIe={key:1,class:"pl-dropdown-multi__helper"},fIe={name:"PlDropdownMulti"},AIe=Tr({...fIe,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{default:void 0},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const r=t,s=O=>r("update:modelValue",O),n=dd(),i=e,o=br(),a=br(),l=B7("overlay"),c=oi({search:"",activeOption:-1,open:!1,optionsHeight:0}),u=Je(()=>Array.isArray(i.modelValue)?i.modelValue:[]),d=Je(()=>c.open&&i.modelValue.length>0?i.placeholder:i.modelValue.length>0?"":i.placeholder),g=Je(()=>o$(i.options??[])),A=Je(()=>u.value.map(O=>g.value.find(j=>ng(j.value,O))).filter(O=>O!==void 0)),w=Je(()=>{const O=Pe(u),j=Pe(g);return(c.search?j.filter(_=>{const G=c.search.toLowerCase();return _.label.toLowerCase().includes(G)?!0:typeof _.value=="string"?_.value.toLowerCase().includes(G):_.value===c.search}):[...j]).map(_=>({..._,selected:YG(O,_.value)}))}),v=Je(()=>i.options===void 0),b=Je(()=>v.value?!0:i.disabled),S=Je(()=>b.value?void 0:"0"),P=()=>{c.activeOption=f5(w.value.findIndex(O=>ng(O.value,i.modelValue)),O=>O<0?0:O)},F=O=>{var j;const _=Pe(u);s(YG(_,O)?_.filter(G=>!ng(G,O)):[..._,O]),c.search="",(j=o==null?void 0:o.value)==null||j.focus()},T=O=>s(Pe(u).filter(j=>!ng(j,O))),D=()=>{var O;return(O=a.value)==null?void 0:O.focus()},B=()=>{c.open=!c.open,c.open||(c.search="")},k=O=>{var j,_,G;const N=O.relatedTarget;!((j=o.value)!=null&&j.contains(N))&&!((G=(_=l.value)==null?void 0:_.listRef)!=null&&G.contains(N))&&(c.search="",c.open=!1)},z=O=>{var j;const{open:_,activeOption:G}=c;if(!_){O.code==="Enter"&&(c.open=!0);return}O.code==="Escape"&&(c.open=!1,(j=o.value)==null||j.focus());const N=Pe(w),{length:W}=N;if(!W)return;["ArrowDown","ArrowUp","Enter"].includes(O.code)&&O.preventDefault(),O.code==="Enter"&&F(N[G].value);const V=O.code==="ArrowDown"?1:O.code==="ArrowUp"?-1:0;c.activeOption=Math.abs(G+V+W)%W,requestAnimationFrame(()=>{var q;return(q=l.value)==null?void 0:q.scrollIntoActive()})};return Jx(o),tn(()=>i.modelValue,()=>P(),{immediate:!0}),oW(()=>{var O;c.search,c.open&&((O=l.value)==null||O.scrollIntoActive())}),(O,j)=>(ye(),je("div",{class:"pl-dropdown-multi__envelope",onClick:D},[We("div",{ref_key:"rootRef",ref:o,tabindex:S.value,class:St(["pl-dropdown-multi",{open:c.open,error:O.error,disabled:b.value}]),onKeydown:z,onFocusout:k},[We("div",nIe,[We("div",iIe,[Av(We("input",{ref_key:"input",ref:a,"onUpdate:modelValue":j[0]||(j[0]=_=>c.search=_),type:"text",tabindex:"-1",disabled:b.value,placeholder:d.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:j[1]||(j[1]=_=>c.open=!0)},null,40,oIe),[[pS,c.search]]),j[6]||(j[6]=Ne()),c.open?yt("",!0):(ye(),je("div",aIe,[(ye(!0),je(_s,null,Fh(A.value,(_,G)=>(ye(),jt(Pe(ZG),{key:G,closeable:"",small:"",onClick:j[2]||(j[2]=Nn(N=>c.open=!0,["stop"])),onClose:N=>T(_.value)},{default:er(()=>[Ne(Zt(_.label||_.value),1)]),_:2},1032,["onClose"]))),128))])),j[7]||(j[7]=Ne()),We("div",lIe,[v.value?(ye(),jt(Pe(Vc),{key:0,name:"loading"})):yt("",!0),j[4]||(j[4]=Ne()),jr(O.$slots,"append"),j[5]||(j[5]=Ne()),We("div",{class:"pl-dropdown-multi__arrow-wrapper",onClick:Nn(B,["stop"])},j[3]||(j[3]=[We("div",{class:"arrow-icon arrow-icon-default"},null,-1)]))])]),j[12]||(j[12]=Ne()),O.label?(ye(),je("label",cIe,[O.required?(ye(),je("i",uIe)):yt("",!0),j[8]||(j[8]=Ne()),We("span",null,Zt(O.label),1),j[9]||(j[9]=Ne()),Pe(n).tooltip?(ye(),jt(Pe(_h),{key:1,class:"info",position:"top"},{tooltip:er(()=>[jr(O.$slots,"tooltip")]),_:3})):yt("",!0)])):yt("",!0),j[13]||(j[13]=Ne()),c.open?(ye(),jt(p$,{key:1,ref_key:"overlay",ref:l,root:o.value,class:"pl-dropdown-multi__options",gap:5,tabindex:"-1",onFocusout:k},{default:er(()=>[We("div",dIe,[(ye(!0),je(_s,null,Fh(A.value,(_,G)=>(ye(),jt(Pe(ZG),{key:G,closeable:"",small:"",onClose:N=>T(_.value)},{default:er(()=>[Ne(Zt(_.label||_.value),1)]),_:2},1032,["onClose"]))),128))]),j[10]||(j[10]=Ne()),(ye(!0),je(_s,null,Fh(w.value,(_,G)=>(ye(),jt(i$,{key:G,option:_,"text-item":"text","is-selected":_.selected,"is-hovered":c.activeOption==G,size:"medium","use-checkbox":"",onClick:Nn(N=>F(_.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),j[11]||(j[11]=Ne()),w.value.length?yt("",!0):(ye(),je("div",hIe,"Nothing found"))]),_:1},8,["root"])):yt("",!0),j[14]||(j[14]=Ne()),zt($x,{class:"pl-dropdown-multi__contour"})])],42,sIe),j[15]||(j[15]=Ne()),O.error?(ye(),je("div",pIe,Zt(O.error),1)):O.helper?(ye(),je("div",gIe,Zt(O.helper),1)):yt("",!0)]))}}),XG=Tr({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean},indeterminate:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=e;return(r,s)=>(ye(),je("div",{tabindex:"0",class:St(["pl-checkbox-base",{...t.indeterminate?{indeterminate:!0}:{checked:t.modelValue},disabled:r.disabled}]),onClick:s[0]||(s[0]=n=>r.$emit("update:modelValue",!r.modelValue)),onKeydown:s[1]||(s[1]=dw(Nn(n=>r.$emit("update:modelValue",!r.modelValue),["prevent"]),["space"]))},null,34))}}),mIe={name:"PlCheckbox"},vIe=Tr({...mIe,props:{modelValue:{type:Boolean},disabled:{type:Boolean},indeterminate:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=e,r=dd();return(s,n)=>Pe(r).default?(ye(),je("div",{key:0,class:St(["pl-checkbox",{disabled:s.disabled}])},[zt(XG,dl(t,{"onUpdate:modelValue":n[0]||(n[0]=i=>s.$emit("update:modelValue",i))}),null,16),n[3]||(n[3]=Ne()),We("label",{onClick:n[1]||(n[1]=i=>s.$emit("update:modelValue",!s.$props.modelValue))},[jr(s.$slots,"default")])],2)):(ye(),jt(XG,dl({key:1},t,{"onUpdate:modelValue":n[2]||(n[2]=i=>s.$emit("update:modelValue",i))}),null,16))}}),CIe="_component_tupwt_1",wIe={component:CIe},yIe={};function bIe(e,t){return ye(),je("div",{class:St(e.$style.component)},t[0]||(t[0]=[We("div",null,null,-1)]),2)}const SIe={$style:wIe},xIe=$h(yIe,[["render",bIe],["__cssModules",SIe]]),EIe={key:1,class:"pl-dialog-modal__title"},PIe={inheritAttrs:!1},f$=Tr({...PIe,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean},size:{default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const r=dd(),s=t,n=e,i=br(),o=Je(()=>{const{width:l,height:c,minHeight:u,maxHeight:d,size:g}=n;return g==="small"?{width:"448px",height:"440px",minHeight:"auto",maxHeight:"auto"}:g==="medium"?{width:"720px",height:"720px",minHeight:"auto",maxHeight:"auto"}:g==="large"?{width:"1080px",height:"880px",minHeight:"auto",maxHeight:"auto"}:{width:l,height:c,minHeight:u,maxHeight:d}});function a(l){i.value&&n.closeOnOutsideClick&&document.contains(l.target)&&!i.value.contains(l.target)&&s("update:modelValue",!1)}return cv(document.body,"keyup",l=>{n.modelValue&&l.code==="Escape"&&s("update:modelValue",!1)}),(l,c)=>(ye(),jt(kx,{to:"body"},[zt(V7,{name:"dialog"},{default:er(()=>[l.modelValue?(ye(),je("div",{key:0,class:"pl-dialog-modal__shadow",onClick:a},[We("div",dl(l.$attrs,{ref_key:"modal",ref:i,class:["pl-dialog-modal",{"has-title":Pe(r).title,"has-content":Pe(r).default}],style:o.value}),[l.closable?(ye(),jt(xIe,{key:0,class:"close-modal-btn",onClick:c[0]||(c[0]=Nn(u=>s("update:modelValue",!1),["stop"]))})):yt("",!0),c[1]||(c[1]=Ne()),Pe(r).title?(ye(),je("div",EIe,[jr(l.$slots,"title")])):yt("",!0),c[2]||(c[2]=Ne()),We("div",{class:St(["pl-dialog-modal__content",{"no-content-gutters":l.noContentGutters,"no-top-content-gutter":l.noTopContentGutter}])},[jr(l.$slots,"default")],2),c[3]||(c[3]=Ne()),Pe(r).actions?(ye(),je("div",{key:2,class:St(["pl-dialog-modal__actions",{"has-top-border":l.actionsHasTopBorder}])},[jr(l.$slots,"actions")],2)):yt("",!0)],16)])):yt("",!0)]),_:3})]))}}),FIe=Tr({__name:"TransitionSlidePanel",setup(e){function t(){window.dispatchEvent(new CustomEvent("adjust"))}function r(){window.dispatchEvent(new CustomEvent("adjust"))}return(s,n)=>(ye(),jt(V7,{name:"slide-panel",onAfterEnter:t,onAfterLeave:r},{default:er(()=>[jr(s.$slots,"default")]),_:3}))}}),RIe={key:0,class:"pl-slide-modal__title"},TIe={class:"pl-slide-modal__title-content"},DIe={class:"pl-slide-modal__content"},MIe={key:1,class:"pl-slide-modal__actions"},IIe={name:"PlSlideModal",inheritAttrs:!1},kIe=Tr({...IIe,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const r=dd(),s=t,n=e,i=br(),o=doe();return h$(i,()=>{n.modelValue&&n.closeOnOutsideClick&&s("update:modelValue",!1)}),cv(document,"keydown",a=>{a.key==="Escape"&&s("update:modelValue",!1)}),(a,l)=>(ye(),jt(kx,{to:"body"},[zt(FIe,null,{default:er(()=>[a.modelValue?(ye(),je("div",dl({key:0,ref_key:"modal",ref:i,style:{width:a.width}},Pe(o),{class:["pl-slide-modal",{"has-title":Pe(r).title,"has-actions":Pe(r).actions}],onKeyup:l[1]||(l[1]=dw(c=>s("update:modelValue",!1),["esc"]))}),[We("div",{class:"close-dialog-btn",onClick:l[0]||(l[0]=c=>s("update:modelValue",!1))}),l[3]||(l[3]=Ne()),Pe(r).title?(ye(),je("div",RIe,[We("span",TIe,[jr(a.$slots,"title")])])):yt("",!0),l[4]||(l[4]=Ne()),We("div",DIe,[jr(a.$slots,"default")]),l[5]||(l[5]=Ne()),Pe(r).actions?(ye(),je("div",MIe,[jr(a.$slots,"actions")])):yt("",!0)],16)):yt("",!0)]),_:3}),l[6]||(l[6]=Ne()),a.modelValue&&a.shadow?(ye(),je("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:l[2]||(l[2]=dw(c=>s("update:modelValue",!1),["esc"]))},null,32)):yt("",!0)]))}});function A$(e){return x7()?(iU(e),!0):!1}const m$=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function BIe(e,t,r={}){const{immediate:s=!0}=r,n=br(!1);let i=null;function o(){i&&(clearTimeout(i),i=null)}function a(){n.value=!1,o()}function l(...c){o(),n.value=!0,i=setTimeout(()=>{n.value=!1,i=null,e(...c)},N2(t))}return s&&(n.value=!0,m$&&l()),A$(a),{isPending:T7(n),start:l,stop:a}}function LIe(e,t,r){return tn(e,(s,n,i)=>{s&&t(s,n,i)},{...r,once:!1})}function HIe(e,t,r={}){const{immediate:s=!0}=r,{start:n}=BIe(o,t,{immediate:!1}),i=br(!1);async function o(){i.value&&(await e(),n())}function a(){i.value||(i.value=!0,o())}function l(){i.value=!1}return s&&m$&&a(),A$(l),{isActive:i,pause:l,resume:a}}var vs;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{const i={};for(const o of n)i[o]=o;return i},e.getValidEnumValues=n=>{const i=e.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(const a of i)o[a]=n[a];return e.objectValues(o)},e.objectValues=n=>e.objectKeys(n).map(function(i){return n[i]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(o);return i},e.find=(n,i)=>{for(const o of n)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,i=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=s,e.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(vs||(vs={}));var $k;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})($k||($k={}));const Gt=vs.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zf=e=>{switch(typeof e){case"undefined":return Gt.undefined;case"string":return Gt.string;case"number":return isNaN(e)?Gt.nan:Gt.number;case"boolean":return Gt.boolean;case"function":return Gt.function;case"bigint":return Gt.bigint;case"symbol":return Gt.symbol;case"object":return Array.isArray(e)?Gt.array:e===null?Gt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Gt.promise:typeof Map<"u"&&e instanceof Map?Gt.map:typeof Set<"u"&&e instanceof Set?Gt.set:typeof Date<"u"&&e instanceof Date?Gt.date:Gt.object;default:return Gt.unknown}},At=vs.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),GIe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Wl extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(i){return i.message},s={_errors:[]},n=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(r(o));else{let a=s,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return n(this),s}static assert(t){if(!(t instanceof Wl))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,vs.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},s=[];for(const n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):s.push(t(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}Wl.create=e=>new Wl(e);const Fw=(e,t)=>{let r;switch(e.code){case At.invalid_type:e.received===Gt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case At.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,vs.jsonStringifyReplacer)}`;break;case At.unrecognized_keys:r=`Unrecognized key(s) in object: ${vs.joinValues(e.keys,", ")}`;break;case At.invalid_union:r="Invalid input";break;case At.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${vs.joinValues(e.options)}`;break;case At.invalid_enum_value:r=`Invalid enum value. Expected ${vs.joinValues(e.options)}, received '${e.received}'`;break;case At.invalid_arguments:r="Invalid function arguments";break;case At.invalid_return_type:r="Invalid function return type";break;case At.invalid_date:r="Invalid date";break;case At.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:vs.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case At.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case At.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case At.custom:r="Invalid input";break;case At.invalid_intersection_types:r="Intersection results could not be merged";break;case At.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case At.not_finite:r="Number must be finite";break;default:r=t.defaultError,vs.assertNever(e)}return{message:r}};let v$=Fw;function OIe(e){v$=e}function BF(){return v$}const LF=e=>{const{data:t,path:r,errorMaps:s,issueData:n}=e,i=[...r,...n.path||[]],o={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let a="";const l=s.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...n,path:i,message:a}},NIe=[];function It(e,t){const r=BF(),s=LF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Fw?void 0:Fw].filter(n=>!!n)});e.common.issues.push(s)}class Oo{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const s=[];for(const n of r){if(n.status==="aborted")return Fr;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,r){const s=[];for(const n of r){const i=await n.key,o=await n.value;s.push({key:i,value:o})}return Oo.mergeObjectSync(t,s)}static mergeObjectSync(t,r){const s={};for(const n of r){const{key:i,value:o}=n;if(i.status==="aborted"||o.status==="aborted")return Fr;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[i.value]=o.value)}return{status:t.value,value:s}}}const Fr=Object.freeze({status:"aborted"}),HF=e=>({status:"dirty",value:e}),Aa=e=>({status:"valid",value:e}),Jk=e=>e.status==="aborted",qk=e=>e.status==="dirty",VS=e=>e.status==="valid",zS=e=>typeof Promise<"u"&&e instanceof Promise;function GF(e,t,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function C$(e,t,r,s,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var Jt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Jt||(Jt={}));var m1,v1;let Vh=class{constructor(e,t,r,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const $G=(e,t)=>{if(VS(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Wl(e.common.issues);return this._error=r,this._error}}};function Vr(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:s,description:n}=e;if(t&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(i,o)=>{var a,l;const{message:c}=e;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:(a=c??s)!==null&&a!==void 0?a:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:o.defaultError}},description:n}}let Zr=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Zf(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Zf(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Oo,ctx:{common:e.parent.common,data:e.data,parsedType:Zf(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(zS(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const s={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zf(e)},n=this._parseSync({data:e,path:s.path,parent:s});return $G(s,n)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zf(e)},s=this._parse({data:e,path:r.path,parent:r}),n=await(zS(s)?s:Promise.resolve(s));return $G(r,n)}refine(e,t){const r=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,n)=>{const i=e(s),o=()=>n.addIssue({code:At.custom,...r(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(a=>a?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof t=="function"?t(r,s):t),!1))}_refinement(e){return new ad({schema:this,typeName:vr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Mh.create(this,this._def)}nullable(){return bA.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ju.create(this,this._def)}promise(){return Tw.create(this,this._def)}or(e){return YS.create([this,e],this._def)}and(e){return ZS.create(this,e,this._def)}transform(e){return new ad({...Vr(this._def),schema:this,typeName:vr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ex({...Vr(this._def),innerType:this,defaultValue:t,typeName:vr.ZodDefault})}brand(){return new v5({typeName:vr.ZodBranded,type:this,...Vr(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new tx({...Vr(this._def),innerType:this,catchValue:t,typeName:vr.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return e3.create(this,e)}readonly(){return rx.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const _Ie=/^c[^\s-]{8,}$/i,VIe=/^[0-9a-z]+$/,zIe=/^[0-9A-HJKMNP-TV-Z]{26}$/,QIe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,UIe=/^[a-z0-9_-]{21}$/i,WIe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jIe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KIe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let h4;const YIe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ZIe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,XIe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,w$="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",$Ie=new RegExp(`^${w$}$`);function y$(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function JIe(e){return new RegExp(`^${y$(e)}$`)}function b$(e){let t=`${w$}T${y$(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function qIe(e,t){return!!((t==="v4"||!t)&&YIe.test(e)||(t==="v6"||!t)&&ZIe.test(e))}class Qu extends Zr{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Gt.string){const n=this._getOrReturnCtx(t);return It(n,{code:At.invalid_type,expected:Gt.string,received:n.parsedType}),Fr}const r=new Oo;let s;for(const n of this._def.checks)if(n.kind==="min")t.data.length<n.value&&(s=this._getOrReturnCtx(t,s),It(s,{code:At.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="max")t.data.length>n.value&&(s=this._getOrReturnCtx(t,s),It(s,{code:At.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=t.data.length>n.value,o=t.data.length<n.value;(i||o)&&(s=this._getOrReturnCtx(t,s),i?It(s,{code:At.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&It(s,{code:At.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if(n.kind==="email")jIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"email",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="emoji")h4||(h4=new RegExp(KIe,"u")),h4.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"emoji",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="uuid")QIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"uuid",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="nanoid")UIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"nanoid",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid")_Ie.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"cuid",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid2")VIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"cuid2",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="ulid")zIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"ulid",code:At.invalid_string,message:n.message}),r.dirty());else if(n.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),It(s,{validation:"url",code:At.invalid_string,message:n.message}),r.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"regex",code:At.invalid_string,message:n.message}),r.dirty())):n.kind==="trim"?t.data=t.data.trim():n.kind==="includes"?t.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()):n.kind==="toLowerCase"?t.data=t.data.toLowerCase():n.kind==="toUpperCase"?t.data=t.data.toUpperCase():n.kind==="startsWith"?t.data.startsWith(n.value)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()):n.kind==="endsWith"?t.data.endsWith(n.value)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()):n.kind==="datetime"?b$(n).test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:"datetime",message:n.message}),r.dirty()):n.kind==="date"?$Ie.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:"date",message:n.message}),r.dirty()):n.kind==="time"?JIe(n).test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{code:At.invalid_string,validation:"time",message:n.message}),r.dirty()):n.kind==="duration"?WIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"duration",code:At.invalid_string,message:n.message}),r.dirty()):n.kind==="ip"?qIe(t.data,n.version)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"ip",code:At.invalid_string,message:n.message}),r.dirty()):n.kind==="base64"?XIe.test(t.data)||(s=this._getOrReturnCtx(t,s),It(s,{validation:"base64",code:At.invalid_string,message:n.message}),r.dirty()):vs.assertNever(n);return{status:r.value,value:t.data}}_regex(t,r,s){return this.refinement(n=>t.test(n),{validation:r,code:At.invalid_string,...Jt.errToObj(s)})}_addCheck(t){return new Qu({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Jt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Jt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Jt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Jt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Jt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Jt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Jt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Jt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Jt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Jt.errToObj(t)})}datetime(t){var r,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...Jt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Jt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Jt.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Jt.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Jt.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Jt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Jt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Jt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Jt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Jt.errToObj(r)})}nonempty(t){return this.min(1,Jt.errToObj(t))}trim(){return new Qu({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Qu({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Qu({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Qu.create=e=>{var t;return new Qu({checks:[],typeName:vr.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Vr(e)})};function eke(e,t){const r=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=r>s?r:s,i=parseInt(e.toFixed(n).replace(".","")),o=parseInt(t.toFixed(n).replace(".",""));return i%o/Math.pow(10,n)}let QS=class eB extends Zr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Gt.number){const n=this._getOrReturnCtx(t);return It(n,{code:At.invalid_type,expected:Gt.number,received:n.parsedType}),Fr}let r;const s=new Oo;for(const n of this._def.checks)n.kind==="int"?vs.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),It(r,{code:At.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="multipleOf"?eke(t.data,n.value)!==0&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):n.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),It(r,{code:At.not_finite,message:n.message}),s.dirty()):vs.assertNever(n);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Jt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Jt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Jt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Jt.toString(r))}setLimit(t,r,s,n){return new eB({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:Jt.toString(n)}]})}_addCheck(t){return new eB({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Jt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Jt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Jt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Jt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Jt.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&vs.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(r)&&Number.isFinite(t)}};QS.create=e=>new QS({checks:[],typeName:vr.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Vr(e)});class wA extends Zr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Gt.bigint){const n=this._getOrReturnCtx(t);return It(n,{code:At.invalid_type,expected:Gt.bigint,received:n.parsedType}),Fr}let r;const s=new Oo;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="multipleOf"?t.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),It(r,{code:At.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):vs.assertNever(n);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Jt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Jt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Jt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Jt.toString(r))}setLimit(t,r,s,n){return new wA({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:Jt.toString(n)}]})}_addCheck(t){return new wA({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Jt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Jt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Jt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Jt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Jt.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}wA.create=e=>{var t;return new wA({checks:[],typeName:vr.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Vr(e)})};let US=class extends Zr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Gt.boolean){const t=this._getOrReturnCtx(e);return It(t,{code:At.invalid_type,expected:Gt.boolean,received:t.parsedType}),Fr}return Aa(e.data)}};US.create=e=>new US({typeName:vr.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Vr(e)});let WS=class S$ extends Zr{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Gt.date){const n=this._getOrReturnCtx(t);return It(n,{code:At.invalid_type,expected:Gt.date,received:n.parsedType}),Fr}if(isNaN(t.data.getTime())){const n=this._getOrReturnCtx(t);return It(n,{code:At.invalid_date}),Fr}const r=new Oo;let s;for(const n of this._def.checks)n.kind==="min"?t.data.getTime()<n.value&&(s=this._getOrReturnCtx(t,s),It(s,{code:At.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):n.kind==="max"?t.data.getTime()>n.value&&(s=this._getOrReturnCtx(t,s),It(s,{code:At.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):vs.assertNever(n);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new S$({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Jt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Jt.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};WS.create=e=>new WS({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:vr.ZodDate,...Vr(e)});let OF=class extends Zr{_parse(e){if(this._getType(e)!==Gt.symbol){const t=this._getOrReturnCtx(e);return It(t,{code:At.invalid_type,expected:Gt.symbol,received:t.parsedType}),Fr}return Aa(e.data)}};OF.create=e=>new OF({typeName:vr.ZodSymbol,...Vr(e)});class jS extends Zr{_parse(t){if(this._getType(t)!==Gt.undefined){const r=this._getOrReturnCtx(t);return It(r,{code:At.invalid_type,expected:Gt.undefined,received:r.parsedType}),Fr}return Aa(t.data)}}jS.create=e=>new jS({typeName:vr.ZodUndefined,...Vr(e)});class KS extends Zr{_parse(t){if(this._getType(t)!==Gt.null){const r=this._getOrReturnCtx(t);return It(r,{code:At.invalid_type,expected:Gt.null,received:r.parsedType}),Fr}return Aa(t.data)}}KS.create=e=>new KS({typeName:vr.ZodNull,...Vr(e)});let Rw=class extends Zr{constructor(){super(...arguments),this._any=!0}_parse(e){return Aa(e.data)}};Rw.create=e=>new Rw({typeName:vr.ZodAny,...Vr(e)});class uv extends Zr{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Aa(t.data)}}uv.create=e=>new uv({typeName:vr.ZodUnknown,...Vr(e)});class mg extends Zr{_parse(t){const r=this._getOrReturnCtx(t);return It(r,{code:At.invalid_type,expected:Gt.never,received:r.parsedType}),Fr}}mg.create=e=>new mg({typeName:vr.ZodNever,...Vr(e)});let NF=class extends Zr{_parse(e){if(this._getType(e)!==Gt.undefined){const t=this._getOrReturnCtx(e);return It(t,{code:At.invalid_type,expected:Gt.void,received:t.parsedType}),Fr}return Aa(e.data)}};NF.create=e=>new NF({typeName:vr.ZodVoid,...Vr(e)});class Ju extends Zr{_parse(t){const{ctx:r,status:s}=this._processInputParams(t),n=this._def;if(r.parsedType!==Gt.array)return It(r,{code:At.invalid_type,expected:Gt.array,received:r.parsedType}),Fr;if(n.exactLength!==null){const o=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(o||a)&&(It(r,{code:o?At.too_big:At.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(It(r,{code:At.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(It(r,{code:At.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>n.type._parseAsync(new Vh(r,o,r.path,a)))).then(o=>Oo.mergeArray(s,o));const i=[...r.data].map((o,a)=>n.type._parseSync(new Vh(r,o,r.path,a)));return Oo.mergeArray(s,i)}get element(){return this._def.type}min(t,r){return new Ju({...this._def,minLength:{value:t,message:Jt.toString(r)}})}max(t,r){return new Ju({...this._def,maxLength:{value:t,message:Jt.toString(r)}})}length(t,r){return new Ju({...this._def,exactLength:{value:t,message:Jt.toString(r)}})}nonempty(t){return this.min(1,t)}}Ju.create=(e,t)=>new Ju({type:e,minLength:null,maxLength:null,exactLength:null,typeName:vr.ZodArray,...Vr(t)});function L0(e){if(e instanceof Jc){const t={};for(const r in e.shape){const s=e.shape[r];t[r]=Mh.create(L0(s))}return new Jc({...e._def,shape:()=>t})}else return e instanceof Ju?new Ju({...e._def,type:L0(e.element)}):e instanceof Mh?Mh.create(L0(e.unwrap())):e instanceof bA?bA.create(L0(e.unwrap())):e instanceof yA?yA.create(e.items.map(t=>L0(t))):e}let Jc=class Lu extends Zr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=vs.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Gt.object){const l=this._getOrReturnCtx(t);return It(l,{code:At.invalid_type,expected:Gt.object,received:l.parsedType}),Fr}const{status:r,ctx:s}=this._processInputParams(t),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof mg&&this._def.unknownKeys==="strip"))for(const l in s.data)i.includes(l)||o.push(l);const a=[];for(const l of i){const c=n[l],u=s.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Vh(s,u,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof mg){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of o)a.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});else if(l==="strict")o.length>0&&(It(s,{code:At.unrecognized_keys,keys:o}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of o){const u=s.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Vh(s,u,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of a){const u=await c.key,d=await c.value;l.push({key:u,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>Oo.mergeObjectSync(r,l)):Oo.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(t){return Jt.errToObj,new Lu({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,s)=>{var n,i,o,a;const l=(o=(i=(n=this._def).errorMap)===null||i===void 0?void 0:i.call(n,r,s).message)!==null&&o!==void 0?o:s.defaultError;return r.code==="unrecognized_keys"?{message:(a=Jt.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Lu({...this._def,unknownKeys:"strip"})}passthrough(){return new Lu({...this._def,unknownKeys:"passthrough"})}extend(t){return new Lu({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Lu({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:vr.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Lu({...this._def,catchall:t})}pick(t){const r={};return vs.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new Lu({...this._def,shape:()=>r})}omit(t){const r={};return vs.objectKeys(this.shape).forEach(s=>{t[s]||(r[s]=this.shape[s])}),new Lu({...this._def,shape:()=>r})}deepPartial(){return L0(this)}partial(t){const r={};return vs.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];t&&!t[s]?r[s]=n:r[s]=n.optional()}),new Lu({...this._def,shape:()=>r})}required(t){const r={};return vs.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])r[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof Mh;)n=n._def.innerType;r[s]=n}}),new Lu({...this._def,shape:()=>r})}keyof(){return F$(vs.objectKeys(this.shape))}};Jc.create=(e,t)=>new Jc({shape:()=>e,unknownKeys:"strip",catchall:mg.create(),typeName:vr.ZodObject,...Vr(t)});Jc.strictCreate=(e,t)=>new Jc({shape:()=>e,unknownKeys:"strict",catchall:mg.create(),typeName:vr.ZodObject,...Vr(t)});Jc.lazycreate=(e,t)=>new Jc({shape:e,unknownKeys:"strip",catchall:mg.create(),typeName:vr.ZodObject,...Vr(t)});let YS=class extends Zr{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function s(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=n.map(o=>new Wl(o.ctx.common.issues));return It(t,{code:At.invalid_union,unionErrors:i}),Fr}if(t.common.async)return Promise.all(r.map(async n=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let n;const i=[];for(const a of r){const l={...t,common:{...t.common,issues:[]},parent:null},c=a._parseSync({data:t.data,path:t.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!n&&(n={result:c,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const o=i.map(a=>new Wl(a));return It(t,{code:At.invalid_union,unionErrors:o}),Fr}}get options(){return this._def.options}};YS.create=(e,t)=>new YS({options:e,typeName:vr.ZodUnion,...Vr(t)});const kf=e=>e instanceof $S?kf(e.schema):e instanceof ad?kf(e.innerType()):e instanceof JS?[e.value]:e instanceof qx?e.options:e instanceof qS?vs.objectValues(e.enum):e instanceof ex?kf(e._def.innerType):e instanceof jS?[void 0]:e instanceof KS?[null]:e instanceof Mh?[void 0,...kf(e.unwrap())]:e instanceof bA?[null,...kf(e.unwrap())]:e instanceof v5||e instanceof rx?kf(e.unwrap()):e instanceof tx?kf(e._def.innerType):[];let x$=class E$ extends Zr{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Gt.object)return It(r,{code:At.invalid_type,expected:Gt.object,received:r.parsedType}),Fr;const s=this.discriminator,n=r.data[s],i=this.optionsMap.get(n);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(It(r,{code:At.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Fr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,s){const n=new Map;for(const i of r){const o=kf(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(n.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,i)}}return new E$({typeName:vr.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...Vr(s)})}};function tB(e,t){const r=Zf(e),s=Zf(t);if(e===t)return{valid:!0,data:e};if(r===Gt.object&&s===Gt.object){const n=vs.objectKeys(t),i=vs.objectKeys(e).filter(a=>n.indexOf(a)!==-1),o={...e,...t};for(const a of i){const l=tB(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===Gt.array&&s===Gt.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let i=0;i<e.length;i++){const o=e[i],a=t[i],l=tB(o,a);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===Gt.date&&s===Gt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ZS extends Zr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=(i,o)=>{if(Jk(i)||Jk(o))return Fr;const a=tB(i.value,o.value);return a.valid?((qk(i)||qk(o))&&r.dirty(),{status:r.value,value:a.data}):(It(s,{code:At.invalid_intersection_types}),Fr)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,o])=>n(i,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ZS.create=(e,t,r)=>new ZS({left:e,right:t,typeName:vr.ZodIntersection,...Vr(r)});let yA=class P$ extends Zr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Gt.array)return It(s,{code:At.invalid_type,expected:Gt.array,received:s.parsedType}),Fr;if(s.data.length<this._def.items.length)return It(s,{code:At.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Fr;!this._def.rest&&s.data.length>this._def.items.length&&(It(s,{code:At.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const n=[...s.data].map((i,o)=>{const a=this._def.items[o]||this._def.rest;return a?a._parse(new Vh(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(n).then(i=>Oo.mergeArray(r,i)):Oo.mergeArray(r,n)}get items(){return this._def.items}rest(t){return new P$({...this._def,rest:t})}};yA.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yA({items:e,typeName:vr.ZodTuple,rest:null,...Vr(t)})};class XS extends Zr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Gt.object)return It(s,{code:At.invalid_type,expected:Gt.object,received:s.parsedType}),Fr;const n=[],i=this._def.keyType,o=this._def.valueType;for(const a in s.data)n.push({key:i._parse(new Vh(s,a,s.path,a)),value:o._parse(new Vh(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?Oo.mergeObjectAsync(r,n):Oo.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,s){return r instanceof Zr?new XS({keyType:t,valueType:r,typeName:vr.ZodRecord,...Vr(s)}):new XS({keyType:Qu.create(),valueType:t,typeName:vr.ZodRecord,...Vr(r)})}}let _F=class extends Zr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Gt.map)return It(r,{code:At.invalid_type,expected:Gt.map,received:r.parsedType}),Fr;const s=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([o,a],l)=>({key:s._parse(new Vh(r,o,r.path,[l,"key"])),value:n._parse(new Vh(r,a,r.path,[l,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const a of i){const l=await a.key,c=await a.value;if(l.status==="aborted"||c.status==="aborted")return Fr;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(l.value,c.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const a of i){const l=a.key,c=a.value;if(l.status==="aborted"||c.status==="aborted")return Fr;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(l.value,c.value)}return{status:t.value,value:o}}}};_F.create=(e,t,r)=>new _F({valueType:t,keyType:e,typeName:vr.ZodMap,...Vr(r)});let VF=class rB extends Zr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Gt.set)return It(s,{code:At.invalid_type,expected:Gt.set,received:s.parsedType}),Fr;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(It(s,{code:At.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(It(s,{code:At.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Fr;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}const a=[...s.data.values()].map((l,c)=>i._parse(new Vh(s,l,s.path,c)));return s.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,r){return new rB({...this._def,minSize:{value:t,message:Jt.toString(r)}})}max(t,r){return new rB({...this._def,maxSize:{value:t,message:Jt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};VF.create=(e,t)=>new VF({valueType:e,minSize:null,maxSize:null,typeName:vr.ZodSet,...Vr(t)});class sw extends Zr{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Gt.function)return It(r,{code:At.invalid_type,expected:Gt.function,received:r.parsedType}),Fr;function s(a,l){return LF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,BF(),Fw].filter(c=>!!c),issueData:{code:At.invalid_arguments,argumentsError:l}})}function n(a,l){return LF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,BF(),Fw].filter(c=>!!c),issueData:{code:At.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Tw){const a=this;return Aa(async function(...l){const c=new Wl([]),u=await a._def.args.parseAsync(l,i).catch(g=>{throw c.addIssue(s(l,g)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(n(d,g)),c})})}else{const a=this;return Aa(function(...l){const c=a._def.args.safeParse(l,i);if(!c.success)throw new Wl([s(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,i);if(!d.success)throw new Wl([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new sw({...this._def,args:yA.create(t).rest(uv.create())})}returns(t){return new sw({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,s){return new sw({args:t||yA.create([]).rest(uv.create()),returns:r||uv.create(),typeName:vr.ZodFunction,...Vr(s)})}}let $S=class extends Zr{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};$S.create=(e,t)=>new $S({getter:e,typeName:vr.ZodLazy,...Vr(t)});let JS=class extends Zr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return It(t,{received:t.data,code:At.invalid_literal,expected:this._def.value}),Fr}return{status:"valid",value:e.data}}get value(){return this._def.value}};JS.create=(e,t)=>new JS({value:e,typeName:vr.ZodLiteral,...Vr(t)});function F$(e,t){return new qx({values:e,typeName:vr.ZodEnum,...Vr(t)})}let qx=class sB extends Zr{constructor(){super(...arguments),m1.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),s=this._def.values;return It(r,{expected:vs.joinValues(s),received:r.parsedType,code:At.invalid_type}),Fr}if(GF(this,m1)||C$(this,m1,new Set(this._def.values)),!GF(this,m1).has(t.data)){const r=this._getOrReturnCtx(t),s=this._def.values;return It(r,{received:r.data,code:At.invalid_enum_value,options:s}),Fr}return Aa(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return sB.create(t,{...this._def,...r})}exclude(t,r=this._def){return sB.create(this.options.filter(s=>!t.includes(s)),{...this._def,...r})}};m1=new WeakMap;qx.create=F$;let qS=class extends Zr{constructor(){super(...arguments),v1.set(this,void 0)}_parse(e){const t=vs.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Gt.string&&r.parsedType!==Gt.number){const s=vs.objectValues(t);return It(r,{expected:vs.joinValues(s),received:r.parsedType,code:At.invalid_type}),Fr}if(GF(this,v1)||C$(this,v1,new Set(vs.getValidEnumValues(this._def.values))),!GF(this,v1).has(e.data)){const s=vs.objectValues(t);return It(r,{received:r.data,code:At.invalid_enum_value,options:s}),Fr}return Aa(e.data)}get enum(){return this._def.values}};v1=new WeakMap;qS.create=(e,t)=>new qS({values:e,typeName:vr.ZodNativeEnum,...Vr(t)});class Tw extends Zr{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Gt.promise&&r.common.async===!1)return It(r,{code:At.invalid_type,expected:Gt.promise,received:r.parsedType}),Fr;const s=r.parsedType===Gt.promise?r.data:Promise.resolve(r.data);return Aa(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Tw.create=(e,t)=>new Tw({type:e,typeName:vr.ZodPromise,...Vr(t)});class ad extends Zr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===vr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=this._def.effect||null,i={addIssue:o=>{It(s,o),o.fatal?r.abort():r.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const o=n.transform(s.data,i);if(s.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return Fr;const l=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return l.status==="aborted"?Fr:l.status==="dirty"||r.value==="dirty"?HF(l.value):l});{if(r.value==="aborted")return Fr;const a=this._def.schema._parseSync({data:o,path:s.path,parent:s});return a.status==="aborted"?Fr:a.status==="dirty"||r.value==="dirty"?HF(a.value):a}}if(n.type==="refinement"){const o=a=>{const l=n.refinement(a,i);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?Fr:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?Fr:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!VS(o))return o;const a=n.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>VS(o)?Promise.resolve(n.transform(o.value,i)).then(a=>({status:r.value,value:a})):o);vs.assertNever(n)}}ad.create=(e,t,r)=>new ad({schema:e,typeName:vr.ZodEffects,effect:t,...Vr(r)});ad.createWithPreprocess=(e,t,r)=>new ad({schema:t,effect:{type:"preprocess",transform:e},typeName:vr.ZodEffects,...Vr(r)});let Mh=class extends Zr{_parse(e){return this._getType(e)===Gt.undefined?Aa(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mh.create=(e,t)=>new Mh({innerType:e,typeName:vr.ZodOptional,...Vr(t)});class bA extends Zr{_parse(t){return this._getType(t)===Gt.null?Aa(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}bA.create=(e,t)=>new bA({innerType:e,typeName:vr.ZodNullable,...Vr(t)});let ex=class extends Zr{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===Gt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};ex.create=(e,t)=>new ex({innerType:e,typeName:vr.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Vr(t)});let tx=class extends Zr{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return zS(s)?s.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Wl(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wl(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};tx.create=(e,t)=>new tx({innerType:e,typeName:vr.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Vr(t)});let zF=class extends Zr{_parse(e){if(this._getType(e)!==Gt.nan){const t=this._getOrReturnCtx(e);return It(t,{code:At.invalid_type,expected:Gt.nan,received:t.parsedType}),Fr}return{status:"valid",value:e.data}}};zF.create=e=>new zF({typeName:vr.ZodNaN,...Vr(e)});const tke=Symbol("zod_brand");let v5=class extends Zr{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};class e3 extends Zr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Fr:n.status==="dirty"?(r.dirty(),HF(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Fr:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,r){return new e3({in:t,out:r,typeName:vr.ZodPipeline})}}let rx=class extends Zr{_parse(e){const t=this._def.innerType._parse(e),r=s=>(VS(s)&&(s.value=Object.freeze(s.value)),s);return zS(t)?t.then(s=>r(s)):r(t)}unwrap(){return this._def.innerType}};rx.create=(e,t)=>new rx({innerType:e,typeName:vr.ZodReadonly,...Vr(t)});function R$(e,t={},r){return e?Rw.create().superRefine((s,n)=>{var i,o;if(!e(s)){const a=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,l=(o=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...c,fatal:l})}}):Rw.create()}const rke={object:Jc.lazycreate};var vr;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(vr||(vr={}));const ske=(e,t={message:`Input not instance of ${e.name}`})=>R$(r=>r instanceof e,t),T$=Qu.create,D$=QS.create,nke=zF.create,ike=wA.create,M$=US.create,oke=WS.create,ake=OF.create,lke=jS.create,cke=KS.create,uke=Rw.create,dke=uv.create,hke=mg.create,pke=NF.create,gke=Ju.create,fke=Jc.create,Ake=Jc.strictCreate,mke=YS.create,vke=x$.create,Cke=ZS.create,wke=yA.create,yke=XS.create,bke=_F.create,Ske=VF.create,xke=sw.create,Eke=$S.create,Pke=JS.create,Fke=qx.create,Rke=qS.create,Tke=Tw.create,JG=ad.create,Dke=Mh.create,Mke=bA.create,Ike=ad.createWithPreprocess,kke=e3.create,Bke=()=>T$().optional(),Lke=()=>D$().optional(),Hke=()=>M$().optional(),Gke={string:e=>Qu.create({...e,coerce:!0}),number:e=>QS.create({...e,coerce:!0}),boolean:e=>US.create({...e,coerce:!0}),bigint:e=>wA.create({...e,coerce:!0}),date:e=>WS.create({...e,coerce:!0})},Oke=Fr;var cs=Object.freeze({__proto__:null,defaultErrorMap:Fw,setErrorMap:OIe,getErrorMap:BF,makeIssue:LF,EMPTY_PATH:NIe,addIssueToContext:It,ParseStatus:Oo,INVALID:Fr,DIRTY:HF,OK:Aa,isAborted:Jk,isDirty:qk,isValid:VS,isAsync:zS,get util(){return vs},get objectUtil(){return $k},ZodParsedType:Gt,getParsedType:Zf,ZodType:Zr,datetimeRegex:b$,ZodString:Qu,ZodNumber:QS,ZodBigInt:wA,ZodBoolean:US,ZodDate:WS,ZodSymbol:OF,ZodUndefined:jS,ZodNull:KS,ZodAny:Rw,ZodUnknown:uv,ZodNever:mg,ZodVoid:NF,ZodArray:Ju,ZodObject:Jc,ZodUnion:YS,ZodDiscriminatedUnion:x$,ZodIntersection:ZS,ZodTuple:yA,ZodRecord:XS,ZodMap:_F,ZodSet:VF,ZodFunction:sw,ZodLazy:$S,ZodLiteral:JS,ZodEnum:qx,ZodNativeEnum:qS,ZodPromise:Tw,ZodEffects:ad,ZodTransformer:ad,ZodOptional:Mh,ZodNullable:bA,ZodDefault:ex,ZodCatch:tx,ZodNaN:zF,BRAND:tke,ZodBranded:v5,ZodPipeline:e3,ZodReadonly:rx,custom:R$,Schema:Zr,ZodSchema:Zr,late:rke,get ZodFirstPartyTypeKind(){return vr},coerce:Gke,any:uke,array:gke,bigint:ike,boolean:M$,date:oke,discriminatedUnion:vke,effect:JG,enum:Fke,function:xke,instanceof:ske,intersection:Cke,lazy:Eke,literal:Pke,map:bke,nan:nke,nativeEnum:Rke,never:hke,null:cke,nullable:Mke,number:D$,object:fke,oboolean:Hke,onumber:Lke,optional:Dke,ostring:Bke,pipeline:kke,preprocess:Ike,promise:Tke,record:yke,set:Ske,strictObject:Ake,string:T$,symbol:ake,transformer:JG,tuple:wke,undefined:lke,union:mke,unknown:dke,void:pke,NEVER:Oke,ZodIssueCode:At,quotelessJson:GIe,ZodError:Wl});function Nke(e){throw new Error("Unexpected object: "+e)}const I$="upload://upload/",k$="index://index/";function _ke(e){return e.startsWith(I$)}function Vke(e){return e.startsWith(k$)}function B$(e){if(Vke(e)){const t=e.slice(k$.length);return JSON.parse(decodeURIComponent(t)).path}else if(_ke(e)){const t=e.slice(I$.length);return JSON.parse(decodeURIComponent(t)).localPath}Nke(e)}function zke(e){return e.replace(/^.*[\\/]/,"")}function Qke(e){return zke(B$(e))}cs.object({__isRef:cs.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:cs.string().describe("Upstream block id"),name:cs.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:cs.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();const Uke=24;cs.string().length(Uke).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");var qG={exports:{}};(function(e,t){t=e.exports=r,t.getSerialize=s;function r(n,i,o,a){return JSON.stringify(n,s(i,a),o)}function s(n,i){var o=[],a=[];return i==null&&(i=function(l,c){return o[0]===c?"[Circular ~]":"[Circular ~."+a.slice(0,o.indexOf(c)).join(".")+"]"}),function(l,c){if(o.length>0){var u=o.indexOf(this);~u?o.splice(u+1):o.push(this),~u?a.splice(u,1/0,l):a.push(l),~o.indexOf(c)&&(c=i.call(this,l,c))}else o.push(c);return n==null?c:n.call(this,l,c)}}})(qG,qG.exports);const Wke=cs.object({type:cs.literal("PlError"),name:cs.string(),message:cs.string(),fullMessage:cs.string().optional(),stack:cs.string().optional()}),jke=Wke.extend({cause:cs.lazy(()=>QF).optional(),errors:cs.lazy(()=>QF.array()).optional()}),Kke=cs.object({type:cs.literal("StandardError"),name:cs.string(),message:cs.string(),stack:cs.string().optional()}),Yke=Kke.extend({cause:cs.lazy(()=>QF).optional(),errors:cs.lazy(()=>QF.array()).optional()}),QF=cs.union([Yke,jke]),Zke=cs.object({name:cs.string(),message:cs.string(),fullMessage:cs.string().optional(),stack:cs.string().optional()}),eO=Zke.extend({cause:cs.lazy(()=>eO).optional(),errors:cs.lazy(()=>eO.array()).optional()});function Xke(e){if(e&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(e);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const $ke=cs.object({type:cs.string(),importance:cs.number().optional(),id:cs.string().optional(),label:cs.string()});cs.array($ke);const Jke="1.31.16";function tA(){return Xke({sdkVersion:Jke})}const qke="[==PROGRESS==]";function eBe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tBe(e){const t=br(),r=oi({errorCount:0});async function s(){var i;let o=t.value;if(o===void 0)return;const a=e.mockPlatforma??tA();if(!a){console.warn("Platforma API is not available");return}for(;;){const l=await a.logDriver.readText(o.logHandle,100,o.lastOffset);if(o.error=void 0,r.errorCount=0,l.shouldUpdateHandle||o.logHandle!==((i=t.value)==null?void 0:i.logHandle))return;const c=e.progressPrefix??qke,u=new TextDecoder().decode(l.data).replace(new RegExp(`${eBe(c)}`,"g"),"");if(o=Object.assign(o,{lines:o.lines+u,lastOffset:l.newOffset,finished:!l.live}),l.newOffset>=l.size)break}}const n=HIe(()=>s().catch(i=>{t.value&&(r.errorCount++,r.errorCount>(e.maxRetries??3)?t.value.error=i:console.warn("skip error:",i,"retry..."))}),1500,{immediate:!1});return LIe(()=>{var i;return(i=t==null?void 0:t.value)==null?void 0:i.finished},()=>n.pause()),tn(()=>e.logHandle,i=>{var o;i===void 0?(t.value=void 0,n.pause()):i!==((o=t.value)==null?void 0:o.logHandle)&&(t.value={logHandle:i,lastOffset:0,lines:"",finished:!1,error:void 0},r.errorCount=0,n.resume())},{immediate:!0}),t}const rBe={key:0},sBe={class:"pl-log-view__copy"},nBe={key:1,class:"pl-log-view__error"},iBe={name:"PlLogView"},oBe=Tr({...iBe,props:{value:{},valueToCopy:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{},disableAutoScroll:{type:Boolean}},setup(e){const t=v=>{if(v&&v.ok===!1)return v.errors.join(`
703
+ `)},r=dd(),s=e,n=tBe(s),i=br(!0),o=br(),a=br(),l=Je(()=>{var v;return((v=n.value)==null?void 0:v.error)??s.error??t(s.output)}),c=Je(()=>{var v;return((v=n.value)==null?void 0:v.lines)??s.value??RDe(s.output)}),u=br(!1);Jx(a);const d=Je(()=>u.value?"clipboard-copied":"clipboard"),g=()=>{u.value=!0,setTimeout(()=>{u.value=!1},1200);let v;s.valueToCopy?v=s.valueToCopy:c.value&&typeof c.value=="string"&&(v=c.value),v!==void 0&&navigator.clipboard.writeText(v)},A=()=>{s.disableAutoScroll||p5(o.value,v=>{i.value&&v.scrollTo(v.scrollLeft,v.scrollHeight)})};tn(c,()=>{requestAnimationFrame(()=>{A()})},{immediate:!0});const w=v=>{const b=v.target;i.value=b.scrollTop+20>=b.scrollHeight-b.offsetHeight};return(v,b)=>(ye(),je("div",{ref_key:"root",ref:a,class:St(["pl-log-view",{"has-error":l.value}])},[v.label?(ye(),je("label",rBe,[We("span",null,Zt(v.label),1),b[0]||(b[0]=Ne()),Pe(r).tooltip?(ye(),jt(Pe(_h),{key:0,class:"info",position:"top"},{tooltip:er(()=>[jr(v.$slots,"tooltip")]),_:3})):yt("",!0)])):yt("",!0),b[2]||(b[2]=Ne()),zt($x,{class:"pl-log-view__contour"}),b[3]||(b[3]=Ne()),We("div",sBe,[zt(Pe(_h),{"close-delay":800,position:"top"},{tooltip:er(()=>[Ne(Zt(u.value?"copied":"copy"),1)]),default:er(()=>[zt(Pe(Vc),{title:"Copy content",name:d.value,onClick:g},null,8,["name"]),b[1]||(b[1]=Ne())]),_:1})]),b[4]||(b[4]=Ne()),l.value?(ye(),je("div",nBe,Zt(l.value),1)):(ye(),je("div",{key:2,ref_key:"contentRef",ref:o,class:"pl-log-view__content",onScroll:w},Zt(c.value),545))],2))}}),aBe="_component_1uz6e_1",lBe="_local_1uz6e_1",cBe="_supported_1uz6e_26",uBe="_remote_1uz6e_32",dBe="_search_1uz6e_40",hBe="_selected_1uz6e_72",pBe="_breadcrumbs_1uz6e_86",gBe="_cat_1uz6e_116",fBe="_message_1uz6e_122",ABe="_isFile_1uz6e_196",mBe="_isDir_1uz6e_200",vBe="_canBeSelected_1uz6e_206",CBe="_spin_1uz6e_1",ni={component:aBe,local:lBe,supported:cBe,remote:uBe,search:dBe,"ls-container":"_ls-container_1uz6e_50","ls-head":"_ls-head_1uz6e_57",selected:hBe,breadcrumbs:pBe,"ls-error":"_ls-error_1uz6e_108",cat:gBe,message:fBe,"ls-empty":"_ls-empty_1uz6e_131","ls-body":"_ls-body_1uz6e_152",isFile:ABe,isDir:mBe,canBeSelected:vBe,"ls-loader":"_ls-loader_1uz6e_212","loader-icon":"_loader-icon_1uz6e_220",spin:CBe},wBe=Tr({__name:"Shortcuts",setup(e){return(t,r)=>(ye(),jt(Pe(_h),{class:"info",position:"southwest","max-width":"420px"},{tooltip:er(()=>[We("span",{class:St(t.$style.title)},"Shortcuts",2),r[2]||(r[2]=Ne()),We("div",{class:St([t.$style.row,t.$style.head])},r[0]||(r[0]=[We("div",null,null,-1),Ne(),We("div",null,"MacOS",-1),Ne(),We("div",null,"Windows/Linux",-1)]),2),r[3]||(r[3]=Ne()),We("div",{class:St([t.$style.row,t.$style.body])},r[1]||(r[1]=[We("div",null,"Single File",-1),Ne(),We("div",null,"Click the file",-1),Ne(),We("div",null,"Click the file",-1),Ne(),We("div",null,"Adjacent multiple files",-1),Ne(),We("div",null,"Hold Shift, click first and last files",-1),Ne(),We("div",null,"Hold Shift, click first and last files",-1),Ne(),We("div",null,"Non-adjacent multiple files",-1),Ne(),We("div",null,"Hold Command (⌘), click each file",-1),Ne(),We("div",null,"Hold Ctrl, click each file",-1),Ne(),We("div",null,"All files",-1),Ne(),We("div",null,"Press Command (⌘) + A",-1),Ne(),We("div",null,"Press Ctrl + A",-1)]),2)]),_:1}))}}),yBe="_title_14dct_2",bBe="_row_14dct_10",SBe="_head_14dct_30",xBe="_body_14dct_58",EBe={title:yBe,row:bBe,head:SBe,body:xBe},PBe={$style:EBe},FBe=$h(wBe,[["__cssModules",PBe]]),tO=()=>({dirPath:"",search:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1});function RBe(e){return Je(()=>{let t=e.items;if(e.showHiddenItems||(t=t.filter(r=>!r.name.startsWith("."))),e.search){const r=e.search.toLocaleLowerCase();t=t.filter(s=>s.name.toLocaleLowerCase().includes(r))}return t})}const rO={mounted:e=>{if(e.clientWidth<e.scrollWidth){const t=e.innerText;e.innerText=t.substring(0,57)+"..."+t.substring(t.length-10)}}};function L$(e){return e?e.map(t=>"."+DDe(t,["."])):void 0}function TBe(e){const t="/",r=e.startsWith(t),s=TDe(e,[t]).split(t),n=[{index:0,name:"Root",path:""}];if(s.length===1&&s[0]==="")return n;for(let i=0;i<s.length;i++){const o=(r?t:"")+s.slice(0,i+1).join(t);n.push({index:i+1,name:s[i],path:o})}return n}const DBe=["title","onClick"],MBe={key:0,class:"ls-loader"},IBe=["onClick"],kBe=["title"],BBe=["onClick"],LBe=["title"],HBe=Tr({__name:"Remote",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},submit:{}},emits:["update:modelValue","import:files"],setup(e,{expose:t}){const r=D=>D.ctrlKey||D.metaKey,s=e,n=oi(tO()),i=()=>{n.search="",n.error="",n.lastSelected=void 0},o=Je(()=>L$(s.extensions)),a=RBe(n),l=Je(()=>{var D;return{modelValue:s.modelValue,dirPath:n.dirPath,storageHandle:(D=n.storageEntry)==null?void 0:D.handle}}),c=(D,B)=>{tA()&&n.currentLoadingPath!==B&&(n.currentLoadingPath=B,tA().lsDriver.listFiles(D,B).then(k=>{B===n.dirPath&&(n.items=NS(k).entries.map(z=>({path:z.fullPath,name:z.name,isDir:z.type==="dir",canBeSelected:z.type==="file"&&(!o.value||o.value.some(O=>z.fullPath.endsWith(O))),handle:z.type==="file"?z.handle:void 0,selected:!1})).sort((z,O)=>z.isDir&&!O.isDir?-1:!z.isDir&&O.isDir?1:z.name.localeCompare(O.name)).map((z,O)=>({id:O,...z})),n.lastSelected=void 0)}).catch(k=>n.error=String(k)).finally(()=>{n.currentLoadingPath=void 0}))},u=()=>{i();const{storageHandle:D,dirPath:B,modelValue:k}=l.value;D&&k&&c(D,B)},d=Je(()=>TBe(n.dirPath)),g=Je(()=>n.items.filter(D=>D.canBeSelected&&D.selected&&!D.isDir)),A=Je(()=>{var D;return g.value.length>0&&((D=n.storageEntry)==null?void 0:D.handle)}),w=()=>{var D;return{storageHandle:NS((D=n.storageEntry)==null?void 0:D.handle),files:g.value.map(B=>B.handle)}},v=D=>{n.dirPath=D},b=(D,B)=>{const{shiftKey:k}=D,z=r(D),{lastSelected:O}=n;D.preventDefault();const j=a.value;if(B.canBeSelected){if(s.multi||j.forEach(_=>_.selected=!1),B.selected=!B.selected,!s.multi)return;!z&&!k&&j.forEach(_=>{_.id!==B.id&&(_.selected=!1)}),k&&O!==void 0&&j.forEach(_=>{FDe(_.id,O,B.id)&&(_.selected=!0)}),B.selected&&(n.lastSelected=B.id)}},S=D=>{D&&!s.multi||a.value.filter(B=>B.canBeSelected).forEach(B=>{B.selected=D})},P=()=>S(!0),F=()=>S(!1),T=()=>{if(i(),F(),!tA()){console.warn("platforma API is not found");return}tA().lsDriver.getStorageList().then(D=>{D=D.filter(B=>B.name!=="local"&&!B.name.startsWith("local_disk_")),n.storageOptions=D.map(B=>({text:B.name,value:B})),s.autoSelectStorage&&p5(D[0],B=>{n.storageEntry=B})}).catch(D=>n.error=String(D))};return tn(I7(n,"storageEntry"),D=>{i(),n.dirPath=(D==null?void 0:D.initialFullPath)??""},{immediate:!0}),tn([()=>n.dirPath,()=>n.storageEntry],()=>{u()}),tn(()=>s.modelValue,D=>{D?T():Object.assign(n,tO())},{immediate:!0}),cv(document,"keydown",D=>{if(!s.modelValue||D.target!==document.body)return;const B=r(D);B&&D.code==="KeyA"&&(D.preventDefault(),P()),B&&D.shiftKey&&D.code==="Period"&&(D.preventDefault(),n.showHiddenItems=!n.showHiddenItems),D.code==="Enter"&&s.submit()}),t({isReady:A,getFilesToImport:w}),Yh(T),(D,B)=>(ye(),je("div",{class:St(Pe(ni).remote),onClick:Nn(F,["stop"])},[We("div",{class:St(Pe(ni).search)},[We("div",null,[zt(Pe(g$),{modelValue:n.storageEntry,"onUpdate:modelValue":B[0]||(B[0]=k=>n.storageEntry=k),label:"Select storage",options:n.storageOptions},null,8,["modelValue","options"])]),B[2]||(B[2]=Ne()),We("div",null,[zt(Pe(G4e),{modelValue:n.search,"onUpdate:modelValue":B[1]||(B[1]=k=>n.search=k),label:"Search in folder",clearable:""},null,8,["modelValue"])])],2),B[12]||(B[12]=Ne()),We("div",{class:St(Pe(ni)["ls-container"])},[We("div",{class:St(Pe(ni)["ls-head"])},[We("div",{class:St(Pe(ni).breadcrumbs)},[(ye(!0),je(_s,null,Fh(d.value,(k,z)=>(ye(),je(_s,{key:z},[We("div",{title:k.path,onClick:O=>v(k.path)},Zt(k.name),9,DBe),B[3]||(B[3]=Ne()),k.index!==d.value.length-1?(ye(),jt(Pe(_S),{key:0,name:"chevron-right"})):yt("",!0)],64))),128))],2),B[5]||(B[5]=Ne()),We("div",{class:St(Pe(ni).selected)},[We("span",null,"Selected: "+Zt(g.value.length),1),B[4]||(B[4]=Ne()),zt(FBe)],2)],2),B[11]||(B[11]=Ne()),n.currentLoadingPath!==void 0?(ye(),je("div",MBe,B[6]||(B[6]=[We("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):n.storageEntry?n.error?(ye(),je("div",{key:2,class:St(Pe(ni)["ls-error"])},[We("div",{class:St(Pe(ni).cat)},null,2),B[8]||(B[8]=Ne()),We("div",{class:St(Pe(ni).message)},Zt(n.error),3)],2)):(ye(),je("div",{key:3,class:St(Pe(ni)["ls-body"])},[(ye(!0),je(_s,null,Fh(Pe(a),k=>(ye(),je(_s,{key:k.id},[k.isDir?(ye(),je("div",{key:0,class:St(Pe(ni).isDir),onClick:z=>v(k.path)},[zt(Pe(_S),{name:"chevron-right"}),B[9]||(B[9]=Ne()),Av((ye(),je("span",{title:k.name},[Ne(Zt(k.name),1)],8,kBe)),[[Pe(rO)]])],10,IBe)):(ye(),je("div",{key:1,class:St({[Pe(ni).canBeSelected]:k.canBeSelected,[Pe(ni).selected]:k.selected}),onClick:Nn(z=>b(z,k),["stop"])},[zt(Pe(Zk),{name:"box",class:St(Pe(ni).isFile)},null,8,["class"]),B[10]||(B[10]=Ne()),Av((ye(),je("span",{title:k.name},[Ne(Zt(k.name),1)],8,LBe)),[[Pe(rO)]])],10,BBe))],64))),128))],2)):(ye(),je("div",{key:1,class:St(Pe(ni)["ls-empty"])},[We("div",{class:St(Pe(ni).cat)},null,2),B[7]||(B[7]=Ne()),We("div",{class:St(Pe(ni).message)},"Select storage to preview",2)],2))],2)],2))}}),GBe={key:1,class:"alert-error"},OBe=Tr({__name:"Local",props:{importFiles:{type:Function},multi:{type:Boolean},extensions:{}},setup(e){const t=e,r=oi({error:void 0}),s=Je(()=>t.multi?"Drag & Drop files here or click to add":"Drag & Drop file here or click to add"),n=async o=>{var a,l,c;const u=(l=(a=tA())==null?void 0:a.lsDriver)==null?void 0:l.fileToImportHandle;if(!u)return console.error("API getPlatformaRawInstance().lsDriver.fileToImportHandle is not available");const d=L$(t.extensions),g=await Promise.all([...((c=o.dataTransfer)==null?void 0:c.files)??[]].filter(A=>!!A).filter(A=>d?d.some(w=>A.name.endsWith(w)):!0).map(A=>u(A)));g.length&&t.importFiles({files:g})},i=async()=>{var o,a;const l=t.extensions?[{name:"All Files",extensions:[...t.extensions]}]:[];t.multi?(o=tA())==null||o.lsDriver.showOpenMultipleFilesDialog({title:"Select files to import",filters:l}).then(({files:c})=>{c&&t.importFiles({files:c})}).catch(c=>r.error=c):(a=tA())==null||a.lsDriver.showOpenSingleFileDialog({title:"Select file to import",filters:l}).then(({file:c})=>{c&&t.importFiles({files:[c]})}).catch(c=>r.error=c)};return(o,a)=>(ye(),je("div",{class:St(Pe(ni).local),onDrop:n,onDragover:a[0]||(a[0]=Nn(()=>{},["prevent"])),onClick:i},[zt(Pe(m5),{name:"cloud-upload"}),a[1]||(a[1]=Ne()),We("span",null,Zt(s.value),1),a[2]||(a[2]=Ne()),o.extensions?(ye(),je("span",{key:0,class:St(Pe(ni).supported)},"Supported formats: "+Zt(o.extensions.join(", ")),3)):yt("",!0),a[3]||(a[3]=Ne()),r.error?(ye(),je("span",GBe,Zt(r.error),1)):yt("",!0)],34))}}),NBe={style:{margin:"0 24px"}},H$=Tr({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(e,{emit:t}){const r=t,s=e,n=br("local"),i=Je(()=>s.multi?"Select Files to Import":"Select File to Import"),o=[{label:"My Computer",value:"local"},{label:"Remote",value:"remote"}],a=()=>r("update:modelValue",!1),l=B7("remote"),c=()=>{var d,g;(d=l.value)!=null&&d.isReady&&(r("import:files",NS((g=l.value)==null?void 0:g.getFilesToImport())),a())},u=d=>{r("import:files",d),a()};return(d,g)=>(ye(),jt(Pe(f$),{"no-content-gutters":!0,"close-on-outside-click":d.closeOnOutsideClick,class:St(["pl-dialog-modal",Pe(ni).component]),"model-value":d.modelValue,width:"688px",height:"720px","onUpdate:modelValue":a},UU({title:er(()=>[Ne(Zt(d.title??i.value),1)]),default:er(()=>[g[4]||(g[4]=Ne()),We("div",NBe,[zt(Pe(i4e),{modelValue:n.value,"onUpdate:modelValue":g[0]||(g[0]=A=>n.value=A),options:o},null,8,["modelValue"])]),g[5]||(g[5]=Ne()),n.value==="remote"?(ye(),jt(HBe,dl({key:0,ref:"remote"},d.$props,{submit:c}),null,16)):yt("",!0),g[6]||(g[6]=Ne()),n.value==="local"?(ye(),jt(OBe,dl({key:1,"import-files":u},d.$props),null,16)):yt("",!0),g[7]||(g[7]=Ne())]),_:2},[n.value==="remote"?{name:"actions",fn:er(()=>{var A;return[zt(Pe(kF),{style:{"min-width":"160px"},disabled:!((A=Pe(l))!=null&&A.isReady),onClick:Nn(c,["stop"])},{default:er(()=>g[1]||(g[1]=[Ne("Import")])),_:1},8,["disabled"]),g[3]||(g[3]=Ne()),zt(Pe(g5),{"justify-center":!1,onClick:Nn(a,["stop"])},{default:er(()=>g[2]||(g[2]=[Ne("Cancel")])),_:1})]}),key:"0"}:void 0]),1032,["close-on-outside-click","class","model-value"]))}}),_Be={key:0,ref:"label"},VBe={key:0,class:"required-icon"},zBe=["data-placeholder"],QBe={key:5,class:"pl-file-input__stats"},UBe={key:0,class:"pl-file-input__error"},WBe={key:1,class:"pl-file-input__helper"},jBe=Tr({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},cellStyle:{type:Boolean,default:!1},fileDialogTitle:{default:void 0},fileDialogCloseOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const r=oi({fileDialogOpen:!1,error:""}),s=dd(),n=t,i=e,o=(F,T)=>{if(F)try{return T(F)}catch(D){return r.error=D instanceof Error?D.message:String(D),F}},a=Je(()=>o(i.modelValue,Qke)),l=Je(()=>o(i.modelValue,B$)),c=Je(()=>i.progress&&!i.progress.done),u=Je(()=>i.progress&&i.progress.done),d=Je(()=>r.error??i.error),g=Je(()=>!!d.value),A=Je(()=>{const{status:F,done:T}=i.progress??{};return!F||!F.bytesTotal?"":F.bytesProcessed&&!T?l4(F.bytesProcessed,{})+" / "+l4(F.bytesTotal,{}):l4(F.bytesTotal,{})}),w=Je(()=>{var F;const{progress:T}=i;return T?{width:T.done?"100%":Math.round((((F=T.status)==null?void 0:F.progress)??0)*100)+"%"}:{}}),v=()=>{r.fileDialogOpen=!0},b=F=>{F.files.length&&n("update:modelValue",F.files[0])},S=()=>n("update:modelValue",void 0);tn(()=>i.modelValue,()=>{r.error=""},{immediate:!0});const P=br();return i.cellStyle||Jx(P),(F,T)=>(ye(),je(_s,null,[We("div",{class:St([{"pl-file-input__cell-style":!!F.cellStyle,"has-file":!!a.value},"pl-file-input__envelope"])},[We("div",{ref_key:"rootRef",ref:P,class:St(["pl-file-input",{dashed:F.dashed,error:g.value}]),tabindex:"0",onKeyup:dw(v,["enter"]),onClick:Nn(v,["stop"])},[We("div",{class:"pl-file-input__progress",style:oo(w.value)},null,4),T[3]||(T[3]=Ne()),!F.cellStyle&&F.label?(ye(),je("label",_Be,[F.required?(ye(),je("i",VBe)):yt("",!0),T[1]||(T[1]=Ne()),We("span",null,Zt(F.label),1),T[2]||(T[2]=Ne()),Pe(s).tooltip||l.value?(ye(),jt(Pe(_h),{key:1,class:"info",position:"top"},{tooltip:er(()=>[Pe(s).tooltip?jr(F.$slots,"tooltip",{key:0}):(ye(),je(_s,{key:1},[Ne(Zt(l.value),1)],64))]),_:3})):yt("",!0)],512)):yt("",!0),T[4]||(T[4]=Ne()),g.value?(ye(),jt(Pe(Vc),{key:1,name:"restart"})):c.value?(ye(),jt(Pe(Vc),{key:2,name:"cloud-upload"})):u.value?(ye(),jt(Pe(Vc),{key:3,name:"success"})):(ye(),jt(Pe(Vc),{key:4,name:"paper-clip"})),T[5]||(T[5]=Ne()),We("div",{"data-placeholder":F.placeholder??"Choose file",class:"pl-file-input__filename"},Zt(a.value),9,zBe),T[6]||(T[6]=Ne()),A.value?(ye(),je("div",QBe,Zt(A.value),1)):yt("",!0),T[7]||(T[7]=Ne()),F.modelValue?(ye(),jt(Pe(Vc),{key:6,name:"close",onClick:Nn(S,["stop"])})):yt("",!0),T[8]||(T[8]=Ne()),zt($x,{class:"pl-file-input__contour"})],34),T[9]||(T[9]=Ne()),g.value?(ye(),je("div",UBe,Zt(d.value),1)):F.helper?(ye(),je("div",WBe,Zt(F.helper),1)):yt("",!0)],2),T[10]||(T[10]=Ne()),zt(Pe(H$),{modelValue:r.fileDialogOpen,"onUpdate:modelValue":T[0]||(T[0]=D=>r.fileDialogOpen=D),extensions:F.extensions,title:F.fileDialogTitle,"close-on-outside-click":F.fileDialogCloseOnOutsideClick,"onImport:files":b},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),KBe={class:"pl-notification-alert__wrapper d-flex text-s"},YBe={class:"pl-notification-alert__content flex-grow-1"},ZBe={key:0,class:"pl-notification-alert__close"},XBe={key:0,class:"pl-notification-alert__actions d-flex"},$Be=Tr({__name:"PlNotificationAlert",props:KU({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,r=lW(e,"modelValue");function s(){t.closable&&(r.value=!1)}return(n,i)=>r.value?(ye(),je("div",{key:0,class:St([n.type,"pl-notification-alert d-flex flex-column gap-16"]),style:oo({width:`${n.width}`})},[We("div",KBe,[We("div",YBe,[jr(n.$slots,"default")]),i[0]||(i[0]=Ne()),n.closable?(ye(),je("div",ZBe,[zt(Pe(g5),{icon:"close",onClick:Nn(s,["stop"])})])):yt("",!0)]),i[1]||(i[1]=Ne()),n.$slots.actions?(ye(),je("div",XBe,[jr(n.$slots,"actions")])):yt("",!0)],6)):yt("",!0)}});function S2(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function JBe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function G$(e){let t,r,s;e.length!==2?(t=S2,r=(a,l)=>S2(e(a),l),s=(a,l)=>e(a)-l):(t=e===S2||e===JBe?e:qBe,r=e,s=e);function n(a,l,c=0,u=a.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;r(a[d],l)<0?c=d+1:u=d}while(c<u)}return c}function i(a,l,c=0,u=a.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;r(a[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function o(a,l,c=0,u=a.length){const d=n(a,l,c,u-1);return d>c&&s(a[d-1],l)>-s(a[d],l)?d-1:d}return{left:n,center:o,right:i}}function qBe(){return 0}function e7e(e){return e===null?NaN:+e}G$(S2);G$(e7e).center;var t7e={value:()=>{}};function O$(){for(var e=0,t=arguments.length,r={},s;e<t;++e){if(!(s=arguments[e]+"")||s in r||/[\s.]/.test(s))throw new Error("illegal type: "+s);r[s]=[]}return new x2(r)}function x2(e){this._=e}function r7e(e,t){return e.trim().split(/^|\s+/).map(function(r){var s="",n=r.indexOf(".");if(n>=0&&(s=r.slice(n+1),r=r.slice(0,n)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:s}})}x2.prototype=O$.prototype={constructor:x2,on:function(e,t){var r=this._,s=r7e(e+"",r),n,i=-1,o=s.length;if(arguments.length<2){for(;++i<o;)if((n=(e=s[i]).type)&&(n=s7e(r[n],e.name)))return n;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(n=(e=s[i]).type)r[n]=sO(r[n],e.name,t);else if(t==null)for(n in r)r[n]=sO(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new x2(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var r=new Array(n),s=0,n,i;s<n;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,n=i.length;s<n;++s)i[s].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],n=0,i=s.length;n<i;++n)s[n].value.apply(t,r)}};function s7e(e,t){for(var r=0,s=e.length,n;r<s;++r)if((n=e[r]).name===t)return n.value}function sO(e,t,r){for(var s=0,n=e.length;s<n;++s)if(e[s].name===t){e[s]=t7e,e=e.slice(0,s).concat(e.slice(s+1));break}return r!=null&&e.push({name:t,value:r}),e}var nB="http://www.w3.org/1999/xhtml";const nO={svg:"http://www.w3.org/2000/svg",xhtml:nB,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bT(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),nO.hasOwnProperty(t)?{space:nO[t],local:e}:e}function n7e(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===nB&&t.documentElement.namespaceURI===nB?t.createElement(e):t.createElementNS(r,e)}}function i7e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function N$(e){var t=bT(e);return(t.local?i7e:n7e)(t)}function o7e(){}function C5(e){return e==null?o7e:function(){return this.querySelector(e)}}function a7e(e){typeof e!="function"&&(e=C5(e));for(var t=this._groups,r=t.length,s=new Array(r),n=0;n<r;++n)for(var i=t[n],o=i.length,a=s[n]=new Array(o),l,c,u=0;u<o;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new ld(s,this._parents)}function l7e(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function c7e(){return[]}function _$(e){return e==null?c7e:function(){return this.querySelectorAll(e)}}function u7e(e){return function(){return l7e(e.apply(this,arguments))}}function d7e(e){typeof e=="function"?e=u7e(e):e=_$(e);for(var t=this._groups,r=t.length,s=[],n=[],i=0;i<r;++i)for(var o=t[i],a=o.length,l,c=0;c<a;++c)(l=o[c])&&(s.push(e.call(l,l.__data__,c,o)),n.push(l));return new ld(s,n)}function V$(e){return function(){return this.matches(e)}}function z$(e){return function(t){return t.matches(e)}}var h7e=Array.prototype.find;function p7e(e){return function(){return h7e.call(this.children,e)}}function g7e(){return this.firstElementChild}function f7e(e){return this.select(e==null?g7e:p7e(typeof e=="function"?e:z$(e)))}var A7e=Array.prototype.filter;function m7e(){return Array.from(this.children)}function v7e(e){return function(){return A7e.call(this.children,e)}}function C7e(e){return this.selectAll(e==null?m7e:v7e(typeof e=="function"?e:z$(e)))}function w7e(e){typeof e!="function"&&(e=V$(e));for(var t=this._groups,r=t.length,s=new Array(r),n=0;n<r;++n)for(var i=t[n],o=i.length,a=s[n]=[],l,c=0;c<o;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new ld(s,this._parents)}function Q$(e){return new Array(e.length)}function y7e(){return new ld(this._enter||this._groups.map(Q$),this._parents)}function UF(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}UF.prototype={constructor:UF,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function b7e(e){return function(){return e}}function S7e(e,t,r,s,n,i){for(var o=0,a,l=t.length,c=i.length;o<c;++o)(a=t[o])?(a.__data__=i[o],s[o]=a):r[o]=new UF(e,i[o]);for(;o<l;++o)(a=t[o])&&(n[o]=a)}function x7e(e,t,r,s,n,i,o){var a,l,c=new Map,u=t.length,d=i.length,g=new Array(u),A;for(a=0;a<u;++a)(l=t[a])&&(g[a]=A=o.call(l,l.__data__,a,t)+"",c.has(A)?n[a]=l:c.set(A,l));for(a=0;a<d;++a)A=o.call(e,i[a],a,i)+"",(l=c.get(A))?(s[a]=l,l.__data__=i[a],c.delete(A)):r[a]=new UF(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(g[a])===l&&(n[a]=l)}function E7e(e){return e.__data__}function P7e(e,t){if(!arguments.length)return Array.from(this,E7e);var r=t?x7e:S7e,s=this._parents,n=this._groups;typeof e!="function"&&(e=b7e(e));for(var i=n.length,o=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=s[c],d=n[c],g=d.length,A=F7e(e.call(u,u&&u.__data__,c,s)),w=A.length,v=a[c]=new Array(w),b=o[c]=new Array(w),S=l[c]=new Array(g);r(u,d,v,b,S,A,t);for(var P=0,F=0,T,D;P<w;++P)if(T=v[P]){for(P>=F&&(F=P+1);!(D=b[F])&&++F<w;);T._next=D||null}}return o=new ld(o,s),o._enter=a,o._exit=l,o}function F7e(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function R7e(){return new ld(this._exit||this._groups.map(Q$),this._parents)}function T7e(e,t,r){var s=this.enter(),n=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(n=t(n),n&&(n=n.selection())),r==null?i.remove():r(i),s&&n?s.merge(n).order():n}function D7e(e){for(var t=e.selection?e.selection():e,r=this._groups,s=t._groups,n=r.length,i=s.length,o=Math.min(n,i),a=new Array(n),l=0;l<o;++l)for(var c=r[l],u=s[l],d=c.length,g=a[l]=new Array(d),A,w=0;w<d;++w)(A=c[w]||u[w])&&(g[w]=A);for(;l<n;++l)a[l]=r[l];return new ld(a,this._parents)}function M7e(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var s=e[t],n=s.length-1,i=s[n],o;--n>=0;)(o=s[n])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function I7e(e){e||(e=k7e);function t(d,g){return d&&g?e(d.__data__,g.__data__):!d-!g}for(var r=this._groups,s=r.length,n=new Array(s),i=0;i<s;++i){for(var o=r[i],a=o.length,l=n[i]=new Array(a),c,u=0;u<a;++u)(c=o[u])&&(l[u]=c);l.sort(t)}return new ld(n,this._parents).order()}function k7e(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function B7e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function L7e(){return Array.from(this)}function H7e(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],n=0,i=s.length;n<i;++n){var o=s[n];if(o)return o}return null}function G7e(){let e=0;for(const t of this)++e;return e}function O7e(){return!this.node()}function N7e(e){for(var t=this._groups,r=0,s=t.length;r<s;++r)for(var n=t[r],i=0,o=n.length,a;i<o;++i)(a=n[i])&&e.call(a,a.__data__,i,n);return this}function _7e(e){return function(){this.removeAttribute(e)}}function V7e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function z7e(e,t){return function(){this.setAttribute(e,t)}}function Q7e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function U7e(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function W7e(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function j7e(e,t){var r=bT(e);if(arguments.length<2){var s=this.node();return r.local?s.getAttributeNS(r.space,r.local):s.getAttribute(r)}return this.each((t==null?r.local?V7e:_7e:typeof t=="function"?r.local?W7e:U7e:r.local?Q7e:z7e)(r,t))}function U$(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function K7e(e){return function(){this.style.removeProperty(e)}}function Y7e(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Z7e(e,t,r){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,r)}}function X7e(e,t,r){return arguments.length>1?this.each((t==null?K7e:typeof t=="function"?Z7e:Y7e)(e,t,r??"")):Dw(this.node(),e)}function Dw(e,t){return e.style.getPropertyValue(t)||U$(e).getComputedStyle(e,null).getPropertyValue(t)}function $7e(e){return function(){delete this[e]}}function J7e(e,t){return function(){this[e]=t}}function q7e(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function eLe(e,t){return arguments.length>1?this.each((t==null?$7e:typeof t=="function"?q7e:J7e)(e,t)):this.node()[e]}function W$(e){return e.trim().split(/^|\s+/)}function w5(e){return e.classList||new j$(e)}function j$(e){this._node=e,this._names=W$(e.getAttribute("class")||"")}j$.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function K$(e,t){for(var r=w5(e),s=-1,n=t.length;++s<n;)r.add(t[s])}function Y$(e,t){for(var r=w5(e),s=-1,n=t.length;++s<n;)r.remove(t[s])}function tLe(e){return function(){K$(this,e)}}function rLe(e){return function(){Y$(this,e)}}function sLe(e,t){return function(){(t.apply(this,arguments)?K$:Y$)(this,e)}}function nLe(e,t){var r=W$(e+"");if(arguments.length<2){for(var s=w5(this.node()),n=-1,i=r.length;++n<i;)if(!s.contains(r[n]))return!1;return!0}return this.each((typeof t=="function"?sLe:t?tLe:rLe)(r,t))}function iLe(){this.textContent=""}function oLe(e){return function(){this.textContent=e}}function aLe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function lLe(e){return arguments.length?this.each(e==null?iLe:(typeof e=="function"?aLe:oLe)(e)):this.node().textContent}function cLe(){this.innerHTML=""}function uLe(e){return function(){this.innerHTML=e}}function dLe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function hLe(e){return arguments.length?this.each(e==null?cLe:(typeof e=="function"?dLe:uLe)(e)):this.node().innerHTML}function pLe(){this.nextSibling&&this.parentNode.appendChild(this)}function gLe(){return this.each(pLe)}function fLe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ALe(){return this.each(fLe)}function mLe(e){var t=typeof e=="function"?e:N$(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function vLe(){return null}function CLe(e,t){var r=typeof e=="function"?e:N$(e),s=t==null?vLe:typeof t=="function"?t:C5(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),s.apply(this,arguments)||null)})}function wLe(){var e=this.parentNode;e&&e.removeChild(this)}function yLe(){return this.each(wLe)}function bLe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function SLe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xLe(e){return this.select(e?SLe:bLe)}function ELe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function PLe(e){return function(t){e.call(this,t,this.__data__)}}function FLe(e){return e.trim().split(/^|\s+/).map(function(t){var r="",s=t.indexOf(".");return s>=0&&(r=t.slice(s+1),t=t.slice(0,s)),{type:t,name:r}})}function RLe(e){return function(){var t=this.__on;if(t){for(var r=0,s=-1,n=t.length,i;r<n;++r)i=t[r],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function TLe(e,t,r){return function(){var s=this.__on,n,i=PLe(t);if(s){for(var o=0,a=s.length;o<a;++o)if((n=s[o]).type===e.type&&n.name===e.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=i,n.options=r),n.value=t;return}}this.addEventListener(e.type,i,r),n={type:e.type,name:e.name,value:t,listener:i,options:r},s?s.push(n):this.__on=[n]}}function DLe(e,t,r){var s=FLe(e+""),n,i=s.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(n=0,u=a[l];n<i;++n)if((o=s[n]).type===u.type&&o.name===u.name)return u.value}return}for(a=t?TLe:RLe,n=0;n<i;++n)this.each(a(s[n],t,r));return this}function Z$(e,t,r){var s=U$(e),n=s.CustomEvent;typeof n=="function"?n=new n(t,r):(n=s.document.createEvent("Event"),r?(n.initEvent(t,r.bubbles,r.cancelable),n.detail=r.detail):n.initEvent(t,!1,!1)),e.dispatchEvent(n)}function MLe(e,t){return function(){return Z$(this,e,t)}}function ILe(e,t){return function(){return Z$(this,e,t.apply(this,arguments))}}function kLe(e,t){return this.each((typeof t=="function"?ILe:MLe)(e,t))}function*BLe(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],n=0,i=s.length,o;n<i;++n)(o=s[n])&&(yield o)}var LLe=[null];function ld(e,t){this._groups=e,this._parents=t}function t3(){return new ld([[document.documentElement]],LLe)}function HLe(){return this}ld.prototype=t3.prototype={constructor:ld,select:a7e,selectAll:d7e,selectChild:f7e,selectChildren:C7e,filter:w7e,data:P7e,enter:y7e,exit:R7e,join:T7e,merge:D7e,selection:HLe,order:M7e,sort:I7e,call:B7e,nodes:L7e,node:H7e,size:G7e,empty:O7e,each:N7e,attr:j7e,style:X7e,property:eLe,classed:nLe,text:lLe,html:hLe,raise:gLe,lower:ALe,append:mLe,insert:CLe,remove:yLe,clone:xLe,datum:ELe,on:DLe,dispatch:kLe,[Symbol.iterator]:BLe};function y5(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function X$(e,t){var r=Object.create(e.prototype);for(var s in t)r[s]=t[s];return r}function r3(){}var sx=.7,WF=1/sx,nw="\\s*([+-]?\\d+)\\s*",nx="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ih="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",GLe=/^#([0-9a-f]{3,8})$/,OLe=new RegExp(`^rgb\\(${nw},${nw},${nw}\\)$`),NLe=new RegExp(`^rgb\\(${Ih},${Ih},${Ih}\\)$`),_Le=new RegExp(`^rgba\\(${nw},${nw},${nw},${nx}\\)$`),VLe=new RegExp(`^rgba\\(${Ih},${Ih},${Ih},${nx}\\)$`),zLe=new RegExp(`^hsl\\(${nx},${Ih},${Ih}\\)$`),QLe=new RegExp(`^hsla\\(${nx},${Ih},${Ih},${nx}\\)$`),iO={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};y5(r3,ix,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oO,formatHex:oO,formatHex8:ULe,formatHsl:WLe,formatRgb:aO,toString:aO});function oO(){return this.rgb().formatHex()}function ULe(){return this.rgb().formatHex8()}function WLe(){return $$(this).formatHsl()}function aO(){return this.rgb().formatRgb()}function ix(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=GLe.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?lO(t):r===3?new sl(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?tP(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?tP(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=OLe.exec(e))?new sl(t[1],t[2],t[3],1):(t=NLe.exec(e))?new sl(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=_Le.exec(e))?tP(t[1],t[2],t[3],t[4]):(t=VLe.exec(e))?tP(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zLe.exec(e))?dO(t[1],t[2]/100,t[3]/100,1):(t=QLe.exec(e))?dO(t[1],t[2]/100,t[3]/100,t[4]):iO.hasOwnProperty(e)?lO(iO[e]):e==="transparent"?new sl(NaN,NaN,NaN,0):null}function lO(e){return new sl(e>>16&255,e>>8&255,e&255,1)}function tP(e,t,r,s){return s<=0&&(e=t=r=NaN),new sl(e,t,r,s)}function jLe(e){return e instanceof r3||(e=ix(e)),e?(e=e.rgb(),new sl(e.r,e.g,e.b,e.opacity)):new sl}function iB(e,t,r,s){return arguments.length===1?jLe(e):new sl(e,t,r,s??1)}function sl(e,t,r,s){this.r=+e,this.g=+t,this.b=+r,this.opacity=+s}y5(sl,iB,X$(r3,{brighter(e){return e=e==null?WF:Math.pow(WF,e),new sl(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sx:Math.pow(sx,e),new sl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sl(dv(this.r),dv(this.g),dv(this.b),jF(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cO,formatHex:cO,formatHex8:KLe,formatRgb:uO,toString:uO}));function cO(){return`#${Xm(this.r)}${Xm(this.g)}${Xm(this.b)}`}function KLe(){return`#${Xm(this.r)}${Xm(this.g)}${Xm(this.b)}${Xm((isNaN(this.opacity)?1:this.opacity)*255)}`}function uO(){const e=jF(this.opacity);return`${e===1?"rgb(":"rgba("}${dv(this.r)}, ${dv(this.g)}, ${dv(this.b)}${e===1?")":`, ${e})`}`}function jF(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function dv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xm(e){return e=dv(e),(e<16?"0":"")+e.toString(16)}function dO(e,t,r,s){return s<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Nu(e,t,r,s)}function $$(e){if(e instanceof Nu)return new Nu(e.h,e.s,e.l,e.opacity);if(e instanceof r3||(e=ix(e)),!e)return new Nu;if(e instanceof Nu)return e;e=e.rgb();var t=e.r/255,r=e.g/255,s=e.b/255,n=Math.min(t,r,s),i=Math.max(t,r,s),o=NaN,a=i-n,l=(i+n)/2;return a?(t===i?o=(r-s)/a+(r<s)*6:r===i?o=(s-t)/a+2:o=(t-r)/a+4,a/=l<.5?i+n:2-i-n,o*=60):a=l>0&&l<1?0:o,new Nu(o,a,l,e.opacity)}function YLe(e,t,r,s){return arguments.length===1?$$(e):new Nu(e,t,r,s??1)}function Nu(e,t,r,s){this.h=+e,this.s=+t,this.l=+r,this.opacity=+s}y5(Nu,YLe,X$(r3,{brighter(e){return e=e==null?WF:Math.pow(WF,e),new Nu(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sx:Math.pow(sx,e),new Nu(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,s=r+(r<.5?r:1-r)*t,n=2*r-s;return new sl(p4(e>=240?e-240:e+120,n,s),p4(e,n,s),p4(e<120?e+240:e-120,n,s),this.opacity)},clamp(){return new Nu(hO(this.h),rP(this.s),rP(this.l),jF(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=jF(this.opacity);return`${e===1?"hsl(":"hsla("}${hO(this.h)}, ${rP(this.s)*100}%, ${rP(this.l)*100}%${e===1?")":`, ${e})`}`}}));function hO(e){return e=(e||0)%360,e<0?e+360:e}function rP(e){return Math.max(0,Math.min(1,e||0))}function p4(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const J$=e=>()=>e;function ZLe(e,t){return function(r){return e+r*t}}function XLe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(s){return Math.pow(e+s*t,r)}}function $Le(e){return(e=+e)==1?q$:function(t,r){return r-t?XLe(t,r,e):J$(isNaN(t)?r:t)}}function q$(e,t){var r=t-e;return r?ZLe(e,r):J$(isNaN(e)?t:e)}const pO=function e(t){var r=$Le(t);function s(n,i){var o=r((n=iB(n)).r,(i=iB(i)).r),a=r(n.g,i.g),l=r(n.b,i.b),c=q$(n.opacity,i.opacity);return function(u){return n.r=o(u),n.g=a(u),n.b=l(u),n.opacity=c(u),n+""}}return s.gamma=e,s}(1);function Uf(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var oB=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,g4=new RegExp(oB.source,"g");function JLe(e){return function(){return e}}function qLe(e){return function(t){return e(t)+""}}function e5e(e,t){var r=oB.lastIndex=g4.lastIndex=0,s,n,i,o=-1,a=[],l=[];for(e=e+"",t=t+"";(s=oB.exec(e))&&(n=g4.exec(t));)(i=n.index)>r&&(i=t.slice(r,i),a[o]?a[o]+=i:a[++o]=i),(s=s[0])===(n=n[0])?a[o]?a[o]+=n:a[++o]=n:(a[++o]=null,l.push({i:o,x:Uf(s,n)})),r=g4.lastIndex;return r<t.length&&(i=t.slice(r),a[o]?a[o]+=i:a[++o]=i),a.length<2?l[0]?qLe(l[0].x):JLe(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}var gO=180/Math.PI,eJ={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tJ(e,t,r,s,n,i){var o,a,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*r+t*s)&&(r-=e*l,s-=t*l),(a=Math.sqrt(r*r+s*s))&&(r/=a,s/=a,l/=a),e*s<t*r&&(e=-e,t=-t,l=-l,o=-o),{translateX:n,translateY:i,rotate:Math.atan2(t,e)*gO,skewX:Math.atan(l)*gO,scaleX:o,scaleY:a}}var sP;function t5e(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?eJ:tJ(t.a,t.b,t.c,t.d,t.e,t.f)}function r5e(e){return e==null||(sP||(sP=document.createElementNS("http://www.w3.org/2000/svg","g")),sP.setAttribute("transform",e),!(e=sP.transform.baseVal.consolidate()))?eJ:(e=e.matrix,tJ(e.a,e.b,e.c,e.d,e.e,e.f))}function rJ(e,t,r,s){function n(c){return c.length?c.pop()+" ":""}function i(c,u,d,g,A,w){if(c!==d||u!==g){var v=A.push("translate(",null,t,null,r);w.push({i:v-4,x:Uf(c,d)},{i:v-2,x:Uf(u,g)})}else(d||g)&&A.push("translate("+d+t+g+r)}function o(c,u,d,g){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),g.push({i:d.push(n(d)+"rotate(",null,s)-2,x:Uf(c,u)})):u&&d.push(n(d)+"rotate("+u+s)}function a(c,u,d,g){c!==u?g.push({i:d.push(n(d)+"skewX(",null,s)-2,x:Uf(c,u)}):u&&d.push(n(d)+"skewX("+u+s)}function l(c,u,d,g,A,w){if(c!==d||u!==g){var v=A.push(n(A)+"scale(",null,",",null,")");w.push({i:v-4,x:Uf(c,d)},{i:v-2,x:Uf(u,g)})}else(d!==1||g!==1)&&A.push(n(A)+"scale("+d+","+g+")")}return function(c,u){var d=[],g=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,g),o(c.rotate,u.rotate,d,g),a(c.skewX,u.skewX,d,g),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,g),c=u=null,function(A){for(var w=-1,v=g.length,b;++w<v;)d[(b=g[w]).i]=b.x(A);return d.join("")}}}var s5e=rJ(t5e,"px, ","px)","deg)"),n5e=rJ(r5e,", ",")",")"),Mw=0,C1=0,Bb=0,sJ=1e3,KF,w1,YF=0,Tv=0,ST=0,ox=typeof performance=="object"&&performance.now?performance:Date,nJ=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function b5(){return Tv||(nJ(i5e),Tv=ox.now()+ST)}function i5e(){Tv=0}function ZF(){this._call=this._time=this._next=null}ZF.prototype=iJ.prototype={constructor:ZF,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?b5():+r)+(t==null?0:+t),!this._next&&w1!==this&&(w1?w1._next=this:KF=this,w1=this),this._call=e,this._time=r,aB()},stop:function(){this._call&&(this._call=null,this._time=1/0,aB())}};function iJ(e,t,r){var s=new ZF;return s.restart(e,t,r),s}function o5e(){b5(),++Mw;for(var e=KF,t;e;)(t=Tv-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Mw}function fO(){Tv=(YF=ox.now())+ST,Mw=C1=0;try{o5e()}finally{Mw=0,l5e(),Tv=0}}function a5e(){var e=ox.now(),t=e-YF;t>sJ&&(ST-=t,YF=e)}function l5e(){for(var e,t=KF,r,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:KF=r);w1=e,aB(s)}function aB(e){if(!Mw){C1&&(C1=clearTimeout(C1));var t=e-Tv;t>24?(e<1/0&&(C1=setTimeout(fO,e-ox.now()-ST)),Bb&&(Bb=clearInterval(Bb))):(Bb||(YF=ox.now(),Bb=setInterval(a5e,sJ)),Mw=1,nJ(fO))}}function AO(e,t,r){var s=new ZF;return t=t==null?0:+t,s.restart(n=>{s.stop(),e(n+t)},t,r),s}var c5e=O$("start","end","cancel","interrupt"),u5e=[],oJ=0,mO=1,lB=2,E2=3,vO=4,cB=5,P2=6;function xT(e,t,r,s,n,i){var o=e.__transition;if(!o)e.__transition={};else if(r in o)return;d5e(e,r,{name:t,index:s,group:n,on:c5e,tween:u5e,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:oJ})}function S5(e,t){var r=Ad(e,t);if(r.state>oJ)throw new Error("too late; already scheduled");return r}function Jh(e,t){var r=Ad(e,t);if(r.state>E2)throw new Error("too late; already running");return r}function Ad(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function d5e(e,t,r){var s=e.__transition,n;s[t]=r,r.timer=iJ(i,0,r.time);function i(c){r.state=mO,r.timer.restart(o,r.delay,r.time),r.delay<=c&&o(c-r.delay)}function o(c){var u,d,g,A;if(r.state!==mO)return l();for(u in s)if(A=s[u],A.name===r.name){if(A.state===E2)return AO(o);A.state===vO?(A.state=P2,A.timer.stop(),A.on.call("interrupt",e,e.__data__,A.index,A.group),delete s[u]):+u<t&&(A.state=P2,A.timer.stop(),A.on.call("cancel",e,e.__data__,A.index,A.group),delete s[u])}if(AO(function(){r.state===E2&&(r.state=vO,r.timer.restart(a,r.delay,r.time),a(c))}),r.state=lB,r.on.call("start",e,e.__data__,r.index,r.group),r.state===lB){for(r.state=E2,n=new Array(g=r.tween.length),u=0,d=-1;u<g;++u)(A=r.tween[u].value.call(e,e.__data__,r.index,r.group))&&(n[++d]=A);n.length=d+1}}function a(c){for(var u=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=cB,1),d=-1,g=n.length;++d<g;)n[d].call(e,u);r.state===cB&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=P2,r.timer.stop(),delete s[t];for(var c in s)return;delete e.__transition}}function h5e(e,t){var r=e.__transition,s,n,i=!0,o;if(r){t=t==null?null:t+"";for(o in r){if((s=r[o]).name!==t){i=!1;continue}n=s.state>lB&&s.state<cB,s.state=P2,s.timer.stop(),s.on.call(n?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete r[o]}i&&delete e.__transition}}function p5e(e){return this.each(function(){h5e(this,e)})}function g5e(e,t){var r,s;return function(){var n=Jh(this,e),i=n.tween;if(i!==r){s=r=i;for(var o=0,a=s.length;o<a;++o)if(s[o].name===t){s=s.slice(),s.splice(o,1);break}}n.tween=s}}function f5e(e,t,r){var s,n;if(typeof r!="function")throw new Error;return function(){var i=Jh(this,e),o=i.tween;if(o!==s){n=(s=o).slice();for(var a={name:t,value:r},l=0,c=n.length;l<c;++l)if(n[l].name===t){n[l]=a;break}l===c&&n.push(a)}i.tween=n}}function A5e(e,t){var r=this._id;if(e+="",arguments.length<2){for(var s=Ad(this.node(),r).tween,n=0,i=s.length,o;n<i;++n)if((o=s[n]).name===e)return o.value;return null}return this.each((t==null?g5e:f5e)(r,e,t))}function x5(e,t,r){var s=e._id;return e.each(function(){var n=Jh(this,s);(n.value||(n.value={}))[t]=r.apply(this,arguments)}),function(n){return Ad(n,s).value[t]}}function aJ(e,t){var r;return(typeof t=="number"?Uf:t instanceof ix?pO:(r=ix(t))?(t=r,pO):e5e)(e,t)}function m5e(e){return function(){this.removeAttribute(e)}}function v5e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function C5e(e,t,r){var s,n=r+"",i;return function(){var o=this.getAttribute(e);return o===n?null:o===s?i:i=t(s=o,r)}}function w5e(e,t,r){var s,n=r+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===n?null:o===s?i:i=t(s=o,r)}}function y5e(e,t,r){var s,n,i;return function(){var o,a=r(this),l;return a==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=a+"",o===l?null:o===s&&l===n?i:(n=l,i=t(s=o,a)))}}function b5e(e,t,r){var s,n,i;return function(){var o,a=r(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=a+"",o===l?null:o===s&&l===n?i:(n=l,i=t(s=o,a)))}}function S5e(e,t){var r=bT(e),s=r==="transform"?n5e:aJ;return this.attrTween(e,typeof t=="function"?(r.local?b5e:y5e)(r,s,x5(this,"attr."+e,t)):t==null?(r.local?v5e:m5e)(r):(r.local?w5e:C5e)(r,s,t))}function x5e(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function E5e(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function P5e(e,t){var r,s;function n(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&E5e(e,i)),r}return n._value=t,n}function F5e(e,t){var r,s;function n(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&x5e(e,i)),r}return n._value=t,n}function R5e(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var s=bT(e);return this.tween(r,(s.local?P5e:F5e)(s,t))}function T5e(e,t){return function(){S5(this,e).delay=+t.apply(this,arguments)}}function D5e(e,t){return t=+t,function(){S5(this,e).delay=t}}function M5e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?T5e:D5e)(t,e)):Ad(this.node(),t).delay}function I5e(e,t){return function(){Jh(this,e).duration=+t.apply(this,arguments)}}function k5e(e,t){return t=+t,function(){Jh(this,e).duration=t}}function B5e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?I5e:k5e)(t,e)):Ad(this.node(),t).duration}function L5e(e,t){if(typeof t!="function")throw new Error;return function(){Jh(this,e).ease=t}}function H5e(e){var t=this._id;return arguments.length?this.each(L5e(t,e)):Ad(this.node(),t).ease}function G5e(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Jh(this,e).ease=r}}function O5e(e){if(typeof e!="function")throw new Error;return this.each(G5e(this._id,e))}function N5e(e){typeof e!="function"&&(e=V$(e));for(var t=this._groups,r=t.length,s=new Array(r),n=0;n<r;++n)for(var i=t[n],o=i.length,a=s[n]=[],l,c=0;c<o;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new vg(s,this._parents,this._name,this._id)}function _5e(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,s=t.length,n=r.length,i=Math.min(s,n),o=new Array(s),a=0;a<i;++a)for(var l=t[a],c=r[a],u=l.length,d=o[a]=new Array(u),g,A=0;A<u;++A)(g=l[A]||c[A])&&(d[A]=g);for(;a<s;++a)o[a]=t[a];return new vg(o,this._parents,this._name,this._id)}function V5e(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function z5e(e,t,r){var s,n,i=V5e(t)?S5:Jh;return function(){var o=i(this,e),a=o.on;a!==s&&(n=(s=a).copy()).on(t,r),o.on=n}}function Q5e(e,t){var r=this._id;return arguments.length<2?Ad(this.node(),r).on.on(e):this.each(z5e(r,e,t))}function U5e(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function W5e(){return this.on("end.remove",U5e(this._id))}function j5e(e){var t=this._name,r=this._id;typeof e!="function"&&(e=C5(e));for(var s=this._groups,n=s.length,i=new Array(n),o=0;o<n;++o)for(var a=s[o],l=a.length,c=i[o]=new Array(l),u,d,g=0;g<l;++g)(u=a[g])&&(d=e.call(u,u.__data__,g,a))&&("__data__"in u&&(d.__data__=u.__data__),c[g]=d,xT(c[g],t,r,g,c,Ad(u,r)));return new vg(i,this._parents,t,r)}function K5e(e){var t=this._name,r=this._id;typeof e!="function"&&(e=_$(e));for(var s=this._groups,n=s.length,i=[],o=[],a=0;a<n;++a)for(var l=s[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var g=e.call(u,u.__data__,d,l),A,w=Ad(u,r),v=0,b=g.length;v<b;++v)(A=g[v])&&xT(A,t,r,v,g,w);i.push(g),o.push(u)}return new vg(i,o,t,r)}var Y5e=t3.prototype.constructor;function Z5e(){return new Y5e(this._groups,this._parents)}function X5e(e,t){var r,s,n;return function(){var i=Dw(this,e),o=(this.style.removeProperty(e),Dw(this,e));return i===o?null:i===r&&o===s?n:n=t(r=i,s=o)}}function lJ(e){return function(){this.style.removeProperty(e)}}function $5e(e,t,r){var s,n=r+"",i;return function(){var o=Dw(this,e);return o===n?null:o===s?i:i=t(s=o,r)}}function J5e(e,t,r){var s,n,i;return function(){var o=Dw(this,e),a=r(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Dw(this,e))),o===l?null:o===s&&l===n?i:(n=l,i=t(s=o,a))}}function q5e(e,t){var r,s,n,i="style."+t,o="end."+i,a;return function(){var l=Jh(this,e),c=l.on,u=l.value[i]==null?a||(a=lJ(t)):void 0;(c!==r||n!==u)&&(s=(r=c).copy()).on(o,n=u),l.on=s}}function e6e(e,t,r){var s=(e+="")=="transform"?s5e:aJ;return t==null?this.styleTween(e,X5e(e,s)).on("end.style."+e,lJ(e)):typeof t=="function"?this.styleTween(e,J5e(e,s,x5(this,"style."+e,t))).each(q5e(this._id,e)):this.styleTween(e,$5e(e,s,t),r).on("end.style."+e,null)}function t6e(e,t,r){return function(s){this.style.setProperty(e,t.call(this,s),r)}}function r6e(e,t,r){var s,n;function i(){var o=t.apply(this,arguments);return o!==n&&(s=(n=o)&&t6e(e,o,r)),s}return i._value=t,i}function s6e(e,t,r){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,r6e(e,t,r??""))}function n6e(e){return function(){this.textContent=e}}function i6e(e){return function(){var t=e(this);this.textContent=t??""}}function o6e(e){return this.tween("text",typeof e=="function"?i6e(x5(this,"text",e)):n6e(e==null?"":e+""))}function a6e(e){return function(t){this.textContent=e.call(this,t)}}function l6e(e){var t,r;function s(){var n=e.apply(this,arguments);return n!==r&&(t=(r=n)&&a6e(n)),t}return s._value=e,s}function c6e(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,l6e(e))}function u6e(){for(var e=this._name,t=this._id,r=cJ(),s=this._groups,n=s.length,i=0;i<n;++i)for(var o=s[i],a=o.length,l,c=0;c<a;++c)if(l=o[c]){var u=Ad(l,t);xT(l,e,r,c,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new vg(s,this._parents,e,r)}function d6e(){var e,t,r=this,s=r._id,n=r.size();return new Promise(function(i,o){var a={value:o},l={value:function(){--n===0&&i()}};r.each(function(){var c=Jh(this,s),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),n===0&&i()})}var h6e=0;function vg(e,t,r,s){this._groups=e,this._parents=t,this._name=r,this._id=s}function cJ(){return++h6e}var _p=t3.prototype;vg.prototype={constructor:vg,select:j5e,selectAll:K5e,selectChild:_p.selectChild,selectChildren:_p.selectChildren,filter:N5e,merge:_5e,selection:Z5e,transition:u6e,call:_p.call,nodes:_p.nodes,node:_p.node,size:_p.size,empty:_p.empty,each:_p.each,on:Q5e,attr:S5e,attrTween:R5e,style:e6e,styleTween:s6e,text:o6e,textTween:c6e,remove:W5e,tween:A5e,delay:M5e,duration:B5e,ease:H5e,easeVarying:O5e,end:d6e,[Symbol.iterator]:_p[Symbol.iterator]};function p6e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var g6e={time:null,delay:0,duration:250,ease:p6e};function f6e(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function A6e(e){var t,r;e instanceof vg?(t=e._id,e=e._name):(t=cJ(),(r=g6e).time=b5(),e=e==null?null:e+"");for(var s=this._groups,n=s.length,i=0;i<n;++i)for(var o=s[i],a=o.length,l,c=0;c<a;++c)(l=o[c])&&xT(l,e,t,c,o,r||f6e(l,t));return new vg(s,this._parents,e,t)}t3.prototype.interrupt=p5e;t3.prototype.transition=A6e;function m6e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function XF(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,s=e.slice(0,r);return[s.length>1?s[0]+s.slice(2):s,+e.slice(r+1)]}function v6e(e){return e=XF(Math.abs(e)),e?e[1]:NaN}function C6e(e,t){return function(r,s){for(var n=r.length,i=[],o=0,a=e[0],l=0;n>0&&a>0&&(l+a+1>s&&(a=Math.max(1,s-l)),i.push(r.substring(n-=a,n+a)),!((l+=a+1)>s));)a=e[o=(o+1)%e.length];return i.reverse().join(t)}}function w6e(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var y6e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function uB(e){if(!(t=y6e.exec(e)))throw new Error("invalid format: "+e);var t;return new E5({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}uB.prototype=E5.prototype;function E5(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}E5.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function b6e(e){e:for(var t=e.length,r=1,s=-1,n;r<t;++r)switch(e[r]){case".":s=n=r;break;case"0":s===0&&(s=r),n=r;break;default:if(!+e[r])break e;s>0&&(s=0);break}return s>0?e.slice(0,s)+e.slice(n+1):e}var uJ;function S6e(e,t){var r=XF(e,t);if(!r)return e+"";var s=r[0],n=r[1],i=n-(uJ=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,o=s.length;return i===o?s:i>o?s+new Array(i-o+1).join("0"):i>0?s.slice(0,i)+"."+s.slice(i):"0."+new Array(1-i).join("0")+XF(e,Math.max(0,t+i-1))[0]}function CO(e,t){var r=XF(e,t);if(!r)return e+"";var s=r[0],n=r[1];return n<0?"0."+new Array(-n).join("0")+s:s.length>n+1?s.slice(0,n+1)+"."+s.slice(n+1):s+new Array(n-s.length+2).join("0")}const wO={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:m6e,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>CO(e*100,t),r:CO,s:S6e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function yO(e){return e}var bO=Array.prototype.map,SO=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function x6e(e){var t=e.grouping===void 0||e.thousands===void 0?yO:C6e(bO.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",s=e.currency===void 0?"":e.currency[1]+"",n=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?yO:w6e(bO.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=uB(d);var g=d.fill,A=d.align,w=d.sign,v=d.symbol,b=d.zero,S=d.width,P=d.comma,F=d.precision,T=d.trim,D=d.type;D==="n"?(P=!0,D="g"):wO[D]||(F===void 0&&(F=12),T=!0,D="g"),(b||g==="0"&&A==="=")&&(b=!0,g="0",A="=");var B=v==="$"?r:v==="#"&&/[boxX]/.test(D)?"0"+D.toLowerCase():"",k=v==="$"?s:/[%p]/.test(D)?o:"",z=wO[D],O=/[defgprs%]/.test(D);F=F===void 0?6:/[gprs]/.test(D)?Math.max(1,Math.min(21,F)):Math.max(0,Math.min(20,F));function j(_){var G=B,N=k,W,V,q;if(D==="c")N=z(_)+N,_="";else{_=+_;var pe=_<0||1/_<0;if(_=isNaN(_)?l:z(Math.abs(_),F),T&&(_=b6e(_)),pe&&+_==0&&w!=="+"&&(pe=!1),G=(pe?w==="("?w:a:w==="-"||w==="("?"":w)+G,N=(D==="s"?SO[8+uJ/3]:"")+N+(pe&&w==="("?")":""),O){for(W=-1,V=_.length;++W<V;)if(q=_.charCodeAt(W),48>q||q>57){N=(q===46?n+_.slice(W+1):_.slice(W))+N,_=_.slice(0,W);break}}}P&&!b&&(_=t(_,1/0));var X=G.length+_.length+N.length,re=X<S?new Array(S-X+1).join(g):"";switch(P&&b&&(_=t(re+_,re.length?S-N.length:1/0),re=""),A){case"<":_=G+_+N+re;break;case"=":_=G+re+_+N;break;case"^":_=re.slice(0,X=re.length>>1)+G+_+N+re.slice(X);break;default:_=re+G+_+N;break}return i(_)}return j.toString=function(){return d+""},j}function u(d,g){var A=c((d=uB(d),d.type="f",d)),w=Math.max(-8,Math.min(8,Math.floor(v6e(g)/3)))*3,v=Math.pow(10,-w),b=SO[8+w/3];return function(S){return A(v*S)+b}}return{format:c,formatPrefix:u}}var nP;E6e({thousands:",",grouping:[3],currency:["$",""]});function E6e(e){return nP=x6e(e),nP.format,nP.formatPrefix,nP}function y1(e,t,r){this.k=e,this.x=t,this.y=r}y1.prototype={constructor:y1,scale:function(e){return e===1?this:new y1(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new y1(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};y1.prototype;const P6e={class:"block__not-found"},F6e=Tr({__name:"NotFound",setup(e){const t=h5().useApp(),r=()=>{t.updateNavigationState(s=>{s.href="/"})};return(s,n)=>(ye(),je("div",P6e,[We("h1",null,"Not found route: "+Zt(Pe(t).snapshot.navigationState.href),1),zt(Pe(u$),{onClick:Nn(r,["stop"])},{default:er(()=>n[0]||(n[0]=[Ne("Return to main page")])),_:1})]))}}),s3=(e,t)=>{const r=e.__vccOpts||e;for(const[s,n]of t)r[s]=n;return r},R6e={},T6e={class:"block__loader-page"};function D6e(e,t){return ye(),je("div",T6e,t[0]||(t[0]=[We("div",{class:"loader-container"},[We("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const M6e=s3(R6e,[["render",D6e]]),I6e={class:"pl-app-notification-alert"},k6e={class:"pl-app-notification-alert__content"},B6e={class:"pl-app-notification-alert__title"},L6e=Tr({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(e){const t=e,r=br(!1),s=br(!0),n=Je(()=>Object.entries(t.errors).filter(o=>!!o[1]));function i(){r.value=!0}return tn(()=>t.errors,o=>{s.value=Object.values(o).some(a=>!!a)},{immediate:!0,deep:!0}),(o,a)=>(ye(),je("div",I6e,[zt(Pe(f$),{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=l=>r.value=l),width:"720px",style:{"max-height":"100vh"}},{title:er(()=>a[2]||(a[2]=[Ne(" Errors ")])),default:er(()=>[We("div",k6e,[(ye(!0),je(_s,null,Fh(n.value,l=>{var c,u;return ye(),je("div",{key:l[0],class:"pl-app-notification-alert__item"},[We("div",B6e,"Block output: "+Zt(l[0]),1),zt(Pe(oBe),{value:(c=l[1])==null?void 0:c.message,valueToCopy:"fullMessage"in(l[1]??{})?l[1].fullMessage:(u=l[1])==null?void 0:u.message},null,8,["value","valueToCopy"])])}),128))])]),_:1},8,["modelValue"]),zt(Pe($Be),{modelValue:s.value,"onUpdate:modelValue":a[1]||(a[1]=l=>s.value=l),type:"error",closable:""},{actions:er(()=>[zt(Pe(kF),{icon:"arrow-right",onClick:i},{default:er(()=>a[3]||(a[3]=[Ne("See errors")])),_:1}),zt(Pe(cMe))]),default:er(()=>[a[4]||(a[4]=Ne(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),H6e={key:0,class:"block__loader"},G6e=Tr({__name:"BlockLoader",props:{value:{type:[Boolean,Number]}},setup(e){const t=e,r=Je(()=>typeof t.value=="boolean"&&t.value),s=Je(()=>{const n=t.value;if(typeof n=="number")return n>=1?void 0:(n*100).toFixed(2)+"%"});return(n,i)=>r.value?(ye(),je("div",H6e)):s.value!==void 0?(ye(),je("div",{key:1,class:"block__progress",style:oo({"--progress-width":s.value})},null,4)):yt("",!0)}});function O6e(e){const t=br(),r=".pl-block-page__title__append",s=()=>{HR(()=>{if(!e.value){t.value=void 0;return}t.value=document.querySelector(r)?r:void 0,t.value||console.error("[Monetization] use #title slot to place monetization button")})};return Yh(s),L7(s),t}const N6e=y.literal("trial"),_6e=y.literal("free"),V6e=y.literal("single_payment"),z6e=y.literal("subscription"),Q6e=y.union([N6e,_6e,V6e,z6e,y.literal("base")]),U6e=y.object({type:y.union([y.literal("unique_launches"),y.literal("volume_limit")]),used:y.number(),toSpend:y.number(),available:y.number().nullable()}),W6e=y.object({productKey:y.string(),productName:y.string().default("Unknown product"),customerEmail:y.string().optional(),canRun:y.boolean(),status:y.string(),mnz:y.object({type:Q6e.optional(),endOfBillingPeriod:y.string().nullable().optional(),limits:y.array(U6e).optional()})},{message:"Invalid DryRunResult"}),j6e=y.object({httpError:y.string().optional(),response:y.object({result:W6e.optional(),error:y.unknown().optional()}).optional()}).optional();function K6e(){const e=h5(),t=Je(()=>e.loaded?e.useApp():void 0),r=Je(()=>{var b,S;return"__mnzDate"in((S=(b=t.value)==null?void 0:b.model)==null?void 0:S.args)}),s=Je(()=>{var b;return j6e.safeParse((b=t.value)==null?void 0:b.model.outputs.__mnzInfo)}),n=Je(()=>{var b;return(b=s.value)==null?void 0:b.data}),i=Je(()=>{var b,S,P;return((b=s.value)==null?void 0:b.error)??((P=(S=o.value)==null?void 0:S.response)==null?void 0:P.error)}),o=br(void 0),a=br(!1),l=br(0);tn([n],([b])=>{if(b){o.value=b;const S=++l.value;setTimeout(()=>{l.value===S&&(a.value=!1)},1e3)}},{immediate:!0});const c=Je(()=>{var b,S;return(S=(b=o.value)==null?void 0:b.response)==null?void 0:S.result}),u=Je(()=>{var b;return!!((b=c.value)!=null&&b.canRun)}),d=Je(()=>{var b;return n.value?(b=c.value)==null?void 0:b.status:"awaiting"}),g=Je(()=>{var b;return(b=c.value)==null?void 0:b.customerEmail}),A=Je(()=>{var b;return(b=c.value)==null?void 0:b.mnz.endOfBillingPeriod}),w=Je(()=>{var b;return(b=c.value)==null?void 0:b.mnz.limits}),v=()=>{var b;a.value=!0,((b=t.value)==null?void 0:b.model.args).__mnzDate=new Date().toISOString()};return tn(u,b=>{var S;r.value&&(((S=t.value)==null?void 0:S.model.args).__mnzCanRun=b)}),r.value&&yDe(v,6e4),{hasMonetization:r,result:c,error:i,canRun:u,status:d,customerEmail:g,endOfBillingPeriod:A,limits:w,refresh:v,version:l,isLoading:a}}const Y6e=["title"],Z6e=Tr({__name:"UserCabinetCard",props:{userCabinetUrl:{}},setup(e){const t=e,r=br(""),s=Je(()=>r.value?"clipboard-copied":"clipboard"),n=()=>{t.userCabinetUrl&&navigator.clipboard.writeText(t.userCabinetUrl).then(()=>{r.value="URL copied!",setTimeout(()=>{r.value=""},2e3)}).catch(i=>{console.error("Failed to copy text: ",i),r.value="Copy failed",setTimeout(()=>{r.value=""},2e3)})};return(i,o)=>(ye(),je("div",null,[i.userCabinetUrl?(ye(),je("div",{key:0,class:St(i.$style.urlSection)},[We("div",{class:St(i.$style.urlLabel)},"Scientist cabinet URL:",2),We("div",{class:St(i.$style.urlActions)},[We("div",{class:St(i.$style.urlDisplay),title:i.userCabinetUrl},Zt(i.userCabinetUrl),11,Y6e),zt(Pe(_h),{"close-delay":800,position:"top"},{tooltip:er(()=>[Ne(Zt(r.value?r.value:"Copy"),1)]),default:er(()=>[zt(Pe(Vc),{class:St(i.$style.copyIcon),title:"Copy content",name:s.value,onClick:n},null,8,["class","name"])]),_:1})],2)],2)):yt("",!0),We("div",{class:St(i.$style.hint)}," * Copy and paste the link into your browser ",2)]))}}),X6e="_hint_1bvg8_2",$6e="_copyIcon_1bvg8_10",J6e="_urlSection_1bvg8_14",q6e="_urlLabel_1bvg8_23",e8e="_urlActions_1bvg8_28",t8e="_urlDisplay_1bvg8_35",r8e={hint:X6e,copyIcon:$6e,urlSection:J6e,urlLabel:q6e,urlActions:e8e,urlDisplay:t8e},s8e={$style:r8e},n8e=s3(Z6e,[["__cssModules",s8e]]),i8e=Tr({__name:"RunStatus",props:{canRun:{type:Boolean},statusText:{}},setup(e){const t=e;Je(()=>t.canRun?"Can run":"Cannot run: check your monetization settings");const r=Je(()=>t.canRun?"Ready to run":"Cannot run");return(s,n)=>(ye(),je("div",null,[We("div",{class:St([{[s.$style["can-run"]]:s.canRun},s.$style.container])},[We("div",{class:St(s.$style.badge)},[We("i",{class:St(s.$style.blob)},[We("span",null,[We("span",{class:St(s.$style.dot)},null,2)])],2),We("span",null,Zt(r.value),1)],2),yt("",!0),jr(s.$slots,"default")],2),s.statusText?(ye(),je("div",{key:0,class:St(s.$style.statusText)},Zt(s.statusText),3)):yt("",!0)]))}}),o8e="_container_s8cm3_2",a8e="_statusText_s8cm3_14",l8e="_badge_s8cm3_22",c8e="_blob_s8cm3_33",u8e="_dot_s8cm3_50",d8e={container:o8e,"can-run":"_can-run_s8cm3_8",statusText:a8e,badge:l8e,blob:c8e,"pulse-glob":"_pulse-glob_s8cm3_1",dot:u8e},h8e={$style:d8e},p8e=s3(i8e,[["__cssModules",h8e]]),g8e={key:0},f8e={key:1},A8e=Tr({__name:"LimitCard",props:{type:{},label:{},used:{},toSpend:{},available:{},unit:{}},setup(e){const t=e,r=Je(()=>t.available===null?0:t.toSpend/t.available*100),s=Je(()=>t.available===null?0:t.used/t.available*100),n=Je(()=>t.available===null?100:100-s.value-r.value),i=Je(()=>t.type==="unique_launches"?"Runs Limits":t.type==="volume_limit"?"Volume Limits":t.label),o=l=>(l/1024/1024/1024).toFixed(2)+" GB",a=l=>t.type==="volume_limit"?o(l):l;return(l,c)=>(ye(),je("div",{class:St(l.$style.container)},[We("span",{class:St(l.$style.label)},Zt(i.value),3),We("div",{class:St(l.$style.content)},[We("div",{class:St(l.$style.contentAvailable)},[c[0]||(c[0]=Ne(" Available: ")),c[1]||(c[1]=We("div",{style:{flex:"1"}},null,-1)),l.available!==null?(ye(),je("span",g8e,[We("strong",null,Zt(a(l.available)),1),Ne(" / "+Zt(a(l.available+l.toSpend+l.used)),1)])):(ye(),je("span",f8e,"Unlimited"))],2),We("div",{class:St(l.$style.progressBar)},[We("span",{class:St(l.$style.progressBarAvailable),style:oo({width:`${n.value}%`})},null,6),We("span",{class:St(l.$style.progressBarToSpend),style:oo({width:`${r.value}%`})},null,6),We("span",{class:St(l.$style.progressBarUsed),style:oo({width:`${s.value}%`})},null,6)],2),We("div",{class:St(l.$style.legends)},[We("div",{class:St(l.$style.usedLegend)},[c[2]||(c[2]=We("span",null,null,-1)),Ne(" Used: "+Zt(a(l.used)),1)],2),We("div",{class:St(l.$style.toSpendLegend)},[c[3]||(c[3]=We("span",null,null,-1)),Ne(" To spend: "+Zt(a(l.toSpend)),1)],2)],2)],2)],2))}}),m8e="_container_1qgbe_2",v8e="_label_1qgbe_16",C8e="_content_1qgbe_25",w8e="_contentAvailable_1qgbe_31",y8e="_progressBar_1qgbe_43",b8e="_progressBarAvailable_1qgbe_57",S8e="_progressBarUsed_1qgbe_62",x8e="_progressBarToSpend_1qgbe_67",E8e="_legends_1qgbe_72",P8e="_usedLegend_1qgbe_89",F8e="_toSpendLegend_1qgbe_98",R8e={container:m8e,label:v8e,content:C8e,contentAvailable:w8e,progressBar:y8e,progressBarAvailable:b8e,progressBarUsed:S8e,progressBarToSpend:x8e,legends:E8e,usedLegend:P8e,toSpendLegend:F8e},T8e={$style:R8e},D8e=s3(A8e,[["__cssModules",T8e]]),M8e=Tr({__name:"EndOfPeriod",props:{endOfPeriod:{}},setup(e){const t=r=>{if(!r)return"N/A";const s=new Date(r),n=s.getDate().toString().padStart(2,"0"),i=(s.getMonth()+1).toString().padStart(2,"0"),o=s.getFullYear();return`${n}.${i}.${o}`};return(r,s)=>(ye(),je("div",{class:St(r.$style.container)},[s[0]||(s[0]=We("span",null,"End of period",-1)),We("span",null,Zt(t(r.endOfPeriod)),1)],2))}}),I8e="_container_1vyu9_2",k8e={container:I8e},B8e={$style:k8e},L8e=s3(M8e,[["__cssModules",B8e]]),H8e=Tr({__name:"MonetizationSidebar",setup(e){const t=br(!1),{result:r,error:s,hasMonetization:n,canRun:i,status:o,customerEmail:a,endOfBillingPeriod:l,limits:c,refresh:u,isLoading:d}=K6e(),g=O6e(n),A=Je(()=>{var P;return(P=r.value)==null?void 0:P.productName}),w=Je(()=>{if(!r.value)return;const P=new URL(`https://scientist.platforma.bio/product/${r.value.productKey}`);return a.value&&P.searchParams.set("email",a.value),P.toString()}),v=Je(()=>r.value?[{label:r.value.productName,value:r.value.productName}]:[]),b=Je(()=>{switch(o.value){case"active":return"";case"limits_exceeded":return"Usage limits exceeded for the current billing period.";case"payment_required":return"Payment required to continue using the service.";case"select-tariff":return"Select a subscription plan in the Scientist Cabinet.";case"inactive":return"Not found billing period.";case"awaiting":return"Waiting for monetization information";default:return"Unknown status: "+o.value}}),S=Je(()=>i.value?"monetization-on":"monetization-off");return(P,F)=>(ye(),je(_s,null,[Pe(n)?(ye(),jt(Pe(kIe),{key:0,modelValue:t.value,"onUpdate:modelValue":F[0]||(F[0]=T=>t.value=T)},{title:er(()=>F[2]||(F[2]=[We("div",{class:"flex items-center gap-2"},[We("span",null,"Subscription")],-1)])),default:er(()=>[zt(Pe(g$),{label:"Product",readonly:"","model-value":A.value,options:v.value},null,8,["model-value","options"]),zt(p8e,{"can-run":Pe(i),"status-text":b.value},{default:er(()=>[zt(Pe(u$),{title:"Refresh status",round:"",size:"small",style:{"margin-left":"auto"},icon:"loading",loading:Pe(d),onClick:Pe(u)},null,8,["loading","onClick"])]),_:1},8,["can-run","status-text"]),Pe(s)?(ye(),jt(Pe(b2),{key:0,type:"error"},{default:er(()=>[Ne(Zt(Pe(s)),1)]),_:1})):yt("",!0),w.value?(ye(),jt(n8e,{key:1,"user-cabinet-url":w.value},null,8,["user-cabinet-url"])):yt("",!0),Pe(l)?(ye(),jt(L8e,{key:2,"end-of-period":Pe(l)},null,8,["end-of-period"])):yt("",!0),Pe(c)?(ye(!0),je(_s,{key:3},Fh(Pe(c),T=>(ye(),jt(D8e,{key:T.type,type:T.type,label:T.type,used:T.used,"to-spend":T.toSpend,available:T.available},null,8,["type","label","used","to-spend","available"]))),128)):yt("",!0)]),_:1},8,["modelValue"])):yt("",!0),Pe(n)&&Pe(g)?(ye(),jt(kx,{key:1,to:Pe(g)},[zt(Pe(g5),{onClick:F[1]||(F[1]=Nn(T=>t.value=!0,["stop"]))},{append:er(()=>[zt(Pe(m5),{name:S.value},null,8,["name"])]),default:er(()=>[F[3]||(F[3]=Ne(" Subscription "))]),_:1})],8,["to"])):yt("",!0)],64))}}),G8e={class:"block block__layout"},O8e={key:0},N8e=Tr({__name:"BlockLayout",setup(e){const t=h5(),r=c=>{try{return new URL(c,"http://dummy").pathname}catch{console.error("Invalid href",c);return}},s=Je(()=>t.loaded?t.useApp().href:void 0),n=Je(()=>{if(t.loaded){const c=t.useApp(),u=r(c.snapshot.navigationState.href);return u?c.getRoute(u):void 0}}),i=Je(()=>t.loaded?t.useApp():void 0),o=Je(()=>i.value?i.value.model.outputErrors:{}),a=Je(()=>{var c;return((c=i.value)==null?void 0:c.showErrorsNotification)??!0}),l=Je(()=>{var c,u;return(u=(c=i.value)==null?void 0:c.progress)==null?void 0:u.call(c)});return(c,u)=>(ye(),je(_s,null,[We("div",G8e,[zt(G6e,{value:l.value},null,8,["value"]),Pe(t).error?(ye(),je("div",O8e,Zt(Pe(t).error),1)):Pe(t).loaded?n.value?(ye(),jt(QU(n.value),{key:s.value})):(ye(),jt(F6e,{key:3})):(ye(),jt(M6e,{key:1},{default:er(()=>u[0]||(u[0]=[Ne("Loading...")])),_:1})),Pe(t).loaded&&a.value?(ye(),jt(Pe(L6e),{key:4,errors:o.value},null,8,["errors"])):yt("",!0)]),n.value?(ye(),jt(Pe(H8e),{key:0})):yt("",!0)],64))}});var $F={exports:{}};/**
704
704
  * @license
705
705
  * Lodash <https://lodash.com/>
706
706
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -13652,5 +13652,5 @@ d3fc-group.cartesian-chart>.y-label{display:flex;transform:rotate(-90deg);width:
13652
13652
  Q ${n},${o} ${n-Es},${o}
13653
13653
  H ${On}
13654
13654
  L 0,0 z`}function D7t(e,t,r,s,n){switch(r){case"left":return P7t(e,t,n);case"right":return F7t(e,t,n);case"top":return R7t(e,t,s);case"bottom":return T7t(e,t,s);default:z6(r,"Unknown tooltip direction")}}function M7t(e,t,r,s,n,i,o){return o?i.right-r-n-On>e?"right":"left":i.top+s-n-On>t?"top":"bottom"}function I7t(e,t,r,s,n,i){return e==="left"||e==="right"?`translate(${e==="left"?-(s+On+t):s+On},${-r/2+i})`:`translate(${-t/2+n},${e==="top"?-(r+s+On):s+On})`}function k7t(e,t){return e==="left"||e==="right"?`translate(${e==="left"?-t:t},0)`:`translate(0,${e==="top"?-t:t})`}function B7t(e,t,r,s){if(e==="left"||e==="right")return 0;let n=t.right-r,i=t.left+r;return n<s/2?n-s/2:i<s/2?s/2-i:0}function L7t(e,t,r,s){if(e==="top"||e==="bottom")return 0;let n=t.top+r,i=t.bottom-r;return n<s/2?s/2-n:i<s/2?i-s/2:0}function H7t({content:e,x:t,y:r,active:s,container:n,sideDistances:i,offset:o=S7t,horizontal:a=!0}){if(!s||!n&&n!==null)return null;let l=E7t(e),c=x7t(e),u=M7t(l,c,t,r,o,i,a),d=B7t(u,i,t,l),g=L7t(u,i,r,c),A=st.jsxs("g",{transform:`translate(${i.left+t},${i.top+r})`,opacity:s?1:0,stroke:"none",fill:"none",style:{pointerEvents:"none"},children:[st.jsx("path",{transform:k7t(u,o),d:D7t(l,c,u,d,g),fill:Bi}),st.jsx("g",{fontSize:"14px",fontFamily:"Manrope",fill:"white",transform:I7t(u,l,c,o,d,g),children:e.map((w,v)=>st.jsx("text",{x:dre,y:ure+i7*v+i7/2,dominantBaseline:"central",children:w},v))})]});return n===null?A:PJ.createPortal(A,n)}function a1(e){return V5().domain([0,1]).range([e,Bi])(.25)}var t2=1.4;function hre(e,t=6,r=Bi,s=null){switch(e){case null:return"";case"0":return st.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:"none",stroke:r});case"1":return st.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:"none",stroke:r});case"2":return st.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:"none",stroke:r});case"3":return st.jsx("path",{d:`M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:r});case"4":return st.jsx("path",{d:`M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:r});case"5":{let n=t*t2;return st.jsx("path",{d:`M0,-${n}L ${n},0 L 0,${n} L -${n},0z`,fill:"none",stroke:r})}case"6":return st.jsx("path",{d:`M${-2*t*Math.tan(Math.PI/6)},-${t}L ${2*t*Math.tan(Math.PI/6)},-${t}L0,${t}z`,fill:"none",stroke:r});case"7":return st.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:r});case"8":{let n=t*2*Math.cos(Math.PI/4);return st.jsx("path",{d:`M0,-${n}L 0,${n} M -${n},0 L ${n},0 M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:r})}case"9":{let n=t*t2;return st.jsx("path",{d:`M0,-${n}L ${n},0 L 0,${n} L -${n},0z M0,-${n}L 0,${n} M -${n},0 L ${n},0`,fill:"none",stroke:r})}case"10":return st.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:r});case"11":{let n=2*t*Math.tan(Math.PI/6);return st.jsx("path",{d:`M-${n},-${t}L${n},-${t}L0,${-t+2*n}z
13655
- M-${n},${t}L0,${t-2*n}L${n},${t}z`,fill:"none",stroke:r})}case"12":return st.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:r});case"13":return st.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:r});case"14":return st.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M-${t},${t}L0,${-t}L${t},${t}`,fill:"none",stroke:r});case"15":return st.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:r,stroke:r});case"16":return st.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:r,stroke:r});case"17":return st.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:r,stroke:r});case"18":{let n=t*t2;return st.jsx("path",{d:`M0,-${n}L ${n},0 L 0,${n} L -${n},0z`,fill:r,stroke:r})}case"20":{let n=t*2/3;return st.jsx("path",{d:`M -${n},0 a ${n},${n} 0 1,0 ${n*2},0 a ${n},${n} 0 1,0 -${n*2},0z`,fill:r,stroke:r})}case"22":return st.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:r,stroke:s??a1(r)});case"21":return st.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:r,stroke:s??a1(r)});case"24":return st.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:r,stroke:s??a1(r)});case"23":{let n=t*t2;return st.jsx("path",{d:`M0,-${n}L ${n},0 L 0,${n} L -${n},0z`,fill:r,stroke:s??a1(r)})}case"25":return st.jsx("path",{d:`M${-2*t*Math.tan(Math.PI/6)},-${t}L ${2*t*Math.tan(Math.PI/6)},-${t}L0,${t}z`,fill:r,stroke:s??a1(r)});default:z6(e,`Unknown point shape ${e}`)}}function G7t({message:e}){return st.jsx("div",{style:{width:"500px",height:"400px",color:"#ee1616",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"25px",fontFamily:"Arial",border:"1px solid"},children:e})}var o7=4;function SQ(e){return isNaN(e)?"?":e===0?"0":Math.abs(e)<.01?lx(".1e")(e):lx(".2f")(e)}function xQ(e=null){switch(e){case null:return"";case"solid":return"";case"dashed":return"6 6";case"dotted":return"1.5 4";case"dotdash":return"1.4 4 8 4";case"longdash":return"10 4";case"twodash":return"3 3 9 3";default:z6(e,`Unknown line shape ${e}`)}}(class extends bJ.Component{constructor(e){super(e),this.state={hasError:!1,message:""}}static getDerivedStateFromError(e){return{hasError:!0,message:e.message}}componentDidUpdate(e){e.dataId!==this.props.dataId&&this.setState({hasError:!1,message:"error.message"})}componentDidCatch(e,t){console.log(t)}render(){return this.state.hasError?st.jsx(G7t,{message:this.state.message}):this.props.children}});function O7t(e,t,r,s){return e==="left"?r:e==="right"?t-s:(t-(r+s))/2+r}function N7t(e){return e==="left"?"start":e==="right"?"end":"middle"}function _7t({show:e,position:t,title:r,chartsWidth:s,leftPadding:n,rightPadding:i}){return e?st.jsx("g",{children:r.map((o,a)=>st.jsx("text",{x:O7t(t,s,n,i),textAnchor:N7t(t),y:-(r.length-a-1)*24-24-24/2,fontSize:"20px",fontFamily:"Manrope",fontWeight:"500",dominantBaseline:"central",children:o},`${o}_${a}`))}):null}var ro=12,l1=-12,EQ=14;function V7t(e=null){return e==="dashed"?"M1 11.25H6V12.75H1V11.25ZM9.5 11.25H14.5V12.75H9.5V11.25ZM18 11.25H23V12.75H18V11.25Z":e==="dotted"?"M2.75 11.25H1.25V12.75H2.75V11.25Z M11.25 11.25H12.75V12.75H11.25V11.25Z M22.75 11.25H21.25V12.75H22.75V11.25Z M7.75 11.25H6.25V12.75H7.75V11.25Z M16.25 11.25H17.75V12.75H16.25V11.25Z":e==="longdash"?"M1 11.25H10V12.75H1V11.25ZM14 11.25H23V12.75H14V11.25Z":e==="dotdash"?"M1 11.25H2.5V12.75H1V11.25ZM17 12.75H7V11.25H17V12.75ZM21.5 12.75V11.25H23V12.75H21.5Z":e==="twodash"?"M1 11.25H4V12.75H1V11.25ZM17.0261 12.75H7V11.25H17.0261V12.75ZM20 12.75V11.25H23V12.75H20Z":"M1 11.25H23V12.75H1V11.25Z"}var z7t=3,Q7t=24;function U7t({aes:e,label:t,usedAes:r}){let s=r.lineShape,n=r.dotShape,i=r.fillColor||r.lineColor&&!r.lineShape||r.dotFill&&!r.dotShape,o=n?hre(e.dotShape??"21",z7t,i?Bi:e.dotFill??Bi):null,a=(n&&s?2*ro:0)-6,l=s?a+Q7t+8:ro+8;return st.jsxs("g",{children:[i&&st.jsx("rect",{width:ro,height:ro,stroke:e.fillColor??e.lineColor,fill:e.fillColor??e.lineColor,rx:"1",ry:"1"}),n&&st.jsx("g",{transform:`translate(${ro/2},${ro/2})`,children:o}),s&&st.jsx("path",{transform:`translate(${a},-5)`,fillRule:"evenodd",clipRule:"evenodd",d:V7t(e.lineShape),fill:e.lineColor}),st.jsx("text",{x:l,y:ro/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function W7t({aes:e,label:t}){let r=hre(e.shape,e.size,e.color);return st.jsxs("g",{children:[st.jsx("g",{transform:`translate(${ro/2},${ro/2})`,children:r}),st.jsx("text",{x:ro+8,y:ro/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function j7t({legendData:e}){let t=e.items.filter(r=>r.type==="continuous");return st.jsxs("g",{children:[st.jsx("defs",{children:t.map(r=>st.jsx("linearGradient",{id:r.id,gradientTransform:"rotate(90)",children:r.scale.domain().reverse().map(s=>{let n=r.scale.domain(),i=n[n.length-1]-n[0],o=i>0?100-(s-n[0])/i*100:0;return st.jsx("stop",{offset:`${o}%`,stopColor:r.scale(s)},s)})},r.id))}),e.items.map(r=>{if(r.type==="continuous")return st.jsxs("g",{transform:`translate(${r.left},${r.top})`,children:[st.jsx("text",{fontWeight:500,fontSize:"14px",y:l1,children:r.title}),st.jsx("rect",{x:"0",y:"0",width:EQ,height:r.height,stroke:Bi,fill:`url(#${r.id})`}),st.jsx("g",{transform:`translate(${EQ},0)`,children:r.values.map(s=>{let n=r.tickPositionScale(s)??0;return st.jsxs("g",{transform:`translate(0,${n})`,children:[st.jsx("line",{x1:"0",x2:-4,stroke:Bi}),st.jsx("text",{x:8,y:4,children:s})]},s)})}),!1]},r.id);if(r.type==="discreteColor")return st.jsxs("g",{transform:`translate(${r.left},${r.top})`,children:[st.jsx("text",{fontWeight:500,fontSize:"14px",y:l1,children:r.title}),r.values.map((s,n)=>st.jsxs("g",{transform:`translate(0, ${n*(ro+4)})`,children:[st.jsx("rect",{x:"0",y:"0",width:ro,height:ro,fill:r.scale(s),rx:"1",ry:"1",stroke:Bi}),st.jsx("text",{x:ro+8,y:10,children:s})]},s)),!1]},r.id);if(r.type==="discreteMulti")return st.jsxs("g",{transform:`translate(${r.left},${r.top})`,fontSize:"14px",fontWeight:500,children:[st.jsx("text",{fontWeight:600,y:l1,children:r.title}),r.values.map((s,n)=>st.jsx("g",{transform:`translate(0, ${n*(ro+4)})`,children:st.jsx(U7t,{aes:r.scale(s),label:r.labels[s],usedAes:r.usedAes})},s)),!1]},r.id);if(r.type==="dots")return st.jsxs("g",{transform:`translate(${r.left},${r.top})`,fontSize:"14px",fontWeight:500,children:[st.jsx("text",{fontWeight:500,y:l1,children:r.title}),r.values.map((s,n)=>st.jsx("g",{transform:`translate(0, ${n*(ro+4)})`,children:st.jsx(W7t,{aes:r.scale(s),label:r.labels[s]})},s)),!1]},r.id);if(r.type==="size"){let s=r.height/r.values.length;return st.jsxs("g",{transform:`translate(${r.left},${r.top})`,fontSize:"14px",fontWeight:500,children:[st.jsx("text",{fontWeight:500,y:l1,children:r.title}),r.values.map((n,i)=>{let o=r.scale(n);return st.jsxs("g",{transform:`translate(0, ${i*s})`,children:[st.jsx("circle",{r:o,cx:s/2,cy:s/2,fill:Bi}),st.jsx("text",{x:s+4,y:s/2,alignmentBaseline:"central",children:r.labels[n]})]},n)}),!1]},r.id)}})]})}new CD("600 14px Manrope");function K7t(e,t,r=!1){let s=Math.abs(e.range()[0]-e.range()[1]),n=r?Math.min(Math.floor(s/45),10):10,i=e.ticks(n).filter(l=>t&&l>=0||!t),o=new Set(i);if(!r&&i.length>1){let l=e(i[0]),c=e(i[0]);for(let u=1;u<i.length;u++)c=e(i[u]),Math.abs(c-l)>=20?l=c:o.delete(i[u])}r&&i.length>2&&Math.abs(e(i[1])-e(i[0]))<45&&(i=i.filter((l,c)=>c%2===0));let a=i.some(l=>Math.abs(l)<1e-4&&l!==0||l>1e4)?",e":",f";return{ticks:i,format:l=>o.has(l)?e.tickFormat(n,a)(l):""}}var Y7t=1;function Z7t({scaleX:e,scaleY:t,width:r,height:s,axisX:n,axisY:i,frameType:o,updatingKey:a=""}){let[l,c]=qu.useState(e.ticks()),[u,d]=qu.useState(t.ticks()),{significantLines:g=[]}=n,{significantLines:A=[]}=i;return qu.useEffect(()=>{let w=e.ticks().filter(b=>!g.includes(b)),v=t.ticks().filter(b=>!A.includes(b));c(w),d(v)},[e,t,a]),st.jsxs("g",{stroke:o1,children:[n.showGrid&&l.map(w=>{let v=e(w);return st.jsx("line",{x1:v,x2:v,y1:0,y2:s},`x_${v}_${s}`)}),i.showGrid&&u.map(w=>{let v=t(w);return st.jsx("line",{x1:0,x2:r,y1:v,y2:v},`y_${v}_${r}`)}),st.jsx("g",{strokeDasharray:xQ(n.significantLinesStyle),stroke:Bi,children:g.map(w=>{let v=e(w);return v<0||v>r?null:st.jsx("line",{x1:v,x2:v,y1:0,y2:s},`significant_${v}_${s}`)})}),st.jsx("g",{strokeDasharray:xQ(i.significantLinesStyle),stroke:Bi,children:A.map(w=>{let v=t(w);return v<0||v>s?null:st.jsx("line",{x1:0,x2:r,y1:v,y2:v},`significant_${v}_${r}`)})}),o!=="empty"&&st.jsxs("g",{strokeWidth:Y7t,children:[(n.showGrid||o!=="left")&&st.jsx("line",{stroke:o==="left"?o1:Bi,x1:"0",x2:r,y1:s,y2:s}),(n.showGrid||o!=="bottom")&&st.jsx("line",{stroke:o==="bottom"?o1:Bi,x1:"0",x2:"0",y1:"0",y2:s}),(n.showGrid||o==="full")&&st.jsx("line",{stroke:o==="full"?Bi:o1,x1:r,x2:r,y1:"0",y2:s}),(i.showGrid||o==="full")&&st.jsx("line",{stroke:o==="full"?Bi:o1,x1:"0",x2:r,y1:"0",y2:"0"})]})]})}function X7t(e){return`translate(${e},0)`}function $7t(e){return`translate(0,${e})`}function J7t(e){return e==="bottom"?`translate(0,${o7})`:`translate(${-o7},0)`}function q7t(e){return e==="bottom"?"hanging":"central"}function eLt(e){return e==="bottom"?"middle":"end"}var PQ=({scale:e,tickSize:t=6,tickPadding:r=o7,orient:s="bottom",onlyPositive:n=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(v){return b=>{let S=v(b);return S===void 0?0:+S}}let{ticks:a,format:l}=K7t(e,n,s==="bottom"),c=Math.max(t,0)+r,u=o(e.copy()),d=s==="bottom"?X7t:$7t,g=s==="left"?-1:1,A={[(s==="left"?"x":"y")+"2"]:g*t},w={[s==="left"?"x":"y"]:g*c};return st.jsx("g",{children:a.map((v,b)=>st.jsxs("g",{className:"tick",transform:d(u(v)+i),children:[st.jsx("line",{stroke:Bi,...A}),st.jsx("g",{transform:J7t(s),children:st.jsx("text",{fill:Bi,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:q7t(s),textAnchor:eLt(s),...w,children:l(v)})})]},b))})};new CD("16px Manrope");BTt(MBt());var OI=20,FQ=4,tLt=24;function rLt(e,t,r=[]){let s=e.data,n=[`x: ${SQ(e.x)}`,`y: ${SQ(e.y)}`];t.label&&n.unshift(`${t.label}: ${s[t.label]}`);for(let i of r)n.push(`${i.label}: ${s[i.valueLabels??i.value]}`);return n}function RQ(e){return typeof e=="string"?e:e.label??e.value}var TQ=V_e().curve(z_e);function sLt({scales:e,chartSettings:t,mainTitle:r,keyColumn:s,margins:n,chartSizes:i,onlyPositive:o,container:a,zoomStateKey:l,legendData:c,dotsByGrouping:u,layers:d,aesGetters:g,selectedDot:A=null}){var w;let{title:v,xAxis:b,yAxis:S,frame:P,legend:F}=t,T=b.showTicks?FQ:0,D=S.showTicks?FQ:0,B=b.title,k=S.title,z={left:0,right:i.chartWidth,top:0,bottom:i.chartHeight};if(!a)return null;let O=d.find(N=>N.type==="curve"),[j,_]=qu.useState([]);function G(){let N=Object.entries(u).map(([W,V])=>({key:W,d:O!=null&&O.smoothing?TQ(V)??"":V.map(q=>`${e.x(q.x)},${e.y(q.y)}`).join(" "),dot:V[0]}));_(N)}return qu.useEffect(()=>{O&&(TQ.x(N=>e.x(N.x)).y(N=>e.y(N.y)),G())},[l]),qu.useEffect(()=>{O&&G()},[O==null?void 0:O.smoothing]),st.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${i.totalWidth} ${i.totalHeight}`,width:i.totalWidth,height:i.totalHeight,style:{pointerEvents:"none"},children:[st.jsx("defs",{children:b7t}),st.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontFamily:"Manrope",children:[st.jsx("clipPath",{id:"viewportClipPath",children:st.jsx("rect",{x:"0",y:"0",width:i.chartWidth,height:i.chartHeight})}),st.jsx(_7t,{title:r,show:v.show,position:v.position,leftPadding:n.left,rightPadding:n.right,chartsWidth:i.chartWidth}),st.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Bi,children:[B&&st.jsx("text",{x:i.chartWidth/2,y:i.chartHeight+n.bottom-OI/2,children:RQ(B)}),k&&st.jsx("text",{x:-n.left+OI/2,y:i.chartHeight/2,transform:`rotate(-90,${-n.left+OI/2},${i.chartHeight/2})`,children:RQ(k)})]}),st.jsx(Z7t,{width:i.chartWidth,height:i.chartHeight,scaleX:e.x,scaleY:e.y,axisX:b,axisY:S,updatingKey:l,frameType:P.type}),st.jsx("g",{transform:`translate(0,${i.chartHeight})`,children:st.jsx(PQ,{scale:e.x,orient:"bottom",onlyPositive:o.x,tickSize:T})}),st.jsx("g",{children:st.jsx(PQ,{scale:e.y,orient:"left",onlyPositive:o.y,tickSize:D})}),O&&O.smoothing&&st.jsx("g",{clipPath:"url(#viewportClipPath)",children:j.map(({key:N,d:W,dot:V})=>st.jsx("path",{d:W,fill:"none",stroke:g.dotFill(V.data),strokeWidth:O.aes.lineWidth,strokeDasharray:g.lineType(V.data)},N))}),O&&!O.smoothing&&st.jsx("g",{clipPath:"url(#viewportClipPath)",children:j.map(({key:N,d:W,dot:V})=>st.jsx("polyline",{points:W,fill:"none",stroke:g.dotFill(V.data),strokeWidth:O.aes.lineWidth,strokeDasharray:g.lineType(V.data)},N))}),A&&st.jsx(H7t,{content:rLt(A,s,(w=t.tooltips)==null?void 0:w.content),x:e.x(A.x),y:e.y(A.y),active:!0,sideDistances:z,container:a}),F.show&&st.jsx("g",{transform:`translate(${i.chartWidth+tLt},0)`,children:st.jsx(j7t,{legendData:c})})]})]})}bJ.memo(sLt);var I2=y.object({type:y.literal("grouping"),value:y.string()}),nLt=y.object({type:y.literal("dots"),aes:y.optional(y.object({dotFill:y.optional(y.union([y.string(),I2,Bh(y.string())])),dotShape:y.optional(y.union([pl,I2])),dotSize:y.optional(y.union([y.number(),I2]))}))}),iLt=y.object({type:y.literal("curve"),smoothing:y.optional(y.boolean()),aes:y.optional(y.object({lineWidth:y.optional(y.number()),lineShape:y.optional(Xc),lineColor:y.optional(y.union([y.string(),I2,Bh(y.string())])),opacity:y.optional(y.number())}))}),oLt=y.union([nLt,iLt]);y.object({type:y.literal("scatterplot-umap"),title:y.object({name:y.string(),show:y.optional(y.boolean()),position:y.optional(SA)}),size:y.optional(y.object({width:y.optional(y.number()),height:y.optional(y.number())})),legend:y.optional(y.object({show:y.optional(y.boolean()),position:y.optional(tC)})),tooltips:y.optional(y.object({show:y.optional(y.boolean()),content:y.optional(y.array(nr))})),frame:y.optional(y.object({type:y.optional(D3)})),keyColumn:nr,x:nr,y:nr,xAxis:y.optional(_w),yAxis:y.optional(_w),grouping:y.optional(y.array(nr)),label:y.optional(nr),inheritedAes:y.optional(y.record(y.string(),Nw)),layers:y.array(oLt),lassoMode:y.optional(y.boolean())});const aw=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,pre=new Set,a7=typeof process=="object"&&process?process:{},gre=(e,t,r,s)=>{typeof a7.emitWarning=="function"?a7.emitWarning(e,t,r,s):console.error(`[${r}] ${t}: ${e}`)};let AR=globalThis.AbortController,DQ=globalThis.AbortSignal;var MQ;if(typeof AR>"u"){DQ=class{constructor(){bs(this,"onabort"),bs(this,"_onabort",[]),bs(this,"reason"),bs(this,"aborted",!1)}addEventListener(r,s){this._onabort.push(s)}},AR=class{constructor(){bs(this,"signal",new DQ),t()}abort(r){var s,n;if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(const i of this.signal._onabort)i(r);(n=(s=this.signal).onabort)==null||n.call(s,r)}}};let e=((MQ=a7.env)==null?void 0:MQ.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const t=()=>{e&&(e=!1,gre("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const aLt=e=>!pre.has(e),Xf=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),fre=e=>Xf(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?k2:null:null;class k2 extends Array{constructor(t){super(t),this.fill(0)}}var eS;const Are=class E1{constructor(t,r){if(bs(this,"heap"),bs(this,"length"),!de(E1,eS))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}static create(t){const r=fre(t);if(!r)return[];hr(E1,eS,!0);const s=new E1(t,r);return hr(E1,eS,!1),s}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};eS=new WeakMap,As(Are,eS,!1);let lLt=Are;var IQ,kQ,mh,kc,vh,H0,gh,tS,P1,ki,Bc,mi,wn,Or,el,Hc,oa,qi,Sh,eo,Ch,wh,Gc,yh,ev,tl,F1,Vt,l7,z0,Wf,mR,Oc,mre,Q0,rS,vR,Bf,jf,NI,CR,B2,pn,_I,R1,rA,c7;const cLt=class vre{constructor(t){As(this,Vt),As(this,mh),As(this,kc),As(this,vh),As(this,H0),As(this,gh),As(this,tS),As(this,P1),bs(this,"ttl"),bs(this,"ttlResolution"),bs(this,"ttlAutopurge"),bs(this,"updateAgeOnGet"),bs(this,"updateAgeOnHas"),bs(this,"allowStale"),bs(this,"noDisposeOnSet"),bs(this,"noUpdateTTL"),bs(this,"maxEntrySize"),bs(this,"sizeCalculation"),bs(this,"noDeleteOnFetchRejection"),bs(this,"noDeleteOnStaleGet"),bs(this,"allowStaleOnFetchAbort"),bs(this,"allowStaleOnFetchRejection"),bs(this,"ignoreFetchAbort"),As(this,ki),As(this,Bc),As(this,mi),As(this,wn),As(this,Or),As(this,el),As(this,Hc),As(this,oa),As(this,qi),As(this,Sh),As(this,eo),As(this,Ch),As(this,wh),As(this,Gc),As(this,yh),As(this,ev),As(this,tl),As(this,F1),As(this,z0,()=>{}),As(this,Wf,()=>{}),As(this,mR,()=>{}),As(this,Oc,()=>!1),As(this,Q0,O=>{}),As(this,rS,(O,j,_)=>{}),As(this,vR,(O,j,_,G)=>{if(_||G)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0}),bs(this,IQ,"LRUCache");const{max:r=0,ttl:s,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:l,dispose:c,onInsert:u,disposeAfter:d,noDisposeOnSet:g,noUpdateTTL:A,maxSize:w=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:S,memoMethod:P,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:B,ignoreFetchAbort:k}=t;if(r!==0&&!Xf(r))throw new TypeError("max option must be a nonnegative integer");const z=r?fre(r):Array;if(!z)throw new Error("invalid max value: "+r);if(hr(this,mh,r),hr(this,kc,w),this.maxEntrySize=v||de(this,kc),this.sizeCalculation=b,this.sizeCalculation){if(!de(this,kc)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(P!==void 0&&typeof P!="function")throw new TypeError("memoMethod must be a function if defined");if(hr(this,P1,P),S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(hr(this,tS,S),hr(this,ev,!!S),hr(this,mi,new Map),hr(this,wn,new Array(r).fill(void 0)),hr(this,Or,new Array(r).fill(void 0)),hr(this,el,new z(r)),hr(this,Hc,new z(r)),hr(this,oa,0),hr(this,qi,0),hr(this,Sh,lLt.create(r)),hr(this,ki,0),hr(this,Bc,0),typeof c=="function"&&hr(this,vh,c),typeof u=="function"&&hr(this,H0,u),typeof d=="function"?(hr(this,gh,d),hr(this,eo,[])):(hr(this,gh,void 0),hr(this,eo,void 0)),hr(this,yh,!!de(this,vh)),hr(this,F1,!!de(this,H0)),hr(this,tl,!!de(this,gh)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!A,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!D,this.allowStaleOnFetchAbort=!!B,this.ignoreFetchAbort=!!k,this.maxEntrySize!==0){if(de(this,kc)!==0&&!Xf(de(this,kc)))throw new TypeError("maxSize must be a positive integer if specified");if(!Xf(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Wt(this,Vt,mre).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Xf(n)||n===0?n:1,this.ttlAutopurge=!!i,this.ttl=s||0,this.ttl){if(!Xf(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Wt(this,Vt,l7).call(this)}if(de(this,mh)===0&&this.ttl===0&&de(this,kc)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!de(this,mh)&&!de(this,kc)){const O="LRU_CACHE_UNBOUNDED";aLt(O)&&(pre.add(O),gre("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,vre))}}static unsafeExposeInternals(t){return{starts:de(t,wh),ttls:de(t,Gc),sizes:de(t,Ch),keyMap:de(t,mi),keyList:de(t,wn),valList:de(t,Or),next:de(t,el),prev:de(t,Hc),get head(){return de(t,oa)},get tail(){return de(t,qi)},free:de(t,Sh),isBackgroundFetch:r=>{var s;return Wt(s=t,Vt,pn).call(s,r)},backgroundFetch:(r,s,n,i)=>{var o;return Wt(o=t,Vt,B2).call(o,r,s,n,i)},moveToTail:r=>{var s;return Wt(s=t,Vt,R1).call(s,r)},indexes:r=>{var s;return Wt(s=t,Vt,Bf).call(s,r)},rindexes:r=>{var s;return Wt(s=t,Vt,jf).call(s,r)},isStale:r=>{var s;return de(s=t,Oc).call(s,r)}}}get max(){return de(this,mh)}get maxSize(){return de(this,kc)}get calculatedSize(){return de(this,Bc)}get size(){return de(this,ki)}get fetchMethod(){return de(this,tS)}get memoMethod(){return de(this,P1)}get dispose(){return de(this,vh)}get onInsert(){return de(this,H0)}get disposeAfter(){return de(this,gh)}getRemainingTTL(t){return de(this,mi).has(t)?1/0:0}*entries(){for(const t of Wt(this,Vt,Bf).call(this))de(this,Or)[t]!==void 0&&de(this,wn)[t]!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield[de(this,wn)[t],de(this,Or)[t]])}*rentries(){for(const t of Wt(this,Vt,jf).call(this))de(this,Or)[t]!==void 0&&de(this,wn)[t]!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield[de(this,wn)[t],de(this,Or)[t]])}*keys(){for(const t of Wt(this,Vt,Bf).call(this)){const r=de(this,wn)[t];r!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield r)}}*rkeys(){for(const t of Wt(this,Vt,jf).call(this)){const r=de(this,wn)[t];r!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield r)}}*values(){for(const t of Wt(this,Vt,Bf).call(this))de(this,Or)[t]!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield de(this,Or)[t])}*rvalues(){for(const t of Wt(this,Vt,jf).call(this))de(this,Or)[t]!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield de(this,Or)[t])}[(kQ=Symbol.iterator,IQ=Symbol.toStringTag,kQ)](){return this.entries()}find(t,r={}){for(const s of Wt(this,Vt,Bf).call(this)){const n=de(this,Or)[s],i=Wt(this,Vt,pn).call(this,n)?n.__staleWhileFetching:n;if(i!==void 0&&t(i,de(this,wn)[s],this))return this.get(de(this,wn)[s],r)}}forEach(t,r=this){for(const s of Wt(this,Vt,Bf).call(this)){const n=de(this,Or)[s],i=Wt(this,Vt,pn).call(this,n)?n.__staleWhileFetching:n;i!==void 0&&t.call(r,i,de(this,wn)[s],this)}}rforEach(t,r=this){for(const s of Wt(this,Vt,jf).call(this)){const n=de(this,Or)[s],i=Wt(this,Vt,pn).call(this,n)?n.__staleWhileFetching:n;i!==void 0&&t.call(r,i,de(this,wn)[s],this)}}purgeStale(){let t=!1;for(const r of Wt(this,Vt,jf).call(this,{allowStale:!0}))de(this,Oc).call(this,r)&&(Wt(this,Vt,rA).call(this,de(this,wn)[r],"expire"),t=!0);return t}info(t){const r=de(this,mi).get(t);if(r===void 0)return;const s=de(this,Or)[r],n=Wt(this,Vt,pn).call(this,s)?s.__staleWhileFetching:s;if(n===void 0)return;const i={value:n};if(de(this,Gc)&&de(this,wh)){const o=de(this,Gc)[r],a=de(this,wh)[r];if(o&&a){const l=o-(aw.now()-a);i.ttl=l,i.start=Date.now()}}return de(this,Ch)&&(i.size=de(this,Ch)[r]),i}dump(){const t=[];for(const r of Wt(this,Vt,Bf).call(this,{allowStale:!0})){const s=de(this,wn)[r],n=de(this,Or)[r],i=Wt(this,Vt,pn).call(this,n)?n.__staleWhileFetching:n;if(i===void 0||s===void 0)continue;const o={value:i};if(de(this,Gc)&&de(this,wh)){o.ttl=de(this,Gc)[r];const a=aw.now()-de(this,wh)[r];o.start=Math.floor(Date.now()-a)}de(this,Ch)&&(o.size=de(this,Ch)[r]),t.unshift([s,o])}return t}load(t){this.clear();for(const[r,s]of t){if(s.start){const n=Date.now()-s.start;s.start=aw.now()-n}this.set(r,s.value,s)}}set(t,r,s={}){var n,i,o,a,l,c,u;if(r===void 0)return this.delete(t),this;const{ttl:d=this.ttl,start:g,noDisposeOnSet:A=this.noDisposeOnSet,sizeCalculation:w=this.sizeCalculation,status:v}=s;let{noUpdateTTL:b=this.noUpdateTTL}=s;const S=de(this,vR).call(this,t,r,s.size||0,w);if(this.maxEntrySize&&S>this.maxEntrySize)return v&&(v.set="miss",v.maxEntrySizeExceeded=!0),Wt(this,Vt,rA).call(this,t,"set"),this;let P=de(this,ki)===0?void 0:de(this,mi).get(t);if(P===void 0)P=de(this,ki)===0?de(this,qi):de(this,Sh).length!==0?de(this,Sh).pop():de(this,ki)===de(this,mh)?Wt(this,Vt,CR).call(this,!1):de(this,ki),de(this,wn)[P]=t,de(this,Or)[P]=r,de(this,mi).set(t,P),de(this,el)[de(this,qi)]=P,de(this,Hc)[P]=de(this,qi),hr(this,qi,P),Uk(this,ki)._++,de(this,rS).call(this,P,S,v),v&&(v.set="add"),b=!1,de(this,F1)&&((n=de(this,H0))==null||n.call(this,r,t,"add"));else{Wt(this,Vt,R1).call(this,P);const F=de(this,Or)[P];if(r!==F){if(de(this,ev)&&Wt(this,Vt,pn).call(this,F)){F.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:T}=F;T!==void 0&&!A&&(de(this,yh)&&((i=de(this,vh))==null||i.call(this,T,t,"set")),de(this,tl)&&((o=de(this,eo))==null||o.push([T,t,"set"])))}else A||(de(this,yh)&&((a=de(this,vh))==null||a.call(this,F,t,"set")),de(this,tl)&&((l=de(this,eo))==null||l.push([F,t,"set"])));if(de(this,Q0).call(this,P),de(this,rS).call(this,P,S,v),de(this,Or)[P]=r,v){v.set="replace";const T=F&&Wt(this,Vt,pn).call(this,F)?F.__staleWhileFetching:F;T!==void 0&&(v.oldValue=T)}}else v&&(v.set="update");de(this,F1)&&((c=this.onInsert)==null||c.call(this,r,t,r===F?"update":"replace"))}if(d!==0&&!de(this,Gc)&&Wt(this,Vt,l7).call(this),de(this,Gc)&&(b||de(this,mR).call(this,P,d,g),v&&de(this,Wf).call(this,v,P)),!A&&de(this,tl)&&de(this,eo)){const F=de(this,eo);let T;for(;T=F==null?void 0:F.shift();)(u=de(this,gh))==null||u.call(this,...T)}return this}pop(){var t;try{for(;de(this,ki);){const r=de(this,Or)[de(this,oa)];if(Wt(this,Vt,CR).call(this,!0),Wt(this,Vt,pn).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(de(this,tl)&&de(this,eo)){const r=de(this,eo);let s;for(;s=r==null?void 0:r.shift();)(t=de(this,gh))==null||t.call(this,...s)}}}has(t,r={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:n}=r,i=de(this,mi).get(t);if(i!==void 0){const o=de(this,Or)[i];if(Wt(this,Vt,pn).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(de(this,Oc).call(this,i))n&&(n.has="stale",de(this,Wf).call(this,n,i));else return s&&de(this,z0).call(this,i),n&&(n.has="hit",de(this,Wf).call(this,n,i)),!0}else n&&(n.has="miss");return!1}peek(t,r={}){const{allowStale:s=this.allowStale}=r,n=de(this,mi).get(t);if(n===void 0||!s&&de(this,Oc).call(this,n))return;const i=de(this,Or)[n];return Wt(this,Vt,pn).call(this,i)?i.__staleWhileFetching:i}async fetch(t,r={}){const{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:A=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:v,forceRefresh:b=!1,status:S,signal:P}=r;if(!de(this,ev))return S&&(S.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:S});const F={allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:l,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:w,ignoreFetchAbort:A,status:S,signal:P};let T=de(this,mi).get(t);if(T===void 0){S&&(S.fetch="miss");const D=Wt(this,Vt,B2).call(this,t,T,F,v);return D.__returned=D}else{const D=de(this,Or)[T];if(Wt(this,Vt,pn).call(this,D)){const O=s&&D.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",O&&(S.returnedStale=!0)),O?D.__staleWhileFetching:D.__returned=D}const B=de(this,Oc).call(this,T);if(!b&&!B)return S&&(S.fetch="hit"),Wt(this,Vt,R1).call(this,T),n&&de(this,z0).call(this,T),S&&de(this,Wf).call(this,S,T),D;const k=Wt(this,Vt,B2).call(this,t,T,F,v),z=k.__staleWhileFetching!==void 0&&s;return S&&(S.fetch=B?"stale":"refresh",z&&B&&(S.returnedStale=!0)),z?k.__staleWhileFetching:k.__returned=k}}async forceFetch(t,r={}){const s=await this.fetch(t,r);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,r={}){const s=de(this,P1);if(!s)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=r,a=this.get(t,o);if(!i&&a!==void 0)return a;const l=s(t,a,{options:o,context:n});return this.set(t,l,o),l}get(t,r={}){const{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,a=de(this,mi).get(t);if(a!==void 0){const l=de(this,Or)[a],c=Wt(this,Vt,pn).call(this,l);return o&&de(this,Wf).call(this,o,a),de(this,Oc).call(this,a)?(o&&(o.get="stale"),c?(o&&s&&l.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?l.__staleWhileFetching:void 0):(i||Wt(this,Vt,rA).call(this,t,"expire"),o&&s&&(o.returnedStale=!0),s?l:void 0)):(o&&(o.get="hit"),c?l.__staleWhileFetching:(Wt(this,Vt,R1).call(this,a),n&&de(this,z0).call(this,a),l))}else o&&(o.get="miss")}delete(t){return Wt(this,Vt,rA).call(this,t,"delete")}clear(){return Wt(this,Vt,c7).call(this,"delete")}};mh=new WeakMap,kc=new WeakMap,vh=new WeakMap,H0=new WeakMap,gh=new WeakMap,tS=new WeakMap,P1=new WeakMap,ki=new WeakMap,Bc=new WeakMap,mi=new WeakMap,wn=new WeakMap,Or=new WeakMap,el=new WeakMap,Hc=new WeakMap,oa=new WeakMap,qi=new WeakMap,Sh=new WeakMap,eo=new WeakMap,Ch=new WeakMap,wh=new WeakMap,Gc=new WeakMap,yh=new WeakMap,ev=new WeakMap,tl=new WeakMap,F1=new WeakMap,Vt=new WeakSet,l7=function(){const e=new k2(de(this,mh)),t=new k2(de(this,mh));hr(this,Gc,e),hr(this,wh,t),hr(this,mR,(n,i,o=aw.now())=>{if(t[n]=i!==0?o:0,e[n]=i,i!==0&&this.ttlAutopurge){const a=setTimeout(()=>{de(this,Oc).call(this,n)&&Wt(this,Vt,rA).call(this,de(this,wn)[n],"expire")},i+1);a.unref&&a.unref()}}),hr(this,z0,n=>{t[n]=e[n]!==0?aw.now():0}),hr(this,Wf,(n,i)=>{if(e[i]){const o=e[i],a=t[i];if(!o||!a)return;n.ttl=o,n.start=a,n.now=r||s();const l=n.now-a;n.remainingTTL=o-l}});let r=0;const s=()=>{const n=aw.now();if(this.ttlResolution>0){r=n;const i=setTimeout(()=>r=0,this.ttlResolution);i.unref&&i.unref()}return n};this.getRemainingTTL=n=>{const i=de(this,mi).get(n);if(i===void 0)return 0;const o=e[i],a=t[i];if(!o||!a)return 1/0;const l=(r||s())-a;return o-l},hr(this,Oc,n=>{const i=t[n],o=e[n];return!!o&&!!i&&(r||s())-i>o})},z0=new WeakMap,Wf=new WeakMap,mR=new WeakMap,Oc=new WeakMap,mre=function(){const e=new k2(de(this,mh));hr(this,Bc,0),hr(this,Ch,e),hr(this,Q0,t=>{hr(this,Bc,de(this,Bc)-e[t]),e[t]=0}),hr(this,vR,(t,r,s,n)=>{if(Wt(this,Vt,pn).call(this,r))return 0;if(!Xf(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(r,t),!Xf(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),hr(this,rS,(t,r,s)=>{if(e[t]=r,de(this,kc)){const n=de(this,kc)-e[t];for(;de(this,Bc)>n;)Wt(this,Vt,CR).call(this,!0)}hr(this,Bc,de(this,Bc)+e[t]),s&&(s.entrySize=r,s.totalCalculatedSize=de(this,Bc))})},Q0=new WeakMap,rS=new WeakMap,vR=new WeakMap,Bf=function*({allowStale:e=this.allowStale}={}){if(de(this,ki))for(let t=de(this,qi);!(!Wt(this,Vt,NI).call(this,t)||((e||!de(this,Oc).call(this,t))&&(yield t),t===de(this,oa)));)t=de(this,Hc)[t]},jf=function*({allowStale:e=this.allowStale}={}){if(de(this,ki))for(let t=de(this,oa);!(!Wt(this,Vt,NI).call(this,t)||((e||!de(this,Oc).call(this,t))&&(yield t),t===de(this,qi)));)t=de(this,el)[t]},NI=function(e){return e!==void 0&&de(this,mi).get(de(this,wn)[e])===e},CR=function(e){var t,r;const s=de(this,oa),n=de(this,wn)[s],i=de(this,Or)[s];return de(this,ev)&&Wt(this,Vt,pn).call(this,i)?i.__abortController.abort(new Error("evicted")):(de(this,yh)||de(this,tl))&&(de(this,yh)&&((t=de(this,vh))==null||t.call(this,i,n,"evict")),de(this,tl)&&((r=de(this,eo))==null||r.push([i,n,"evict"]))),de(this,Q0).call(this,s),e&&(de(this,wn)[s]=void 0,de(this,Or)[s]=void 0,de(this,Sh).push(s)),de(this,ki)===1?(hr(this,oa,hr(this,qi,0)),de(this,Sh).length=0):hr(this,oa,de(this,el)[s]),de(this,mi).delete(n),Uk(this,ki)._--,s},B2=function(e,t,r,s){const n=t===void 0?void 0:de(this,Or)[t];if(Wt(this,Vt,pn).call(this,n))return n;const i=new AR,{signal:o}=r;o==null||o.addEventListener("abort",()=>i.abort(o.reason),{signal:i.signal});const a={signal:i.signal,options:r,context:s},l=(w,v=!1)=>{const{aborted:b}=i.signal,S=r.ignoreFetchAbort&&w!==void 0;if(r.status&&(b&&!v?(r.status.fetchAborted=!0,r.status.fetchError=i.signal.reason,S&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!S&&!v)return u(i.signal.reason);const P=g;return de(this,Or)[t]===g&&(w===void 0?P.__staleWhileFetching?de(this,Or)[t]=P.__staleWhileFetching:Wt(this,Vt,rA).call(this,e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,w,a.options))),w},c=w=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=w),u(w)),u=w=>{const{aborted:v}=i.signal,b=v&&r.allowStaleOnFetchAbort,S=b||r.allowStaleOnFetchRejection,P=S||r.noDeleteOnFetchRejection,F=g;if(de(this,Or)[t]===g&&(!P||F.__staleWhileFetching===void 0?Wt(this,Vt,rA).call(this,e,"fetch"):b||(de(this,Or)[t]=F.__staleWhileFetching)),S)return r.status&&F.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),F.__staleWhileFetching;if(F.__returned===F)throw w},d=(w,v)=>{var b;const S=(b=de(this,tS))==null?void 0:b.call(this,e,n,a);S&&S instanceof Promise&&S.then(P=>w(P===void 0?void 0:P),v),i.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(w(void 0),r.allowStaleOnFetchAbort&&(w=P=>l(P,!0)))})};r.status&&(r.status.fetchDispatched=!0);const g=new Promise(d).then(l,c),A=Object.assign(g,{__abortController:i,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,A,{...a.options,status:void 0}),t=de(this,mi).get(e)):de(this,Or)[t]=A,A},pn=function(e){if(!de(this,ev))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AR},_I=function(e,t){de(this,Hc)[t]=e,de(this,el)[e]=t},R1=function(e){e!==de(this,qi)&&(e===de(this,oa)?hr(this,oa,de(this,el)[e]):Wt(this,Vt,_I).call(this,de(this,Hc)[e],de(this,el)[e]),Wt(this,Vt,_I).call(this,de(this,qi),e),hr(this,qi,e))},rA=function(e,t){var r,s,n,i;let o=!1;if(de(this,ki)!==0){const a=de(this,mi).get(e);if(a!==void 0)if(o=!0,de(this,ki)===1)Wt(this,Vt,c7).call(this,t);else{de(this,Q0).call(this,a);const l=de(this,Or)[a];if(Wt(this,Vt,pn).call(this,l)?l.__abortController.abort(new Error("deleted")):(de(this,yh)||de(this,tl))&&(de(this,yh)&&((r=de(this,vh))==null||r.call(this,l,e,t)),de(this,tl)&&((s=de(this,eo))==null||s.push([l,e,t]))),de(this,mi).delete(e),de(this,wn)[a]=void 0,de(this,Or)[a]=void 0,a===de(this,qi))hr(this,qi,de(this,Hc)[a]);else if(a===de(this,oa))hr(this,oa,de(this,el)[a]);else{const c=de(this,Hc)[a];de(this,el)[c]=de(this,el)[a];const u=de(this,el)[a];de(this,Hc)[u]=de(this,Hc)[a]}Uk(this,ki)._--,de(this,Sh).push(a)}}if(de(this,tl)&&(n=de(this,eo))!=null&&n.length){const a=de(this,eo);let l;for(;l=a==null?void 0:a.shift();)(i=de(this,gh))==null||i.call(this,...l)}return o},c7=function(e){var t,r,s;for(const n of Wt(this,Vt,jf).call(this,{allowStale:!0})){const i=de(this,Or)[n];if(Wt(this,Vt,pn).call(this,i))i.__abortController.abort(new Error("deleted"));else{const o=de(this,wn)[n];de(this,yh)&&((t=de(this,vh))==null||t.call(this,i,o,e)),de(this,tl)&&((r=de(this,eo))==null||r.push([i,o,e]))}}if(de(this,mi).clear(),de(this,Or).fill(void 0),de(this,wn).fill(void 0),de(this,Gc)&&de(this,wh)&&(de(this,Gc).fill(0),de(this,wh).fill(0)),de(this,Ch)&&de(this,Ch).fill(0),hr(this,oa,0),hr(this,qi,0),de(this,Sh).length=0,hr(this,Bc,0),hr(this,ki,0),de(this,tl)&&de(this,eo)){const n=de(this,eo);let i;for(;i=n==null?void 0:n.shift();)(s=de(this,gh))==null||s.call(this,...i)}};let uLt=cLt;const dLt={cacheSize:15e6};class hLt{constructor(t){bs(this,"_str"),bs(this,"_rawJson"),bs(this,"_zodSchema"),bs(this,"_validatedJson"),this.bytes=t}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(t){return this._zodSchema!==t&&(this._validatedJson=t.parse(this.rawJson),this._zodSchema=t),this._validatedJson}}const BQ=class L2{constructor(t){bs(this,"fileDataCache"),bs(this,"fileDataRefs",new Map);const r={...dLt,...t??{}};this.fileDataCache=new uLt({maxSize:r.cacheSize,fetchMethod:async s=>new hLt(await $X().blobDriver.getContent(s)),sizeCalculation:s=>s.bytes.length,dispose:(s,n)=>{this.fileDataRefs.delete(n)}})}getDataRef(t){const r=this.fileDataRefs.get(t);if(r!==void 0)return r;const s=yU();return this.fileDataRefs.set(t,s),(async()=>{try{const n=await this.fileDataCache.fetch(t);s.value=n}catch(n){console.error(n)}})(),s}getContentBytes(t){if(t===void 0)return;const r=this.getDataRef(t);return Je(()=>{var s;return(s=r.value)==null?void 0:s.bytes})}getContentString(t){if(t===void 0)return;const r=this.getDataRef(t);return Je(()=>{var s;return(s=r==null?void 0:r.value)==null?void 0:s.str})}getContentJson(t,r){if(t===void 0)return;const s=this.getDataRef(t);return Je(()=>{var n,i;return r===void 0?(n=s==null?void 0:s.value)==null?void 0:n.rawJson:(i=s==null?void 0:s.value)==null?void 0:i.validatedJson(r)})}static getContentBytes(t){return L2.globalInstance.getContentBytes(t)}static getContentString(t){return L2.globalInstance.getContentString(t)}static getContentJson(t,r){return L2.globalInstance.getContentJson(t,r)}};bs(BQ,"globalInstance",new BQ);function pLt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gLt=function e(t){if(typeof t=="number"&&isNaN(t))throw new Error("NaN is not allowed");if(typeof t=="number"&&!isFinite(t))throw new Error("Infinity is not allowed");return t===null||typeof t!="object"?JSON.stringify(t):t.toJSON instanceof Function?e(t.toJSON()):Array.isArray(t)?`[${t.reduce((n,i,o)=>`${n}${o===0?"":","}${e(i===void 0||typeof i=="symbol"?null:i)}`,"")}]`:`{${Object.keys(t).sort().reduce((s,n)=>{if(t[n]===void 0||typeof t[n]=="symbol")return s;const i=s.length===0?"":",";return`${s}${i}${e(n)}:${e(t[n])}`},"")}}`};const vy=pLt(gLt);var Cs;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{const i={};for(const o of n)i[o]=o;return i},e.getValidEnumValues=n=>{const i=e.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(const a of i)o[a]=n[a];return e.objectValues(o)},e.objectValues=n=>e.objectKeys(n).map(function(i){return n[i]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(o);return i},e.find=(n,i)=>{for(const o of n)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,i=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=s,e.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(Cs||(Cs={}));var u7;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(u7||(u7={}));const Ot=Cs.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$f=e=>{switch(typeof e){case"undefined":return Ot.undefined;case"string":return Ot.string;case"number":return isNaN(e)?Ot.nan:Ot.number;case"boolean":return Ot.boolean;case"function":return Ot.function;case"bigint":return Ot.bigint;case"symbol":return Ot.symbol;case"object":return Array.isArray(e)?Ot.array:e===null?Ot.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ot.promise:typeof Map<"u"&&e instanceof Map?Ot.map:typeof Set<"u"&&e instanceof Set?Ot.set:typeof Date<"u"&&e instanceof Date?Ot.date:Ot.object;default:return Ot.unknown}},mt=Cs.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),fLt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class jl extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(i){return i.message},s={_errors:[]},n=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(r(o));else{let a=s,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return n(this),s}static assert(t){if(!(t instanceof jl))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Cs.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},s=[];for(const n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):s.push(t(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}jl.create=e=>new jl(e);const Vw=(e,t)=>{let r;switch(e.code){case mt.invalid_type:e.received===Ot.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case mt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Cs.jsonStringifyReplacer)}`;break;case mt.unrecognized_keys:r=`Unrecognized key(s) in object: ${Cs.joinValues(e.keys,", ")}`;break;case mt.invalid_union:r="Invalid input";break;case mt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Cs.joinValues(e.options)}`;break;case mt.invalid_enum_value:r=`Invalid enum value. Expected ${Cs.joinValues(e.options)}, received '${e.received}'`;break;case mt.invalid_arguments:r="Invalid function arguments";break;case mt.invalid_return_type:r="Invalid function return type";break;case mt.invalid_date:r="Invalid date";break;case mt.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Cs.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case mt.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case mt.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case mt.custom:r="Invalid input";break;case mt.invalid_intersection_types:r="Intersection results could not be merged";break;case mt.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case mt.not_finite:r="Number must be finite";break;default:r=t.defaultError,Cs.assertNever(e)}return{message:r}};let Cre=Vw;function ALt(e){Cre=e}function wR(){return Cre}const yR=e=>{const{data:t,path:r,errorMaps:s,issueData:n}=e,i=[...r,...n.path||[]],o={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let a="";const l=s.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...n,path:i,message:a}},mLt=[];function kt(e,t){const r=wR(),s=yR({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Vw?void 0:Vw].filter(n=>!!n)});e.common.issues.push(s)}class No{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const s=[];for(const n of r){if(n.status==="aborted")return yr;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,r){const s=[];for(const n of r){const i=await n.key,o=await n.value;s.push({key:i,value:o})}return No.mergeObjectSync(t,s)}static mergeObjectSync(t,r){const s={};for(const n of r){const{key:i,value:o}=n;if(i.status==="aborted"||o.status==="aborted")return yr;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[i.value]=o.value)}return{status:t.value,value:s}}}const yr=Object.freeze({status:"aborted"}),U0=e=>({status:"dirty",value:e}),Ca=e=>({status:"valid",value:e}),d7=e=>e.status==="aborted",h7=e=>e.status==="dirty",Ax=e=>e.status==="valid",mx=e=>typeof Promise<"u"&&e instanceof Promise;function bR(e,t,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function wre(e,t,r,s,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var qt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(qt||(qt={}));var T1,D1;class jh{constructor(t,r,s,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const LQ=(e,t)=>{if(Ax(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new jl(e.common.issues);return this._error=r,this._error}}};function zr(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:s,description:n}=e;if(t&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(o,a)=>{var l,c;const{message:u}=e;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??s)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??r)!==null&&c!==void 0?c:a.defaultError}},description:n}}class Xr{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return $f(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:$f(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new No,ctx:{common:t.parent.common,data:t.data,parsedType:$f(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(mx(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const s=this.safeParse(t,r);if(s.success)return s.data;throw s.error}safeParse(t,r){var s;const n={common:{issues:[],async:(s=r==null?void 0:r.async)!==null&&s!==void 0?s:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$f(t)},i=this._parseSync({data:t,path:n.path,parent:n});return LQ(n,i)}async parseAsync(t,r){const s=await this.safeParseAsync(t,r);if(s.success)return s.data;throw s.error}async safeParseAsync(t,r){const s={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$f(t)},n=this._parse({data:t,path:s.path,parent:s}),i=await(mx(n)?n:Promise.resolve(n));return LQ(s,i)}refine(t,r){const s=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,i)=>{const o=t(n),a=()=>i.addIssue({code:mt.custom,...s(n)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,r){return this._refinement((s,n)=>t(s)?!0:(n.addIssue(typeof r=="function"?r(s,n):r),!1))}_refinement(t){return new ud({schema:this,typeName:Cr.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Lh.create(this,this._def)}nullable(){return FA.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ed.create(this,this._def)}promise(){return Qw.create(this,this._def)}or(t){return yx.create([this,t],this._def)}and(t){return bx.create(this,t,this._def)}transform(t){return new ud({...zr(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Fx({...zr(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new Q6({typeName:Cr.ZodBranded,type:this,...zr(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Rx({...zr(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return M3.create(this,t)}readonly(){return Tx.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const vLt=/^c[^\s-]{8,}$/i,CLt=/^[0-9a-z]+$/,wLt=/^[0-9A-HJKMNP-TV-Z]{26}$/,yLt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,bLt=/^[a-z0-9_-]{21}$/i,SLt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,xLt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ELt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let VI;const PLt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,FLt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,RLt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yre="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",TLt=new RegExp(`^${yre}$`);function bre(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function DLt(e){return new RegExp(`^${bre(e)}$`)}function Sre(e){let t=`${yre}T${bre(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function MLt(e,t){return!!((t==="v4"||!t)&&PLt.test(e)||(t==="v6"||!t)&&FLt.test(e))}class Uu extends Xr{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ot.string){const i=this._getOrReturnCtx(t);return kt(i,{code:mt.invalid_type,expected:Ot.string,received:i.parsedType}),yr}const s=new No;let n;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="max")t.data.length>i.value&&(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,a=t.data.length<i.value;(o||a)&&(n=this._getOrReturnCtx(t,n),o?kt(n,{code:mt.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&kt(n,{code:mt.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),s.dirty())}else if(i.kind==="email")xLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"email",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")VI||(VI=new RegExp(ELt,"u")),VI.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"emoji",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")yLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"uuid",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")bLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"nanoid",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid")vLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"cuid",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid2")CLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"cuid2",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")wLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"ulid",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),kt(n,{validation:"url",code:mt.invalid_string,message:i.message}),s.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"regex",code:mt.invalid_string,message:i.message}),s.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),s.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:{startsWith:i.value},message:i.message}),s.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:{endsWith:i.value},message:i.message}),s.dirty()):i.kind==="datetime"?Sre(i).test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?TLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?DLt(i).test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?SLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"duration",code:mt.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?MLt(t.data,i.version)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"ip",code:mt.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?RLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"base64",code:mt.invalid_string,message:i.message}),s.dirty()):Cs.assertNever(i);return{status:s.value,value:t.data}}_regex(t,r,s){return this.refinement(n=>t.test(n),{validation:r,code:mt.invalid_string,...qt.errToObj(s)})}_addCheck(t){return new Uu({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...qt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...qt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...qt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...qt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...qt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...qt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...qt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...qt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...qt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...qt.errToObj(t)})}datetime(t){var r,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...qt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...qt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...qt.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...qt.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...qt.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...qt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...qt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...qt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...qt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...qt.errToObj(r)})}nonempty(t){return this.min(1,qt.errToObj(t))}trim(){return new Uu({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Uu({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Uu({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Uu.create=e=>{var t;return new Uu({checks:[],typeName:Cr.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...zr(e)})};function ILt(e,t){const r=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=r>s?r:s,i=parseInt(e.toFixed(n).replace(".","")),o=parseInt(t.toFixed(n).replace(".",""));return i%o/Math.pow(10,n)}class xA extends Xr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ot.number){const i=this._getOrReturnCtx(t);return kt(i,{code:mt.invalid_type,expected:Ot.number,received:i.parsedType}),yr}let s;const n=new No;for(const i of this._def.checks)i.kind==="int"?Cs.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?ILt(t.data,i.value)!==0&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.not_finite,message:i.message}),n.dirty()):Cs.assertNever(i);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,qt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,qt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,qt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,qt.toString(r))}setLimit(t,r,s,n){return new xA({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:qt.toString(n)}]})}_addCheck(t){return new xA({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:qt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:qt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:qt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:qt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:qt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:qt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:qt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:qt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:qt.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Cs.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(r)&&Number.isFinite(t)}}xA.create=e=>new xA({checks:[],typeName:Cr.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...zr(e)});class EA extends Xr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Ot.bigint){const i=this._getOrReturnCtx(t);return kt(i,{code:mt.invalid_type,expected:Ot.bigint,received:i.parsedType}),yr}let s;const n=new No;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):Cs.assertNever(i);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,qt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,qt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,qt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,qt.toString(r))}setLimit(t,r,s,n){return new EA({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:qt.toString(n)}]})}_addCheck(t){return new EA({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:qt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:qt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:qt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:qt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:qt.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}EA.create=e=>{var t;return new EA({checks:[],typeName:Cr.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...zr(e)})};class vx extends Xr{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ot.boolean){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.boolean,received:s.parsedType}),yr}return Ca(t.data)}}vx.create=e=>new vx({typeName:Cr.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...zr(e)});class kv extends Xr{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ot.date){const i=this._getOrReturnCtx(t);return kt(i,{code:mt.invalid_type,expected:Ot.date,received:i.parsedType}),yr}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return kt(i,{code:mt.invalid_date}),yr}const s=new No;let n;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),s.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),s.dirty()):Cs.assertNever(i);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(t){return new kv({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:qt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:qt.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}kv.create=e=>new kv({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Cr.ZodDate,...zr(e)});class SR extends Xr{_parse(t){if(this._getType(t)!==Ot.symbol){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.symbol,received:s.parsedType}),yr}return Ca(t.data)}}SR.create=e=>new SR({typeName:Cr.ZodSymbol,...zr(e)});class Cx extends Xr{_parse(t){if(this._getType(t)!==Ot.undefined){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.undefined,received:s.parsedType}),yr}return Ca(t.data)}}Cx.create=e=>new Cx({typeName:Cr.ZodUndefined,...zr(e)});class wx extends Xr{_parse(t){if(this._getType(t)!==Ot.null){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.null,received:s.parsedType}),yr}return Ca(t.data)}}wx.create=e=>new wx({typeName:Cr.ZodNull,...zr(e)});class zw extends Xr{constructor(){super(...arguments),this._any=!0}_parse(t){return Ca(t.data)}}zw.create=e=>new zw({typeName:Cr.ZodAny,...zr(e)});class pv extends Xr{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ca(t.data)}}pv.create=e=>new pv({typeName:Cr.ZodUnknown,...zr(e)});class bg extends Xr{_parse(t){const r=this._getOrReturnCtx(t);return kt(r,{code:mt.invalid_type,expected:Ot.never,received:r.parsedType}),yr}}bg.create=e=>new bg({typeName:Cr.ZodNever,...zr(e)});class xR extends Xr{_parse(t){if(this._getType(t)!==Ot.undefined){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.void,received:s.parsedType}),yr}return Ca(t.data)}}xR.create=e=>new xR({typeName:Cr.ZodVoid,...zr(e)});class ed extends Xr{_parse(t){const{ctx:r,status:s}=this._processInputParams(t),n=this._def;if(r.parsedType!==Ot.array)return kt(r,{code:mt.invalid_type,expected:Ot.array,received:r.parsedType}),yr;if(n.exactLength!==null){const o=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(o||a)&&(kt(r,{code:o?mt.too_big:mt.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(kt(r,{code:mt.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(kt(r,{code:mt.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>n.type._parseAsync(new jh(r,o,r.path,a)))).then(o=>No.mergeArray(s,o));const i=[...r.data].map((o,a)=>n.type._parseSync(new jh(r,o,r.path,a)));return No.mergeArray(s,i)}get element(){return this._def.type}min(t,r){return new ed({...this._def,minLength:{value:t,message:qt.toString(r)}})}max(t,r){return new ed({...this._def,maxLength:{value:t,message:qt.toString(r)}})}length(t,r){return new ed({...this._def,exactLength:{value:t,message:qt.toString(r)}})}nonempty(t){return this.min(1,t)}}ed.create=(e,t)=>new ed({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...zr(t)});function G0(e){if(e instanceof Rn){const t={};for(const r in e.shape){const s=e.shape[r];t[r]=Lh.create(G0(s))}return new Rn({...e._def,shape:()=>t})}else return e instanceof ed?new ed({...e._def,type:G0(e.element)}):e instanceof Lh?Lh.create(G0(e.unwrap())):e instanceof FA?FA.create(G0(e.unwrap())):e instanceof Kh?Kh.create(e.items.map(t=>G0(t))):e}class Rn extends Xr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Cs.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Ot.object){const c=this._getOrReturnCtx(t);return kt(c,{code:mt.invalid_type,expected:Ot.object,received:c.parsedType}),yr}const{status:s,ctx:n}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof bg&&this._def.unknownKeys==="strip"))for(const c in n.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const u=i[c],d=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new jh(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof bg){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict")a.length>0&&(kt(n,{code:mt.unrecognized_keys,keys:a}),s.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new jh(n,d,n.path,u)),alwaysSet:u in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,g=await u.value;c.push({key:d,value:g,alwaysSet:u.alwaysSet})}return c}).then(c=>No.mergeObjectSync(s,c)):No.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(t){return qt.errToObj,new Rn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,s)=>{var n,i,o,a;const l=(o=(i=(n=this._def).errorMap)===null||i===void 0?void 0:i.call(n,r,s).message)!==null&&o!==void 0?o:s.defaultError;return r.code==="unrecognized_keys"?{message:(a=qt.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Rn({...this._def,unknownKeys:"strip"})}passthrough(){return new Rn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Cr.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Rn({...this._def,catchall:t})}pick(t){const r={};return Cs.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new Rn({...this._def,shape:()=>r})}omit(t){const r={};return Cs.objectKeys(this.shape).forEach(s=>{t[s]||(r[s]=this.shape[s])}),new Rn({...this._def,shape:()=>r})}deepPartial(){return G0(this)}partial(t){const r={};return Cs.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];t&&!t[s]?r[s]=n:r[s]=n.optional()}),new Rn({...this._def,shape:()=>r})}required(t){const r={};return Cs.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])r[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof Lh;)i=i._def.innerType;r[s]=i}}),new Rn({...this._def,shape:()=>r})}keyof(){return xre(Cs.objectKeys(this.shape))}}Rn.create=(e,t)=>new Rn({shape:()=>e,unknownKeys:"strip",catchall:bg.create(),typeName:Cr.ZodObject,...zr(t)});Rn.strictCreate=(e,t)=>new Rn({shape:()=>e,unknownKeys:"strict",catchall:bg.create(),typeName:Cr.ZodObject,...zr(t)});Rn.lazycreate=(e,t)=>new Rn({shape:e,unknownKeys:"strip",catchall:bg.create(),typeName:Cr.ZodObject,...zr(t)});class yx extends Xr{_parse(t){const{ctx:r}=this._processInputParams(t),s=this._def.options;function n(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new jl(a.ctx.common.issues));return kt(r,{code:mt.invalid_union,unionErrors:o}),yr}if(r.common.async)return Promise.all(s.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(n);{let i;const o=[];for(const l of s){const c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(l=>new jl(l));return kt(r,{code:mt.invalid_union,unionErrors:a}),yr}}get options(){return this._def.options}}yx.create=(e,t)=>new yx({options:e,typeName:Cr.ZodUnion,...zr(t)});const Zp=e=>e instanceof xx?Zp(e.schema):e instanceof ud?Zp(e.innerType()):e instanceof Ex?[e.value]:e instanceof PA?e.options:e instanceof Px?Cs.objectValues(e.enum):e instanceof Fx?Zp(e._def.innerType):e instanceof Cx?[void 0]:e instanceof wx?[null]:e instanceof Lh?[void 0,...Zp(e.unwrap())]:e instanceof FA?[null,...Zp(e.unwrap())]:e instanceof Q6||e instanceof Tx?Zp(e.unwrap()):e instanceof Rx?Zp(e._def.innerType):[];class wD extends Xr{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ot.object)return kt(r,{code:mt.invalid_type,expected:Ot.object,received:r.parsedType}),yr;const s=this.discriminator,n=r.data[s],i=this.optionsMap.get(n);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(kt(r,{code:mt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),yr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,s){const n=new Map;for(const i of r){const o=Zp(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(n.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,i)}}return new wD({typeName:Cr.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...zr(s)})}}function p7(e,t){const r=$f(e),s=$f(t);if(e===t)return{valid:!0,data:e};if(r===Ot.object&&s===Ot.object){const n=Cs.objectKeys(t),i=Cs.objectKeys(e).filter(a=>n.indexOf(a)!==-1),o={...e,...t};for(const a of i){const l=p7(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===Ot.array&&s===Ot.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let i=0;i<e.length;i++){const o=e[i],a=t[i],l=p7(o,a);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===Ot.date&&s===Ot.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class bx extends Xr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=(i,o)=>{if(d7(i)||d7(o))return yr;const a=p7(i.value,o.value);return a.valid?((h7(i)||h7(o))&&r.dirty(),{status:r.value,value:a.data}):(kt(s,{code:mt.invalid_intersection_types}),yr)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,o])=>n(i,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}bx.create=(e,t,r)=>new bx({left:e,right:t,typeName:Cr.ZodIntersection,...zr(r)});class Kh extends Xr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ot.array)return kt(s,{code:mt.invalid_type,expected:Ot.array,received:s.parsedType}),yr;if(s.data.length<this._def.items.length)return kt(s,{code:mt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),yr;!this._def.rest&&s.data.length>this._def.items.length&&(kt(s,{code:mt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...s.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new jh(s,o,s.path,a)):null}).filter(o=>!!o);return s.common.async?Promise.all(i).then(o=>No.mergeArray(r,o)):No.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new Kh({...this._def,rest:t})}}Kh.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Kh({items:e,typeName:Cr.ZodTuple,rest:null,...zr(t)})};class Sx extends Xr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ot.object)return kt(s,{code:mt.invalid_type,expected:Ot.object,received:s.parsedType}),yr;const n=[],i=this._def.keyType,o=this._def.valueType;for(const a in s.data)n.push({key:i._parse(new jh(s,a,s.path,a)),value:o._parse(new jh(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?No.mergeObjectAsync(r,n):No.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,s){return r instanceof Xr?new Sx({keyType:t,valueType:r,typeName:Cr.ZodRecord,...zr(s)}):new Sx({keyType:Uu.create(),valueType:t,typeName:Cr.ZodRecord,...zr(r)})}}class ER extends Xr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ot.map)return kt(s,{code:mt.invalid_type,expected:Ot.map,received:s.parsedType}),yr;const n=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([a,l],c)=>({key:n._parse(new jh(s,a,s.path,[c,"key"])),value:i._parse(new jh(s,l,s.path,[c,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return yr;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(c.value,u.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return yr;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(c.value,u.value)}return{status:r.value,value:a}}}}ER.create=(e,t,r)=>new ER({valueType:t,keyType:e,typeName:Cr.ZodMap,...zr(r)});class Bv extends Xr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ot.set)return kt(s,{code:mt.invalid_type,expected:Ot.set,received:s.parsedType}),yr;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(kt(s,{code:mt.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(kt(s,{code:mt.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return yr;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}const a=[...s.data.values()].map((l,c)=>i._parse(new jh(s,l,s.path,c)));return s.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,r){return new Bv({...this._def,minSize:{value:t,message:qt.toString(r)}})}max(t,r){return new Bv({...this._def,maxSize:{value:t,message:qt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Bv.create=(e,t)=>new Bv({valueType:e,minSize:null,maxSize:null,typeName:Cr.ZodSet,...zr(t)});class lw extends Xr{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ot.function)return kt(r,{code:mt.invalid_type,expected:Ot.function,received:r.parsedType}),yr;function s(a,l){return yR({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wR(),Vw].filter(c=>!!c),issueData:{code:mt.invalid_arguments,argumentsError:l}})}function n(a,l){return yR({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wR(),Vw].filter(c=>!!c),issueData:{code:mt.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Qw){const a=this;return Ca(async function(...l){const c=new jl([]),u=await a._def.args.parseAsync(l,i).catch(A=>{throw c.addIssue(s(l,A)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,i).catch(A=>{throw c.addIssue(n(d,A)),c})})}else{const a=this;return Ca(function(...l){const c=a._def.args.safeParse(l,i);if(!c.success)throw new jl([s(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,i);if(!d.success)throw new jl([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new lw({...this._def,args:Kh.create(t).rest(pv.create())})}returns(t){return new lw({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,s){return new lw({args:t||Kh.create([]).rest(pv.create()),returns:r||pv.create(),typeName:Cr.ZodFunction,...zr(s)})}}class xx extends Xr{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}xx.create=(e,t)=>new xx({getter:e,typeName:Cr.ZodLazy,...zr(t)});class Ex extends Xr{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return kt(r,{received:r.data,code:mt.invalid_literal,expected:this._def.value}),yr}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ex.create=(e,t)=>new Ex({value:e,typeName:Cr.ZodLiteral,...zr(t)});function xre(e,t){return new PA({values:e,typeName:Cr.ZodEnum,...zr(t)})}class PA extends Xr{constructor(){super(...arguments),T1.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),s=this._def.values;return kt(r,{expected:Cs.joinValues(s),received:r.parsedType,code:mt.invalid_type}),yr}if(bR(this,T1)||wre(this,T1,new Set(this._def.values)),!bR(this,T1).has(t.data)){const r=this._getOrReturnCtx(t),s=this._def.values;return kt(r,{received:r.data,code:mt.invalid_enum_value,options:s}),yr}return Ca(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return PA.create(t,{...this._def,...r})}exclude(t,r=this._def){return PA.create(this.options.filter(s=>!t.includes(s)),{...this._def,...r})}}T1=new WeakMap;PA.create=xre;class Px extends Xr{constructor(){super(...arguments),D1.set(this,void 0)}_parse(t){const r=Cs.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==Ot.string&&s.parsedType!==Ot.number){const n=Cs.objectValues(r);return kt(s,{expected:Cs.joinValues(n),received:s.parsedType,code:mt.invalid_type}),yr}if(bR(this,D1)||wre(this,D1,new Set(Cs.getValidEnumValues(this._def.values))),!bR(this,D1).has(t.data)){const n=Cs.objectValues(r);return kt(s,{received:s.data,code:mt.invalid_enum_value,options:n}),yr}return Ca(t.data)}get enum(){return this._def.values}}D1=new WeakMap;Px.create=(e,t)=>new Px({values:e,typeName:Cr.ZodNativeEnum,...zr(t)});class Qw extends Xr{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ot.promise&&r.common.async===!1)return kt(r,{code:mt.invalid_type,expected:Ot.promise,received:r.parsedType}),yr;const s=r.parsedType===Ot.promise?r.data:Promise.resolve(r.data);return Ca(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Qw.create=(e,t)=>new Qw({type:e,typeName:Cr.ZodPromise,...zr(t)});class ud extends Xr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Cr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=this._def.effect||null,i={addIssue:o=>{kt(s,o),o.fatal?r.abort():r.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const o=n.transform(s.data,i);if(s.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return yr;const l=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return l.status==="aborted"?yr:l.status==="dirty"||r.value==="dirty"?U0(l.value):l});{if(r.value==="aborted")return yr;const a=this._def.schema._parseSync({data:o,path:s.path,parent:s});return a.status==="aborted"?yr:a.status==="dirty"||r.value==="dirty"?U0(a.value):a}}if(n.type==="refinement"){const o=a=>{const l=n.refinement(a,i);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?yr:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?yr:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Ax(o))return o;const a=n.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>Ax(o)?Promise.resolve(n.transform(o.value,i)).then(a=>({status:r.value,value:a})):o);Cs.assertNever(n)}}ud.create=(e,t,r)=>new ud({schema:e,typeName:Cr.ZodEffects,effect:t,...zr(r)});ud.createWithPreprocess=(e,t,r)=>new ud({schema:t,effect:{type:"preprocess",transform:e},typeName:Cr.ZodEffects,...zr(r)});class Lh extends Xr{_parse(t){return this._getType(t)===Ot.undefined?Ca(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Lh.create=(e,t)=>new Lh({innerType:e,typeName:Cr.ZodOptional,...zr(t)});class FA extends Xr{_parse(t){return this._getType(t)===Ot.null?Ca(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}FA.create=(e,t)=>new FA({innerType:e,typeName:Cr.ZodNullable,...zr(t)});class Fx extends Xr{_parse(t){const{ctx:r}=this._processInputParams(t);let s=r.data;return r.parsedType===Ot.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Fx.create=(e,t)=>new Fx({innerType:e,typeName:Cr.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...zr(t)});class Rx extends Xr{_parse(t){const{ctx:r}=this._processInputParams(t),s={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return mx(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new jl(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new jl(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Rx.create=(e,t)=>new Rx({innerType:e,typeName:Cr.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...zr(t)});class PR extends Xr{_parse(t){if(this._getType(t)!==Ot.nan){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.nan,received:s.parsedType}),yr}return{status:"valid",value:t.data}}}PR.create=e=>new PR({typeName:Cr.ZodNaN,...zr(e)});const kLt=Symbol("zod_brand");class Q6 extends Xr{_parse(t){const{ctx:r}=this._processInputParams(t),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}}class M3 extends Xr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?yr:i.status==="dirty"?(r.dirty(),U0(i.value)):this._def.out._parseAsync({data:i.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?yr:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,r){return new M3({in:t,out:r,typeName:Cr.ZodPipeline})}}class Tx extends Xr{_parse(t){const r=this._def.innerType._parse(t),s=n=>(Ax(n)&&(n.value=Object.freeze(n.value)),n);return mx(r)?r.then(n=>s(n)):s(r)}unwrap(){return this._def.innerType}}Tx.create=(e,t)=>new Tx({innerType:e,typeName:Cr.ZodReadonly,...zr(t)});function Ere(e,t={},r){return e?zw.create().superRefine((s,n)=>{var i,o;if(!e(s)){const a=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,l=(o=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...c,fatal:l})}}):zw.create()}const BLt={object:Rn.lazycreate};var Cr;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Cr||(Cr={}));const LLt=(e,t={message:`Input not instance of ${e.name}`})=>Ere(r=>r instanceof e,t),Pre=Uu.create,Fre=xA.create,HLt=PR.create,GLt=EA.create,Rre=vx.create,OLt=kv.create,NLt=SR.create,_Lt=Cx.create,VLt=wx.create,zLt=zw.create,QLt=pv.create,ULt=bg.create,WLt=xR.create,jLt=ed.create,KLt=Rn.create,YLt=Rn.strictCreate,ZLt=yx.create,XLt=wD.create,$Lt=bx.create,JLt=Kh.create,qLt=Sx.create,e5t=ER.create,t5t=Bv.create,r5t=lw.create,s5t=xx.create,n5t=Ex.create,i5t=PA.create,o5t=Px.create,a5t=Qw.create,HQ=ud.create,l5t=Lh.create,c5t=FA.create,u5t=ud.createWithPreprocess,d5t=M3.create,h5t=()=>Pre().optional(),p5t=()=>Fre().optional(),g5t=()=>Rre().optional(),f5t={string:e=>Uu.create({...e,coerce:!0}),number:e=>xA.create({...e,coerce:!0}),boolean:e=>vx.create({...e,coerce:!0}),bigint:e=>EA.create({...e,coerce:!0}),date:e=>kv.create({...e,coerce:!0})},A5t=yr;var us=Object.freeze({__proto__:null,defaultErrorMap:Vw,setErrorMap:ALt,getErrorMap:wR,makeIssue:yR,EMPTY_PATH:mLt,addIssueToContext:kt,ParseStatus:No,INVALID:yr,DIRTY:U0,OK:Ca,isAborted:d7,isDirty:h7,isValid:Ax,isAsync:mx,get util(){return Cs},get objectUtil(){return u7},ZodParsedType:Ot,getParsedType:$f,ZodType:Xr,datetimeRegex:Sre,ZodString:Uu,ZodNumber:xA,ZodBigInt:EA,ZodBoolean:vx,ZodDate:kv,ZodSymbol:SR,ZodUndefined:Cx,ZodNull:wx,ZodAny:zw,ZodUnknown:pv,ZodNever:bg,ZodVoid:xR,ZodArray:ed,ZodObject:Rn,ZodUnion:yx,ZodDiscriminatedUnion:wD,ZodIntersection:bx,ZodTuple:Kh,ZodRecord:Sx,ZodMap:ER,ZodSet:Bv,ZodFunction:lw,ZodLazy:xx,ZodLiteral:Ex,ZodEnum:PA,ZodNativeEnum:Px,ZodPromise:Qw,ZodEffects:ud,ZodTransformer:ud,ZodOptional:Lh,ZodNullable:FA,ZodDefault:Fx,ZodCatch:Rx,ZodNaN:PR,BRAND:kLt,ZodBranded:Q6,ZodPipeline:M3,ZodReadonly:Tx,custom:Ere,Schema:Xr,ZodSchema:Xr,late:BLt,get ZodFirstPartyTypeKind(){return Cr},coerce:f5t,any:zLt,array:jLt,bigint:GLt,boolean:Rre,date:OLt,discriminatedUnion:XLt,effect:HQ,enum:i5t,function:r5t,instanceof:LLt,intersection:$Lt,lazy:s5t,literal:n5t,map:e5t,nan:HLt,nativeEnum:o5t,never:ULt,null:VLt,nullable:c5t,number:Fre,object:KLt,oboolean:g5t,onumber:p5t,optional:l5t,ostring:h5t,pipeline:d5t,preprocess:u5t,promise:a5t,record:qLt,set:t5t,strictObject:YLt,string:Pre,symbol:NLt,transformer:HQ,tuple:JLt,undefined:_Lt,union:ZLt,unknown:QLt,void:WLt,NEVER:A5t,ZodIssueCode:mt,quotelessJson:fLt,ZodError:jl}),m5t=Object.defineProperty,v5t=(e,t,r)=>t in e?m5t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,r2=(e,t,r)=>v5t(e,typeof t!="symbol"?t+"":t,r);function Tre(e){throw new Error("Unexpected object: "+e)}function U6(e){if(!e||typeof e!="object")return!1;const t=e;if(!("type"in t))return!1;switch(t.type){case"Json":return typeof t.keyLength=="number"&&t.data!==void 0&&typeof t.data=="object";case"JsonPartitioned":return typeof t.partitionKeyLength=="number"&&t.parts!==void 0&&typeof t.parts=="object";case"BinaryPartitioned":return typeof t.partitionKeyLength=="number"&&t.parts!==void 0&&typeof t.parts=="object";default:return!1}}function C5t(e,t){if(e!==void 0)switch(e.type){case"Json":return e;case"JsonPartitioned":{const r={};for(const[s,n]of Object.entries(e.parts))r[s]=t(n);return{...e,parts:r}}case"BinaryPartitioned":{const r={};for(const[s,n]of Object.entries(e.parts))r[s]={index:t(n.index),values:t(n.values)};return{...e,parts:r}}}}function W6(e){if(!e||typeof e!="object")return!1;const t=e;if(!("type"in t))return!1;switch(t.type){case"Json":return typeof t.keyLength=="number"&&Array.isArray(t.data);case"JsonPartitioned":return typeof t.partitionKeyLength=="number"&&Array.isArray(t.parts);case"BinaryPartitioned":return typeof t.partitionKeyLength=="number"&&Array.isArray(t.parts);default:return!1}}function w5t(e){return W6(e)?e.type==="JsonPartitioned"||e.type==="BinaryPartitioned":!1}function y5t(e){switch(e.type){case"Json":{const t=Object.entries(e.data).map(([r,s])=>({key:JSON.parse(r),value:s}));return{type:"Json",keyLength:e.keyLength,data:t}}case"JsonPartitioned":{const t=Object.entries(e.parts).map(([r,s])=>({key:JSON.parse(r),value:s}));return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:t}}case"BinaryPartitioned":{const t=Object.entries(e.parts).map(([r,s])=>({key:JSON.parse(r),value:s}));return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:t}}}}function b5t(e){switch(e.type){case"Json":{const t={};for(const r of e.data)t[JSON.stringify(r.key)]=r.value;return{type:"Json",keyLength:e.keyLength,data:t}}case"JsonPartitioned":{const t={};for(const r of e.parts)t[JSON.stringify(r.key)]=r.value;return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:t}}case"BinaryPartitioned":{const t={};for(const r of e.parts)t[JSON.stringify(r.key)]=r.value;return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:t}}}}function RA(e){const{type:t,name:r,domain:s}=e;return{type:t,name:r,...s&&{domain:s}}}function S5t(e){return e.map(RA)}function x5t(e){return vy(RA(e))}function E5t(e,t){if(e===void 0)return t===void 0;if(t===void 0)return!0;for(const r in t)if(e[r]!==t[r])return!1;return!0}function P5t(e,t){return e.name===t.name&&E5t(e.domain,t.domain)}function F5t(e,t){return{...e,src:H2(e.src,t)}}function H2(e,t){switch(e.type){case"column":return{type:"column",column:t(e.column)};case"slicedColumn":return{type:"slicedColumn",column:t(e.column),newId:e.newId,axisFilters:e.axisFilters};case"inlineColumn":return e;case"inner":case"full":return{type:e.type,entries:e.entries.map(r=>H2(r,t))};case"outer":return{type:"outer",primary:H2(e.primary,t),secondary:e.secondary.map(r=>H2(r,t))};default:Tre(e)}}function R5t(e){return vy(e)}function GQ(e){return vy(RA(e))}function OQ(e,t){return JSON.stringify([e,t])}class NQ{constructor(t){r2(this,"domains",new Map),r2(this,"axes",new Map),r2(this,"domainPacks",[]),r2(this,"domainPackToAnchor",new Map),this.anchors=t;const r=Object.entries(t);r.sort((s,n)=>s[0].localeCompare(n[0]));for(const[s,n]of r){for(let i=0;i<n.axesSpec.length;i++){const o=n.axesSpec[i],a=GQ(o);this.axes.set(a,{anchor:s,idx:i})}if(n.domain!==void 0){const i=Object.entries(n.domain);i.sort((o,a)=>o[0].localeCompare(a[0])),this.domainPackToAnchor.set(JSON.stringify(i),s),this.domainPacks.push(i.map(([o])=>o));for(const[o,a]of i){const l=OQ(o,a);this.domains.set(l,s)}}}}derive(t,r){const s={name:t.name,axes:[]};let n;if(t.domain!==void 0)e:for(const o of this.domainPacks){const a=[];for(const c of o){const u=t.domain[c];if(u!==void 0)a.push([c,u]);else break e}const l=this.domainPackToAnchor.get(JSON.stringify(a));if(l!==void 0){s.domainAnchor=l,n=new Set(o);break}}for(const[o,a]of Object.entries(t.domain??{})){if(n!==void 0&&n.has(o))continue;const l=OQ(o,a),c=this.domains.get(l);s.domain??(s.domain={}),s.domain[o]=c?{anchor:c}:a}if(s.axes=t.axesSpec.map(o=>{const a=GQ(o),l=this.axes.get(a);return l===void 0?RA(o):l}),!r||r.length===0)return s;const i=[];for(const o of r){const[a,l]=o;if(typeof a=="number"){if(a<0||a>=t.axesSpec.length)throw new Error(`Axis index ${a} is out of bounds (0-${t.axesSpec.length-1})`);i.push([a,l])}else{const c=t.axesSpec.findIndex(u=>u.name===a);if(c===-1)throw new Error(`Axis with name "${a}" not found in the column specification`);i.push([c,l])}}return i.sort((o,a)=>o[0]-a[0]),{source:s,axisFilters:i}}deriveS(t,r){return R5t(this.derive(t,r))}}function _Q(e,t,r){const s={...t},n=(r==null?void 0:r.ignoreMissingDomains)??!1;if(s.domainAnchor!==void 0){const i=e[s.domainAnchor];if(!i)throw new Error(`Anchor "${s.domainAnchor}" not found`);const o=i.domain||{};s.domain={...o,...s.domain},delete s.domainAnchor}if(s.domain){const i={};for(const[o,a]of Object.entries(s.domain))if(typeof a=="string")i[o]=a;else{const l=e[a.anchor];if(!l)throw new Error(`Anchor "${a.anchor}" not found for domain key "${o}"`);if(!l.domain||l.domain[o]===void 0){if(!n)throw new Error(`Domain key "${o}" not found in anchor "${a.anchor}"`);continue}i[o]=l.domain[o]}s.domain=i}return s.axes&&(s.axes=s.axes.map(i=>T5t(e,i))),s}function T5t(e,t){if(!D5t(t))return t;const r=t.anchor,s=e[r];if(!s)throw new Error(`Anchor "${r}" not found for axis reference`);if("idx"in t){if(t.idx<0||t.idx>=s.axesSpec.length)throw new Error(`Axis index ${t.idx} out of bounds for anchor "${r}"`);return s.axesSpec[t.idx]}else if("name"in t){const n=s.axesSpec.filter(i=>i.name===t.name);if(n.length>1)throw new Error(`Multiple axes with name "${t.name}" found in anchor "${r}"`);if(n.length===0)throw new Error(`Axis with name "${t.name}" not found in anchor "${r}"`);return n[0]}else if("id"in t){const n=s.axesSpec.filter(i=>P5t(t.id,RA(i)));if(n.length>1)throw new Error(`Multiple matching axes found for matcher in anchor "${r}"`);if(n.length===0)throw new Error(`No matching axis found for matcher in anchor "${r}"`);return n[0]}throw new Error("Unsupported axis reference type")}function D5t(e){return typeof e=="object"&&"anchor"in e}function oA(e){return e.kind==="PColumn"}function j6(e){return oA(e.spec)}function M5t(e){if(!j6(e))throw new Error(`not a PColumn (kind = ${e.spec.kind})`);return e}function K6(e,t){return e===void 0?void 0:{...e,data:t(e.data)}}function I5t(e){const t=new Map,r=s=>{switch(s.type){case"column":t.set(s.column.id,s.column);return;case"slicedColumn":t.set(s.column.id,s.column);return;case"inlineColumn":return;case"full":case"inner":for(const n of s.entries)r(n);return;case"outer":r(s.primary);for(const n of s.secondary)r(n);return;default:Tre(s)}};return r(e),[...t.values()]}function VQ(e,t){if(e.name!==void 0&&e.name!==t.name)return!1;if(e.type!==void 0){if(Array.isArray(e.type)){if(!e.type.includes(t.type))return!1}else if(e.type!==t.type)return!1}if(e.domain!==void 0){const r=t.domain||{};for(const[s,n]of Object.entries(e.domain))if(r[s]!==n)return!1}return!0}function zQ(e,t){if(t.name!==void 0&&e.name!==t.name||t.namePattern!==void 0&&!new RegExp(t.namePattern).test(e.name))return!1;if(t.type!==void 0){if(Array.isArray(t.type)){if(!t.type.includes(e.valueType))return!1}else if(t.type!==e.valueType)return!1}if(t.domain!==void 0){const r=e.domain||{};for(const[s,n]of Object.entries(t.domain))if(r[s]!==n)return!1}if(t.axes!==void 0){const r=e.axesSpec.map(RA);if(t.partialAxesMatch){for(const s of t.axes)if(!r.some(n=>VQ(s,n)))return!1}else{if(r.length!==t.axes.length)return!1;for(let s=0;s<t.axes.length;s++)if(!VQ(t.axes[s],r[s]))return!1}}if(t.annotations!==void 0){const r=e.annotations||{};for(const[s,n]of Object.entries(t.annotations))if(r[s]!==n)return!1}if(t.annotationPatterns!==void 0){const r=e.annotations||{};for(const[s,n]of Object.entries(t.annotationPatterns)){const i=r[s];if(i===void 0||!new RegExp(n).test(i))return!1}}return!0}function Dx(e){return Array.isArray(e)?t=>e.some(r=>oA(t)&&zQ(t,r)):t=>oA(t)&&zQ(t,e)}function k5t(e){const t={kind:e.kind,name:e.name};return e.domain!==void 0&&(t.domain=e.domain),oA(e)&&(t.axesSpec=S5t(e.axesSpec)),vy(t)}us.object({__isRef:us.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:us.string().describe("Upstream block id"),name:us.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:us.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();function B5t(e){return typeof e=="object"&&e!==null&&"__isRef"in e&&e.__isRef===!0&&"blockId"in e&&"name"in e}function QQ(e,t=!0){if(t)return{...e,requireEnrichments:!0};{const{requireEnrichments:r,...s}=e;return s}}function L5t(e,t){return e.ok?{ok:!0,value:t(e.value)}:e}const H5t=24;us.string().length(H5t).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");var UQ={exports:{}};(function(e,t){t=e.exports=r,t.getSerialize=s;function r(n,i,o,a){return JSON.stringify(n,s(i,a),o)}function s(n,i){var o=[],a=[];return i==null&&(i=function(l,c){return o[0]===c?"[Circular ~]":"[Circular ~."+a.slice(0,o.indexOf(c)).join(".")+"]"}),function(l,c){if(o.length>0){var u=o.indexOf(this);~u?o.splice(u+1):o.push(this),~u?a.splice(u,1/0,l):a.push(l),~o.indexOf(c)&&(c=i.call(this,l,c))}else o.push(c);return n==null?c:n.call(this,l,c)}}})(UQ,UQ.exports);const G5t=us.object({type:us.literal("PlError"),name:us.string(),message:us.string(),fullMessage:us.string().optional(),stack:us.string().optional()}),O5t=G5t.extend({cause:us.lazy(()=>FR).optional(),errors:us.lazy(()=>FR.array()).optional()}),N5t=us.object({type:us.literal("StandardError"),name:us.string(),message:us.string(),stack:us.string().optional()}),_5t=N5t.extend({cause:us.lazy(()=>FR).optional(),errors:us.lazy(()=>FR.array()).optional()}),FR=us.union([_5t,O5t]),V5t=us.object({name:us.string(),message:us.string(),fullMessage:us.string().optional(),stack:us.string().optional()}),WQ=V5t.extend({cause:us.lazy(()=>WQ).optional(),errors:us.lazy(()=>WQ.array()).optional()});var z5t=Object.defineProperty,Q5t=(e,t,r)=>t in e?z5t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vu=(e,t,r)=>Q5t(e,typeof t!="symbol"?t+"":t,r);function zI(e){return{type:"Immediate",value:e}}function U5t(){return typeof globalThis.getPlatforma<"u"||typeof globalThis.platforma<"u"}function W5t(e){if(e&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(e);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}function j5t(){if(typeof globalThis.cfgRenderCtx<"u")return globalThis.cfgRenderCtx}function Os(){if(typeof globalThis.cfgRenderCtx<"u")return globalThis.cfgRenderCtx;throw new Error("Not in config rendering context")}function c1(e,t){const r=j5t();if(r===void 0)return!1;if(e in r.callbackRegistry)throw new Error(`Callback with key ${e} already registered.`);return r.callbackRegistry[e]=t,!0}const QI=new Map;function K5t(e,t){e in Os().callbackRegistry||(Os().callbackRegistry[e]=r=>{for(const s of QI.get(e))s(r)},QI.set(e,[])),QI.get(e).push(t)}class qa{constructor(t,r=s=>s){Vu(this,"isResolved",!1),Vu(this,"resolvedValue"),this.handle=t,this.postProcess=r,K5t(t,s=>{this.resolvedValue=r(s),this.isResolved=!0})}map(t){return new qa(this.handle,r=>t(this.postProcess(r)))}mapDefined(t){return new qa(this.handle,r=>{const s=this.postProcess(r);return s?t(s):void 0})}toJSON(){return this.isResolved?this.resolvedValue:{__awaited_futures__:[this.handle]}}}function g7(e,t){return e===void 0?void 0:t(e)}class td{constructor(t,r){this.handle=t,this.resolvePath=r}resolve(...t){const r=t.map(s=>({assertFieldType:"Input",...typeof s=="string"?{field:s}:s}));return this.resolveWithCommon({},...r)}resolveOutput(...t){const r=t.map(s=>({assertFieldType:"Output",...typeof s=="string"?{field:s}:s}));return this.resolveWithCommon({},...r)}resolveInput(...t){const r=t.map(s=>({assertFieldType:"Input",...typeof s=="string"?{field:s}:s}));return this.resolveWithCommon({},...r)}resolveAny(...t){return this.resolveWithCommon({},...t)}resolveWithCommon(t,...r){const s=[...this.resolvePath,...r.map(n=>typeof n=="string"?n:n.field)];return g7(Os().resolveWithCommon(this.handle,t,...r),n=>new td(n,s))}get resourceType(){return Os().getResourceType(this.handle)}getInputsLocked(){return Os().getInputsLocked(this.handle)}getOutputsLocked(){return Os().getOutputsLocked(this.handle)}getIsReadyOrError(){return Os().getIsReadyOrError(this.handle)}getIsFinal(){return Os().getIsFinal(this.handle)}getError(){const t=[...this.resolvePath,"error"];return g7(Os().getError(this.handle),r=>new td(r,t))}listInputFields(){return Os().listInputFields(this.handle)}listOutputFields(){return Os().listOutputFields(this.handle)}listDynamicFields(){return Os().listDynamicFields(this.handle)}getKeyValueBase64(t){return Os().getKeyValueBase64(this.handle,t)}getKeyValueAsString(t){return Os().getKeyValueAsString(this.handle,t)}getKeyValueAsJson(t){const r=this.getKeyValueAsString(t);if(r==null)throw new Error("Resource has no content.");return JSON.parse(r)}getDataBase64(){return Os().getDataBase64(this.handle)}getDataAsString(){return Os().getDataAsString(this.handle)}getDataAsJson(){const t=this.getDataAsString();if(t==null)throw new Error("Resource has no content.");return JSON.parse(t)}getPColumns(t=!1,r=""){const s=this.parsePObjectCollection(t,r);return s===void 0?void 0:Object.entries(s).map(([,n])=>{if(!j6(n))throw new Error(`not a PColumn (kind = ${n.spec.kind})`);return n})}parsePObjectCollection(t=!1,r=""){const s=Os().parsePObjectCollection(this.handle,t,r,...this.resolvePath);if(s===void 0)return;const n={};for(const[i,o]of Object.entries(s)){const a=[...this.resolvePath,i];n[i]=K6(o,l=>new td(l,a))}return n}getFileContentAsBase64(t){return new qa(Os().getBlobContentAsBase64(this.handle,t))}getFileContentAsString(t){return new qa(Os().getBlobContentAsString(this.handle,t))}getFileContentAsJson(t){return new qa(Os().getBlobContentAsString(this.handle,t)).mapDefined(r=>JSON.parse(r))}getBlobContentAsBase64(){return this.getFileContentAsBase64()}getBlobContentAsString(){return this.getFileContentAsString()}getFileHandle(){return new qa(Os().getDownloadedBlobContentHandle(this.handle))}getDownloadedBlobHandle(){return this.getFileHandle()}getRemoteFileHandle(){return new qa(Os().getOnDemandBlobContentHandle(this.handle))}getOnDemandBlobHandle(){return this.getRemoteFileHandle()}extractArchiveAndGetURL(t){return new qa(Os().extractArchiveAndGetURL(this.handle,t))}getImportProgress(){return new qa(Os().getImportProgress(this.handle))}getLastLogs(t){return new qa(Os().getLastLogs(this.handle,t))}getProgressLog(t){return new qa(Os().getProgressLog(this.handle,t))}getProgressLogWithInfo(t){return new qa(Os().getProgressLogWithInfo(this.handle,t))}getLogHandle(){return new qa(Os().getLogHandle(this.handle))}allFieldsResolved(t="Input"){switch(t){case"Input":return this.getInputsLocked()&&this.listInputFields().every(r=>this.resolve({field:r,assertFieldType:"Input"})!==void 0);case"Output":return this.getOutputsLocked()&&this.listOutputFields().every(r=>this.resolve({field:r,assertFieldType:"Output"})!==void 0)}}mapFields(t,r){const{fieldType:s,requireLocked:n,skipUnresolved:i}={fieldType:"Input",requireLocked:!0,skipUnresolved:!1,...r},o=t;if(n&&(s==="Input"&&!this.getInputsLocked()||s==="Output"&&!this.getOutputsLocked()))return;let a=(s==="Input"?this.listInputFields():s==="Output"?this.listOutputFields():this.listDynamicFields()).map(l=>[l,this.resolve({field:l,assertFieldType:s})]);return i&&(a=a.filter(l=>l[1]!==void 0)),a.map(([l,c])=>o(l,c))}}const Y5t="staging",Z5t="main",X5t="pl7.app/label",$5t="pl7.app/trace",J5t=us.object({type:us.string(),importance:us.number().optional(),id:us.string().optional(),label:us.string()}),q5t=us.array(J5t),e6t=.001,t6t="__LABEL__",jQ="__LABEL__@1";function Dre(e,t,r={}){const s=new Map,n=r.forceTraceElements!==void 0&&r.forceTraceElements.length>0?new Set(r.forceTraceElements):void 0,i=new Map,o=e.map(A=>{var w,v;const b=t(A);let S,P,F;"spec"in b&&typeof b.spec=="object"?(S=b.spec,P=b.prefixTrace,F=b.suffixTrace):S=b;const T=(w=S.annotations)==null?void 0:w[X5t],D=(v=S.annotations)==null?void 0:v[$5t],B=(D?q5t.safeParse(JSON.parse(D)).data:void 0)??[],k=[...P??[],...B,...F??[]];if(T!==void 0){const j={label:T,type:t6t,importance:-2};r.addLabelAsSuffix?k.push(j):k.splice(0,0,j)}const z=[],O=new Map;for(let j=k.length-1;j>=0;--j){const{type:_}=k[j],G=k[j].importance??0,N=(O.get(_)??0)+1;O.set(_,N);const W=`${_}@${N}`;i.set(W,(i.get(W)??0)+1),s.set(W,Math.max(s.get(W)??Number.NEGATIVE_INFINITY,G-(k.length-j)*e6t)),z.push({...k[j],fullType:W,occurrenceIndex:N})}return z.reverse(),{value:A,spec:S,label:T,fullTrace:z}}),a=[],l=[],c=[...s];c.sort(([,A],[,w])=>w-A);for(const[A]of c)A.endsWith("@1")||i.get(A)===e.length?a.push(A):l.push(A);const u=(A,w=!1)=>{const v=[];for(let b=0;b<o.length;b++){const S=o[b],P=S.fullTrace.filter(D=>A.has(D.fullType)||n&&n.has(D.type));if(P.length===0)if(w)v.push({label:"Unlabeled",value:S.value});else return;const F=P.map(D=>D.label),T=r.separator??" / ";v.push({label:F.join(T),value:S.value})}return v};if(a.length===0){if(l.length!==0)throw new Error("Non-empty secondary types list while main types list is empty.");return u(new Set(jQ),!0)}let d=0,g=-1;for(;d<a.length;){const A=new Set;r.includeNativeLabel&&A.add(jQ);for(let v=0;v<d;++v)A.add(a[v]);g>=0&&A.add(a[g]);const w=u(A);if(w!==void 0&&new Set(w.map(v=>v.label)).size===e.length)return w;g++,g>=a.length&&(d++,g=d)}return u(new Set([...a,...l]),!0)}const I3="PColumnData/",f7=I3+"ResourceMap",A7=I3+"Partitioned/ResourceMap",sS=I3+"JsonPartitioned",cw=I3+"BinaryPartitioned",Mre=I3+"Partitioned/",RR=Mre+"JsonPartitioned",nS=Mre+"BinaryPartitioned",m7=e=>{if(e.endsWith(".index"))return{baseKey:e.substring(0,e.length-6),type:"index"};if(e.endsWith(".values"))return{baseKey:e.substring(0,e.length-7),type:"values"};throw new Error(`key must ends on .index/.values for binary p-column, got: ${e}`)};function r6t(e){if(!e)return;const t=e.resourceType.name,r=e.getDataAsJson(),s=[];let n=0;switch(t){case f7:n=r.keyLength;break;case A7:n=r.partitionKeyLength+r.keyLength;break;case sS:case cw:n=r.partitionKeyLength;break;case nS:case RR:n=r.superPartitionKeyLength+r.partitionKeyLength;break}switch(t){case f7:case sS:case cw:for(let i of e.listInputFields()){t===cw&&(i=m7(i).baseKey);const o=[...JSON.parse(i)];s.push(o)}break;case A7:case nS:case RR:for(const i of e.listInputFields()){const o=[...JSON.parse(i)],a=e.resolve({field:i,assertFieldType:"Input"});if(a!==void 0)for(let l of a.listInputFields()){t===nS&&(l=m7(l).baseKey);const c=[...o,...JSON.parse(l)];s.push(c)}}break}return{data:s,keyLength:n}}function s6t(e){if(e.type!=="JsonPartitioned"&&e.type!=="BinaryPartitioned")throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${e.type}`);const{parts:t,partitionKeyLength:r}=e,s=[];for(let n=0;n<r;++n)s.push(new Set);for(const n of t){const i=n.key;if(i.length!==r)throw new Error(`Key length (${i.length}) does not match partition length (${r}) for key: ${JSON.stringify(i)}`);for(let o=0;o<r;++o)s[o].add(i[o])}return s.map(n=>Array.from(n.values()))}function n6t(e){if(e===void 0)return;if(W6(e))return s6t(e);const t=r6t(e);if(!t)return;const{data:r,keyLength:s}=t,n=[];for(let i=0;i<s;++i)n.push(new Set);for(const i of r){if(i.length!==s)throw new Error("key length does not match partition length");for(let o=0;o<s;++o)n[o].add(i[o])}return n.map(i=>Array.from(i.values()))}function v7(e,t=[]){if(e===void 0||!e.getIsReadyOrError())return;const r=e.resourceType.name,s=e.getDataAsJson();if(t.length>0&&(r===RR||r===nS))throw new Error(`Unexpected nested super-partitioned resource: ${r}`);switch(r){case f7:case A7:throw new Error(`Only data columns are supported, got: ${r}`);case sS:{if(typeof(s==null?void 0:s.partitionKeyLength)!="number")throw new Error(`Missing partitionKeyLength in metadata for ${r}`);const n=[];for(const i of e.listInputFields()){const o=e.resolve({field:i,assertFieldType:"Input"});if(o===void 0)return;const a=[...t,...JSON.parse(i)];n.push({key:a,value:o})}return{type:"JsonPartitioned",partitionKeyLength:s.partitionKeyLength,parts:n}}case cw:{if(typeof(s==null?void 0:s.partitionKeyLength)!="number")throw new Error(`Missing partitionKeyLength in metadata for ${r}`);const n=[],i=new Map;for(const o of e.listInputFields()){const a=m7(o),l=e.resolve({field:o,assertFieldType:"Input"});if(l===void 0)return;let c=i.get(a.baseKey);c||(c={},i.set(a.baseKey,c)),a.type==="index"?c.index=l:c.values=l}for(const[o,a]of i.entries()){if(!a.index||!a.values)return;const l=[...t,...JSON.parse(o)];n.push({key:l,value:{index:a.index,values:a.values}})}return{type:"BinaryPartitioned",partitionKeyLength:s.partitionKeyLength,parts:n}}case RR:{if(typeof(s==null?void 0:s.superPartitionKeyLength)!="number"||typeof(s==null?void 0:s.partitionKeyLength)!="number")throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${r}`);const n=s.superPartitionKeyLength+s.partitionKeyLength,i=[];for(const o of e.listInputFields()){const a=e.resolve({field:o,assertFieldType:"Input"});if(a===void 0)return;if(a.resourceType.name!==sS)throw new Error(`Expected ${sS} inside ${r}, but got ${a.resourceType.name}`);const l=v7(a,JSON.parse(o));if(l===void 0)return;if(l.type!=="JsonPartitioned")throw new Error(`Unexpected inner result type for ${r}: ${l.type}`);i.push(...l.parts)}return{type:"JsonPartitioned",partitionKeyLength:n,parts:i}}case nS:{if(typeof(s==null?void 0:s.superPartitionKeyLength)!="number"||typeof(s==null?void 0:s.partitionKeyLength)!="number")throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${r}`);const n=s.superPartitionKeyLength+s.partitionKeyLength,i=[];for(const o of e.listInputFields()){const a=e.resolve({field:o,assertFieldType:"Input"});if(a===void 0)return;if(a.resourceType.name!==cw)throw new Error(`Expected ${cw} inside ${r}, but got ${a.resourceType.name}`);const l=v7(a,JSON.parse(o));if(l===void 0)return;if(l.type!=="BinaryPartitioned")throw new Error(`Unexpected inner result type for ${r}: ${l.type}`);i.push(...l.parts)}return{type:"BinaryPartitioned",partitionKeyLength:n,parts:i}}default:throw new Error(`Unknown resource type: ${r}`)}}function i6t(e){if(e!==void 0){if(W6(e))return e;if(U6(e))return y5t(e);if(e instanceof td)return v7(e);throw new Error(`Unexpected input type: ${typeof e}`)}}function o6t(e,t){const r=[...t].sort((i,o)=>o[0]-i[0]);if(e.type==="JsonPartitioned"||e.type==="BinaryPartitioned"){const{partitionKeyLength:i}=e;for(const[o]of t)if(o>=i)throw new Error(`Can't filter on non-partitioned axis ${o}. Must be >= ${i}`)}else if(e.type==="Json"){const{keyLength:i}=e;for(const[o]of t)if(o>=i)throw new Error(`Can't filter on non-data axis ${o}. Must be >= ${i}`)}const s=i=>{for(const[o,a]of r)if(i[o]!==a)return!1;return!0},n=i=>{const o=[...i];for(const[a]of r)o.splice(a,1);return o};switch(e.type){case"Json":{const i=e.data.filter(o=>s(o.key)).map(o=>({key:n(o.key),value:o.value}));return{type:"Json",keyLength:e.keyLength-t.length,data:i}}case"JsonPartitioned":{const i=e.parts.filter(o=>s(o.key)).map(o=>({key:n(o.key),value:o.value}));return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength-t.length,parts:i}}case"BinaryPartitioned":{const i=e.parts.filter(o=>s(o.key)).map(o=>({key:n(o.key),value:o.value}));return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength-t.length,parts:i}}}}class a6t{constructor(t){this.columns=t}selectColumns(t){const r=typeof t=="function"?t:Dx(t);return this.columns.filter(s=>r(s.spec))}}function l6t(e){if(e)return e.map(t=>({type:`split:${x5t(t.axisId)}`,label:t.label,importance:1e6}))}function c6t(e){if(e)return e.map(t=>[t.axisIdx,t.value])}function u6t(e,t){if(!t||t.length===0)return e;const r=[...t].sort((s,n)=>s[0]-n[0]);return vy({id:e,axisFilters:r})}function KQ(e){if(!e||typeof e!="object")return!1;const t=e,r=t.domain&&typeof t.domain=="object"&&Object.values(t.domain).some(n=>typeof n=="object"&&n!==null&&"anchor"in n),s=t.axes&&Array.isArray(t.axes)&&t.axes.some(n=>typeof n=="object"&&n!==null&&"anchor"in n);return!!t.domainAnchor||r||s}function d6t(e){if(typeof e!="object"||!("axes"in e)||e.axes===void 0)return[];const t=e.axes.map((r,s)=>typeof r=="object"&&"split"in r&&r.split===!0?s:-1).filter(r=>r!==-1);if(t.length>0&&e.partialAxesMatch!==void 0)throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");return t.sort((r,s)=>r-s),t}class YQ{constructor(){Vu(this,"defaultProviderStore",[]),Vu(this,"providers",[new a6t(this.defaultProviderStore)]),Vu(this,"axisLabelProviders",[])}addColumnProvider(t){return this.providers.push(t),this}addAxisLabelProvider(t){return this.axisLabelProviders.push(t),this}addColumns(t){return this.defaultProviderStore.push(...t),this}addColumn(t){return this.defaultProviderStore.push(t),this}findLabels(t){for(const r of this.axisLabelProviders){const s=r.findLabels(t);if(s)return s}}getUniversalEntries(t,r){const{anchorCtx:s,labelOps:n,dontWaitAllData:i=!1,overrideLabelAnnotation:o=!1,exclude:a}=r??{},l={...o&&(n==null?void 0:n.includeNativeLabel)!==!1?{includeNativeLabel:!0}:{},...n??{}};let c=()=>!1;if(a){const v=(Array.isArray(a)?a:[a]).map(b=>{if(KQ(b)){if(!s)throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");return Dx(_Q(s.anchors,b,r))}else return Dx(b)});c=b=>v.some(S=>S(b))}const u=typeof t=="function"?[t]:Array.isArray(t)?t:[t],d=[],g=new Set;for(const v of u){const b=KQ(v);let S;if(b){if(!s)throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");S=_Q(s.anchors,v,r)}else S=v;const P=new Set,F=[];for(const B of this.providers){const k=B.selectColumns(S);for(const z of k){if(c(z.spec))continue;if(P.has(z.id))throw new Error(`Duplicate column id ${z.id} in provider ${B.constructor.name}`);const O=k5t(z.spec);g.has(O)||(P.add(z.id),g.add(O),F.push(z))}}if(F.length===0)continue;const T=d6t(v),D=T.length>0;for(const B of F){if(!oA(B.spec))continue;const k=B.spec;if(D){const z=i6t(B.data);if(!z){if(i)continue;return}if(!w5t(z))throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${z.type} for column ${B.id}`);const O=n6t(z),j=T[T.length-1];if(j>=z.partitionKeyLength)throw new Error(`Not enough partition keys (${z.partitionKeyLength}) for requested split axes (max index ${j}) in column ${k.name}`);const _=T.map(pe=>this.findLabels(RA(k.axesSpec[pe]))),G=[],N=(pe,X)=>{if(X>=T.length){if(G.push([...pe]),G.length>1e4)throw new Error("Too many key combinations, aborting.");return}const re=T[X];if(re>=O.length)throw new Error(`Axis index ${re} out of bounds for unique keys array (length ${O.length}) during split key generation for column ${B.id}`);const ae=O[re];if(!ae||ae.length===0){G.length=0;return}for(const $ of ae)pe.push($),N(pe,X+1),pe.pop()};if(N([],0),G.length===0)continue;const W=[...k.axesSpec],V=T.map(pe=>pe);for(let pe=T.length-1;pe>=0;pe--)W.splice(T[pe],1);const q={...k,axesSpec:W};for(const pe of G){const X=pe.map((re,ae)=>{const $=V[ae],se=RA(k.axesSpec[$]),De=_[ae],Oe=(De==null?void 0:De[re])??String(re);return{axisIdx:$,axisId:se,value:re,label:Oe}});d.push({type:"split",originalColumn:B,spec:k,adjustedSpec:q,dataEntries:z,axisFilters:X})}}else d.push({type:"direct",originalColumn:B,spec:k,adjustedSpec:k})}}if(d.length===0)return[];const A=Dre(d,v=>({spec:v.spec,suffixTrace:v.type==="split"?l6t(v.axisFilters):void 0}),l),w=[];for(const{value:v,label:b}of A){const{originalColumn:S,spec:P}=v,F=v.type==="split"?v.axisFilters:void 0,T=c6t(F);let D;s?D=s.deriveS(P,T):D=u6t(S.id,T);let B={...v.adjustedSpec};o&&(B={...B,annotations:{...B.annotations??{},"pl7.app/label":b}}),w.push({id:D,spec:B,data:()=>v.type==="split"?b5t(o6t(v.dataEntries,T)):v.originalColumn.data,label:b})}return w}getColumns(t,r){const s=this.getUniversalEntries(t,{overrideLabelAnnotation:!0,...r??{}});if(!s)return;const n=[];for(const i of s){const o=i.data();if(!o){if(r!=null&&r.dontWaitAllData)continue;return}n.push({id:i.id,spec:i.spec,data:o})}return n}}function UI(e,t){if(e===void 0)return t===void 0;if(t===void 0)return!0;for(const r in t)if(e[r]!==t[r])return!1;return!0}function ZQ(e){return K6(e,t=>t instanceof td?t.handle:U6(t)?C5t(t,r=>r.handle):t)}class h6t{constructor(){Vu(this,"ctx",Os())}calculateOptions(t){return this.ctx.calculateOptions(t)}getOptions(t,r){const s=typeof t=="function"?t:Dx(t),n=this.getSpecs().entries.filter(a=>s(a.obj));let i={},o=!1;return typeof r<"u"&&(typeof r=="function"?i=r:typeof r=="object"&&("includeNativeLabel"in r||"separator"in r||"addLabelAsSuffix"in r?i=r:(r=r,i=r.label??{},o=r.refsWithEnrichments??!1))),typeof i=="object"?Dre(n,a=>a.obj,i??{}).map(({value:{ref:a},label:l})=>({ref:QQ(a,o),label:l})):n.map(({ref:a,obj:l})=>({ref:QQ(a,o),label:i(l,a)}))}resolveAnchorCtx(t){if(t instanceof NQ)return t;const r={};for(const[s,n]of Object.entries(t))if(B5t(n)){const i=this.getPColumnSpecByRef(n);if(!i)return;r[s]=i}else r[s]=n;return new NQ(r)}getAnchoredPColumns(t,r,s){const n=this.resolveAnchorCtx(t);if(n)return new YQ().addColumnProvider(this).addAxisLabelProvider(this).getColumns(r,{...s,anchorCtx:n})}getCanonicalOptions(t,r,s){const n=this.resolveAnchorCtx(t);if(!n)return;const i=new YQ().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(r,{...s,anchorCtx:n});if(i)return i.map(o=>({value:o.id,label:o.label}))}getDataFromResultPool(){return this.getData()}getData(){const t=this.ctx.getDataFromResultPool();return{isComplete:t.isComplete,entries:t.entries.map(r=>({ref:r.ref,obj:{...r.obj,data:new td(r.obj.data,[r.ref.blockId,r.ref.name])}}))}}getDataWithErrorsFromResultPool(){return this.getDataWithErrors()}getDataWithErrors(){const t=this.ctx.getDataWithErrorsFromResultPool();return{isComplete:t.isComplete,entries:t.entries.map(r=>({ref:r.ref,obj:{...r.obj,data:L5t(r.obj.data,s=>new td(s,[r.ref.blockId,r.ref.name]))}}))}}getSpecsFromResultPool(){return this.getSpecs()}getSpecs(){return this.ctx.getSpecsFromResultPool()}getDataByRef(t){var r;if(typeof this.ctx.getDataFromResultPoolByRef>"u")return(r=this.getData().entries.find(n=>n.ref.blockId===t.blockId&&n.ref.name===t.name))==null?void 0:r.obj;const s=this.ctx.getDataFromResultPoolByRef(t.blockId,t.name);if(s)return K6(s,n=>new td(n,[t.blockId,t.name]))}getPColumnByRef(t){const r=this.getDataByRef(t);if(r)return M5t(r)}getPColumnSpecByRef(t){const r=this.getSpecByRef(t);if(r){if(!oA(r))throw new Error(`not a PColumn spec (kind = ${r.kind})`);return r}}getSpecByRef(t){return this.ctx.getSpecFromResultPoolByRef(t.blockId,t.name)}findDataWithCompatibleSpec(t){const r=[];e:for(const s of this.getData().entries){if(!oA(s.obj.spec))continue;const n=s.obj.spec;if(t.name===n.name&&t.valueType===n.valueType&&t.axesSpec.length===n.axesSpec.length&&UI(t.domain,n.domain)){for(let i=0;i<t.axesSpec.length;++i){const o=t.axesSpec[i],a=n.axesSpec[i];if(o.name!==a.name||o.type!==a.type||!UI(o.domain,a.domain))continue e}r.push(s.obj)}}return r}findLabels(t){const r=this.getData();for(const s of r.entries){if(!j6(s.obj))continue;const n=s.obj.spec;if(n.name==="pl7.app/label"&&n.axesSpec.length===1&&n.axesSpec[0].name===t.name&&n.axesSpec[0].type===t.type&&UI(t.domain,n.axesSpec[0].domain)){if(s.obj.data.resourceType.name!=="PColumnData/Json")throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);return Object.fromEntries(Object.entries(s.obj.data.getDataAsJson().data).map(i=>[JSON.parse(i[0])[0],i[1]]))}}}selectColumns(t){const r=typeof t=="function"?t:Dx(t);return this.getSpecs().entries.filter(({obj:s})=>oA(s)?r(s):!1).map(({ref:s,obj:n})=>{const i=n;let o=null;const a=this;return{id:vy(s),spec:i,get data(){var l;return o!==null||(o=(l=a.getPColumnByRef(s))==null?void 0:l.data),o}}})}findLabelsForColumnAxis(t,r){var s;const n=this.findLabels(t.axesSpec[r]);if(!n)return;const i=(s=t.annotations)==null?void 0:s["pl7.app/axisKeys/"+r];if(i!==void 0){const o=JSON.parse(i);return Object.fromEntries(o.map(a=>[a,n[a]??"Unlabelled"]))}else return n}}class s2{constructor(){Vu(this,"ctx"),Vu(this,"args"),Vu(this,"uiState"),Vu(this,"_activeArgsCache"),Vu(this,"resultPool",new h6t),this.ctx=Os(),this.args=JSON.parse(this.ctx.args),this.uiState=this.ctx.uiState!==void 0?JSON.parse(this.ctx.uiState):{}}get activeArgs(){return this._activeArgsCache===void 0&&(this._activeArgsCache={v:this.ctx.activeArgs?JSON.parse(this.ctx.activeArgs):void 0}),this._activeArgsCache.v}getNamedAccessor(t){return g7(this.ctx.getAccessorHandleByName(t),r=>new td(r,[t]))}get prerun(){return this.getNamedAccessor(Y5t)}get outputs(){return this.getNamedAccessor(Z5t)}findLabels(t){return this.resultPool.findLabels(t)}verifyInlineAndExplicitColumnsSupport(t){var r;const s=t.some(i=>!(i.data instanceof td)||U6(i.data)),n=((r=this.ctx.featureFlags)==null?void 0:r.inlineColumnsSupport)===!0;if(s&&!n)throw Error("Inline or explicit columns not supported")}createPFrame(t){return this.verifyInlineAndExplicitColumnsSupport(t),this.ctx.createPFrame(t.map(r=>ZQ(r)))}createPTable(t){let r;return"columns"in t?r={src:{type:"full",entries:t.columns.map(s=>({type:"column",column:s}))},filters:t.filters??[],sorting:t.sorting??[]}:r=t,this.verifyInlineAndExplicitColumnsSupport(I5t(r.src)),this.ctx.createPTable(F5t(r,s=>ZQ(s)))}getBlockLabel(t){return this.ctx.getBlockLabel(t)}getCurrentUnstableMarker(){return this.ctx.getCurrentUnstableMarker()}}const WI="1.31.15";function p6t(e){return e.__renderLambda===!0}function jI(e){if(e!==void 0)return p6t(e)?e.handle:e}class $a{constructor(t,r,s,n,i,o,a,l){this._renderingMode=t,this._initialArgs=r,this._initialUiState=s,this._outputs=n,this._inputsValid=i,this._sections=o,this._title=a,this._enrichmentTargets=l}static create(t="Heavy"){return new $a(t,void 0,{},{},zI(!0),zI([]),void 0,void 0)}output(t,r,s={}){if(typeof r=="function"){const n=`output#${t}`;return c1(n,()=>r(new s2)),new $a(this._renderingMode,this._initialArgs,this._initialUiState,{...this._outputs,[t]:{__renderLambda:!0,handle:n,...s}},this._inputsValid,this._sections,this._title,this._enrichmentTargets)}else return new $a(this._renderingMode,this._initialArgs,this._initialUiState,{...this._outputs,[t]:r},this._inputsValid,this._sections,this._title,this._enrichmentTargets)}retentiveOutput(t,r){return this.output(t,r,{retentive:!0})}argsValid(t){return typeof t=="function"?(c1("inputsValid",()=>t(new s2)),new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,{__renderLambda:!0,handle:"inputsValid"},this._sections,this._title,this._enrichmentTargets)):new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,t,this._sections,this._title,this._enrichmentTargets)}sections(t){return Array.isArray(t)?this.sections(zI(t)):typeof t=="function"?(c1("sections",()=>t(new s2)),new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,{__renderLambda:!0,handle:"sections"},this._title,this._enrichmentTargets)):new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,t,this._title,this._enrichmentTargets)}title(t){return c1("title",()=>t(new s2)),new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,this._sections,{__renderLambda:!0,handle:"title"},this._enrichmentTargets)}initialArgs(t){return new $a(this._renderingMode,t,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets)}withArgs(t){return new $a(this._renderingMode,t,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets)}withUiState(t){return new $a(this._renderingMode,this._initialArgs,t,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets)}enriches(t){return c1("enrichmentTargets",t),new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,{__renderLambda:!0,handle:"enrichmentTargets"})}done(){if(this._initialArgs===void 0)throw new Error("Initial arguments not set.");const t={v3:{sdkVersion:WI,renderingMode:this._renderingMode,initialArgs:this._initialArgs,initialUiState:this._initialUiState,inputsValid:this._inputsValid,sections:this._sections,title:this._title,outputs:this._outputs,enrichmentTargets:this._enrichmentTargets},sdkVersion:WI,renderingMode:this._renderingMode,initialArgs:this._initialArgs,inputsValid:jI(this._inputsValid),sections:jI(this._sections),outputs:Object.fromEntries(Object.entries(this._outputs).map(([r,s])=>[r,jI(s)]))};return U5t()?W5t({sdkVersion:WI}):{config:t}}}var g6t=$a.create().withArgs({productKey:"MIFAKEMIFAKEMIFAKE",inputHandles:[],shouldAddRunPerFile:!1,__mnzDate:new Date().toISOString(),__mnzCanRun:!1}).argsValid(e=>e.args.__mnzCanRun).output("__mnzInfo",e=>{var t,r;return(r=(t=e.prerun)==null?void 0:t.resolve("info"))==null?void 0:r.getDataAsJson()}).output("token",e=>{var t,r;return(r=(t=e.outputs)==null?void 0:t.resolve("token"))==null?void 0:r.getDataAsString()}).output("progresses",e=>{var s;const t=(s=e.prerun)==null?void 0:s.resolve("progresses"),r=t==null?void 0:t.mapFields((n,i)=>[n,i==null?void 0:i.getImportProgress()]);return Object.fromEntries(r??[])}).output("mainProgresses",e=>{var s;const t=(s=e.outputs)==null?void 0:s.resolve("progresses"),r=t==null?void 0:t.mapFields((n,i)=>[n,i==null?void 0:i.getImportProgress()]);return Object.fromEntries(r??[])}).sections(e=>[{type:"link",href:"/",label:"Main"}]).done();const f6t="MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECGShTw8Plag1uMuCg9OMYVHCF+wzjvXKr3cihyO77jEe9CrF6RP9tfnCd2XjM7XqQ0QH3i41rz5ohCB9fDDBbQ==",A6t=Tr({__name:"MainPage",setup(e){const t=m6t(),r=[{text:"sha256",value:"sha256"},{text:"lines (only in .zip files)",value:"lines"},{text:"size",value:"size"}],s=oi({isMultiDialogFileOpen:!1}),n=(c,u)=>{c?t.model.args.inputHandles[u].handle=c:t.model.args.inputHandles.splice(u,1)},i=c=>{t.model.args.inputHandles=c.files.map((u,d)=>({handle:u,fileName:`test${d}.txt`,argName:`arg_${d}`,options:["size","sha256"]}))},o=Je({get:()=>{var d;const u=(((d=t.model.outputs.token)==null?void 0:d.split("."))??[])[1];return JSON.parse(atob(u))},set:()=>{}}),a=br("");async function l(c){const u=await crypto.subtle.importKey("spki",Uint8Array.from(atob(f6t),v=>v.charCodeAt(0)).buffer,{name:"ECDSA",namedCurve:"P-256"},!0,["verify"]),[d,g,A]=c.split(".");if(!d||typeof g!="string"||typeof A!="string")throw new Error("Invalid token body");const w=Uint8Array.from(atob(A.replace(/-/g,"+").replace(/_/g,"/")),v=>v.charCodeAt(0));try{await crypto.subtle.verify({name:"ECDSA",hash:{name:"SHA-256"}},u,w,new TextEncoder().encode(`${d}.${g}`))?a.value="Signature is correct":a.value="Signature is incorrect"}catch{a.value="Verification failed"}}return(c,u)=>(ye(),jt(Pe(sMe),null,{title:er(()=>u[5]||(u[5]=[Ne(" Monetization example ")])),default:er(()=>[zt(Pe(d4),{modelValue:Pe(t).model.args.productKey,"onUpdate:modelValue":u[0]||(u[0]=d=>Pe(t).model.args.productKey=d),label:"Enter product key (keep MIFAKEMIFAKEMIFAKE for fake product)",clearable:""},null,8,["modelValue"]),zt(Pe(vIe),{modelValue:Pe(t).model.args.shouldAddRunPerFile,"onUpdate:modelValue":u[1]||(u[1]=d=>Pe(t).model.args.shouldAddRunPerFile=d)},{default:er(()=>u[6]||(u[6]=[Ne(" Add run per file ")])),_:1},8,["modelValue"]),zt(Pe(WG),{width:"400px"},{default:er(()=>[zt(Pe(kF),{onClick:u[2]||(u[2]=d=>s.isMultiDialogFileOpen=!0)},{default:er(()=>u[7]||(u[7]=[Ne(" Open multiple files to monetize ")])),_:1})]),_:1}),(ye(!0),je(_s,null,Fh(Pe(t).model.args.inputHandles,({handle:d},g)=>(ye(),jt(Pe(oMe),{key:g},{default:er(()=>[zt(Pe(d4),{modelValue:Pe(t).model.args.inputHandles[g].fileName,"onUpdate:modelValue":A=>Pe(t).model.args.inputHandles[g].fileName=A,label:"Type file name"},null,8,["modelValue","onUpdate:modelValue"]),zt(Pe(d4),{modelValue:Pe(t).model.args.inputHandles[g].argName,"onUpdate:modelValue":A=>Pe(t).model.args.inputHandles[g].argName=A,label:"Type argument name"},null,8,["modelValue","onUpdate:modelValue"]),zt(Pe(jBe),{"model-value":d,"onUpdate:modelValue":A=>n(A,g)},null,8,["model-value","onUpdate:modelValue"]),zt(Pe(AIe),{label:"Metrics to monetize",modelValue:Pe(t).model.args.inputHandles[g].options,"onUpdate:modelValue":A=>Pe(t).model.args.inputHandles[g].options=A,options:r},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024))),128)),zt(Pe(H$),{modelValue:s.isMultiDialogFileOpen,"onUpdate:modelValue":u[3]||(u[3]=d=>s.isMultiDialogFileOpen=d),multi:"","onImport:files":i},null,8,["modelValue"]),zt(Pe(WG)),We("pre",null," "+Zt(Pe(t).model.outputs.__mnzInfo)+" ",1),Pe(t).model.outputs.token?(ye(),jt(Pe(b2),{key:0,label:"token"},{default:er(()=>[Ne(Zt(Pe(t).model.outputs.token),1)]),_:1})):yt("",!0),Pe(t).model.outputs.token?(ye(),jt(Pe(kF),{key:1,onClick:u[4]||(u[4]=d=>l(Pe(t).model.outputs.token))},{default:er(()=>u[8]||(u[8]=[Ne(" Verify")])),_:1})):yt("",!0),a.value?(ye(),jt(Pe(b2),{key:2,label:"token verification"},{default:er(()=>[Ne(Zt(a.value),1)]),_:1})):yt("",!0),Pe(t).model.outputs.token?(ye(),jt(Pe(b2),{key:3,label:"trying to parse a token"},{default:er(()=>[We("pre",null," "+Zt(JSON.stringify(o.value,null,2))+" ",1)]),_:1})):yt("",!0)]),_:1}))}}),Ire=PDe(g6t,()=>({routes:{"/":()=>A6t}})),m6t=Ire.useApp;kae(N8e).use(Ire).mount("#app");
13656
- //# sourceMappingURL=index-Bh-0eLyW.js.map
13655
+ M-${n},${t}L0,${t-2*n}L${n},${t}z`,fill:"none",stroke:r})}case"12":return st.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:r});case"13":return st.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:r});case"14":return st.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M-${t},${t}L0,${-t}L${t},${t}`,fill:"none",stroke:r});case"15":return st.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:r,stroke:r});case"16":return st.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:r,stroke:r});case"17":return st.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:r,stroke:r});case"18":{let n=t*t2;return st.jsx("path",{d:`M0,-${n}L ${n},0 L 0,${n} L -${n},0z`,fill:r,stroke:r})}case"20":{let n=t*2/3;return st.jsx("path",{d:`M -${n},0 a ${n},${n} 0 1,0 ${n*2},0 a ${n},${n} 0 1,0 -${n*2},0z`,fill:r,stroke:r})}case"22":return st.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:r,stroke:s??a1(r)});case"21":return st.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:r,stroke:s??a1(r)});case"24":return st.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:r,stroke:s??a1(r)});case"23":{let n=t*t2;return st.jsx("path",{d:`M0,-${n}L ${n},0 L 0,${n} L -${n},0z`,fill:r,stroke:s??a1(r)})}case"25":return st.jsx("path",{d:`M${-2*t*Math.tan(Math.PI/6)},-${t}L ${2*t*Math.tan(Math.PI/6)},-${t}L0,${t}z`,fill:r,stroke:s??a1(r)});default:z6(e,`Unknown point shape ${e}`)}}function G7t({message:e}){return st.jsx("div",{style:{width:"500px",height:"400px",color:"#ee1616",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"25px",fontFamily:"Arial",border:"1px solid"},children:e})}var o7=4;function SQ(e){return isNaN(e)?"?":e===0?"0":Math.abs(e)<.01?lx(".1e")(e):lx(".2f")(e)}function xQ(e=null){switch(e){case null:return"";case"solid":return"";case"dashed":return"6 6";case"dotted":return"1.5 4";case"dotdash":return"1.4 4 8 4";case"longdash":return"10 4";case"twodash":return"3 3 9 3";default:z6(e,`Unknown line shape ${e}`)}}(class extends bJ.Component{constructor(e){super(e),this.state={hasError:!1,message:""}}static getDerivedStateFromError(e){return{hasError:!0,message:e.message}}componentDidUpdate(e){e.dataId!==this.props.dataId&&this.setState({hasError:!1,message:"error.message"})}componentDidCatch(e,t){console.log(t)}render(){return this.state.hasError?st.jsx(G7t,{message:this.state.message}):this.props.children}});function O7t(e,t,r,s){return e==="left"?r:e==="right"?t-s:(t-(r+s))/2+r}function N7t(e){return e==="left"?"start":e==="right"?"end":"middle"}function _7t({show:e,position:t,title:r,chartsWidth:s,leftPadding:n,rightPadding:i}){return e?st.jsx("g",{children:r.map((o,a)=>st.jsx("text",{x:O7t(t,s,n,i),textAnchor:N7t(t),y:-(r.length-a-1)*24-24-24/2,fontSize:"20px",fontFamily:"Manrope",fontWeight:"500",dominantBaseline:"central",children:o},`${o}_${a}`))}):null}var ro=12,l1=-12,EQ=14;function V7t(e=null){return e==="dashed"?"M1 11.25H6V12.75H1V11.25ZM9.5 11.25H14.5V12.75H9.5V11.25ZM18 11.25H23V12.75H18V11.25Z":e==="dotted"?"M2.75 11.25H1.25V12.75H2.75V11.25Z M11.25 11.25H12.75V12.75H11.25V11.25Z M22.75 11.25H21.25V12.75H22.75V11.25Z M7.75 11.25H6.25V12.75H7.75V11.25Z M16.25 11.25H17.75V12.75H16.25V11.25Z":e==="longdash"?"M1 11.25H10V12.75H1V11.25ZM14 11.25H23V12.75H14V11.25Z":e==="dotdash"?"M1 11.25H2.5V12.75H1V11.25ZM17 12.75H7V11.25H17V12.75ZM21.5 12.75V11.25H23V12.75H21.5Z":e==="twodash"?"M1 11.25H4V12.75H1V11.25ZM17.0261 12.75H7V11.25H17.0261V12.75ZM20 12.75V11.25H23V12.75H20Z":"M1 11.25H23V12.75H1V11.25Z"}var z7t=3,Q7t=24;function U7t({aes:e,label:t,usedAes:r}){let s=r.lineShape,n=r.dotShape,i=r.fillColor||r.lineColor&&!r.lineShape||r.dotFill&&!r.dotShape,o=n?hre(e.dotShape??"21",z7t,i?Bi:e.dotFill??Bi):null,a=(n&&s?2*ro:0)-6,l=s?a+Q7t+8:ro+8;return st.jsxs("g",{children:[i&&st.jsx("rect",{width:ro,height:ro,stroke:e.fillColor??e.lineColor,fill:e.fillColor??e.lineColor,rx:"1",ry:"1"}),n&&st.jsx("g",{transform:`translate(${ro/2},${ro/2})`,children:o}),s&&st.jsx("path",{transform:`translate(${a},-5)`,fillRule:"evenodd",clipRule:"evenodd",d:V7t(e.lineShape),fill:e.lineColor}),st.jsx("text",{x:l,y:ro/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function W7t({aes:e,label:t}){let r=hre(e.shape,e.size,e.color);return st.jsxs("g",{children:[st.jsx("g",{transform:`translate(${ro/2},${ro/2})`,children:r}),st.jsx("text",{x:ro+8,y:ro/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function j7t({legendData:e}){let t=e.items.filter(r=>r.type==="continuous");return st.jsxs("g",{children:[st.jsx("defs",{children:t.map(r=>st.jsx("linearGradient",{id:r.id,gradientTransform:"rotate(90)",children:r.scale.domain().reverse().map(s=>{let n=r.scale.domain(),i=n[n.length-1]-n[0],o=i>0?100-(s-n[0])/i*100:0;return st.jsx("stop",{offset:`${o}%`,stopColor:r.scale(s)},s)})},r.id))}),e.items.map(r=>{if(r.type==="continuous")return st.jsxs("g",{transform:`translate(${r.left},${r.top})`,children:[st.jsx("text",{fontWeight:500,fontSize:"14px",y:l1,children:r.title}),st.jsx("rect",{x:"0",y:"0",width:EQ,height:r.height,stroke:Bi,fill:`url(#${r.id})`}),st.jsx("g",{transform:`translate(${EQ},0)`,children:r.values.map(s=>{let n=r.tickPositionScale(s)??0;return st.jsxs("g",{transform:`translate(0,${n})`,children:[st.jsx("line",{x1:"0",x2:-4,stroke:Bi}),st.jsx("text",{x:8,y:4,children:s})]},s)})}),!1]},r.id);if(r.type==="discreteColor")return st.jsxs("g",{transform:`translate(${r.left},${r.top})`,children:[st.jsx("text",{fontWeight:500,fontSize:"14px",y:l1,children:r.title}),r.values.map((s,n)=>st.jsxs("g",{transform:`translate(0, ${n*(ro+4)})`,children:[st.jsx("rect",{x:"0",y:"0",width:ro,height:ro,fill:r.scale(s),rx:"1",ry:"1",stroke:Bi}),st.jsx("text",{x:ro+8,y:10,children:s})]},s)),!1]},r.id);if(r.type==="discreteMulti")return st.jsxs("g",{transform:`translate(${r.left},${r.top})`,fontSize:"14px",fontWeight:500,children:[st.jsx("text",{fontWeight:600,y:l1,children:r.title}),r.values.map((s,n)=>st.jsx("g",{transform:`translate(0, ${n*(ro+4)})`,children:st.jsx(U7t,{aes:r.scale(s),label:r.labels[s],usedAes:r.usedAes})},s)),!1]},r.id);if(r.type==="dots")return st.jsxs("g",{transform:`translate(${r.left},${r.top})`,fontSize:"14px",fontWeight:500,children:[st.jsx("text",{fontWeight:500,y:l1,children:r.title}),r.values.map((s,n)=>st.jsx("g",{transform:`translate(0, ${n*(ro+4)})`,children:st.jsx(W7t,{aes:r.scale(s),label:r.labels[s]})},s)),!1]},r.id);if(r.type==="size"){let s=r.height/r.values.length;return st.jsxs("g",{transform:`translate(${r.left},${r.top})`,fontSize:"14px",fontWeight:500,children:[st.jsx("text",{fontWeight:500,y:l1,children:r.title}),r.values.map((n,i)=>{let o=r.scale(n);return st.jsxs("g",{transform:`translate(0, ${i*s})`,children:[st.jsx("circle",{r:o,cx:s/2,cy:s/2,fill:Bi}),st.jsx("text",{x:s+4,y:s/2,alignmentBaseline:"central",children:r.labels[n]})]},n)}),!1]},r.id)}})]})}new CD("600 14px Manrope");function K7t(e,t,r=!1){let s=Math.abs(e.range()[0]-e.range()[1]),n=r?Math.min(Math.floor(s/45),10):10,i=e.ticks(n).filter(l=>t&&l>=0||!t),o=new Set(i);if(!r&&i.length>1){let l=e(i[0]),c=e(i[0]);for(let u=1;u<i.length;u++)c=e(i[u]),Math.abs(c-l)>=20?l=c:o.delete(i[u])}r&&i.length>2&&Math.abs(e(i[1])-e(i[0]))<45&&(i=i.filter((l,c)=>c%2===0));let a=i.some(l=>Math.abs(l)<1e-4&&l!==0||l>1e4)?",e":",f";return{ticks:i,format:l=>o.has(l)?e.tickFormat(n,a)(l):""}}var Y7t=1;function Z7t({scaleX:e,scaleY:t,width:r,height:s,axisX:n,axisY:i,frameType:o,updatingKey:a=""}){let[l,c]=qu.useState(e.ticks()),[u,d]=qu.useState(t.ticks()),{significantLines:g=[]}=n,{significantLines:A=[]}=i;return qu.useEffect(()=>{let w=e.ticks().filter(b=>!g.includes(b)),v=t.ticks().filter(b=>!A.includes(b));c(w),d(v)},[e,t,a]),st.jsxs("g",{stroke:o1,children:[n.showGrid&&l.map(w=>{let v=e(w);return st.jsx("line",{x1:v,x2:v,y1:0,y2:s},`x_${v}_${s}`)}),i.showGrid&&u.map(w=>{let v=t(w);return st.jsx("line",{x1:0,x2:r,y1:v,y2:v},`y_${v}_${r}`)}),st.jsx("g",{strokeDasharray:xQ(n.significantLinesStyle),stroke:Bi,children:g.map(w=>{let v=e(w);return v<0||v>r?null:st.jsx("line",{x1:v,x2:v,y1:0,y2:s},`significant_${v}_${s}`)})}),st.jsx("g",{strokeDasharray:xQ(i.significantLinesStyle),stroke:Bi,children:A.map(w=>{let v=t(w);return v<0||v>s?null:st.jsx("line",{x1:0,x2:r,y1:v,y2:v},`significant_${v}_${r}`)})}),o!=="empty"&&st.jsxs("g",{strokeWidth:Y7t,children:[(n.showGrid||o!=="left")&&st.jsx("line",{stroke:o==="left"?o1:Bi,x1:"0",x2:r,y1:s,y2:s}),(n.showGrid||o!=="bottom")&&st.jsx("line",{stroke:o==="bottom"?o1:Bi,x1:"0",x2:"0",y1:"0",y2:s}),(n.showGrid||o==="full")&&st.jsx("line",{stroke:o==="full"?Bi:o1,x1:r,x2:r,y1:"0",y2:s}),(i.showGrid||o==="full")&&st.jsx("line",{stroke:o==="full"?Bi:o1,x1:"0",x2:r,y1:"0",y2:"0"})]})]})}function X7t(e){return`translate(${e},0)`}function $7t(e){return`translate(0,${e})`}function J7t(e){return e==="bottom"?`translate(0,${o7})`:`translate(${-o7},0)`}function q7t(e){return e==="bottom"?"hanging":"central"}function eLt(e){return e==="bottom"?"middle":"end"}var PQ=({scale:e,tickSize:t=6,tickPadding:r=o7,orient:s="bottom",onlyPositive:n=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(v){return b=>{let S=v(b);return S===void 0?0:+S}}let{ticks:a,format:l}=K7t(e,n,s==="bottom"),c=Math.max(t,0)+r,u=o(e.copy()),d=s==="bottom"?X7t:$7t,g=s==="left"?-1:1,A={[(s==="left"?"x":"y")+"2"]:g*t},w={[s==="left"?"x":"y"]:g*c};return st.jsx("g",{children:a.map((v,b)=>st.jsxs("g",{className:"tick",transform:d(u(v)+i),children:[st.jsx("line",{stroke:Bi,...A}),st.jsx("g",{transform:J7t(s),children:st.jsx("text",{fill:Bi,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:q7t(s),textAnchor:eLt(s),...w,children:l(v)})})]},b))})};new CD("16px Manrope");BTt(MBt());var OI=20,FQ=4,tLt=24;function rLt(e,t,r=[]){let s=e.data,n=[`x: ${SQ(e.x)}`,`y: ${SQ(e.y)}`];t.label&&n.unshift(`${t.label}: ${s[t.label]}`);for(let i of r)n.push(`${i.label}: ${s[i.valueLabels??i.value]}`);return n}function RQ(e){return typeof e=="string"?e:e.label??e.value}var TQ=V_e().curve(z_e);function sLt({scales:e,chartSettings:t,mainTitle:r,keyColumn:s,margins:n,chartSizes:i,onlyPositive:o,container:a,zoomStateKey:l,legendData:c,dotsByGrouping:u,layers:d,aesGetters:g,selectedDot:A=null}){var w;let{title:v,xAxis:b,yAxis:S,frame:P,legend:F}=t,T=b.showTicks?FQ:0,D=S.showTicks?FQ:0,B=b.title,k=S.title,z={left:0,right:i.chartWidth,top:0,bottom:i.chartHeight};if(!a)return null;let O=d.find(N=>N.type==="curve"),[j,_]=qu.useState([]);function G(){let N=Object.entries(u).map(([W,V])=>({key:W,d:O!=null&&O.smoothing?TQ(V)??"":V.map(q=>`${e.x(q.x)},${e.y(q.y)}`).join(" "),dot:V[0]}));_(N)}return qu.useEffect(()=>{O&&(TQ.x(N=>e.x(N.x)).y(N=>e.y(N.y)),G())},[l]),qu.useEffect(()=>{O&&G()},[O==null?void 0:O.smoothing]),st.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${i.totalWidth} ${i.totalHeight}`,width:i.totalWidth,height:i.totalHeight,style:{pointerEvents:"none"},children:[st.jsx("defs",{children:b7t}),st.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontFamily:"Manrope",children:[st.jsx("clipPath",{id:"viewportClipPath",children:st.jsx("rect",{x:"0",y:"0",width:i.chartWidth,height:i.chartHeight})}),st.jsx(_7t,{title:r,show:v.show,position:v.position,leftPadding:n.left,rightPadding:n.right,chartsWidth:i.chartWidth}),st.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Bi,children:[B&&st.jsx("text",{x:i.chartWidth/2,y:i.chartHeight+n.bottom-OI/2,children:RQ(B)}),k&&st.jsx("text",{x:-n.left+OI/2,y:i.chartHeight/2,transform:`rotate(-90,${-n.left+OI/2},${i.chartHeight/2})`,children:RQ(k)})]}),st.jsx(Z7t,{width:i.chartWidth,height:i.chartHeight,scaleX:e.x,scaleY:e.y,axisX:b,axisY:S,updatingKey:l,frameType:P.type}),st.jsx("g",{transform:`translate(0,${i.chartHeight})`,children:st.jsx(PQ,{scale:e.x,orient:"bottom",onlyPositive:o.x,tickSize:T})}),st.jsx("g",{children:st.jsx(PQ,{scale:e.y,orient:"left",onlyPositive:o.y,tickSize:D})}),O&&O.smoothing&&st.jsx("g",{clipPath:"url(#viewportClipPath)",children:j.map(({key:N,d:W,dot:V})=>st.jsx("path",{d:W,fill:"none",stroke:g.dotFill(V.data),strokeWidth:O.aes.lineWidth,strokeDasharray:g.lineType(V.data)},N))}),O&&!O.smoothing&&st.jsx("g",{clipPath:"url(#viewportClipPath)",children:j.map(({key:N,d:W,dot:V})=>st.jsx("polyline",{points:W,fill:"none",stroke:g.dotFill(V.data),strokeWidth:O.aes.lineWidth,strokeDasharray:g.lineType(V.data)},N))}),A&&st.jsx(H7t,{content:rLt(A,s,(w=t.tooltips)==null?void 0:w.content),x:e.x(A.x),y:e.y(A.y),active:!0,sideDistances:z,container:a}),F.show&&st.jsx("g",{transform:`translate(${i.chartWidth+tLt},0)`,children:st.jsx(j7t,{legendData:c})})]})]})}bJ.memo(sLt);var I2=y.object({type:y.literal("grouping"),value:y.string()}),nLt=y.object({type:y.literal("dots"),aes:y.optional(y.object({dotFill:y.optional(y.union([y.string(),I2,Bh(y.string())])),dotShape:y.optional(y.union([pl,I2])),dotSize:y.optional(y.union([y.number(),I2]))}))}),iLt=y.object({type:y.literal("curve"),smoothing:y.optional(y.boolean()),aes:y.optional(y.object({lineWidth:y.optional(y.number()),lineShape:y.optional(Xc),lineColor:y.optional(y.union([y.string(),I2,Bh(y.string())])),opacity:y.optional(y.number())}))}),oLt=y.union([nLt,iLt]);y.object({type:y.literal("scatterplot-umap"),title:y.object({name:y.string(),show:y.optional(y.boolean()),position:y.optional(SA)}),size:y.optional(y.object({width:y.optional(y.number()),height:y.optional(y.number())})),legend:y.optional(y.object({show:y.optional(y.boolean()),position:y.optional(tC)})),tooltips:y.optional(y.object({show:y.optional(y.boolean()),content:y.optional(y.array(nr))})),frame:y.optional(y.object({type:y.optional(D3)})),keyColumn:nr,x:nr,y:nr,xAxis:y.optional(_w),yAxis:y.optional(_w),grouping:y.optional(y.array(nr)),label:y.optional(nr),inheritedAes:y.optional(y.record(y.string(),Nw)),layers:y.array(oLt),lassoMode:y.optional(y.boolean())});const aw=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,pre=new Set,a7=typeof process=="object"&&process?process:{},gre=(e,t,r,s)=>{typeof a7.emitWarning=="function"?a7.emitWarning(e,t,r,s):console.error(`[${r}] ${t}: ${e}`)};let AR=globalThis.AbortController,DQ=globalThis.AbortSignal;var MQ;if(typeof AR>"u"){DQ=class{constructor(){bs(this,"onabort"),bs(this,"_onabort",[]),bs(this,"reason"),bs(this,"aborted",!1)}addEventListener(r,s){this._onabort.push(s)}},AR=class{constructor(){bs(this,"signal",new DQ),t()}abort(r){var s,n;if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(const i of this.signal._onabort)i(r);(n=(s=this.signal).onabort)==null||n.call(s,r)}}};let e=((MQ=a7.env)==null?void 0:MQ.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const t=()=>{e&&(e=!1,gre("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const aLt=e=>!pre.has(e),Xf=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),fre=e=>Xf(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?k2:null:null;class k2 extends Array{constructor(t){super(t),this.fill(0)}}var eS;const Are=class E1{constructor(t,r){if(bs(this,"heap"),bs(this,"length"),!de(E1,eS))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}static create(t){const r=fre(t);if(!r)return[];hr(E1,eS,!0);const s=new E1(t,r);return hr(E1,eS,!1),s}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};eS=new WeakMap,As(Are,eS,!1);let lLt=Are;var IQ,kQ,mh,kc,vh,H0,gh,tS,P1,ki,Bc,mi,wn,Or,el,Hc,oa,qi,Sh,eo,Ch,wh,Gc,yh,ev,tl,F1,Vt,l7,z0,Wf,mR,Oc,mre,Q0,rS,vR,Bf,jf,NI,CR,B2,pn,_I,R1,rA,c7;const cLt=class vre{constructor(t){As(this,Vt),As(this,mh),As(this,kc),As(this,vh),As(this,H0),As(this,gh),As(this,tS),As(this,P1),bs(this,"ttl"),bs(this,"ttlResolution"),bs(this,"ttlAutopurge"),bs(this,"updateAgeOnGet"),bs(this,"updateAgeOnHas"),bs(this,"allowStale"),bs(this,"noDisposeOnSet"),bs(this,"noUpdateTTL"),bs(this,"maxEntrySize"),bs(this,"sizeCalculation"),bs(this,"noDeleteOnFetchRejection"),bs(this,"noDeleteOnStaleGet"),bs(this,"allowStaleOnFetchAbort"),bs(this,"allowStaleOnFetchRejection"),bs(this,"ignoreFetchAbort"),As(this,ki),As(this,Bc),As(this,mi),As(this,wn),As(this,Or),As(this,el),As(this,Hc),As(this,oa),As(this,qi),As(this,Sh),As(this,eo),As(this,Ch),As(this,wh),As(this,Gc),As(this,yh),As(this,ev),As(this,tl),As(this,F1),As(this,z0,()=>{}),As(this,Wf,()=>{}),As(this,mR,()=>{}),As(this,Oc,()=>!1),As(this,Q0,O=>{}),As(this,rS,(O,j,_)=>{}),As(this,vR,(O,j,_,G)=>{if(_||G)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0}),bs(this,IQ,"LRUCache");const{max:r=0,ttl:s,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:l,dispose:c,onInsert:u,disposeAfter:d,noDisposeOnSet:g,noUpdateTTL:A,maxSize:w=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:S,memoMethod:P,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:B,ignoreFetchAbort:k}=t;if(r!==0&&!Xf(r))throw new TypeError("max option must be a nonnegative integer");const z=r?fre(r):Array;if(!z)throw new Error("invalid max value: "+r);if(hr(this,mh,r),hr(this,kc,w),this.maxEntrySize=v||de(this,kc),this.sizeCalculation=b,this.sizeCalculation){if(!de(this,kc)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(P!==void 0&&typeof P!="function")throw new TypeError("memoMethod must be a function if defined");if(hr(this,P1,P),S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(hr(this,tS,S),hr(this,ev,!!S),hr(this,mi,new Map),hr(this,wn,new Array(r).fill(void 0)),hr(this,Or,new Array(r).fill(void 0)),hr(this,el,new z(r)),hr(this,Hc,new z(r)),hr(this,oa,0),hr(this,qi,0),hr(this,Sh,lLt.create(r)),hr(this,ki,0),hr(this,Bc,0),typeof c=="function"&&hr(this,vh,c),typeof u=="function"&&hr(this,H0,u),typeof d=="function"?(hr(this,gh,d),hr(this,eo,[])):(hr(this,gh,void 0),hr(this,eo,void 0)),hr(this,yh,!!de(this,vh)),hr(this,F1,!!de(this,H0)),hr(this,tl,!!de(this,gh)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!A,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!D,this.allowStaleOnFetchAbort=!!B,this.ignoreFetchAbort=!!k,this.maxEntrySize!==0){if(de(this,kc)!==0&&!Xf(de(this,kc)))throw new TypeError("maxSize must be a positive integer if specified");if(!Xf(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Wt(this,Vt,mre).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Xf(n)||n===0?n:1,this.ttlAutopurge=!!i,this.ttl=s||0,this.ttl){if(!Xf(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Wt(this,Vt,l7).call(this)}if(de(this,mh)===0&&this.ttl===0&&de(this,kc)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!de(this,mh)&&!de(this,kc)){const O="LRU_CACHE_UNBOUNDED";aLt(O)&&(pre.add(O),gre("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,vre))}}static unsafeExposeInternals(t){return{starts:de(t,wh),ttls:de(t,Gc),sizes:de(t,Ch),keyMap:de(t,mi),keyList:de(t,wn),valList:de(t,Or),next:de(t,el),prev:de(t,Hc),get head(){return de(t,oa)},get tail(){return de(t,qi)},free:de(t,Sh),isBackgroundFetch:r=>{var s;return Wt(s=t,Vt,pn).call(s,r)},backgroundFetch:(r,s,n,i)=>{var o;return Wt(o=t,Vt,B2).call(o,r,s,n,i)},moveToTail:r=>{var s;return Wt(s=t,Vt,R1).call(s,r)},indexes:r=>{var s;return Wt(s=t,Vt,Bf).call(s,r)},rindexes:r=>{var s;return Wt(s=t,Vt,jf).call(s,r)},isStale:r=>{var s;return de(s=t,Oc).call(s,r)}}}get max(){return de(this,mh)}get maxSize(){return de(this,kc)}get calculatedSize(){return de(this,Bc)}get size(){return de(this,ki)}get fetchMethod(){return de(this,tS)}get memoMethod(){return de(this,P1)}get dispose(){return de(this,vh)}get onInsert(){return de(this,H0)}get disposeAfter(){return de(this,gh)}getRemainingTTL(t){return de(this,mi).has(t)?1/0:0}*entries(){for(const t of Wt(this,Vt,Bf).call(this))de(this,Or)[t]!==void 0&&de(this,wn)[t]!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield[de(this,wn)[t],de(this,Or)[t]])}*rentries(){for(const t of Wt(this,Vt,jf).call(this))de(this,Or)[t]!==void 0&&de(this,wn)[t]!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield[de(this,wn)[t],de(this,Or)[t]])}*keys(){for(const t of Wt(this,Vt,Bf).call(this)){const r=de(this,wn)[t];r!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield r)}}*rkeys(){for(const t of Wt(this,Vt,jf).call(this)){const r=de(this,wn)[t];r!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield r)}}*values(){for(const t of Wt(this,Vt,Bf).call(this))de(this,Or)[t]!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield de(this,Or)[t])}*rvalues(){for(const t of Wt(this,Vt,jf).call(this))de(this,Or)[t]!==void 0&&!Wt(this,Vt,pn).call(this,de(this,Or)[t])&&(yield de(this,Or)[t])}[(kQ=Symbol.iterator,IQ=Symbol.toStringTag,kQ)](){return this.entries()}find(t,r={}){for(const s of Wt(this,Vt,Bf).call(this)){const n=de(this,Or)[s],i=Wt(this,Vt,pn).call(this,n)?n.__staleWhileFetching:n;if(i!==void 0&&t(i,de(this,wn)[s],this))return this.get(de(this,wn)[s],r)}}forEach(t,r=this){for(const s of Wt(this,Vt,Bf).call(this)){const n=de(this,Or)[s],i=Wt(this,Vt,pn).call(this,n)?n.__staleWhileFetching:n;i!==void 0&&t.call(r,i,de(this,wn)[s],this)}}rforEach(t,r=this){for(const s of Wt(this,Vt,jf).call(this)){const n=de(this,Or)[s],i=Wt(this,Vt,pn).call(this,n)?n.__staleWhileFetching:n;i!==void 0&&t.call(r,i,de(this,wn)[s],this)}}purgeStale(){let t=!1;for(const r of Wt(this,Vt,jf).call(this,{allowStale:!0}))de(this,Oc).call(this,r)&&(Wt(this,Vt,rA).call(this,de(this,wn)[r],"expire"),t=!0);return t}info(t){const r=de(this,mi).get(t);if(r===void 0)return;const s=de(this,Or)[r],n=Wt(this,Vt,pn).call(this,s)?s.__staleWhileFetching:s;if(n===void 0)return;const i={value:n};if(de(this,Gc)&&de(this,wh)){const o=de(this,Gc)[r],a=de(this,wh)[r];if(o&&a){const l=o-(aw.now()-a);i.ttl=l,i.start=Date.now()}}return de(this,Ch)&&(i.size=de(this,Ch)[r]),i}dump(){const t=[];for(const r of Wt(this,Vt,Bf).call(this,{allowStale:!0})){const s=de(this,wn)[r],n=de(this,Or)[r],i=Wt(this,Vt,pn).call(this,n)?n.__staleWhileFetching:n;if(i===void 0||s===void 0)continue;const o={value:i};if(de(this,Gc)&&de(this,wh)){o.ttl=de(this,Gc)[r];const a=aw.now()-de(this,wh)[r];o.start=Math.floor(Date.now()-a)}de(this,Ch)&&(o.size=de(this,Ch)[r]),t.unshift([s,o])}return t}load(t){this.clear();for(const[r,s]of t){if(s.start){const n=Date.now()-s.start;s.start=aw.now()-n}this.set(r,s.value,s)}}set(t,r,s={}){var n,i,o,a,l,c,u;if(r===void 0)return this.delete(t),this;const{ttl:d=this.ttl,start:g,noDisposeOnSet:A=this.noDisposeOnSet,sizeCalculation:w=this.sizeCalculation,status:v}=s;let{noUpdateTTL:b=this.noUpdateTTL}=s;const S=de(this,vR).call(this,t,r,s.size||0,w);if(this.maxEntrySize&&S>this.maxEntrySize)return v&&(v.set="miss",v.maxEntrySizeExceeded=!0),Wt(this,Vt,rA).call(this,t,"set"),this;let P=de(this,ki)===0?void 0:de(this,mi).get(t);if(P===void 0)P=de(this,ki)===0?de(this,qi):de(this,Sh).length!==0?de(this,Sh).pop():de(this,ki)===de(this,mh)?Wt(this,Vt,CR).call(this,!1):de(this,ki),de(this,wn)[P]=t,de(this,Or)[P]=r,de(this,mi).set(t,P),de(this,el)[de(this,qi)]=P,de(this,Hc)[P]=de(this,qi),hr(this,qi,P),Uk(this,ki)._++,de(this,rS).call(this,P,S,v),v&&(v.set="add"),b=!1,de(this,F1)&&((n=de(this,H0))==null||n.call(this,r,t,"add"));else{Wt(this,Vt,R1).call(this,P);const F=de(this,Or)[P];if(r!==F){if(de(this,ev)&&Wt(this,Vt,pn).call(this,F)){F.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:T}=F;T!==void 0&&!A&&(de(this,yh)&&((i=de(this,vh))==null||i.call(this,T,t,"set")),de(this,tl)&&((o=de(this,eo))==null||o.push([T,t,"set"])))}else A||(de(this,yh)&&((a=de(this,vh))==null||a.call(this,F,t,"set")),de(this,tl)&&((l=de(this,eo))==null||l.push([F,t,"set"])));if(de(this,Q0).call(this,P),de(this,rS).call(this,P,S,v),de(this,Or)[P]=r,v){v.set="replace";const T=F&&Wt(this,Vt,pn).call(this,F)?F.__staleWhileFetching:F;T!==void 0&&(v.oldValue=T)}}else v&&(v.set="update");de(this,F1)&&((c=this.onInsert)==null||c.call(this,r,t,r===F?"update":"replace"))}if(d!==0&&!de(this,Gc)&&Wt(this,Vt,l7).call(this),de(this,Gc)&&(b||de(this,mR).call(this,P,d,g),v&&de(this,Wf).call(this,v,P)),!A&&de(this,tl)&&de(this,eo)){const F=de(this,eo);let T;for(;T=F==null?void 0:F.shift();)(u=de(this,gh))==null||u.call(this,...T)}return this}pop(){var t;try{for(;de(this,ki);){const r=de(this,Or)[de(this,oa)];if(Wt(this,Vt,CR).call(this,!0),Wt(this,Vt,pn).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(de(this,tl)&&de(this,eo)){const r=de(this,eo);let s;for(;s=r==null?void 0:r.shift();)(t=de(this,gh))==null||t.call(this,...s)}}}has(t,r={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:n}=r,i=de(this,mi).get(t);if(i!==void 0){const o=de(this,Or)[i];if(Wt(this,Vt,pn).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(de(this,Oc).call(this,i))n&&(n.has="stale",de(this,Wf).call(this,n,i));else return s&&de(this,z0).call(this,i),n&&(n.has="hit",de(this,Wf).call(this,n,i)),!0}else n&&(n.has="miss");return!1}peek(t,r={}){const{allowStale:s=this.allowStale}=r,n=de(this,mi).get(t);if(n===void 0||!s&&de(this,Oc).call(this,n))return;const i=de(this,Or)[n];return Wt(this,Vt,pn).call(this,i)?i.__staleWhileFetching:i}async fetch(t,r={}){const{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:A=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:v,forceRefresh:b=!1,status:S,signal:P}=r;if(!de(this,ev))return S&&(S.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:S});const F={allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:l,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:w,ignoreFetchAbort:A,status:S,signal:P};let T=de(this,mi).get(t);if(T===void 0){S&&(S.fetch="miss");const D=Wt(this,Vt,B2).call(this,t,T,F,v);return D.__returned=D}else{const D=de(this,Or)[T];if(Wt(this,Vt,pn).call(this,D)){const O=s&&D.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",O&&(S.returnedStale=!0)),O?D.__staleWhileFetching:D.__returned=D}const B=de(this,Oc).call(this,T);if(!b&&!B)return S&&(S.fetch="hit"),Wt(this,Vt,R1).call(this,T),n&&de(this,z0).call(this,T),S&&de(this,Wf).call(this,S,T),D;const k=Wt(this,Vt,B2).call(this,t,T,F,v),z=k.__staleWhileFetching!==void 0&&s;return S&&(S.fetch=B?"stale":"refresh",z&&B&&(S.returnedStale=!0)),z?k.__staleWhileFetching:k.__returned=k}}async forceFetch(t,r={}){const s=await this.fetch(t,r);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,r={}){const s=de(this,P1);if(!s)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=r,a=this.get(t,o);if(!i&&a!==void 0)return a;const l=s(t,a,{options:o,context:n});return this.set(t,l,o),l}get(t,r={}){const{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,a=de(this,mi).get(t);if(a!==void 0){const l=de(this,Or)[a],c=Wt(this,Vt,pn).call(this,l);return o&&de(this,Wf).call(this,o,a),de(this,Oc).call(this,a)?(o&&(o.get="stale"),c?(o&&s&&l.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?l.__staleWhileFetching:void 0):(i||Wt(this,Vt,rA).call(this,t,"expire"),o&&s&&(o.returnedStale=!0),s?l:void 0)):(o&&(o.get="hit"),c?l.__staleWhileFetching:(Wt(this,Vt,R1).call(this,a),n&&de(this,z0).call(this,a),l))}else o&&(o.get="miss")}delete(t){return Wt(this,Vt,rA).call(this,t,"delete")}clear(){return Wt(this,Vt,c7).call(this,"delete")}};mh=new WeakMap,kc=new WeakMap,vh=new WeakMap,H0=new WeakMap,gh=new WeakMap,tS=new WeakMap,P1=new WeakMap,ki=new WeakMap,Bc=new WeakMap,mi=new WeakMap,wn=new WeakMap,Or=new WeakMap,el=new WeakMap,Hc=new WeakMap,oa=new WeakMap,qi=new WeakMap,Sh=new WeakMap,eo=new WeakMap,Ch=new WeakMap,wh=new WeakMap,Gc=new WeakMap,yh=new WeakMap,ev=new WeakMap,tl=new WeakMap,F1=new WeakMap,Vt=new WeakSet,l7=function(){const e=new k2(de(this,mh)),t=new k2(de(this,mh));hr(this,Gc,e),hr(this,wh,t),hr(this,mR,(n,i,o=aw.now())=>{if(t[n]=i!==0?o:0,e[n]=i,i!==0&&this.ttlAutopurge){const a=setTimeout(()=>{de(this,Oc).call(this,n)&&Wt(this,Vt,rA).call(this,de(this,wn)[n],"expire")},i+1);a.unref&&a.unref()}}),hr(this,z0,n=>{t[n]=e[n]!==0?aw.now():0}),hr(this,Wf,(n,i)=>{if(e[i]){const o=e[i],a=t[i];if(!o||!a)return;n.ttl=o,n.start=a,n.now=r||s();const l=n.now-a;n.remainingTTL=o-l}});let r=0;const s=()=>{const n=aw.now();if(this.ttlResolution>0){r=n;const i=setTimeout(()=>r=0,this.ttlResolution);i.unref&&i.unref()}return n};this.getRemainingTTL=n=>{const i=de(this,mi).get(n);if(i===void 0)return 0;const o=e[i],a=t[i];if(!o||!a)return 1/0;const l=(r||s())-a;return o-l},hr(this,Oc,n=>{const i=t[n],o=e[n];return!!o&&!!i&&(r||s())-i>o})},z0=new WeakMap,Wf=new WeakMap,mR=new WeakMap,Oc=new WeakMap,mre=function(){const e=new k2(de(this,mh));hr(this,Bc,0),hr(this,Ch,e),hr(this,Q0,t=>{hr(this,Bc,de(this,Bc)-e[t]),e[t]=0}),hr(this,vR,(t,r,s,n)=>{if(Wt(this,Vt,pn).call(this,r))return 0;if(!Xf(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(r,t),!Xf(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),hr(this,rS,(t,r,s)=>{if(e[t]=r,de(this,kc)){const n=de(this,kc)-e[t];for(;de(this,Bc)>n;)Wt(this,Vt,CR).call(this,!0)}hr(this,Bc,de(this,Bc)+e[t]),s&&(s.entrySize=r,s.totalCalculatedSize=de(this,Bc))})},Q0=new WeakMap,rS=new WeakMap,vR=new WeakMap,Bf=function*({allowStale:e=this.allowStale}={}){if(de(this,ki))for(let t=de(this,qi);!(!Wt(this,Vt,NI).call(this,t)||((e||!de(this,Oc).call(this,t))&&(yield t),t===de(this,oa)));)t=de(this,Hc)[t]},jf=function*({allowStale:e=this.allowStale}={}){if(de(this,ki))for(let t=de(this,oa);!(!Wt(this,Vt,NI).call(this,t)||((e||!de(this,Oc).call(this,t))&&(yield t),t===de(this,qi)));)t=de(this,el)[t]},NI=function(e){return e!==void 0&&de(this,mi).get(de(this,wn)[e])===e},CR=function(e){var t,r;const s=de(this,oa),n=de(this,wn)[s],i=de(this,Or)[s];return de(this,ev)&&Wt(this,Vt,pn).call(this,i)?i.__abortController.abort(new Error("evicted")):(de(this,yh)||de(this,tl))&&(de(this,yh)&&((t=de(this,vh))==null||t.call(this,i,n,"evict")),de(this,tl)&&((r=de(this,eo))==null||r.push([i,n,"evict"]))),de(this,Q0).call(this,s),e&&(de(this,wn)[s]=void 0,de(this,Or)[s]=void 0,de(this,Sh).push(s)),de(this,ki)===1?(hr(this,oa,hr(this,qi,0)),de(this,Sh).length=0):hr(this,oa,de(this,el)[s]),de(this,mi).delete(n),Uk(this,ki)._--,s},B2=function(e,t,r,s){const n=t===void 0?void 0:de(this,Or)[t];if(Wt(this,Vt,pn).call(this,n))return n;const i=new AR,{signal:o}=r;o==null||o.addEventListener("abort",()=>i.abort(o.reason),{signal:i.signal});const a={signal:i.signal,options:r,context:s},l=(w,v=!1)=>{const{aborted:b}=i.signal,S=r.ignoreFetchAbort&&w!==void 0;if(r.status&&(b&&!v?(r.status.fetchAborted=!0,r.status.fetchError=i.signal.reason,S&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),b&&!S&&!v)return u(i.signal.reason);const P=g;return de(this,Or)[t]===g&&(w===void 0?P.__staleWhileFetching?de(this,Or)[t]=P.__staleWhileFetching:Wt(this,Vt,rA).call(this,e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,w,a.options))),w},c=w=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=w),u(w)),u=w=>{const{aborted:v}=i.signal,b=v&&r.allowStaleOnFetchAbort,S=b||r.allowStaleOnFetchRejection,P=S||r.noDeleteOnFetchRejection,F=g;if(de(this,Or)[t]===g&&(!P||F.__staleWhileFetching===void 0?Wt(this,Vt,rA).call(this,e,"fetch"):b||(de(this,Or)[t]=F.__staleWhileFetching)),S)return r.status&&F.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),F.__staleWhileFetching;if(F.__returned===F)throw w},d=(w,v)=>{var b;const S=(b=de(this,tS))==null?void 0:b.call(this,e,n,a);S&&S instanceof Promise&&S.then(P=>w(P===void 0?void 0:P),v),i.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(w(void 0),r.allowStaleOnFetchAbort&&(w=P=>l(P,!0)))})};r.status&&(r.status.fetchDispatched=!0);const g=new Promise(d).then(l,c),A=Object.assign(g,{__abortController:i,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,A,{...a.options,status:void 0}),t=de(this,mi).get(e)):de(this,Or)[t]=A,A},pn=function(e){if(!de(this,ev))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AR},_I=function(e,t){de(this,Hc)[t]=e,de(this,el)[e]=t},R1=function(e){e!==de(this,qi)&&(e===de(this,oa)?hr(this,oa,de(this,el)[e]):Wt(this,Vt,_I).call(this,de(this,Hc)[e],de(this,el)[e]),Wt(this,Vt,_I).call(this,de(this,qi),e),hr(this,qi,e))},rA=function(e,t){var r,s,n,i;let o=!1;if(de(this,ki)!==0){const a=de(this,mi).get(e);if(a!==void 0)if(o=!0,de(this,ki)===1)Wt(this,Vt,c7).call(this,t);else{de(this,Q0).call(this,a);const l=de(this,Or)[a];if(Wt(this,Vt,pn).call(this,l)?l.__abortController.abort(new Error("deleted")):(de(this,yh)||de(this,tl))&&(de(this,yh)&&((r=de(this,vh))==null||r.call(this,l,e,t)),de(this,tl)&&((s=de(this,eo))==null||s.push([l,e,t]))),de(this,mi).delete(e),de(this,wn)[a]=void 0,de(this,Or)[a]=void 0,a===de(this,qi))hr(this,qi,de(this,Hc)[a]);else if(a===de(this,oa))hr(this,oa,de(this,el)[a]);else{const c=de(this,Hc)[a];de(this,el)[c]=de(this,el)[a];const u=de(this,el)[a];de(this,Hc)[u]=de(this,Hc)[a]}Uk(this,ki)._--,de(this,Sh).push(a)}}if(de(this,tl)&&(n=de(this,eo))!=null&&n.length){const a=de(this,eo);let l;for(;l=a==null?void 0:a.shift();)(i=de(this,gh))==null||i.call(this,...l)}return o},c7=function(e){var t,r,s;for(const n of Wt(this,Vt,jf).call(this,{allowStale:!0})){const i=de(this,Or)[n];if(Wt(this,Vt,pn).call(this,i))i.__abortController.abort(new Error("deleted"));else{const o=de(this,wn)[n];de(this,yh)&&((t=de(this,vh))==null||t.call(this,i,o,e)),de(this,tl)&&((r=de(this,eo))==null||r.push([i,o,e]))}}if(de(this,mi).clear(),de(this,Or).fill(void 0),de(this,wn).fill(void 0),de(this,Gc)&&de(this,wh)&&(de(this,Gc).fill(0),de(this,wh).fill(0)),de(this,Ch)&&de(this,Ch).fill(0),hr(this,oa,0),hr(this,qi,0),de(this,Sh).length=0,hr(this,Bc,0),hr(this,ki,0),de(this,tl)&&de(this,eo)){const n=de(this,eo);let i;for(;i=n==null?void 0:n.shift();)(s=de(this,gh))==null||s.call(this,...i)}};let uLt=cLt;const dLt={cacheSize:15e6};class hLt{constructor(t){bs(this,"_str"),bs(this,"_rawJson"),bs(this,"_zodSchema"),bs(this,"_validatedJson"),this.bytes=t}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(t){return this._zodSchema!==t&&(this._validatedJson=t.parse(this.rawJson),this._zodSchema=t),this._validatedJson}}const BQ=class L2{constructor(t){bs(this,"fileDataCache"),bs(this,"fileDataRefs",new Map);const r={...dLt,...t??{}};this.fileDataCache=new uLt({maxSize:r.cacheSize,fetchMethod:async s=>new hLt(await $X().blobDriver.getContent(s)),sizeCalculation:s=>s.bytes.length,dispose:(s,n)=>{this.fileDataRefs.delete(n)}})}getDataRef(t){const r=this.fileDataRefs.get(t);if(r!==void 0)return r;const s=yU();return this.fileDataRefs.set(t,s),(async()=>{try{const n=await this.fileDataCache.fetch(t);s.value=n}catch(n){console.error(n)}})(),s}getContentBytes(t){if(t===void 0)return;const r=this.getDataRef(t);return Je(()=>{var s;return(s=r.value)==null?void 0:s.bytes})}getContentString(t){if(t===void 0)return;const r=this.getDataRef(t);return Je(()=>{var s;return(s=r==null?void 0:r.value)==null?void 0:s.str})}getContentJson(t,r){if(t===void 0)return;const s=this.getDataRef(t);return Je(()=>{var n,i;return r===void 0?(n=s==null?void 0:s.value)==null?void 0:n.rawJson:(i=s==null?void 0:s.value)==null?void 0:i.validatedJson(r)})}static getContentBytes(t){return L2.globalInstance.getContentBytes(t)}static getContentString(t){return L2.globalInstance.getContentString(t)}static getContentJson(t,r){return L2.globalInstance.getContentJson(t,r)}};bs(BQ,"globalInstance",new BQ);function pLt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gLt=function e(t){if(typeof t=="number"&&isNaN(t))throw new Error("NaN is not allowed");if(typeof t=="number"&&!isFinite(t))throw new Error("Infinity is not allowed");return t===null||typeof t!="object"?JSON.stringify(t):t.toJSON instanceof Function?e(t.toJSON()):Array.isArray(t)?`[${t.reduce((n,i,o)=>`${n}${o===0?"":","}${e(i===void 0||typeof i=="symbol"?null:i)}`,"")}]`:`{${Object.keys(t).sort().reduce((s,n)=>{if(t[n]===void 0||typeof t[n]=="symbol")return s;const i=s.length===0?"":",";return`${s}${i}${e(n)}:${e(t[n])}`},"")}}`};const vy=pLt(gLt);var Cs;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{const i={};for(const o of n)i[o]=o;return i},e.getValidEnumValues=n=>{const i=e.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(const a of i)o[a]=n[a];return e.objectValues(o)},e.objectValues=n=>e.objectKeys(n).map(function(i){return n[i]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(o);return i},e.find=(n,i)=>{for(const o of n)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,i=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=s,e.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(Cs||(Cs={}));var u7;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(u7||(u7={}));const Ot=Cs.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$f=e=>{switch(typeof e){case"undefined":return Ot.undefined;case"string":return Ot.string;case"number":return isNaN(e)?Ot.nan:Ot.number;case"boolean":return Ot.boolean;case"function":return Ot.function;case"bigint":return Ot.bigint;case"symbol":return Ot.symbol;case"object":return Array.isArray(e)?Ot.array:e===null?Ot.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ot.promise:typeof Map<"u"&&e instanceof Map?Ot.map:typeof Set<"u"&&e instanceof Set?Ot.set:typeof Date<"u"&&e instanceof Date?Ot.date:Ot.object;default:return Ot.unknown}},mt=Cs.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),fLt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class jl extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(i){return i.message},s={_errors:[]},n=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(r(o));else{let a=s,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return n(this),s}static assert(t){if(!(t instanceof jl))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Cs.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},s=[];for(const n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):s.push(t(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}jl.create=e=>new jl(e);const Vw=(e,t)=>{let r;switch(e.code){case mt.invalid_type:e.received===Ot.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case mt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Cs.jsonStringifyReplacer)}`;break;case mt.unrecognized_keys:r=`Unrecognized key(s) in object: ${Cs.joinValues(e.keys,", ")}`;break;case mt.invalid_union:r="Invalid input";break;case mt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Cs.joinValues(e.options)}`;break;case mt.invalid_enum_value:r=`Invalid enum value. Expected ${Cs.joinValues(e.options)}, received '${e.received}'`;break;case mt.invalid_arguments:r="Invalid function arguments";break;case mt.invalid_return_type:r="Invalid function return type";break;case mt.invalid_date:r="Invalid date";break;case mt.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Cs.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case mt.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case mt.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case mt.custom:r="Invalid input";break;case mt.invalid_intersection_types:r="Intersection results could not be merged";break;case mt.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case mt.not_finite:r="Number must be finite";break;default:r=t.defaultError,Cs.assertNever(e)}return{message:r}};let Cre=Vw;function ALt(e){Cre=e}function wR(){return Cre}const yR=e=>{const{data:t,path:r,errorMaps:s,issueData:n}=e,i=[...r,...n.path||[]],o={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let a="";const l=s.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...n,path:i,message:a}},mLt=[];function kt(e,t){const r=wR(),s=yR({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Vw?void 0:Vw].filter(n=>!!n)});e.common.issues.push(s)}class No{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const s=[];for(const n of r){if(n.status==="aborted")return yr;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,r){const s=[];for(const n of r){const i=await n.key,o=await n.value;s.push({key:i,value:o})}return No.mergeObjectSync(t,s)}static mergeObjectSync(t,r){const s={};for(const n of r){const{key:i,value:o}=n;if(i.status==="aborted"||o.status==="aborted")return yr;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[i.value]=o.value)}return{status:t.value,value:s}}}const yr=Object.freeze({status:"aborted"}),U0=e=>({status:"dirty",value:e}),Ca=e=>({status:"valid",value:e}),d7=e=>e.status==="aborted",h7=e=>e.status==="dirty",Ax=e=>e.status==="valid",mx=e=>typeof Promise<"u"&&e instanceof Promise;function bR(e,t,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function wre(e,t,r,s,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var qt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(qt||(qt={}));var T1,D1;class jh{constructor(t,r,s,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const LQ=(e,t)=>{if(Ax(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new jl(e.common.issues);return this._error=r,this._error}}};function zr(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:s,description:n}=e;if(t&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(o,a)=>{var l,c;const{message:u}=e;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??s)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??r)!==null&&c!==void 0?c:a.defaultError}},description:n}}class Xr{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return $f(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:$f(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new No,ctx:{common:t.parent.common,data:t.data,parsedType:$f(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(mx(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const s=this.safeParse(t,r);if(s.success)return s.data;throw s.error}safeParse(t,r){var s;const n={common:{issues:[],async:(s=r==null?void 0:r.async)!==null&&s!==void 0?s:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$f(t)},i=this._parseSync({data:t,path:n.path,parent:n});return LQ(n,i)}async parseAsync(t,r){const s=await this.safeParseAsync(t,r);if(s.success)return s.data;throw s.error}async safeParseAsync(t,r){const s={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$f(t)},n=this._parse({data:t,path:s.path,parent:s}),i=await(mx(n)?n:Promise.resolve(n));return LQ(s,i)}refine(t,r){const s=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,i)=>{const o=t(n),a=()=>i.addIssue({code:mt.custom,...s(n)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,r){return this._refinement((s,n)=>t(s)?!0:(n.addIssue(typeof r=="function"?r(s,n):r),!1))}_refinement(t){return new ud({schema:this,typeName:Cr.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Lh.create(this,this._def)}nullable(){return FA.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ed.create(this,this._def)}promise(){return Qw.create(this,this._def)}or(t){return yx.create([this,t],this._def)}and(t){return bx.create(this,t,this._def)}transform(t){return new ud({...zr(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Fx({...zr(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new Q6({typeName:Cr.ZodBranded,type:this,...zr(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Rx({...zr(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return M3.create(this,t)}readonly(){return Tx.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const vLt=/^c[^\s-]{8,}$/i,CLt=/^[0-9a-z]+$/,wLt=/^[0-9A-HJKMNP-TV-Z]{26}$/,yLt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,bLt=/^[a-z0-9_-]{21}$/i,SLt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,xLt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ELt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let VI;const PLt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,FLt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,RLt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yre="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",TLt=new RegExp(`^${yre}$`);function bre(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function DLt(e){return new RegExp(`^${bre(e)}$`)}function Sre(e){let t=`${yre}T${bre(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function MLt(e,t){return!!((t==="v4"||!t)&&PLt.test(e)||(t==="v6"||!t)&&FLt.test(e))}class Uu extends Xr{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ot.string){const i=this._getOrReturnCtx(t);return kt(i,{code:mt.invalid_type,expected:Ot.string,received:i.parsedType}),yr}const s=new No;let n;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="max")t.data.length>i.value&&(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,a=t.data.length<i.value;(o||a)&&(n=this._getOrReturnCtx(t,n),o?kt(n,{code:mt.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&kt(n,{code:mt.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),s.dirty())}else if(i.kind==="email")xLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"email",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")VI||(VI=new RegExp(ELt,"u")),VI.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"emoji",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")yLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"uuid",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")bLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"nanoid",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid")vLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"cuid",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid2")CLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"cuid2",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")wLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"ulid",code:mt.invalid_string,message:i.message}),s.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),kt(n,{validation:"url",code:mt.invalid_string,message:i.message}),s.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"regex",code:mt.invalid_string,message:i.message}),s.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),s.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:{startsWith:i.value},message:i.message}),s.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:{endsWith:i.value},message:i.message}),s.dirty()):i.kind==="datetime"?Sre(i).test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?TLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?DLt(i).test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?SLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"duration",code:mt.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?MLt(t.data,i.version)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"ip",code:mt.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?RLt.test(t.data)||(n=this._getOrReturnCtx(t,n),kt(n,{validation:"base64",code:mt.invalid_string,message:i.message}),s.dirty()):Cs.assertNever(i);return{status:s.value,value:t.data}}_regex(t,r,s){return this.refinement(n=>t.test(n),{validation:r,code:mt.invalid_string,...qt.errToObj(s)})}_addCheck(t){return new Uu({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...qt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...qt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...qt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...qt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...qt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...qt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...qt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...qt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...qt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...qt.errToObj(t)})}datetime(t){var r,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...qt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...qt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...qt.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...qt.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...qt.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...qt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...qt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...qt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...qt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...qt.errToObj(r)})}nonempty(t){return this.min(1,qt.errToObj(t))}trim(){return new Uu({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Uu({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Uu({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Uu.create=e=>{var t;return new Uu({checks:[],typeName:Cr.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...zr(e)})};function ILt(e,t){const r=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=r>s?r:s,i=parseInt(e.toFixed(n).replace(".","")),o=parseInt(t.toFixed(n).replace(".",""));return i%o/Math.pow(10,n)}class xA extends Xr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ot.number){const i=this._getOrReturnCtx(t);return kt(i,{code:mt.invalid_type,expected:Ot.number,received:i.parsedType}),yr}let s;const n=new No;for(const i of this._def.checks)i.kind==="int"?Cs.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?ILt(t.data,i.value)!==0&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.not_finite,message:i.message}),n.dirty()):Cs.assertNever(i);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,qt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,qt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,qt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,qt.toString(r))}setLimit(t,r,s,n){return new xA({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:qt.toString(n)}]})}_addCheck(t){return new xA({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:qt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:qt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:qt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:qt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:qt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:qt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:qt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:qt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:qt.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Cs.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(r)&&Number.isFinite(t)}}xA.create=e=>new xA({checks:[],typeName:Cr.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...zr(e)});class EA extends Xr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Ot.bigint){const i=this._getOrReturnCtx(t);return kt(i,{code:mt.invalid_type,expected:Ot.bigint,received:i.parsedType}),yr}let s;const n=new No;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),kt(s,{code:mt.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):Cs.assertNever(i);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,qt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,qt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,qt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,qt.toString(r))}setLimit(t,r,s,n){return new EA({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:s,message:qt.toString(n)}]})}_addCheck(t){return new EA({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:qt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:qt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:qt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:qt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:qt.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}EA.create=e=>{var t;return new EA({checks:[],typeName:Cr.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...zr(e)})};class vx extends Xr{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ot.boolean){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.boolean,received:s.parsedType}),yr}return Ca(t.data)}}vx.create=e=>new vx({typeName:Cr.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...zr(e)});class kv extends Xr{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ot.date){const i=this._getOrReturnCtx(t);return kt(i,{code:mt.invalid_type,expected:Ot.date,received:i.parsedType}),yr}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return kt(i,{code:mt.invalid_date}),yr}const s=new No;let n;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),s.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(n=this._getOrReturnCtx(t,n),kt(n,{code:mt.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),s.dirty()):Cs.assertNever(i);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(t){return new kv({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:qt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:qt.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}kv.create=e=>new kv({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Cr.ZodDate,...zr(e)});class SR extends Xr{_parse(t){if(this._getType(t)!==Ot.symbol){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.symbol,received:s.parsedType}),yr}return Ca(t.data)}}SR.create=e=>new SR({typeName:Cr.ZodSymbol,...zr(e)});class Cx extends Xr{_parse(t){if(this._getType(t)!==Ot.undefined){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.undefined,received:s.parsedType}),yr}return Ca(t.data)}}Cx.create=e=>new Cx({typeName:Cr.ZodUndefined,...zr(e)});class wx extends Xr{_parse(t){if(this._getType(t)!==Ot.null){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.null,received:s.parsedType}),yr}return Ca(t.data)}}wx.create=e=>new wx({typeName:Cr.ZodNull,...zr(e)});class zw extends Xr{constructor(){super(...arguments),this._any=!0}_parse(t){return Ca(t.data)}}zw.create=e=>new zw({typeName:Cr.ZodAny,...zr(e)});class pv extends Xr{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ca(t.data)}}pv.create=e=>new pv({typeName:Cr.ZodUnknown,...zr(e)});class bg extends Xr{_parse(t){const r=this._getOrReturnCtx(t);return kt(r,{code:mt.invalid_type,expected:Ot.never,received:r.parsedType}),yr}}bg.create=e=>new bg({typeName:Cr.ZodNever,...zr(e)});class xR extends Xr{_parse(t){if(this._getType(t)!==Ot.undefined){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.void,received:s.parsedType}),yr}return Ca(t.data)}}xR.create=e=>new xR({typeName:Cr.ZodVoid,...zr(e)});class ed extends Xr{_parse(t){const{ctx:r,status:s}=this._processInputParams(t),n=this._def;if(r.parsedType!==Ot.array)return kt(r,{code:mt.invalid_type,expected:Ot.array,received:r.parsedType}),yr;if(n.exactLength!==null){const o=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(o||a)&&(kt(r,{code:o?mt.too_big:mt.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(kt(r,{code:mt.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(kt(r,{code:mt.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>n.type._parseAsync(new jh(r,o,r.path,a)))).then(o=>No.mergeArray(s,o));const i=[...r.data].map((o,a)=>n.type._parseSync(new jh(r,o,r.path,a)));return No.mergeArray(s,i)}get element(){return this._def.type}min(t,r){return new ed({...this._def,minLength:{value:t,message:qt.toString(r)}})}max(t,r){return new ed({...this._def,maxLength:{value:t,message:qt.toString(r)}})}length(t,r){return new ed({...this._def,exactLength:{value:t,message:qt.toString(r)}})}nonempty(t){return this.min(1,t)}}ed.create=(e,t)=>new ed({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...zr(t)});function G0(e){if(e instanceof Rn){const t={};for(const r in e.shape){const s=e.shape[r];t[r]=Lh.create(G0(s))}return new Rn({...e._def,shape:()=>t})}else return e instanceof ed?new ed({...e._def,type:G0(e.element)}):e instanceof Lh?Lh.create(G0(e.unwrap())):e instanceof FA?FA.create(G0(e.unwrap())):e instanceof Kh?Kh.create(e.items.map(t=>G0(t))):e}class Rn extends Xr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Cs.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Ot.object){const c=this._getOrReturnCtx(t);return kt(c,{code:mt.invalid_type,expected:Ot.object,received:c.parsedType}),yr}const{status:s,ctx:n}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof bg&&this._def.unknownKeys==="strip"))for(const c in n.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const u=i[c],d=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new jh(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof bg){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict")a.length>0&&(kt(n,{code:mt.unrecognized_keys,keys:a}),s.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new jh(n,d,n.path,u)),alwaysSet:u in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,g=await u.value;c.push({key:d,value:g,alwaysSet:u.alwaysSet})}return c}).then(c=>No.mergeObjectSync(s,c)):No.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(t){return qt.errToObj,new Rn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,s)=>{var n,i,o,a;const l=(o=(i=(n=this._def).errorMap)===null||i===void 0?void 0:i.call(n,r,s).message)!==null&&o!==void 0?o:s.defaultError;return r.code==="unrecognized_keys"?{message:(a=qt.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Rn({...this._def,unknownKeys:"strip"})}passthrough(){return new Rn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Cr.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Rn({...this._def,catchall:t})}pick(t){const r={};return Cs.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new Rn({...this._def,shape:()=>r})}omit(t){const r={};return Cs.objectKeys(this.shape).forEach(s=>{t[s]||(r[s]=this.shape[s])}),new Rn({...this._def,shape:()=>r})}deepPartial(){return G0(this)}partial(t){const r={};return Cs.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];t&&!t[s]?r[s]=n:r[s]=n.optional()}),new Rn({...this._def,shape:()=>r})}required(t){const r={};return Cs.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])r[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof Lh;)i=i._def.innerType;r[s]=i}}),new Rn({...this._def,shape:()=>r})}keyof(){return xre(Cs.objectKeys(this.shape))}}Rn.create=(e,t)=>new Rn({shape:()=>e,unknownKeys:"strip",catchall:bg.create(),typeName:Cr.ZodObject,...zr(t)});Rn.strictCreate=(e,t)=>new Rn({shape:()=>e,unknownKeys:"strict",catchall:bg.create(),typeName:Cr.ZodObject,...zr(t)});Rn.lazycreate=(e,t)=>new Rn({shape:e,unknownKeys:"strip",catchall:bg.create(),typeName:Cr.ZodObject,...zr(t)});class yx extends Xr{_parse(t){const{ctx:r}=this._processInputParams(t),s=this._def.options;function n(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new jl(a.ctx.common.issues));return kt(r,{code:mt.invalid_union,unionErrors:o}),yr}if(r.common.async)return Promise.all(s.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(n);{let i;const o=[];for(const l of s){const c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(l=>new jl(l));return kt(r,{code:mt.invalid_union,unionErrors:a}),yr}}get options(){return this._def.options}}yx.create=(e,t)=>new yx({options:e,typeName:Cr.ZodUnion,...zr(t)});const Zp=e=>e instanceof xx?Zp(e.schema):e instanceof ud?Zp(e.innerType()):e instanceof Ex?[e.value]:e instanceof PA?e.options:e instanceof Px?Cs.objectValues(e.enum):e instanceof Fx?Zp(e._def.innerType):e instanceof Cx?[void 0]:e instanceof wx?[null]:e instanceof Lh?[void 0,...Zp(e.unwrap())]:e instanceof FA?[null,...Zp(e.unwrap())]:e instanceof Q6||e instanceof Tx?Zp(e.unwrap()):e instanceof Rx?Zp(e._def.innerType):[];class wD extends Xr{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ot.object)return kt(r,{code:mt.invalid_type,expected:Ot.object,received:r.parsedType}),yr;const s=this.discriminator,n=r.data[s],i=this.optionsMap.get(n);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(kt(r,{code:mt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),yr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,s){const n=new Map;for(const i of r){const o=Zp(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(n.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,i)}}return new wD({typeName:Cr.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...zr(s)})}}function p7(e,t){const r=$f(e),s=$f(t);if(e===t)return{valid:!0,data:e};if(r===Ot.object&&s===Ot.object){const n=Cs.objectKeys(t),i=Cs.objectKeys(e).filter(a=>n.indexOf(a)!==-1),o={...e,...t};for(const a of i){const l=p7(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===Ot.array&&s===Ot.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let i=0;i<e.length;i++){const o=e[i],a=t[i],l=p7(o,a);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===Ot.date&&s===Ot.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class bx extends Xr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=(i,o)=>{if(d7(i)||d7(o))return yr;const a=p7(i.value,o.value);return a.valid?((h7(i)||h7(o))&&r.dirty(),{status:r.value,value:a.data}):(kt(s,{code:mt.invalid_intersection_types}),yr)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,o])=>n(i,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}bx.create=(e,t,r)=>new bx({left:e,right:t,typeName:Cr.ZodIntersection,...zr(r)});class Kh extends Xr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ot.array)return kt(s,{code:mt.invalid_type,expected:Ot.array,received:s.parsedType}),yr;if(s.data.length<this._def.items.length)return kt(s,{code:mt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),yr;!this._def.rest&&s.data.length>this._def.items.length&&(kt(s,{code:mt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...s.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new jh(s,o,s.path,a)):null}).filter(o=>!!o);return s.common.async?Promise.all(i).then(o=>No.mergeArray(r,o)):No.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new Kh({...this._def,rest:t})}}Kh.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Kh({items:e,typeName:Cr.ZodTuple,rest:null,...zr(t)})};class Sx extends Xr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ot.object)return kt(s,{code:mt.invalid_type,expected:Ot.object,received:s.parsedType}),yr;const n=[],i=this._def.keyType,o=this._def.valueType;for(const a in s.data)n.push({key:i._parse(new jh(s,a,s.path,a)),value:o._parse(new jh(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?No.mergeObjectAsync(r,n):No.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,s){return r instanceof Xr?new Sx({keyType:t,valueType:r,typeName:Cr.ZodRecord,...zr(s)}):new Sx({keyType:Uu.create(),valueType:t,typeName:Cr.ZodRecord,...zr(r)})}}class ER extends Xr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ot.map)return kt(s,{code:mt.invalid_type,expected:Ot.map,received:s.parsedType}),yr;const n=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([a,l],c)=>({key:n._parse(new jh(s,a,s.path,[c,"key"])),value:i._parse(new jh(s,l,s.path,[c,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return yr;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(c.value,u.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return yr;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(c.value,u.value)}return{status:r.value,value:a}}}}ER.create=(e,t,r)=>new ER({valueType:t,keyType:e,typeName:Cr.ZodMap,...zr(r)});class Bv extends Xr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.parsedType!==Ot.set)return kt(s,{code:mt.invalid_type,expected:Ot.set,received:s.parsedType}),yr;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(kt(s,{code:mt.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(kt(s,{code:mt.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return yr;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}const a=[...s.data.values()].map((l,c)=>i._parse(new jh(s,l,s.path,c)));return s.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,r){return new Bv({...this._def,minSize:{value:t,message:qt.toString(r)}})}max(t,r){return new Bv({...this._def,maxSize:{value:t,message:qt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Bv.create=(e,t)=>new Bv({valueType:e,minSize:null,maxSize:null,typeName:Cr.ZodSet,...zr(t)});class lw extends Xr{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ot.function)return kt(r,{code:mt.invalid_type,expected:Ot.function,received:r.parsedType}),yr;function s(a,l){return yR({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wR(),Vw].filter(c=>!!c),issueData:{code:mt.invalid_arguments,argumentsError:l}})}function n(a,l){return yR({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wR(),Vw].filter(c=>!!c),issueData:{code:mt.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Qw){const a=this;return Ca(async function(...l){const c=new jl([]),u=await a._def.args.parseAsync(l,i).catch(A=>{throw c.addIssue(s(l,A)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,i).catch(A=>{throw c.addIssue(n(d,A)),c})})}else{const a=this;return Ca(function(...l){const c=a._def.args.safeParse(l,i);if(!c.success)throw new jl([s(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,i);if(!d.success)throw new jl([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new lw({...this._def,args:Kh.create(t).rest(pv.create())})}returns(t){return new lw({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,s){return new lw({args:t||Kh.create([]).rest(pv.create()),returns:r||pv.create(),typeName:Cr.ZodFunction,...zr(s)})}}class xx extends Xr{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}xx.create=(e,t)=>new xx({getter:e,typeName:Cr.ZodLazy,...zr(t)});class Ex extends Xr{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return kt(r,{received:r.data,code:mt.invalid_literal,expected:this._def.value}),yr}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ex.create=(e,t)=>new Ex({value:e,typeName:Cr.ZodLiteral,...zr(t)});function xre(e,t){return new PA({values:e,typeName:Cr.ZodEnum,...zr(t)})}class PA extends Xr{constructor(){super(...arguments),T1.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),s=this._def.values;return kt(r,{expected:Cs.joinValues(s),received:r.parsedType,code:mt.invalid_type}),yr}if(bR(this,T1)||wre(this,T1,new Set(this._def.values)),!bR(this,T1).has(t.data)){const r=this._getOrReturnCtx(t),s=this._def.values;return kt(r,{received:r.data,code:mt.invalid_enum_value,options:s}),yr}return Ca(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return PA.create(t,{...this._def,...r})}exclude(t,r=this._def){return PA.create(this.options.filter(s=>!t.includes(s)),{...this._def,...r})}}T1=new WeakMap;PA.create=xre;class Px extends Xr{constructor(){super(...arguments),D1.set(this,void 0)}_parse(t){const r=Cs.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==Ot.string&&s.parsedType!==Ot.number){const n=Cs.objectValues(r);return kt(s,{expected:Cs.joinValues(n),received:s.parsedType,code:mt.invalid_type}),yr}if(bR(this,D1)||wre(this,D1,new Set(Cs.getValidEnumValues(this._def.values))),!bR(this,D1).has(t.data)){const n=Cs.objectValues(r);return kt(s,{received:s.data,code:mt.invalid_enum_value,options:n}),yr}return Ca(t.data)}get enum(){return this._def.values}}D1=new WeakMap;Px.create=(e,t)=>new Px({values:e,typeName:Cr.ZodNativeEnum,...zr(t)});class Qw extends Xr{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ot.promise&&r.common.async===!1)return kt(r,{code:mt.invalid_type,expected:Ot.promise,received:r.parsedType}),yr;const s=r.parsedType===Ot.promise?r.data:Promise.resolve(r.data);return Ca(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Qw.create=(e,t)=>new Qw({type:e,typeName:Cr.ZodPromise,...zr(t)});class ud extends Xr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Cr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:s}=this._processInputParams(t),n=this._def.effect||null,i={addIssue:o=>{kt(s,o),o.fatal?r.abort():r.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const o=n.transform(s.data,i);if(s.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return yr;const l=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return l.status==="aborted"?yr:l.status==="dirty"||r.value==="dirty"?U0(l.value):l});{if(r.value==="aborted")return yr;const a=this._def.schema._parseSync({data:o,path:s.path,parent:s});return a.status==="aborted"?yr:a.status==="dirty"||r.value==="dirty"?U0(a.value):a}}if(n.type==="refinement"){const o=a=>{const l=n.refinement(a,i);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?yr:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?yr:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Ax(o))return o;const a=n.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>Ax(o)?Promise.resolve(n.transform(o.value,i)).then(a=>({status:r.value,value:a})):o);Cs.assertNever(n)}}ud.create=(e,t,r)=>new ud({schema:e,typeName:Cr.ZodEffects,effect:t,...zr(r)});ud.createWithPreprocess=(e,t,r)=>new ud({schema:t,effect:{type:"preprocess",transform:e},typeName:Cr.ZodEffects,...zr(r)});class Lh extends Xr{_parse(t){return this._getType(t)===Ot.undefined?Ca(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Lh.create=(e,t)=>new Lh({innerType:e,typeName:Cr.ZodOptional,...zr(t)});class FA extends Xr{_parse(t){return this._getType(t)===Ot.null?Ca(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}FA.create=(e,t)=>new FA({innerType:e,typeName:Cr.ZodNullable,...zr(t)});class Fx extends Xr{_parse(t){const{ctx:r}=this._processInputParams(t);let s=r.data;return r.parsedType===Ot.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Fx.create=(e,t)=>new Fx({innerType:e,typeName:Cr.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...zr(t)});class Rx extends Xr{_parse(t){const{ctx:r}=this._processInputParams(t),s={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return mx(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new jl(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new jl(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Rx.create=(e,t)=>new Rx({innerType:e,typeName:Cr.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...zr(t)});class PR extends Xr{_parse(t){if(this._getType(t)!==Ot.nan){const s=this._getOrReturnCtx(t);return kt(s,{code:mt.invalid_type,expected:Ot.nan,received:s.parsedType}),yr}return{status:"valid",value:t.data}}}PR.create=e=>new PR({typeName:Cr.ZodNaN,...zr(e)});const kLt=Symbol("zod_brand");class Q6 extends Xr{_parse(t){const{ctx:r}=this._processInputParams(t),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}}class M3 extends Xr{_parse(t){const{status:r,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?yr:i.status==="dirty"?(r.dirty(),U0(i.value)):this._def.out._parseAsync({data:i.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?yr:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,r){return new M3({in:t,out:r,typeName:Cr.ZodPipeline})}}class Tx extends Xr{_parse(t){const r=this._def.innerType._parse(t),s=n=>(Ax(n)&&(n.value=Object.freeze(n.value)),n);return mx(r)?r.then(n=>s(n)):s(r)}unwrap(){return this._def.innerType}}Tx.create=(e,t)=>new Tx({innerType:e,typeName:Cr.ZodReadonly,...zr(t)});function Ere(e,t={},r){return e?zw.create().superRefine((s,n)=>{var i,o;if(!e(s)){const a=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,l=(o=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...c,fatal:l})}}):zw.create()}const BLt={object:Rn.lazycreate};var Cr;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Cr||(Cr={}));const LLt=(e,t={message:`Input not instance of ${e.name}`})=>Ere(r=>r instanceof e,t),Pre=Uu.create,Fre=xA.create,HLt=PR.create,GLt=EA.create,Rre=vx.create,OLt=kv.create,NLt=SR.create,_Lt=Cx.create,VLt=wx.create,zLt=zw.create,QLt=pv.create,ULt=bg.create,WLt=xR.create,jLt=ed.create,KLt=Rn.create,YLt=Rn.strictCreate,ZLt=yx.create,XLt=wD.create,$Lt=bx.create,JLt=Kh.create,qLt=Sx.create,e5t=ER.create,t5t=Bv.create,r5t=lw.create,s5t=xx.create,n5t=Ex.create,i5t=PA.create,o5t=Px.create,a5t=Qw.create,HQ=ud.create,l5t=Lh.create,c5t=FA.create,u5t=ud.createWithPreprocess,d5t=M3.create,h5t=()=>Pre().optional(),p5t=()=>Fre().optional(),g5t=()=>Rre().optional(),f5t={string:e=>Uu.create({...e,coerce:!0}),number:e=>xA.create({...e,coerce:!0}),boolean:e=>vx.create({...e,coerce:!0}),bigint:e=>EA.create({...e,coerce:!0}),date:e=>kv.create({...e,coerce:!0})},A5t=yr;var us=Object.freeze({__proto__:null,defaultErrorMap:Vw,setErrorMap:ALt,getErrorMap:wR,makeIssue:yR,EMPTY_PATH:mLt,addIssueToContext:kt,ParseStatus:No,INVALID:yr,DIRTY:U0,OK:Ca,isAborted:d7,isDirty:h7,isValid:Ax,isAsync:mx,get util(){return Cs},get objectUtil(){return u7},ZodParsedType:Ot,getParsedType:$f,ZodType:Xr,datetimeRegex:Sre,ZodString:Uu,ZodNumber:xA,ZodBigInt:EA,ZodBoolean:vx,ZodDate:kv,ZodSymbol:SR,ZodUndefined:Cx,ZodNull:wx,ZodAny:zw,ZodUnknown:pv,ZodNever:bg,ZodVoid:xR,ZodArray:ed,ZodObject:Rn,ZodUnion:yx,ZodDiscriminatedUnion:wD,ZodIntersection:bx,ZodTuple:Kh,ZodRecord:Sx,ZodMap:ER,ZodSet:Bv,ZodFunction:lw,ZodLazy:xx,ZodLiteral:Ex,ZodEnum:PA,ZodNativeEnum:Px,ZodPromise:Qw,ZodEffects:ud,ZodTransformer:ud,ZodOptional:Lh,ZodNullable:FA,ZodDefault:Fx,ZodCatch:Rx,ZodNaN:PR,BRAND:kLt,ZodBranded:Q6,ZodPipeline:M3,ZodReadonly:Tx,custom:Ere,Schema:Xr,ZodSchema:Xr,late:BLt,get ZodFirstPartyTypeKind(){return Cr},coerce:f5t,any:zLt,array:jLt,bigint:GLt,boolean:Rre,date:OLt,discriminatedUnion:XLt,effect:HQ,enum:i5t,function:r5t,instanceof:LLt,intersection:$Lt,lazy:s5t,literal:n5t,map:e5t,nan:HLt,nativeEnum:o5t,never:ULt,null:VLt,nullable:c5t,number:Fre,object:KLt,oboolean:g5t,onumber:p5t,optional:l5t,ostring:h5t,pipeline:d5t,preprocess:u5t,promise:a5t,record:qLt,set:t5t,strictObject:YLt,string:Pre,symbol:NLt,transformer:HQ,tuple:JLt,undefined:_Lt,union:ZLt,unknown:QLt,void:WLt,NEVER:A5t,ZodIssueCode:mt,quotelessJson:fLt,ZodError:jl}),m5t=Object.defineProperty,v5t=(e,t,r)=>t in e?m5t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,r2=(e,t,r)=>v5t(e,typeof t!="symbol"?t+"":t,r);function Tre(e){throw new Error("Unexpected object: "+e)}function U6(e){if(!e||typeof e!="object")return!1;const t=e;if(!("type"in t))return!1;switch(t.type){case"Json":return typeof t.keyLength=="number"&&t.data!==void 0&&typeof t.data=="object";case"JsonPartitioned":return typeof t.partitionKeyLength=="number"&&t.parts!==void 0&&typeof t.parts=="object";case"BinaryPartitioned":return typeof t.partitionKeyLength=="number"&&t.parts!==void 0&&typeof t.parts=="object";default:return!1}}function C5t(e,t){if(e!==void 0)switch(e.type){case"Json":return e;case"JsonPartitioned":{const r={};for(const[s,n]of Object.entries(e.parts))r[s]=t(n);return{...e,parts:r}}case"BinaryPartitioned":{const r={};for(const[s,n]of Object.entries(e.parts))r[s]={index:t(n.index),values:t(n.values)};return{...e,parts:r}}}}function W6(e){if(!e||typeof e!="object")return!1;const t=e;if(!("type"in t))return!1;switch(t.type){case"Json":return typeof t.keyLength=="number"&&Array.isArray(t.data);case"JsonPartitioned":return typeof t.partitionKeyLength=="number"&&Array.isArray(t.parts);case"BinaryPartitioned":return typeof t.partitionKeyLength=="number"&&Array.isArray(t.parts);default:return!1}}function w5t(e){return W6(e)?e.type==="JsonPartitioned"||e.type==="BinaryPartitioned":!1}function y5t(e){switch(e.type){case"Json":{const t=Object.entries(e.data).map(([r,s])=>({key:JSON.parse(r),value:s}));return{type:"Json",keyLength:e.keyLength,data:t}}case"JsonPartitioned":{const t=Object.entries(e.parts).map(([r,s])=>({key:JSON.parse(r),value:s}));return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:t}}case"BinaryPartitioned":{const t=Object.entries(e.parts).map(([r,s])=>({key:JSON.parse(r),value:s}));return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:t}}}}function b5t(e){switch(e.type){case"Json":{const t={};for(const r of e.data)t[JSON.stringify(r.key)]=r.value;return{type:"Json",keyLength:e.keyLength,data:t}}case"JsonPartitioned":{const t={};for(const r of e.parts)t[JSON.stringify(r.key)]=r.value;return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:t}}case"BinaryPartitioned":{const t={};for(const r of e.parts)t[JSON.stringify(r.key)]=r.value;return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:t}}}}function RA(e){const{type:t,name:r,domain:s}=e;return{type:t,name:r,...s&&{domain:s}}}function S5t(e){return e.map(RA)}function x5t(e){return vy(RA(e))}function E5t(e,t){if(e===void 0)return t===void 0;if(t===void 0)return!0;for(const r in t)if(e[r]!==t[r])return!1;return!0}function P5t(e,t){return e.name===t.name&&E5t(e.domain,t.domain)}function F5t(e,t){return{...e,src:H2(e.src,t)}}function H2(e,t){switch(e.type){case"column":return{type:"column",column:t(e.column)};case"slicedColumn":return{type:"slicedColumn",column:t(e.column),newId:e.newId,axisFilters:e.axisFilters};case"inlineColumn":return e;case"inner":case"full":return{type:e.type,entries:e.entries.map(r=>H2(r,t))};case"outer":return{type:"outer",primary:H2(e.primary,t),secondary:e.secondary.map(r=>H2(r,t))};default:Tre(e)}}function R5t(e){return vy(e)}function GQ(e){return vy(RA(e))}function OQ(e,t){return JSON.stringify([e,t])}class NQ{constructor(t){r2(this,"domains",new Map),r2(this,"axes",new Map),r2(this,"domainPacks",[]),r2(this,"domainPackToAnchor",new Map),this.anchors=t;const r=Object.entries(t);r.sort((s,n)=>s[0].localeCompare(n[0]));for(const[s,n]of r){for(let i=0;i<n.axesSpec.length;i++){const o=n.axesSpec[i],a=GQ(o);this.axes.set(a,{anchor:s,idx:i})}if(n.domain!==void 0){const i=Object.entries(n.domain);i.sort((o,a)=>o[0].localeCompare(a[0])),this.domainPackToAnchor.set(JSON.stringify(i),s),this.domainPacks.push(i.map(([o])=>o));for(const[o,a]of i){const l=OQ(o,a);this.domains.set(l,s)}}}}derive(t,r){const s={name:t.name,axes:[]};let n;if(t.domain!==void 0)e:for(const o of this.domainPacks){const a=[];for(const c of o){const u=t.domain[c];if(u!==void 0)a.push([c,u]);else break e}const l=this.domainPackToAnchor.get(JSON.stringify(a));if(l!==void 0){s.domainAnchor=l,n=new Set(o);break}}for(const[o,a]of Object.entries(t.domain??{})){if(n!==void 0&&n.has(o))continue;const l=OQ(o,a),c=this.domains.get(l);s.domain??(s.domain={}),s.domain[o]=c?{anchor:c}:a}if(s.axes=t.axesSpec.map(o=>{const a=GQ(o),l=this.axes.get(a);return l===void 0?RA(o):l}),!r||r.length===0)return s;const i=[];for(const o of r){const[a,l]=o;if(typeof a=="number"){if(a<0||a>=t.axesSpec.length)throw new Error(`Axis index ${a} is out of bounds (0-${t.axesSpec.length-1})`);i.push([a,l])}else{const c=t.axesSpec.findIndex(u=>u.name===a);if(c===-1)throw new Error(`Axis with name "${a}" not found in the column specification`);i.push([c,l])}}return i.sort((o,a)=>o[0]-a[0]),{source:s,axisFilters:i}}deriveS(t,r){return R5t(this.derive(t,r))}}function _Q(e,t,r){const s={...t},n=(r==null?void 0:r.ignoreMissingDomains)??!1;if(s.domainAnchor!==void 0){const i=e[s.domainAnchor];if(!i)throw new Error(`Anchor "${s.domainAnchor}" not found`);const o=i.domain||{};s.domain={...o,...s.domain},delete s.domainAnchor}if(s.domain){const i={};for(const[o,a]of Object.entries(s.domain))if(typeof a=="string")i[o]=a;else{const l=e[a.anchor];if(!l)throw new Error(`Anchor "${a.anchor}" not found for domain key "${o}"`);if(!l.domain||l.domain[o]===void 0){if(!n)throw new Error(`Domain key "${o}" not found in anchor "${a.anchor}"`);continue}i[o]=l.domain[o]}s.domain=i}return s.axes&&(s.axes=s.axes.map(i=>T5t(e,i))),s}function T5t(e,t){if(!D5t(t))return t;const r=t.anchor,s=e[r];if(!s)throw new Error(`Anchor "${r}" not found for axis reference`);if("idx"in t){if(t.idx<0||t.idx>=s.axesSpec.length)throw new Error(`Axis index ${t.idx} out of bounds for anchor "${r}"`);return s.axesSpec[t.idx]}else if("name"in t){const n=s.axesSpec.filter(i=>i.name===t.name);if(n.length>1)throw new Error(`Multiple axes with name "${t.name}" found in anchor "${r}"`);if(n.length===0)throw new Error(`Axis with name "${t.name}" not found in anchor "${r}"`);return n[0]}else if("id"in t){const n=s.axesSpec.filter(i=>P5t(t.id,RA(i)));if(n.length>1)throw new Error(`Multiple matching axes found for matcher in anchor "${r}"`);if(n.length===0)throw new Error(`No matching axis found for matcher in anchor "${r}"`);return n[0]}throw new Error("Unsupported axis reference type")}function D5t(e){return typeof e=="object"&&"anchor"in e}function oA(e){return e.kind==="PColumn"}function j6(e){return oA(e.spec)}function M5t(e){if(!j6(e))throw new Error(`not a PColumn (kind = ${e.spec.kind})`);return e}function K6(e,t){return e===void 0?void 0:{...e,data:t(e.data)}}function I5t(e){const t=new Map,r=s=>{switch(s.type){case"column":t.set(s.column.id,s.column);return;case"slicedColumn":t.set(s.column.id,s.column);return;case"inlineColumn":return;case"full":case"inner":for(const n of s.entries)r(n);return;case"outer":r(s.primary);for(const n of s.secondary)r(n);return;default:Tre(s)}};return r(e),[...t.values()]}function VQ(e,t){if(e.name!==void 0&&e.name!==t.name)return!1;if(e.type!==void 0){if(Array.isArray(e.type)){if(!e.type.includes(t.type))return!1}else if(e.type!==t.type)return!1}if(e.domain!==void 0){const r=t.domain||{};for(const[s,n]of Object.entries(e.domain))if(r[s]!==n)return!1}return!0}function zQ(e,t){if(t.name!==void 0&&e.name!==t.name||t.namePattern!==void 0&&!new RegExp(t.namePattern).test(e.name))return!1;if(t.type!==void 0){if(Array.isArray(t.type)){if(!t.type.includes(e.valueType))return!1}else if(t.type!==e.valueType)return!1}if(t.domain!==void 0){const r=e.domain||{};for(const[s,n]of Object.entries(t.domain))if(r[s]!==n)return!1}if(t.axes!==void 0){const r=e.axesSpec.map(RA);if(t.partialAxesMatch){for(const s of t.axes)if(!r.some(n=>VQ(s,n)))return!1}else{if(r.length!==t.axes.length)return!1;for(let s=0;s<t.axes.length;s++)if(!VQ(t.axes[s],r[s]))return!1}}if(t.annotations!==void 0){const r=e.annotations||{};for(const[s,n]of Object.entries(t.annotations))if(r[s]!==n)return!1}if(t.annotationPatterns!==void 0){const r=e.annotations||{};for(const[s,n]of Object.entries(t.annotationPatterns)){const i=r[s];if(i===void 0||!new RegExp(n).test(i))return!1}}return!0}function Dx(e){return Array.isArray(e)?t=>e.some(r=>oA(t)&&zQ(t,r)):t=>oA(t)&&zQ(t,e)}function k5t(e){const t={kind:e.kind,name:e.name};return e.domain!==void 0&&(t.domain=e.domain),oA(e)&&(t.axesSpec=S5t(e.axesSpec)),vy(t)}us.object({__isRef:us.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:us.string().describe("Upstream block id"),name:us.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:us.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();function B5t(e){return typeof e=="object"&&e!==null&&"__isRef"in e&&e.__isRef===!0&&"blockId"in e&&"name"in e}function QQ(e,t=!0){if(t)return{...e,requireEnrichments:!0};{const{requireEnrichments:r,...s}=e;return s}}function L5t(e,t){return e.ok?{ok:!0,value:t(e.value)}:e}const H5t=24;us.string().length(H5t).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");var UQ={exports:{}};(function(e,t){t=e.exports=r,t.getSerialize=s;function r(n,i,o,a){return JSON.stringify(n,s(i,a),o)}function s(n,i){var o=[],a=[];return i==null&&(i=function(l,c){return o[0]===c?"[Circular ~]":"[Circular ~."+a.slice(0,o.indexOf(c)).join(".")+"]"}),function(l,c){if(o.length>0){var u=o.indexOf(this);~u?o.splice(u+1):o.push(this),~u?a.splice(u,1/0,l):a.push(l),~o.indexOf(c)&&(c=i.call(this,l,c))}else o.push(c);return n==null?c:n.call(this,l,c)}}})(UQ,UQ.exports);const G5t=us.object({type:us.literal("PlError"),name:us.string(),message:us.string(),fullMessage:us.string().optional(),stack:us.string().optional()}),O5t=G5t.extend({cause:us.lazy(()=>FR).optional(),errors:us.lazy(()=>FR.array()).optional()}),N5t=us.object({type:us.literal("StandardError"),name:us.string(),message:us.string(),stack:us.string().optional()}),_5t=N5t.extend({cause:us.lazy(()=>FR).optional(),errors:us.lazy(()=>FR.array()).optional()}),FR=us.union([_5t,O5t]),V5t=us.object({name:us.string(),message:us.string(),fullMessage:us.string().optional(),stack:us.string().optional()}),WQ=V5t.extend({cause:us.lazy(()=>WQ).optional(),errors:us.lazy(()=>WQ.array()).optional()});var z5t=Object.defineProperty,Q5t=(e,t,r)=>t in e?z5t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vu=(e,t,r)=>Q5t(e,typeof t!="symbol"?t+"":t,r);function zI(e){return{type:"Immediate",value:e}}function U5t(){return typeof globalThis.getPlatforma<"u"||typeof globalThis.platforma<"u"}function W5t(e){if(e&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(e);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}function j5t(){if(typeof globalThis.cfgRenderCtx<"u")return globalThis.cfgRenderCtx}function Os(){if(typeof globalThis.cfgRenderCtx<"u")return globalThis.cfgRenderCtx;throw new Error("Not in config rendering context")}function c1(e,t){const r=j5t();if(r===void 0)return!1;if(e in r.callbackRegistry)throw new Error(`Callback with key ${e} already registered.`);return r.callbackRegistry[e]=t,!0}const QI=new Map;function K5t(e,t){e in Os().callbackRegistry||(Os().callbackRegistry[e]=r=>{for(const s of QI.get(e))s(r)},QI.set(e,[])),QI.get(e).push(t)}class qa{constructor(t,r=s=>s){Vu(this,"isResolved",!1),Vu(this,"resolvedValue"),this.handle=t,this.postProcess=r,K5t(t,s=>{this.resolvedValue=r(s),this.isResolved=!0})}map(t){return new qa(this.handle,r=>t(this.postProcess(r)))}mapDefined(t){return new qa(this.handle,r=>{const s=this.postProcess(r);return s?t(s):void 0})}toJSON(){return this.isResolved?this.resolvedValue:{__awaited_futures__:[this.handle]}}}function g7(e,t){return e===void 0?void 0:t(e)}class td{constructor(t,r){this.handle=t,this.resolvePath=r}resolve(...t){const r=t.map(s=>({assertFieldType:"Input",...typeof s=="string"?{field:s}:s}));return this.resolveWithCommon({},...r)}resolveOutput(...t){const r=t.map(s=>({assertFieldType:"Output",...typeof s=="string"?{field:s}:s}));return this.resolveWithCommon({},...r)}resolveInput(...t){const r=t.map(s=>({assertFieldType:"Input",...typeof s=="string"?{field:s}:s}));return this.resolveWithCommon({},...r)}resolveAny(...t){return this.resolveWithCommon({},...t)}resolveWithCommon(t,...r){const s=[...this.resolvePath,...r.map(n=>typeof n=="string"?n:n.field)];return g7(Os().resolveWithCommon(this.handle,t,...r),n=>new td(n,s))}get resourceType(){return Os().getResourceType(this.handle)}getInputsLocked(){return Os().getInputsLocked(this.handle)}getOutputsLocked(){return Os().getOutputsLocked(this.handle)}getIsReadyOrError(){return Os().getIsReadyOrError(this.handle)}getIsFinal(){return Os().getIsFinal(this.handle)}getError(){const t=[...this.resolvePath,"error"];return g7(Os().getError(this.handle),r=>new td(r,t))}listInputFields(){return Os().listInputFields(this.handle)}listOutputFields(){return Os().listOutputFields(this.handle)}listDynamicFields(){return Os().listDynamicFields(this.handle)}getKeyValueBase64(t){return Os().getKeyValueBase64(this.handle,t)}getKeyValueAsString(t){return Os().getKeyValueAsString(this.handle,t)}getKeyValueAsJson(t){const r=this.getKeyValueAsString(t);if(r==null)throw new Error("Resource has no content.");return JSON.parse(r)}getDataBase64(){return Os().getDataBase64(this.handle)}getDataAsString(){return Os().getDataAsString(this.handle)}getDataAsJson(){const t=this.getDataAsString();if(t==null)throw new Error("Resource has no content.");return JSON.parse(t)}getPColumns(t=!1,r=""){const s=this.parsePObjectCollection(t,r);return s===void 0?void 0:Object.entries(s).map(([,n])=>{if(!j6(n))throw new Error(`not a PColumn (kind = ${n.spec.kind})`);return n})}parsePObjectCollection(t=!1,r=""){const s=Os().parsePObjectCollection(this.handle,t,r,...this.resolvePath);if(s===void 0)return;const n={};for(const[i,o]of Object.entries(s)){const a=[...this.resolvePath,i];n[i]=K6(o,l=>new td(l,a))}return n}getFileContentAsBase64(t){return new qa(Os().getBlobContentAsBase64(this.handle,t))}getFileContentAsString(t){return new qa(Os().getBlobContentAsString(this.handle,t))}getFileContentAsJson(t){return new qa(Os().getBlobContentAsString(this.handle,t)).mapDefined(r=>JSON.parse(r))}getBlobContentAsBase64(){return this.getFileContentAsBase64()}getBlobContentAsString(){return this.getFileContentAsString()}getFileHandle(){return new qa(Os().getDownloadedBlobContentHandle(this.handle))}getDownloadedBlobHandle(){return this.getFileHandle()}getRemoteFileHandle(){return new qa(Os().getOnDemandBlobContentHandle(this.handle))}getOnDemandBlobHandle(){return this.getRemoteFileHandle()}extractArchiveAndGetURL(t){return new qa(Os().extractArchiveAndGetURL(this.handle,t))}getImportProgress(){return new qa(Os().getImportProgress(this.handle))}getLastLogs(t){return new qa(Os().getLastLogs(this.handle,t))}getProgressLog(t){return new qa(Os().getProgressLog(this.handle,t))}getProgressLogWithInfo(t){return new qa(Os().getProgressLogWithInfo(this.handle,t))}getLogHandle(){return new qa(Os().getLogHandle(this.handle))}allFieldsResolved(t="Input"){switch(t){case"Input":return this.getInputsLocked()&&this.listInputFields().every(r=>this.resolve({field:r,assertFieldType:"Input"})!==void 0);case"Output":return this.getOutputsLocked()&&this.listOutputFields().every(r=>this.resolve({field:r,assertFieldType:"Output"})!==void 0)}}mapFields(t,r){const{fieldType:s,requireLocked:n,skipUnresolved:i}={fieldType:"Input",requireLocked:!0,skipUnresolved:!1,...r},o=t;if(n&&(s==="Input"&&!this.getInputsLocked()||s==="Output"&&!this.getOutputsLocked()))return;let a=(s==="Input"?this.listInputFields():s==="Output"?this.listOutputFields():this.listDynamicFields()).map(l=>[l,this.resolve({field:l,assertFieldType:s})]);return i&&(a=a.filter(l=>l[1]!==void 0)),a.map(([l,c])=>o(l,c))}}const Y5t="staging",Z5t="main",X5t="pl7.app/label",$5t="pl7.app/trace",J5t=us.object({type:us.string(),importance:us.number().optional(),id:us.string().optional(),label:us.string()}),q5t=us.array(J5t),e6t=.001,t6t="__LABEL__",jQ="__LABEL__@1";function Dre(e,t,r={}){const s=new Map,n=r.forceTraceElements!==void 0&&r.forceTraceElements.length>0?new Set(r.forceTraceElements):void 0,i=new Map,o=e.map(A=>{var w,v;const b=t(A);let S,P,F;"spec"in b&&typeof b.spec=="object"?(S=b.spec,P=b.prefixTrace,F=b.suffixTrace):S=b;const T=(w=S.annotations)==null?void 0:w[X5t],D=(v=S.annotations)==null?void 0:v[$5t],B=(D?q5t.safeParse(JSON.parse(D)).data:void 0)??[],k=[...P??[],...B,...F??[]];if(T!==void 0){const j={label:T,type:t6t,importance:-2};r.addLabelAsSuffix?k.push(j):k.splice(0,0,j)}const z=[],O=new Map;for(let j=k.length-1;j>=0;--j){const{type:_}=k[j],G=k[j].importance??0,N=(O.get(_)??0)+1;O.set(_,N);const W=`${_}@${N}`;i.set(W,(i.get(W)??0)+1),s.set(W,Math.max(s.get(W)??Number.NEGATIVE_INFINITY,G-(k.length-j)*e6t)),z.push({...k[j],fullType:W,occurrenceIndex:N})}return z.reverse(),{value:A,spec:S,label:T,fullTrace:z}}),a=[],l=[],c=[...s];c.sort(([,A],[,w])=>w-A);for(const[A]of c)A.endsWith("@1")||i.get(A)===e.length?a.push(A):l.push(A);const u=(A,w=!1)=>{const v=[];for(let b=0;b<o.length;b++){const S=o[b],P=S.fullTrace.filter(D=>A.has(D.fullType)||n&&n.has(D.type));if(P.length===0)if(w)v.push({label:"Unlabeled",value:S.value});else return;const F=P.map(D=>D.label),T=r.separator??" / ";v.push({label:F.join(T),value:S.value})}return v};if(a.length===0){if(l.length!==0)throw new Error("Non-empty secondary types list while main types list is empty.");return u(new Set(jQ),!0)}let d=0,g=-1;for(;d<a.length;){const A=new Set;r.includeNativeLabel&&A.add(jQ);for(let v=0;v<d;++v)A.add(a[v]);g>=0&&A.add(a[g]);const w=u(A);if(w!==void 0&&new Set(w.map(v=>v.label)).size===e.length)return w;g++,g>=a.length&&(d++,g=d)}return u(new Set([...a,...l]),!0)}const I3="PColumnData/",f7=I3+"ResourceMap",A7=I3+"Partitioned/ResourceMap",sS=I3+"JsonPartitioned",cw=I3+"BinaryPartitioned",Mre=I3+"Partitioned/",RR=Mre+"JsonPartitioned",nS=Mre+"BinaryPartitioned",m7=e=>{if(e.endsWith(".index"))return{baseKey:e.substring(0,e.length-6),type:"index"};if(e.endsWith(".values"))return{baseKey:e.substring(0,e.length-7),type:"values"};throw new Error(`key must ends on .index/.values for binary p-column, got: ${e}`)};function r6t(e){if(!e)return;const t=e.resourceType.name,r=e.getDataAsJson(),s=[];let n=0;switch(t){case f7:n=r.keyLength;break;case A7:n=r.partitionKeyLength+r.keyLength;break;case sS:case cw:n=r.partitionKeyLength;break;case nS:case RR:n=r.superPartitionKeyLength+r.partitionKeyLength;break}switch(t){case f7:case sS:case cw:for(let i of e.listInputFields()){t===cw&&(i=m7(i).baseKey);const o=[...JSON.parse(i)];s.push(o)}break;case A7:case nS:case RR:for(const i of e.listInputFields()){const o=[...JSON.parse(i)],a=e.resolve({field:i,assertFieldType:"Input"});if(a!==void 0)for(let l of a.listInputFields()){t===nS&&(l=m7(l).baseKey);const c=[...o,...JSON.parse(l)];s.push(c)}}break}return{data:s,keyLength:n}}function s6t(e){if(e.type!=="JsonPartitioned"&&e.type!=="BinaryPartitioned")throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${e.type}`);const{parts:t,partitionKeyLength:r}=e,s=[];for(let n=0;n<r;++n)s.push(new Set);for(const n of t){const i=n.key;if(i.length!==r)throw new Error(`Key length (${i.length}) does not match partition length (${r}) for key: ${JSON.stringify(i)}`);for(let o=0;o<r;++o)s[o].add(i[o])}return s.map(n=>Array.from(n.values()))}function n6t(e){if(e===void 0)return;if(W6(e))return s6t(e);const t=r6t(e);if(!t)return;const{data:r,keyLength:s}=t,n=[];for(let i=0;i<s;++i)n.push(new Set);for(const i of r){if(i.length!==s)throw new Error("key length does not match partition length");for(let o=0;o<s;++o)n[o].add(i[o])}return n.map(i=>Array.from(i.values()))}function v7(e,t=[]){if(e===void 0||!e.getIsReadyOrError())return;const r=e.resourceType.name,s=e.getDataAsJson();if(t.length>0&&(r===RR||r===nS))throw new Error(`Unexpected nested super-partitioned resource: ${r}`);switch(r){case f7:case A7:throw new Error(`Only data columns are supported, got: ${r}`);case sS:{if(typeof(s==null?void 0:s.partitionKeyLength)!="number")throw new Error(`Missing partitionKeyLength in metadata for ${r}`);const n=[];for(const i of e.listInputFields()){const o=e.resolve({field:i,assertFieldType:"Input"});if(o===void 0)return;const a=[...t,...JSON.parse(i)];n.push({key:a,value:o})}return{type:"JsonPartitioned",partitionKeyLength:s.partitionKeyLength,parts:n}}case cw:{if(typeof(s==null?void 0:s.partitionKeyLength)!="number")throw new Error(`Missing partitionKeyLength in metadata for ${r}`);const n=[],i=new Map;for(const o of e.listInputFields()){const a=m7(o),l=e.resolve({field:o,assertFieldType:"Input"});if(l===void 0)return;let c=i.get(a.baseKey);c||(c={},i.set(a.baseKey,c)),a.type==="index"?c.index=l:c.values=l}for(const[o,a]of i.entries()){if(!a.index||!a.values)return;const l=[...t,...JSON.parse(o)];n.push({key:l,value:{index:a.index,values:a.values}})}return{type:"BinaryPartitioned",partitionKeyLength:s.partitionKeyLength,parts:n}}case RR:{if(typeof(s==null?void 0:s.superPartitionKeyLength)!="number"||typeof(s==null?void 0:s.partitionKeyLength)!="number")throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${r}`);const n=s.superPartitionKeyLength+s.partitionKeyLength,i=[];for(const o of e.listInputFields()){const a=e.resolve({field:o,assertFieldType:"Input"});if(a===void 0)return;if(a.resourceType.name!==sS)throw new Error(`Expected ${sS} inside ${r}, but got ${a.resourceType.name}`);const l=v7(a,JSON.parse(o));if(l===void 0)return;if(l.type!=="JsonPartitioned")throw new Error(`Unexpected inner result type for ${r}: ${l.type}`);i.push(...l.parts)}return{type:"JsonPartitioned",partitionKeyLength:n,parts:i}}case nS:{if(typeof(s==null?void 0:s.superPartitionKeyLength)!="number"||typeof(s==null?void 0:s.partitionKeyLength)!="number")throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${r}`);const n=s.superPartitionKeyLength+s.partitionKeyLength,i=[];for(const o of e.listInputFields()){const a=e.resolve({field:o,assertFieldType:"Input"});if(a===void 0)return;if(a.resourceType.name!==cw)throw new Error(`Expected ${cw} inside ${r}, but got ${a.resourceType.name}`);const l=v7(a,JSON.parse(o));if(l===void 0)return;if(l.type!=="BinaryPartitioned")throw new Error(`Unexpected inner result type for ${r}: ${l.type}`);i.push(...l.parts)}return{type:"BinaryPartitioned",partitionKeyLength:n,parts:i}}default:throw new Error(`Unknown resource type: ${r}`)}}function i6t(e){if(e!==void 0){if(W6(e))return e;if(U6(e))return y5t(e);if(e instanceof td)return v7(e);throw new Error(`Unexpected input type: ${typeof e}`)}}function o6t(e,t){const r=[...t].sort((i,o)=>o[0]-i[0]);if(e.type==="JsonPartitioned"||e.type==="BinaryPartitioned"){const{partitionKeyLength:i}=e;for(const[o]of t)if(o>=i)throw new Error(`Can't filter on non-partitioned axis ${o}. Must be >= ${i}`)}else if(e.type==="Json"){const{keyLength:i}=e;for(const[o]of t)if(o>=i)throw new Error(`Can't filter on non-data axis ${o}. Must be >= ${i}`)}const s=i=>{for(const[o,a]of r)if(i[o]!==a)return!1;return!0},n=i=>{const o=[...i];for(const[a]of r)o.splice(a,1);return o};switch(e.type){case"Json":{const i=e.data.filter(o=>s(o.key)).map(o=>({key:n(o.key),value:o.value}));return{type:"Json",keyLength:e.keyLength-t.length,data:i}}case"JsonPartitioned":{const i=e.parts.filter(o=>s(o.key)).map(o=>({key:n(o.key),value:o.value}));return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength-t.length,parts:i}}case"BinaryPartitioned":{const i=e.parts.filter(o=>s(o.key)).map(o=>({key:n(o.key),value:o.value}));return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength-t.length,parts:i}}}}class a6t{constructor(t){this.columns=t}selectColumns(t){const r=typeof t=="function"?t:Dx(t);return this.columns.filter(s=>r(s.spec))}}function l6t(e){if(e)return e.map(t=>({type:`split:${x5t(t.axisId)}`,label:t.label,importance:1e6}))}function c6t(e){if(e)return e.map(t=>[t.axisIdx,t.value])}function u6t(e,t){if(!t||t.length===0)return e;const r=[...t].sort((s,n)=>s[0]-n[0]);return vy({id:e,axisFilters:r})}function KQ(e){if(!e||typeof e!="object")return!1;const t=e,r=t.domain&&typeof t.domain=="object"&&Object.values(t.domain).some(n=>typeof n=="object"&&n!==null&&"anchor"in n),s=t.axes&&Array.isArray(t.axes)&&t.axes.some(n=>typeof n=="object"&&n!==null&&"anchor"in n);return!!t.domainAnchor||r||s}function d6t(e){if(typeof e!="object"||!("axes"in e)||e.axes===void 0)return[];const t=e.axes.map((r,s)=>typeof r=="object"&&"split"in r&&r.split===!0?s:-1).filter(r=>r!==-1);if(t.length>0&&e.partialAxesMatch!==void 0)throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");return t.sort((r,s)=>r-s),t}class YQ{constructor(){Vu(this,"defaultProviderStore",[]),Vu(this,"providers",[new a6t(this.defaultProviderStore)]),Vu(this,"axisLabelProviders",[])}addColumnProvider(t){return this.providers.push(t),this}addAxisLabelProvider(t){return this.axisLabelProviders.push(t),this}addColumns(t){return this.defaultProviderStore.push(...t),this}addColumn(t){return this.defaultProviderStore.push(t),this}findLabels(t){for(const r of this.axisLabelProviders){const s=r.findLabels(t);if(s)return s}}getUniversalEntries(t,r){const{anchorCtx:s,labelOps:n,dontWaitAllData:i=!1,overrideLabelAnnotation:o=!1,exclude:a}=r??{},l={...o&&(n==null?void 0:n.includeNativeLabel)!==!1?{includeNativeLabel:!0}:{},...n??{}};let c=()=>!1;if(a){const v=(Array.isArray(a)?a:[a]).map(b=>{if(KQ(b)){if(!s)throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");return Dx(_Q(s.anchors,b,r))}else return Dx(b)});c=b=>v.some(S=>S(b))}const u=typeof t=="function"?[t]:Array.isArray(t)?t:[t],d=[],g=new Set;for(const v of u){const b=KQ(v);let S;if(b){if(!s)throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");S=_Q(s.anchors,v,r)}else S=v;const P=new Set,F=[];for(const B of this.providers){const k=B.selectColumns(S);for(const z of k){if(c(z.spec))continue;if(P.has(z.id))throw new Error(`Duplicate column id ${z.id} in provider ${B.constructor.name}`);const O=k5t(z.spec);g.has(O)||(P.add(z.id),g.add(O),F.push(z))}}if(F.length===0)continue;const T=d6t(v),D=T.length>0;for(const B of F){if(!oA(B.spec))continue;const k=B.spec;if(D){const z=i6t(B.data);if(!z){if(i)continue;return}if(!w5t(z))throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${z.type} for column ${B.id}`);const O=n6t(z),j=T[T.length-1];if(j>=z.partitionKeyLength)throw new Error(`Not enough partition keys (${z.partitionKeyLength}) for requested split axes (max index ${j}) in column ${k.name}`);const _=T.map(pe=>this.findLabels(RA(k.axesSpec[pe]))),G=[],N=(pe,X)=>{if(X>=T.length){if(G.push([...pe]),G.length>1e4)throw new Error("Too many key combinations, aborting.");return}const re=T[X];if(re>=O.length)throw new Error(`Axis index ${re} out of bounds for unique keys array (length ${O.length}) during split key generation for column ${B.id}`);const ae=O[re];if(!ae||ae.length===0){G.length=0;return}for(const $ of ae)pe.push($),N(pe,X+1),pe.pop()};if(N([],0),G.length===0)continue;const W=[...k.axesSpec],V=T.map(pe=>pe);for(let pe=T.length-1;pe>=0;pe--)W.splice(T[pe],1);const q={...k,axesSpec:W};for(const pe of G){const X=pe.map((re,ae)=>{const $=V[ae],se=RA(k.axesSpec[$]),De=_[ae],Oe=(De==null?void 0:De[re])??String(re);return{axisIdx:$,axisId:se,value:re,label:Oe}});d.push({type:"split",originalColumn:B,spec:k,adjustedSpec:q,dataEntries:z,axisFilters:X})}}else d.push({type:"direct",originalColumn:B,spec:k,adjustedSpec:k})}}if(d.length===0)return[];const A=Dre(d,v=>({spec:v.spec,suffixTrace:v.type==="split"?l6t(v.axisFilters):void 0}),l),w=[];for(const{value:v,label:b}of A){const{originalColumn:S,spec:P}=v,F=v.type==="split"?v.axisFilters:void 0,T=c6t(F);let D;s?D=s.deriveS(P,T):D=u6t(S.id,T);let B={...v.adjustedSpec};o&&(B={...B,annotations:{...B.annotations??{},"pl7.app/label":b}}),w.push({id:D,spec:B,data:()=>v.type==="split"?b5t(o6t(v.dataEntries,T)):v.originalColumn.data,label:b})}return w}getColumns(t,r){const s=this.getUniversalEntries(t,{overrideLabelAnnotation:!0,...r??{}});if(!s)return;const n=[];for(const i of s){const o=i.data();if(!o){if(r!=null&&r.dontWaitAllData)continue;return}n.push({id:i.id,spec:i.spec,data:o})}return n}}function UI(e,t){if(e===void 0)return t===void 0;if(t===void 0)return!0;for(const r in t)if(e[r]!==t[r])return!1;return!0}function ZQ(e){return K6(e,t=>t instanceof td?t.handle:U6(t)?C5t(t,r=>r.handle):t)}class h6t{constructor(){Vu(this,"ctx",Os())}calculateOptions(t){return this.ctx.calculateOptions(t)}getOptions(t,r){const s=typeof t=="function"?t:Dx(t),n=this.getSpecs().entries.filter(a=>s(a.obj));let i={},o=!1;return typeof r<"u"&&(typeof r=="function"?i=r:typeof r=="object"&&("includeNativeLabel"in r||"separator"in r||"addLabelAsSuffix"in r?i=r:(r=r,i=r.label??{},o=r.refsWithEnrichments??!1))),typeof i=="object"?Dre(n,a=>a.obj,i??{}).map(({value:{ref:a},label:l})=>({ref:QQ(a,o),label:l})):n.map(({ref:a,obj:l})=>({ref:QQ(a,o),label:i(l,a)}))}resolveAnchorCtx(t){if(t instanceof NQ)return t;const r={};for(const[s,n]of Object.entries(t))if(B5t(n)){const i=this.getPColumnSpecByRef(n);if(!i)return;r[s]=i}else r[s]=n;return new NQ(r)}getAnchoredPColumns(t,r,s){const n=this.resolveAnchorCtx(t);if(n)return new YQ().addColumnProvider(this).addAxisLabelProvider(this).getColumns(r,{...s,anchorCtx:n})}getCanonicalOptions(t,r,s){const n=this.resolveAnchorCtx(t);if(!n)return;const i=new YQ().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(r,{...s,anchorCtx:n});if(i)return i.map(o=>({value:o.id,label:o.label}))}getDataFromResultPool(){return this.getData()}getData(){const t=this.ctx.getDataFromResultPool();return{isComplete:t.isComplete,entries:t.entries.map(r=>({ref:r.ref,obj:{...r.obj,data:new td(r.obj.data,[r.ref.blockId,r.ref.name])}}))}}getDataWithErrorsFromResultPool(){return this.getDataWithErrors()}getDataWithErrors(){const t=this.ctx.getDataWithErrorsFromResultPool();return{isComplete:t.isComplete,entries:t.entries.map(r=>({ref:r.ref,obj:{...r.obj,data:L5t(r.obj.data,s=>new td(s,[r.ref.blockId,r.ref.name]))}}))}}getSpecsFromResultPool(){return this.getSpecs()}getSpecs(){return this.ctx.getSpecsFromResultPool()}getDataByRef(t){var r;if(typeof this.ctx.getDataFromResultPoolByRef>"u")return(r=this.getData().entries.find(n=>n.ref.blockId===t.blockId&&n.ref.name===t.name))==null?void 0:r.obj;const s=this.ctx.getDataFromResultPoolByRef(t.blockId,t.name);if(s)return K6(s,n=>new td(n,[t.blockId,t.name]))}getPColumnByRef(t){const r=this.getDataByRef(t);if(r)return M5t(r)}getPColumnSpecByRef(t){const r=this.getSpecByRef(t);if(r){if(!oA(r))throw new Error(`not a PColumn spec (kind = ${r.kind})`);return r}}getSpecByRef(t){return this.ctx.getSpecFromResultPoolByRef(t.blockId,t.name)}findDataWithCompatibleSpec(t){const r=[];e:for(const s of this.getData().entries){if(!oA(s.obj.spec))continue;const n=s.obj.spec;if(t.name===n.name&&t.valueType===n.valueType&&t.axesSpec.length===n.axesSpec.length&&UI(t.domain,n.domain)){for(let i=0;i<t.axesSpec.length;++i){const o=t.axesSpec[i],a=n.axesSpec[i];if(o.name!==a.name||o.type!==a.type||!UI(o.domain,a.domain))continue e}r.push(s.obj)}}return r}findLabels(t){const r=this.getData();for(const s of r.entries){if(!j6(s.obj))continue;const n=s.obj.spec;if(n.name==="pl7.app/label"&&n.axesSpec.length===1&&n.axesSpec[0].name===t.name&&n.axesSpec[0].type===t.type&&UI(t.domain,n.axesSpec[0].domain)){if(s.obj.data.resourceType.name!=="PColumnData/Json")throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);return Object.fromEntries(Object.entries(s.obj.data.getDataAsJson().data).map(i=>[JSON.parse(i[0])[0],i[1]]))}}}selectColumns(t){const r=typeof t=="function"?t:Dx(t);return this.getSpecs().entries.filter(({obj:s})=>oA(s)?r(s):!1).map(({ref:s,obj:n})=>{const i=n;let o=null;const a=this;return{id:vy(s),spec:i,get data(){var l;return o!==null||(o=(l=a.getPColumnByRef(s))==null?void 0:l.data),o}}})}findLabelsForColumnAxis(t,r){var s;const n=this.findLabels(t.axesSpec[r]);if(!n)return;const i=(s=t.annotations)==null?void 0:s["pl7.app/axisKeys/"+r];if(i!==void 0){const o=JSON.parse(i);return Object.fromEntries(o.map(a=>[a,n[a]??"Unlabelled"]))}else return n}}class s2{constructor(){Vu(this,"ctx"),Vu(this,"args"),Vu(this,"uiState"),Vu(this,"_activeArgsCache"),Vu(this,"resultPool",new h6t),this.ctx=Os(),this.args=JSON.parse(this.ctx.args),this.uiState=this.ctx.uiState!==void 0?JSON.parse(this.ctx.uiState):{}}get activeArgs(){return this._activeArgsCache===void 0&&(this._activeArgsCache={v:this.ctx.activeArgs?JSON.parse(this.ctx.activeArgs):void 0}),this._activeArgsCache.v}getNamedAccessor(t){return g7(this.ctx.getAccessorHandleByName(t),r=>new td(r,[t]))}get prerun(){return this.getNamedAccessor(Y5t)}get outputs(){return this.getNamedAccessor(Z5t)}findLabels(t){return this.resultPool.findLabels(t)}verifyInlineAndExplicitColumnsSupport(t){var r;const s=t.some(i=>!(i.data instanceof td)||U6(i.data)),n=((r=this.ctx.featureFlags)==null?void 0:r.inlineColumnsSupport)===!0;if(s&&!n)throw Error("Inline or explicit columns not supported")}createPFrame(t){return this.verifyInlineAndExplicitColumnsSupport(t),this.ctx.createPFrame(t.map(r=>ZQ(r)))}createPTable(t){let r;return"columns"in t?r={src:{type:"full",entries:t.columns.map(s=>({type:"column",column:s}))},filters:t.filters??[],sorting:t.sorting??[]}:r=t,this.verifyInlineAndExplicitColumnsSupport(I5t(r.src)),this.ctx.createPTable(F5t(r,s=>ZQ(s)))}getBlockLabel(t){return this.ctx.getBlockLabel(t)}getCurrentUnstableMarker(){return this.ctx.getCurrentUnstableMarker()}}const WI="1.31.16";function p6t(e){return e.__renderLambda===!0}function jI(e){if(e!==void 0)return p6t(e)?e.handle:e}class $a{constructor(t,r,s,n,i,o,a,l){this._renderingMode=t,this._initialArgs=r,this._initialUiState=s,this._outputs=n,this._inputsValid=i,this._sections=o,this._title=a,this._enrichmentTargets=l}static create(t="Heavy"){return new $a(t,void 0,{},{},zI(!0),zI([]),void 0,void 0)}output(t,r,s={}){if(typeof r=="function"){const n=`output#${t}`;return c1(n,()=>r(new s2)),new $a(this._renderingMode,this._initialArgs,this._initialUiState,{...this._outputs,[t]:{__renderLambda:!0,handle:n,...s}},this._inputsValid,this._sections,this._title,this._enrichmentTargets)}else return new $a(this._renderingMode,this._initialArgs,this._initialUiState,{...this._outputs,[t]:r},this._inputsValid,this._sections,this._title,this._enrichmentTargets)}retentiveOutput(t,r){return this.output(t,r,{retentive:!0})}argsValid(t){return typeof t=="function"?(c1("inputsValid",()=>t(new s2)),new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,{__renderLambda:!0,handle:"inputsValid"},this._sections,this._title,this._enrichmentTargets)):new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,t,this._sections,this._title,this._enrichmentTargets)}sections(t){return Array.isArray(t)?this.sections(zI(t)):typeof t=="function"?(c1("sections",()=>t(new s2)),new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,{__renderLambda:!0,handle:"sections"},this._title,this._enrichmentTargets)):new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,t,this._title,this._enrichmentTargets)}title(t){return c1("title",()=>t(new s2)),new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,this._sections,{__renderLambda:!0,handle:"title"},this._enrichmentTargets)}initialArgs(t){return new $a(this._renderingMode,t,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets)}withArgs(t){return new $a(this._renderingMode,t,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets)}withUiState(t){return new $a(this._renderingMode,this._initialArgs,t,this._outputs,this._inputsValid,this._sections,this._title,this._enrichmentTargets)}enriches(t){return c1("enrichmentTargets",t),new $a(this._renderingMode,this._initialArgs,this._initialUiState,this._outputs,this._inputsValid,this._sections,this._title,{__renderLambda:!0,handle:"enrichmentTargets"})}done(){if(this._initialArgs===void 0)throw new Error("Initial arguments not set.");const t={v3:{sdkVersion:WI,renderingMode:this._renderingMode,initialArgs:this._initialArgs,initialUiState:this._initialUiState,inputsValid:this._inputsValid,sections:this._sections,title:this._title,outputs:this._outputs,enrichmentTargets:this._enrichmentTargets},sdkVersion:WI,renderingMode:this._renderingMode,initialArgs:this._initialArgs,inputsValid:jI(this._inputsValid),sections:jI(this._sections),outputs:Object.fromEntries(Object.entries(this._outputs).map(([r,s])=>[r,jI(s)]))};return U5t()?W5t({sdkVersion:WI}):{config:t}}}var g6t=$a.create().withArgs({productKey:"MIFAKEMIFAKEMIFAKE",inputHandles:[],shouldAddRunPerFile:!1,__mnzDate:new Date().toISOString(),__mnzCanRun:!1}).argsValid(e=>e.args.__mnzCanRun).output("__mnzInfo",e=>{var t,r;return(r=(t=e.prerun)==null?void 0:t.resolve("info"))==null?void 0:r.getDataAsJson()}).output("token",e=>{var t,r;return(r=(t=e.outputs)==null?void 0:t.resolve("token"))==null?void 0:r.getDataAsString()}).output("progresses",e=>{var s;const t=(s=e.prerun)==null?void 0:s.resolve("progresses"),r=t==null?void 0:t.mapFields((n,i)=>[n,i==null?void 0:i.getImportProgress()]);return Object.fromEntries(r??[])}).output("mainProgresses",e=>{var s;const t=(s=e.outputs)==null?void 0:s.resolve("progresses"),r=t==null?void 0:t.mapFields((n,i)=>[n,i==null?void 0:i.getImportProgress()]);return Object.fromEntries(r??[])}).sections(e=>[{type:"link",href:"/",label:"Main"}]).done();const f6t="MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECGShTw8Plag1uMuCg9OMYVHCF+wzjvXKr3cihyO77jEe9CrF6RP9tfnCd2XjM7XqQ0QH3i41rz5ohCB9fDDBbQ==",A6t=Tr({__name:"MainPage",setup(e){const t=m6t(),r=[{text:"sha256",value:"sha256"},{text:"lines (only in .zip files)",value:"lines"},{text:"size",value:"size"}],s=oi({isMultiDialogFileOpen:!1}),n=(c,u)=>{c?t.model.args.inputHandles[u].handle=c:t.model.args.inputHandles.splice(u,1)},i=c=>{t.model.args.inputHandles=c.files.map((u,d)=>({handle:u,fileName:`test${d}.txt`,argName:`arg_${d}`,options:["size","sha256"]}))},o=Je({get:()=>{var d;const u=(((d=t.model.outputs.token)==null?void 0:d.split("."))??[])[1];return JSON.parse(atob(u))},set:()=>{}}),a=br("");async function l(c){const u=await crypto.subtle.importKey("spki",Uint8Array.from(atob(f6t),v=>v.charCodeAt(0)).buffer,{name:"ECDSA",namedCurve:"P-256"},!0,["verify"]),[d,g,A]=c.split(".");if(!d||typeof g!="string"||typeof A!="string")throw new Error("Invalid token body");const w=Uint8Array.from(atob(A.replace(/-/g,"+").replace(/_/g,"/")),v=>v.charCodeAt(0));try{await crypto.subtle.verify({name:"ECDSA",hash:{name:"SHA-256"}},u,w,new TextEncoder().encode(`${d}.${g}`))?a.value="Signature is correct":a.value="Signature is incorrect"}catch{a.value="Verification failed"}}return(c,u)=>(ye(),jt(Pe(sMe),null,{title:er(()=>u[5]||(u[5]=[Ne(" Monetization example ")])),default:er(()=>[zt(Pe(d4),{modelValue:Pe(t).model.args.productKey,"onUpdate:modelValue":u[0]||(u[0]=d=>Pe(t).model.args.productKey=d),label:"Enter product key (keep MIFAKEMIFAKEMIFAKE for fake product)",clearable:""},null,8,["modelValue"]),zt(Pe(vIe),{modelValue:Pe(t).model.args.shouldAddRunPerFile,"onUpdate:modelValue":u[1]||(u[1]=d=>Pe(t).model.args.shouldAddRunPerFile=d)},{default:er(()=>u[6]||(u[6]=[Ne(" Add run per file ")])),_:1},8,["modelValue"]),zt(Pe(WG),{width:"400px"},{default:er(()=>[zt(Pe(kF),{onClick:u[2]||(u[2]=d=>s.isMultiDialogFileOpen=!0)},{default:er(()=>u[7]||(u[7]=[Ne(" Open multiple files to monetize ")])),_:1})]),_:1}),(ye(!0),je(_s,null,Fh(Pe(t).model.args.inputHandles,({handle:d},g)=>(ye(),jt(Pe(oMe),{key:g},{default:er(()=>[zt(Pe(d4),{modelValue:Pe(t).model.args.inputHandles[g].fileName,"onUpdate:modelValue":A=>Pe(t).model.args.inputHandles[g].fileName=A,label:"Type file name"},null,8,["modelValue","onUpdate:modelValue"]),zt(Pe(d4),{modelValue:Pe(t).model.args.inputHandles[g].argName,"onUpdate:modelValue":A=>Pe(t).model.args.inputHandles[g].argName=A,label:"Type argument name"},null,8,["modelValue","onUpdate:modelValue"]),zt(Pe(jBe),{"model-value":d,"onUpdate:modelValue":A=>n(A,g)},null,8,["model-value","onUpdate:modelValue"]),zt(Pe(AIe),{label:"Metrics to monetize",modelValue:Pe(t).model.args.inputHandles[g].options,"onUpdate:modelValue":A=>Pe(t).model.args.inputHandles[g].options=A,options:r},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024))),128)),zt(Pe(H$),{modelValue:s.isMultiDialogFileOpen,"onUpdate:modelValue":u[3]||(u[3]=d=>s.isMultiDialogFileOpen=d),multi:"","onImport:files":i},null,8,["modelValue"]),zt(Pe(WG)),We("pre",null," "+Zt(Pe(t).model.outputs.__mnzInfo)+" ",1),Pe(t).model.outputs.token?(ye(),jt(Pe(b2),{key:0,label:"token"},{default:er(()=>[Ne(Zt(Pe(t).model.outputs.token),1)]),_:1})):yt("",!0),Pe(t).model.outputs.token?(ye(),jt(Pe(kF),{key:1,onClick:u[4]||(u[4]=d=>l(Pe(t).model.outputs.token))},{default:er(()=>u[8]||(u[8]=[Ne(" Verify")])),_:1})):yt("",!0),a.value?(ye(),jt(Pe(b2),{key:2,label:"token verification"},{default:er(()=>[Ne(Zt(a.value),1)]),_:1})):yt("",!0),Pe(t).model.outputs.token?(ye(),jt(Pe(b2),{key:3,label:"trying to parse a token"},{default:er(()=>[We("pre",null," "+Zt(JSON.stringify(o.value,null,2))+" ",1)]),_:1})):yt("",!0)]),_:1}))}}),Ire=PDe(g6t,()=>({routes:{"/":()=>A6t}})),m6t=Ire.useApp;kae(N8e).use(Ire).mount("#app");
13656
+ //# sourceMappingURL=index-DIDj0XXi.js.map